1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.getColumnKey = getColumnKey;
|
7 | exports.getColumnPos = getColumnPos;
|
8 | exports.renderColumnTitle = renderColumnTitle;
|
9 |
|
10 | function 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 |
|
22 | function getColumnPos(index, pos) {
|
23 | return pos ? "".concat(pos, "-").concat(index) : "".concat(index);
|
24 | }
|
25 |
|
26 | function renderColumnTitle(title, props) {
|
27 | if (typeof title === 'function') {
|
28 | return title(props);
|
29 | }
|
30 |
|
31 | return title;
|
32 | } |
\ | No newline at end of file |