@tanstack/svelte-table 8.10.2 → 8.10.4

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.
@@ -1981,7 +1981,7 @@
1981
1981
  ...old
1982
1982
  };
1983
1983
  table.getRowModel().rows.forEach(row => {
1984
- mutateRowIsSelected(rowSelection, row.id, resolvedValue, table);
1984
+ mutateRowIsSelected(rowSelection, row.id, resolvedValue, true, table);
1985
1985
  });
1986
1986
  return rowSelection;
1987
1987
  });
@@ -2166,9 +2166,7 @@
2166
2166
  const selectedRowIds = {
2167
2167
  ...old
2168
2168
  };
2169
- if ((_opts$selectChildren = opts == null ? void 0 : opts.selectChildren) != null ? _opts$selectChildren : true) {
2170
- mutateRowIsSelected(selectedRowIds, row.id, value, table);
2171
- }
2169
+ mutateRowIsSelected(selectedRowIds, row.id, value, (_opts$selectChildren = opts == null ? void 0 : opts.selectChildren) != null ? _opts$selectChildren : true, table);
2172
2170
  return selectedRowIds;
2173
2171
  });
2174
2172
  };
@@ -2221,7 +2219,7 @@
2221
2219
  };
2222
2220
  }
2223
2221
  };
2224
- const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
2222
+ const mutateRowIsSelected = (selectedRowIds, id, value, includeChildren, table) => {
2225
2223
  var _row$subRows;
2226
2224
  const row = table.getRow(id);
2227
2225
 
@@ -2243,8 +2241,8 @@
2243
2241
  }
2244
2242
  // }
2245
2243
 
2246
- if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
2247
- row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, table));
2244
+ if (includeChildren && (_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
2245
+ row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, includeChildren, table));
2248
2246
  }
2249
2247
  };
2250
2248
  function selectRowsFn(table, rowModel) {
@@ -3464,7 +3462,9 @@
3464
3462
  const sortData = rows => {
3465
3463
  // This will also perform a stable sorting using the row index
3466
3464
  // if needed.
3467
- const sortedData = [...rows];
3465
+ const sortedData = rows.map(row => ({
3466
+ ...row
3467
+ }));
3468
3468
  sortedData.sort((rowA, rowB) => {
3469
3469
  for (let i = 0; i < availableSorting.length; i += 1) {
3470
3470
  var _sortEntry$desc;