@tanstack/react-table 8.0.0-beta.9 → 8.0.4

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.
@@ -1333,7 +1333,10 @@ function shouldAutoRemoveFilter(filterFn, value, column) {
1333
1333
  const sum = (columnId, _leafRows, childRows) => {
1334
1334
  // It's faster to just add the aggregations together instead of
1335
1335
  // process leaf nodes individually
1336
- return childRows.reduce((sum, next) => sum + (typeof next === 'number' ? next : 0), 0);
1336
+ return childRows.reduce((sum, next) => {
1337
+ const nextValue = next.getValue(columnId);
1338
+ return sum + (typeof nextValue === 'number' ? nextValue : 0);
1339
+ }, 0);
1337
1340
  };
1338
1341
 
1339
1342
  const min = (columnId, _leafRows, childRows) => {
@@ -2306,9 +2309,6 @@ function selectRowsFn(instance, rowModel) {
2306
2309
  const newSelectedRowsById = {}; // Filters top level and nested rows
2307
2310
 
2308
2311
  const recurseRows = function (rows, depth) {
2309
- if (depth === void 0) {
2310
- depth = 0;
2311
- }
2312
2312
 
2313
2313
  return rows.map(row => {
2314
2314
  var _row$subRows2;
@@ -2322,7 +2322,7 @@ function selectRowsFn(instance, rowModel) {
2322
2322
 
2323
2323
  if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
2324
2324
  row = { ...row,
2325
- subRows: recurseRows(row.subRows, depth + 1)
2325
+ subRows: recurseRows(row.subRows)
2326
2326
  };
2327
2327
  }
2328
2328
 
@@ -3247,9 +3247,6 @@ function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
3247
3247
  const newFilteredRowsById = {};
3248
3248
 
3249
3249
  const recurseFilterRows = function (rowsToFilter, depth) {
3250
- if (depth === void 0) {
3251
- depth = 0;
3252
- }
3253
3250
 
3254
3251
  const rows = []; // Filter from children up first
3255
3252
 
@@ -3261,7 +3258,7 @@ function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
3261
3258
  if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
3262
3259
  const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3263
3260
  newRow.columnFilters = row.columnFilters;
3264
- newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
3261
+ newRow.subRows = recurseFilterRows(row.subRows);
3265
3262
 
3266
3263
  if (!newRow.subRows.length) {
3267
3264
  continue;
@@ -3291,9 +3288,6 @@ function filterRowModelFromRoot(rowsToFilter, filterRow, instance) {
3291
3288
  const newFilteredRowsById = {}; // Filters top level and nested rows
3292
3289
 
3293
3290
  const recurseFilterRows = function (rowsToFilter, depth) {
3294
- if (depth === void 0) {
3295
- depth = 0;
3296
- }
3297
3291
 
3298
3292
  // Filter from parents downward first
3299
3293
  const rows = []; // Apply the filter to any subRows
@@ -3307,7 +3301,7 @@ function filterRowModelFromRoot(rowsToFilter, filterRow, instance) {
3307
3301
 
3308
3302
  if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
3309
3303
  const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3310
- newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
3304
+ newRow.subRows = recurseFilterRows(row.subRows);
3311
3305
  row = newRow;
3312
3306
  }
3313
3307