@tanstack/react-table 8.0.0-alpha.9 → 8.0.0-beta.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.
- package/build/cjs/react-table/src/index.js +139 -0
- package/build/cjs/react-table/src/index.js.map +1 -0
- package/build/cjs/table-core/build/esm/index.js +3867 -0
- package/build/cjs/table-core/build/esm/index.js.map +1 -0
- package/build/esm/index.js +3196 -4117
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +24 -813
- package/build/types/index.d.ts +16 -9
- package/build/umd/index.development.js +3234 -4125
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +11 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +10 -6
- package/src/index.tsx +111 -9
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -112
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
- package/build/cjs/aggregationTypes.js +0 -130
- package/build/cjs/aggregationTypes.js.map +0 -1
- package/build/cjs/core.js +0 -545
- package/build/cjs/core.js.map +0 -1
- package/build/cjs/createTable.js +0 -122
- package/build/cjs/createTable.js.map +0 -1
- package/build/cjs/features/ColumnSizing.js +0 -318
- package/build/cjs/features/ColumnSizing.js.map +0 -1
- package/build/cjs/features/Expanding.js +0 -239
- package/build/cjs/features/Expanding.js.map +0 -1
- package/build/cjs/features/Filters.js +0 -414
- package/build/cjs/features/Filters.js.map +0 -1
- package/build/cjs/features/Grouping.js +0 -232
- package/build/cjs/features/Grouping.js.map +0 -1
- package/build/cjs/features/Headers.js +0 -629
- package/build/cjs/features/Headers.js.map +0 -1
- package/build/cjs/features/Ordering.js +0 -86
- package/build/cjs/features/Ordering.js.map +0 -1
- package/build/cjs/features/Pagination.js +0 -193
- package/build/cjs/features/Pagination.js.map +0 -1
- package/build/cjs/features/Pinning.js +0 -149
- package/build/cjs/features/Pinning.js.map +0 -1
- package/build/cjs/features/RowSelection.js +0 -526
- package/build/cjs/features/RowSelection.js.map +0 -1
- package/build/cjs/features/Sorting.js +0 -315
- package/build/cjs/features/Sorting.js.map +0 -1
- package/build/cjs/features/Visibility.js +0 -174
- package/build/cjs/features/Visibility.js.map +0 -1
- package/build/cjs/filterTypes.js +0 -172
- package/build/cjs/filterTypes.js.map +0 -1
- package/build/cjs/index.js +0 -44
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/sortTypes.js +0 -122
- package/build/cjs/sortTypes.js.map +0 -1
- package/build/cjs/types.js +0 -22
- package/build/cjs/types.js.map +0 -1
- package/build/cjs/utils/columnFilterRowsFn.js +0 -131
- package/build/cjs/utils/columnFilterRowsFn.js.map +0 -1
- package/build/cjs/utils/expandRowsFn.js +0 -38
- package/build/cjs/utils/expandRowsFn.js.map +0 -1
- package/build/cjs/utils/globalFilterRowsFn.js +0 -101
- package/build/cjs/utils/globalFilterRowsFn.js.map +0 -1
- package/build/cjs/utils/groupRowsFn.js +0 -155
- package/build/cjs/utils/groupRowsFn.js.map +0 -1
- package/build/cjs/utils/paginateRowsFn.js +0 -44
- package/build/cjs/utils/paginateRowsFn.js.map +0 -1
- package/build/cjs/utils/sortRowsFn.js +0 -94
- package/build/cjs/utils/sortRowsFn.js.map +0 -1
- package/build/cjs/utils.js +0 -167
- package/build/cjs/utils.js.map +0 -1
- package/build/types/aggregationTypes.d.ts +0 -22
- package/build/types/core.d.ts +0 -105
- package/build/types/createTable.d.ts +0 -42
- package/build/types/features/ColumnSizing.d.ts +0 -73
- package/build/types/features/Expanding.d.ts +0 -48
- package/build/types/features/Filters.d.ts +0 -90
- package/build/types/features/Grouping.d.ts +0 -83
- package/build/types/features/Headers.d.ts +0 -41
- package/build/types/features/Ordering.d.ts +0 -19
- package/build/types/features/Pagination.d.ts +0 -39
- package/build/types/features/Pinning.d.ts +0 -39
- package/build/types/features/RowSelection.d.ts +0 -58
- package/build/types/features/Sorting.d.ts +0 -79
- package/build/types/features/Visibility.d.ts +0 -47
- package/build/types/filterTypes.d.ts +0 -50
- package/build/types/sortTypes.d.ts +0 -18
- package/build/types/types.d.ts +0 -138
- package/build/types/utils/columnFilterRowsFn.d.ts +0 -2
- package/build/types/utils/expandRowsFn.d.ts +0 -2
- package/build/types/utils/globalFilterRowsFn.d.ts +0 -2
- package/build/types/utils/groupRowsFn.d.ts +0 -2
- package/build/types/utils/paginateRowsFn.d.ts +0 -2
- package/build/types/utils/sortRowsFn.d.ts +0 -2
- package/build/types/utils.d.ts +0 -23
- package/src/aggregationTypes.ts +0 -115
- package/src/core.tsx +0 -763
- package/src/createTable.tsx +0 -186
- package/src/features/ColumnSizing.ts +0 -424
- package/src/features/Expanding.ts +0 -318
- package/src/features/Filters.ts +0 -560
- package/src/features/Grouping.ts +0 -361
- package/src/features/Headers.ts +0 -729
- package/src/features/Ordering.ts +0 -110
- package/src/features/Pagination.ts +0 -250
- package/src/features/Pinning.ts +0 -174
- package/src/features/RowSelection.ts +0 -651
- package/src/features/Sorting.ts +0 -453
- package/src/features/Visibility.ts +0 -238
- package/src/filterTypes.ts +0 -188
- package/src/sortTypes.ts +0 -147
- package/src/types.ts +0 -311
- package/src/utils/columnFilterRowsFn.ts +0 -113
- package/src/utils/expandRowsFn.ts +0 -30
- package/src/utils/globalFilterRowsFn.ts +0 -89
- package/src/utils/groupRowsFn.ts +0 -170
- package/src/utils/paginateRowsFn.ts +0 -28
- package/src/utils/sortRowsFn.ts +0 -95
- package/src/utils.tsx +0 -221
package/src/features/Grouping.ts
DELETED
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
import React, { MouseEvent, TouchEvent } from 'react'
|
|
2
|
-
import { RowModel } from '..'
|
|
3
|
-
import { BuiltInAggregationType, aggregationTypes } from '../aggregationTypes'
|
|
4
|
-
import {
|
|
5
|
-
Cell,
|
|
6
|
-
Column,
|
|
7
|
-
Getter,
|
|
8
|
-
OnChangeFn,
|
|
9
|
-
PropGetterValue,
|
|
10
|
-
TableInstance,
|
|
11
|
-
Row,
|
|
12
|
-
Updater,
|
|
13
|
-
PartialGenerics,
|
|
14
|
-
} from '../types'
|
|
15
|
-
import {
|
|
16
|
-
functionalUpdate,
|
|
17
|
-
isFunction,
|
|
18
|
-
makeStateUpdater,
|
|
19
|
-
memo,
|
|
20
|
-
Overwrite,
|
|
21
|
-
propGetter,
|
|
22
|
-
} from '../utils'
|
|
23
|
-
|
|
24
|
-
export type GroupingState = string[]
|
|
25
|
-
|
|
26
|
-
export type AggregationFn<TGenerics extends PartialGenerics> = (
|
|
27
|
-
leafValues: TGenerics['Row'][],
|
|
28
|
-
childValues: TGenerics['Row'][]
|
|
29
|
-
) => any
|
|
30
|
-
|
|
31
|
-
export type CustomAggregationTypes<TGenerics extends PartialGenerics> = Record<
|
|
32
|
-
string,
|
|
33
|
-
AggregationFn<TGenerics>
|
|
34
|
-
>
|
|
35
|
-
|
|
36
|
-
export type AggregationType<TGenerics extends PartialGenerics> =
|
|
37
|
-
| 'auto'
|
|
38
|
-
| BuiltInAggregationType
|
|
39
|
-
| keyof TGenerics['AggregationFns']
|
|
40
|
-
| AggregationFn<TGenerics>
|
|
41
|
-
|
|
42
|
-
export type GroupingTableState = {
|
|
43
|
-
grouping: GroupingState
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type GroupingColumnDef<TGenerics extends PartialGenerics> = {
|
|
47
|
-
aggregationType?: AggregationType<Overwrite<TGenerics, { Value: any }>>
|
|
48
|
-
aggregateValue?: (columnValue: unknown) => any
|
|
49
|
-
renderAggregatedCell?: () => React.ReactNode
|
|
50
|
-
enableGrouping?: boolean
|
|
51
|
-
defaultCanGroup?: boolean
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export type GroupingColumn<TGenerics extends PartialGenerics> = {
|
|
55
|
-
aggregationType?: AggregationType<Overwrite<TGenerics, { Value: any }>>
|
|
56
|
-
getCanGroup: () => boolean
|
|
57
|
-
getIsGrouped: () => boolean
|
|
58
|
-
getGroupedIndex: () => number
|
|
59
|
-
toggleGrouping: () => void
|
|
60
|
-
getToggleGroupingProps: <TGetter extends Getter<ToggleGroupingProps>>(
|
|
61
|
-
userProps?: TGetter
|
|
62
|
-
) => undefined | PropGetterValue<ToggleGroupingProps, TGetter>
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export type GroupingRow = {
|
|
66
|
-
groupingColumnId?: string
|
|
67
|
-
groupingValue?: any
|
|
68
|
-
getIsGrouped: () => boolean
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export type GroupingCell = {
|
|
72
|
-
getIsGrouped: () => boolean
|
|
73
|
-
getIsPlaceholder: () => boolean
|
|
74
|
-
getIsAggregated: () => boolean
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export type ColumnDefaultOptions = {
|
|
78
|
-
// Column
|
|
79
|
-
onGroupingChange: OnChangeFn<GroupingState>
|
|
80
|
-
autoResetGrouping: boolean
|
|
81
|
-
enableGrouping: boolean
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type GroupingOptions<TGenerics extends PartialGenerics> = {
|
|
85
|
-
aggregationTypes?: TGenerics['AggregationFns']
|
|
86
|
-
onGroupingChange?: OnChangeFn<GroupingState>
|
|
87
|
-
autoResetGrouping?: boolean
|
|
88
|
-
enableGrouping?: boolean
|
|
89
|
-
enableGroupingRemoval?: boolean
|
|
90
|
-
groupRowsFn?: (
|
|
91
|
-
instance: TableInstance<TGenerics>,
|
|
92
|
-
rowModel: RowModel<TGenerics>
|
|
93
|
-
) => RowModel<TGenerics>
|
|
94
|
-
|
|
95
|
-
groupedColumnMode?: false | 'reorder' | 'remove'
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export type GroupingColumnMode = false | 'reorder' | 'remove'
|
|
99
|
-
|
|
100
|
-
export type ToggleGroupingProps = {
|
|
101
|
-
title?: string
|
|
102
|
-
onClick?: (event: MouseEvent | TouchEvent) => void
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export type GroupingInstance<TGenerics extends PartialGenerics> = {
|
|
106
|
-
_notifyGroupingReset: () => void
|
|
107
|
-
getColumnAutoAggregationFn: (
|
|
108
|
-
columnId: string
|
|
109
|
-
) => AggregationFn<TGenerics> | undefined
|
|
110
|
-
getColumnAggregationFn: (
|
|
111
|
-
columnId: string
|
|
112
|
-
) => AggregationFn<TGenerics> | undefined
|
|
113
|
-
setGrouping: (updater: Updater<GroupingState>) => void
|
|
114
|
-
resetGrouping: () => void
|
|
115
|
-
toggleColumnGrouping: (columnId: string) => void
|
|
116
|
-
getColumnCanGroup: (columnId: string) => boolean
|
|
117
|
-
getColumnIsGrouped: (columnId: string) => boolean
|
|
118
|
-
getColumnGroupedIndex: (columnId: string) => number
|
|
119
|
-
getToggleGroupingProps: <TGetter extends Getter<ToggleGroupingProps>>(
|
|
120
|
-
columnId: string,
|
|
121
|
-
userProps?: TGetter
|
|
122
|
-
) => undefined | PropGetterValue<ToggleGroupingProps, TGetter>
|
|
123
|
-
getRowIsGrouped: (rowId: string) => boolean
|
|
124
|
-
getPreGroupedRowModel: () => RowModel<TGenerics>
|
|
125
|
-
getGroupedRowModel: () => RowModel<TGenerics>
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
export function getDefaultColumn<
|
|
131
|
-
TGenerics extends PartialGenerics
|
|
132
|
-
>(): GroupingColumnDef<TGenerics> {
|
|
133
|
-
return {
|
|
134
|
-
aggregationType: 'auto',
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export function getInitialState(): GroupingTableState {
|
|
139
|
-
return {
|
|
140
|
-
grouping: [],
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export function getDefaultOptions<TGenerics extends PartialGenerics>(
|
|
145
|
-
instance: TableInstance<TGenerics>
|
|
146
|
-
): GroupingOptions<TGenerics> {
|
|
147
|
-
return {
|
|
148
|
-
onGroupingChange: makeStateUpdater('grouping', instance),
|
|
149
|
-
autoResetGrouping: true,
|
|
150
|
-
groupedColumnMode: 'reorder',
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export function createColumn<TGenerics extends PartialGenerics>(
|
|
155
|
-
column: Column<TGenerics>,
|
|
156
|
-
instance: TableInstance<TGenerics>
|
|
157
|
-
): GroupingColumn<TGenerics> {
|
|
158
|
-
return {
|
|
159
|
-
aggregationType: column.aggregationType,
|
|
160
|
-
getCanGroup: () => instance.getColumnCanGroup(column.id),
|
|
161
|
-
getGroupedIndex: () => instance.getColumnGroupedIndex(column.id),
|
|
162
|
-
getIsGrouped: () => instance.getColumnIsGrouped(column.id),
|
|
163
|
-
toggleGrouping: () => instance.toggleColumnGrouping(column.id),
|
|
164
|
-
getToggleGroupingProps: userProps =>
|
|
165
|
-
instance.getToggleGroupingProps(column.id, userProps),
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export function getInstance<TGenerics extends PartialGenerics>(
|
|
170
|
-
instance: TableInstance<TGenerics>
|
|
171
|
-
): GroupingInstance<TGenerics> {
|
|
172
|
-
let registered = false
|
|
173
|
-
|
|
174
|
-
return {
|
|
175
|
-
_notifyGroupingReset: () => {
|
|
176
|
-
if (!registered) {
|
|
177
|
-
registered = true
|
|
178
|
-
return
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (instance.options.autoResetAll === false) {
|
|
182
|
-
return
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (
|
|
186
|
-
instance.options.autoResetAll === true ||
|
|
187
|
-
instance.options.autoResetGrouping
|
|
188
|
-
) {
|
|
189
|
-
instance.resetGrouping()
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
getColumnAutoAggregationFn: columnId => {
|
|
193
|
-
const firstRow = instance.getCoreRowModel().flatRows[0]
|
|
194
|
-
|
|
195
|
-
const value = firstRow?.values[columnId]
|
|
196
|
-
|
|
197
|
-
if (typeof value === 'number') {
|
|
198
|
-
return aggregationTypes.sum
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
202
|
-
return aggregationTypes.extent
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return aggregationTypes.count
|
|
206
|
-
},
|
|
207
|
-
getColumnAggregationFn: columnId => {
|
|
208
|
-
const column = instance.getColumn(columnId)
|
|
209
|
-
const userAggregationTypes = instance.options.aggregationTypes
|
|
210
|
-
|
|
211
|
-
if (!column) {
|
|
212
|
-
throw new Error()
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return isFunction(column.aggregationType)
|
|
216
|
-
? column.aggregationType
|
|
217
|
-
: column.aggregationType === 'auto'
|
|
218
|
-
? instance.getColumnAutoFilterFn(columnId)
|
|
219
|
-
: (userAggregationTypes as Record<string, any>)?.[
|
|
220
|
-
column.aggregationType as string
|
|
221
|
-
] ??
|
|
222
|
-
(aggregationTypes[
|
|
223
|
-
column.aggregationType as BuiltInAggregationType
|
|
224
|
-
] as AggregationFn<TGenerics>)
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
setGrouping: updater =>
|
|
228
|
-
instance.options.onGroupingChange?.(
|
|
229
|
-
updater,
|
|
230
|
-
functionalUpdate(updater, instance.getState().grouping)
|
|
231
|
-
),
|
|
232
|
-
|
|
233
|
-
toggleColumnGrouping: columnId => {
|
|
234
|
-
instance.setGrouping(old => {
|
|
235
|
-
// Find any existing grouping for this column
|
|
236
|
-
if (old?.includes(columnId)) {
|
|
237
|
-
return old.filter(d => d !== columnId)
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return [...(old ?? []), columnId]
|
|
241
|
-
})
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
getColumnCanGroup: columnId => {
|
|
245
|
-
const column = instance.getColumn(columnId)
|
|
246
|
-
|
|
247
|
-
if (!column) {
|
|
248
|
-
throw new Error()
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
return (
|
|
252
|
-
column.enableGrouping ??
|
|
253
|
-
instance.options.enableGrouping ??
|
|
254
|
-
column.defaultCanGroup ??
|
|
255
|
-
!!column.accessorFn
|
|
256
|
-
)
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
getColumnIsGrouped: columnId => {
|
|
260
|
-
return instance.getState().grouping?.includes(columnId)
|
|
261
|
-
},
|
|
262
|
-
|
|
263
|
-
getColumnGroupedIndex: columnId =>
|
|
264
|
-
instance.getState().grouping?.indexOf(columnId),
|
|
265
|
-
|
|
266
|
-
resetGrouping: () => {
|
|
267
|
-
instance.setGrouping(instance.initialState?.grouping ?? [])
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
getToggleGroupingProps: (columnId, userProps) => {
|
|
271
|
-
const column = instance.getColumn(columnId)
|
|
272
|
-
|
|
273
|
-
const canGroup = column.getCanGroup()
|
|
274
|
-
|
|
275
|
-
const initialProps: ToggleGroupingProps = {
|
|
276
|
-
title: canGroup ? 'Toggle Grouping' : undefined,
|
|
277
|
-
onClick: canGroup
|
|
278
|
-
? (e: MouseEvent | TouchEvent) => {
|
|
279
|
-
e.persist()
|
|
280
|
-
column.toggleGrouping?.()
|
|
281
|
-
}
|
|
282
|
-
: undefined,
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
return propGetter(initialProps, userProps)
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
getRowIsGrouped: rowId => !!instance.getRow(rowId)?.groupingColumnId,
|
|
289
|
-
|
|
290
|
-
getPreGroupedRowModel: () => instance.getSortedRowModel(),
|
|
291
|
-
getGroupedRowModel: memo(
|
|
292
|
-
() => [
|
|
293
|
-
instance.getState().grouping,
|
|
294
|
-
instance.getSortedRowModel(),
|
|
295
|
-
instance.options.groupRowsFn,
|
|
296
|
-
],
|
|
297
|
-
(grouping, rowModel, groupRowsFn) => {
|
|
298
|
-
if (!groupRowsFn || !grouping.length) {
|
|
299
|
-
return rowModel
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
return groupRowsFn(instance, rowModel)
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
key: 'getGroupedRowModel',
|
|
306
|
-
debug: () => instance.options.debugAll ?? instance.options.debugTable,
|
|
307
|
-
onChange: () => instance._notifyExpandedReset(),
|
|
308
|
-
}
|
|
309
|
-
),
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export function createRow<TGenerics extends PartialGenerics>(
|
|
314
|
-
row: Row<TGenerics>,
|
|
315
|
-
instance: TableInstance<TGenerics>
|
|
316
|
-
): GroupingRow {
|
|
317
|
-
return {
|
|
318
|
-
getIsGrouped: () => instance.getRowIsGrouped(row.id),
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export function createCell<TGenerics extends PartialGenerics>(
|
|
323
|
-
cell: Cell<TGenerics> & GroupingCell,
|
|
324
|
-
column: Column<TGenerics>,
|
|
325
|
-
row: Row<TGenerics>,
|
|
326
|
-
_instance: TableInstance<TGenerics>
|
|
327
|
-
): GroupingCell {
|
|
328
|
-
return {
|
|
329
|
-
getIsGrouped: () =>
|
|
330
|
-
column.getIsGrouped() && column.id === row.groupingColumnId,
|
|
331
|
-
getIsPlaceholder: () => !cell.getIsGrouped() && column.getIsGrouped(),
|
|
332
|
-
getIsAggregated: () =>
|
|
333
|
-
!cell.getIsGrouped() &&
|
|
334
|
-
!cell.getIsPlaceholder() &&
|
|
335
|
-
row.subRows?.length > 1,
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export function orderColumns<TGenerics extends PartialGenerics>(
|
|
340
|
-
leafColumns: Column<TGenerics>[],
|
|
341
|
-
grouping: string[],
|
|
342
|
-
groupedColumnMode?: GroupingColumnMode
|
|
343
|
-
) {
|
|
344
|
-
if (!grouping?.length || !groupedColumnMode) {
|
|
345
|
-
return leafColumns
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
const nonGroupingColumns = leafColumns.filter(
|
|
349
|
-
col => !grouping.includes(col.id)
|
|
350
|
-
)
|
|
351
|
-
|
|
352
|
-
if (groupedColumnMode === 'remove') {
|
|
353
|
-
return nonGroupingColumns
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
const groupingColumns = grouping
|
|
357
|
-
.map(g => leafColumns.find(col => col.id === g)!)
|
|
358
|
-
.filter(Boolean)
|
|
359
|
-
|
|
360
|
-
return [...groupingColumns, ...nonGroupingColumns]
|
|
361
|
-
}
|