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