@tanstack/react-table 8.0.0-alpha.82 → 8.0.0-alpha.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/react-table/src/index.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +62 -49
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +62 -49
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +17 -17
- package/build/types/index.d.ts +2 -2
- package/build/umd/index.development.js +62 -49
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/index.tsx +3 -5
package/build/stats-html.html
CHANGED
|
@@ -2669,7 +2669,7 @@ var drawChart = (function (exports) {
|
|
|
2669
2669
|
</script>
|
|
2670
2670
|
<script>
|
|
2671
2671
|
/*<!--*/
|
|
2672
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"
|
|
2672
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"0e3b-127"},{"name":"react-table/src/index.tsx","uid":"0e3b-129"}]}]}],"isRoot":true},"nodeParts":{"0e3b-127":{"renderedLength":141152,"gzipLength":24072,"brotliLength":0,"mainUid":"0e3b-126"},"0e3b-129":{"renderedLength":2102,"gzipLength":836,"brotliLength":0,"mainUid":"0e3b-128"}},"nodeMetas":{"0e3b-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"0e3b-127"},"imported":[],"importedBy":[{"uid":"0e3b-128"}]},"0e3b-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"0e3b-129"},"imported":[{"uid":"0e3b-130"},{"uid":"0e3b-126"}],"importedBy":[],"isEntry":true},"0e3b-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"0e3b-128"}],"isExternal":true}},"env":{"rollup":"2.70.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
2673
2673
|
|
|
2674
2674
|
const run = () => {
|
|
2675
2675
|
const width = window.innerWidth;
|
package/build/stats-react.json
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "table-core/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "0e3b-132"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "react-table/src/index.tsx",
|
|
18
|
-
"uid": "
|
|
18
|
+
"uid": "0e3b-134"
|
|
19
19
|
}
|
|
20
20
|
]
|
|
21
21
|
}
|
|
@@ -25,55 +25,55 @@
|
|
|
25
25
|
"isRoot": true
|
|
26
26
|
},
|
|
27
27
|
"nodeParts": {
|
|
28
|
-
"
|
|
29
|
-
"renderedLength":
|
|
30
|
-
"gzipLength":
|
|
28
|
+
"0e3b-132": {
|
|
29
|
+
"renderedLength": 141152,
|
|
30
|
+
"gzipLength": 24072,
|
|
31
31
|
"brotliLength": 0,
|
|
32
|
-
"mainUid": "
|
|
32
|
+
"mainUid": "0e3b-131"
|
|
33
33
|
},
|
|
34
|
-
"
|
|
34
|
+
"0e3b-134": {
|
|
35
35
|
"renderedLength": 2102,
|
|
36
36
|
"gzipLength": 836,
|
|
37
37
|
"brotliLength": 0,
|
|
38
|
-
"mainUid": "
|
|
38
|
+
"mainUid": "0e3b-133"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"nodeMetas": {
|
|
42
|
-
"
|
|
42
|
+
"0e3b-131": {
|
|
43
43
|
"id": "/packages/table-core/build/esm/index.js",
|
|
44
44
|
"moduleParts": {
|
|
45
|
-
"index.production.js": "
|
|
45
|
+
"index.production.js": "0e3b-132"
|
|
46
46
|
},
|
|
47
47
|
"imported": [],
|
|
48
48
|
"importedBy": [
|
|
49
49
|
{
|
|
50
|
-
"uid": "
|
|
50
|
+
"uid": "0e3b-133"
|
|
51
51
|
}
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
|
-
"
|
|
54
|
+
"0e3b-133": {
|
|
55
55
|
"id": "/packages/react-table/src/index.tsx",
|
|
56
56
|
"moduleParts": {
|
|
57
|
-
"index.production.js": "
|
|
57
|
+
"index.production.js": "0e3b-134"
|
|
58
58
|
},
|
|
59
59
|
"imported": [
|
|
60
60
|
{
|
|
61
|
-
"uid": "
|
|
61
|
+
"uid": "0e3b-135"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
"uid": "
|
|
64
|
+
"uid": "0e3b-131"
|
|
65
65
|
}
|
|
66
66
|
],
|
|
67
67
|
"importedBy": [],
|
|
68
68
|
"isEntry": true
|
|
69
69
|
},
|
|
70
|
-
"
|
|
70
|
+
"0e3b-135": {
|
|
71
71
|
"id": "react",
|
|
72
72
|
"moduleParts": {},
|
|
73
73
|
"imported": [],
|
|
74
74
|
"importedBy": [
|
|
75
75
|
{
|
|
76
|
-
"uid": "
|
|
76
|
+
"uid": "0e3b-133"
|
|
77
77
|
}
|
|
78
78
|
],
|
|
79
79
|
"isExternal": true
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export * from '@tanstack/table-core';
|
|
3
|
-
import { TableOptions, TableInstance, Table, TableGenerics, Overwrite
|
|
3
|
+
import { TableOptions, TableInstance, Table, TableGenerics, Overwrite } from '@tanstack/table-core';
|
|
4
4
|
export declare type Renderable<TProps> = React.ReactNode | React.FunctionComponent<TProps> | React.Component<TProps>;
|
|
5
5
|
export declare type Render = <TProps extends {}>(Comp: Renderable<TProps>, props: TProps) => React.ReactNode | JSX.Element;
|
|
6
6
|
export declare type ReactTableGenerics = Overwrite<TableGenerics, {
|
|
@@ -12,5 +12,5 @@ export declare const createTable: () => Table<{
|
|
|
12
12
|
Renderer: Render;
|
|
13
13
|
Rendered: React.ReactNode | JSX.Element;
|
|
14
14
|
}>;
|
|
15
|
-
export declare type UseTableInstanceOptions<TGenerics extends ReactTableGenerics> =
|
|
15
|
+
export declare type UseTableInstanceOptions<TGenerics extends ReactTableGenerics> = TableOptions<TGenerics>;
|
|
16
16
|
export declare function useTableInstance<TGenerics extends ReactTableGenerics>(table: Table<TGenerics>, options: UseTableInstanceOptions<TGenerics>): TableInstance<TGenerics>;
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
const Columns = {
|
|
126
126
|
createInstance: instance => {
|
|
127
127
|
return {
|
|
128
|
-
|
|
128
|
+
getDefaultColumnDef: memo(() => [instance.options.defaultColumnDef], defaultColumn => {
|
|
129
129
|
var _defaultColumn;
|
|
130
130
|
|
|
131
131
|
defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
return (_props$getValue$toStr = (_props$getValue$toStr2 = (_props$getValue = props.getValue()).toString) == null ? void 0 : _props$getValue$toStr2.call(_props$getValue)) != null ? _props$getValue$toStr : null;
|
|
139
139
|
},
|
|
140
140
|
...instance._features.reduce((obj, feature) => {
|
|
141
|
-
return Object.assign(obj, feature.
|
|
141
|
+
return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
|
|
142
142
|
}, {}),
|
|
143
143
|
...defaultColumn
|
|
144
144
|
};
|
|
@@ -148,13 +148,16 @@
|
|
|
148
148
|
|
|
149
149
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
|
|
150
150
|
},
|
|
151
|
-
key: '
|
|
151
|
+
key: 'getDefaultColumnDef'
|
|
152
152
|
}),
|
|
153
153
|
getColumnDefs: () => instance.options.columns,
|
|
154
154
|
createColumn: (columnDef, depth, parent) => {
|
|
155
155
|
var _ref, _columnDef$id;
|
|
156
156
|
|
|
157
|
-
const
|
|
157
|
+
const defaultColumnDef = instance.getDefaultColumnDef();
|
|
158
|
+
columnDef = { ...defaultColumnDef,
|
|
159
|
+
...columnDef
|
|
160
|
+
};
|
|
158
161
|
let id = (_ref = (_columnDef$id = columnDef.id) != null ? _columnDef$id : columnDef.accessorKey) != null ? _ref : typeof columnDef.header === 'string' ? columnDef.header : undefined;
|
|
159
162
|
let accessorFn;
|
|
160
163
|
|
|
@@ -170,8 +173,7 @@
|
|
|
170
173
|
}
|
|
171
174
|
}
|
|
172
175
|
|
|
173
|
-
let column = { ...
|
|
174
|
-
...columnDef,
|
|
176
|
+
let column = { ...columnDef,
|
|
175
177
|
id: "" + id,
|
|
176
178
|
accessorFn,
|
|
177
179
|
parent: parent,
|
|
@@ -405,7 +407,7 @@
|
|
|
405
407
|
row,
|
|
406
408
|
column,
|
|
407
409
|
getValue: () => row.getValue(columnId),
|
|
408
|
-
renderCell: () => column.cell ? instance._render(column.cell, {
|
|
410
|
+
renderCell: () => column.columnDef.cell ? instance._render(column.columnDef.cell, {
|
|
409
411
|
instance,
|
|
410
412
|
column,
|
|
411
413
|
row,
|
|
@@ -460,7 +462,7 @@
|
|
|
460
462
|
});
|
|
461
463
|
|
|
462
464
|
const ColumnSizing = {
|
|
463
|
-
|
|
465
|
+
getDefaultColumnDef: () => {
|
|
464
466
|
return defaultColumnSizing;
|
|
465
467
|
},
|
|
466
468
|
getInitialState: state => {
|
|
@@ -480,10 +482,10 @@
|
|
|
480
482
|
createColumn: (column, instance) => {
|
|
481
483
|
return {
|
|
482
484
|
getSize: () => {
|
|
483
|
-
var _column$
|
|
485
|
+
var _column$columnDef$min, _ref, _column$columnDef$max;
|
|
484
486
|
|
|
485
487
|
const columnSize = instance.getState().columnSizing[column.id];
|
|
486
|
-
return Math.min(Math.max((_column$
|
|
488
|
+
return Math.min(Math.max((_column$columnDef$min = column.columnDef.minSize) != null ? _column$columnDef$min : defaultColumnSizing.minSize, (_ref = columnSize != null ? columnSize : column.columnDef.size) != null ? _ref : defaultColumnSizing.size), (_column$columnDef$max = column.columnDef.maxSize) != null ? _column$columnDef$max : defaultColumnSizing.maxSize);
|
|
487
489
|
},
|
|
488
490
|
getStart: position => {
|
|
489
491
|
const columns = !position ? instance.getVisibleLeafColumns() : position === 'left' ? instance.getLeftVisibleLeafColumns() : instance.getRightVisibleLeafColumns();
|
|
@@ -506,9 +508,9 @@
|
|
|
506
508
|
});
|
|
507
509
|
},
|
|
508
510
|
getCanResize: () => {
|
|
509
|
-
var _column$
|
|
511
|
+
var _column$columnDef$ena, _instance$options$ena;
|
|
510
512
|
|
|
511
|
-
return ((_column$
|
|
513
|
+
return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableColumnResizing) != null ? _instance$options$ena : true);
|
|
512
514
|
},
|
|
513
515
|
getIsResizing: () => {
|
|
514
516
|
return instance.getState().columnSizingInfo.isResizingColumn === column.id;
|
|
@@ -965,7 +967,7 @@
|
|
|
965
967
|
|
|
966
968
|
//
|
|
967
969
|
const Filters = {
|
|
968
|
-
|
|
970
|
+
getDefaultColumnDef: () => {
|
|
969
971
|
return {
|
|
970
972
|
filterFn: 'auto'
|
|
971
973
|
};
|
|
@@ -1008,6 +1010,10 @@
|
|
|
1008
1010
|
return filterFns.inNumberRange;
|
|
1009
1011
|
}
|
|
1010
1012
|
|
|
1013
|
+
if (typeof value === 'boolean') {
|
|
1014
|
+
return filterFns.equals;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1011
1017
|
if (value !== null && typeof value === 'object') {
|
|
1012
1018
|
return filterFns.equals;
|
|
1013
1019
|
}
|
|
@@ -1025,14 +1031,14 @@
|
|
|
1025
1031
|
return isFunction(column.filterFn) ? column.filterFn : column.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.filterFn]) != null ? _ref : filterFns[column.filterFn];
|
|
1026
1032
|
},
|
|
1027
1033
|
getCanFilter: () => {
|
|
1028
|
-
var _column$
|
|
1034
|
+
var _column$columnDef$ena, _instance$options$ena, _instance$options$ena2;
|
|
1029
1035
|
|
|
1030
|
-
return ((_column$
|
|
1036
|
+
return ((_column$columnDef$ena = column.columnDef.enableColumnFilter) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableColumnFilters) != null ? _instance$options$ena : true) && ((_instance$options$ena2 = instance.options.enableFilters) != null ? _instance$options$ena2 : true) && !!column.accessorFn;
|
|
1031
1037
|
},
|
|
1032
1038
|
getCanGlobalFilter: () => {
|
|
1033
|
-
var _column$
|
|
1039
|
+
var _column$columnDef$ena2, _instance$options$ena3, _instance$options$ena4, _instance$options$get;
|
|
1034
1040
|
|
|
1035
|
-
return ((_column$
|
|
1041
|
+
return ((_column$columnDef$ena2 = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena2 : true) && ((_instance$options$ena3 = instance.options.enableGlobalFilter) != null ? _instance$options$ena3 : true) && ((_instance$options$ena4 = instance.options.enableFilters) != null ? _instance$options$ena4 : true) && ((_instance$options$get = instance.options.getColumnCanGlobalFilter == null ? void 0 : instance.options.getColumnCanGlobalFilter(column)) != null ? _instance$options$get : true) && !!column.accessorFn;
|
|
1036
1042
|
},
|
|
1037
1043
|
getIsFiltered: () => column.getFilterIndex() > -1,
|
|
1038
1044
|
getFilterValue: () => {
|
|
@@ -1310,7 +1316,7 @@
|
|
|
1310
1316
|
|
|
1311
1317
|
//
|
|
1312
1318
|
const Grouping = {
|
|
1313
|
-
|
|
1319
|
+
getDefaultColumnDef: () => {
|
|
1314
1320
|
return {
|
|
1315
1321
|
aggregationFn: 'auto'
|
|
1316
1322
|
};
|
|
@@ -1340,9 +1346,9 @@
|
|
|
1340
1346
|
});
|
|
1341
1347
|
},
|
|
1342
1348
|
getCanGroup: () => {
|
|
1343
|
-
var _ref, _ref2, _ref3, _column$
|
|
1349
|
+
var _ref, _ref2, _ref3, _column$columnDef$ena;
|
|
1344
1350
|
|
|
1345
|
-
return (_ref = (_ref2 = (_ref3 = (_column$
|
|
1351
|
+
return (_ref = (_ref2 = (_ref3 = (_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) != null ? _ref3 : instance.options.enableGrouping) != null ? _ref2 : true) != null ? _ref : !!column.accessorFn;
|
|
1346
1352
|
},
|
|
1347
1353
|
getIsGrouped: () => {
|
|
1348
1354
|
var _instance$getState$gr;
|
|
@@ -1426,9 +1432,9 @@
|
|
|
1426
1432
|
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && ((_row$subRows = row.subRows) == null ? void 0 : _row$subRows.length) > 1;
|
|
1427
1433
|
},
|
|
1428
1434
|
renderAggregatedCell: () => {
|
|
1429
|
-
var _column$
|
|
1435
|
+
var _column$columnDef$agg;
|
|
1430
1436
|
|
|
1431
|
-
const template = (_column$
|
|
1437
|
+
const template = (_column$columnDef$agg = column.columnDef.aggregatedCell) != null ? _column$columnDef$agg : column.columnDef.cell;
|
|
1432
1438
|
return template ? instance._render(template, {
|
|
1433
1439
|
instance,
|
|
1434
1440
|
column,
|
|
@@ -1735,9 +1741,9 @@
|
|
|
1735
1741
|
getCanPin: () => {
|
|
1736
1742
|
const leafColumns = column.getLeafColumns();
|
|
1737
1743
|
return leafColumns.some(d => {
|
|
1738
|
-
var _d$
|
|
1744
|
+
var _d$columnDef$enablePi, _instance$options$ena;
|
|
1739
1745
|
|
|
1740
|
-
return ((_d$
|
|
1746
|
+
return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_instance$options$ena = instance.options.enablePinning) != null ? _instance$options$ena : true);
|
|
1741
1747
|
});
|
|
1742
1748
|
},
|
|
1743
1749
|
getIsPinned: () => {
|
|
@@ -1807,12 +1813,18 @@
|
|
|
1807
1813
|
|
|
1808
1814
|
return instance.setColumnPinning(defaultState ? getDefaultPinningState() : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnPinning) != null ? _instance$initialStat : getDefaultPinningState());
|
|
1809
1815
|
},
|
|
1810
|
-
getIsSomeColumnsPinned:
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
+
getIsSomeColumnsPinned: position => {
|
|
1817
|
+
var _pinningState$positio;
|
|
1818
|
+
|
|
1819
|
+
const pinningState = instance.getState().columnPinning;
|
|
1820
|
+
|
|
1821
|
+
if (!position) {
|
|
1822
|
+
var _pinningState$left, _pinningState$right;
|
|
1823
|
+
|
|
1824
|
+
return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
|
|
1816
1828
|
},
|
|
1817
1829
|
getLeftLeafColumns: memo(() => [instance.getAllLeafColumns(), instance.getState().columnPinning.left], (allColumns, left) => {
|
|
1818
1830
|
return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
@@ -2338,7 +2350,7 @@
|
|
|
2338
2350
|
...state
|
|
2339
2351
|
};
|
|
2340
2352
|
},
|
|
2341
|
-
|
|
2353
|
+
getDefaultColumnDef: () => {
|
|
2342
2354
|
return {
|
|
2343
2355
|
sortingFn: 'auto'
|
|
2344
2356
|
};
|
|
@@ -2398,7 +2410,7 @@
|
|
|
2398
2410
|
throw new Error();
|
|
2399
2411
|
}
|
|
2400
2412
|
|
|
2401
|
-
return isFunction(column.sortingFn) ? column.sortingFn : column.sortingFn === 'auto' ? column.getAutoSortingFn() : (_ref = userSortingFn == null ? void 0 : userSortingFn[column.sortingFn]) != null ? _ref : sortingFns[column.sortingFn];
|
|
2413
|
+
return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : (_ref = userSortingFn == null ? void 0 : userSortingFn[column.columnDef.sortingFn]) != null ? _ref : sortingFns[column.columnDef.sortingFn];
|
|
2402
2414
|
},
|
|
2403
2415
|
toggleSorting: (desc, multi) => {
|
|
2404
2416
|
// if (column.columns.length) {
|
|
@@ -2410,7 +2422,7 @@
|
|
|
2410
2422
|
// return
|
|
2411
2423
|
// }
|
|
2412
2424
|
instance.setSorting(old => {
|
|
2413
|
-
var _ref2, _column$
|
|
2425
|
+
var _ref2, _column$columnDef$sor, _instance$options$ena, _instance$options$ena2;
|
|
2414
2426
|
|
|
2415
2427
|
// Find any existing sorting for this column
|
|
2416
2428
|
const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
|
|
@@ -2437,7 +2449,7 @@
|
|
|
2437
2449
|
}
|
|
2438
2450
|
}
|
|
2439
2451
|
|
|
2440
|
-
const sortDescFirst = (_ref2 = (_column$
|
|
2452
|
+
const sortDescFirst = (_ref2 = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc'; // Handle toggle states that will remove the sorting
|
|
2441
2453
|
|
|
2442
2454
|
if (sortAction === 'toggle' && ( // Must be toggling
|
|
2443
2455
|
(_instance$options$ena = instance.options.enableSortingRemoval) != null ? _instance$options$ena : true) && // If enableSortRemove, enable in general
|
|
@@ -2481,14 +2493,14 @@
|
|
|
2481
2493
|
});
|
|
2482
2494
|
},
|
|
2483
2495
|
getCanSort: () => {
|
|
2484
|
-
var _column$
|
|
2496
|
+
var _column$columnDef$ena, _instance$options$ena3;
|
|
2485
2497
|
|
|
2486
|
-
return ((_column$
|
|
2498
|
+
return ((_column$columnDef$ena = column.columnDef.enableSorting) != null ? _column$columnDef$ena : true) && ((_instance$options$ena3 = instance.options.enableSorting) != null ? _instance$options$ena3 : true) && !!column.accessorFn;
|
|
2487
2499
|
},
|
|
2488
2500
|
getCanMultiSort: () => {
|
|
2489
|
-
var _ref3, _column$
|
|
2501
|
+
var _ref3, _column$columnDef$ena2;
|
|
2490
2502
|
|
|
2491
|
-
return (_ref3 = (_column$
|
|
2503
|
+
return (_ref3 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : instance.options.enableMultiSort) != null ? _ref3 : !!column.accessorFn;
|
|
2492
2504
|
},
|
|
2493
2505
|
getIsSorted: () => {
|
|
2494
2506
|
var _instance$getState$so;
|
|
@@ -2552,7 +2564,7 @@
|
|
|
2552
2564
|
onColumnVisibilityChange: makeStateUpdater('columnVisibility', instance)
|
|
2553
2565
|
};
|
|
2554
2566
|
},
|
|
2555
|
-
|
|
2567
|
+
getDefaultColumnDef: () => {
|
|
2556
2568
|
return {
|
|
2557
2569
|
defaultIsVisible: true
|
|
2558
2570
|
};
|
|
@@ -2572,9 +2584,9 @@
|
|
|
2572
2584
|
return (_instance$getState$co = (_instance$getState$co2 = instance.getState().columnVisibility) == null ? void 0 : _instance$getState$co2[column.id]) != null ? _instance$getState$co : true;
|
|
2573
2585
|
},
|
|
2574
2586
|
getCanHide: () => {
|
|
2575
|
-
var _column$
|
|
2587
|
+
var _column$columnDef$ena, _instance$options$ena;
|
|
2576
2588
|
|
|
2577
|
-
return ((_column$
|
|
2589
|
+
return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableHiding) != null ? _instance$options$ena : true);
|
|
2578
2590
|
},
|
|
2579
2591
|
getToggleVisibilityHandler: () => {
|
|
2580
2592
|
return e => {
|
|
@@ -2685,12 +2697,12 @@
|
|
|
2685
2697
|
recurseHeader(header);
|
|
2686
2698
|
return leafHeaders;
|
|
2687
2699
|
},
|
|
2688
|
-
renderHeader: () => column.header ? instance._render(column.header, {
|
|
2700
|
+
renderHeader: () => column.columnDef.header ? instance._render(column.columnDef.header, {
|
|
2689
2701
|
instance,
|
|
2690
2702
|
header: header,
|
|
2691
2703
|
column
|
|
2692
2704
|
}) : null,
|
|
2693
|
-
renderFooter: () => column.footer ? instance._render(column.footer, {
|
|
2705
|
+
renderFooter: () => column.columnDef.footer ? instance._render(column.columnDef.footer, {
|
|
2694
2706
|
instance,
|
|
2695
2707
|
header: header,
|
|
2696
2708
|
column
|
|
@@ -3198,7 +3210,7 @@
|
|
|
3198
3210
|
throw new Error('');
|
|
3199
3211
|
})()
|
|
3200
3212
|
},
|
|
3201
|
-
setGenerics: () => table,
|
|
3213
|
+
// setGenerics: () => table as any,
|
|
3202
3214
|
setRowType: () => table,
|
|
3203
3215
|
setTableMetaType: () => table,
|
|
3204
3216
|
setColumnMetaType: () => table,
|
|
@@ -3234,7 +3246,8 @@
|
|
|
3234
3246
|
}
|
|
3235
3247
|
|
|
3236
3248
|
throw new Error('Invalid accessor');
|
|
3237
|
-
}
|
|
3249
|
+
},
|
|
3250
|
+
createOptions: options => options
|
|
3238
3251
|
};
|
|
3239
3252
|
return table;
|
|
3240
3253
|
}
|
|
@@ -3631,8 +3644,8 @@
|
|
|
3631
3644
|
availableSorting.forEach(sortEntry => {
|
|
3632
3645
|
const column = instance.getColumn(sortEntry.id);
|
|
3633
3646
|
columnInfoById[sortEntry.id] = {
|
|
3634
|
-
sortUndefined: column.sortUndefined,
|
|
3635
|
-
invertSorting: column.invertSorting,
|
|
3647
|
+
sortUndefined: column.columnDef.sortUndefined,
|
|
3648
|
+
invertSorting: column.columnDef.invertSorting,
|
|
3636
3649
|
sortingFn: column.getSortingFn()
|
|
3637
3650
|
};
|
|
3638
3651
|
});
|
|
@@ -3780,8 +3793,8 @@
|
|
|
3780
3793
|
row.groupingValuesCache[columnId] = aggregateFn(() => leafRows.map(row => {
|
|
3781
3794
|
let columnValue = row.getValue(columnId);
|
|
3782
3795
|
|
|
3783
|
-
if (!depth && column.aggregateValue) {
|
|
3784
|
-
columnValue = column.aggregateValue(columnValue);
|
|
3796
|
+
if (!depth && column.columnDef.aggregateValue) {
|
|
3797
|
+
columnValue = column.columnDef.aggregateValue(columnValue);
|
|
3785
3798
|
}
|
|
3786
3799
|
|
|
3787
3800
|
return columnValue;
|