@tanstack/table-core 9.0.0-beta.36 → 9.0.0-beta.38
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/headers/buildHeaderGroups.cjs.map +1 -1
- package/dist/core/headers/buildHeaderGroups.d.cts +1 -1
- package/dist/core/headers/buildHeaderGroups.d.ts +1 -1
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.cjs +7 -7
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.js +7 -7
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +2 -2
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +2 -2
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +6 -6
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +6 -6
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +6 -6
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +3 -3
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +3 -3
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +6 -6
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.cjs +44 -39
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.d.cts +6 -1
- package/dist/features/column-pinning/columnPinningFeature.d.ts +6 -1
- package/dist/features/column-pinning/columnPinningFeature.js +45 -40
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +49 -38
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +49 -38
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +154 -146
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +81 -73
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +81 -73
- package/dist/features/column-pinning/columnPinningFeature.utils.js +141 -133
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +4 -4
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.js +5 -5
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +18 -12
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +18 -12
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +24 -20
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +18 -14
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +18 -14
- package/dist/features/column-sizing/columnSizingFeature.utils.js +24 -20
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +16 -16
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +16 -16
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +1 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +1 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +1 -1
- package/dist/static-functions.cjs +16 -16
- package/dist/static-functions.d.cts +3 -3
- package/dist/static-functions.d.ts +3 -3
- package/dist/static-functions.js +3 -3
- package/dist/utils.cjs +3 -15
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +3 -15
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/core/headers/buildHeaderGroups.ts +1 -1
- package/src/core/headers/coreHeadersFeature.utils.ts +7 -8
- package/src/core/row-models/coreRowModelsFeature.types.ts +0 -1
- package/src/core/table/coreTablesFeature.types.ts +1 -0
- package/src/features/column-faceting/columnFacetingFeature.types.ts +0 -1
- package/src/features/column-filtering/columnFilteringFeature.types.ts +3 -3
- package/src/features/column-grouping/columnGroupingFeature.types.ts +2 -2
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +2 -0
- package/src/features/column-ordering/columnOrderingFeature.types.ts +7 -7
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +9 -9
- package/src/features/column-pinning/columnPinningFeature.ts +64 -59
- package/src/features/column-pinning/columnPinningFeature.types.ts +49 -38
- package/src/features/column-pinning/columnPinningFeature.utils.ts +163 -155
- package/src/features/column-sizing/columnSizingFeature.ts +6 -6
- package/src/features/column-sizing/columnSizingFeature.types.ts +18 -12
- package/src/features/column-sizing/columnSizingFeature.utils.ts +31 -27
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +15 -15
- package/src/features/row-expanding/rowExpandingFeature.types.ts +2 -3
- package/src/features/row-pagination/rowPaginationFeature.types.ts +2 -3
- package/src/features/row-sorting/rowSortingFeature.types.ts +2 -2
- package/src/types/ColumnDef.ts +1 -0
- package/src/utils.ts +3 -4
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
header_getStart,
|
|
15
15
|
table_getCenterTotalSize,
|
|
16
16
|
table_getColumnOffsets,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
table_getEndTotalSize,
|
|
18
|
+
table_getStartTotalSize,
|
|
19
19
|
table_getTotalSize,
|
|
20
20
|
table_resetColumnSizing,
|
|
21
21
|
table_setColumnSizing,
|
|
@@ -119,8 +119,8 @@ export const columnSizingFeature: TableFeature = {
|
|
|
119
119
|
table.getHeaderGroups(),
|
|
120
120
|
],
|
|
121
121
|
},
|
|
122
|
-
|
|
123
|
-
fn: () =>
|
|
122
|
+
table_getStartTotalSize: {
|
|
123
|
+
fn: () => table_getStartTotalSize(table),
|
|
124
124
|
memoDeps: () => [
|
|
125
125
|
table.atoms.columnSizing?.get(),
|
|
126
126
|
table.getHeaderGroups(),
|
|
@@ -133,8 +133,8 @@ export const columnSizingFeature: TableFeature = {
|
|
|
133
133
|
table.getHeaderGroups(),
|
|
134
134
|
],
|
|
135
135
|
},
|
|
136
|
-
|
|
137
|
-
fn: () =>
|
|
136
|
+
table_getEndTotalSize: {
|
|
137
|
+
fn: () => table_getEndTotalSize(table),
|
|
138
138
|
memoDeps: () => [
|
|
139
139
|
table.atoms.columnSizing?.get(),
|
|
140
140
|
table.getHeaderGroups(),
|
|
@@ -30,13 +30,19 @@ export interface ColumnOffsetsByPosition {
|
|
|
30
30
|
*/
|
|
31
31
|
center: ColumnOffsets
|
|
32
32
|
/**
|
|
33
|
-
* Offsets within the
|
|
33
|
+
* Offsets within the logical start pinned region.
|
|
34
|
+
*
|
|
35
|
+
* In LTR languages/layouts, start usually corresponds to left. In RTL
|
|
36
|
+
* languages/layouts, start usually corresponds to right.
|
|
34
37
|
*/
|
|
35
|
-
|
|
38
|
+
start: ColumnOffsets
|
|
36
39
|
/**
|
|
37
|
-
* Offsets within the
|
|
40
|
+
* Offsets within the logical end pinned region.
|
|
41
|
+
*
|
|
42
|
+
* In LTR languages/layouts, end usually corresponds to right. In RTL
|
|
43
|
+
* languages/layouts, end usually corresponds to left.
|
|
38
44
|
*/
|
|
39
|
-
|
|
45
|
+
end: ColumnOffsets
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
export interface TableOptions_ColumnSizing {
|
|
@@ -66,13 +72,13 @@ export interface Table_ColumnSizing {
|
|
|
66
72
|
*/
|
|
67
73
|
getColumnOffsets: () => ColumnOffsetsByPosition
|
|
68
74
|
/**
|
|
69
|
-
* Sums the current sizes of visible
|
|
75
|
+
* Sums the current sizes of visible logical start-pinned leaf columns.
|
|
70
76
|
*/
|
|
71
|
-
|
|
77
|
+
getStartTotalSize: () => number
|
|
72
78
|
/**
|
|
73
|
-
* Sums the current sizes of visible
|
|
79
|
+
* Sums the current sizes of visible logical end-pinned leaf columns.
|
|
74
80
|
*/
|
|
75
|
-
|
|
81
|
+
getEndTotalSize: () => number
|
|
76
82
|
/**
|
|
77
83
|
* Sums the current sizes of all visible leaf columns.
|
|
78
84
|
*/
|
|
@@ -107,8 +113,8 @@ export interface Column_ColumnSizing {
|
|
|
107
113
|
/**
|
|
108
114
|
* Measures the offset from this column's end edge to the end of its region.
|
|
109
115
|
*
|
|
110
|
-
* Pass a pinned region to measure within that region. The value is
|
|
111
|
-
* of visible leaf column sizes after this column.
|
|
116
|
+
* Pass a pinned region to measure within that logical region. The value is
|
|
117
|
+
* the sum of visible leaf column sizes after this column.
|
|
112
118
|
*/
|
|
113
119
|
getAfter: (position?: ColumnPinningPosition | 'center') => number
|
|
114
120
|
/**
|
|
@@ -119,8 +125,8 @@ export interface Column_ColumnSizing {
|
|
|
119
125
|
* Measures the offset from the start of this column's region to its start
|
|
120
126
|
* edge.
|
|
121
127
|
*
|
|
122
|
-
* Pass a pinned region to measure within that region. The value is
|
|
123
|
-
* of visible leaf column sizes before this column.
|
|
128
|
+
* Pass a pinned region to measure within that logical region. The value is
|
|
129
|
+
* the sum of visible leaf column sizes before this column.
|
|
124
130
|
*/
|
|
125
131
|
getStart: (position?: ColumnPinningPosition | 'center') => number
|
|
126
132
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
table_getCenterHeaderGroups,
|
|
3
|
-
|
|
3
|
+
table_getEndHeaderGroups,
|
|
4
4
|
table_getPinnedVisibleLeafColumns,
|
|
5
|
-
|
|
5
|
+
table_getStartHeaderGroups,
|
|
6
6
|
} from '../column-pinning/columnPinningFeature.utils'
|
|
7
7
|
import {
|
|
8
8
|
callMemoOrStaticFn,
|
|
@@ -125,7 +125,7 @@ function buildColumnOffsets<
|
|
|
125
125
|
* @example
|
|
126
126
|
* ```ts
|
|
127
127
|
* const offsets = table_getColumnOffsets(table)
|
|
128
|
-
* const
|
|
128
|
+
* const startOffset = offsets.start.starts[column.id]
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
131
|
export function table_getColumnOffsets<
|
|
@@ -143,13 +143,13 @@ export function table_getColumnOffsets<
|
|
|
143
143
|
Column_Internal<TFeatures, TData, unknown>
|
|
144
144
|
>,
|
|
145
145
|
),
|
|
146
|
-
|
|
147
|
-
table_getPinnedVisibleLeafColumns(table, '
|
|
146
|
+
start: buildColumnOffsets(
|
|
147
|
+
table_getPinnedVisibleLeafColumns(table, 'start') as Array<
|
|
148
148
|
Column_Internal<TFeatures, TData, unknown>
|
|
149
149
|
>,
|
|
150
150
|
),
|
|
151
|
-
|
|
152
|
-
table_getPinnedVisibleLeafColumns(table, '
|
|
151
|
+
end: buildColumnOffsets(
|
|
152
|
+
table_getPinnedVisibleLeafColumns(table, 'end') as Array<
|
|
153
153
|
Column_Internal<TFeatures, TData, unknown>
|
|
154
154
|
>,
|
|
155
155
|
),
|
|
@@ -159,10 +159,10 @@ export function table_getColumnOffsets<
|
|
|
159
159
|
function toOffsetsKey(
|
|
160
160
|
position: ColumnPinningPosition | 'center' | undefined,
|
|
161
161
|
): keyof ColumnOffsetsByPosition {
|
|
162
|
-
return position === '
|
|
163
|
-
? '
|
|
164
|
-
: position === '
|
|
165
|
-
? '
|
|
162
|
+
return position === 'start'
|
|
163
|
+
? 'start'
|
|
164
|
+
: position === 'end'
|
|
165
|
+
? 'end'
|
|
166
166
|
: position === 'center'
|
|
167
167
|
? 'center'
|
|
168
168
|
: 'all' // undefined | false use the full visible list
|
|
@@ -172,11 +172,15 @@ function toOffsetsKey(
|
|
|
172
172
|
* Computes the offset from the start edge of a pinning region to this column.
|
|
173
173
|
*
|
|
174
174
|
* The value is the sum of all previous visible leaf column sizes in the
|
|
175
|
-
* requested `'
|
|
175
|
+
* requested `'start'`, `'center'`, or `'end'` region.
|
|
176
|
+
*
|
|
177
|
+
* `start` and `end` are logical positions. In LTR languages/layouts, `start`
|
|
178
|
+
* usually corresponds to left and `end` to right. In RTL languages/layouts,
|
|
179
|
+
* `start` usually corresponds to right and `end` to left.
|
|
176
180
|
*
|
|
177
181
|
* @example
|
|
178
182
|
* ```ts
|
|
179
|
-
* const
|
|
183
|
+
* const startOffset = column_getStart(column, 'start')
|
|
180
184
|
* ```
|
|
181
185
|
*/
|
|
182
186
|
export function column_getStart<
|
|
@@ -203,7 +207,7 @@ export function column_getStart<
|
|
|
203
207
|
*
|
|
204
208
|
* @example
|
|
205
209
|
* ```ts
|
|
206
|
-
* const
|
|
210
|
+
* const endOffset = column_getAfter(column, 'end')
|
|
207
211
|
* ```
|
|
208
212
|
*/
|
|
209
213
|
export function column_getAfter<
|
|
@@ -364,7 +368,7 @@ export function table_resetColumnSizing<
|
|
|
364
368
|
/**
|
|
365
369
|
* Sums the rendered size of the full table header row.
|
|
366
370
|
*
|
|
367
|
-
* This includes
|
|
371
|
+
* This includes start, center, and end columns in the main header group.
|
|
368
372
|
*
|
|
369
373
|
* @example
|
|
370
374
|
* ```ts
|
|
@@ -383,24 +387,24 @@ export function table_getTotalSize<
|
|
|
383
387
|
}
|
|
384
388
|
|
|
385
389
|
/**
|
|
386
|
-
* Sums the rendered size of the
|
|
390
|
+
* Sums the rendered size of the logical start pinned header region.
|
|
387
391
|
*
|
|
388
|
-
* An empty
|
|
392
|
+
* An empty start pinning region returns `0`.
|
|
389
393
|
*
|
|
390
394
|
* @example
|
|
391
395
|
* ```ts
|
|
392
|
-
* const width =
|
|
396
|
+
* const width = table_getStartTotalSize(table)
|
|
393
397
|
* ```
|
|
394
398
|
*/
|
|
395
|
-
export function
|
|
399
|
+
export function table_getStartTotalSize<
|
|
396
400
|
TFeatures extends TableFeatures,
|
|
397
401
|
TData extends RowData,
|
|
398
402
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
399
403
|
return (
|
|
400
404
|
callMemoOrStaticFn(
|
|
401
405
|
table,
|
|
402
|
-
'
|
|
403
|
-
|
|
406
|
+
'getStartHeaderGroups',
|
|
407
|
+
table_getStartHeaderGroups,
|
|
404
408
|
)[0]?.headers.reduce((sum: number, header: Header<TFeatures, TData>) => {
|
|
405
409
|
return sum + header_getSize(header)
|
|
406
410
|
}, 0) ?? 0
|
|
@@ -433,24 +437,24 @@ export function table_getCenterTotalSize<
|
|
|
433
437
|
}
|
|
434
438
|
|
|
435
439
|
/**
|
|
436
|
-
* Sums the rendered size of the
|
|
440
|
+
* Sums the rendered size of the logical end pinned header region.
|
|
437
441
|
*
|
|
438
|
-
* An empty
|
|
442
|
+
* An empty end pinning region returns `0`.
|
|
439
443
|
*
|
|
440
444
|
* @example
|
|
441
445
|
* ```ts
|
|
442
|
-
* const width =
|
|
446
|
+
* const width = table_getEndTotalSize(table)
|
|
443
447
|
* ```
|
|
444
448
|
*/
|
|
445
|
-
export function
|
|
449
|
+
export function table_getEndTotalSize<
|
|
446
450
|
TFeatures extends TableFeatures,
|
|
447
451
|
TData extends RowData,
|
|
448
452
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
449
453
|
return (
|
|
450
454
|
callMemoOrStaticFn(
|
|
451
455
|
table,
|
|
452
|
-
'
|
|
453
|
-
|
|
456
|
+
'getEndHeaderGroups',
|
|
457
|
+
table_getEndHeaderGroups,
|
|
454
458
|
)[0]?.headers.reduce((sum: number, header: Header<TFeatures, TData>) => {
|
|
455
459
|
return sum + header_getSize(header)
|
|
456
460
|
}, 0) ?? 0
|
|
@@ -32,7 +32,7 @@ export function getDefaultColumnVisibilityState(): ColumnVisibilityState {
|
|
|
32
32
|
* Updates this column's visibility when hiding is allowed.
|
|
33
33
|
*
|
|
34
34
|
* Passing `visible` stores that value. Omitting it flips the column's current
|
|
35
|
-
* visibility state. Columns that cannot hide are
|
|
35
|
+
* visibility state. Columns that cannot hide are start unchanged.
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* ```ts
|
|
@@ -137,8 +137,8 @@ export function column_getToggleVisibilityHandler<
|
|
|
137
137
|
/**
|
|
138
138
|
* Collects the cells from this row whose columns are visible.
|
|
139
139
|
*
|
|
140
|
-
* When column pinning is active, the result is ordered as
|
|
141
|
-
* center cells, then
|
|
140
|
+
* When column pinning is active, the result is ordered as start-pinned cells,
|
|
141
|
+
* center cells, then end-pinned cells.
|
|
142
142
|
*
|
|
143
143
|
* @example
|
|
144
144
|
* ```ts
|
|
@@ -158,9 +158,9 @@ export function row_getVisibleCells<
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
const {
|
|
161
|
+
const { start, end } =
|
|
162
162
|
row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
163
|
-
if (!
|
|
163
|
+
if (!start.length && !end.length) return visibleCells // no pinning, return early
|
|
164
164
|
|
|
165
165
|
const visibleCellsByColumnId = callMemoOrStaticFn(
|
|
166
166
|
row,
|
|
@@ -168,16 +168,16 @@ export function row_getVisibleCells<
|
|
|
168
168
|
row_getVisibleCellsByColumnId,
|
|
169
169
|
)
|
|
170
170
|
|
|
171
|
-
const
|
|
172
|
-
for (let i = 0; i <
|
|
173
|
-
const cell = visibleCellsByColumnId[
|
|
174
|
-
if (cell)
|
|
171
|
+
const startCells: Array<Cell<TFeatures, TData, unknown>> = []
|
|
172
|
+
for (let i = 0; i < start.length; i++) {
|
|
173
|
+
const cell = visibleCellsByColumnId[start[i]!]
|
|
174
|
+
if (cell) startCells.push(cell)
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
const
|
|
178
|
-
for (let i = 0; i <
|
|
179
|
-
const cell = visibleCellsByColumnId[
|
|
180
|
-
if (cell)
|
|
177
|
+
const endCells: Array<Cell<TFeatures, TData, unknown>> = []
|
|
178
|
+
for (let i = 0; i < end.length; i++) {
|
|
179
|
+
const cell = visibleCellsByColumnId[end[i]!]
|
|
180
|
+
if (cell) endCells.push(cell)
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
// Center cells: visible cells in natural column order, minus pinned ones.
|
|
@@ -185,10 +185,10 @@ export function row_getVisibleCells<
|
|
|
185
185
|
for (let i = 0; i < visibleCells.length; i++) {
|
|
186
186
|
const cell = visibleCells[i]!
|
|
187
187
|
const id = cell.column.id
|
|
188
|
-
if (!
|
|
188
|
+
if (!start.includes(id) && !end.includes(id)) centerCells.push(cell)
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
return [...
|
|
191
|
+
return [...startCells, ...centerCells, ...endCells]
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Table } from '../../types/Table'
|
|
2
1
|
import type { OnChangeFn, RowData, Updater } from '../../types/type-utils'
|
|
3
2
|
import type { TableFeatures } from '../../types/TableFeatures'
|
|
4
3
|
import type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'
|
|
@@ -71,8 +70,8 @@ export interface TableOptions_RowExpanding<
|
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
export interface Table_RowExpanding<
|
|
74
|
-
in out
|
|
75
|
-
in out
|
|
73
|
+
in out _TFeatures extends TableFeatures,
|
|
74
|
+
in out _TData extends RowData,
|
|
76
75
|
> {
|
|
77
76
|
autoResetExpanded: () => void
|
|
78
77
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'
|
|
2
|
-
import type { Table } from '../../types/Table'
|
|
3
2
|
import type { OnChangeFn, RowData, Updater } from '../../types/type-utils'
|
|
4
3
|
import type { TableFeatures } from '../../types/TableFeatures'
|
|
5
4
|
|
|
@@ -42,8 +41,8 @@ export interface PaginationDefaultOptions {
|
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
export interface Table_RowPagination<
|
|
45
|
-
in out
|
|
46
|
-
in out
|
|
44
|
+
in out _TFeatures extends TableFeatures,
|
|
45
|
+
in out _TData extends RowData,
|
|
47
46
|
> {
|
|
48
47
|
_autoResetPageIndex: () => void
|
|
49
48
|
/**
|
|
@@ -199,8 +199,8 @@ export interface TableOptions_RowSorting {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
export interface Table_RowSorting<
|
|
202
|
-
in out
|
|
203
|
-
in out
|
|
202
|
+
in out _TFeatures extends TableFeatures,
|
|
203
|
+
in out _TData extends RowData,
|
|
204
204
|
> {
|
|
205
205
|
/**
|
|
206
206
|
* Resets `sorting` to `initialState.sorting`.
|
package/src/types/ColumnDef.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { ColumnDef_ColumnVisibility } from '../features/column-visibility/c
|
|
|
15
15
|
import type { ColumnDef_GlobalFiltering } from '../features/global-filtering/globalFilteringFeature.types'
|
|
16
16
|
import type { ColumnDef_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
|
|
17
17
|
|
|
18
|
+
// @ts-expect-error Phantom type params: unused in this empty base declaration, but required with these exact names so user `declare module` augmentations merge correctly.
|
|
18
19
|
export interface ColumnMeta<
|
|
19
20
|
in out TFeatures extends TableFeatures,
|
|
20
21
|
in out TData extends RowData,
|
package/src/utils.ts
CHANGED
|
@@ -254,8 +254,7 @@ export function tableMemo<
|
|
|
254
254
|
let debugCache: boolean | undefined
|
|
255
255
|
|
|
256
256
|
if (process.env.NODE_ENV === 'development') {
|
|
257
|
-
const {
|
|
258
|
-
debugCache = _debugCache
|
|
257
|
+
const { debugAll } = table.options
|
|
259
258
|
const { parentName } = getFunctionNameInfo(fnName, '.')
|
|
260
259
|
|
|
261
260
|
const debugByParent =
|
|
@@ -360,7 +359,7 @@ export function tableMemo<
|
|
|
360
359
|
})
|
|
361
360
|
}
|
|
362
361
|
|
|
363
|
-
export interface API<
|
|
362
|
+
export interface API<_TDeps extends ReadonlyArray<any>, _TDepArgs> {
|
|
364
363
|
fn: (...args: any) => any
|
|
365
364
|
memoDeps?: (depArgs?: any) => [...any] | undefined
|
|
366
365
|
}
|
|
@@ -415,7 +414,7 @@ export function assignTableAPIs<
|
|
|
415
414
|
}
|
|
416
415
|
}
|
|
417
416
|
|
|
418
|
-
export interface PrototypeAPI<
|
|
417
|
+
export interface PrototypeAPI<_TDeps extends ReadonlyArray<any>, _TDepArgs> {
|
|
419
418
|
fn: (self: any, ...args: any) => any
|
|
420
419
|
memoDeps?: (self: any, depArgs?: any) => [...any] | undefined
|
|
421
420
|
}
|