UNPKG

732 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.getColumnKey = getColumnKey;
7exports.getColumnPos = getColumnPos;
8exports.renderColumnTitle = renderColumnTitle;
9
10function getColumnKey(column, defaultKey) {
11 if ('key' in column && column.key !== undefined && column.key !== null) {
12 return column.key;
13 }
14
15 if (column.dataIndex) {
16 return Array.isArray(column.dataIndex) ? column.dataIndex.join('.') : column.dataIndex;
17 }
18
19 return defaultKey;
20}
21
22function getColumnPos(index, pos) {
23 return pos ? "".concat(pos, "-").concat(index) : "".concat(index);
24}
25
26function renderColumnTitle(title, props) {
27 if (typeof title === 'function') {
28 return title(props);
29 }
30
31 return title;
32}
\No newline at end of file