@tanstack/svelte-table 8.0.0-alpha.70 → 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.
@@ -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":"fca1-163"},{"name":"svelte-table/src","children":[{"uid":"fca1-165","name":"placeholder.svelte"},{"uid":"fca1-167","name":"render-component.ts"},{"uid":"fca1-169","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"fca1-163":{"renderedLength":142313,"gzipLength":24348,"brotliLength":0,"mainUid":"fca1-162"},"fca1-165":{"renderedLength":925,"gzipLength":444,"brotliLength":0,"mainUid":"fca1-164"},"fca1-167":{"renderedLength":1365,"gzipLength":519,"brotliLength":0,"mainUid":"fca1-166"},"fca1-169":{"renderedLength":1958,"gzipLength":709,"brotliLength":0,"mainUid":"fca1-168"}},"nodeMetas":{"fca1-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"fca1-163"},"imported":[],"importedBy":[{"uid":"fca1-168"}]},"fca1-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"fca1-165"},"imported":[{"uid":"fca1-171"}],"importedBy":[{"uid":"fca1-168"}]},"fca1-166":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"fca1-167"},"imported":[{"uid":"fca1-171"}],"importedBy":[{"uid":"fca1-168"}]},"fca1-168":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"fca1-169"},"imported":[{"uid":"fca1-162"},{"uid":"fca1-164"},{"uid":"fca1-170"},{"uid":"fca1-166"}],"importedBy":[],"isEntry":true},"fca1-170":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"fca1-168"}],"isExternal":true},"fca1-171":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"fca1-164"},{"uid":"fca1-166"}],"isExternal":true}},"env":{"rollup":"2.70.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
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;
@@ -11,21 +11,21 @@
11
11
  "children": [
12
12
  {
13
13
  "name": "table-core/build/esm/index.js",
14
- "uid": "fca1-173"
14
+ "uid": "9906-173"
15
15
  },
16
16
  {
17
17
  "name": "svelte-table/src",
18
18
  "children": [
19
19
  {
20
- "uid": "fca1-175",
20
+ "uid": "9906-175",
21
21
  "name": "placeholder.svelte"
22
22
  },
23
23
  {
24
- "uid": "fca1-177",
24
+ "uid": "9906-177",
25
25
  "name": "render-component.ts"
26
26
  },
27
27
  {
28
- "uid": "fca1-179",
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
- "fca1-173": {
42
- "renderedLength": 142313,
43
- "gzipLength": 24348,
41
+ "9906-173": {
42
+ "renderedLength": 142389,
43
+ "gzipLength": 24368,
44
44
  "brotliLength": 0,
45
- "mainUid": "fca1-172"
45
+ "mainUid": "9906-172"
46
46
  },
47
- "fca1-175": {
47
+ "9906-175": {
48
48
  "renderedLength": 925,
49
49
  "gzipLength": 444,
50
50
  "brotliLength": 0,
51
- "mainUid": "fca1-174"
51
+ "mainUid": "9906-174"
52
52
  },
53
- "fca1-177": {
53
+ "9906-177": {
54
54
  "renderedLength": 1365,
55
55
  "gzipLength": 519,
56
56
  "brotliLength": 0,
57
- "mainUid": "fca1-176"
57
+ "mainUid": "9906-176"
58
58
  },
59
- "fca1-179": {
59
+ "9906-179": {
60
60
  "renderedLength": 1958,
61
61
  "gzipLength": 709,
62
62
  "brotliLength": 0,
63
- "mainUid": "fca1-178"
63
+ "mainUid": "9906-178"
64
64
  }
65
65
  },
66
66
  "nodeMetas": {
67
- "fca1-172": {
67
+ "9906-172": {
68
68
  "id": "/packages/table-core/build/esm/index.js",
69
69
  "moduleParts": {
70
- "index.production.js": "fca1-173"
70
+ "index.production.js": "9906-173"
71
71
  },
72
72
  "imported": [],
73
73
  "importedBy": [
74
74
  {
75
- "uid": "fca1-178"
75
+ "uid": "9906-178"
76
76
  }
77
77
  ]
78
78
  },
79
- "fca1-174": {
79
+ "9906-174": {
80
80
  "id": "/packages/svelte-table/src/placeholder.svelte",
81
81
  "moduleParts": {
82
- "index.production.js": "fca1-175"
82
+ "index.production.js": "9906-175"
83
83
  },
84
84
  "imported": [
85
85
  {
86
- "uid": "fca1-181"
86
+ "uid": "9906-181"
87
87
  }
88
88
  ],
89
89
  "importedBy": [
90
90
  {
91
- "uid": "fca1-178"
91
+ "uid": "9906-178"
92
92
  }
93
93
  ]
94
94
  },
95
- "fca1-176": {
95
+ "9906-176": {
96
96
  "id": "/packages/svelte-table/src/render-component.ts",
97
97
  "moduleParts": {
98
- "index.production.js": "fca1-177"
98
+ "index.production.js": "9906-177"
99
99
  },
100
100
  "imported": [
101
101
  {
102
- "uid": "fca1-181"
102
+ "uid": "9906-181"
103
103
  }
104
104
  ],
105
105
  "importedBy": [
106
106
  {
107
- "uid": "fca1-178"
107
+ "uid": "9906-178"
108
108
  }
109
109
  ]
110
110
  },
111
- "fca1-178": {
111
+ "9906-178": {
112
112
  "id": "/packages/svelte-table/src/index.ts",
113
113
  "moduleParts": {
114
- "index.production.js": "fca1-179"
114
+ "index.production.js": "9906-179"
115
115
  },
116
116
  "imported": [
117
117
  {
118
- "uid": "fca1-172"
118
+ "uid": "9906-172"
119
119
  },
120
120
  {
121
- "uid": "fca1-174"
121
+ "uid": "9906-174"
122
122
  },
123
123
  {
124
- "uid": "fca1-180"
124
+ "uid": "9906-180"
125
125
  },
126
126
  {
127
- "uid": "fca1-176"
127
+ "uid": "9906-176"
128
128
  }
129
129
  ],
130
130
  "importedBy": [],
131
131
  "isEntry": true
132
132
  },
133
- "fca1-180": {
133
+ "9906-180": {
134
134
  "id": "svelte/store",
135
135
  "moduleParts": {},
136
136
  "imported": [],
137
137
  "importedBy": [
138
138
  {
139
- "uid": "fca1-178"
139
+ "uid": "9906-178"
140
140
  }
141
141
  ],
142
142
  "isExternal": true
143
143
  },
144
- "fca1-181": {
144
+ "9906-181": {
145
145
  "id": "svelte/internal",
146
146
  "moduleParts": {},
147
147
  "imported": [],
148
148
  "importedBy": [
149
149
  {
150
- "uid": "fca1-174"
150
+ "uid": "9906-174"
151
151
  },
152
152
  {
153
- "uid": "fca1-176"
153
+ "uid": "9906-176"
154
154
  }
155
155
  ],
156
156
  "isExternal": true
@@ -630,28 +630,28 @@
630
630
  var _instance$getHeaderGr, _instance$getHeaderGr2;
631
631
 
632
632
  return (_instance$getHeaderGr = (_instance$getHeaderGr2 = instance.getHeaderGroups()[0]) == null ? void 0 : _instance$getHeaderGr2.headers.reduce((sum, header) => {
633
- return sum + header.column.getSize();
633
+ return sum + header.getSize();
634
634
  }, 0)) != null ? _instance$getHeaderGr : 0;
635
635
  },
636
636
  getLeftTotalSize: () => {
637
637
  var _instance$getLeftHead, _instance$getLeftHead2;
638
638
 
639
639
  return (_instance$getLeftHead = (_instance$getLeftHead2 = instance.getLeftHeaderGroups()[0]) == null ? void 0 : _instance$getLeftHead2.headers.reduce((sum, header) => {
640
- return sum + header.column.getSize();
640
+ return sum + header.getSize();
641
641
  }, 0)) != null ? _instance$getLeftHead : 0;
642
642
  },
643
643
  getCenterTotalSize: () => {
644
644
  var _instance$getCenterHe, _instance$getCenterHe2;
645
645
 
646
646
  return (_instance$getCenterHe = (_instance$getCenterHe2 = instance.getCenterHeaderGroups()[0]) == null ? void 0 : _instance$getCenterHe2.headers.reduce((sum, header) => {
647
- return sum + header.column.getSize();
647
+ return sum + header.getSize();
648
648
  }, 0)) != null ? _instance$getCenterHe : 0;
649
649
  },
650
650
  getRightTotalSize: () => {
651
651
  var _instance$getRightHea, _instance$getRightHea2;
652
652
 
653
653
  return (_instance$getRightHea = (_instance$getRightHea2 = instance.getRightHeaderGroups()[0]) == null ? void 0 : _instance$getRightHea2.headers.reduce((sum, header) => {
654
- return sum + header.column.getSize();
654
+ return sum + header.getSize();
655
655
  }, 0)) != null ? _instance$getRightHea : 0;
656
656
  }
657
657
  };
@@ -705,10 +705,13 @@
705
705
  },
706
706
  createInstance: instance => {
707
707
  let registered = false;
708
+ let queued = false;
708
709
  return {
709
710
  _autoResetExpanded: () => {
710
711
  if (!registered) {
711
- registered = true;
712
+ instance.queue(() => {
713
+ registered = true;
714
+ });
712
715
  return;
713
716
  }
714
717
 
@@ -717,7 +720,12 @@
717
720
  }
718
721
 
719
722
  if (instance.options.autoResetAll === true || instance.options.autoResetExpanded) {
720
- instance.resetExpanded();
723
+ if (queued) return;
724
+ queued = true;
725
+ instance.queue(() => {
726
+ instance.resetExpanded();
727
+ queued = false;
728
+ });
721
729
  }
722
730
  },
723
731
  setExpanded: updater => instance.options.onExpandedChange == null ? void 0 : instance.options.onExpandedChange(updater),
@@ -1070,7 +1078,7 @@
1070
1078
  _getFacetedMinMaxValues: instance.options.getFacetedMinMaxValues && instance.options.getFacetedMinMaxValues(instance, column.id),
1071
1079
  getFacetedMinMaxValues: () => {
1072
1080
  if (!column._getFacetedMinMaxValues) {
1073
- return [NaN, NaN];
1081
+ return undefined;
1074
1082
  }
1075
1083
 
1076
1084
  return column._getFacetedMinMaxValues();
@@ -1161,7 +1169,7 @@
1161
1169
  _getGlobalFacetedMinMaxValues: instance.options.getFacetedMinMaxValues && instance.options.getFacetedMinMaxValues(instance, '__global__'),
1162
1170
  getGlobalFacetedMinMaxValues: () => {
1163
1171
  if (!instance._getGlobalFacetedMinMaxValues) {
1164
- return [NaN, NaN];
1172
+ return;
1165
1173
  }
1166
1174
 
1167
1175
  return instance._getGlobalFacetedMinMaxValues();
@@ -1505,10 +1513,13 @@
1505
1513
  },
1506
1514
  createInstance: instance => {
1507
1515
  let registered = false;
1516
+ let queued = false;
1508
1517
  return {
1509
1518
  _autoResetPageIndex: () => {
1510
1519
  if (!registered) {
1511
- registered = true;
1520
+ instance.queue(() => {
1521
+ registered = true;
1522
+ });
1512
1523
  return;
1513
1524
  }
1514
1525
 
@@ -1517,7 +1528,12 @@
1517
1528
  }
1518
1529
 
1519
1530
  if (instance.options.autoResetAll === true || instance.options.autoResetPageIndex) {
1520
- instance.resetPageIndex();
1531
+ if (queued) return;
1532
+ queued = true;
1533
+ instance.queue(() => {
1534
+ instance.resetPageIndex();
1535
+ queued = false;
1536
+ });
1521
1537
  }
1522
1538
  },
1523
1539
  setPagination: updater => {
@@ -3358,9 +3374,7 @@
3358
3374
  return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3359
3375
  },
3360
3376
  onChange: () => {
3361
- instance.queue(() => {
3362
- instance._autoResetPageIndex();
3363
- });
3377
+ instance._autoResetPageIndex();
3364
3378
  }
3365
3379
  });
3366
3380
  }
@@ -3566,9 +3580,7 @@
3566
3580
  return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3567
3581
  },
3568
3582
  onChange: () => {
3569
- instance.queue(() => {
3570
- instance._autoResetPageIndex();
3571
- });
3583
+ instance._autoResetPageIndex();
3572
3584
  }
3573
3585
  });
3574
3586
  }
@@ -3636,14 +3648,20 @@
3636
3648
 
3637
3649
  function getFacetedMinMaxValues() {
3638
3650
  return (instance, columnId) => memo(() => [instance.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3639
- var _facetedRowModel$flat, _facetedRowModel$flat2, _facetedRowModel$flat3, _facetedRowModel$flat4;
3651
+ var _facetedRowModel$flat;
3652
+
3653
+ const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId);
3654
+
3655
+ if (typeof firstValue === 'undefined') {
3656
+ return undefined;
3657
+ }
3640
3658
 
3641
- let facetedMinMaxValues = [(_facetedRowModel$flat = (_facetedRowModel$flat2 = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat2.getValue(columnId)) != null ? _facetedRowModel$flat : null, (_facetedRowModel$flat3 = (_facetedRowModel$flat4 = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat4.getValue(columnId)) != null ? _facetedRowModel$flat3 : null];
3659
+ let facetedMinMaxValues = [firstValue, firstValue];
3642
3660
 
3643
3661
  for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
3644
- var _facetedRowModel$flat5;
3662
+ var _facetedRowModel$flat2;
3645
3663
 
3646
- const value = (_facetedRowModel$flat5 = facetedRowModel.flatRows[i]) == null ? void 0 : _facetedRowModel$flat5.getValue(columnId);
3664
+ const value = (_facetedRowModel$flat2 = facetedRowModel.flatRows[i]) == null ? void 0 : _facetedRowModel$flat2.getValue(columnId);
3647
3665
 
3648
3666
  if (value < facetedMinMaxValues[0]) {
3649
3667
  facetedMinMaxValues[0] = value;
@@ -3751,9 +3769,7 @@
3751
3769
  return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3752
3770
  },
3753
3771
  onChange: () => {
3754
- instance.queue(() => {
3755
- instance._autoResetPageIndex();
3756
- });
3772
+ instance._autoResetPageIndex();
3757
3773
  }
3758
3774
  });
3759
3775
  }