@tanstack/react-table 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.
@@ -963,7 +963,7 @@ const Expanding = {
963
963
  getCanExpand: () => {
964
964
  var _table$options$getRow, _table$options$enable, _row$subRows;
965
965
 
966
- 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);
966
+ 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);
967
967
  },
968
968
  getToggleExpandedHandler: () => {
969
969
  const canExpand = row.getCanExpand();
@@ -1109,7 +1109,7 @@ const Filters = {
1109
1109
  var _table$getCoreRowMode, _table$getCoreRowMode2;
1110
1110
 
1111
1111
  const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null ? void 0 : (_table$getCoreRowMode2 = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode2.getValue();
1112
- return typeof value === 'string';
1112
+ return typeof value === 'string' || typeof value === 'number';
1113
1113
  }
1114
1114
  };
1115
1115
  },
@@ -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