@tanstack/table-core 8.5.22 → 8.5.25

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.
@@ -1471,7 +1471,7 @@
1471
1471
  table.setPagination(old => {
1472
1472
  let pageIndex = functionalUpdate(updater, old.pageIndex);
1473
1473
  const maxPageIndex = typeof table.options.pageCount === 'undefined' || table.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : table.options.pageCount - 1;
1474
- pageIndex = Math.min(Math.max(0, pageIndex), maxPageIndex);
1474
+ pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex));
1475
1475
  return {
1476
1476
  ...old,
1477
1477
  pageIndex
@@ -2846,19 +2846,30 @@
2846
2846
  for (let i = 0; i < rowsToFilter.length; i++) {
2847
2847
  var _row$subRows;
2848
2848
  let row = rowsToFilter[i];
2849
+ const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2850
+ newRow.columnFilters = row.columnFilters;
2849
2851
  if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
2850
- const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2851
- newRow.columnFilters = row.columnFilters;
2852
2852
  newRow.subRows = recurseFilterRows(row.subRows);
2853
- if (!newRow.subRows.length) {
2853
+ row = newRow;
2854
+ if (filterRow(row) && !newRow.subRows.length) {
2855
+ rows.push(row);
2856
+ newFilteredRowsById[row.id] = row;
2857
+ newFilteredRowsById[i] = row;
2858
+ continue;
2859
+ }
2860
+ if (filterRow(row) || newRow.subRows.length) {
2861
+ rows.push(row);
2862
+ newFilteredRowsById[row.id] = row;
2863
+ newFilteredRowsById[i] = row;
2854
2864
  continue;
2855
2865
  }
2866
+ } else {
2856
2867
  row = newRow;
2857
- }
2858
- if (filterRow(row)) {
2859
- rows.push(row);
2860
- newFilteredRowsById[row.id] = row;
2861
- newFilteredRowsById[i] = row;
2868
+ if (filterRow(row)) {
2869
+ rows.push(row);
2870
+ newFilteredRowsById[row.id] = row;
2871
+ newFilteredRowsById[i] = row;
2872
+ }
2862
2873
  }
2863
2874
  }
2864
2875
  return rows;