@tanstack/svelte-table 8.0.0-beta.3 → 8.0.0-beta.6
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 +6 -2
- package/build/cjs/svelte-table/src/index.js.map +1 -1
- package/build/cjs/svelte-table/src/placeholder.js +24 -0
- package/build/cjs/svelte-table/src/placeholder.js.map +1 -0
- package/build/cjs/svelte-table/src/render-component.js +5 -1
- package/build/cjs/svelte-table/src/render-component.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +76 -31
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +97 -36
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +76 -44
- package/build/types/placeholder.d.ts +3 -0
- package/build/umd/index.development.js +92 -34
- 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 +10 -2
- package/src/placeholder.ts +15 -0
- package/src/render-component.ts +5 -1
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":"c1f5-163"},{"name":"svelte-table/src","children":[{"uid":"c1f5-165","name":"placeholder.svelte"},{"uid":"c1f5-167","name":"placeholder.ts"},{"uid":"c1f5-169","name":"render-component.ts"},{"uid":"c1f5-171","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"c1f5-163":{"renderedLength":138814,"gzipLength":23636,"brotliLength":0,"mainUid":"c1f5-162"},"c1f5-165":{"renderedLength":927,"gzipLength":445,"brotliLength":0,"mainUid":"c1f5-164"},"c1f5-167":{"renderedLength":246,"gzipLength":184,"brotliLength":0,"mainUid":"c1f5-166"},"c1f5-169":{"renderedLength":1458,"gzipLength":539,"brotliLength":0,"mainUid":"c1f5-168"},"c1f5-171":{"renderedLength":3046,"gzipLength":993,"brotliLength":0,"mainUid":"c1f5-170"}},"nodeMetas":{"c1f5-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"c1f5-163"},"imported":[],"importedBy":[{"uid":"c1f5-170"}]},"c1f5-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"c1f5-165"},"imported":[{"uid":"c1f5-172"}],"importedBy":[{"uid":"c1f5-166"}]},"c1f5-166":{"id":"/packages/svelte-table/src/placeholder.ts","moduleParts":{"index.production.js":"c1f5-167"},"imported":[{"uid":"c1f5-172"},{"uid":"c1f5-164"}],"importedBy":[{"uid":"c1f5-170"}]},"c1f5-168":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"c1f5-169"},"imported":[{"uid":"c1f5-172"}],"importedBy":[{"uid":"c1f5-170"}]},"c1f5-170":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"c1f5-171"},"imported":[{"uid":"c1f5-162"},{"uid":"c1f5-166"},{"uid":"c1f5-172"},{"uid":"c1f5-173"},{"uid":"c1f5-168"}],"importedBy":[],"isEntry":true},"c1f5-172":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"c1f5-170"},{"uid":"c1f5-166"},{"uid":"c1f5-168"},{"uid":"c1f5-164"}],"isExternal":true},"c1f5-173":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"c1f5-170"}],"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,25 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "table-core/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "c1f5-175"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "svelte-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "c1f5-177",
|
|
21
21
|
"name": "placeholder.svelte"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "c1f5-179",
|
|
25
|
+
"name": "placeholder.ts"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"uid": "c1f5-181",
|
|
25
29
|
"name": "render-component.ts"
|
|
26
30
|
},
|
|
27
31
|
{
|
|
28
|
-
"uid": "
|
|
32
|
+
"uid": "c1f5-183",
|
|
29
33
|
"name": "index.ts"
|
|
30
34
|
}
|
|
31
35
|
]
|
|
@@ -38,125 +42,153 @@
|
|
|
38
42
|
"isRoot": true
|
|
39
43
|
},
|
|
40
44
|
"nodeParts": {
|
|
41
|
-
"
|
|
42
|
-
"renderedLength":
|
|
43
|
-
"gzipLength":
|
|
45
|
+
"c1f5-175": {
|
|
46
|
+
"renderedLength": 138814,
|
|
47
|
+
"gzipLength": 23636,
|
|
44
48
|
"brotliLength": 0,
|
|
45
|
-
"mainUid": "
|
|
49
|
+
"mainUid": "c1f5-174"
|
|
46
50
|
},
|
|
47
|
-
"
|
|
48
|
-
"renderedLength":
|
|
49
|
-
"gzipLength":
|
|
51
|
+
"c1f5-177": {
|
|
52
|
+
"renderedLength": 927,
|
|
53
|
+
"gzipLength": 445,
|
|
50
54
|
"brotliLength": 0,
|
|
51
|
-
"mainUid": "
|
|
55
|
+
"mainUid": "c1f5-176"
|
|
52
56
|
},
|
|
53
|
-
"
|
|
54
|
-
"renderedLength":
|
|
55
|
-
"gzipLength":
|
|
57
|
+
"c1f5-179": {
|
|
58
|
+
"renderedLength": 246,
|
|
59
|
+
"gzipLength": 184,
|
|
56
60
|
"brotliLength": 0,
|
|
57
|
-
"mainUid": "
|
|
61
|
+
"mainUid": "c1f5-178"
|
|
58
62
|
},
|
|
59
|
-
"
|
|
60
|
-
"renderedLength":
|
|
61
|
-
"gzipLength":
|
|
63
|
+
"c1f5-181": {
|
|
64
|
+
"renderedLength": 1458,
|
|
65
|
+
"gzipLength": 539,
|
|
62
66
|
"brotliLength": 0,
|
|
63
|
-
"mainUid": "
|
|
67
|
+
"mainUid": "c1f5-180"
|
|
68
|
+
},
|
|
69
|
+
"c1f5-183": {
|
|
70
|
+
"renderedLength": 3046,
|
|
71
|
+
"gzipLength": 993,
|
|
72
|
+
"brotliLength": 0,
|
|
73
|
+
"mainUid": "c1f5-182"
|
|
64
74
|
}
|
|
65
75
|
},
|
|
66
76
|
"nodeMetas": {
|
|
67
|
-
"
|
|
77
|
+
"c1f5-174": {
|
|
68
78
|
"id": "/packages/table-core/build/esm/index.js",
|
|
69
79
|
"moduleParts": {
|
|
70
|
-
"index.production.js": "
|
|
80
|
+
"index.production.js": "c1f5-175"
|
|
71
81
|
},
|
|
72
82
|
"imported": [],
|
|
73
83
|
"importedBy": [
|
|
74
84
|
{
|
|
75
|
-
"uid": "
|
|
85
|
+
"uid": "c1f5-182"
|
|
76
86
|
}
|
|
77
87
|
]
|
|
78
88
|
},
|
|
79
|
-
"
|
|
89
|
+
"c1f5-176": {
|
|
80
90
|
"id": "/packages/svelte-table/src/placeholder.svelte",
|
|
81
91
|
"moduleParts": {
|
|
82
|
-
"index.production.js": "
|
|
92
|
+
"index.production.js": "c1f5-177"
|
|
83
93
|
},
|
|
84
94
|
"imported": [
|
|
85
95
|
{
|
|
86
|
-
"uid": "
|
|
96
|
+
"uid": "c1f5-184"
|
|
87
97
|
}
|
|
88
98
|
],
|
|
89
99
|
"importedBy": [
|
|
90
100
|
{
|
|
91
|
-
"uid": "
|
|
101
|
+
"uid": "c1f5-178"
|
|
92
102
|
}
|
|
93
103
|
]
|
|
94
104
|
},
|
|
95
|
-
"
|
|
105
|
+
"c1f5-178": {
|
|
106
|
+
"id": "/packages/svelte-table/src/placeholder.ts",
|
|
107
|
+
"moduleParts": {
|
|
108
|
+
"index.production.js": "c1f5-179"
|
|
109
|
+
},
|
|
110
|
+
"imported": [
|
|
111
|
+
{
|
|
112
|
+
"uid": "c1f5-184"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"uid": "c1f5-176"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"importedBy": [
|
|
119
|
+
{
|
|
120
|
+
"uid": "c1f5-182"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"c1f5-180": {
|
|
96
125
|
"id": "/packages/svelte-table/src/render-component.ts",
|
|
97
126
|
"moduleParts": {
|
|
98
|
-
"index.production.js": "
|
|
127
|
+
"index.production.js": "c1f5-181"
|
|
99
128
|
},
|
|
100
129
|
"imported": [
|
|
101
130
|
{
|
|
102
|
-
"uid": "
|
|
131
|
+
"uid": "c1f5-184"
|
|
103
132
|
}
|
|
104
133
|
],
|
|
105
134
|
"importedBy": [
|
|
106
135
|
{
|
|
107
|
-
"uid": "
|
|
136
|
+
"uid": "c1f5-182"
|
|
108
137
|
}
|
|
109
138
|
]
|
|
110
139
|
},
|
|
111
|
-
"
|
|
140
|
+
"c1f5-182": {
|
|
112
141
|
"id": "/packages/svelte-table/src/index.ts",
|
|
113
142
|
"moduleParts": {
|
|
114
|
-
"index.production.js": "
|
|
143
|
+
"index.production.js": "c1f5-183"
|
|
115
144
|
},
|
|
116
145
|
"imported": [
|
|
117
146
|
{
|
|
118
|
-
"uid": "
|
|
147
|
+
"uid": "c1f5-174"
|
|
119
148
|
},
|
|
120
149
|
{
|
|
121
|
-
"uid": "
|
|
150
|
+
"uid": "c1f5-178"
|
|
122
151
|
},
|
|
123
152
|
{
|
|
124
|
-
"uid": "
|
|
153
|
+
"uid": "c1f5-184"
|
|
125
154
|
},
|
|
126
155
|
{
|
|
127
|
-
"uid": "
|
|
156
|
+
"uid": "c1f5-185"
|
|
128
157
|
},
|
|
129
158
|
{
|
|
130
|
-
"uid": "
|
|
159
|
+
"uid": "c1f5-180"
|
|
131
160
|
}
|
|
132
161
|
],
|
|
133
162
|
"importedBy": [],
|
|
134
163
|
"isEntry": true
|
|
135
164
|
},
|
|
136
|
-
"
|
|
165
|
+
"c1f5-184": {
|
|
137
166
|
"id": "svelte/internal",
|
|
138
167
|
"moduleParts": {},
|
|
139
168
|
"imported": [],
|
|
140
169
|
"importedBy": [
|
|
141
170
|
{
|
|
142
|
-
"uid": "
|
|
171
|
+
"uid": "c1f5-182"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"uid": "c1f5-178"
|
|
143
175
|
},
|
|
144
176
|
{
|
|
145
|
-
"uid": "
|
|
177
|
+
"uid": "c1f5-180"
|
|
146
178
|
},
|
|
147
179
|
{
|
|
148
|
-
"uid": "
|
|
180
|
+
"uid": "c1f5-176"
|
|
149
181
|
}
|
|
150
182
|
],
|
|
151
183
|
"isExternal": true
|
|
152
184
|
},
|
|
153
|
-
"
|
|
185
|
+
"c1f5-185": {
|
|
154
186
|
"id": "svelte/store",
|
|
155
187
|
"moduleParts": {},
|
|
156
188
|
"imported": [],
|
|
157
189
|
"importedBy": [
|
|
158
190
|
{
|
|
159
|
-
"uid": "
|
|
191
|
+
"uid": "c1f5-182"
|
|
160
192
|
}
|
|
161
193
|
],
|
|
162
194
|
"isExternal": true
|
|
@@ -828,7 +828,6 @@
|
|
|
828
828
|
getDefaultOptions: instance => {
|
|
829
829
|
return {
|
|
830
830
|
onExpandedChange: makeStateUpdater('expanded', instance),
|
|
831
|
-
autoResetExpanded: true,
|
|
832
831
|
paginateExpandedRows: true
|
|
833
832
|
};
|
|
834
833
|
},
|
|
@@ -837,6 +836,8 @@
|
|
|
837
836
|
let queued = false;
|
|
838
837
|
return {
|
|
839
838
|
_autoResetExpanded: () => {
|
|
839
|
+
var _ref, _instance$options$aut;
|
|
840
|
+
|
|
840
841
|
if (!registered) {
|
|
841
842
|
instance._queue(() => {
|
|
842
843
|
registered = true;
|
|
@@ -845,11 +846,7 @@
|
|
|
845
846
|
return;
|
|
846
847
|
}
|
|
847
848
|
|
|
848
|
-
if (instance.options.autoResetAll
|
|
849
|
-
return;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
if (instance.options.autoResetAll === true || instance.options.autoResetExpanded) {
|
|
849
|
+
if ((_ref = (_instance$options$aut = instance.options.autoResetAll) != null ? _instance$options$aut : instance.options.autoResetExpanded) != null ? _ref : !instance.options.manualExpanding) {
|
|
853
850
|
if (queued) return;
|
|
854
851
|
queued = true;
|
|
855
852
|
|
|
@@ -913,7 +910,7 @@
|
|
|
913
910
|
});
|
|
914
911
|
return maxDepth;
|
|
915
912
|
},
|
|
916
|
-
getPreExpandedRowModel: () => instance.
|
|
913
|
+
getPreExpandedRowModel: () => instance.getSortedRowModel(),
|
|
917
914
|
getExpandedRowModel: () => {
|
|
918
915
|
if (!instance._getExpandedRowModel && instance.options.getExpandedRowModel) {
|
|
919
916
|
instance._getExpandedRowModel = instance.options.getExpandedRowModel(instance);
|
|
@@ -1514,7 +1511,7 @@
|
|
|
1514
1511
|
|
|
1515
1512
|
instance.setGrouping(defaultState ? [] : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.grouping) != null ? _instance$initialStat : []);
|
|
1516
1513
|
},
|
|
1517
|
-
getPreGroupedRowModel: () => instance.
|
|
1514
|
+
getPreGroupedRowModel: () => instance.getFilteredRowModel(),
|
|
1518
1515
|
getGroupedRowModel: () => {
|
|
1519
1516
|
if (!instance._getGroupedRowModel && instance.options.getGroupedRowModel) {
|
|
1520
1517
|
instance._getGroupedRowModel = instance.options.getGroupedRowModel(instance);
|
|
@@ -1535,6 +1532,12 @@
|
|
|
1535
1532
|
};
|
|
1536
1533
|
},
|
|
1537
1534
|
createCell: (cell, column, row, instance) => {
|
|
1535
|
+
const getRenderValue = () => {
|
|
1536
|
+
var _cell$getValue;
|
|
1537
|
+
|
|
1538
|
+
return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : instance.options.renderFallbackValue;
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1538
1541
|
return {
|
|
1539
1542
|
getIsGrouped: () => column.getIsGrouped() && column.id === row.groupingColumnId,
|
|
1540
1543
|
getIsPlaceholder: () => !cell.getIsGrouped() && column.getIsGrouped(),
|
|
@@ -1544,15 +1547,19 @@
|
|
|
1544
1547
|
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && ((_row$subRows = row.subRows) == null ? void 0 : _row$subRows.length) > 1;
|
|
1545
1548
|
},
|
|
1546
1549
|
renderAggregatedCell: () => {
|
|
1547
|
-
|
|
1550
|
+
{
|
|
1551
|
+
if (!column.columnDef.aggregatedCell) {
|
|
1552
|
+
console.warn('A columnDef.aggregatedCell template is recommended for displaying aggregated values.');
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1548
1555
|
|
|
1549
|
-
const template =
|
|
1556
|
+
const template = column.columnDef.aggregatedCell || column.columnDef.cell;
|
|
1550
1557
|
return template ? instance._render(template, {
|
|
1551
1558
|
instance,
|
|
1552
1559
|
column,
|
|
1553
1560
|
row,
|
|
1554
1561
|
cell,
|
|
1555
|
-
getValue:
|
|
1562
|
+
getValue: getRenderValue
|
|
1556
1563
|
}) : null;
|
|
1557
1564
|
}
|
|
1558
1565
|
};
|
|
@@ -2022,11 +2029,11 @@
|
|
|
2022
2029
|
});
|
|
2023
2030
|
},
|
|
2024
2031
|
toggleAllPageRowsSelected: value => instance.setRowSelection(old => {
|
|
2025
|
-
typeof value !== 'undefined' ? value : !instance.getIsAllPageRowsSelected();
|
|
2032
|
+
const resolvedValue = typeof value !== 'undefined' ? value : !instance.getIsAllPageRowsSelected();
|
|
2026
2033
|
const rowSelection = { ...old
|
|
2027
2034
|
};
|
|
2028
2035
|
instance.getRowModel().rows.forEach(row => {
|
|
2029
|
-
mutateRowIsSelected(rowSelection, row.id,
|
|
2036
|
+
mutateRowIsSelected(rowSelection, row.id, resolvedValue, instance);
|
|
2030
2037
|
});
|
|
2031
2038
|
return rowSelection;
|
|
2032
2039
|
}),
|
|
@@ -2117,7 +2124,7 @@
|
|
|
2117
2124
|
return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugTable;
|
|
2118
2125
|
}
|
|
2119
2126
|
}),
|
|
2120
|
-
getGroupedSelectedRowModel: memo(() => [instance.getState().rowSelection, instance.
|
|
2127
|
+
getGroupedSelectedRowModel: memo(() => [instance.getState().rowSelection, instance.getSortedRowModel()], (rowSelection, rowModel) => {
|
|
2121
2128
|
if (!Object.keys(rowSelection).length) {
|
|
2122
2129
|
return {
|
|
2123
2130
|
rows: [],
|
|
@@ -2181,7 +2188,7 @@
|
|
|
2181
2188
|
},
|
|
2182
2189
|
getIsSomePageRowsSelected: () => {
|
|
2183
2190
|
const paginationFlatRows = instance.getPaginationRowModel().flatRows;
|
|
2184
|
-
return instance.getIsAllPageRowsSelected() ? false :
|
|
2191
|
+
return instance.getIsAllPageRowsSelected() ? false : paginationFlatRows.some(d => d.getIsSelected() || d.getIsSomeSelected());
|
|
2185
2192
|
},
|
|
2186
2193
|
getToggleAllRowsSelectedHandler: () => {
|
|
2187
2194
|
return e => {
|
|
@@ -2535,8 +2542,10 @@
|
|
|
2535
2542
|
// })
|
|
2536
2543
|
// return
|
|
2537
2544
|
// }
|
|
2545
|
+
// this needs to be outside of instance.setSorting to be in sync with rerender
|
|
2546
|
+
const nextSortingOrder = column.getNextSortingOrder();
|
|
2538
2547
|
instance.setSorting(old => {
|
|
2539
|
-
var
|
|
2548
|
+
var _instance$options$ena, _instance$options$ena2;
|
|
2540
2549
|
|
|
2541
2550
|
// Find any existing sorting for this column
|
|
2542
2551
|
const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
|
|
@@ -2561,30 +2570,29 @@
|
|
|
2561
2570
|
} else {
|
|
2562
2571
|
sortAction = 'replace';
|
|
2563
2572
|
}
|
|
2564
|
-
}
|
|
2573
|
+
} // Handle toggle states that will remove the sorting
|
|
2565
2574
|
|
|
2566
|
-
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
|
|
2567
2575
|
|
|
2568
2576
|
if (sortAction === 'toggle' && ( // Must be toggling
|
|
2569
2577
|
(_instance$options$ena = instance.options.enableSortingRemoval) != null ? _instance$options$ena : true) && // If enableSortRemove, enable in general
|
|
2570
2578
|
!hasDescDefined && ( // Must not be setting desc
|
|
2571
|
-
multi ? (_instance$options$ena2 = instance.options.enableMultiRemove) != null ? _instance$options$ena2 : true : true) &&
|
|
2572
|
-
|
|
2573
|
-
|
|
2579
|
+
multi ? (_instance$options$ena2 = instance.options.enableMultiRemove) != null ? _instance$options$ena2 : true : true) && // If multi, don't allow if enableMultiRemove
|
|
2580
|
+
!nextSortingOrder // Finally, detect if it should indeed be removed
|
|
2581
|
+
) {
|
|
2574
2582
|
sortAction = 'remove';
|
|
2575
2583
|
}
|
|
2576
2584
|
|
|
2577
2585
|
if (sortAction === 'replace') {
|
|
2578
2586
|
newSorting = [{
|
|
2579
2587
|
id: column.id,
|
|
2580
|
-
desc: hasDescDefined ? desc :
|
|
2588
|
+
desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
|
|
2581
2589
|
}];
|
|
2582
2590
|
} else if (sortAction === 'add' && old != null && old.length) {
|
|
2583
2591
|
var _instance$options$max;
|
|
2584
2592
|
|
|
2585
2593
|
newSorting = [...old, {
|
|
2586
2594
|
id: column.id,
|
|
2587
|
-
desc: hasDescDefined ? desc :
|
|
2595
|
+
desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
|
|
2588
2596
|
}]; // Take latest n columns
|
|
2589
2597
|
|
|
2590
2598
|
newSorting.splice(0, newSorting.length - ((_instance$options$max = instance.options.maxMultiSortColCount) != null ? _instance$options$max : Number.MAX_SAFE_INTEGER));
|
|
@@ -2593,7 +2601,7 @@
|
|
|
2593
2601
|
newSorting = old.map(d => {
|
|
2594
2602
|
if (d.id === column.id) {
|
|
2595
2603
|
return { ...d,
|
|
2596
|
-
desc: hasDescDefined ? desc :
|
|
2604
|
+
desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
|
|
2597
2605
|
};
|
|
2598
2606
|
}
|
|
2599
2607
|
|
|
@@ -2606,6 +2614,23 @@
|
|
|
2606
2614
|
return newSorting;
|
|
2607
2615
|
});
|
|
2608
2616
|
},
|
|
2617
|
+
getNextSortingOrder: () => {
|
|
2618
|
+
var _ref2, _column$columnDef$sor;
|
|
2619
|
+
|
|
2620
|
+
const sortDescFirst = (_ref2 = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc';
|
|
2621
|
+
const firstSortDirection = sortDescFirst ? 'desc' : 'asc';
|
|
2622
|
+
const isSorted = column.getIsSorted();
|
|
2623
|
+
|
|
2624
|
+
if (!isSorted) {
|
|
2625
|
+
return firstSortDirection;
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
if (isSorted === firstSortDirection) {
|
|
2629
|
+
return isSorted === 'desc' ? 'asc' : 'desc';
|
|
2630
|
+
} else {
|
|
2631
|
+
return false;
|
|
2632
|
+
}
|
|
2633
|
+
},
|
|
2609
2634
|
getCanSort: () => {
|
|
2610
2635
|
var _column$columnDef$ena, _instance$options$ena3;
|
|
2611
2636
|
|
|
@@ -2649,7 +2674,7 @@
|
|
|
2649
2674
|
|
|
2650
2675
|
instance.setSorting(defaultState ? [] : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.sorting) != null ? _instance$initialStat : []);
|
|
2651
2676
|
},
|
|
2652
|
-
getPreSortedRowModel: () => instance.
|
|
2677
|
+
getPreSortedRowModel: () => instance.getGroupedRowModel(),
|
|
2653
2678
|
getSortedRowModel: () => {
|
|
2654
2679
|
if (!instance._getSortedRowModel && instance.options.getSortedRowModel) {
|
|
2655
2680
|
instance._getSortedRowModel = instance.options.getSortedRowModel(instance);
|
|
@@ -3053,6 +3078,12 @@
|
|
|
3053
3078
|
}
|
|
3054
3079
|
|
|
3055
3080
|
function createCell(instance, row, column, columnId) {
|
|
3081
|
+
const getRenderValue = () => {
|
|
3082
|
+
var _cell$getValue;
|
|
3083
|
+
|
|
3084
|
+
return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : instance.options.renderFallbackValue;
|
|
3085
|
+
};
|
|
3086
|
+
|
|
3056
3087
|
const cell = {
|
|
3057
3088
|
id: row.id + "_" + column.id,
|
|
3058
3089
|
row,
|
|
@@ -3064,7 +3095,7 @@
|
|
|
3064
3095
|
column,
|
|
3065
3096
|
row,
|
|
3066
3097
|
cell: cell,
|
|
3067
|
-
getValue:
|
|
3098
|
+
getValue: getRenderValue
|
|
3068
3099
|
}) : null;
|
|
3069
3100
|
}
|
|
3070
3101
|
};
|
|
@@ -3793,20 +3824,34 @@
|
|
|
3793
3824
|
const pageStart = pageSize * pageIndex;
|
|
3794
3825
|
const pageEnd = pageStart + pageSize;
|
|
3795
3826
|
rows = rows.slice(pageStart, pageEnd);
|
|
3827
|
+
let paginatedRowModel;
|
|
3796
3828
|
|
|
3797
3829
|
if (!instance.options.paginateExpandedRows) {
|
|
3798
|
-
|
|
3830
|
+
paginatedRowModel = expandRows({
|
|
3799
3831
|
rows,
|
|
3800
3832
|
flatRows,
|
|
3801
3833
|
rowsById
|
|
3802
3834
|
});
|
|
3835
|
+
} else {
|
|
3836
|
+
paginatedRowModel = {
|
|
3837
|
+
rows,
|
|
3838
|
+
flatRows,
|
|
3839
|
+
rowsById
|
|
3840
|
+
};
|
|
3803
3841
|
}
|
|
3804
3842
|
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3843
|
+
paginatedRowModel.flatRows = [];
|
|
3844
|
+
|
|
3845
|
+
const handleRow = row => {
|
|
3846
|
+
paginatedRowModel.flatRows.push(row);
|
|
3847
|
+
|
|
3848
|
+
if (row.subRows.length) {
|
|
3849
|
+
row.subRows.forEach(handleRow);
|
|
3850
|
+
}
|
|
3809
3851
|
};
|
|
3852
|
+
|
|
3853
|
+
paginatedRowModel.rows.forEach(handleRow);
|
|
3854
|
+
return paginatedRowModel;
|
|
3810
3855
|
}, {
|
|
3811
3856
|
key: 'getPaginationRowModel',
|
|
3812
3857
|
debug: () => {
|
|
@@ -3850,13 +3895,18 @@
|
|
|
3850
3895
|
return [content];
|
|
3851
3896
|
}
|
|
3852
3897
|
|
|
3853
|
-
class Placeholder extends internal.SvelteComponent {
|
|
3898
|
+
class Placeholder$1 extends internal.SvelteComponent {
|
|
3854
3899
|
constructor(options) {
|
|
3855
3900
|
super();
|
|
3856
3901
|
internal.init(this, options, instance, create_fragment$1, internal.safe_not_equal, { content: 0 });
|
|
3857
3902
|
}
|
|
3858
3903
|
}
|
|
3859
3904
|
|
|
3905
|
+
const PlaceholderServer = internal.create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
|
3906
|
+
return "" + internal.escape($$props.content);
|
|
3907
|
+
});
|
|
3908
|
+
var Placeholder = typeof document === 'undefined' ? PlaceholderServer : Placeholder$1;
|
|
3909
|
+
|
|
3860
3910
|
function create_fragment(ctx, Comp, props) {
|
|
3861
3911
|
let c;
|
|
3862
3912
|
let current;
|
|
@@ -3869,6 +3919,10 @@
|
|
|
3869
3919
|
internal.create_component(c.$$.fragment);
|
|
3870
3920
|
},
|
|
3871
3921
|
|
|
3922
|
+
l(nodes) {
|
|
3923
|
+
internal.claim_component(c.$$.fragment, nodes);
|
|
3924
|
+
},
|
|
3925
|
+
|
|
3872
3926
|
m(target, anchor) {
|
|
3873
3927
|
// @ts-ignore
|
|
3874
3928
|
internal.mount_component(c, target, anchor);
|
|
@@ -3907,7 +3961,7 @@
|
|
|
3907
3961
|
|
|
3908
3962
|
function renderServer(Comp, props) {
|
|
3909
3963
|
const WrapperComp = internal.create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
|
3910
|
-
return "" + internal.validate_component(Comp, '
|
|
3964
|
+
return "" + internal.validate_component(Comp, 'TableComponent').$$render($$result, props, {}, {});
|
|
3911
3965
|
});
|
|
3912
3966
|
return WrapperComp;
|
|
3913
3967
|
}
|
|
@@ -3919,7 +3973,10 @@
|
|
|
3919
3973
|
}
|
|
3920
3974
|
|
|
3921
3975
|
function isSvelteClientComponent(component) {
|
|
3922
|
-
|
|
3976
|
+
var _component$name, _component$name2;
|
|
3977
|
+
|
|
3978
|
+
let isHMR = ('__SVELTE_HMR' in window);
|
|
3979
|
+
return component.prototype instanceof internal.SvelteComponent || isHMR && ((_component$name = component.name) == null ? void 0 : _component$name.startsWith('Proxy<')) && ((_component$name2 = component.name) == null ? void 0 : _component$name2.endsWith('>'));
|
|
3923
3980
|
}
|
|
3924
3981
|
|
|
3925
3982
|
function isSvelteComponent(component) {
|
|
@@ -3973,6 +4030,7 @@
|
|
|
3973
4030
|
onStateChange: () => {},
|
|
3974
4031
|
// noop
|
|
3975
4032
|
render,
|
|
4033
|
+
renderFallbackValue: null,
|
|
3976
4034
|
...store.get(optionsStore)
|
|
3977
4035
|
};
|
|
3978
4036
|
let instance = createTableInstance$1(resolvedOptions);
|