@tanstack/svelte-table 8.0.0-alpha.72 → 8.0.0-alpha.76
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 +59 -159
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +59 -159
- 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 +59 -159
- 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 +4 -4
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":"e2ab-163"},{"name":"svelte-table/src","children":[{"uid":"e2ab-165","name":"placeholder.svelte"},{"uid":"e2ab-167","name":"render-component.ts"},{"uid":"e2ab-169","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"e2ab-163":{"renderedLength":139597,"gzipLength":23873,"brotliLength":0,"mainUid":"e2ab-162"},"e2ab-165":{"renderedLength":925,"gzipLength":444,"brotliLength":0,"mainUid":"e2ab-164"},"e2ab-167":{"renderedLength":1365,"gzipLength":519,"brotliLength":0,"mainUid":"e2ab-166"},"e2ab-169":{"renderedLength":1958,"gzipLength":709,"brotliLength":0,"mainUid":"e2ab-168"}},"nodeMetas":{"e2ab-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"e2ab-163"},"imported":[],"importedBy":[{"uid":"e2ab-168"}]},"e2ab-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"e2ab-165"},"imported":[{"uid":"e2ab-171"}],"importedBy":[{"uid":"e2ab-168"}]},"e2ab-166":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"e2ab-167"},"imported":[{"uid":"e2ab-171"}],"importedBy":[{"uid":"e2ab-168"}]},"e2ab-168":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"e2ab-169"},"imported":[{"uid":"e2ab-162"},{"uid":"e2ab-164"},{"uid":"e2ab-170"},{"uid":"e2ab-166"}],"importedBy":[],"isEntry":true},"e2ab-170":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"e2ab-168"}],"isExternal":true},"e2ab-171":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"e2ab-164"},{"uid":"e2ab-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": "e2ab-173"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "svelte-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "e2ab-175",
|
|
21
21
|
"name": "placeholder.svelte"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "e2ab-177",
|
|
25
25
|
"name": "render-component.ts"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"uid": "
|
|
28
|
+
"uid": "e2ab-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
|
+
"e2ab-173": {
|
|
42
|
+
"renderedLength": 139597,
|
|
43
|
+
"gzipLength": 23873,
|
|
44
44
|
"brotliLength": 0,
|
|
45
|
-
"mainUid": "
|
|
45
|
+
"mainUid": "e2ab-172"
|
|
46
46
|
},
|
|
47
|
-
"
|
|
47
|
+
"e2ab-175": {
|
|
48
48
|
"renderedLength": 925,
|
|
49
49
|
"gzipLength": 444,
|
|
50
50
|
"brotliLength": 0,
|
|
51
|
-
"mainUid": "
|
|
51
|
+
"mainUid": "e2ab-174"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
53
|
+
"e2ab-177": {
|
|
54
54
|
"renderedLength": 1365,
|
|
55
55
|
"gzipLength": 519,
|
|
56
56
|
"brotliLength": 0,
|
|
57
|
-
"mainUid": "
|
|
57
|
+
"mainUid": "e2ab-176"
|
|
58
58
|
},
|
|
59
|
-
"
|
|
59
|
+
"e2ab-179": {
|
|
60
60
|
"renderedLength": 1958,
|
|
61
61
|
"gzipLength": 709,
|
|
62
62
|
"brotliLength": 0,
|
|
63
|
-
"mainUid": "
|
|
63
|
+
"mainUid": "e2ab-178"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"nodeMetas": {
|
|
67
|
-
"
|
|
67
|
+
"e2ab-172": {
|
|
68
68
|
"id": "/packages/table-core/build/esm/index.js",
|
|
69
69
|
"moduleParts": {
|
|
70
|
-
"index.production.js": "
|
|
70
|
+
"index.production.js": "e2ab-173"
|
|
71
71
|
},
|
|
72
72
|
"imported": [],
|
|
73
73
|
"importedBy": [
|
|
74
74
|
{
|
|
75
|
-
"uid": "
|
|
75
|
+
"uid": "e2ab-178"
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"e2ab-174": {
|
|
80
80
|
"id": "/packages/svelte-table/src/placeholder.svelte",
|
|
81
81
|
"moduleParts": {
|
|
82
|
-
"index.production.js": "
|
|
82
|
+
"index.production.js": "e2ab-175"
|
|
83
83
|
},
|
|
84
84
|
"imported": [
|
|
85
85
|
{
|
|
86
|
-
"uid": "
|
|
86
|
+
"uid": "e2ab-181"
|
|
87
87
|
}
|
|
88
88
|
],
|
|
89
89
|
"importedBy": [
|
|
90
90
|
{
|
|
91
|
-
"uid": "
|
|
91
|
+
"uid": "e2ab-178"
|
|
92
92
|
}
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"
|
|
95
|
+
"e2ab-176": {
|
|
96
96
|
"id": "/packages/svelte-table/src/render-component.ts",
|
|
97
97
|
"moduleParts": {
|
|
98
|
-
"index.production.js": "
|
|
98
|
+
"index.production.js": "e2ab-177"
|
|
99
99
|
},
|
|
100
100
|
"imported": [
|
|
101
101
|
{
|
|
102
|
-
"uid": "
|
|
102
|
+
"uid": "e2ab-181"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"importedBy": [
|
|
106
106
|
{
|
|
107
|
-
"uid": "
|
|
107
|
+
"uid": "e2ab-178"
|
|
108
108
|
}
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"e2ab-178": {
|
|
112
112
|
"id": "/packages/svelte-table/src/index.ts",
|
|
113
113
|
"moduleParts": {
|
|
114
|
-
"index.production.js": "
|
|
114
|
+
"index.production.js": "e2ab-179"
|
|
115
115
|
},
|
|
116
116
|
"imported": [
|
|
117
117
|
{
|
|
118
|
-
"uid": "
|
|
118
|
+
"uid": "e2ab-172"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
"uid": "
|
|
121
|
+
"uid": "e2ab-174"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
"uid": "
|
|
124
|
+
"uid": "e2ab-180"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
"uid": "
|
|
127
|
+
"uid": "e2ab-176"
|
|
128
128
|
}
|
|
129
129
|
],
|
|
130
130
|
"importedBy": [],
|
|
131
131
|
"isEntry": true
|
|
132
132
|
},
|
|
133
|
-
"
|
|
133
|
+
"e2ab-180": {
|
|
134
134
|
"id": "svelte/store",
|
|
135
135
|
"moduleParts": {},
|
|
136
136
|
"imported": [],
|
|
137
137
|
"importedBy": [
|
|
138
138
|
{
|
|
139
|
-
"uid": "
|
|
139
|
+
"uid": "e2ab-178"
|
|
140
140
|
}
|
|
141
141
|
],
|
|
142
142
|
"isExternal": true
|
|
143
143
|
},
|
|
144
|
-
"
|
|
144
|
+
"e2ab-181": {
|
|
145
145
|
"id": "svelte/internal",
|
|
146
146
|
"moduleParts": {},
|
|
147
147
|
"imported": [],
|
|
148
148
|
"importedBy": [
|
|
149
149
|
{
|
|
150
|
-
"uid": "
|
|
150
|
+
"uid": "e2ab-174"
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
|
-
"uid": "
|
|
153
|
+
"uid": "e2ab-176"
|
|
154
154
|
}
|
|
155
155
|
],
|
|
156
156
|
"isExternal": true
|
|
@@ -385,7 +385,7 @@
|
|
|
385
385
|
row,
|
|
386
386
|
column,
|
|
387
387
|
getValue: () => row.getValue(columnId),
|
|
388
|
-
renderCell: () => column.cell ? instance.
|
|
388
|
+
renderCell: () => column.cell ? instance._render(column.cell, {
|
|
389
389
|
instance,
|
|
390
390
|
column,
|
|
391
391
|
row,
|
|
@@ -709,9 +709,10 @@
|
|
|
709
709
|
return {
|
|
710
710
|
_autoResetExpanded: () => {
|
|
711
711
|
if (!registered) {
|
|
712
|
-
instance.
|
|
712
|
+
instance._queue(() => {
|
|
713
713
|
registered = true;
|
|
714
714
|
});
|
|
715
|
+
|
|
715
716
|
return;
|
|
716
717
|
}
|
|
717
718
|
|
|
@@ -722,7 +723,8 @@
|
|
|
722
723
|
if (instance.options.autoResetAll === true || instance.options.autoResetExpanded) {
|
|
723
724
|
if (queued) return;
|
|
724
725
|
queued = true;
|
|
725
|
-
|
|
726
|
+
|
|
727
|
+
instance._queue(() => {
|
|
726
728
|
instance.resetExpanded();
|
|
727
729
|
queued = false;
|
|
728
730
|
});
|
|
@@ -1406,7 +1408,7 @@
|
|
|
1406
1408
|
var _column$aggregatedCel;
|
|
1407
1409
|
|
|
1408
1410
|
const template = (_column$aggregatedCel = column.aggregatedCell) != null ? _column$aggregatedCel : column.cell;
|
|
1409
|
-
return template ? instance.
|
|
1411
|
+
return template ? instance._render(template, {
|
|
1410
1412
|
instance,
|
|
1411
1413
|
column,
|
|
1412
1414
|
row,
|
|
@@ -1507,8 +1509,7 @@
|
|
|
1507
1509
|
},
|
|
1508
1510
|
getDefaultOptions: instance => {
|
|
1509
1511
|
return {
|
|
1510
|
-
onPaginationChange: makeStateUpdater('pagination', instance)
|
|
1511
|
-
autoResetPageIndex: true
|
|
1512
|
+
onPaginationChange: makeStateUpdater('pagination', instance)
|
|
1512
1513
|
};
|
|
1513
1514
|
},
|
|
1514
1515
|
createInstance: instance => {
|
|
@@ -1516,21 +1517,21 @@
|
|
|
1516
1517
|
let queued = false;
|
|
1517
1518
|
return {
|
|
1518
1519
|
_autoResetPageIndex: () => {
|
|
1520
|
+
var _ref, _instance$options$aut;
|
|
1521
|
+
|
|
1519
1522
|
if (!registered) {
|
|
1520
|
-
instance.
|
|
1523
|
+
instance._queue(() => {
|
|
1521
1524
|
registered = true;
|
|
1522
1525
|
});
|
|
1523
|
-
return;
|
|
1524
|
-
}
|
|
1525
1526
|
|
|
1526
|
-
if (instance.options.autoResetAll === false) {
|
|
1527
1527
|
return;
|
|
1528
1528
|
}
|
|
1529
1529
|
|
|
1530
|
-
if (instance.options.autoResetAll
|
|
1530
|
+
if ((_ref = (_instance$options$aut = instance.options.autoResetAll) != null ? _instance$options$aut : instance.options.autoResetPageIndex) != null ? _ref : !instance.options.manualPagination) {
|
|
1531
1531
|
if (queued) return;
|
|
1532
1532
|
queued = true;
|
|
1533
|
-
|
|
1533
|
+
|
|
1534
|
+
instance._queue(() => {
|
|
1534
1535
|
instance.resetPageIndex();
|
|
1535
1536
|
queued = false;
|
|
1536
1537
|
});
|
|
@@ -1552,7 +1553,7 @@
|
|
|
1552
1553
|
setPageIndex: updater => {
|
|
1553
1554
|
instance.setPagination(old => {
|
|
1554
1555
|
let pageIndex = functionalUpdate(updater, old.pageIndex);
|
|
1555
|
-
const maxPageIndex =
|
|
1556
|
+
const maxPageIndex = typeof old.pageCount !== 'undefined' ? old.pageCount - 1 : Number.MAX_SAFE_INTEGER;
|
|
1556
1557
|
pageIndex = Math.min(Math.max(0, pageIndex), maxPageIndex);
|
|
1557
1558
|
return { ...old,
|
|
1558
1559
|
pageIndex
|
|
@@ -2663,12 +2664,12 @@
|
|
|
2663
2664
|
recurseHeader(header);
|
|
2664
2665
|
return leafHeaders;
|
|
2665
2666
|
},
|
|
2666
|
-
renderHeader: () => column.header ? instance.
|
|
2667
|
+
renderHeader: () => column.header ? instance._render(column.header, {
|
|
2667
2668
|
instance,
|
|
2668
2669
|
header: header,
|
|
2669
2670
|
column
|
|
2670
2671
|
}) : null,
|
|
2671
|
-
renderFooter: () => column.footer ? instance.
|
|
2672
|
+
renderFooter: () => column.footer ? instance._render(column.footer, {
|
|
2672
2673
|
instance,
|
|
2673
2674
|
header: header,
|
|
2674
2675
|
column
|
|
@@ -2708,8 +2709,10 @@
|
|
|
2708
2709
|
}
|
|
2709
2710
|
}),
|
|
2710
2711
|
getLeftHeaderGroups: memo(() => [instance.getAllColumns(), instance.getVisibleLeafColumns(), instance.getState().columnPinning.left], (allColumns, leafColumns, left) => {
|
|
2711
|
-
|
|
2712
|
-
|
|
2712
|
+
var _left$map$filter;
|
|
2713
|
+
|
|
2714
|
+
const orderedLeafColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
|
|
2715
|
+
return buildHeaderGroups(allColumns, orderedLeafColumns, instance, 'left');
|
|
2713
2716
|
}, {
|
|
2714
2717
|
key: 'getLeftHeaderGroups',
|
|
2715
2718
|
debug: () => {
|
|
@@ -2719,8 +2722,10 @@
|
|
|
2719
2722
|
}
|
|
2720
2723
|
}),
|
|
2721
2724
|
getRightHeaderGroups: memo(() => [instance.getAllColumns(), instance.getVisibleLeafColumns(), instance.getState().columnPinning.right], (allColumns, leafColumns, right) => {
|
|
2722
|
-
|
|
2723
|
-
|
|
2725
|
+
var _right$map$filter;
|
|
2726
|
+
|
|
2727
|
+
const orderedLeafColumns = (_right$map$filter = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
|
|
2728
|
+
return buildHeaderGroups(allColumns, orderedLeafColumns, instance, 'right');
|
|
2724
2729
|
}, {
|
|
2725
2730
|
key: 'getRightHeaderGroups',
|
|
2726
2731
|
debug: () => {
|
|
@@ -3031,7 +3036,6 @@
|
|
|
3031
3036
|
// data: Batch[]
|
|
3032
3037
|
// facets: Batch[]
|
|
3033
3038
|
// }
|
|
3034
|
-
// export type TaskPriority = keyof CoreBatches
|
|
3035
3039
|
function createTableInstance$1(options) {
|
|
3036
3040
|
var _options$initialState;
|
|
3037
3041
|
|
|
@@ -3070,64 +3074,7 @@
|
|
|
3070
3074
|
});
|
|
3071
3075
|
|
|
3072
3076
|
const queued = [];
|
|
3073
|
-
let queuedTimeout = false;
|
|
3074
|
-
// let working = false
|
|
3075
|
-
// let latestCallback: ReturnType<typeof requestIdleCallback>
|
|
3076
|
-
// let batchUid = 0
|
|
3077
|
-
// const onProgress = () => {}
|
|
3078
|
-
// const getBatch = () => {
|
|
3079
|
-
// instance.batches.data = instance.batches.data.filter(d => d.tasks.length)
|
|
3080
|
-
// instance.batches.facets = instance.batches.facets.filter(
|
|
3081
|
-
// d => d.tasks.length
|
|
3082
|
-
// )
|
|
3083
|
-
// return (
|
|
3084
|
-
// instance.batches.data.find(d => d.tasks.length) ??
|
|
3085
|
-
// instance.batches.facets.find(d => d.tasks.length)
|
|
3086
|
-
// )
|
|
3087
|
-
// }
|
|
3088
|
-
// const startWorkLoop = () => {
|
|
3089
|
-
// working = true
|
|
3090
|
-
// const workLoop = (deadline: IdleDeadline) => {
|
|
3091
|
-
// const batch = getBatch()
|
|
3092
|
-
// if (!batch) {
|
|
3093
|
-
// working = false
|
|
3094
|
-
// return
|
|
3095
|
-
// }
|
|
3096
|
-
// // Prioritize tasks
|
|
3097
|
-
// while (deadline.timeRemaining() > 0 && batch.tasks.length) {
|
|
3098
|
-
// batch.tasks.shift()!()
|
|
3099
|
-
// }
|
|
3100
|
-
// onProgress()
|
|
3101
|
-
// if (working) {
|
|
3102
|
-
// latestCallback = requestIdleCallback(workLoop, { timeout: 10000 })
|
|
3103
|
-
// }
|
|
3104
|
-
// }
|
|
3105
|
-
// latestCallback = requestIdleCallback(workLoop, { timeout: 10000 })
|
|
3106
|
-
// }
|
|
3107
|
-
// const startWork = () => {
|
|
3108
|
-
// if (getBatch() && !working) {
|
|
3109
|
-
// if (
|
|
3110
|
-
// ("development" === 'development' && instance.options.debugAll) ??
|
|
3111
|
-
// instance.options.debugTable
|
|
3112
|
-
// ) {
|
|
3113
|
-
// console.info('Starting work...')
|
|
3114
|
-
// }
|
|
3115
|
-
// startWorkLoop()
|
|
3116
|
-
// }
|
|
3117
|
-
// }
|
|
3118
|
-
// const stopWork = () => {
|
|
3119
|
-
// if (working) {
|
|
3120
|
-
// if (
|
|
3121
|
-
// ("development" === 'development' && instance.options.debugAll) ??
|
|
3122
|
-
// instance.options.debugTable
|
|
3123
|
-
// ) {
|
|
3124
|
-
// console.info('Stopping work...')
|
|
3125
|
-
// }
|
|
3126
|
-
// working = false
|
|
3127
|
-
// cancelIdleCallback(latestCallback)
|
|
3128
|
-
// }
|
|
3129
|
-
// }
|
|
3130
|
-
|
|
3077
|
+
let queuedTimeout = false;
|
|
3131
3078
|
const midInstance = { ...instance,
|
|
3132
3079
|
// init: () => {
|
|
3133
3080
|
// startWork()
|
|
@@ -3142,7 +3089,7 @@
|
|
|
3142
3089
|
...options
|
|
3143
3090
|
},
|
|
3144
3091
|
initialState,
|
|
3145
|
-
|
|
3092
|
+
_queue: cb => {
|
|
3146
3093
|
queued.push(cb);
|
|
3147
3094
|
|
|
3148
3095
|
if (!queuedTimeout) {
|
|
@@ -3160,39 +3107,6 @@
|
|
|
3160
3107
|
}));
|
|
3161
3108
|
}
|
|
3162
3109
|
},
|
|
3163
|
-
// batches: {
|
|
3164
|
-
// data: [],
|
|
3165
|
-
// facets: [],
|
|
3166
|
-
// },
|
|
3167
|
-
// createBatch: priority => {
|
|
3168
|
-
// const batchId = batchUid++
|
|
3169
|
-
// let canceled: boolean
|
|
3170
|
-
// const batch: Batch = {
|
|
3171
|
-
// id: batchId,
|
|
3172
|
-
// priority,
|
|
3173
|
-
// tasks: [],
|
|
3174
|
-
// schedule: cb => {
|
|
3175
|
-
// if (canceled) return
|
|
3176
|
-
// batch.tasks.push(cb)
|
|
3177
|
-
// if (!working && !workScheduled) {
|
|
3178
|
-
// workScheduled = true
|
|
3179
|
-
// instance.queue(() => {
|
|
3180
|
-
// workScheduled = false
|
|
3181
|
-
// instance.setState(old => ({ ...old }))
|
|
3182
|
-
// })
|
|
3183
|
-
// }
|
|
3184
|
-
// },
|
|
3185
|
-
// cancel: () => {
|
|
3186
|
-
// canceled = true
|
|
3187
|
-
// batch.tasks = []
|
|
3188
|
-
// instance.batches[priority] = instance.batches[priority].filter(
|
|
3189
|
-
// b => b.id !== batchId
|
|
3190
|
-
// )
|
|
3191
|
-
// },
|
|
3192
|
-
// }
|
|
3193
|
-
// instance.batches[priority].push(batch)
|
|
3194
|
-
// return batch
|
|
3195
|
-
// },
|
|
3196
3110
|
reset: () => {
|
|
3197
3111
|
instance.setState(instance.initialState);
|
|
3198
3112
|
},
|
|
@@ -3200,7 +3114,7 @@
|
|
|
3200
3114
|
const newOptions = functionalUpdate(updater, instance.options);
|
|
3201
3115
|
instance.options = mergeOptions(newOptions);
|
|
3202
3116
|
},
|
|
3203
|
-
|
|
3117
|
+
_render: (template, props) => {
|
|
3204
3118
|
if (typeof instance.options.render === 'function') {
|
|
3205
3119
|
return instance.options.render(template, props);
|
|
3206
3120
|
}
|
|
@@ -3303,69 +3217,55 @@
|
|
|
3303
3217
|
|
|
3304
3218
|
function getCoreRowModel() {
|
|
3305
3219
|
return instance => memo(() => [instance.options.data], data => {
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3220
|
+
const rowModel = {
|
|
3221
|
+
rows: [],
|
|
3222
|
+
flatRows: [],
|
|
3223
|
+
rowsById: {}
|
|
3224
|
+
};
|
|
3225
|
+
let rows;
|
|
3226
|
+
let row;
|
|
3227
|
+
let originalRow;
|
|
3311
3228
|
|
|
3312
|
-
const
|
|
3229
|
+
const accessRows = function (originalRows, depth, parent) {
|
|
3313
3230
|
if (depth === void 0) {
|
|
3314
3231
|
depth = 0;
|
|
3315
3232
|
}
|
|
3316
3233
|
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
if (!id) {
|
|
3320
|
-
{
|
|
3321
|
-
throw new Error("getRowId expected an ID, but got " + id);
|
|
3322
|
-
}
|
|
3323
|
-
}
|
|
3324
|
-
|
|
3325
|
-
const values = {};
|
|
3326
|
-
|
|
3327
|
-
for (let i = 0; i < leafColumns.length; i++) {
|
|
3328
|
-
const column = leafColumns[i];
|
|
3329
|
-
|
|
3330
|
-
if (column && column.accessorFn) {
|
|
3331
|
-
values[column.id] = column.accessorFn(originalRow, rowIndex);
|
|
3332
|
-
}
|
|
3333
|
-
} // Make the row
|
|
3234
|
+
rows = [];
|
|
3334
3235
|
|
|
3236
|
+
for (let i = 0; i < originalRows.length; i++) {
|
|
3237
|
+
originalRow = originalRows[i]; // This could be an expensive check at scale, so we should move it somewhere else, but where?
|
|
3238
|
+
// if (!id) {
|
|
3239
|
+
// if ("development" !== 'production') {
|
|
3240
|
+
// throw new Error(`getRowId expected an ID, but got ${id}`)
|
|
3241
|
+
// }
|
|
3242
|
+
// }
|
|
3243
|
+
// Make the row
|
|
3335
3244
|
|
|
3336
|
-
|
|
3245
|
+
row = instance.createRow(instance.getRowId(originalRow, i, parent), originalRow, i, depth); // Keep track of every row in a flat array
|
|
3337
3246
|
|
|
3338
|
-
|
|
3247
|
+
rowModel.flatRows.push(row); // Also keep track of every row by its ID
|
|
3339
3248
|
|
|
3340
|
-
|
|
3249
|
+
rowModel.rowsById[row.id] = row; // Push instance row into parent
|
|
3341
3250
|
|
|
3342
|
-
|
|
3251
|
+
rows.push(row); // Get the original subrows
|
|
3343
3252
|
|
|
3344
|
-
|
|
3345
|
-
|
|
3253
|
+
if (instance.options.getSubRows) {
|
|
3254
|
+
var _row$originalSubRows;
|
|
3346
3255
|
|
|
3347
|
-
|
|
3348
|
-
row.originalSubRows = originalSubRows;
|
|
3349
|
-
const subRows = [];
|
|
3256
|
+
row.originalSubRows = instance.options.getSubRows(originalRow, i); // Then recursively access them
|
|
3350
3257
|
|
|
3351
|
-
|
|
3352
|
-
|
|
3258
|
+
if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {
|
|
3259
|
+
row.subRows = accessRows(row.originalSubRows, depth + 1, row);
|
|
3353
3260
|
}
|
|
3354
|
-
|
|
3355
|
-
row.subRows = subRows;
|
|
3356
3261
|
}
|
|
3357
3262
|
}
|
|
3358
|
-
};
|
|
3359
|
-
|
|
3360
|
-
for (let i = 0; i < data.length; i++) {
|
|
3361
|
-
accessRow(data[i], i, 0, rows);
|
|
3362
|
-
}
|
|
3363
3263
|
|
|
3364
|
-
|
|
3365
|
-
rows,
|
|
3366
|
-
flatRows,
|
|
3367
|
-
rowsById
|
|
3264
|
+
return rows;
|
|
3368
3265
|
};
|
|
3266
|
+
|
|
3267
|
+
rowModel.rows = accessRows(data);
|
|
3268
|
+
return rowModel;
|
|
3369
3269
|
}, {
|
|
3370
3270
|
key: 'getRowModel',
|
|
3371
3271
|
debug: () => {
|
|
@@ -3899,7 +3799,7 @@
|
|
|
3899
3799
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
|
|
3900
3800
|
},
|
|
3901
3801
|
onChange: () => {
|
|
3902
|
-
instance.
|
|
3802
|
+
instance._queue(() => {
|
|
3903
3803
|
instance._autoResetExpanded();
|
|
3904
3804
|
|
|
3905
3805
|
instance._autoResetPageIndex();
|