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