@tanstack/react-table 0.0.1-alpha.8 → 8.0.0-alpha.11

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.
Files changed (61) hide show
  1. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +34 -0
  2. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  3. package/build/cjs/index.js +85 -0
  4. package/build/cjs/index.js.map +1 -0
  5. package/build/esm/index.js +73 -0
  6. package/build/esm/index.js.map +1 -0
  7. package/build/stats-html.html +2689 -0
  8. package/build/stats-react.json +99 -0
  9. package/build/types/index.d.ts +3 -0
  10. package/build/umd/index.development.js +105 -0
  11. package/build/umd/index.development.js.map +1 -0
  12. package/build/umd/index.production.js +12 -0
  13. package/build/umd/index.production.js.map +1 -0
  14. package/package.json +12 -94
  15. package/src/index.tsx +56 -7
  16. package/dist/react-table.development.js +0 -3406
  17. package/dist/react-table.development.js.map +0 -1
  18. package/dist/react-table.production.min.js +0 -2
  19. package/dist/react-table.production.min.js.map +0 -1
  20. package/lib/index.js +0 -65
  21. package/src/aggregationTypes.ts +0 -115
  22. package/src/core.tsx +0 -1194
  23. package/src/createTable.tsx +0 -181
  24. package/src/features/Expanding.ts +0 -388
  25. package/src/features/Filters.ts +0 -707
  26. package/src/features/Grouping.ts +0 -451
  27. package/src/features/Headers.ts +0 -907
  28. package/src/features/Ordering.ts +0 -134
  29. package/src/features/Pinning.ts +0 -213
  30. package/src/features/Sorting.ts +0 -487
  31. package/src/features/Visibility.ts +0 -281
  32. package/src/features/notest/useAbsoluteLayout.test.js +0 -152
  33. package/src/features/notest/useBlockLayout.test.js +0 -158
  34. package/src/features/notest/useColumnOrder.test.js +0 -186
  35. package/src/features/notest/useExpanded.test.js +0 -125
  36. package/src/features/notest/useFilters.test.js +0 -393
  37. package/src/features/notest/useFiltersAndRowSelect.test.js +0 -256
  38. package/src/features/notest/useFlexLayout.test.js +0 -152
  39. package/src/features/notest/useGroupBy.test.js +0 -259
  40. package/src/features/notest/usePagination.test.js +0 -231
  41. package/src/features/notest/useResizeColumns.test.js +0 -229
  42. package/src/features/notest/useRowSelect.test.js +0 -250
  43. package/src/features/notest/useRowState.test.js +0 -178
  44. package/src/features/tests/Visibility.test.tsx +0 -225
  45. package/src/features/tests/__snapshots__/Visibility.test.tsx.snap +0 -390
  46. package/src/features/tests/withSorting.notest.tsx +0 -341
  47. package/src/features/withColumnResizing.ts +0 -281
  48. package/src/features/withPagination.ts +0 -208
  49. package/src/features/withRowSelection.ts +0 -467
  50. package/src/filterTypes.ts +0 -251
  51. package/src/sortTypes.ts +0 -159
  52. package/src/test-utils/makeTestData.ts +0 -41
  53. package/src/tests/__snapshots__/core.test.tsx.snap +0 -148
  54. package/src/tests/core.test.tsx +0 -241
  55. package/src/types.ts +0 -285
  56. package/src/utils/columnFilterRowsFn.ts +0 -162
  57. package/src/utils/expandRowsFn.ts +0 -53
  58. package/src/utils/globalFilterRowsFn.ts +0 -129
  59. package/src/utils/groupRowsFn.ts +0 -196
  60. package/src/utils/sortRowsFn.ts +0 -115
  61. package/src/utils.tsx +0 -243
package/src/types.ts DELETED
@@ -1,285 +0,0 @@
1
- import React from 'react'
2
- // import * as TS from 'ts-toolbelt'
3
- import {
4
- CoreColumn,
5
- CoreColumnDef,
6
- CoreOptions,
7
- CoreRow,
8
- TableCore,
9
- } from './core'
10
- import {
11
- VisibilityInstance,
12
- VisibilityTableState,
13
- VisibilityColumn as ColumnVisibilityColumn,
14
- VisibilityOptions,
15
- VisibilityColumnDef,
16
- VisibilityRow,
17
- } from './features/Visibility'
18
- import {
19
- ColumnOrderInstance,
20
- ColumnOrderOptions,
21
- ColumnOrderTableState,
22
- } from './features/Ordering'
23
- import {
24
- ColumnPinningColumn,
25
- ColumnPinningColumnDef,
26
- ColumnPinningInstance,
27
- ColumnPinningOptions,
28
- ColumnPinningTableState,
29
- } from './features/Pinning'
30
- import { HeadersInstance, HeadersRow } from './features/Headers'
31
- import {
32
- FiltersColumn,
33
- FiltersColumnDef,
34
- FiltersInstance,
35
- FiltersOptions,
36
- FiltersTableState,
37
- } from './features/Filters'
38
- import {
39
- SortingColumn,
40
- SortingColumnDef,
41
- SortingInstance,
42
- SortingOptions,
43
- SortingTableState,
44
- } from './features/Sorting'
45
- import {
46
- GroupingColumn,
47
- GroupingColumnDef,
48
- GroupingInstance,
49
- GroupingOptions,
50
- GroupingRow,
51
- GroupingTableState,
52
- } from './features/Grouping'
53
- import {
54
- ExpandedInstance,
55
- ExpandedOptions,
56
- ExpandedTableState,
57
- } from './features/Expanding'
58
- import { Overwrite } from './utils'
59
-
60
- // declare global {
61
- // const process.env.NODE_ENV !== 'production': boolean
62
- // }
63
-
64
- export type ReactTable<
65
- TData,
66
- TValue,
67
- TFilterFns,
68
- TSortingFns,
69
- TAggregationFns
70
- > = TableCore<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
71
- VisibilityInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
72
- ColumnOrderInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
73
- ColumnPinningInstance<
74
- TData,
75
- TValue,
76
- TFilterFns,
77
- TSortingFns,
78
- TAggregationFns
79
- > &
80
- HeadersInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
81
- FiltersInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
82
- SortingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
83
- GroupingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
84
- ExpandedInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
85
-
86
- export type Renderable<TProps> =
87
- | React.ReactNode
88
- | React.FunctionComponent<TProps>
89
- | React.Component<TProps>
90
-
91
- //
92
-
93
- export type Options<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> =
94
- CoreOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
95
- VisibilityOptions &
96
- ColumnOrderOptions &
97
- ColumnPinningOptions &
98
- FiltersOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
99
- SortingOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
100
- GroupingOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
101
- ExpandedOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
102
-
103
- export type Updater<T> = T | ((old?: T) => T)
104
- export type OnChangeFn<T> = (updaterOrValue: Updater<T>, value: T) => void
105
-
106
- export type TableState = VisibilityTableState &
107
- ColumnOrderTableState &
108
- ColumnPinningTableState &
109
- FiltersTableState &
110
- SortingTableState &
111
- ExpandedTableState &
112
- GroupingTableState
113
-
114
- export type Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> =
115
- CoreRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
116
- VisibilityRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
117
- HeadersRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
118
- GroupingRow
119
-
120
- export type RowValues = {
121
- [key: string]: any
122
- }
123
-
124
- export type RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> =
125
- {
126
- rows: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[]
127
- flatRows: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[]
128
- rowsById: Record<
129
- string,
130
- Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
131
- >
132
- }
133
-
134
- export type AccessorFn<TData> = (originalRow: TData, index: number) => any
135
-
136
- export type ColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> =
137
- CoreColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
138
- VisibilityColumnDef &
139
- ColumnPinningColumnDef &
140
- FiltersColumnDef<TFilterFns> &
141
- SortingColumnDef<TSortingFns> &
142
- GroupingColumnDef<TAggregationFns>
143
-
144
- export type Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> =
145
- ColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
146
- CoreColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
147
- ColumnVisibilityColumn &
148
- ColumnPinningColumn &
149
- FiltersColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
150
- SortingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> &
151
- GroupingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
152
-
153
- export type Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
154
- id: string
155
- rowId: string
156
- columnId: string
157
- value: TValue
158
- row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
159
- column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
160
- getCellProps: PropGetter<CellProps>
161
- renderCell: () => React.ReactNode
162
- }
163
-
164
- export type Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
165
- id: string
166
- depth: number
167
- column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
168
- getWidth: () => number
169
- subHeaders: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[]
170
- colSpan?: number
171
- rowSpan?: number
172
- getHeaderProps: PropGetter<HeaderProps>
173
- getFooterProps: PropGetter<HeaderProps>
174
- getLeafHeaders: () => Header<
175
- TData,
176
- TValue,
177
- TFilterFns,
178
- TSortingFns,
179
- TAggregationFns
180
- >[]
181
- isPlaceholder?: boolean
182
- placeholderId?: string
183
- renderHeader: (options?: { renderPlaceholder?: boolean }) => React.ReactNode
184
- renderFooter: (options?: { renderPlaceholder?: boolean }) => React.ReactNode
185
- }
186
-
187
- export type HeaderGroup<
188
- TData,
189
- TValue,
190
- TFilterFns,
191
- TSortingFns,
192
- TAggregationFns
193
- > = {
194
- id: string
195
- depth: number
196
- headers: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[]
197
- getHeaderGroupProps: PropGetter<HeaderGroupProps>
198
- getFooterGroupProps: PropGetter<FooterGroupProps>
199
- }
200
-
201
- export type HeaderRenderProps<THeader> = {
202
- header: THeader
203
- }
204
-
205
- export type FooterRenderProps<THeader> = {
206
- header: THeader
207
- }
208
-
209
- export type CellRenderProps<TCell, TRow> = {
210
- cell: TCell
211
- row: TRow
212
- }
213
-
214
- export type TableProps = {
215
- role: string
216
- }
217
-
218
- export type TableBodyProps = {
219
- role: string
220
- }
221
-
222
- export type TableHeadProps = {
223
- key: string
224
- role: string
225
- }
226
-
227
- export type TableFooterProps = {
228
- key: string
229
- role: string
230
- }
231
-
232
- export type HeaderGroupProps = {
233
- key: string
234
- role: string
235
- }
236
-
237
- export type FooterGroupProps = {
238
- key: string
239
- role: string
240
- }
241
-
242
- export type HeaderProps = {
243
- key: string
244
- role: string
245
- colSpan?: number
246
- rowSpan?: number
247
- }
248
-
249
- export type FooterProps = {
250
- key: string
251
- role: string
252
- colSpan?: number
253
- rowSpan?: number
254
- }
255
-
256
- export type RowProps = {
257
- key: string
258
- role: string
259
- }
260
-
261
- export type CellProps = {
262
- key: string
263
- role: string
264
- }
265
-
266
- //
267
-
268
- export type PropGetter<TBase> = <TGetter extends Getter<TBase>>(
269
- userProps?: TGetter
270
- ) => PropGetterValue<TBase, TGetter>
271
-
272
- export type Getter<TInitial> =
273
- | ((initial: TInitial) => object)
274
- | object
275
- | undefined
276
-
277
- export type PropGetterValue<TBase, TGetter> = TGetter extends undefined
278
- ? TBase
279
- : TGetter extends (...args: any[]) => infer TReturn
280
- ? Overwrite<TBase, TReturn>
281
- : TGetter extends object
282
- ? Overwrite<TBase, TGetter>
283
- : never
284
-
285
- export type NoInfer<A extends any> = [A][A extends any ? 0 : never]
@@ -1,162 +0,0 @@
1
- import { ReactTable, Row, RowModel } from '../types'
2
- import { ColumnFiltersState } from '../features/Filters'
3
- import { Options } from '..'
4
-
5
- export const columnFilterRowsFn: Options<
6
- any,
7
- any,
8
- {},
9
- {},
10
- {}
11
- >['columnFilterRowsFn'] = <
12
- TData,
13
- TValue,
14
- TFilterFns,
15
- TSortingFns,
16
- TAggregationFns
17
- >(
18
- instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>,
19
- columnFilters: ColumnFiltersState,
20
- rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
21
- ): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> => {
22
- const newFilteredFlatRows: Row<
23
- TData,
24
- TValue,
25
- TFilterFns,
26
- TSortingFns,
27
- TAggregationFns
28
- >[] = []
29
- const newFilteredRowsById: Record<
30
- string,
31
- Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
32
- > = {}
33
-
34
- const filterFromChildrenUp = instance.options.filterFromChildrenUp
35
-
36
- const filterRows = (
37
- rowsToFilter: Row<
38
- TData,
39
- TValue,
40
- TFilterFns,
41
- TSortingFns,
42
- TAggregationFns
43
- >[],
44
- depth: number
45
- ) => {
46
- columnFilters.forEach(({ id: columnId, value: filterValue }) => {
47
- // Find the columnFilters column
48
- const column = instance.getColumn(columnId)
49
-
50
- if (!column) {
51
- if (process.env.NODE_ENV !== 'production') {
52
- console.warn(
53
- `React-Table: Could not find a column with id: ${columnId}`
54
- )
55
- }
56
- throw new Error()
57
- }
58
-
59
- if (depth === 0) {
60
- const preFilteredRows = [...rowsToFilter]
61
- column.getPreFilteredRows = () => preFilteredRows
62
- }
63
-
64
- const filterFn = instance.getColumnFilterFn(column.id)
65
-
66
- if (!filterFn) {
67
- if (process.env.NODE_ENV !== 'production') {
68
- console.warn(
69
- `Could not find a valid 'column.filterType' for column with the ID: ${column.id}.`
70
- )
71
- }
72
- return
73
- }
74
-
75
- // Pass the rows, id, filterValue and column to the filterFn
76
- // to get the filtered rows back
77
- rowsToFilter = filterFn(rowsToFilter, [columnId], filterValue)
78
- })
79
-
80
- return rowsToFilter
81
- }
82
-
83
- if (filterFromChildrenUp) {
84
- const recurseFilterRows = (
85
- rowsToFilter: Row<
86
- TData,
87
- TValue,
88
- TFilterFns,
89
- TSortingFns,
90
- TAggregationFns
91
- >[],
92
- depth = 0
93
- ) => {
94
- // Filter from children up
95
- rowsToFilter = rowsToFilter.filter(row => {
96
- if (!row.subRows?.length) {
97
- return true
98
- }
99
-
100
- row.subRows = recurseFilterRows(row.subRows, depth + 1)
101
-
102
- return row.subRows.length
103
- })
104
-
105
- rowsToFilter = filterRows(rowsToFilter, depth)
106
-
107
- // Apply the filter to any subRows
108
- rowsToFilter.forEach(row => {
109
- newFilteredFlatRows.push(row)
110
- newFilteredRowsById[row.id] = row
111
- })
112
-
113
- return rowsToFilter
114
- }
115
-
116
- return {
117
- rows: recurseFilterRows(rowModel.rows),
118
- flatRows: newFilteredFlatRows,
119
- rowsById: newFilteredRowsById,
120
- }
121
- }
122
-
123
- // Filters top level and nested rows
124
- const recurseFilterRows = (
125
- rowsToFilter: Row<
126
- TData,
127
- TValue,
128
- TFilterFns,
129
- TSortingFns,
130
- TAggregationFns
131
- >[],
132
- depth = 0
133
- ) => {
134
- // Filter from parents downward
135
- rowsToFilter = filterRows(rowsToFilter, depth)
136
-
137
- // Apply the filter to any subRows
138
- // We technically could do this recursively in the above loop,
139
- // but that would severely hinder the API for the user, since they
140
- // would be required to do that recursion in some scenarios
141
- rowsToFilter.forEach(row => {
142
- newFilteredFlatRows.push(row)
143
- newFilteredRowsById[row.id] = row
144
-
145
- if (!filterFromChildrenUp) {
146
- if (!row.subRows?.length) {
147
- return
148
- }
149
-
150
- row.subRows = recurseFilterRows(row.subRows, depth + 1)
151
- }
152
- })
153
-
154
- return rowsToFilter
155
- }
156
-
157
- return {
158
- rows: recurseFilterRows(rowModel.rows),
159
- flatRows: newFilteredFlatRows,
160
- rowsById: newFilteredRowsById,
161
- }
162
- }
@@ -1,53 +0,0 @@
1
- import { ReactTable, Row, RowModel } from '../types'
2
- import { Options } from '../types'
3
- import { ExpandedState } from '../features/Expanding'
4
-
5
- export const expandRowsFn: Options<any, any, {}, {}, {}>['expandRowsFn'] = <
6
- TData,
7
- TValue,
8
- TFilterFns,
9
- TSortingFns,
10
- TAggregationFns
11
- >(
12
- instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>,
13
- _expandedState: ExpandedState,
14
- sortedRowModel: RowModel<
15
- TData,
16
- TValue,
17
- TFilterFns,
18
- TSortingFns,
19
- TAggregationFns
20
- >
21
- ): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> => {
22
- const expandedRows: Row<
23
- TData,
24
- TValue,
25
- TFilterFns,
26
- TSortingFns,
27
- TAggregationFns
28
- >[] = []
29
-
30
- const { expandSubRows } = instance.options
31
-
32
- const handleRow = (
33
- row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
34
- ) => {
35
- expandedRows.push(row)
36
-
37
- if (
38
- expandSubRows &&
39
- row.subRows?.length &&
40
- instance.getIsRowExpanded(row.id)
41
- ) {
42
- row.subRows.forEach(handleRow)
43
- }
44
- }
45
-
46
- sortedRowModel.rows.forEach(handleRow)
47
-
48
- return {
49
- rows: expandedRows,
50
- flatRows: sortedRowModel.flatRows,
51
- rowsById: sortedRowModel.rowsById,
52
- }
53
- }
@@ -1,129 +0,0 @@
1
- import { Options } from '..'
2
- import { ReactTable, Row, RowModel } from '../types'
3
-
4
- export const globalFilterRowsFn: Options<
5
- any,
6
- any,
7
- {},
8
- {},
9
- {}
10
- >['globalFilterRowsFn'] = <
11
- TData,
12
- TValue,
13
- TFilterFns,
14
- TSortingFns,
15
- TAggregationFns
16
- >(
17
- instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>,
18
- globalFilter: any,
19
- rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
20
- ): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> => {
21
- const newFilteredFlatRows: Row<
22
- TData,
23
- TValue,
24
- TFilterFns,
25
- TSortingFns,
26
- TAggregationFns
27
- >[] = []
28
- const newFilteredRowsById: Record<
29
- string,
30
- Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>
31
- > = {}
32
-
33
- const filterFromChildrenUp = instance.options.filterFromChildrenUp
34
-
35
- const filterFn = instance.getGlobalFilterFn()
36
-
37
- if (!filterFn) {
38
- if (process.env.NODE_ENV !== 'production') {
39
- console.warn(`Could not find a valid 'globalFilterType'`)
40
- }
41
- return rowModel
42
- }
43
-
44
- const filterableColumns = instance
45
- .getAllLeafColumns()
46
- .filter(column => column.getCanGlobalFilter())
47
-
48
- const filterableColumnIds = filterableColumns.map(d => d.id)
49
-
50
- if (filterFromChildrenUp) {
51
- const recurseFilterRows = (
52
- rowsToFilter: Row<
53
- TData,
54
- TValue,
55
- TFilterFns,
56
- TSortingFns,
57
- TAggregationFns
58
- >[],
59
- depth = 0
60
- ) => {
61
- // Filter from children up
62
- rowsToFilter = rowsToFilter.filter(row => {
63
- if (!row.subRows?.length) {
64
- return true
65
- }
66
-
67
- row.subRows = recurseFilterRows(row.subRows, depth + 1)
68
-
69
- return row.subRows.length
70
- })
71
-
72
- rowsToFilter = filterFn(rowsToFilter, filterableColumnIds, globalFilter)
73
-
74
- // Apply the filter to any subRows
75
- rowsToFilter.forEach(row => {
76
- newFilteredFlatRows.push(row)
77
- newFilteredRowsById[row.id] = row
78
- })
79
-
80
- return rowsToFilter
81
- }
82
-
83
- return {
84
- rows: recurseFilterRows(rowModel.rows),
85
- flatRows: newFilteredFlatRows,
86
- rowsById: newFilteredRowsById,
87
- }
88
- }
89
-
90
- // Filters top level and nested rows
91
- const recurseFilterRows = (
92
- rowsToFilter: Row<
93
- TData,
94
- TValue,
95
- TFilterFns,
96
- TSortingFns,
97
- TAggregationFns
98
- >[],
99
- depth = 0
100
- ) => {
101
- // Filter from parents downward
102
- rowsToFilter = filterFn(rowsToFilter, filterableColumnIds, globalFilter)
103
-
104
- // Apply the filter to any subRows
105
- // We technically could do this recursively in the above loop,
106
- // but that would severely hinder the API for the user, since they
107
- // would be required to do that recursion in some scenarios
108
- rowsToFilter.forEach(row => {
109
- newFilteredFlatRows.push(row)
110
- newFilteredRowsById[row.id] = row
111
-
112
- if (!filterFromChildrenUp) {
113
- if (!row.subRows?.length) {
114
- return
115
- }
116
-
117
- row.subRows = recurseFilterRows(row.subRows, depth + 1)
118
- }
119
- })
120
-
121
- return rowsToFilter
122
- }
123
-
124
- return {
125
- rows: recurseFilterRows(rowModel.rows),
126
- flatRows: newFilteredFlatRows,
127
- rowsById: newFilteredRowsById,
128
- }
129
- }