@tanstack/react-table 8.5.28 → 8.6.0

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.
@@ -4024,7 +4024,7 @@ var drawChart = (function (exports) {
4024
4024
  </script>
4025
4025
  <script>
4026
4026
  /*<!--*/
4027
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"10ed-127"},{"name":"react-table/src/index.tsx","uid":"10ed-129"}]}]}],"isRoot":true},"nodeParts":{"10ed-127":{"renderedLength":126592,"gzipLength":22412,"brotliLength":0,"mainUid":"10ed-126"},"10ed-129":{"renderedLength":1923,"gzipLength":755,"brotliLength":0,"mainUid":"10ed-128"}},"nodeMetas":{"10ed-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"10ed-127"},"imported":[],"importedBy":[{"uid":"10ed-128"}]},"10ed-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"10ed-129"},"imported":[{"uid":"10ed-130"},{"uid":"10ed-126"}],"importedBy":[],"isEntry":true},"10ed-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"10ed-128"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4027
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"7238-127"},{"name":"react-table/src/index.tsx","uid":"7238-129"}]}]}],"isRoot":true},"nodeParts":{"7238-127":{"renderedLength":126934,"gzipLength":22466,"brotliLength":0,"mainUid":"7238-126"},"7238-129":{"renderedLength":1923,"gzipLength":755,"brotliLength":0,"mainUid":"7238-128"}},"nodeMetas":{"7238-126":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"7238-127"},"imported":[],"importedBy":[{"uid":"7238-128"}]},"7238-128":{"id":"/packages/react-table/src/index.tsx","moduleParts":{"index.production.js":"7238-129"},"imported":[{"uid":"7238-130"},{"uid":"7238-126"}],"importedBy":[],"isEntry":true},"7238-130":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"7238-128"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4028
4028
 
4029
4029
  const run = () => {
4030
4030
  const width = window.innerWidth;
@@ -11,11 +11,11 @@
11
11
  "children": [
12
12
  {
13
13
  "name": "table-core/build/esm/index.js",
14
- "uid": "10ed-132"
14
+ "uid": "7238-132"
15
15
  },
16
16
  {
17
17
  "name": "react-table/src/index.tsx",
18
- "uid": "10ed-134"
18
+ "uid": "7238-134"
19
19
  }
20
20
  ]
21
21
  }
@@ -25,55 +25,55 @@
25
25
  "isRoot": true
26
26
  },
27
27
  "nodeParts": {
28
- "10ed-132": {
29
- "renderedLength": 126592,
30
- "gzipLength": 22412,
28
+ "7238-132": {
29
+ "renderedLength": 126934,
30
+ "gzipLength": 22466,
31
31
  "brotliLength": 0,
32
- "mainUid": "10ed-131"
32
+ "mainUid": "7238-131"
33
33
  },
34
- "10ed-134": {
34
+ "7238-134": {
35
35
  "renderedLength": 1923,
36
36
  "gzipLength": 755,
37
37
  "brotliLength": 0,
38
- "mainUid": "10ed-133"
38
+ "mainUid": "7238-133"
39
39
  }
40
40
  },
41
41
  "nodeMetas": {
42
- "10ed-131": {
42
+ "7238-131": {
43
43
  "id": "/packages/table-core/build/esm/index.js",
44
44
  "moduleParts": {
45
- "index.production.js": "10ed-132"
45
+ "index.production.js": "7238-132"
46
46
  },
47
47
  "imported": [],
48
48
  "importedBy": [
49
49
  {
50
- "uid": "10ed-133"
50
+ "uid": "7238-133"
51
51
  }
52
52
  ]
53
53
  },
54
- "10ed-133": {
54
+ "7238-133": {
55
55
  "id": "/packages/react-table/src/index.tsx",
56
56
  "moduleParts": {
57
- "index.production.js": "10ed-134"
57
+ "index.production.js": "7238-134"
58
58
  },
59
59
  "imported": [
60
60
  {
61
- "uid": "10ed-135"
61
+ "uid": "7238-135"
62
62
  },
63
63
  {
64
- "uid": "10ed-131"
64
+ "uid": "7238-131"
65
65
  }
66
66
  ],
67
67
  "importedBy": [],
68
68
  "isEntry": true
69
69
  },
70
- "10ed-135": {
70
+ "7238-135": {
71
71
  "id": "react",
72
72
  "moduleParts": {},
73
73
  "imported": [],
74
74
  "importedBy": [
75
75
  {
76
- "uid": "10ed-133"
76
+ "uid": "7238-133"
77
77
  }
78
78
  ],
79
79
  "isExternal": true
@@ -13,7 +13,7 @@ import { RowData, TableOptions } from '@tanstack/table-core';
13
13
  export * from '@tanstack/table-core';
14
14
  import * as React from 'react';
15
15
 
16
- declare type Renderable<TProps> = React.ReactNode | React.ComponentType<TProps>;
16
+ type Renderable<TProps> = React.ReactNode | React.ComponentType<TProps>;
17
17
  declare function flexRender<TProps extends object>(Comp: Renderable<TProps>, props: TProps): React.ReactNode | JSX.Element;
18
18
  declare function useReactTable<TData extends RowData>(options: TableOptions<TData>): _tanstack_table_core.Table<TData>;
19
19
 
@@ -989,6 +989,7 @@
989
989
  onColumnFiltersChange: makeStateUpdater('columnFilters', table),
990
990
  onGlobalFilterChange: makeStateUpdater('globalFilter', table),
991
991
  filterFromLeafRows: false,
992
+ maxLeafRowFilterDepth: 100,
992
993
  globalFilterFn: 'auto',
993
994
  getColumnCanGlobalFilter: column => {
994
995
  var _table$getCoreRowMode, _table$getCoreRowMode2;
@@ -2869,7 +2870,11 @@
2869
2870
  function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
2870
2871
  const newFilteredFlatRows = [];
2871
2872
  const newFilteredRowsById = {};
2873
+ const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
2872
2874
  const recurseFilterRows = function (rowsToFilter, depth) {
2875
+ if (depth === void 0) {
2876
+ depth = 0;
2877
+ }
2873
2878
  const rows = [];
2874
2879
 
2875
2880
  // Filter from children up first
@@ -2878,8 +2883,8 @@
2878
2883
  let row = rowsToFilter[i];
2879
2884
  const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2880
2885
  newRow.columnFilters = row.columnFilters;
2881
- if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
2882
- newRow.subRows = recurseFilterRows(row.subRows);
2886
+ if ((_row$subRows = row.subRows) != null && _row$subRows.length && depth < maxDepth) {
2887
+ newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
2883
2888
  row = newRow;
2884
2889
  if (filterRow(row) && !newRow.subRows.length) {
2885
2890
  rows.push(row);
@@ -2913,9 +2918,13 @@
2913
2918
  function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
2914
2919
  const newFilteredFlatRows = [];
2915
2920
  const newFilteredRowsById = {};
2921
+ const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
2916
2922
 
2917
2923
  // Filters top level and nested rows
2918
2924
  const recurseFilterRows = function (rowsToFilter, depth) {
2925
+ if (depth === void 0) {
2926
+ depth = 0;
2927
+ }
2919
2928
  // Filter from parents downward first
2920
2929
 
2921
2930
  const rows = [];
@@ -2926,9 +2935,9 @@
2926
2935
  const pass = filterRow(row);
2927
2936
  if (pass) {
2928
2937
  var _row$subRows2;
2929
- if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
2938
+ if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length && depth < maxDepth) {
2930
2939
  const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2931
- newRow.subRows = recurseFilterRows(row.subRows);
2940
+ newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
2932
2941
  row = newRow;
2933
2942
  }
2934
2943
  rows.push(row);