@tanstack/svelte-table 8.0.0-beta.2 → 8.0.0-beta.5
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 +78 -33
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +99 -38
- 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 +94 -36
- 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":"8d24-163"},{"name":"svelte-table/src","children":[{"uid":"8d24-165","name":"placeholder.svelte"},{"uid":"8d24-167","name":"placeholder.ts"},{"uid":"8d24-169","name":"render-component.ts"},{"uid":"8d24-171","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"8d24-163":{"renderedLength":138786,"gzipLength":23665,"brotliLength":0,"mainUid":"8d24-162"},"8d24-165":{"renderedLength":927,"gzipLength":445,"brotliLength":0,"mainUid":"8d24-164"},"8d24-167":{"renderedLength":246,"gzipLength":184,"brotliLength":0,"mainUid":"8d24-166"},"8d24-169":{"renderedLength":1458,"gzipLength":539,"brotliLength":0,"mainUid":"8d24-168"},"8d24-171":{"renderedLength":3046,"gzipLength":993,"brotliLength":0,"mainUid":"8d24-170"}},"nodeMetas":{"8d24-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"8d24-163"},"imported":[],"importedBy":[{"uid":"8d24-170"}]},"8d24-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"8d24-165"},"imported":[{"uid":"8d24-172"}],"importedBy":[{"uid":"8d24-166"}]},"8d24-166":{"id":"/packages/svelte-table/src/placeholder.ts","moduleParts":{"index.production.js":"8d24-167"},"imported":[{"uid":"8d24-172"},{"uid":"8d24-164"}],"importedBy":[{"uid":"8d24-170"}]},"8d24-168":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"8d24-169"},"imported":[{"uid":"8d24-172"}],"importedBy":[{"uid":"8d24-170"}]},"8d24-170":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"8d24-171"},"imported":[{"uid":"8d24-162"},{"uid":"8d24-166"},{"uid":"8d24-172"},{"uid":"8d24-173"},{"uid":"8d24-168"}],"importedBy":[],"isEntry":true},"8d24-172":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"8d24-170"},{"uid":"8d24-166"},{"uid":"8d24-168"},{"uid":"8d24-164"}],"isExternal":true},"8d24-173":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"8d24-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": "8d24-175"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "svelte-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "8d24-177",
|
|
21
21
|
"name": "placeholder.svelte"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "8d24-179",
|
|
25
|
+
"name": "placeholder.ts"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"uid": "8d24-181",
|
|
25
29
|
"name": "render-component.ts"
|
|
26
30
|
},
|
|
27
31
|
{
|
|
28
|
-
"uid": "
|
|
32
|
+
"uid": "8d24-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
|
+
"8d24-175": {
|
|
46
|
+
"renderedLength": 138786,
|
|
47
|
+
"gzipLength": 23665,
|
|
44
48
|
"brotliLength": 0,
|
|
45
|
-
"mainUid": "
|
|
49
|
+
"mainUid": "8d24-174"
|
|
46
50
|
},
|
|
47
|
-
"
|
|
48
|
-
"renderedLength":
|
|
49
|
-
"gzipLength":
|
|
51
|
+
"8d24-177": {
|
|
52
|
+
"renderedLength": 927,
|
|
53
|
+
"gzipLength": 445,
|
|
50
54
|
"brotliLength": 0,
|
|
51
|
-
"mainUid": "
|
|
55
|
+
"mainUid": "8d24-176"
|
|
52
56
|
},
|
|
53
|
-
"
|
|
54
|
-
"renderedLength":
|
|
55
|
-
"gzipLength":
|
|
57
|
+
"8d24-179": {
|
|
58
|
+
"renderedLength": 246,
|
|
59
|
+
"gzipLength": 184,
|
|
56
60
|
"brotliLength": 0,
|
|
57
|
-
"mainUid": "
|
|
61
|
+
"mainUid": "8d24-178"
|
|
58
62
|
},
|
|
59
|
-
"
|
|
60
|
-
"renderedLength":
|
|
61
|
-
"gzipLength":
|
|
63
|
+
"8d24-181": {
|
|
64
|
+
"renderedLength": 1458,
|
|
65
|
+
"gzipLength": 539,
|
|
62
66
|
"brotliLength": 0,
|
|
63
|
-
"mainUid": "
|
|
67
|
+
"mainUid": "8d24-180"
|
|
68
|
+
},
|
|
69
|
+
"8d24-183": {
|
|
70
|
+
"renderedLength": 3046,
|
|
71
|
+
"gzipLength": 993,
|
|
72
|
+
"brotliLength": 0,
|
|
73
|
+
"mainUid": "8d24-182"
|
|
64
74
|
}
|
|
65
75
|
},
|
|
66
76
|
"nodeMetas": {
|
|
67
|
-
"
|
|
77
|
+
"8d24-174": {
|
|
68
78
|
"id": "/packages/table-core/build/esm/index.js",
|
|
69
79
|
"moduleParts": {
|
|
70
|
-
"index.production.js": "
|
|
80
|
+
"index.production.js": "8d24-175"
|
|
71
81
|
},
|
|
72
82
|
"imported": [],
|
|
73
83
|
"importedBy": [
|
|
74
84
|
{
|
|
75
|
-
"uid": "
|
|
85
|
+
"uid": "8d24-182"
|
|
76
86
|
}
|
|
77
87
|
]
|
|
78
88
|
},
|
|
79
|
-
"
|
|
89
|
+
"8d24-176": {
|
|
80
90
|
"id": "/packages/svelte-table/src/placeholder.svelte",
|
|
81
91
|
"moduleParts": {
|
|
82
|
-
"index.production.js": "
|
|
92
|
+
"index.production.js": "8d24-177"
|
|
83
93
|
},
|
|
84
94
|
"imported": [
|
|
85
95
|
{
|
|
86
|
-
"uid": "
|
|
96
|
+
"uid": "8d24-184"
|
|
87
97
|
}
|
|
88
98
|
],
|
|
89
99
|
"importedBy": [
|
|
90
100
|
{
|
|
91
|
-
"uid": "
|
|
101
|
+
"uid": "8d24-178"
|
|
92
102
|
}
|
|
93
103
|
]
|
|
94
104
|
},
|
|
95
|
-
"
|
|
105
|
+
"8d24-178": {
|
|
106
|
+
"id": "/packages/svelte-table/src/placeholder.ts",
|
|
107
|
+
"moduleParts": {
|
|
108
|
+
"index.production.js": "8d24-179"
|
|
109
|
+
},
|
|
110
|
+
"imported": [
|
|
111
|
+
{
|
|
112
|
+
"uid": "8d24-184"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"uid": "8d24-176"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"importedBy": [
|
|
119
|
+
{
|
|
120
|
+
"uid": "8d24-182"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"8d24-180": {
|
|
96
125
|
"id": "/packages/svelte-table/src/render-component.ts",
|
|
97
126
|
"moduleParts": {
|
|
98
|
-
"index.production.js": "
|
|
127
|
+
"index.production.js": "8d24-181"
|
|
99
128
|
},
|
|
100
129
|
"imported": [
|
|
101
130
|
{
|
|
102
|
-
"uid": "
|
|
131
|
+
"uid": "8d24-184"
|
|
103
132
|
}
|
|
104
133
|
],
|
|
105
134
|
"importedBy": [
|
|
106
135
|
{
|
|
107
|
-
"uid": "
|
|
136
|
+
"uid": "8d24-182"
|
|
108
137
|
}
|
|
109
138
|
]
|
|
110
139
|
},
|
|
111
|
-
"
|
|
140
|
+
"8d24-182": {
|
|
112
141
|
"id": "/packages/svelte-table/src/index.ts",
|
|
113
142
|
"moduleParts": {
|
|
114
|
-
"index.production.js": "
|
|
143
|
+
"index.production.js": "8d24-183"
|
|
115
144
|
},
|
|
116
145
|
"imported": [
|
|
117
146
|
{
|
|
118
|
-
"uid": "
|
|
147
|
+
"uid": "8d24-174"
|
|
119
148
|
},
|
|
120
149
|
{
|
|
121
|
-
"uid": "
|
|
150
|
+
"uid": "8d24-178"
|
|
122
151
|
},
|
|
123
152
|
{
|
|
124
|
-
"uid": "
|
|
153
|
+
"uid": "8d24-184"
|
|
125
154
|
},
|
|
126
155
|
{
|
|
127
|
-
"uid": "
|
|
156
|
+
"uid": "8d24-185"
|
|
128
157
|
},
|
|
129
158
|
{
|
|
130
|
-
"uid": "
|
|
159
|
+
"uid": "8d24-180"
|
|
131
160
|
}
|
|
132
161
|
],
|
|
133
162
|
"importedBy": [],
|
|
134
163
|
"isEntry": true
|
|
135
164
|
},
|
|
136
|
-
"
|
|
165
|
+
"8d24-184": {
|
|
137
166
|
"id": "svelte/internal",
|
|
138
167
|
"moduleParts": {},
|
|
139
168
|
"imported": [],
|
|
140
169
|
"importedBy": [
|
|
141
170
|
{
|
|
142
|
-
"uid": "
|
|
171
|
+
"uid": "8d24-182"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"uid": "8d24-178"
|
|
143
175
|
},
|
|
144
176
|
{
|
|
145
|
-
"uid": "
|
|
177
|
+
"uid": "8d24-180"
|
|
146
178
|
},
|
|
147
179
|
{
|
|
148
|
-
"uid": "
|
|
180
|
+
"uid": "8d24-176"
|
|
149
181
|
}
|
|
150
182
|
],
|
|
151
183
|
"isExternal": true
|
|
152
184
|
},
|
|
153
|
-
"
|
|
185
|
+
"8d24-185": {
|
|
154
186
|
"id": "svelte/store",
|
|
155
187
|
"moduleParts": {},
|
|
156
188
|
"imported": [],
|
|
157
189
|
"importedBy": [
|
|
158
190
|
{
|
|
159
|
-
"uid": "
|
|
191
|
+
"uid": "8d24-182"
|
|
160
192
|
}
|
|
161
193
|
],
|
|
162
194
|
"isExternal": true
|
|
@@ -1108,7 +1108,6 @@
|
|
|
1108
1108
|
},
|
|
1109
1109
|
createColumn: (column, instance) => {
|
|
1110
1110
|
return {
|
|
1111
|
-
filterFn: column.filterFn,
|
|
1112
1111
|
getAutoFilterFn: () => {
|
|
1113
1112
|
const firstRow = instance.getCoreRowModel().flatRows[0];
|
|
1114
1113
|
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
@@ -1139,7 +1138,7 @@
|
|
|
1139
1138
|
var _ref;
|
|
1140
1139
|
|
|
1141
1140
|
const userFilterFns = instance.options.filterFns;
|
|
1142
|
-
return isFunction(column.filterFn) ? column.filterFn : column.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.filterFn]) != null ? _ref : filterFns[column.filterFn];
|
|
1141
|
+
return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.columnDef.filterFn]) != null ? _ref : filterFns[column.columnDef.filterFn];
|
|
1143
1142
|
},
|
|
1144
1143
|
getCanFilter: () => {
|
|
1145
1144
|
var _column$columnDef$ena, _instance$options$ena, _instance$options$ena2;
|
|
@@ -1428,6 +1427,11 @@
|
|
|
1428
1427
|
const Grouping = {
|
|
1429
1428
|
getDefaultColumnDef: () => {
|
|
1430
1429
|
return {
|
|
1430
|
+
aggregatedCell: props => {
|
|
1431
|
+
var _props$getValue$toStr, _props$getValue;
|
|
1432
|
+
|
|
1433
|
+
return (_props$getValue$toStr = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _props$getValue$toStr : null;
|
|
1434
|
+
},
|
|
1431
1435
|
aggregationFn: 'auto'
|
|
1432
1436
|
};
|
|
1433
1437
|
},
|
|
@@ -1488,8 +1492,6 @@
|
|
|
1488
1492
|
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
1489
1493
|
return aggregationFns.extent;
|
|
1490
1494
|
}
|
|
1491
|
-
|
|
1492
|
-
return aggregationFns.count;
|
|
1493
1495
|
},
|
|
1494
1496
|
getAggregationFn: () => {
|
|
1495
1497
|
var _ref4;
|
|
@@ -1500,7 +1502,7 @@
|
|
|
1500
1502
|
throw new Error();
|
|
1501
1503
|
}
|
|
1502
1504
|
|
|
1503
|
-
return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.aggregationFn]) != null ? _ref4 : aggregationFns[column.aggregationFn];
|
|
1505
|
+
return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.columnDef.aggregationFn]) != null ? _ref4 : aggregationFns[column.columnDef.aggregationFn];
|
|
1504
1506
|
}
|
|
1505
1507
|
};
|
|
1506
1508
|
},
|
|
@@ -1533,6 +1535,12 @@
|
|
|
1533
1535
|
};
|
|
1534
1536
|
},
|
|
1535
1537
|
createCell: (cell, column, row, instance) => {
|
|
1538
|
+
const getRenderValue = () => {
|
|
1539
|
+
var _cell$getValue;
|
|
1540
|
+
|
|
1541
|
+
return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : instance.options.renderFallbackValue;
|
|
1542
|
+
};
|
|
1543
|
+
|
|
1536
1544
|
return {
|
|
1537
1545
|
getIsGrouped: () => column.getIsGrouped() && column.id === row.groupingColumnId,
|
|
1538
1546
|
getIsPlaceholder: () => !cell.getIsGrouped() && column.getIsGrouped(),
|
|
@@ -1542,15 +1550,19 @@
|
|
|
1542
1550
|
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && ((_row$subRows = row.subRows) == null ? void 0 : _row$subRows.length) > 1;
|
|
1543
1551
|
},
|
|
1544
1552
|
renderAggregatedCell: () => {
|
|
1545
|
-
|
|
1553
|
+
{
|
|
1554
|
+
if (!column.columnDef.aggregatedCell) {
|
|
1555
|
+
console.warn('A columnDef.aggregatedCell template is recommended for displaying aggregated values.');
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1546
1558
|
|
|
1547
|
-
const template =
|
|
1559
|
+
const template = column.columnDef.aggregatedCell || column.columnDef.cell;
|
|
1548
1560
|
return template ? instance._render(template, {
|
|
1549
1561
|
instance,
|
|
1550
1562
|
column,
|
|
1551
1563
|
row,
|
|
1552
1564
|
cell,
|
|
1553
|
-
getValue:
|
|
1565
|
+
getValue: getRenderValue
|
|
1554
1566
|
}) : null;
|
|
1555
1567
|
}
|
|
1556
1568
|
};
|
|
@@ -2020,11 +2032,11 @@
|
|
|
2020
2032
|
});
|
|
2021
2033
|
},
|
|
2022
2034
|
toggleAllPageRowsSelected: value => instance.setRowSelection(old => {
|
|
2023
|
-
typeof value !== 'undefined' ? value : !instance.getIsAllPageRowsSelected();
|
|
2035
|
+
const resolvedValue = typeof value !== 'undefined' ? value : !instance.getIsAllPageRowsSelected();
|
|
2024
2036
|
const rowSelection = { ...old
|
|
2025
2037
|
};
|
|
2026
2038
|
instance.getRowModel().rows.forEach(row => {
|
|
2027
|
-
mutateRowIsSelected(rowSelection, row.id,
|
|
2039
|
+
mutateRowIsSelected(rowSelection, row.id, resolvedValue, instance);
|
|
2028
2040
|
});
|
|
2029
2041
|
return rowSelection;
|
|
2030
2042
|
}),
|
|
@@ -2179,7 +2191,7 @@
|
|
|
2179
2191
|
},
|
|
2180
2192
|
getIsSomePageRowsSelected: () => {
|
|
2181
2193
|
const paginationFlatRows = instance.getPaginationRowModel().flatRows;
|
|
2182
|
-
return instance.getIsAllPageRowsSelected() ? false :
|
|
2194
|
+
return instance.getIsAllPageRowsSelected() ? false : paginationFlatRows.some(d => d.getIsSelected() || d.getIsSomeSelected());
|
|
2183
2195
|
},
|
|
2184
2196
|
getToggleAllRowsSelectedHandler: () => {
|
|
2185
2197
|
return e => {
|
|
@@ -2533,8 +2545,10 @@
|
|
|
2533
2545
|
// })
|
|
2534
2546
|
// return
|
|
2535
2547
|
// }
|
|
2548
|
+
// this needs to be outside of instance.setSorting to be in sync with rerender
|
|
2549
|
+
const nextSortingOrder = column.getNextSortingOrder();
|
|
2536
2550
|
instance.setSorting(old => {
|
|
2537
|
-
var
|
|
2551
|
+
var _instance$options$ena, _instance$options$ena2;
|
|
2538
2552
|
|
|
2539
2553
|
// Find any existing sorting for this column
|
|
2540
2554
|
const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
|
|
@@ -2559,30 +2573,29 @@
|
|
|
2559
2573
|
} else {
|
|
2560
2574
|
sortAction = 'replace';
|
|
2561
2575
|
}
|
|
2562
|
-
}
|
|
2576
|
+
} // Handle toggle states that will remove the sorting
|
|
2563
2577
|
|
|
2564
|
-
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
|
|
2565
2578
|
|
|
2566
2579
|
if (sortAction === 'toggle' && ( // Must be toggling
|
|
2567
2580
|
(_instance$options$ena = instance.options.enableSortingRemoval) != null ? _instance$options$ena : true) && // If enableSortRemove, enable in general
|
|
2568
2581
|
!hasDescDefined && ( // Must not be setting desc
|
|
2569
|
-
multi ? (_instance$options$ena2 = instance.options.enableMultiRemove) != null ? _instance$options$ena2 : true : true) &&
|
|
2570
|
-
|
|
2571
|
-
|
|
2582
|
+
multi ? (_instance$options$ena2 = instance.options.enableMultiRemove) != null ? _instance$options$ena2 : true : true) && // If multi, don't allow if enableMultiRemove
|
|
2583
|
+
!nextSortingOrder // Finally, detect if it should indeed be removed
|
|
2584
|
+
) {
|
|
2572
2585
|
sortAction = 'remove';
|
|
2573
2586
|
}
|
|
2574
2587
|
|
|
2575
2588
|
if (sortAction === 'replace') {
|
|
2576
2589
|
newSorting = [{
|
|
2577
2590
|
id: column.id,
|
|
2578
|
-
desc: hasDescDefined ? desc :
|
|
2591
|
+
desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
|
|
2579
2592
|
}];
|
|
2580
2593
|
} else if (sortAction === 'add' && old != null && old.length) {
|
|
2581
2594
|
var _instance$options$max;
|
|
2582
2595
|
|
|
2583
2596
|
newSorting = [...old, {
|
|
2584
2597
|
id: column.id,
|
|
2585
|
-
desc: hasDescDefined ? desc :
|
|
2598
|
+
desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
|
|
2586
2599
|
}]; // Take latest n columns
|
|
2587
2600
|
|
|
2588
2601
|
newSorting.splice(0, newSorting.length - ((_instance$options$max = instance.options.maxMultiSortColCount) != null ? _instance$options$max : Number.MAX_SAFE_INTEGER));
|
|
@@ -2591,7 +2604,7 @@
|
|
|
2591
2604
|
newSorting = old.map(d => {
|
|
2592
2605
|
if (d.id === column.id) {
|
|
2593
2606
|
return { ...d,
|
|
2594
|
-
desc: hasDescDefined ? desc :
|
|
2607
|
+
desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
|
|
2595
2608
|
};
|
|
2596
2609
|
}
|
|
2597
2610
|
|
|
@@ -2604,6 +2617,23 @@
|
|
|
2604
2617
|
return newSorting;
|
|
2605
2618
|
});
|
|
2606
2619
|
},
|
|
2620
|
+
getNextSortingOrder: () => {
|
|
2621
|
+
var _ref2, _column$columnDef$sor;
|
|
2622
|
+
|
|
2623
|
+
const sortDescFirst = (_ref2 = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc';
|
|
2624
|
+
const firstSortDirection = sortDescFirst ? 'desc' : 'asc';
|
|
2625
|
+
const isSorted = column.getIsSorted();
|
|
2626
|
+
|
|
2627
|
+
if (!isSorted) {
|
|
2628
|
+
return firstSortDirection;
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
if (isSorted === firstSortDirection) {
|
|
2632
|
+
return isSorted === 'desc' ? 'asc' : 'desc';
|
|
2633
|
+
} else {
|
|
2634
|
+
return false;
|
|
2635
|
+
}
|
|
2636
|
+
},
|
|
2607
2637
|
getCanSort: () => {
|
|
2608
2638
|
var _column$columnDef$ena, _instance$options$ena3;
|
|
2609
2639
|
|
|
@@ -2895,9 +2925,9 @@
|
|
|
2895
2925
|
header: props => props.header.column.id,
|
|
2896
2926
|
footer: props => props.header.column.id,
|
|
2897
2927
|
cell: props => {
|
|
2898
|
-
var _props$getValue$toStr, _props$getValue
|
|
2928
|
+
var _props$getValue$toStr, _props$getValue;
|
|
2899
2929
|
|
|
2900
|
-
return (_props$getValue$toStr = (_props$getValue
|
|
2930
|
+
return (_props$getValue$toStr = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _props$getValue$toStr : null;
|
|
2901
2931
|
},
|
|
2902
2932
|
...instance._features.reduce((obj, feature) => {
|
|
2903
2933
|
return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
|
|
@@ -3051,6 +3081,12 @@
|
|
|
3051
3081
|
}
|
|
3052
3082
|
|
|
3053
3083
|
function createCell(instance, row, column, columnId) {
|
|
3084
|
+
const getRenderValue = () => {
|
|
3085
|
+
var _cell$getValue;
|
|
3086
|
+
|
|
3087
|
+
return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : instance.options.renderFallbackValue;
|
|
3088
|
+
};
|
|
3089
|
+
|
|
3054
3090
|
const cell = {
|
|
3055
3091
|
id: row.id + "_" + column.id,
|
|
3056
3092
|
row,
|
|
@@ -3062,7 +3098,7 @@
|
|
|
3062
3098
|
column,
|
|
3063
3099
|
row,
|
|
3064
3100
|
cell: cell,
|
|
3065
|
-
getValue:
|
|
3101
|
+
getValue: getRenderValue
|
|
3066
3102
|
}) : null;
|
|
3067
3103
|
}
|
|
3068
3104
|
};
|
|
@@ -3668,11 +3704,6 @@
|
|
|
3668
3704
|
if (aggregateFn) {
|
|
3669
3705
|
row._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows);
|
|
3670
3706
|
return row._groupingValuesCache[columnId];
|
|
3671
|
-
} else if (column.aggregationFn) {
|
|
3672
|
-
console.info({
|
|
3673
|
-
column
|
|
3674
|
-
});
|
|
3675
|
-
throw new Error("Table: Invalid column.aggregateType option for column listed above" );
|
|
3676
3707
|
}
|
|
3677
3708
|
}
|
|
3678
3709
|
});
|
|
@@ -3796,20 +3827,34 @@
|
|
|
3796
3827
|
const pageStart = pageSize * pageIndex;
|
|
3797
3828
|
const pageEnd = pageStart + pageSize;
|
|
3798
3829
|
rows = rows.slice(pageStart, pageEnd);
|
|
3830
|
+
let paginatedRowModel;
|
|
3799
3831
|
|
|
3800
3832
|
if (!instance.options.paginateExpandedRows) {
|
|
3801
|
-
|
|
3833
|
+
paginatedRowModel = expandRows({
|
|
3802
3834
|
rows,
|
|
3803
3835
|
flatRows,
|
|
3804
3836
|
rowsById
|
|
3805
3837
|
});
|
|
3838
|
+
} else {
|
|
3839
|
+
paginatedRowModel = {
|
|
3840
|
+
rows,
|
|
3841
|
+
flatRows,
|
|
3842
|
+
rowsById
|
|
3843
|
+
};
|
|
3806
3844
|
}
|
|
3807
3845
|
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3846
|
+
paginatedRowModel.flatRows = [];
|
|
3847
|
+
|
|
3848
|
+
const handleRow = row => {
|
|
3849
|
+
paginatedRowModel.flatRows.push(row);
|
|
3850
|
+
|
|
3851
|
+
if (row.subRows.length) {
|
|
3852
|
+
row.subRows.forEach(handleRow);
|
|
3853
|
+
}
|
|
3812
3854
|
};
|
|
3855
|
+
|
|
3856
|
+
paginatedRowModel.rows.forEach(handleRow);
|
|
3857
|
+
return paginatedRowModel;
|
|
3813
3858
|
}, {
|
|
3814
3859
|
key: 'getPaginationRowModel',
|
|
3815
3860
|
debug: () => {
|
|
@@ -3853,13 +3898,18 @@
|
|
|
3853
3898
|
return [content];
|
|
3854
3899
|
}
|
|
3855
3900
|
|
|
3856
|
-
class Placeholder extends internal.SvelteComponent {
|
|
3901
|
+
class Placeholder$1 extends internal.SvelteComponent {
|
|
3857
3902
|
constructor(options) {
|
|
3858
3903
|
super();
|
|
3859
3904
|
internal.init(this, options, instance, create_fragment$1, internal.safe_not_equal, { content: 0 });
|
|
3860
3905
|
}
|
|
3861
3906
|
}
|
|
3862
3907
|
|
|
3908
|
+
const PlaceholderServer = internal.create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
|
3909
|
+
return "" + internal.escape($$props.content);
|
|
3910
|
+
});
|
|
3911
|
+
var Placeholder = typeof document === 'undefined' ? PlaceholderServer : Placeholder$1;
|
|
3912
|
+
|
|
3863
3913
|
function create_fragment(ctx, Comp, props) {
|
|
3864
3914
|
let c;
|
|
3865
3915
|
let current;
|
|
@@ -3872,6 +3922,10 @@
|
|
|
3872
3922
|
internal.create_component(c.$$.fragment);
|
|
3873
3923
|
},
|
|
3874
3924
|
|
|
3925
|
+
l(nodes) {
|
|
3926
|
+
internal.claim_component(c.$$.fragment, nodes);
|
|
3927
|
+
},
|
|
3928
|
+
|
|
3875
3929
|
m(target, anchor) {
|
|
3876
3930
|
// @ts-ignore
|
|
3877
3931
|
internal.mount_component(c, target, anchor);
|
|
@@ -3910,7 +3964,7 @@
|
|
|
3910
3964
|
|
|
3911
3965
|
function renderServer(Comp, props) {
|
|
3912
3966
|
const WrapperComp = internal.create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
|
3913
|
-
return "" + internal.validate_component(Comp, '
|
|
3967
|
+
return "" + internal.validate_component(Comp, 'TableComponent').$$render($$result, props, {}, {});
|
|
3914
3968
|
});
|
|
3915
3969
|
return WrapperComp;
|
|
3916
3970
|
}
|
|
@@ -3922,7 +3976,10 @@
|
|
|
3922
3976
|
}
|
|
3923
3977
|
|
|
3924
3978
|
function isSvelteClientComponent(component) {
|
|
3925
|
-
|
|
3979
|
+
var _component$name, _component$name2;
|
|
3980
|
+
|
|
3981
|
+
let isHMR = ('__SVELTE_HMR' in window);
|
|
3982
|
+
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('>'));
|
|
3926
3983
|
}
|
|
3927
3984
|
|
|
3928
3985
|
function isSvelteComponent(component) {
|
|
@@ -3976,6 +4033,7 @@
|
|
|
3976
4033
|
onStateChange: () => {},
|
|
3977
4034
|
// noop
|
|
3978
4035
|
render,
|
|
4036
|
+
renderFallbackValue: null,
|
|
3979
4037
|
...store.get(optionsStore)
|
|
3980
4038
|
};
|
|
3981
4039
|
let instance = createTableInstance$1(resolvedOptions);
|