@tanstack/svelte-table 8.5.8 → 8.5.9

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.
@@ -4014,7 +4014,7 @@ var drawChart = (function (exports) {
4014
4014
  </script>
4015
4015
  <script>
4016
4016
  /*<!--*/
4017
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"2953-163"},{"name":"svelte-table/src","children":[{"uid":"2953-165","name":"placeholder.svelte"},{"uid":"2953-167","name":"placeholder.ts"},{"uid":"2953-169","name":"render-component.ts"},{"uid":"2953-171","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"2953-163":{"renderedLength":138254,"gzipLength":23997,"brotliLength":0,"mainUid":"2953-162"},"2953-165":{"renderedLength":927,"gzipLength":445,"brotliLength":0,"mainUid":"2953-164"},"2953-167":{"renderedLength":246,"gzipLength":184,"brotliLength":0,"mainUid":"2953-166"},"2953-169":{"renderedLength":1458,"gzipLength":539,"brotliLength":0,"mainUid":"2953-168"},"2953-171":{"renderedLength":2915,"gzipLength":958,"brotliLength":0,"mainUid":"2953-170"}},"nodeMetas":{"2953-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"2953-163"},"imported":[],"importedBy":[{"uid":"2953-170"}]},"2953-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"2953-165"},"imported":[{"uid":"2953-172"}],"importedBy":[{"uid":"2953-166"}]},"2953-166":{"id":"/packages/svelte-table/src/placeholder.ts","moduleParts":{"index.production.js":"2953-167"},"imported":[{"uid":"2953-172"},{"uid":"2953-164"}],"importedBy":[{"uid":"2953-170"}]},"2953-168":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"2953-169"},"imported":[{"uid":"2953-172"}],"importedBy":[{"uid":"2953-170"}]},"2953-170":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"2953-171"},"imported":[{"uid":"2953-162"},{"uid":"2953-166"},{"uid":"2953-172"},{"uid":"2953-173"},{"uid":"2953-168"}],"importedBy":[],"isEntry":true},"2953-172":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"2953-170"},{"uid":"2953-166"},{"uid":"2953-168"},{"uid":"2953-164"}],"isExternal":true},"2953-173":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"2953-170"}],"isExternal":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4017
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"45a2-163"},{"name":"svelte-table/src","children":[{"uid":"45a2-165","name":"placeholder.svelte"},{"uid":"45a2-167","name":"placeholder.ts"},{"uid":"45a2-169","name":"render-component.ts"},{"uid":"45a2-171","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"45a2-163":{"renderedLength":138454,"gzipLength":24035,"brotliLength":0,"mainUid":"45a2-162"},"45a2-165":{"renderedLength":927,"gzipLength":445,"brotliLength":0,"mainUid":"45a2-164"},"45a2-167":{"renderedLength":246,"gzipLength":184,"brotliLength":0,"mainUid":"45a2-166"},"45a2-169":{"renderedLength":1458,"gzipLength":539,"brotliLength":0,"mainUid":"45a2-168"},"45a2-171":{"renderedLength":2915,"gzipLength":958,"brotliLength":0,"mainUid":"45a2-170"}},"nodeMetas":{"45a2-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"45a2-163"},"imported":[],"importedBy":[{"uid":"45a2-170"}]},"45a2-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"45a2-165"},"imported":[{"uid":"45a2-172"}],"importedBy":[{"uid":"45a2-166"}]},"45a2-166":{"id":"/packages/svelte-table/src/placeholder.ts","moduleParts":{"index.production.js":"45a2-167"},"imported":[{"uid":"45a2-172"},{"uid":"45a2-164"}],"importedBy":[{"uid":"45a2-170"}]},"45a2-168":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"45a2-169"},"imported":[{"uid":"45a2-172"}],"importedBy":[{"uid":"45a2-170"}]},"45a2-170":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"45a2-171"},"imported":[{"uid":"45a2-162"},{"uid":"45a2-166"},{"uid":"45a2-172"},{"uid":"45a2-173"},{"uid":"45a2-168"}],"importedBy":[],"isEntry":true},"45a2-172":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"45a2-170"},{"uid":"45a2-166"},{"uid":"45a2-168"},{"uid":"45a2-164"}],"isExternal":true},"45a2-173":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"45a2-170"}],"isExternal":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4018
4018
 
4019
4019
  const run = () => {
4020
4020
  const width = window.innerWidth;
@@ -11,25 +11,25 @@
11
11
  "children": [
12
12
  {
13
13
  "name": "table-core/build/esm/index.js",
14
- "uid": "2953-175"
14
+ "uid": "45a2-175"
15
15
  },
16
16
  {
17
17
  "name": "svelte-table/src",
18
18
  "children": [
19
19
  {
20
- "uid": "2953-177",
20
+ "uid": "45a2-177",
21
21
  "name": "placeholder.svelte"
22
22
  },
23
23
  {
24
- "uid": "2953-179",
24
+ "uid": "45a2-179",
25
25
  "name": "placeholder.ts"
26
26
  },
27
27
  {
28
- "uid": "2953-181",
28
+ "uid": "45a2-181",
29
29
  "name": "render-component.ts"
30
30
  },
31
31
  {
32
- "uid": "2953-183",
32
+ "uid": "45a2-183",
33
33
  "name": "index.ts"
34
34
  }
35
35
  ]
@@ -42,153 +42,153 @@
42
42
  "isRoot": true
43
43
  },
44
44
  "nodeParts": {
45
- "2953-175": {
46
- "renderedLength": 138254,
47
- "gzipLength": 23997,
45
+ "45a2-175": {
46
+ "renderedLength": 138454,
47
+ "gzipLength": 24035,
48
48
  "brotliLength": 0,
49
- "mainUid": "2953-174"
49
+ "mainUid": "45a2-174"
50
50
  },
51
- "2953-177": {
51
+ "45a2-177": {
52
52
  "renderedLength": 927,
53
53
  "gzipLength": 445,
54
54
  "brotliLength": 0,
55
- "mainUid": "2953-176"
55
+ "mainUid": "45a2-176"
56
56
  },
57
- "2953-179": {
57
+ "45a2-179": {
58
58
  "renderedLength": 246,
59
59
  "gzipLength": 184,
60
60
  "brotliLength": 0,
61
- "mainUid": "2953-178"
61
+ "mainUid": "45a2-178"
62
62
  },
63
- "2953-181": {
63
+ "45a2-181": {
64
64
  "renderedLength": 1458,
65
65
  "gzipLength": 539,
66
66
  "brotliLength": 0,
67
- "mainUid": "2953-180"
67
+ "mainUid": "45a2-180"
68
68
  },
69
- "2953-183": {
69
+ "45a2-183": {
70
70
  "renderedLength": 2915,
71
71
  "gzipLength": 958,
72
72
  "brotliLength": 0,
73
- "mainUid": "2953-182"
73
+ "mainUid": "45a2-182"
74
74
  }
75
75
  },
76
76
  "nodeMetas": {
77
- "2953-174": {
77
+ "45a2-174": {
78
78
  "id": "/packages/table-core/build/esm/index.js",
79
79
  "moduleParts": {
80
- "index.production.js": "2953-175"
80
+ "index.production.js": "45a2-175"
81
81
  },
82
82
  "imported": [],
83
83
  "importedBy": [
84
84
  {
85
- "uid": "2953-182"
85
+ "uid": "45a2-182"
86
86
  }
87
87
  ]
88
88
  },
89
- "2953-176": {
89
+ "45a2-176": {
90
90
  "id": "/packages/svelte-table/src/placeholder.svelte",
91
91
  "moduleParts": {
92
- "index.production.js": "2953-177"
92
+ "index.production.js": "45a2-177"
93
93
  },
94
94
  "imported": [
95
95
  {
96
- "uid": "2953-184"
96
+ "uid": "45a2-184"
97
97
  }
98
98
  ],
99
99
  "importedBy": [
100
100
  {
101
- "uid": "2953-178"
101
+ "uid": "45a2-178"
102
102
  }
103
103
  ]
104
104
  },
105
- "2953-178": {
105
+ "45a2-178": {
106
106
  "id": "/packages/svelte-table/src/placeholder.ts",
107
107
  "moduleParts": {
108
- "index.production.js": "2953-179"
108
+ "index.production.js": "45a2-179"
109
109
  },
110
110
  "imported": [
111
111
  {
112
- "uid": "2953-184"
112
+ "uid": "45a2-184"
113
113
  },
114
114
  {
115
- "uid": "2953-176"
115
+ "uid": "45a2-176"
116
116
  }
117
117
  ],
118
118
  "importedBy": [
119
119
  {
120
- "uid": "2953-182"
120
+ "uid": "45a2-182"
121
121
  }
122
122
  ]
123
123
  },
124
- "2953-180": {
124
+ "45a2-180": {
125
125
  "id": "/packages/svelte-table/src/render-component.ts",
126
126
  "moduleParts": {
127
- "index.production.js": "2953-181"
127
+ "index.production.js": "45a2-181"
128
128
  },
129
129
  "imported": [
130
130
  {
131
- "uid": "2953-184"
131
+ "uid": "45a2-184"
132
132
  }
133
133
  ],
134
134
  "importedBy": [
135
135
  {
136
- "uid": "2953-182"
136
+ "uid": "45a2-182"
137
137
  }
138
138
  ]
139
139
  },
140
- "2953-182": {
140
+ "45a2-182": {
141
141
  "id": "/packages/svelte-table/src/index.ts",
142
142
  "moduleParts": {
143
- "index.production.js": "2953-183"
143
+ "index.production.js": "45a2-183"
144
144
  },
145
145
  "imported": [
146
146
  {
147
- "uid": "2953-174"
147
+ "uid": "45a2-174"
148
148
  },
149
149
  {
150
- "uid": "2953-178"
150
+ "uid": "45a2-178"
151
151
  },
152
152
  {
153
- "uid": "2953-184"
153
+ "uid": "45a2-184"
154
154
  },
155
155
  {
156
- "uid": "2953-185"
156
+ "uid": "45a2-185"
157
157
  },
158
158
  {
159
- "uid": "2953-180"
159
+ "uid": "45a2-180"
160
160
  }
161
161
  ],
162
162
  "importedBy": [],
163
163
  "isEntry": true
164
164
  },
165
- "2953-184": {
165
+ "45a2-184": {
166
166
  "id": "svelte/internal",
167
167
  "moduleParts": {},
168
168
  "imported": [],
169
169
  "importedBy": [
170
170
  {
171
- "uid": "2953-182"
171
+ "uid": "45a2-182"
172
172
  },
173
173
  {
174
- "uid": "2953-178"
174
+ "uid": "45a2-178"
175
175
  },
176
176
  {
177
- "uid": "2953-180"
177
+ "uid": "45a2-180"
178
178
  },
179
179
  {
180
- "uid": "2953-176"
180
+ "uid": "45a2-176"
181
181
  }
182
182
  ],
183
183
  "isExternal": true
184
184
  },
185
- "2953-185": {
185
+ "45a2-185": {
186
186
  "id": "svelte/store",
187
187
  "moduleParts": {},
188
188
  "imported": [],
189
189
  "importedBy": [
190
190
  {
191
- "uid": "2953-182"
191
+ "uid": "45a2-182"
192
192
  }
193
193
  ],
194
194
  "isExternal": true
@@ -3795,8 +3795,13 @@
3795
3795
 
3796
3796
  function getExpandedRowModel() {
3797
3797
  return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3798
- if (!rowModel.rows.length || // Do not expand if rows are not included in pagination
3799
- !paginateExpandedRows || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3798
+ if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3799
+ return rowModel;
3800
+ }
3801
+
3802
+ if (!paginateExpandedRows) {
3803
+ // Only expand rows at this point if they are being paginated
3804
+ console.log(rowModel.rows);
3800
3805
  return rowModel;
3801
3806
  }
3802
3807
 
@@ -3810,7 +3815,7 @@
3810
3815
  }
3811
3816
  });
3812
3817
  }
3813
- function expandRows(rowModel, table) {
3818
+ function expandRows(rowModel) {
3814
3819
  const expandedRows = [];
3815
3820
 
3816
3821
  const handleRow = row => {
@@ -3832,7 +3837,7 @@
3832
3837
  }
3833
3838
 
3834
3839
  function getPaginationRowModel(opts) {
3835
- return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel()], (pagination, rowModel) => {
3840
+ return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel(), table.options.paginateExpandedRows ? undefined : table.getState().expanded], (pagination, rowModel) => {
3836
3841
  if (!rowModel.rows.length) {
3837
3842
  return rowModel;
3838
3843
  }
@@ -3865,6 +3870,7 @@
3865
3870
  };
3866
3871
  }
3867
3872
 
3873
+ console.log(paginatedRowModel.rows);
3868
3874
  paginatedRowModel.flatRows = [];
3869
3875
 
3870
3876
  const handleRow = row => {