@tanstack/table-core 8.2.3 → 8.2.6

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.
@@ -953,7 +953,7 @@
953
953
  getCanExpand: () => {
954
954
  var _table$options$getRow, _table$options$enable, _row$subRows;
955
955
 
956
- return ((_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : true) && ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
956
+ return (_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
957
957
  },
958
958
  getToggleExpandedHandler: () => {
959
959
  const canExpand = row.getCanExpand();
@@ -1099,7 +1099,7 @@
1099
1099
  var _table$getCoreRowMode, _table$getCoreRowMode2;
1100
1100
 
1101
1101
  const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null ? void 0 : (_table$getCoreRowMode2 = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode2.getValue();
1102
- return typeof value === 'string';
1102
+ return typeof value === 'string' || typeof value === 'number';
1103
1103
  }
1104
1104
  };
1105
1105
  },
@@ -2250,8 +2250,8 @@
2250
2250
  const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
2251
2251
  var _row$subRows;
2252
2252
 
2253
- const row = table.getRow(id);
2254
- row.getIsGrouped(); // if ( // TODO: enforce grouping row selection rules
2253
+ const row = table.getRow(id); // const isGrouped = row.getIsGrouped()
2254
+ // if ( // TODO: enforce grouping row selection rules
2255
2255
  // !isGrouped ||
2256
2256
  // (isGrouped && table.options.enableGroupingRowSelection)
2257
2257
  // ) {
@@ -3564,9 +3564,20 @@
3564
3564
  depth = 0;
3565
3565
  }
3566
3566
 
3567
- // This is the last level, just return the rows
3568
- if (depth === existingGrouping.length) {
3569
- return rows;
3567
+ // Grouping depth has been been met
3568
+ // Stop grouping and simply rewrite thd depth and row relationships
3569
+ if (depth >= existingGrouping.length) {
3570
+ return rows.map(row => {
3571
+ row.depth = depth;
3572
+ groupedFlatRows.push(row);
3573
+ groupedRowsById[row.id] = row;
3574
+
3575
+ if (row.subRows) {
3576
+ row.subRows = groupUpRecursively(row.subRows, depth + 1);
3577
+ }
3578
+
3579
+ return row;
3580
+ });
3570
3581
  }
3571
3582
 
3572
3583
  const columnId = existingGrouping[depth]; // Group the rows together for this level