@tanstack/svelte-table 8.10.1 → 8.10.3

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
  });
@@ -2155,9 +2155,10 @@
2155
2155
  };
2156
2156
  },
2157
2157
  createRow: (row, table) => {
2158
- row.toggleSelected = value => {
2158
+ row.toggleSelected = (value, opts) => {
2159
2159
  const isSelected = row.getIsSelected();
2160
2160
  table.setRowSelection(old => {
2161
+ var _opts$selectChildren;
2161
2162
  value = typeof value !== 'undefined' ? value : !isSelected;
2162
2163
  if (row.getCanSelect() && isSelected === value) {
2163
2164
  return old;
@@ -2165,7 +2166,7 @@
2165
2166
  const selectedRowIds = {
2166
2167
  ...old
2167
2168
  };
2168
- mutateRowIsSelected(selectedRowIds, row.id, value, table);
2169
+ mutateRowIsSelected(selectedRowIds, row.id, value, (_opts$selectChildren = opts == null ? void 0 : opts.selectChildren) != null ? _opts$selectChildren : true, table);
2169
2170
  return selectedRowIds;
2170
2171
  });
2171
2172
  };
@@ -2218,7 +2219,7 @@
2218
2219
  };
2219
2220
  }
2220
2221
  };
2221
- const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
2222
+ const mutateRowIsSelected = (selectedRowIds, id, value, includeChildren, table) => {
2222
2223
  var _row$subRows;
2223
2224
  const row = table.getRow(id);
2224
2225
 
@@ -2240,8 +2241,8 @@
2240
2241
  }
2241
2242
  // }
2242
2243
 
2243
- if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
2244
- 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));
2245
2246
  }
2246
2247
  };
2247
2248
  function selectRowsFn(table, rowModel) {