@tanstack/table-core 8.19.2 → 8.19.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.
@@ -3259,6 +3259,10 @@ function getFilteredRowModel() {
3259
3259
  function getGroupedRowModel() {
3260
3260
  return table => memo(() => [table.getState().grouping, table.getPreGroupedRowModel()], (grouping, rowModel) => {
3261
3261
  if (!rowModel.rows.length || !grouping.length) {
3262
+ rowModel.rows.forEach(row => {
3263
+ row.depth = 0;
3264
+ row.parentId = undefined;
3265
+ });
3262
3266
  return rowModel;
3263
3267
  }
3264
3268
 
@@ -3294,7 +3298,7 @@ function getGroupedRowModel() {
3294
3298
  // Group the rows together for this level
3295
3299
  const rowGroupsMap = groupBy(rows, columnId);
3296
3300
 
3297
- // Peform aggregations for each group
3301
+ // Perform aggregations for each group
3298
3302
  const aggregatedGroupedRows = Array.from(rowGroupsMap.entries()).map((_ref, index) => {
3299
3303
  let [groupingValue, groupedRows] = _ref;
3300
3304
  let id = `${columnId}:${groupingValue}`;
@@ -3302,6 +3306,9 @@ function getGroupedRowModel() {
3302
3306
 
3303
3307
  // First, Recurse to group sub rows before aggregation
3304
3308
  const subRows = groupUpRecursively(groupedRows, depth + 1, id);
3309
+ subRows.forEach(subRow => {
3310
+ subRow.parentId = id;
3311
+ });
3305
3312
 
3306
3313
  // Flatten the leaf rows of the rows in this group
3307
3314
  const leafRows = depth ? flattenBy(groupedRows, row => row.subRows) : groupedRows;