@tanstack/svelte-table 8.0.0-alpha.78 → 8.0.0-alpha.82
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 +5 -0
- package/build/cjs/svelte-table/src/index.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +33 -15
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +29 -16
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +38 -38
- package/build/umd/index.development.js +33 -15
- 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":"1e4f-163"},{"name":"svelte-table/src","children":[{"uid":"1e4f-165","name":"placeholder.svelte"},{"uid":"1e4f-167","name":"render-component.ts"},{"uid":"1e4f-169","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"1e4f-163":{"renderedLength":140240,"gzipLength":23956,"brotliLength":0,"mainUid":"1e4f-162"},"1e4f-165":{"renderedLength":925,"gzipLength":444,"brotliLength":0,"mainUid":"1e4f-164"},"1e4f-167":{"renderedLength":1365,"gzipLength":519,"brotliLength":0,"mainUid":"1e4f-166"},"1e4f-169":{"renderedLength":2729,"gzipLength":868,"brotliLength":0,"mainUid":"1e4f-168"}},"nodeMetas":{"1e4f-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"1e4f-163"},"imported":[],"importedBy":[{"uid":"1e4f-168"}]},"1e4f-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"1e4f-165"},"imported":[{"uid":"1e4f-170"}],"importedBy":[{"uid":"1e4f-168"}]},"1e4f-166":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"1e4f-167"},"imported":[{"uid":"1e4f-170"}],"importedBy":[{"uid":"1e4f-168"}]},"1e4f-168":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"1e4f-169"},"imported":[{"uid":"1e4f-162"},{"uid":"1e4f-164"},{"uid":"1e4f-170"},{"uid":"1e4f-171"},{"uid":"1e4f-166"}],"importedBy":[],"isEntry":true},"1e4f-170":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"1e4f-168"},{"uid":"1e4f-164"},{"uid":"1e4f-166"}],"isExternal":true},"1e4f-171":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"1e4f-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": "1e4f-173"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "svelte-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "1e4f-175",
|
|
21
21
|
"name": "placeholder.svelte"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "1e4f-177",
|
|
25
25
|
"name": "render-component.ts"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"uid": "
|
|
28
|
+
"uid": "1e4f-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
|
+
"1e4f-173": {
|
|
42
|
+
"renderedLength": 140240,
|
|
43
|
+
"gzipLength": 23956,
|
|
44
44
|
"brotliLength": 0,
|
|
45
|
-
"mainUid": "
|
|
45
|
+
"mainUid": "1e4f-172"
|
|
46
46
|
},
|
|
47
|
-
"
|
|
47
|
+
"1e4f-175": {
|
|
48
48
|
"renderedLength": 925,
|
|
49
49
|
"gzipLength": 444,
|
|
50
50
|
"brotliLength": 0,
|
|
51
|
-
"mainUid": "
|
|
51
|
+
"mainUid": "1e4f-174"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
53
|
+
"1e4f-177": {
|
|
54
54
|
"renderedLength": 1365,
|
|
55
55
|
"gzipLength": 519,
|
|
56
56
|
"brotliLength": 0,
|
|
57
|
-
"mainUid": "
|
|
57
|
+
"mainUid": "1e4f-176"
|
|
58
58
|
},
|
|
59
|
-
"
|
|
59
|
+
"1e4f-179": {
|
|
60
60
|
"renderedLength": 2729,
|
|
61
61
|
"gzipLength": 868,
|
|
62
62
|
"brotliLength": 0,
|
|
63
|
-
"mainUid": "
|
|
63
|
+
"mainUid": "1e4f-178"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"nodeMetas": {
|
|
67
|
-
"
|
|
67
|
+
"1e4f-172": {
|
|
68
68
|
"id": "/packages/table-core/build/esm/index.js",
|
|
69
69
|
"moduleParts": {
|
|
70
|
-
"index.production.js": "
|
|
70
|
+
"index.production.js": "1e4f-173"
|
|
71
71
|
},
|
|
72
72
|
"imported": [],
|
|
73
73
|
"importedBy": [
|
|
74
74
|
{
|
|
75
|
-
"uid": "
|
|
75
|
+
"uid": "1e4f-178"
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"1e4f-174": {
|
|
80
80
|
"id": "/packages/svelte-table/src/placeholder.svelte",
|
|
81
81
|
"moduleParts": {
|
|
82
|
-
"index.production.js": "
|
|
82
|
+
"index.production.js": "1e4f-175"
|
|
83
83
|
},
|
|
84
84
|
"imported": [
|
|
85
85
|
{
|
|
86
|
-
"uid": "
|
|
86
|
+
"uid": "1e4f-180"
|
|
87
87
|
}
|
|
88
88
|
],
|
|
89
89
|
"importedBy": [
|
|
90
90
|
{
|
|
91
|
-
"uid": "
|
|
91
|
+
"uid": "1e4f-178"
|
|
92
92
|
}
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"
|
|
95
|
+
"1e4f-176": {
|
|
96
96
|
"id": "/packages/svelte-table/src/render-component.ts",
|
|
97
97
|
"moduleParts": {
|
|
98
|
-
"index.production.js": "
|
|
98
|
+
"index.production.js": "1e4f-177"
|
|
99
99
|
},
|
|
100
100
|
"imported": [
|
|
101
101
|
{
|
|
102
|
-
"uid": "
|
|
102
|
+
"uid": "1e4f-180"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"importedBy": [
|
|
106
106
|
{
|
|
107
|
-
"uid": "
|
|
107
|
+
"uid": "1e4f-178"
|
|
108
108
|
}
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"1e4f-178": {
|
|
112
112
|
"id": "/packages/svelte-table/src/index.ts",
|
|
113
113
|
"moduleParts": {
|
|
114
|
-
"index.production.js": "
|
|
114
|
+
"index.production.js": "1e4f-179"
|
|
115
115
|
},
|
|
116
116
|
"imported": [
|
|
117
117
|
{
|
|
118
|
-
"uid": "
|
|
118
|
+
"uid": "1e4f-172"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
"uid": "
|
|
121
|
+
"uid": "1e4f-174"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
"uid": "
|
|
124
|
+
"uid": "1e4f-180"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
"uid": "
|
|
127
|
+
"uid": "1e4f-181"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
|
-
"uid": "
|
|
130
|
+
"uid": "1e4f-176"
|
|
131
131
|
}
|
|
132
132
|
],
|
|
133
133
|
"importedBy": [],
|
|
134
134
|
"isEntry": true
|
|
135
135
|
},
|
|
136
|
-
"
|
|
136
|
+
"1e4f-180": {
|
|
137
137
|
"id": "svelte/internal",
|
|
138
138
|
"moduleParts": {},
|
|
139
139
|
"imported": [],
|
|
140
140
|
"importedBy": [
|
|
141
141
|
{
|
|
142
|
-
"uid": "
|
|
142
|
+
"uid": "1e4f-178"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
|
-
"uid": "
|
|
145
|
+
"uid": "1e4f-174"
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
|
-
"uid": "
|
|
148
|
+
"uid": "1e4f-176"
|
|
149
149
|
}
|
|
150
150
|
],
|
|
151
151
|
"isExternal": true
|
|
152
152
|
},
|
|
153
|
-
"
|
|
153
|
+
"1e4f-181": {
|
|
154
154
|
"id": "svelte/store",
|
|
155
155
|
"moduleParts": {},
|
|
156
156
|
"imported": [],
|
|
157
157
|
"importedBy": [
|
|
158
158
|
{
|
|
159
|
-
"uid": "
|
|
159
|
+
"uid": "1e4f-178"
|
|
160
160
|
}
|
|
161
161
|
],
|
|
162
162
|
"isExternal": true
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
const column = instance.getColumn(columnId);
|
|
301
301
|
|
|
302
302
|
if (!column.accessorFn) {
|
|
303
|
-
|
|
303
|
+
return undefined;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
row.valuesCache[columnId] = column.accessorFn(row.original, rowIndex);
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
-
const startSize =
|
|
540
|
+
const startSize = header.getSize();
|
|
541
541
|
const columnSizingStart = header ? header.getLeafHeaders().map(d => [d.column.id, d.column.getSize()]) : [[column.id, column.getSize()]];
|
|
542
542
|
const clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX;
|
|
543
543
|
|
|
@@ -1091,7 +1091,8 @@
|
|
|
1091
1091
|
},
|
|
1092
1092
|
createRow: (row, instance) => {
|
|
1093
1093
|
return {
|
|
1094
|
-
|
|
1094
|
+
columnFilters: {},
|
|
1095
|
+
columnFiltersMeta: {},
|
|
1095
1096
|
subRowsByFacetId: {}
|
|
1096
1097
|
};
|
|
1097
1098
|
},
|
|
@@ -2333,7 +2334,7 @@
|
|
|
2333
2334
|
createColumn: (column, instance) => {
|
|
2334
2335
|
return {
|
|
2335
2336
|
getAutoSortingFn: () => {
|
|
2336
|
-
const firstRows = instance.getFilteredRowModel().flatRows.slice(
|
|
2337
|
+
const firstRows = instance.getFilteredRowModel().flatRows.slice(10);
|
|
2337
2338
|
let isString = false;
|
|
2338
2339
|
|
|
2339
2340
|
for (const row of firstRows) {
|
|
@@ -3181,6 +3182,7 @@
|
|
|
3181
3182
|
setRowType: () => table,
|
|
3182
3183
|
setTableMetaType: () => table,
|
|
3183
3184
|
setColumnMetaType: () => table,
|
|
3185
|
+
setFilterMetaType: () => table,
|
|
3184
3186
|
setOptions: newOptions => createTable$1(_, __, { ...options,
|
|
3185
3187
|
...newOptions
|
|
3186
3188
|
}),
|
|
@@ -3308,7 +3310,7 @@
|
|
|
3308
3310
|
|
|
3309
3311
|
if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
|
|
3310
3312
|
newRow = instance.createRow(row.id, row.original, row.index, row.depth);
|
|
3311
|
-
newRow.
|
|
3313
|
+
newRow.columnFilters = row.columnFilters;
|
|
3312
3314
|
newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
|
|
3313
3315
|
|
|
3314
3316
|
if (!newRow.subRows.length) {
|
|
@@ -3381,6 +3383,11 @@
|
|
|
3381
3383
|
function getFilteredRowModel() {
|
|
3382
3384
|
return instance => memo(() => [instance.getPreFilteredRowModel(), instance.getState().columnFilters, instance.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
|
|
3383
3385
|
if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
|
|
3386
|
+
for (let i = 0; i < rowModel.flatRows.length; i++) {
|
|
3387
|
+
rowModel.flatRows[i].columnFilters = {};
|
|
3388
|
+
rowModel.flatRows[i].columnFiltersMeta = {};
|
|
3389
|
+
}
|
|
3390
|
+
|
|
3384
3391
|
return rowModel;
|
|
3385
3392
|
}
|
|
3386
3393
|
|
|
@@ -3435,28 +3442,34 @@
|
|
|
3435
3442
|
|
|
3436
3443
|
for (let j = 0; j < rowModel.flatRows.length; j++) {
|
|
3437
3444
|
const row = rowModel.flatRows[j];
|
|
3438
|
-
row.
|
|
3445
|
+
row.columnFilters = {};
|
|
3439
3446
|
|
|
3440
3447
|
if (resolvedColumnFilters.length) {
|
|
3441
3448
|
for (let i = 0; i < resolvedColumnFilters.length; i++) {
|
|
3442
|
-
currentColumnFilter = resolvedColumnFilters[i];
|
|
3449
|
+
currentColumnFilter = resolvedColumnFilters[i];
|
|
3450
|
+
const id = currentColumnFilter.id; // Tag the row with the column filter state
|
|
3443
3451
|
|
|
3444
|
-
row.
|
|
3452
|
+
row.columnFilters[id] = currentColumnFilter.filterFn(row, id, currentColumnFilter.resolvedValue, filterMeta => {
|
|
3453
|
+
row.columnFiltersMeta[id] = filterMeta;
|
|
3454
|
+
});
|
|
3445
3455
|
}
|
|
3446
3456
|
}
|
|
3447
3457
|
|
|
3448
3458
|
if (resolvedGlobalFilters.length) {
|
|
3449
3459
|
for (let i = 0; i < resolvedGlobalFilters.length; i++) {
|
|
3450
|
-
currentGlobalFilter = resolvedGlobalFilters[i];
|
|
3460
|
+
currentGlobalFilter = resolvedGlobalFilters[i];
|
|
3461
|
+
const id = currentGlobalFilter.id; // Tag the row with the first truthy global filter state
|
|
3451
3462
|
|
|
3452
|
-
if (currentGlobalFilter.filterFn(row,
|
|
3453
|
-
row.
|
|
3463
|
+
if (currentGlobalFilter.filterFn(row, id, currentGlobalFilter.resolvedValue, filterMeta => {
|
|
3464
|
+
row.columnFiltersMeta[id] = filterMeta;
|
|
3465
|
+
})) {
|
|
3466
|
+
row.columnFilters.__global__ = true;
|
|
3454
3467
|
break;
|
|
3455
3468
|
}
|
|
3456
3469
|
}
|
|
3457
3470
|
|
|
3458
|
-
if (row.
|
|
3459
|
-
row.
|
|
3471
|
+
if (row.columnFilters.__global__ !== true) {
|
|
3472
|
+
row.columnFilters.__global__ = false;
|
|
3460
3473
|
}
|
|
3461
3474
|
}
|
|
3462
3475
|
}
|
|
@@ -3464,7 +3477,7 @@
|
|
|
3464
3477
|
const filterRowsImpl = row => {
|
|
3465
3478
|
// Horizontally filter rows through each column
|
|
3466
3479
|
for (let i = 0; i < filterableIds.length; i++) {
|
|
3467
|
-
if (row.
|
|
3480
|
+
if (row.columnFilters[filterableIds[i]] === false) {
|
|
3468
3481
|
return false;
|
|
3469
3482
|
}
|
|
3470
3483
|
}
|
|
@@ -3498,7 +3511,7 @@
|
|
|
3498
3511
|
const filterRowsImpl = row => {
|
|
3499
3512
|
// Horizontally filter rows through each column
|
|
3500
3513
|
for (let i = 0; i < filterableIds.length; i++) {
|
|
3501
|
-
if (row.
|
|
3514
|
+
if (row.columnFilters[filterableIds[i]] === false) {
|
|
3502
3515
|
return false;
|
|
3503
3516
|
}
|
|
3504
3517
|
}
|
|
@@ -4113,12 +4126,14 @@
|
|
|
4113
4126
|
exports.RowSelection = RowSelection;
|
|
4114
4127
|
exports.Sorting = Sorting;
|
|
4115
4128
|
exports.Visibility = Visibility;
|
|
4129
|
+
exports.aggregationFns = aggregationFns;
|
|
4116
4130
|
exports.buildHeaderGroups = buildHeaderGroups;
|
|
4117
4131
|
exports.createTable = createTable;
|
|
4118
4132
|
exports.createTableFactory = createTableFactory;
|
|
4119
4133
|
exports.createTableInstance = createTableInstance;
|
|
4120
4134
|
exports.defaultColumnSizing = defaultColumnSizing;
|
|
4121
4135
|
exports.expandRows = expandRows;
|
|
4136
|
+
exports.filterFns = filterFns;
|
|
4122
4137
|
exports.flattenBy = flattenBy;
|
|
4123
4138
|
exports.functionalUpdate = functionalUpdate;
|
|
4124
4139
|
exports.getCoreRowModel = getCoreRowModel;
|
|
@@ -4133,14 +4148,17 @@
|
|
|
4133
4148
|
exports.isFunction = isFunction;
|
|
4134
4149
|
exports.isRowSelected = isRowSelected;
|
|
4135
4150
|
exports.makeStateUpdater = makeStateUpdater;
|
|
4151
|
+
exports.mean = mean;
|
|
4136
4152
|
exports.memo = memo;
|
|
4137
4153
|
exports.noop = noop;
|
|
4138
4154
|
exports.orderColumns = orderColumns;
|
|
4139
4155
|
exports.passiveEventSupported = passiveEventSupported;
|
|
4156
|
+
exports.reSplitAlphaNumeric = reSplitAlphaNumeric;
|
|
4140
4157
|
exports.render = render;
|
|
4141
4158
|
exports.renderComponent = renderComponent;
|
|
4142
4159
|
exports.selectRowsFn = selectRowsFn;
|
|
4143
4160
|
exports.shouldAutoRemoveFilter = shouldAutoRemoveFilter;
|
|
4161
|
+
exports.sortingFns = sortingFns;
|
|
4144
4162
|
|
|
4145
4163
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4146
4164
|
|