@tanstack/svelte-table 8.0.0-alpha.68 → 8.0.0-alpha.71
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/table-core/build/esm/index.js +109 -78
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +109 -78
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +36 -36
- package/build/umd/index.development.js +109 -78
- 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/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":"9906-163"},{"name":"svelte-table/src","children":[{"uid":"9906-165","name":"placeholder.svelte"},{"uid":"9906-167","name":"render-component.ts"},{"uid":"9906-169","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"9906-163":{"renderedLength":142389,"gzipLength":24368,"brotliLength":0,"mainUid":"9906-162"},"9906-165":{"renderedLength":925,"gzipLength":444,"brotliLength":0,"mainUid":"9906-164"},"9906-167":{"renderedLength":1365,"gzipLength":519,"brotliLength":0,"mainUid":"9906-166"},"9906-169":{"renderedLength":1958,"gzipLength":709,"brotliLength":0,"mainUid":"9906-168"}},"nodeMetas":{"9906-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"9906-163"},"imported":[],"importedBy":[{"uid":"9906-168"}]},"9906-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"9906-165"},"imported":[{"uid":"9906-171"}],"importedBy":[{"uid":"9906-168"}]},"9906-166":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"9906-167"},"imported":[{"uid":"9906-171"}],"importedBy":[{"uid":"9906-168"}]},"9906-168":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"9906-169"},"imported":[{"uid":"9906-162"},{"uid":"9906-164"},{"uid":"9906-170"},{"uid":"9906-166"}],"importedBy":[],"isEntry":true},"9906-170":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"9906-168"}],"isExternal":true},"9906-171":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"9906-164"},{"uid":"9906-166"}],"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": "9906-173"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "svelte-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "9906-175",
|
|
21
21
|
"name": "placeholder.svelte"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "9906-177",
|
|
25
25
|
"name": "render-component.ts"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"uid": "
|
|
28
|
+
"uid": "9906-179",
|
|
29
29
|
"name": "index.ts"
|
|
30
30
|
}
|
|
31
31
|
]
|
|
@@ -38,119 +38,119 @@
|
|
|
38
38
|
"isRoot": true
|
|
39
39
|
},
|
|
40
40
|
"nodeParts": {
|
|
41
|
-
"
|
|
42
|
-
"renderedLength":
|
|
43
|
-
"gzipLength":
|
|
41
|
+
"9906-173": {
|
|
42
|
+
"renderedLength": 142389,
|
|
43
|
+
"gzipLength": 24368,
|
|
44
44
|
"brotliLength": 0,
|
|
45
|
-
"mainUid": "
|
|
45
|
+
"mainUid": "9906-172"
|
|
46
46
|
},
|
|
47
|
-
"
|
|
47
|
+
"9906-175": {
|
|
48
48
|
"renderedLength": 925,
|
|
49
49
|
"gzipLength": 444,
|
|
50
50
|
"brotliLength": 0,
|
|
51
|
-
"mainUid": "
|
|
51
|
+
"mainUid": "9906-174"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
53
|
+
"9906-177": {
|
|
54
54
|
"renderedLength": 1365,
|
|
55
55
|
"gzipLength": 519,
|
|
56
56
|
"brotliLength": 0,
|
|
57
|
-
"mainUid": "
|
|
57
|
+
"mainUid": "9906-176"
|
|
58
58
|
},
|
|
59
|
-
"
|
|
59
|
+
"9906-179": {
|
|
60
60
|
"renderedLength": 1958,
|
|
61
61
|
"gzipLength": 709,
|
|
62
62
|
"brotliLength": 0,
|
|
63
|
-
"mainUid": "
|
|
63
|
+
"mainUid": "9906-178"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"nodeMetas": {
|
|
67
|
-
"
|
|
67
|
+
"9906-172": {
|
|
68
68
|
"id": "/packages/table-core/build/esm/index.js",
|
|
69
69
|
"moduleParts": {
|
|
70
|
-
"index.production.js": "
|
|
70
|
+
"index.production.js": "9906-173"
|
|
71
71
|
},
|
|
72
72
|
"imported": [],
|
|
73
73
|
"importedBy": [
|
|
74
74
|
{
|
|
75
|
-
"uid": "
|
|
75
|
+
"uid": "9906-178"
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"9906-174": {
|
|
80
80
|
"id": "/packages/svelte-table/src/placeholder.svelte",
|
|
81
81
|
"moduleParts": {
|
|
82
|
-
"index.production.js": "
|
|
82
|
+
"index.production.js": "9906-175"
|
|
83
83
|
},
|
|
84
84
|
"imported": [
|
|
85
85
|
{
|
|
86
|
-
"uid": "
|
|
86
|
+
"uid": "9906-181"
|
|
87
87
|
}
|
|
88
88
|
],
|
|
89
89
|
"importedBy": [
|
|
90
90
|
{
|
|
91
|
-
"uid": "
|
|
91
|
+
"uid": "9906-178"
|
|
92
92
|
}
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"
|
|
95
|
+
"9906-176": {
|
|
96
96
|
"id": "/packages/svelte-table/src/render-component.ts",
|
|
97
97
|
"moduleParts": {
|
|
98
|
-
"index.production.js": "
|
|
98
|
+
"index.production.js": "9906-177"
|
|
99
99
|
},
|
|
100
100
|
"imported": [
|
|
101
101
|
{
|
|
102
|
-
"uid": "
|
|
102
|
+
"uid": "9906-181"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"importedBy": [
|
|
106
106
|
{
|
|
107
|
-
"uid": "
|
|
107
|
+
"uid": "9906-178"
|
|
108
108
|
}
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"9906-178": {
|
|
112
112
|
"id": "/packages/svelte-table/src/index.ts",
|
|
113
113
|
"moduleParts": {
|
|
114
|
-
"index.production.js": "
|
|
114
|
+
"index.production.js": "9906-179"
|
|
115
115
|
},
|
|
116
116
|
"imported": [
|
|
117
117
|
{
|
|
118
|
-
"uid": "
|
|
118
|
+
"uid": "9906-172"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
"uid": "
|
|
121
|
+
"uid": "9906-174"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
"uid": "
|
|
124
|
+
"uid": "9906-180"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
"uid": "
|
|
127
|
+
"uid": "9906-176"
|
|
128
128
|
}
|
|
129
129
|
],
|
|
130
130
|
"importedBy": [],
|
|
131
131
|
"isEntry": true
|
|
132
132
|
},
|
|
133
|
-
"
|
|
133
|
+
"9906-180": {
|
|
134
134
|
"id": "svelte/store",
|
|
135
135
|
"moduleParts": {},
|
|
136
136
|
"imported": [],
|
|
137
137
|
"importedBy": [
|
|
138
138
|
{
|
|
139
|
-
"uid": "
|
|
139
|
+
"uid": "9906-178"
|
|
140
140
|
}
|
|
141
141
|
],
|
|
142
142
|
"isExternal": true
|
|
143
143
|
},
|
|
144
|
-
"
|
|
144
|
+
"9906-181": {
|
|
145
145
|
"id": "svelte/internal",
|
|
146
146
|
"moduleParts": {},
|
|
147
147
|
"imported": [],
|
|
148
148
|
"importedBy": [
|
|
149
149
|
{
|
|
150
|
-
"uid": "
|
|
150
|
+
"uid": "9906-174"
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
|
-
"uid": "
|
|
153
|
+
"uid": "9906-176"
|
|
154
154
|
}
|
|
155
155
|
],
|
|
156
156
|
"isExternal": true
|
|
@@ -429,6 +429,16 @@
|
|
|
429
429
|
minSize: 20,
|
|
430
430
|
maxSize: Number.MAX_SAFE_INTEGER
|
|
431
431
|
};
|
|
432
|
+
|
|
433
|
+
const getDefaultColumnSizingInfoState = () => ({
|
|
434
|
+
startOffset: null,
|
|
435
|
+
startSize: null,
|
|
436
|
+
deltaOffset: null,
|
|
437
|
+
deltaPercentage: null,
|
|
438
|
+
isResizingColumn: false,
|
|
439
|
+
columnSizingStart: []
|
|
440
|
+
});
|
|
441
|
+
|
|
432
442
|
const ColumnSizing = {
|
|
433
443
|
getDefaultColumn: () => {
|
|
434
444
|
return defaultColumnSizing;
|
|
@@ -436,14 +446,7 @@
|
|
|
436
446
|
getInitialState: state => {
|
|
437
447
|
return {
|
|
438
448
|
columnSizing: {},
|
|
439
|
-
columnSizingInfo:
|
|
440
|
-
startOffset: null,
|
|
441
|
-
startSize: null,
|
|
442
|
-
deltaOffset: null,
|
|
443
|
-
deltaPercentage: null,
|
|
444
|
-
isResizingColumn: false,
|
|
445
|
-
columnSizingStart: []
|
|
446
|
-
},
|
|
449
|
+
columnSizingInfo: getDefaultColumnSizingInfoState(),
|
|
447
450
|
...state
|
|
448
451
|
};
|
|
449
452
|
},
|
|
@@ -613,42 +616,42 @@
|
|
|
613
616
|
return {
|
|
614
617
|
setColumnSizing: updater => instance.options.onColumnSizingChange == null ? void 0 : instance.options.onColumnSizingChange(updater),
|
|
615
618
|
setColumnSizingInfo: updater => instance.options.onColumnSizingInfoChange == null ? void 0 : instance.options.onColumnSizingInfoChange(updater),
|
|
616
|
-
resetColumnSizing:
|
|
619
|
+
resetColumnSizing: defaultState => {
|
|
617
620
|
var _instance$initialStat;
|
|
618
621
|
|
|
619
|
-
instance.setColumnSizing((_instance$initialStat = instance.initialState.columnSizing) != null ? _instance$initialStat : {});
|
|
622
|
+
instance.setColumnSizing(defaultState ? {} : (_instance$initialStat = instance.initialState.columnSizing) != null ? _instance$initialStat : {});
|
|
620
623
|
},
|
|
621
|
-
resetHeaderSizeInfo:
|
|
624
|
+
resetHeaderSizeInfo: defaultState => {
|
|
622
625
|
var _instance$initialStat2;
|
|
623
626
|
|
|
624
|
-
instance.setColumnSizingInfo((_instance$initialStat2 = instance.initialState.columnSizingInfo) != null ? _instance$initialStat2 :
|
|
627
|
+
instance.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_instance$initialStat2 = instance.initialState.columnSizingInfo) != null ? _instance$initialStat2 : getDefaultColumnSizingInfoState());
|
|
625
628
|
},
|
|
626
629
|
getTotalSize: () => {
|
|
627
630
|
var _instance$getHeaderGr, _instance$getHeaderGr2;
|
|
628
631
|
|
|
629
632
|
return (_instance$getHeaderGr = (_instance$getHeaderGr2 = instance.getHeaderGroups()[0]) == null ? void 0 : _instance$getHeaderGr2.headers.reduce((sum, header) => {
|
|
630
|
-
return sum + header.
|
|
633
|
+
return sum + header.getSize();
|
|
631
634
|
}, 0)) != null ? _instance$getHeaderGr : 0;
|
|
632
635
|
},
|
|
633
636
|
getLeftTotalSize: () => {
|
|
634
637
|
var _instance$getLeftHead, _instance$getLeftHead2;
|
|
635
638
|
|
|
636
639
|
return (_instance$getLeftHead = (_instance$getLeftHead2 = instance.getLeftHeaderGroups()[0]) == null ? void 0 : _instance$getLeftHead2.headers.reduce((sum, header) => {
|
|
637
|
-
return sum + header.
|
|
640
|
+
return sum + header.getSize();
|
|
638
641
|
}, 0)) != null ? _instance$getLeftHead : 0;
|
|
639
642
|
},
|
|
640
643
|
getCenterTotalSize: () => {
|
|
641
644
|
var _instance$getCenterHe, _instance$getCenterHe2;
|
|
642
645
|
|
|
643
646
|
return (_instance$getCenterHe = (_instance$getCenterHe2 = instance.getCenterHeaderGroups()[0]) == null ? void 0 : _instance$getCenterHe2.headers.reduce((sum, header) => {
|
|
644
|
-
return sum + header.
|
|
647
|
+
return sum + header.getSize();
|
|
645
648
|
}, 0)) != null ? _instance$getCenterHe : 0;
|
|
646
649
|
},
|
|
647
650
|
getRightTotalSize: () => {
|
|
648
651
|
var _instance$getRightHea, _instance$getRightHea2;
|
|
649
652
|
|
|
650
653
|
return (_instance$getRightHea = (_instance$getRightHea2 = instance.getRightHeaderGroups()[0]) == null ? void 0 : _instance$getRightHea2.headers.reduce((sum, header) => {
|
|
651
|
-
return sum + header.
|
|
654
|
+
return sum + header.getSize();
|
|
652
655
|
}, 0)) != null ? _instance$getRightHea : 0;
|
|
653
656
|
}
|
|
654
657
|
};
|
|
@@ -702,10 +705,13 @@
|
|
|
702
705
|
},
|
|
703
706
|
createInstance: instance => {
|
|
704
707
|
let registered = false;
|
|
708
|
+
let queued = false;
|
|
705
709
|
return {
|
|
706
710
|
_autoResetExpanded: () => {
|
|
707
711
|
if (!registered) {
|
|
708
|
-
|
|
712
|
+
instance.queue(() => {
|
|
713
|
+
registered = true;
|
|
714
|
+
});
|
|
709
715
|
return;
|
|
710
716
|
}
|
|
711
717
|
|
|
@@ -714,7 +720,12 @@
|
|
|
714
720
|
}
|
|
715
721
|
|
|
716
722
|
if (instance.options.autoResetAll === true || instance.options.autoResetExpanded) {
|
|
717
|
-
|
|
723
|
+
if (queued) return;
|
|
724
|
+
queued = true;
|
|
725
|
+
instance.queue(() => {
|
|
726
|
+
instance.resetExpanded();
|
|
727
|
+
queued = false;
|
|
728
|
+
});
|
|
718
729
|
}
|
|
719
730
|
},
|
|
720
731
|
setExpanded: updater => instance.options.onExpandedChange == null ? void 0 : instance.options.onExpandedChange(updater),
|
|
@@ -725,10 +736,10 @@
|
|
|
725
736
|
instance.setExpanded({});
|
|
726
737
|
}
|
|
727
738
|
},
|
|
728
|
-
resetExpanded:
|
|
739
|
+
resetExpanded: defaultState => {
|
|
729
740
|
var _instance$initialStat, _instance$initialStat2;
|
|
730
741
|
|
|
731
|
-
instance.setExpanded((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.expanded) != null ? _instance$initialStat : {});
|
|
742
|
+
instance.setExpanded(defaultState ? {} : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.expanded) != null ? _instance$initialStat : {});
|
|
732
743
|
},
|
|
733
744
|
getCanSomeRowsExpand: () => {
|
|
734
745
|
return instance.getRowModel().flatRows.some(row => row.getCanExpand());
|
|
@@ -1067,7 +1078,7 @@
|
|
|
1067
1078
|
_getFacetedMinMaxValues: instance.options.getFacetedMinMaxValues && instance.options.getFacetedMinMaxValues(instance, column.id),
|
|
1068
1079
|
getFacetedMinMaxValues: () => {
|
|
1069
1080
|
if (!column._getFacetedMinMaxValues) {
|
|
1070
|
-
return
|
|
1081
|
+
return undefined;
|
|
1071
1082
|
}
|
|
1072
1083
|
|
|
1073
1084
|
return column._getFacetedMinMaxValues();
|
|
@@ -1122,13 +1133,13 @@
|
|
|
1122
1133
|
setGlobalFilter: updater => {
|
|
1123
1134
|
instance.options.onGlobalFilterChange == null ? void 0 : instance.options.onGlobalFilterChange(updater);
|
|
1124
1135
|
},
|
|
1125
|
-
resetGlobalFilter:
|
|
1126
|
-
instance.setGlobalFilter(instance.initialState.globalFilter);
|
|
1136
|
+
resetGlobalFilter: defaultState => {
|
|
1137
|
+
instance.setGlobalFilter(defaultState ? undefined : instance.initialState.globalFilter);
|
|
1127
1138
|
},
|
|
1128
|
-
resetColumnFilters:
|
|
1139
|
+
resetColumnFilters: defaultState => {
|
|
1129
1140
|
var _instance$initialStat, _instance$initialStat2;
|
|
1130
1141
|
|
|
1131
|
-
instance.setColumnFilters((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnFilters) != null ? _instance$initialStat : []);
|
|
1142
|
+
instance.setColumnFilters(defaultState ? [] : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnFilters) != null ? _instance$initialStat : []);
|
|
1132
1143
|
},
|
|
1133
1144
|
getPreFilteredRowModel: () => instance.getCoreRowModel(),
|
|
1134
1145
|
_getFilteredRowModel: instance.options.getFilteredRowModel && instance.options.getFilteredRowModel(instance),
|
|
@@ -1158,7 +1169,7 @@
|
|
|
1158
1169
|
_getGlobalFacetedMinMaxValues: instance.options.getFacetedMinMaxValues && instance.options.getFacetedMinMaxValues(instance, '__global__'),
|
|
1159
1170
|
getGlobalFacetedMinMaxValues: () => {
|
|
1160
1171
|
if (!instance._getGlobalFacetedMinMaxValues) {
|
|
1161
|
-
return
|
|
1172
|
+
return;
|
|
1162
1173
|
}
|
|
1163
1174
|
|
|
1164
1175
|
return instance._getGlobalFacetedMinMaxValues();
|
|
@@ -1357,10 +1368,10 @@
|
|
|
1357
1368
|
createInstance: instance => {
|
|
1358
1369
|
return {
|
|
1359
1370
|
setGrouping: updater => instance.options.onGroupingChange == null ? void 0 : instance.options.onGroupingChange(updater),
|
|
1360
|
-
resetGrouping:
|
|
1371
|
+
resetGrouping: defaultState => {
|
|
1361
1372
|
var _instance$initialStat, _instance$initialStat2;
|
|
1362
1373
|
|
|
1363
|
-
instance.setGrouping((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.grouping) != null ? _instance$initialStat : []);
|
|
1374
|
+
instance.setGrouping(defaultState ? [] : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.grouping) != null ? _instance$initialStat : []);
|
|
1364
1375
|
},
|
|
1365
1376
|
getPreGroupedRowModel: () => instance.getSortedRowModel(),
|
|
1366
1377
|
getGroupedRowModel: () => {
|
|
@@ -1437,10 +1448,10 @@
|
|
|
1437
1448
|
createInstance: instance => {
|
|
1438
1449
|
return {
|
|
1439
1450
|
setColumnOrder: updater => instance.options.onColumnOrderChange == null ? void 0 : instance.options.onColumnOrderChange(updater),
|
|
1440
|
-
resetColumnOrder:
|
|
1451
|
+
resetColumnOrder: defaultState => {
|
|
1441
1452
|
var _instance$initialStat;
|
|
1442
1453
|
|
|
1443
|
-
instance.setColumnOrder((_instance$initialStat = instance.initialState.columnOrder) != null ? _instance$initialStat : []);
|
|
1454
|
+
instance.setColumnOrder(defaultState ? [] : (_instance$initialStat = instance.initialState.columnOrder) != null ? _instance$initialStat : []);
|
|
1444
1455
|
},
|
|
1445
1456
|
_getOrderColumnsFn: memo(() => [instance.getState().columnOrder, instance.getState().grouping, instance.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {
|
|
1446
1457
|
// Sort grouped columns to the start of the column list
|
|
@@ -1478,13 +1489,18 @@
|
|
|
1478
1489
|
};
|
|
1479
1490
|
|
|
1480
1491
|
//
|
|
1492
|
+
const defaultPageIndex = 0;
|
|
1493
|
+
const defaultPageSize = 10;
|
|
1494
|
+
|
|
1495
|
+
const getDefaultPaginationState = () => ({
|
|
1496
|
+
pageIndex: defaultPageIndex,
|
|
1497
|
+
pageSize: defaultPageSize
|
|
1498
|
+
});
|
|
1499
|
+
|
|
1481
1500
|
const Pagination = {
|
|
1482
1501
|
getInitialState: state => {
|
|
1483
1502
|
return { ...state,
|
|
1484
|
-
pagination: {
|
|
1485
|
-
pageCount: -1,
|
|
1486
|
-
pageIndex: 0,
|
|
1487
|
-
pageSize: 10,
|
|
1503
|
+
pagination: { ...getDefaultPaginationState(),
|
|
1488
1504
|
...(state == null ? void 0 : state.pagination)
|
|
1489
1505
|
}
|
|
1490
1506
|
};
|
|
@@ -1497,10 +1513,13 @@
|
|
|
1497
1513
|
},
|
|
1498
1514
|
createInstance: instance => {
|
|
1499
1515
|
let registered = false;
|
|
1516
|
+
let queued = false;
|
|
1500
1517
|
return {
|
|
1501
1518
|
_autoResetPageIndex: () => {
|
|
1502
1519
|
if (!registered) {
|
|
1503
|
-
|
|
1520
|
+
instance.queue(() => {
|
|
1521
|
+
registered = true;
|
|
1522
|
+
});
|
|
1504
1523
|
return;
|
|
1505
1524
|
}
|
|
1506
1525
|
|
|
@@ -1509,7 +1528,12 @@
|
|
|
1509
1528
|
}
|
|
1510
1529
|
|
|
1511
1530
|
if (instance.options.autoResetAll === true || instance.options.autoResetPageIndex) {
|
|
1512
|
-
|
|
1531
|
+
if (queued) return;
|
|
1532
|
+
queued = true;
|
|
1533
|
+
instance.queue(() => {
|
|
1534
|
+
instance.resetPageIndex();
|
|
1535
|
+
queued = false;
|
|
1536
|
+
});
|
|
1513
1537
|
}
|
|
1514
1538
|
},
|
|
1515
1539
|
setPagination: updater => {
|
|
@@ -1520,14 +1544,10 @@
|
|
|
1520
1544
|
|
|
1521
1545
|
return instance.options.onPaginationChange == null ? void 0 : instance.options.onPaginationChange(safeUpdater);
|
|
1522
1546
|
},
|
|
1523
|
-
resetPagination:
|
|
1547
|
+
resetPagination: defaultState => {
|
|
1524
1548
|
var _instance$initialStat;
|
|
1525
1549
|
|
|
1526
|
-
instance.setPagination((_instance$initialStat = instance.initialState.pagination) != null ? _instance$initialStat :
|
|
1527
|
-
pageIndex: 0,
|
|
1528
|
-
pageSize: 10,
|
|
1529
|
-
pageCount: -1
|
|
1530
|
-
});
|
|
1550
|
+
instance.setPagination(defaultState ? getDefaultPaginationState() : (_instance$initialStat = instance.initialState.pagination) != null ? _instance$initialStat : getDefaultPaginationState());
|
|
1531
1551
|
},
|
|
1532
1552
|
setPageIndex: updater => {
|
|
1533
1553
|
instance.setPagination(old => {
|
|
@@ -1539,13 +1559,15 @@
|
|
|
1539
1559
|
};
|
|
1540
1560
|
});
|
|
1541
1561
|
},
|
|
1542
|
-
resetPageIndex:
|
|
1543
|
-
instance.setPageIndex(0);
|
|
1544
|
-
},
|
|
1545
|
-
resetPageSize: () => {
|
|
1562
|
+
resetPageIndex: defaultState => {
|
|
1546
1563
|
var _instance$initialStat2, _instance$initialStat3, _instance$initialStat4;
|
|
1547
1564
|
|
|
1548
|
-
instance.
|
|
1565
|
+
instance.setPageIndex(defaultState ? defaultPageIndex : (_instance$initialStat2 = (_instance$initialStat3 = instance.initialState) == null ? void 0 : (_instance$initialStat4 = _instance$initialStat3.pagination) == null ? void 0 : _instance$initialStat4.pageIndex) != null ? _instance$initialStat2 : defaultPageIndex);
|
|
1566
|
+
},
|
|
1567
|
+
resetPageSize: defaultState => {
|
|
1568
|
+
var _instance$initialStat5, _instance$initialStat6, _instance$initialStat7;
|
|
1569
|
+
|
|
1570
|
+
instance.setPageSize(defaultState ? defaultPageSize : (_instance$initialStat5 = (_instance$initialStat6 = instance.initialState) == null ? void 0 : (_instance$initialStat7 = _instance$initialStat6.pagination) == null ? void 0 : _instance$initialStat7.pageSize) != null ? _instance$initialStat5 : defaultPageSize);
|
|
1549
1571
|
},
|
|
1550
1572
|
setPageSize: updater => {
|
|
1551
1573
|
instance.setPagination(old => {
|
|
@@ -1559,7 +1581,9 @@
|
|
|
1559
1581
|
});
|
|
1560
1582
|
},
|
|
1561
1583
|
setPageCount: updater => instance.setPagination(old => {
|
|
1562
|
-
|
|
1584
|
+
var _old$pageCount;
|
|
1585
|
+
|
|
1586
|
+
let newPageCount = functionalUpdate(updater, (_old$pageCount = old.pageCount) != null ? _old$pageCount : -1);
|
|
1563
1587
|
|
|
1564
1588
|
if (typeof newPageCount === 'number') {
|
|
1565
1589
|
newPageCount = Math.max(-1, newPageCount);
|
|
@@ -1627,7 +1651,7 @@
|
|
|
1627
1651
|
pageCount
|
|
1628
1652
|
} = instance.getState().pagination;
|
|
1629
1653
|
|
|
1630
|
-
if (pageCount
|
|
1654
|
+
if (typeof pageCount !== 'undefined') {
|
|
1631
1655
|
return pageCount;
|
|
1632
1656
|
}
|
|
1633
1657
|
|
|
@@ -1638,13 +1662,15 @@
|
|
|
1638
1662
|
};
|
|
1639
1663
|
|
|
1640
1664
|
//
|
|
1665
|
+
const getDefaultPinningState = () => ({
|
|
1666
|
+
left: [],
|
|
1667
|
+
right: []
|
|
1668
|
+
});
|
|
1669
|
+
|
|
1641
1670
|
const Pinning = {
|
|
1642
1671
|
getInitialState: state => {
|
|
1643
1672
|
return {
|
|
1644
|
-
columnPinning:
|
|
1645
|
-
left: [],
|
|
1646
|
-
right: []
|
|
1647
|
-
},
|
|
1673
|
+
columnPinning: getDefaultPinningState(),
|
|
1648
1674
|
...state
|
|
1649
1675
|
};
|
|
1650
1676
|
},
|
|
@@ -1754,10 +1780,10 @@
|
|
|
1754
1780
|
createInstance: instance => {
|
|
1755
1781
|
return {
|
|
1756
1782
|
setColumnPinning: updater => instance.options.onColumnPinningChange == null ? void 0 : instance.options.onColumnPinningChange(updater),
|
|
1757
|
-
resetColumnPinning:
|
|
1783
|
+
resetColumnPinning: defaultState => {
|
|
1758
1784
|
var _instance$initialStat, _instance$initialStat2;
|
|
1759
1785
|
|
|
1760
|
-
return instance.setColumnPinning((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnPinning) != null ? _instance$initialStat :
|
|
1786
|
+
return instance.setColumnPinning(defaultState ? getDefaultPinningState() : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnPinning) != null ? _instance$initialStat : getDefaultPinningState());
|
|
1761
1787
|
},
|
|
1762
1788
|
getIsSomeColumnsPinned: () => {
|
|
1763
1789
|
const {
|
|
@@ -1823,10 +1849,10 @@
|
|
|
1823
1849
|
createInstance: instance => {
|
|
1824
1850
|
return {
|
|
1825
1851
|
setRowSelection: updater => instance.options.onRowSelectionChange == null ? void 0 : instance.options.onRowSelectionChange(updater),
|
|
1826
|
-
resetRowSelection:
|
|
1852
|
+
resetRowSelection: defaultState => {
|
|
1827
1853
|
var _instance$initialStat;
|
|
1828
1854
|
|
|
1829
|
-
return instance.setRowSelection((_instance$initialStat = instance.initialState.rowSelection) != null ? _instance$initialStat : {});
|
|
1855
|
+
return instance.setRowSelection(defaultState ? {} : (_instance$initialStat = instance.initialState.rowSelection) != null ? _instance$initialStat : {});
|
|
1830
1856
|
},
|
|
1831
1857
|
toggleAllRowsSelected: value => {
|
|
1832
1858
|
instance.setRowSelection(old => {
|
|
@@ -2453,14 +2479,9 @@
|
|
|
2453
2479
|
|
|
2454
2480
|
return (_instance$getState$so2 = (_instance$getState$so3 = instance.getState().sorting) == null ? void 0 : _instance$getState$so3.findIndex(d => d.id === column.id)) != null ? _instance$getState$so2 : -1;
|
|
2455
2481
|
},
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
} else {
|
|
2460
|
-
var _instance$initialStat, _instance$initialStat2;
|
|
2461
|
-
|
|
2462
|
-
instance.setSorting((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.sorting) != null ? _instance$initialStat : []);
|
|
2463
|
-
}
|
|
2482
|
+
clearSorting: () => {
|
|
2483
|
+
//clear sorting for just 1 column
|
|
2484
|
+
instance.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);
|
|
2464
2485
|
},
|
|
2465
2486
|
getToggleSortingHandler: () => {
|
|
2466
2487
|
const canSort = column.getCanSort();
|
|
@@ -2475,6 +2496,11 @@
|
|
|
2475
2496
|
createInstance: instance => {
|
|
2476
2497
|
return {
|
|
2477
2498
|
setSorting: updater => instance.options.onSortingChange == null ? void 0 : instance.options.onSortingChange(updater),
|
|
2499
|
+
resetSorting: defaultState => {
|
|
2500
|
+
var _instance$initialStat, _instance$initialStat2;
|
|
2501
|
+
|
|
2502
|
+
instance.setSorting(defaultState ? [] : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.sorting) != null ? _instance$initialStat : []);
|
|
2503
|
+
},
|
|
2478
2504
|
getPreSortedRowModel: () => instance.getFilteredRowModel(),
|
|
2479
2505
|
getSortedRowModel: () => {
|
|
2480
2506
|
if (!instance._getSortedRowModel && instance.options.getSortedRowModel) {
|
|
@@ -2578,6 +2604,11 @@
|
|
|
2578
2604
|
getRightVisibleLeafColumns: makeVisibleColumnsMethod('getRightVisibleLeafColumns', () => instance.getRightLeafColumns()),
|
|
2579
2605
|
getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => instance.getCenterLeafColumns()),
|
|
2580
2606
|
setColumnVisibility: updater => instance.options.onColumnVisibilityChange == null ? void 0 : instance.options.onColumnVisibilityChange(updater),
|
|
2607
|
+
resetColumnVisibility: defaultState => {
|
|
2608
|
+
var _instance$initialStat;
|
|
2609
|
+
|
|
2610
|
+
instance.setColumnVisibility(defaultState ? {} : (_instance$initialStat = instance.initialState.columnVisibility) != null ? _instance$initialStat : {});
|
|
2611
|
+
},
|
|
2581
2612
|
toggleAllColumnsVisible: value => {
|
|
2582
2613
|
var _value;
|
|
2583
2614
|
|
|
@@ -3343,9 +3374,7 @@
|
|
|
3343
3374
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
|
|
3344
3375
|
},
|
|
3345
3376
|
onChange: () => {
|
|
3346
|
-
instance.
|
|
3347
|
-
instance._autoResetPageIndex();
|
|
3348
|
-
});
|
|
3377
|
+
instance._autoResetPageIndex();
|
|
3349
3378
|
}
|
|
3350
3379
|
});
|
|
3351
3380
|
}
|
|
@@ -3551,9 +3580,7 @@
|
|
|
3551
3580
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
|
|
3552
3581
|
},
|
|
3553
3582
|
onChange: () => {
|
|
3554
|
-
instance.
|
|
3555
|
-
instance._autoResetPageIndex();
|
|
3556
|
-
});
|
|
3583
|
+
instance._autoResetPageIndex();
|
|
3557
3584
|
}
|
|
3558
3585
|
});
|
|
3559
3586
|
}
|
|
@@ -3621,14 +3648,20 @@
|
|
|
3621
3648
|
|
|
3622
3649
|
function getFacetedMinMaxValues() {
|
|
3623
3650
|
return (instance, columnId) => memo(() => [instance.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
|
|
3624
|
-
var _facetedRowModel$flat
|
|
3651
|
+
var _facetedRowModel$flat;
|
|
3652
|
+
|
|
3653
|
+
const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId);
|
|
3625
3654
|
|
|
3626
|
-
|
|
3655
|
+
if (typeof firstValue === 'undefined') {
|
|
3656
|
+
return undefined;
|
|
3657
|
+
}
|
|
3658
|
+
|
|
3659
|
+
let facetedMinMaxValues = [firstValue, firstValue];
|
|
3627
3660
|
|
|
3628
3661
|
for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
|
|
3629
|
-
var _facetedRowModel$
|
|
3662
|
+
var _facetedRowModel$flat2;
|
|
3630
3663
|
|
|
3631
|
-
const value = (_facetedRowModel$
|
|
3664
|
+
const value = (_facetedRowModel$flat2 = facetedRowModel.flatRows[i]) == null ? void 0 : _facetedRowModel$flat2.getValue(columnId);
|
|
3632
3665
|
|
|
3633
3666
|
if (value < facetedMinMaxValues[0]) {
|
|
3634
3667
|
facetedMinMaxValues[0] = value;
|
|
@@ -3736,9 +3769,7 @@
|
|
|
3736
3769
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
|
|
3737
3770
|
},
|
|
3738
3771
|
onChange: () => {
|
|
3739
|
-
instance.
|
|
3740
|
-
instance._autoResetPageIndex();
|
|
3741
|
-
});
|
|
3772
|
+
instance._autoResetPageIndex();
|
|
3742
3773
|
}
|
|
3743
3774
|
});
|
|
3744
3775
|
}
|