@tanstack/svelte-table 8.5.29 → 8.6.0

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.
@@ -4024,7 +4024,7 @@ var drawChart = (function (exports) {
4024
4024
  </script>
4025
4025
  <script>
4026
4026
  /*<!--*/
4027
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"6c35-163"},{"name":"svelte-table/src","children":[{"uid":"6c35-165","name":"placeholder.svelte"},{"uid":"6c35-167","name":"placeholder.ts"},{"uid":"6c35-169","name":"render-component.ts"},{"uid":"6c35-171","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"6c35-163":{"renderedLength":126592,"gzipLength":22412,"brotliLength":0,"mainUid":"6c35-162"},"6c35-165":{"renderedLength":927,"gzipLength":445,"brotliLength":0,"mainUid":"6c35-164"},"6c35-167":{"renderedLength":246,"gzipLength":186,"brotliLength":0,"mainUid":"6c35-166"},"6c35-169":{"renderedLength":1447,"gzipLength":537,"brotliLength":0,"mainUid":"6c35-168"},"6c35-171":{"renderedLength":2930,"gzipLength":948,"brotliLength":0,"mainUid":"6c35-170"}},"nodeMetas":{"6c35-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"6c35-163"},"imported":[],"importedBy":[{"uid":"6c35-170"}]},"6c35-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"6c35-165"},"imported":[{"uid":"6c35-172"}],"importedBy":[{"uid":"6c35-166"}]},"6c35-166":{"id":"/packages/svelte-table/src/placeholder.ts","moduleParts":{"index.production.js":"6c35-167"},"imported":[{"uid":"6c35-172"},{"uid":"6c35-164"}],"importedBy":[{"uid":"6c35-170"}]},"6c35-168":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"6c35-169"},"imported":[{"uid":"6c35-172"}],"importedBy":[{"uid":"6c35-170"}]},"6c35-170":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"6c35-171"},"imported":[{"uid":"6c35-162"},{"uid":"6c35-166"},{"uid":"6c35-172"},{"uid":"6c35-173"},{"uid":"6c35-168"}],"importedBy":[],"isEntry":true},"6c35-172":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"6c35-170"},{"uid":"6c35-166"},{"uid":"6c35-168"},{"uid":"6c35-164"}],"isExternal":true},"6c35-173":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"6c35-170"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4027
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"7238-163"},{"name":"svelte-table/src","children":[{"uid":"7238-165","name":"placeholder.svelte"},{"uid":"7238-167","name":"placeholder.ts"},{"uid":"7238-169","name":"render-component.ts"},{"uid":"7238-171","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"7238-163":{"renderedLength":126934,"gzipLength":22466,"brotliLength":0,"mainUid":"7238-162"},"7238-165":{"renderedLength":927,"gzipLength":445,"brotliLength":0,"mainUid":"7238-164"},"7238-167":{"renderedLength":246,"gzipLength":186,"brotliLength":0,"mainUid":"7238-166"},"7238-169":{"renderedLength":1447,"gzipLength":537,"brotliLength":0,"mainUid":"7238-168"},"7238-171":{"renderedLength":2930,"gzipLength":948,"brotliLength":0,"mainUid":"7238-170"}},"nodeMetas":{"7238-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"7238-163"},"imported":[],"importedBy":[{"uid":"7238-170"}]},"7238-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"7238-165"},"imported":[{"uid":"7238-172"}],"importedBy":[{"uid":"7238-166"}]},"7238-166":{"id":"/packages/svelte-table/src/placeholder.ts","moduleParts":{"index.production.js":"7238-167"},"imported":[{"uid":"7238-172"},{"uid":"7238-164"}],"importedBy":[{"uid":"7238-170"}]},"7238-168":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"7238-169"},"imported":[{"uid":"7238-172"}],"importedBy":[{"uid":"7238-170"}]},"7238-170":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"7238-171"},"imported":[{"uid":"7238-162"},{"uid":"7238-166"},{"uid":"7238-172"},{"uid":"7238-173"},{"uid":"7238-168"}],"importedBy":[],"isEntry":true},"7238-172":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"7238-170"},{"uid":"7238-166"},{"uid":"7238-168"},{"uid":"7238-164"}],"isExternal":true},"7238-173":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"7238-170"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4028
4028
 
4029
4029
  const run = () => {
4030
4030
  const width = window.innerWidth;
@@ -11,25 +11,25 @@
11
11
  "children": [
12
12
  {
13
13
  "name": "table-core/build/esm/index.js",
14
- "uid": "6c35-175"
14
+ "uid": "7238-175"
15
15
  },
16
16
  {
17
17
  "name": "svelte-table/src",
18
18
  "children": [
19
19
  {
20
- "uid": "6c35-177",
20
+ "uid": "7238-177",
21
21
  "name": "placeholder.svelte"
22
22
  },
23
23
  {
24
- "uid": "6c35-179",
24
+ "uid": "7238-179",
25
25
  "name": "placeholder.ts"
26
26
  },
27
27
  {
28
- "uid": "6c35-181",
28
+ "uid": "7238-181",
29
29
  "name": "render-component.ts"
30
30
  },
31
31
  {
32
- "uid": "6c35-183",
32
+ "uid": "7238-183",
33
33
  "name": "index.ts"
34
34
  }
35
35
  ]
@@ -42,153 +42,153 @@
42
42
  "isRoot": true
43
43
  },
44
44
  "nodeParts": {
45
- "6c35-175": {
46
- "renderedLength": 126592,
47
- "gzipLength": 22412,
45
+ "7238-175": {
46
+ "renderedLength": 126934,
47
+ "gzipLength": 22466,
48
48
  "brotliLength": 0,
49
- "mainUid": "6c35-174"
49
+ "mainUid": "7238-174"
50
50
  },
51
- "6c35-177": {
51
+ "7238-177": {
52
52
  "renderedLength": 927,
53
53
  "gzipLength": 445,
54
54
  "brotliLength": 0,
55
- "mainUid": "6c35-176"
55
+ "mainUid": "7238-176"
56
56
  },
57
- "6c35-179": {
57
+ "7238-179": {
58
58
  "renderedLength": 246,
59
59
  "gzipLength": 186,
60
60
  "brotliLength": 0,
61
- "mainUid": "6c35-178"
61
+ "mainUid": "7238-178"
62
62
  },
63
- "6c35-181": {
63
+ "7238-181": {
64
64
  "renderedLength": 1447,
65
65
  "gzipLength": 537,
66
66
  "brotliLength": 0,
67
- "mainUid": "6c35-180"
67
+ "mainUid": "7238-180"
68
68
  },
69
- "6c35-183": {
69
+ "7238-183": {
70
70
  "renderedLength": 2930,
71
71
  "gzipLength": 948,
72
72
  "brotliLength": 0,
73
- "mainUid": "6c35-182"
73
+ "mainUid": "7238-182"
74
74
  }
75
75
  },
76
76
  "nodeMetas": {
77
- "6c35-174": {
77
+ "7238-174": {
78
78
  "id": "/packages/table-core/build/esm/index.js",
79
79
  "moduleParts": {
80
- "index.production.js": "6c35-175"
80
+ "index.production.js": "7238-175"
81
81
  },
82
82
  "imported": [],
83
83
  "importedBy": [
84
84
  {
85
- "uid": "6c35-182"
85
+ "uid": "7238-182"
86
86
  }
87
87
  ]
88
88
  },
89
- "6c35-176": {
89
+ "7238-176": {
90
90
  "id": "/packages/svelte-table/src/placeholder.svelte",
91
91
  "moduleParts": {
92
- "index.production.js": "6c35-177"
92
+ "index.production.js": "7238-177"
93
93
  },
94
94
  "imported": [
95
95
  {
96
- "uid": "6c35-184"
96
+ "uid": "7238-184"
97
97
  }
98
98
  ],
99
99
  "importedBy": [
100
100
  {
101
- "uid": "6c35-178"
101
+ "uid": "7238-178"
102
102
  }
103
103
  ]
104
104
  },
105
- "6c35-178": {
105
+ "7238-178": {
106
106
  "id": "/packages/svelte-table/src/placeholder.ts",
107
107
  "moduleParts": {
108
- "index.production.js": "6c35-179"
108
+ "index.production.js": "7238-179"
109
109
  },
110
110
  "imported": [
111
111
  {
112
- "uid": "6c35-184"
112
+ "uid": "7238-184"
113
113
  },
114
114
  {
115
- "uid": "6c35-176"
115
+ "uid": "7238-176"
116
116
  }
117
117
  ],
118
118
  "importedBy": [
119
119
  {
120
- "uid": "6c35-182"
120
+ "uid": "7238-182"
121
121
  }
122
122
  ]
123
123
  },
124
- "6c35-180": {
124
+ "7238-180": {
125
125
  "id": "/packages/svelte-table/src/render-component.ts",
126
126
  "moduleParts": {
127
- "index.production.js": "6c35-181"
127
+ "index.production.js": "7238-181"
128
128
  },
129
129
  "imported": [
130
130
  {
131
- "uid": "6c35-184"
131
+ "uid": "7238-184"
132
132
  }
133
133
  ],
134
134
  "importedBy": [
135
135
  {
136
- "uid": "6c35-182"
136
+ "uid": "7238-182"
137
137
  }
138
138
  ]
139
139
  },
140
- "6c35-182": {
140
+ "7238-182": {
141
141
  "id": "/packages/svelte-table/src/index.ts",
142
142
  "moduleParts": {
143
- "index.production.js": "6c35-183"
143
+ "index.production.js": "7238-183"
144
144
  },
145
145
  "imported": [
146
146
  {
147
- "uid": "6c35-174"
147
+ "uid": "7238-174"
148
148
  },
149
149
  {
150
- "uid": "6c35-178"
150
+ "uid": "7238-178"
151
151
  },
152
152
  {
153
- "uid": "6c35-184"
153
+ "uid": "7238-184"
154
154
  },
155
155
  {
156
- "uid": "6c35-185"
156
+ "uid": "7238-185"
157
157
  },
158
158
  {
159
- "uid": "6c35-180"
159
+ "uid": "7238-180"
160
160
  }
161
161
  ],
162
162
  "importedBy": [],
163
163
  "isEntry": true
164
164
  },
165
- "6c35-184": {
165
+ "7238-184": {
166
166
  "id": "svelte/internal",
167
167
  "moduleParts": {},
168
168
  "imported": [],
169
169
  "importedBy": [
170
170
  {
171
- "uid": "6c35-182"
171
+ "uid": "7238-182"
172
172
  },
173
173
  {
174
- "uid": "6c35-178"
174
+ "uid": "7238-178"
175
175
  },
176
176
  {
177
- "uid": "6c35-180"
177
+ "uid": "7238-180"
178
178
  },
179
179
  {
180
- "uid": "6c35-176"
180
+ "uid": "7238-176"
181
181
  }
182
182
  ],
183
183
  "isExternal": true
184
184
  },
185
- "6c35-185": {
185
+ "7238-185": {
186
186
  "id": "svelte/store",
187
187
  "moduleParts": {},
188
188
  "imported": [],
189
189
  "importedBy": [
190
190
  {
191
- "uid": "6c35-182"
191
+ "uid": "7238-182"
192
192
  }
193
193
  ],
194
194
  "isExternal": true
@@ -42,7 +42,7 @@ declare function renderServer<T>(Comp: T, props: T extends ComponentType<infer C
42
42
  declare const renderComponent: typeof renderServer | typeof renderClient;
43
43
 
44
44
  declare function flexRender(component: any, props: any): any;
45
- declare type ReadableOrVal<T> = T | Readable<T>;
45
+ type ReadableOrVal<T> = T | Readable<T>;
46
46
  declare function createSvelteTable<TData extends RowData>(options: ReadableOrVal<TableOptions<TData>>): Readable<_tanstack_table_core.Table<TData>>;
47
47
 
48
48
  export { createSvelteTable, flexRender, renderComponent };
@@ -969,6 +969,7 @@
969
969
  onColumnFiltersChange: makeStateUpdater('columnFilters', table),
970
970
  onGlobalFilterChange: makeStateUpdater('globalFilter', table),
971
971
  filterFromLeafRows: false,
972
+ maxLeafRowFilterDepth: 100,
972
973
  globalFilterFn: 'auto',
973
974
  getColumnCanGlobalFilter: column => {
974
975
  var _table$getCoreRowMode, _table$getCoreRowMode2;
@@ -2849,7 +2850,11 @@
2849
2850
  function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
2850
2851
  const newFilteredFlatRows = [];
2851
2852
  const newFilteredRowsById = {};
2853
+ const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
2852
2854
  const recurseFilterRows = function (rowsToFilter, depth) {
2855
+ if (depth === void 0) {
2856
+ depth = 0;
2857
+ }
2853
2858
  const rows = [];
2854
2859
 
2855
2860
  // Filter from children up first
@@ -2858,8 +2863,8 @@
2858
2863
  let row = rowsToFilter[i];
2859
2864
  const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2860
2865
  newRow.columnFilters = row.columnFilters;
2861
- if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
2862
- newRow.subRows = recurseFilterRows(row.subRows);
2866
+ if ((_row$subRows = row.subRows) != null && _row$subRows.length && depth < maxDepth) {
2867
+ newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
2863
2868
  row = newRow;
2864
2869
  if (filterRow(row) && !newRow.subRows.length) {
2865
2870
  rows.push(row);
@@ -2893,9 +2898,13 @@
2893
2898
  function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
2894
2899
  const newFilteredFlatRows = [];
2895
2900
  const newFilteredRowsById = {};
2901
+ const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
2896
2902
 
2897
2903
  // Filters top level and nested rows
2898
2904
  const recurseFilterRows = function (rowsToFilter, depth) {
2905
+ if (depth === void 0) {
2906
+ depth = 0;
2907
+ }
2899
2908
  // Filter from parents downward first
2900
2909
 
2901
2910
  const rows = [];
@@ -2906,9 +2915,9 @@
2906
2915
  const pass = filterRow(row);
2907
2916
  if (pass) {
2908
2917
  var _row$subRows2;
2909
- if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
2918
+ if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length && depth < maxDepth) {
2910
2919
  const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2911
- newRow.subRows = recurseFilterRows(row.subRows);
2920
+ newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
2912
2921
  row = newRow;
2913
2922
  }
2914
2923
  rows.push(row);