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