@tanstack/table-core 9.0.0-alpha.32 → 9.0.0-alpha.34
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/dist/core/columns/coreColumnsFeature.cjs +18 -12
- package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.js +18 -12
- package/dist/core/columns/coreColumnsFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.cjs +11 -8
- package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.js +11 -8
- package/dist/core/headers/coreHeadersFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.cjs +2 -1
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.js +2 -1
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/table/constructTable.cjs +19 -10
- package/dist/core/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.d.cts +1 -3
- package/dist/core/table/constructTable.d.ts +1 -3
- package/dist/core/table/constructTable.js +21 -11
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +54 -10
- package/dist/core/table/coreTablesFeature.types.d.ts +54 -10
- package/dist/core/table/coreTablesFeature.utils.cjs +5 -1
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.js +5 -1
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.cjs +18 -12
- package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.js +18 -12
- package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.cjs +9 -6
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.js +9 -6
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +4 -4
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +4 -4
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.cjs +11 -6
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.js +11 -6
- package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +4 -4
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +4 -4
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.cjs +6 -2
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.js +6 -2
- package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.cjs +17 -11
- package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.js +17 -11
- package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +5 -3
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +5 -3
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.cjs +72 -45
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.js +72 -45
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +24 -13
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.js +24 -13
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +2 -2
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.js +2 -2
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +16 -10
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.js +16 -10
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +2 -2
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.js +2 -2
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +28 -16
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.js +28 -16
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +2 -2
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +2 -2
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.cjs +10 -6
- package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.js +10 -6
- package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +8 -5
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +8 -5
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.cjs +10 -6
- package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.js +10 -6
- package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +6 -6
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.js +6 -6
- package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.cjs +12 -6
- package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.js +12 -6
- package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +8 -5
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.js +8 -5
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs +12 -3
- package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.js +12 -3
- package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +14 -7
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.js +14 -7
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs +6 -2
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.js +6 -2
- package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +4 -4
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.js +4 -4
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
- package/dist/features/table-reactivity/tableReactivityFeature.cjs +23 -1
- package/dist/features/table-reactivity/tableReactivityFeature.cjs.map +1 -1
- package/dist/features/table-reactivity/tableReactivityFeature.js +23 -1
- package/dist/features/table-reactivity/tableReactivityFeature.js.map +1 -1
- package/dist/index.cjs +1 -261
- package/dist/index.d.cts +3 -23
- package/dist/index.d.ts +3 -23
- package/dist/index.js +2 -22
- package/dist/static-functions.cjs +261 -0
- package/dist/static-functions.d.cts +21 -0
- package/dist/static-functions.d.ts +21 -0
- package/dist/static-functions.js +22 -0
- package/dist/types/Table.d.cts +5 -3
- package/dist/types/Table.d.ts +5 -3
- package/dist/utils.cjs +2 -6
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +2 -6
- package/dist/utils.js.map +1 -1
- package/package.json +6 -2
- package/src/core/columns/coreColumnsFeature.ts +4 -4
- package/src/core/headers/coreHeadersFeature.ts +4 -4
- package/src/core/headers/coreHeadersFeature.utils.ts +1 -1
- package/src/core/table/constructTable.ts +31 -15
- package/src/core/table/coreTablesFeature.types.ts +69 -9
- package/src/core/table/coreTablesFeature.utils.ts +7 -1
- package/src/features/column-faceting/columnFacetingFeature.ts +4 -4
- package/src/features/column-faceting/createFacetedRowModel.ts +2 -2
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +6 -5
- package/src/features/column-filtering/createFilteredRowModel.ts +4 -3
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +2 -2
- package/src/features/column-grouping/createGroupedRowModel.ts +2 -2
- package/src/features/column-ordering/columnOrderingFeature.ts +5 -5
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +3 -3
- package/src/features/column-pinning/columnPinningFeature.ts +22 -21
- package/src/features/column-pinning/columnPinningFeature.utils.ts +12 -12
- package/src/features/column-resizing/columnResizingFeature.utils.ts +3 -1
- package/src/features/column-sizing/columnSizingFeature.ts +2 -2
- package/src/features/column-sizing/columnSizingFeature.utils.ts +1 -1
- package/src/features/column-visibility/columnVisibilityFeature.ts +6 -6
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +1 -1
- package/src/features/row-expanding/createExpandedRowModel.ts +2 -2
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +5 -5
- package/src/features/row-pagination/createPaginatedRowModel.ts +3 -3
- package/src/features/row-pagination/rowPaginationFeature.utils.ts +3 -3
- package/src/features/row-pinning/rowPinningFeature.ts +4 -4
- package/src/features/row-pinning/rowPinningFeature.utils.ts +4 -4
- package/src/features/row-selection/rowSelectionFeature.ts +3 -3
- package/src/features/row-selection/rowSelectionFeature.types.ts +1 -1
- package/src/features/row-selection/rowSelectionFeature.utils.ts +10 -8
- package/src/features/row-sorting/createSortedRowModel.ts +5 -2
- package/src/features/row-sorting/rowSortingFeature.utils.ts +5 -4
- package/src/features/table-reactivity/tableReactivityFeature.ts +46 -1
- package/src/index.ts +0 -20
- package/src/static-functions.ts +31 -0
- package/src/types/Table.ts +10 -3
- package/src/utils.ts +3 -8
|
@@ -70,6 +70,7 @@ export function constructColumnPinningFeature<
|
|
|
70
70
|
...getDefaultColumnPinningState(),
|
|
71
71
|
...initialState.columnPinning,
|
|
72
72
|
},
|
|
73
|
+
...initialState,
|
|
73
74
|
}
|
|
74
75
|
},
|
|
75
76
|
|
|
@@ -102,24 +103,24 @@ export function constructColumnPinningFeature<
|
|
|
102
103
|
fn: (row) => row_getCenterVisibleCells(row),
|
|
103
104
|
memoDeps: (row) => [
|
|
104
105
|
row.getAllCells(),
|
|
105
|
-
row.table.
|
|
106
|
-
row.table.
|
|
106
|
+
row.table.atoms.columnPinning?.get(),
|
|
107
|
+
row.table.atoms.columnVisibility?.get(),
|
|
107
108
|
],
|
|
108
109
|
},
|
|
109
110
|
row_getLeftVisibleCells: {
|
|
110
111
|
fn: (row) => row_getLeftVisibleCells(row),
|
|
111
112
|
memoDeps: (row) => [
|
|
112
113
|
row.getAllCells(),
|
|
113
|
-
row.table.
|
|
114
|
-
row.table.
|
|
114
|
+
row.table.atoms.columnPinning?.get()?.left,
|
|
115
|
+
row.table.atoms.columnVisibility?.get(),
|
|
115
116
|
],
|
|
116
117
|
},
|
|
117
118
|
row_getRightVisibleCells: {
|
|
118
119
|
fn: (row) => row_getRightVisibleCells(row),
|
|
119
120
|
memoDeps: (row) => [
|
|
120
121
|
row.getAllCells(),
|
|
121
|
-
row.table.
|
|
122
|
-
row.table.
|
|
122
|
+
row.table.atoms.columnPinning?.get()?.right,
|
|
123
|
+
row.table.atoms.columnVisibility?.get(),
|
|
123
124
|
],
|
|
124
125
|
},
|
|
125
126
|
})
|
|
@@ -146,8 +147,8 @@ export function constructColumnPinningFeature<
|
|
|
146
147
|
'getVisibleLeafColumns',
|
|
147
148
|
table_getVisibleLeafColumns,
|
|
148
149
|
),
|
|
149
|
-
table.
|
|
150
|
-
table.
|
|
150
|
+
table.atoms.columnPinning?.get()?.left,
|
|
151
|
+
table.atoms.columnOrder?.get(),
|
|
151
152
|
],
|
|
152
153
|
},
|
|
153
154
|
table_getCenterHeaderGroups: {
|
|
@@ -159,8 +160,8 @@ export function constructColumnPinningFeature<
|
|
|
159
160
|
'getVisibleLeafColumns',
|
|
160
161
|
table_getVisibleLeafColumns,
|
|
161
162
|
),
|
|
162
|
-
table.
|
|
163
|
-
table.
|
|
163
|
+
table.atoms.columnPinning?.get(),
|
|
164
|
+
table.atoms.columnOrder?.get(),
|
|
164
165
|
],
|
|
165
166
|
},
|
|
166
167
|
table_getRightHeaderGroups: {
|
|
@@ -172,8 +173,8 @@ export function constructColumnPinningFeature<
|
|
|
172
173
|
'getVisibleLeafColumns',
|
|
173
174
|
table_getVisibleLeafColumns,
|
|
174
175
|
),
|
|
175
|
-
table.
|
|
176
|
-
table.
|
|
176
|
+
table.atoms.columnPinning?.get()?.right,
|
|
177
|
+
table.atoms.columnOrder?.get(),
|
|
177
178
|
],
|
|
178
179
|
},
|
|
179
180
|
// footer groups
|
|
@@ -274,21 +275,21 @@ export function constructColumnPinningFeature<
|
|
|
274
275
|
fn: () => table_getLeftLeafColumns(table),
|
|
275
276
|
memoDeps: () => [
|
|
276
277
|
table.options.columns,
|
|
277
|
-
table.
|
|
278
|
+
table.atoms.columnPinning?.get(),
|
|
278
279
|
],
|
|
279
280
|
},
|
|
280
281
|
table_getRightLeafColumns: {
|
|
281
282
|
fn: () => table_getRightLeafColumns(table),
|
|
282
283
|
memoDeps: () => [
|
|
283
284
|
table.options.columns,
|
|
284
|
-
table.
|
|
285
|
+
table.atoms.columnPinning?.get(),
|
|
285
286
|
],
|
|
286
287
|
},
|
|
287
288
|
table_getCenterLeafColumns: {
|
|
288
289
|
fn: () => table_getCenterLeafColumns(table),
|
|
289
290
|
memoDeps: () => [
|
|
290
291
|
table.options.columns,
|
|
291
|
-
table.
|
|
292
|
+
table.atoms.columnPinning?.get(),
|
|
292
293
|
],
|
|
293
294
|
},
|
|
294
295
|
// visible leaf columns
|
|
@@ -296,24 +297,24 @@ export function constructColumnPinningFeature<
|
|
|
296
297
|
fn: () => table_getLeftVisibleLeafColumns(table),
|
|
297
298
|
memoDeps: () => [
|
|
298
299
|
table.options.columns,
|
|
299
|
-
table.
|
|
300
|
-
table.
|
|
300
|
+
table.atoms.columnPinning?.get(),
|
|
301
|
+
table.atoms.columnVisibility?.get(),
|
|
301
302
|
],
|
|
302
303
|
},
|
|
303
304
|
table_getCenterVisibleLeafColumns: {
|
|
304
305
|
fn: () => table_getCenterVisibleLeafColumns(table),
|
|
305
306
|
memoDeps: () => [
|
|
306
307
|
table.options.columns,
|
|
307
|
-
table.
|
|
308
|
-
table.
|
|
308
|
+
table.atoms.columnPinning?.get(),
|
|
309
|
+
table.atoms.columnVisibility?.get(),
|
|
309
310
|
],
|
|
310
311
|
},
|
|
311
312
|
table_getRightVisibleLeafColumns: {
|
|
312
313
|
fn: () => table_getRightVisibleLeafColumns(table),
|
|
313
314
|
memoDeps: () => [
|
|
314
315
|
table.options.columns,
|
|
315
|
-
table.
|
|
316
|
-
table.
|
|
316
|
+
table.atoms.columnPinning?.get(),
|
|
317
|
+
table.atoms.columnVisibility?.get(),
|
|
317
318
|
],
|
|
318
319
|
},
|
|
319
320
|
})
|
|
@@ -92,7 +92,7 @@ export function column_getIsPinned<
|
|
|
92
92
|
const leafColumnIds = column.getLeafColumns().map((d) => d.id)
|
|
93
93
|
|
|
94
94
|
const { left, right } =
|
|
95
|
-
column.table.
|
|
95
|
+
column.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
96
96
|
|
|
97
97
|
const isLeft = leafColumnIds.some((d) => left.includes(d))
|
|
98
98
|
const isRight = leafColumnIds.some((d) => right.includes(d))
|
|
@@ -108,7 +108,7 @@ export function column_getPinnedIndex<
|
|
|
108
108
|
const position = column_getIsPinned(column)
|
|
109
109
|
|
|
110
110
|
return position
|
|
111
|
-
? (column.table.
|
|
111
|
+
? (column.table.atoms.columnPinning?.get()?.[position].indexOf(column.id) ??
|
|
112
112
|
-1)
|
|
113
113
|
: 0
|
|
114
114
|
}
|
|
@@ -125,7 +125,7 @@ export function row_getCenterVisibleCells<
|
|
|
125
125
|
row_getAllVisibleCells,
|
|
126
126
|
)
|
|
127
127
|
const { left, right } =
|
|
128
|
-
row.table.
|
|
128
|
+
row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
129
129
|
const leftAndRight: Array<string> = [...left, ...right]
|
|
130
130
|
return allCells.filter((d) => !leftAndRight.includes(d.column.id))
|
|
131
131
|
}
|
|
@@ -140,7 +140,7 @@ export function row_getLeftVisibleCells<
|
|
|
140
140
|
row_getAllVisibleCells,
|
|
141
141
|
)
|
|
142
142
|
const { left } =
|
|
143
|
-
row.table.
|
|
143
|
+
row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
144
144
|
const cells = left
|
|
145
145
|
.map((columnId) => allCells.find((cell) => cell.column.id === columnId)!)
|
|
146
146
|
.filter(Boolean)
|
|
@@ -161,7 +161,7 @@ export function row_getRightVisibleCells<
|
|
|
161
161
|
row_getAllVisibleCells,
|
|
162
162
|
)
|
|
163
163
|
const { right } =
|
|
164
|
-
row.table.
|
|
164
|
+
row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
165
165
|
const cells = right
|
|
166
166
|
.map((columnId) => allCells.find((cell) => cell.column.id === columnId)!)
|
|
167
167
|
.filter(Boolean)
|
|
@@ -200,7 +200,7 @@ export function table_getIsSomeColumnsPinned<
|
|
|
200
200
|
TFeatures extends TableFeatures,
|
|
201
201
|
TData extends RowData,
|
|
202
202
|
>(table: Table_Internal<TFeatures, TData>, position?: ColumnPinningPosition) {
|
|
203
|
-
const pinningState = table.
|
|
203
|
+
const pinningState = table.atoms.columnPinning?.get()
|
|
204
204
|
|
|
205
205
|
if (!position) {
|
|
206
206
|
return Boolean(pinningState?.left.length || pinningState?.right.length)
|
|
@@ -221,7 +221,7 @@ export function table_getLeftHeaderGroups<
|
|
|
221
221
|
table_getVisibleLeafColumns,
|
|
222
222
|
) as Array<Column_Internal<TFeatures, TData, unknown>>
|
|
223
223
|
const { left } =
|
|
224
|
-
table.
|
|
224
|
+
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
225
225
|
|
|
226
226
|
const orderedLeafColumns = left
|
|
227
227
|
.map((columnId) => leafColumns.find((d) => d.id === columnId)!)
|
|
@@ -241,7 +241,7 @@ export function table_getRightHeaderGroups<
|
|
|
241
241
|
table_getVisibleLeafColumns,
|
|
242
242
|
) as unknown as Array<Column_Internal<TFeatures, TData, unknown>>
|
|
243
243
|
const { right } =
|
|
244
|
-
table.
|
|
244
|
+
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
245
245
|
|
|
246
246
|
const orderedLeafColumns = right
|
|
247
247
|
.map((columnId) => leafColumns.find((d) => d.id === columnId)!)
|
|
@@ -263,7 +263,7 @@ export function table_getCenterHeaderGroups<
|
|
|
263
263
|
table_getVisibleLeafColumns,
|
|
264
264
|
) as unknown as Array<Column_Internal<TFeatures, TData, unknown>>
|
|
265
265
|
const { left, right } =
|
|
266
|
-
table.
|
|
266
|
+
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
267
267
|
const leftAndRight: Array<string> = [...left, ...right]
|
|
268
268
|
|
|
269
269
|
leafColumns = leafColumns.filter(
|
|
@@ -402,7 +402,7 @@ export function table_getLeftLeafColumns<
|
|
|
402
402
|
TData extends RowData,
|
|
403
403
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
404
404
|
const { left } =
|
|
405
|
-
table.
|
|
405
|
+
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
406
406
|
return left
|
|
407
407
|
.map(
|
|
408
408
|
(columnId) =>
|
|
@@ -416,7 +416,7 @@ export function table_getRightLeafColumns<
|
|
|
416
416
|
TData extends RowData,
|
|
417
417
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
418
418
|
const { right } =
|
|
419
|
-
table.
|
|
419
|
+
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
420
420
|
return right
|
|
421
421
|
.map(
|
|
422
422
|
(columnId) =>
|
|
@@ -430,7 +430,7 @@ export function table_getCenterLeafColumns<
|
|
|
430
430
|
TData extends RowData,
|
|
431
431
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
432
432
|
const { left, right } =
|
|
433
|
-
table.
|
|
433
|
+
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
434
434
|
const leftAndRight: Array<string> = [...left, ...right]
|
|
435
435
|
return table.getAllLeafColumns().filter((d) => !leftAndRight.includes(d.id))
|
|
436
436
|
}
|
|
@@ -39,7 +39,9 @@ export function column_getIsResizing<
|
|
|
39
39
|
TData extends RowData,
|
|
40
40
|
TValue extends CellData = CellData,
|
|
41
41
|
>(column: Column_Internal<TFeatures, TData, TValue>) {
|
|
42
|
-
return
|
|
42
|
+
return (
|
|
43
|
+
column.table.atoms.columnResizing?.get()?.isResizingColumn === column.id
|
|
44
|
+
)
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
export function header_getResizeHandler<
|
|
@@ -81,7 +81,7 @@ export function constructColumnSizingFeature<
|
|
|
81
81
|
table_getPinnedVisibleLeafColumns,
|
|
82
82
|
position,
|
|
83
83
|
),
|
|
84
|
-
column.table.
|
|
84
|
+
column.table.atoms.columnSizing?.get(),
|
|
85
85
|
],
|
|
86
86
|
},
|
|
87
87
|
column_getAfter: {
|
|
@@ -94,7 +94,7 @@ export function constructColumnSizingFeature<
|
|
|
94
94
|
table_getPinnedVisibleLeafColumns,
|
|
95
95
|
position,
|
|
96
96
|
),
|
|
97
|
-
column.table.
|
|
97
|
+
column.table.atoms.columnSizing?.get(),
|
|
98
98
|
],
|
|
99
99
|
},
|
|
100
100
|
column_resetSize: {
|
|
@@ -32,7 +32,7 @@ export function column_getSize<
|
|
|
32
32
|
TValue extends CellData = CellData,
|
|
33
33
|
>(column: Column_Internal<TFeatures, TData, TValue>): number {
|
|
34
34
|
const defaultSizes = getDefaultColumnSizingColumnDef()
|
|
35
|
-
const columnSize = column.table.
|
|
35
|
+
const columnSize = column.table.atoms.columnSizing?.get()?.[column.id]
|
|
36
36
|
|
|
37
37
|
return Math.min(
|
|
38
38
|
Math.max(
|
|
@@ -72,7 +72,7 @@ export function constructColumnVisibilityFeature<
|
|
|
72
72
|
fn: (column) => column_getIsVisible(column),
|
|
73
73
|
memoDeps: (column) => [
|
|
74
74
|
column.table.options.columns,
|
|
75
|
-
column.table.
|
|
75
|
+
column.table.atoms.columnVisibility?.get(),
|
|
76
76
|
column.columns,
|
|
77
77
|
],
|
|
78
78
|
},
|
|
@@ -94,7 +94,7 @@ export function constructColumnVisibilityFeature<
|
|
|
94
94
|
fn: (row) => row_getAllVisibleCells(row),
|
|
95
95
|
memoDeps: (row) => [
|
|
96
96
|
row.getAllCells(),
|
|
97
|
-
row.table.
|
|
97
|
+
row.table.atoms.columnVisibility?.get(),
|
|
98
98
|
],
|
|
99
99
|
},
|
|
100
100
|
row_getVisibleCells: {
|
|
@@ -114,16 +114,16 @@ export function constructColumnVisibilityFeature<
|
|
|
114
114
|
table_getVisibleFlatColumns: {
|
|
115
115
|
fn: () => table_getVisibleFlatColumns(table),
|
|
116
116
|
memoDeps: () => [
|
|
117
|
-
table.
|
|
118
|
-
table.
|
|
117
|
+
table.atoms.columnVisibility?.get(),
|
|
118
|
+
table.atoms.columnOrder?.get(),
|
|
119
119
|
table.options.columns,
|
|
120
120
|
],
|
|
121
121
|
},
|
|
122
122
|
table_getVisibleLeafColumns: {
|
|
123
123
|
fn: () => table_getVisibleLeafColumns(table),
|
|
124
124
|
memoDeps: () => [
|
|
125
|
-
table.
|
|
126
|
-
table.
|
|
125
|
+
table.atoms.columnVisibility?.get(),
|
|
126
|
+
table.atoms.columnOrder?.get(),
|
|
127
127
|
table.options.columns,
|
|
128
128
|
],
|
|
129
129
|
},
|
|
@@ -37,7 +37,7 @@ export function column_getIsVisible<
|
|
|
37
37
|
? childColumns.some((childColumn) =>
|
|
38
38
|
callMemoOrStaticFn(childColumn, 'getIsVisible', column_getIsVisible),
|
|
39
39
|
)
|
|
40
|
-
: column.table.
|
|
40
|
+
: column.table.atoms.columnVisibility?.get()?.[column.id]) ?? true
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -17,7 +17,7 @@ export function createExpandedRowModel<
|
|
|
17
17
|
table,
|
|
18
18
|
fnName: 'table.getExpandedRowModel',
|
|
19
19
|
memoDeps: () => [
|
|
20
|
-
table.
|
|
20
|
+
table.atoms.expanded?.get(),
|
|
21
21
|
table.getPreExpandedRowModel(),
|
|
22
22
|
table.options.paginateExpandedRows,
|
|
23
23
|
],
|
|
@@ -31,7 +31,7 @@ function _createExpandedRowModel<
|
|
|
31
31
|
TData extends RowData = any,
|
|
32
32
|
>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {
|
|
33
33
|
const rowModel = table.getPreExpandedRowModel()
|
|
34
|
-
const expanded = table.
|
|
34
|
+
const expanded = table.atoms.expanded?.get()
|
|
35
35
|
|
|
36
36
|
if (
|
|
37
37
|
!rowModel.rows.length ||
|
|
@@ -75,7 +75,7 @@ export function table_getIsSomeRowsExpanded<
|
|
|
75
75
|
TFeatures extends TableFeatures,
|
|
76
76
|
TData extends RowData,
|
|
77
77
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
78
|
-
const expanded = table.
|
|
78
|
+
const expanded = table.atoms.expanded?.get() ?? {}
|
|
79
79
|
return expanded === true || Object.values(expanded).some(Boolean)
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -83,7 +83,7 @@ export function table_getIsAllRowsExpanded<
|
|
|
83
83
|
TFeatures extends TableFeatures,
|
|
84
84
|
TData extends RowData,
|
|
85
85
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
86
|
-
const expanded = table.
|
|
86
|
+
const expanded = table.atoms.expanded?.get() ?? {}
|
|
87
87
|
|
|
88
88
|
// If expanded is true, save some cycles and return true
|
|
89
89
|
if (expanded === true) {
|
|
@@ -110,9 +110,9 @@ export function table_getExpandedDepth<
|
|
|
110
110
|
let maxDepth = 0
|
|
111
111
|
|
|
112
112
|
const rowIds =
|
|
113
|
-
table.
|
|
113
|
+
table.atoms.expanded?.get() === true
|
|
114
114
|
? Object.keys(table.getRowModel().rowsById)
|
|
115
|
-
: Object.keys(table.
|
|
115
|
+
: Object.keys(table.atoms.expanded?.get() ?? {})
|
|
116
116
|
|
|
117
117
|
rowIds.forEach((id) => {
|
|
118
118
|
const splitId = id.split('.')
|
|
@@ -161,7 +161,7 @@ export function row_getIsExpanded<
|
|
|
161
161
|
TFeatures extends TableFeatures,
|
|
162
162
|
TData extends RowData,
|
|
163
163
|
>(row: Row<TFeatures, TData>) {
|
|
164
|
-
const expanded = row.table.
|
|
164
|
+
const expanded = row.table.atoms.expanded?.get() ?? ({} as ExpandedState)
|
|
165
165
|
|
|
166
166
|
return !!(
|
|
167
167
|
row.table.options.getIsRowExpanded?.(row) ??
|
|
@@ -19,9 +19,9 @@ export function createPaginatedRowModel<
|
|
|
19
19
|
fnName: 'table.getPaginatedRowModel',
|
|
20
20
|
memoDeps: () => [
|
|
21
21
|
table.getPrePaginatedRowModel(),
|
|
22
|
-
table.
|
|
22
|
+
table.atoms.pagination?.get(),
|
|
23
23
|
table.options.paginateExpandedRows
|
|
24
|
-
? table.
|
|
24
|
+
? table.atoms.expanded?.get()
|
|
25
25
|
: undefined,
|
|
26
26
|
],
|
|
27
27
|
fn: () => _createPaginatedRowModel(table),
|
|
@@ -34,7 +34,7 @@ function _createPaginatedRowModel<
|
|
|
34
34
|
TData extends RowData = any,
|
|
35
35
|
>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {
|
|
36
36
|
const prePaginatedRowModel = table.getPrePaginatedRowModel()
|
|
37
|
-
const pagination = table.
|
|
37
|
+
const pagination = table.atoms.pagination?.get()
|
|
38
38
|
|
|
39
39
|
if (!prePaginatedRowModel.rows.length) {
|
|
40
40
|
return prePaginatedRowModel
|
|
@@ -131,14 +131,14 @@ export function table_getCanPreviousPage<
|
|
|
131
131
|
TFeatures extends TableFeatures,
|
|
132
132
|
TData extends RowData,
|
|
133
133
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
134
|
-
return (table.
|
|
134
|
+
return (table.atoms.pagination?.get()?.pageIndex ?? 0) > 0
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
export function table_getCanNextPage<
|
|
138
138
|
TFeatures extends TableFeatures,
|
|
139
139
|
TData extends RowData,
|
|
140
140
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
141
|
-
const pageIndex = table.
|
|
141
|
+
const pageIndex = table.atoms.pagination?.get()?.pageIndex ?? defaultPageIndex
|
|
142
142
|
|
|
143
143
|
const pageCount = table_getPageCount(table)
|
|
144
144
|
|
|
@@ -191,7 +191,7 @@ export function table_getPageCount<
|
|
|
191
191
|
table.options.pageCount ??
|
|
192
192
|
Math.ceil(
|
|
193
193
|
table_getRowCount(table) /
|
|
194
|
-
(table.
|
|
194
|
+
(table.atoms.pagination?.get()?.pageSize ?? defaultPageSize),
|
|
195
195
|
)
|
|
196
196
|
)
|
|
197
197
|
}
|
|
@@ -68,7 +68,7 @@ export function constructRowPinningFeature<
|
|
|
68
68
|
fn: (row) => row_getPinnedIndex(row),
|
|
69
69
|
memoDeps: (row) => [
|
|
70
70
|
row.table.getRowModel().rows,
|
|
71
|
-
row.table.
|
|
71
|
+
row.table.atoms.rowPinning?.get(),
|
|
72
72
|
],
|
|
73
73
|
},
|
|
74
74
|
row_pin: {
|
|
@@ -93,21 +93,21 @@ export function constructRowPinningFeature<
|
|
|
93
93
|
fn: () => table_getTopRows(table),
|
|
94
94
|
memoDeps: () => [
|
|
95
95
|
table.getRowModel().rows,
|
|
96
|
-
table.
|
|
96
|
+
table.atoms.rowPinning?.get()?.top,
|
|
97
97
|
],
|
|
98
98
|
},
|
|
99
99
|
table_getBottomRows: {
|
|
100
100
|
fn: () => table_getBottomRows(table),
|
|
101
101
|
memoDeps: () => [
|
|
102
102
|
table.getRowModel().rows,
|
|
103
|
-
table.
|
|
103
|
+
table.atoms.rowPinning?.get()?.bottom,
|
|
104
104
|
],
|
|
105
105
|
},
|
|
106
106
|
table_getCenterRows: {
|
|
107
107
|
fn: () => table_getCenterRows(table),
|
|
108
108
|
memoDeps: () => [
|
|
109
109
|
table.getRowModel().rows,
|
|
110
|
-
table.
|
|
110
|
+
table.atoms.rowPinning?.get(),
|
|
111
111
|
],
|
|
112
112
|
},
|
|
113
113
|
})
|
|
@@ -49,7 +49,7 @@ export function table_getIsSomeRowsPinned<
|
|
|
49
49
|
table: Table_Internal<TFeatures, TData>,
|
|
50
50
|
position?: RowPinningPosition,
|
|
51
51
|
): boolean {
|
|
52
|
-
const rowPinning = table.
|
|
52
|
+
const rowPinning = table.atoms.rowPinning?.get()
|
|
53
53
|
|
|
54
54
|
if (!position) {
|
|
55
55
|
return Boolean(rowPinning?.top.length || rowPinning?.bottom.length)
|
|
@@ -65,7 +65,7 @@ function table_getPinnedRows<
|
|
|
65
65
|
position: 'top' | 'bottom',
|
|
66
66
|
): Array<Row<TFeatures, TData>> {
|
|
67
67
|
const visibleRows = table.getRowModel().rows
|
|
68
|
-
const pinnedRowIds = table.
|
|
68
|
+
const pinnedRowIds = table.atoms.rowPinning?.get()?.[position] ?? []
|
|
69
69
|
|
|
70
70
|
const rows =
|
|
71
71
|
(table.options.keepPinnedRows ?? true)
|
|
@@ -107,7 +107,7 @@ export function table_getCenterRows<
|
|
|
107
107
|
TData extends RowData,
|
|
108
108
|
>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>> {
|
|
109
109
|
const { top, bottom } =
|
|
110
|
-
table.
|
|
110
|
+
table.atoms.rowPinning?.get() ?? getDefaultRowPinningState()
|
|
111
111
|
const allRows = table.getRowModel().rows
|
|
112
112
|
|
|
113
113
|
const topAndBottom = new Set([...top, ...bottom])
|
|
@@ -132,7 +132,7 @@ export function row_getIsPinned<
|
|
|
132
132
|
TData extends RowData,
|
|
133
133
|
>(row: Row<TFeatures, TData>): RowPinningPosition {
|
|
134
134
|
const { top, bottom } =
|
|
135
|
-
row.table.
|
|
135
|
+
row.table.atoms.rowPinning?.get() ?? getDefaultRowPinningState()
|
|
136
136
|
|
|
137
137
|
return top.includes(row.id)
|
|
138
138
|
? 'top'
|
|
@@ -117,21 +117,21 @@ export function constructRowSelectionFeature<
|
|
|
117
117
|
table_getSelectedRowModel: {
|
|
118
118
|
fn: () => table_getSelectedRowModel(table),
|
|
119
119
|
memoDeps: () => [
|
|
120
|
-
table.
|
|
120
|
+
table.atoms.rowSelection?.get(),
|
|
121
121
|
table.getCoreRowModel(),
|
|
122
122
|
],
|
|
123
123
|
},
|
|
124
124
|
table_getFilteredSelectedRowModel: {
|
|
125
125
|
fn: () => table_getFilteredSelectedRowModel(table),
|
|
126
126
|
memoDeps: () => [
|
|
127
|
-
table.
|
|
127
|
+
table.atoms.rowSelection?.get(),
|
|
128
128
|
table.getFilteredRowModel(),
|
|
129
129
|
],
|
|
130
130
|
},
|
|
131
131
|
table_getGroupedSelectedRowModel: {
|
|
132
132
|
fn: () => table_getGroupedSelectedRowModel(table),
|
|
133
133
|
memoDeps: () => [
|
|
134
|
-
table.
|
|
134
|
+
table.atoms.rowSelection?.get(),
|
|
135
135
|
table.getSortedRowModel(),
|
|
136
136
|
],
|
|
137
137
|
},
|
|
@@ -3,7 +3,7 @@ import type { TableFeatures } from '../../types/TableFeatures'
|
|
|
3
3
|
import type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'
|
|
4
4
|
import type { Row } from '../../types/Row'
|
|
5
5
|
|
|
6
|
-
export type RowSelectionState = Record<string, boolean>
|
|
6
|
+
export type RowSelectionState = Record<string, boolean | undefined>
|
|
7
7
|
|
|
8
8
|
export interface TableState_RowSelection {
|
|
9
9
|
rowSelection: RowSelectionState
|
|
@@ -97,7 +97,7 @@ export function table_getSelectedRowModel<
|
|
|
97
97
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
98
98
|
const rowModel = table.getCoreRowModel()
|
|
99
99
|
|
|
100
|
-
if (!Object.keys(table.
|
|
100
|
+
if (!Object.keys(table.atoms.rowSelection?.get() ?? {}).length) {
|
|
101
101
|
return {
|
|
102
102
|
rows: [],
|
|
103
103
|
flatRows: [],
|
|
@@ -114,7 +114,7 @@ export function table_getFilteredSelectedRowModel<
|
|
|
114
114
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
115
115
|
const rowModel = table.getCoreRowModel()
|
|
116
116
|
|
|
117
|
-
if (!Object.keys(table.
|
|
117
|
+
if (!Object.keys(table.atoms.rowSelection?.get() ?? {}).length) {
|
|
118
118
|
return {
|
|
119
119
|
rows: [],
|
|
120
120
|
flatRows: [],
|
|
@@ -131,7 +131,7 @@ export function table_getGroupedSelectedRowModel<
|
|
|
131
131
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
132
132
|
const rowModel = table.getCoreRowModel()
|
|
133
133
|
|
|
134
|
-
if (!Object.keys(table.
|
|
134
|
+
if (!Object.keys(table.atoms.rowSelection?.get() ?? {}).length) {
|
|
135
135
|
return {
|
|
136
136
|
rows: [],
|
|
137
137
|
flatRows: [],
|
|
@@ -148,7 +148,7 @@ export function table_getIsAllRowsSelected<
|
|
|
148
148
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
149
149
|
const preGroupedFlatRows = table.getFilteredRowModel().flatRows
|
|
150
150
|
const rowSelection =
|
|
151
|
-
table.
|
|
151
|
+
table.atoms.rowSelection?.get() ?? ({} as RowSelectionState)
|
|
152
152
|
|
|
153
153
|
let isAllRowsSelected = Boolean(
|
|
154
154
|
preGroupedFlatRows.length && Object.keys(rowSelection).length,
|
|
@@ -175,7 +175,7 @@ export function table_getIsAllPageRowsSelected<
|
|
|
175
175
|
.getPaginatedRowModel()
|
|
176
176
|
.flatRows.filter((row) => row_getCanSelect(row))
|
|
177
177
|
const rowSelection =
|
|
178
|
-
table.
|
|
178
|
+
table.atoms.rowSelection?.get() ?? ({} as RowSelectionState)
|
|
179
179
|
|
|
180
180
|
let isAllPageRowsSelected = !!paginationFlatRows.length
|
|
181
181
|
|
|
@@ -193,7 +193,9 @@ export function table_getIsSomeRowsSelected<
|
|
|
193
193
|
TFeatures extends TableFeatures,
|
|
194
194
|
TData extends RowData,
|
|
195
195
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
196
|
-
const totalSelected = Object.keys(
|
|
196
|
+
const totalSelected = Object.keys(
|
|
197
|
+
table.atoms.rowSelection?.get() ?? {},
|
|
198
|
+
).length
|
|
197
199
|
return (
|
|
198
200
|
totalSelected > 0 &&
|
|
199
201
|
totalSelected < table.getFilteredRowModel().flatRows.length
|
|
@@ -347,7 +349,7 @@ const mutateRowIsSelected = <
|
|
|
347
349
|
TFeatures extends TableFeatures,
|
|
348
350
|
TData extends RowData,
|
|
349
351
|
>(
|
|
350
|
-
selectedRowIds: Record<string, boolean>,
|
|
352
|
+
selectedRowIds: Record<string, boolean | undefined>,
|
|
351
353
|
rowId: string,
|
|
352
354
|
value: boolean,
|
|
353
355
|
includeChildren: boolean,
|
|
@@ -419,7 +421,7 @@ export function isRowSelected<
|
|
|
419
421
|
TFeatures extends TableFeatures,
|
|
420
422
|
TData extends RowData,
|
|
421
423
|
>(row: Row<TFeatures, TData>): boolean {
|
|
422
|
-
return (row.table.
|
|
424
|
+
return (row.table.atoms.rowSelection?.get() ?? {})[row.id] ?? false
|
|
423
425
|
}
|
|
424
426
|
|
|
425
427
|
export function isSubRowSelected<
|
|
@@ -22,7 +22,10 @@ export function createSortedRowModel<
|
|
|
22
22
|
feature: 'rowSortingFeature',
|
|
23
23
|
table,
|
|
24
24
|
fnName: 'table.getSortedRowModel',
|
|
25
|
-
memoDeps: () => [
|
|
25
|
+
memoDeps: () => [
|
|
26
|
+
table.atoms.sorting?.get(),
|
|
27
|
+
table.getPreSortedRowModel(),
|
|
28
|
+
],
|
|
26
29
|
fn: () => _createSortedRowModel(table),
|
|
27
30
|
onAfterUpdate: () => table_autoResetPageIndex(table),
|
|
28
31
|
})
|
|
@@ -34,7 +37,7 @@ function _createSortedRowModel<
|
|
|
34
37
|
TData extends RowData = any,
|
|
35
38
|
>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {
|
|
36
39
|
const preSortedRowModel = table.getPreSortedRowModel()
|
|
37
|
-
const sorting = table.
|
|
40
|
+
const sorting = table.atoms.sorting?.get()
|
|
38
41
|
|
|
39
42
|
if (!preSortedRowModel.rows.length || !sorting?.length) {
|
|
40
43
|
return preSortedRowModel
|
|
@@ -271,9 +271,9 @@ export function column_getIsSorted<
|
|
|
271
271
|
TData extends RowData,
|
|
272
272
|
TValue extends CellData = CellData,
|
|
273
273
|
>(column: Column_Internal<TFeatures, TData, TValue>): false | SortDirection {
|
|
274
|
-
const columnSort = column.table.
|
|
275
|
-
(
|
|
276
|
-
|
|
274
|
+
const columnSort = column.table.atoms.sorting
|
|
275
|
+
?.get()
|
|
276
|
+
?.find((d) => d.id === column.id)
|
|
277
277
|
return !columnSort ? false : columnSort.desc ? 'desc' : 'asc'
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -283,7 +283,8 @@ export function column_getSortIndex<
|
|
|
283
283
|
TValue extends CellData = CellData,
|
|
284
284
|
>(column: Column_Internal<TFeatures, TData, TValue>): number {
|
|
285
285
|
return (
|
|
286
|
-
column.table.
|
|
286
|
+
column.table.atoms.sorting?.get()?.findIndex((d) => d.id === column.id) ??
|
|
287
|
+
-1
|
|
287
288
|
)
|
|
288
289
|
}
|
|
289
290
|
|