@tanstack/svelte-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/svelte-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 +38 -38
- 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.ts +4 -13
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-163"},{"name":"svelte-table/src","children":[{"uid":"0e3b-165","name":"placeholder.svelte"},{"uid":"0e3b-167","name":"render-component.ts"},{"uid":"0e3b-169","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"0e3b-163":{"renderedLength":141154,"gzipLength":24074,"brotliLength":0,"mainUid":"0e3b-162"},"0e3b-165":{"renderedLength":925,"gzipLength":444,"brotliLength":0,"mainUid":"0e3b-164"},"0e3b-167":{"renderedLength":1365,"gzipLength":519,"brotliLength":0,"mainUid":"0e3b-166"},"0e3b-169":{"renderedLength":2729,"gzipLength":868,"brotliLength":0,"mainUid":"0e3b-168"}},"nodeMetas":{"0e3b-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"0e3b-163"},"imported":[],"importedBy":[{"uid":"0e3b-168"}]},"0e3b-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"0e3b-165"},"imported":[{"uid":"0e3b-170"}],"importedBy":[{"uid":"0e3b-168"}]},"0e3b-166":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"0e3b-167"},"imported":[{"uid":"0e3b-170"}],"importedBy":[{"uid":"0e3b-168"}]},"0e3b-168":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"0e3b-169"},"imported":[{"uid":"0e3b-162"},{"uid":"0e3b-164"},{"uid":"0e3b-170"},{"uid":"0e3b-171"},{"uid":"0e3b-166"}],"importedBy":[],"isEntry":true},"0e3b-170":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"0e3b-168"},{"uid":"0e3b-164"},{"uid":"0e3b-166"}],"isExternal":true},"0e3b-171":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"0e3b-168"}],"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,21 +11,21 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "table-core/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "0e3b-173"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "svelte-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "0e3b-175",
|
|
21
21
|
"name": "placeholder.svelte"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "0e3b-177",
|
|
25
25
|
"name": "render-component.ts"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"uid": "
|
|
28
|
+
"uid": "0e3b-179",
|
|
29
29
|
"name": "index.ts"
|
|
30
30
|
}
|
|
31
31
|
]
|
|
@@ -38,125 +38,125 @@
|
|
|
38
38
|
"isRoot": true
|
|
39
39
|
},
|
|
40
40
|
"nodeParts": {
|
|
41
|
-
"
|
|
42
|
-
"renderedLength":
|
|
43
|
-
"gzipLength":
|
|
41
|
+
"0e3b-173": {
|
|
42
|
+
"renderedLength": 141154,
|
|
43
|
+
"gzipLength": 24074,
|
|
44
44
|
"brotliLength": 0,
|
|
45
|
-
"mainUid": "
|
|
45
|
+
"mainUid": "0e3b-172"
|
|
46
46
|
},
|
|
47
|
-
"
|
|
47
|
+
"0e3b-175": {
|
|
48
48
|
"renderedLength": 925,
|
|
49
49
|
"gzipLength": 444,
|
|
50
50
|
"brotliLength": 0,
|
|
51
|
-
"mainUid": "
|
|
51
|
+
"mainUid": "0e3b-174"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
53
|
+
"0e3b-177": {
|
|
54
54
|
"renderedLength": 1365,
|
|
55
55
|
"gzipLength": 519,
|
|
56
56
|
"brotliLength": 0,
|
|
57
|
-
"mainUid": "
|
|
57
|
+
"mainUid": "0e3b-176"
|
|
58
58
|
},
|
|
59
|
-
"
|
|
59
|
+
"0e3b-179": {
|
|
60
60
|
"renderedLength": 2729,
|
|
61
61
|
"gzipLength": 868,
|
|
62
62
|
"brotliLength": 0,
|
|
63
|
-
"mainUid": "
|
|
63
|
+
"mainUid": "0e3b-178"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"nodeMetas": {
|
|
67
|
-
"
|
|
67
|
+
"0e3b-172": {
|
|
68
68
|
"id": "/packages/table-core/build/esm/index.js",
|
|
69
69
|
"moduleParts": {
|
|
70
|
-
"index.production.js": "
|
|
70
|
+
"index.production.js": "0e3b-173"
|
|
71
71
|
},
|
|
72
72
|
"imported": [],
|
|
73
73
|
"importedBy": [
|
|
74
74
|
{
|
|
75
|
-
"uid": "
|
|
75
|
+
"uid": "0e3b-178"
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"0e3b-174": {
|
|
80
80
|
"id": "/packages/svelte-table/src/placeholder.svelte",
|
|
81
81
|
"moduleParts": {
|
|
82
|
-
"index.production.js": "
|
|
82
|
+
"index.production.js": "0e3b-175"
|
|
83
83
|
},
|
|
84
84
|
"imported": [
|
|
85
85
|
{
|
|
86
|
-
"uid": "
|
|
86
|
+
"uid": "0e3b-180"
|
|
87
87
|
}
|
|
88
88
|
],
|
|
89
89
|
"importedBy": [
|
|
90
90
|
{
|
|
91
|
-
"uid": "
|
|
91
|
+
"uid": "0e3b-178"
|
|
92
92
|
}
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"
|
|
95
|
+
"0e3b-176": {
|
|
96
96
|
"id": "/packages/svelte-table/src/render-component.ts",
|
|
97
97
|
"moduleParts": {
|
|
98
|
-
"index.production.js": "
|
|
98
|
+
"index.production.js": "0e3b-177"
|
|
99
99
|
},
|
|
100
100
|
"imported": [
|
|
101
101
|
{
|
|
102
|
-
"uid": "
|
|
102
|
+
"uid": "0e3b-180"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"importedBy": [
|
|
106
106
|
{
|
|
107
|
-
"uid": "
|
|
107
|
+
"uid": "0e3b-178"
|
|
108
108
|
}
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"0e3b-178": {
|
|
112
112
|
"id": "/packages/svelte-table/src/index.ts",
|
|
113
113
|
"moduleParts": {
|
|
114
|
-
"index.production.js": "
|
|
114
|
+
"index.production.js": "0e3b-179"
|
|
115
115
|
},
|
|
116
116
|
"imported": [
|
|
117
117
|
{
|
|
118
|
-
"uid": "
|
|
118
|
+
"uid": "0e3b-172"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
"uid": "
|
|
121
|
+
"uid": "0e3b-174"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
"uid": "
|
|
124
|
+
"uid": "0e3b-180"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
"uid": "
|
|
127
|
+
"uid": "0e3b-181"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
|
-
"uid": "
|
|
130
|
+
"uid": "0e3b-176"
|
|
131
131
|
}
|
|
132
132
|
],
|
|
133
133
|
"importedBy": [],
|
|
134
134
|
"isEntry": true
|
|
135
135
|
},
|
|
136
|
-
"
|
|
136
|
+
"0e3b-180": {
|
|
137
137
|
"id": "svelte/internal",
|
|
138
138
|
"moduleParts": {},
|
|
139
139
|
"imported": [],
|
|
140
140
|
"importedBy": [
|
|
141
141
|
{
|
|
142
|
-
"uid": "
|
|
142
|
+
"uid": "0e3b-178"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
|
-
"uid": "
|
|
145
|
+
"uid": "0e3b-174"
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
|
-
"uid": "
|
|
148
|
+
"uid": "0e3b-176"
|
|
149
149
|
}
|
|
150
150
|
],
|
|
151
151
|
"isExternal": true
|
|
152
152
|
},
|
|
153
|
-
"
|
|
153
|
+
"0e3b-181": {
|
|
154
154
|
"id": "svelte/store",
|
|
155
155
|
"moduleParts": {},
|
|
156
156
|
"imported": [],
|
|
157
157
|
"importedBy": [
|
|
158
158
|
{
|
|
159
|
-
"uid": "
|
|
159
|
+
"uid": "0e3b-178"
|
|
160
160
|
}
|
|
161
161
|
],
|
|
162
162
|
"isExternal": true
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Table, TableGenerics, TableOptions } from '@tanstack/table-core';
|
|
2
2
|
import { Readable } from 'svelte/store';
|
|
3
3
|
export { renderComponent } from './render-component';
|
|
4
4
|
export * from '@tanstack/table-core';
|
|
@@ -8,4 +8,4 @@ export declare const createTable: () => Table<{
|
|
|
8
8
|
Rendered: any;
|
|
9
9
|
}>;
|
|
10
10
|
declare type ReadableOrVal<T> = T | Readable<T>;
|
|
11
|
-
export declare function createTableInstance<TGenerics extends TableGenerics>(table: Table<TGenerics>, options: ReadableOrVal<
|
|
11
|
+
export declare function createTableInstance<TGenerics extends TableGenerics>(table: Table<TGenerics>, options: ReadableOrVal<TableOptions<TGenerics>>): Readable<import("@tanstack/table-core").TableInstance<TGenerics>>;
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
const Columns = {
|
|
106
106
|
createInstance: instance => {
|
|
107
107
|
return {
|
|
108
|
-
|
|
108
|
+
getDefaultColumnDef: memo(() => [instance.options.defaultColumnDef], defaultColumn => {
|
|
109
109
|
var _defaultColumn;
|
|
110
110
|
|
|
111
111
|
defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
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;
|
|
119
119
|
},
|
|
120
120
|
...instance._features.reduce((obj, feature) => {
|
|
121
|
-
return Object.assign(obj, feature.
|
|
121
|
+
return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
|
|
122
122
|
}, {}),
|
|
123
123
|
...defaultColumn
|
|
124
124
|
};
|
|
@@ -128,13 +128,16 @@
|
|
|
128
128
|
|
|
129
129
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
|
|
130
130
|
},
|
|
131
|
-
key: '
|
|
131
|
+
key: 'getDefaultColumnDef'
|
|
132
132
|
}),
|
|
133
133
|
getColumnDefs: () => instance.options.columns,
|
|
134
134
|
createColumn: (columnDef, depth, parent) => {
|
|
135
135
|
var _ref, _columnDef$id;
|
|
136
136
|
|
|
137
|
-
const
|
|
137
|
+
const defaultColumnDef = instance.getDefaultColumnDef();
|
|
138
|
+
columnDef = { ...defaultColumnDef,
|
|
139
|
+
...columnDef
|
|
140
|
+
};
|
|
138
141
|
let id = (_ref = (_columnDef$id = columnDef.id) != null ? _columnDef$id : columnDef.accessorKey) != null ? _ref : typeof columnDef.header === 'string' ? columnDef.header : undefined;
|
|
139
142
|
let accessorFn;
|
|
140
143
|
|
|
@@ -150,8 +153,7 @@
|
|
|
150
153
|
}
|
|
151
154
|
}
|
|
152
155
|
|
|
153
|
-
let column = { ...
|
|
154
|
-
...columnDef,
|
|
156
|
+
let column = { ...columnDef,
|
|
155
157
|
id: "" + id,
|
|
156
158
|
accessorFn,
|
|
157
159
|
parent: parent,
|
|
@@ -385,7 +387,7 @@
|
|
|
385
387
|
row,
|
|
386
388
|
column,
|
|
387
389
|
getValue: () => row.getValue(columnId),
|
|
388
|
-
renderCell: () => column.cell ? instance._render(column.cell, {
|
|
390
|
+
renderCell: () => column.columnDef.cell ? instance._render(column.columnDef.cell, {
|
|
389
391
|
instance,
|
|
390
392
|
column,
|
|
391
393
|
row,
|
|
@@ -440,7 +442,7 @@
|
|
|
440
442
|
});
|
|
441
443
|
|
|
442
444
|
const ColumnSizing = {
|
|
443
|
-
|
|
445
|
+
getDefaultColumnDef: () => {
|
|
444
446
|
return defaultColumnSizing;
|
|
445
447
|
},
|
|
446
448
|
getInitialState: state => {
|
|
@@ -460,10 +462,10 @@
|
|
|
460
462
|
createColumn: (column, instance) => {
|
|
461
463
|
return {
|
|
462
464
|
getSize: () => {
|
|
463
|
-
var _column$
|
|
465
|
+
var _column$columnDef$min, _ref, _column$columnDef$max;
|
|
464
466
|
|
|
465
467
|
const columnSize = instance.getState().columnSizing[column.id];
|
|
466
|
-
return Math.min(Math.max((_column$
|
|
468
|
+
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);
|
|
467
469
|
},
|
|
468
470
|
getStart: position => {
|
|
469
471
|
const columns = !position ? instance.getVisibleLeafColumns() : position === 'left' ? instance.getLeftVisibleLeafColumns() : instance.getRightVisibleLeafColumns();
|
|
@@ -486,9 +488,9 @@
|
|
|
486
488
|
});
|
|
487
489
|
},
|
|
488
490
|
getCanResize: () => {
|
|
489
|
-
var _column$
|
|
491
|
+
var _column$columnDef$ena, _instance$options$ena;
|
|
490
492
|
|
|
491
|
-
return ((_column$
|
|
493
|
+
return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableColumnResizing) != null ? _instance$options$ena : true);
|
|
492
494
|
},
|
|
493
495
|
getIsResizing: () => {
|
|
494
496
|
return instance.getState().columnSizingInfo.isResizingColumn === column.id;
|
|
@@ -945,7 +947,7 @@
|
|
|
945
947
|
|
|
946
948
|
//
|
|
947
949
|
const Filters = {
|
|
948
|
-
|
|
950
|
+
getDefaultColumnDef: () => {
|
|
949
951
|
return {
|
|
950
952
|
filterFn: 'auto'
|
|
951
953
|
};
|
|
@@ -988,6 +990,10 @@
|
|
|
988
990
|
return filterFns.inNumberRange;
|
|
989
991
|
}
|
|
990
992
|
|
|
993
|
+
if (typeof value === 'boolean') {
|
|
994
|
+
return filterFns.equals;
|
|
995
|
+
}
|
|
996
|
+
|
|
991
997
|
if (value !== null && typeof value === 'object') {
|
|
992
998
|
return filterFns.equals;
|
|
993
999
|
}
|
|
@@ -1005,14 +1011,14 @@
|
|
|
1005
1011
|
return isFunction(column.filterFn) ? column.filterFn : column.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.filterFn]) != null ? _ref : filterFns[column.filterFn];
|
|
1006
1012
|
},
|
|
1007
1013
|
getCanFilter: () => {
|
|
1008
|
-
var _column$
|
|
1014
|
+
var _column$columnDef$ena, _instance$options$ena, _instance$options$ena2;
|
|
1009
1015
|
|
|
1010
|
-
return ((_column$
|
|
1016
|
+
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;
|
|
1011
1017
|
},
|
|
1012
1018
|
getCanGlobalFilter: () => {
|
|
1013
|
-
var _column$
|
|
1019
|
+
var _column$columnDef$ena2, _instance$options$ena3, _instance$options$ena4, _instance$options$get;
|
|
1014
1020
|
|
|
1015
|
-
return ((_column$
|
|
1021
|
+
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;
|
|
1016
1022
|
},
|
|
1017
1023
|
getIsFiltered: () => column.getFilterIndex() > -1,
|
|
1018
1024
|
getFilterValue: () => {
|
|
@@ -1290,7 +1296,7 @@
|
|
|
1290
1296
|
|
|
1291
1297
|
//
|
|
1292
1298
|
const Grouping = {
|
|
1293
|
-
|
|
1299
|
+
getDefaultColumnDef: () => {
|
|
1294
1300
|
return {
|
|
1295
1301
|
aggregationFn: 'auto'
|
|
1296
1302
|
};
|
|
@@ -1320,9 +1326,9 @@
|
|
|
1320
1326
|
});
|
|
1321
1327
|
},
|
|
1322
1328
|
getCanGroup: () => {
|
|
1323
|
-
var _ref, _ref2, _ref3, _column$
|
|
1329
|
+
var _ref, _ref2, _ref3, _column$columnDef$ena;
|
|
1324
1330
|
|
|
1325
|
-
return (_ref = (_ref2 = (_ref3 = (_column$
|
|
1331
|
+
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;
|
|
1326
1332
|
},
|
|
1327
1333
|
getIsGrouped: () => {
|
|
1328
1334
|
var _instance$getState$gr;
|
|
@@ -1406,9 +1412,9 @@
|
|
|
1406
1412
|
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && ((_row$subRows = row.subRows) == null ? void 0 : _row$subRows.length) > 1;
|
|
1407
1413
|
},
|
|
1408
1414
|
renderAggregatedCell: () => {
|
|
1409
|
-
var _column$
|
|
1415
|
+
var _column$columnDef$agg;
|
|
1410
1416
|
|
|
1411
|
-
const template = (_column$
|
|
1417
|
+
const template = (_column$columnDef$agg = column.columnDef.aggregatedCell) != null ? _column$columnDef$agg : column.columnDef.cell;
|
|
1412
1418
|
return template ? instance._render(template, {
|
|
1413
1419
|
instance,
|
|
1414
1420
|
column,
|
|
@@ -1715,9 +1721,9 @@
|
|
|
1715
1721
|
getCanPin: () => {
|
|
1716
1722
|
const leafColumns = column.getLeafColumns();
|
|
1717
1723
|
return leafColumns.some(d => {
|
|
1718
|
-
var _d$
|
|
1724
|
+
var _d$columnDef$enablePi, _instance$options$ena;
|
|
1719
1725
|
|
|
1720
|
-
return ((_d$
|
|
1726
|
+
return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_instance$options$ena = instance.options.enablePinning) != null ? _instance$options$ena : true);
|
|
1721
1727
|
});
|
|
1722
1728
|
},
|
|
1723
1729
|
getIsPinned: () => {
|
|
@@ -1787,12 +1793,18 @@
|
|
|
1787
1793
|
|
|
1788
1794
|
return instance.setColumnPinning(defaultState ? getDefaultPinningState() : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnPinning) != null ? _instance$initialStat : getDefaultPinningState());
|
|
1789
1795
|
},
|
|
1790
|
-
getIsSomeColumnsPinned:
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
+
getIsSomeColumnsPinned: position => {
|
|
1797
|
+
var _pinningState$positio;
|
|
1798
|
+
|
|
1799
|
+
const pinningState = instance.getState().columnPinning;
|
|
1800
|
+
|
|
1801
|
+
if (!position) {
|
|
1802
|
+
var _pinningState$left, _pinningState$right;
|
|
1803
|
+
|
|
1804
|
+
return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
|
|
1796
1808
|
},
|
|
1797
1809
|
getLeftLeafColumns: memo(() => [instance.getAllLeafColumns(), instance.getState().columnPinning.left], (allColumns, left) => {
|
|
1798
1810
|
return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
@@ -2318,7 +2330,7 @@
|
|
|
2318
2330
|
...state
|
|
2319
2331
|
};
|
|
2320
2332
|
},
|
|
2321
|
-
|
|
2333
|
+
getDefaultColumnDef: () => {
|
|
2322
2334
|
return {
|
|
2323
2335
|
sortingFn: 'auto'
|
|
2324
2336
|
};
|
|
@@ -2378,7 +2390,7 @@
|
|
|
2378
2390
|
throw new Error();
|
|
2379
2391
|
}
|
|
2380
2392
|
|
|
2381
|
-
return isFunction(column.sortingFn) ? column.sortingFn : column.sortingFn === 'auto' ? column.getAutoSortingFn() : (_ref = userSortingFn == null ? void 0 : userSortingFn[column.sortingFn]) != null ? _ref : sortingFns[column.sortingFn];
|
|
2393
|
+
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];
|
|
2382
2394
|
},
|
|
2383
2395
|
toggleSorting: (desc, multi) => {
|
|
2384
2396
|
// if (column.columns.length) {
|
|
@@ -2390,7 +2402,7 @@
|
|
|
2390
2402
|
// return
|
|
2391
2403
|
// }
|
|
2392
2404
|
instance.setSorting(old => {
|
|
2393
|
-
var _ref2, _column$
|
|
2405
|
+
var _ref2, _column$columnDef$sor, _instance$options$ena, _instance$options$ena2;
|
|
2394
2406
|
|
|
2395
2407
|
// Find any existing sorting for this column
|
|
2396
2408
|
const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
|
|
@@ -2417,7 +2429,7 @@
|
|
|
2417
2429
|
}
|
|
2418
2430
|
}
|
|
2419
2431
|
|
|
2420
|
-
const sortDescFirst = (_ref2 = (_column$
|
|
2432
|
+
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
|
|
2421
2433
|
|
|
2422
2434
|
if (sortAction === 'toggle' && ( // Must be toggling
|
|
2423
2435
|
(_instance$options$ena = instance.options.enableSortingRemoval) != null ? _instance$options$ena : true) && // If enableSortRemove, enable in general
|
|
@@ -2461,14 +2473,14 @@
|
|
|
2461
2473
|
});
|
|
2462
2474
|
},
|
|
2463
2475
|
getCanSort: () => {
|
|
2464
|
-
var _column$
|
|
2476
|
+
var _column$columnDef$ena, _instance$options$ena3;
|
|
2465
2477
|
|
|
2466
|
-
return ((_column$
|
|
2478
|
+
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;
|
|
2467
2479
|
},
|
|
2468
2480
|
getCanMultiSort: () => {
|
|
2469
|
-
var _ref3, _column$
|
|
2481
|
+
var _ref3, _column$columnDef$ena2;
|
|
2470
2482
|
|
|
2471
|
-
return (_ref3 = (_column$
|
|
2483
|
+
return (_ref3 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : instance.options.enableMultiSort) != null ? _ref3 : !!column.accessorFn;
|
|
2472
2484
|
},
|
|
2473
2485
|
getIsSorted: () => {
|
|
2474
2486
|
var _instance$getState$so;
|
|
@@ -2532,7 +2544,7 @@
|
|
|
2532
2544
|
onColumnVisibilityChange: makeStateUpdater('columnVisibility', instance)
|
|
2533
2545
|
};
|
|
2534
2546
|
},
|
|
2535
|
-
|
|
2547
|
+
getDefaultColumnDef: () => {
|
|
2536
2548
|
return {
|
|
2537
2549
|
defaultIsVisible: true
|
|
2538
2550
|
};
|
|
@@ -2552,9 +2564,9 @@
|
|
|
2552
2564
|
return (_instance$getState$co = (_instance$getState$co2 = instance.getState().columnVisibility) == null ? void 0 : _instance$getState$co2[column.id]) != null ? _instance$getState$co : true;
|
|
2553
2565
|
},
|
|
2554
2566
|
getCanHide: () => {
|
|
2555
|
-
var _column$
|
|
2567
|
+
var _column$columnDef$ena, _instance$options$ena;
|
|
2556
2568
|
|
|
2557
|
-
return ((_column$
|
|
2569
|
+
return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableHiding) != null ? _instance$options$ena : true);
|
|
2558
2570
|
},
|
|
2559
2571
|
getToggleVisibilityHandler: () => {
|
|
2560
2572
|
return e => {
|
|
@@ -2665,12 +2677,12 @@
|
|
|
2665
2677
|
recurseHeader(header);
|
|
2666
2678
|
return leafHeaders;
|
|
2667
2679
|
},
|
|
2668
|
-
renderHeader: () => column.header ? instance._render(column.header, {
|
|
2680
|
+
renderHeader: () => column.columnDef.header ? instance._render(column.columnDef.header, {
|
|
2669
2681
|
instance,
|
|
2670
2682
|
header: header,
|
|
2671
2683
|
column
|
|
2672
2684
|
}) : null,
|
|
2673
|
-
renderFooter: () => column.footer ? instance._render(column.footer, {
|
|
2685
|
+
renderFooter: () => column.columnDef.footer ? instance._render(column.columnDef.footer, {
|
|
2674
2686
|
instance,
|
|
2675
2687
|
header: header,
|
|
2676
2688
|
column
|
|
@@ -3178,7 +3190,7 @@
|
|
|
3178
3190
|
throw new Error('');
|
|
3179
3191
|
})()
|
|
3180
3192
|
},
|
|
3181
|
-
setGenerics: () => table,
|
|
3193
|
+
// setGenerics: () => table as any,
|
|
3182
3194
|
setRowType: () => table,
|
|
3183
3195
|
setTableMetaType: () => table,
|
|
3184
3196
|
setColumnMetaType: () => table,
|
|
@@ -3214,7 +3226,8 @@
|
|
|
3214
3226
|
}
|
|
3215
3227
|
|
|
3216
3228
|
throw new Error('Invalid accessor');
|
|
3217
|
-
}
|
|
3229
|
+
},
|
|
3230
|
+
createOptions: options => options
|
|
3218
3231
|
};
|
|
3219
3232
|
return table;
|
|
3220
3233
|
}
|
|
@@ -3611,8 +3624,8 @@
|
|
|
3611
3624
|
availableSorting.forEach(sortEntry => {
|
|
3612
3625
|
const column = instance.getColumn(sortEntry.id);
|
|
3613
3626
|
columnInfoById[sortEntry.id] = {
|
|
3614
|
-
sortUndefined: column.sortUndefined,
|
|
3615
|
-
invertSorting: column.invertSorting,
|
|
3627
|
+
sortUndefined: column.columnDef.sortUndefined,
|
|
3628
|
+
invertSorting: column.columnDef.invertSorting,
|
|
3616
3629
|
sortingFn: column.getSortingFn()
|
|
3617
3630
|
};
|
|
3618
3631
|
});
|
|
@@ -3760,8 +3773,8 @@
|
|
|
3760
3773
|
row.groupingValuesCache[columnId] = aggregateFn(() => leafRows.map(row => {
|
|
3761
3774
|
let columnValue = row.getValue(columnId);
|
|
3762
3775
|
|
|
3763
|
-
if (!depth && column.aggregateValue) {
|
|
3764
|
-
columnValue = column.aggregateValue(columnValue);
|
|
3776
|
+
if (!depth && column.columnDef.aggregateValue) {
|
|
3777
|
+
columnValue = column.columnDef.aggregateValue(columnValue);
|
|
3765
3778
|
}
|
|
3766
3779
|
|
|
3767
3780
|
return columnValue;
|