@tanstack/svelte-table 8.2.3 → 8.2.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.
@@ -2259,8 +2259,8 @@ const RowSelection = {
2259
2259
  const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
2260
2260
  var _row$subRows;
2261
2261
 
2262
- const row = table.getRow(id);
2263
- row.getIsGrouped(); // if ( // TODO: enforce grouping row selection rules
2262
+ const row = table.getRow(id); // const isGrouped = row.getIsGrouped()
2263
+ // if ( // TODO: enforce grouping row selection rules
2264
2264
  // !isGrouped ||
2265
2265
  // (isGrouped && table.options.enableGroupingRowSelection)
2266
2266
  // ) {
@@ -3575,9 +3575,20 @@ function getGroupedRowModel() {
3575
3575
  depth = 0;
3576
3576
  }
3577
3577
 
3578
- // This is the last level, just return the rows
3579
- if (depth === existingGrouping.length) {
3580
- return rows;
3578
+ // Grouping depth has been been met
3579
+ // Stop grouping and simply rewrite thd depth and row relationships
3580
+ if (depth >= existingGrouping.length) {
3581
+ return rows.map(row => {
3582
+ row.depth = depth;
3583
+ groupedFlatRows.push(row);
3584
+ groupedRowsById[row.id] = row;
3585
+
3586
+ if (row.subRows) {
3587
+ row.subRows = groupUpRecursively(row.subRows, depth + 1);
3588
+ }
3589
+
3590
+ return row;
3591
+ });
3581
3592
  }
3582
3593
 
3583
3594
  const columnId = existingGrouping[depth]; // Group the rows together for this level