@tanstack/table-core 9.0.0-beta.11 → 9.0.0-beta.12
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.utils.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
- package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +3 -2
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +3 -2
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +1 -4
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +1 -4
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/helpers/columnHelper.cjs.map +1 -1
- package/dist/helpers/columnHelper.d.cts +2 -2
- package/dist/helpers/columnHelper.d.ts +2 -2
- package/dist/helpers/columnHelper.js.map +1 -1
- package/dist/types/Column.d.cts +2 -2
- package/dist/types/Column.d.ts +2 -2
- package/dist/types/HeaderGroup.d.cts +1 -1
- package/dist/types/HeaderGroup.d.ts +1 -1
- package/dist/types/RowModel.d.cts +1 -1
- package/dist/types/RowModel.d.ts +1 -1
- package/dist/types/RowModelFns.d.cts +1 -1
- package/dist/types/RowModelFns.d.ts +1 -1
- package/dist/types/Table.d.cts +2 -11
- package/dist/types/Table.d.ts +2 -11
- package/dist/types/TableState.d.cts +1 -1
- package/dist/types/TableState.d.ts +1 -1
- package/package.json +1 -1
- package/src/core/columns/coreColumnsFeature.utils.ts +1 -1
- package/src/core/headers/buildHeaderGroups.ts +3 -1
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +1 -1
- package/src/features/column-pinning/columnPinningFeature.utils.ts +6 -14
- package/src/features/column-resizing/columnResizingFeature.types.ts +1 -4
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +1 -1
- package/src/helpers/columnHelper.ts +4 -4
- package/src/types/Column.ts +4 -4
- package/src/types/HeaderGroup.ts +4 -4
- package/src/types/RowModel.ts +5 -5
- package/src/types/RowModelFns.ts +5 -5
- package/src/types/Table.ts +11 -32
- package/src/types/TableState.ts +15 -1
|
@@ -13,7 +13,7 @@ import type { Row } from '../../types/Row'
|
|
|
13
13
|
import type { CellData, RowData, Updater } from '../../types/type-utils'
|
|
14
14
|
import type { TableFeatures } from '../../types/TableFeatures'
|
|
15
15
|
import type { Table_Internal } from '../../types/Table'
|
|
16
|
-
import type { Column_Internal } from '../../types/Column'
|
|
16
|
+
import type { Column, Column_Internal } from '../../types/Column'
|
|
17
17
|
import type {
|
|
18
18
|
ColumnPinningPosition,
|
|
19
19
|
ColumnPinningState,
|
|
@@ -364,15 +364,11 @@ export function table_getLeftHeaderGroups<
|
|
|
364
364
|
TData extends RowData,
|
|
365
365
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
366
366
|
const allColumns = table.getAllColumns()
|
|
367
|
-
const leafColumnsById = table.getAllLeafColumnsById()
|
|
368
|
-
string,
|
|
369
|
-
Column_Internal<TFeatures, TData, unknown>
|
|
370
|
-
>
|
|
367
|
+
const leafColumnsById = table.getAllLeafColumnsById()
|
|
371
368
|
const { left } =
|
|
372
369
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
373
370
|
|
|
374
|
-
const orderedLeafColumns: Array<
|
|
375
|
-
[]
|
|
371
|
+
const orderedLeafColumns: Array<Column<TFeatures, TData, unknown>> = []
|
|
376
372
|
for (let i = 0; i < left.length; i++) {
|
|
377
373
|
const column = leafColumnsById[left[i]!]
|
|
378
374
|
if (
|
|
@@ -402,15 +398,11 @@ export function table_getRightHeaderGroups<
|
|
|
402
398
|
TData extends RowData,
|
|
403
399
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
404
400
|
const allColumns = table.getAllColumns()
|
|
405
|
-
const leafColumnsById = table.getAllLeafColumnsById()
|
|
406
|
-
string,
|
|
407
|
-
Column_Internal<TFeatures, TData, unknown>
|
|
408
|
-
>
|
|
401
|
+
const leafColumnsById = table.getAllLeafColumnsById()
|
|
409
402
|
const { right } =
|
|
410
403
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
411
404
|
|
|
412
|
-
const orderedLeafColumns: Array<
|
|
413
|
-
[]
|
|
405
|
+
const orderedLeafColumns: Array<Column<TFeatures, TData, unknown>> = []
|
|
414
406
|
for (let i = 0; i < right.length; i++) {
|
|
415
407
|
const column = leafColumnsById[right[i]!]
|
|
416
408
|
if (
|
|
@@ -446,7 +438,7 @@ export function table_getCenterHeaderGroups<
|
|
|
446
438
|
table,
|
|
447
439
|
'getVisibleLeafColumns',
|
|
448
440
|
table_getVisibleLeafColumns,
|
|
449
|
-
)
|
|
441
|
+
)
|
|
450
442
|
const { left, right } =
|
|
451
443
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
452
444
|
const leftAndRight: Array<string> = [...left, ...right]
|
|
@@ -54,11 +54,8 @@ export interface Table_ColumnResizing {
|
|
|
54
54
|
resetHeaderSizeInfo: (defaultState?: boolean) => void
|
|
55
55
|
/**
|
|
56
56
|
* Updates transient resize interaction state with a next state or updater function.
|
|
57
|
-
*
|
|
58
|
-
* The lowercase `c` in this API name matches the current generated v9 table
|
|
59
|
-
* API for the `columnResizing` state slice.
|
|
60
57
|
*/
|
|
61
|
-
|
|
58
|
+
setColumnResizing: (updater: Updater<columnResizingState>) => void
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
export interface ColumnDef_ColumnResizing {
|
|
@@ -26,7 +26,7 @@ export function column_getCanGlobalFilter<
|
|
|
26
26
|
(column.columnDef.enableGlobalFilter ?? true) &&
|
|
27
27
|
(column.table.options.enableGlobalFilter ?? true) &&
|
|
28
28
|
(column.table.options.enableFilters ?? true) &&
|
|
29
|
-
(column.table.options.getColumnCanGlobalFilter?.(column) ?? true) &&
|
|
29
|
+
(column.table.options.getColumnCanGlobalFilter?.(column as any) ?? true) &&
|
|
30
30
|
!!column.accessorFn
|
|
31
31
|
)
|
|
32
32
|
}
|
|
@@ -10,10 +10,10 @@ import type {
|
|
|
10
10
|
IdentifiedColumnDef,
|
|
11
11
|
} from '../types/ColumnDef'
|
|
12
12
|
|
|
13
|
-
export
|
|
14
|
-
TFeatures extends TableFeatures,
|
|
15
|
-
TData extends RowData,
|
|
16
|
-
>
|
|
13
|
+
export interface ColumnHelper<
|
|
14
|
+
in out TFeatures extends TableFeatures,
|
|
15
|
+
in out TData extends RowData,
|
|
16
|
+
> {
|
|
17
17
|
/**
|
|
18
18
|
* Creates a data column definition with an accessor key or function to extract the cell value.
|
|
19
19
|
* @example
|
package/src/types/Column.ts
CHANGED
|
@@ -42,10 +42,10 @@ export type Column<
|
|
|
42
42
|
> = Column_Core<TFeatures, TData, TValue> &
|
|
43
43
|
ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>>
|
|
44
44
|
|
|
45
|
-
export
|
|
46
|
-
TFeatures extends TableFeatures,
|
|
47
|
-
TData extends RowData,
|
|
45
|
+
export interface Column_Internal<
|
|
46
|
+
in out TFeatures extends TableFeatures,
|
|
47
|
+
in out TData extends RowData,
|
|
48
48
|
TValue = unknown,
|
|
49
|
-
>
|
|
49
|
+
> extends Omit<Column_Core<TFeatures, TData, TValue>, 'columnDef'> {
|
|
50
50
|
columnDef: ColumnDefBase_All<TFeatures, TData, TValue>
|
|
51
51
|
}
|
package/src/types/HeaderGroup.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface HeaderGroup_Core<
|
|
|
7
7
|
in out TData extends RowData,
|
|
8
8
|
> extends HeaderGroup_Header<TFeatures, TData> {}
|
|
9
9
|
|
|
10
|
-
export
|
|
11
|
-
TFeatures extends TableFeatures,
|
|
12
|
-
TData extends RowData,
|
|
13
|
-
>
|
|
10
|
+
export interface HeaderGroup<
|
|
11
|
+
in out TFeatures extends TableFeatures,
|
|
12
|
+
in out TData extends RowData,
|
|
13
|
+
> extends HeaderGroup_Core<TFeatures, TData> {}
|
package/src/types/RowModel.ts
CHANGED
|
@@ -33,10 +33,10 @@ export type CachedRowModels<
|
|
|
33
33
|
CachedRowModels_FeatureMap<TFeatures, TData>
|
|
34
34
|
>
|
|
35
35
|
|
|
36
|
-
export
|
|
37
|
-
TFeatures extends TableFeatures,
|
|
38
|
-
TData extends RowData = any,
|
|
39
|
-
>
|
|
36
|
+
export interface CachedRowModel_All<
|
|
37
|
+
in out TFeatures extends TableFeatures,
|
|
38
|
+
in out TData extends RowData = any,
|
|
39
|
+
> extends Partial<
|
|
40
40
|
CachedRowModel_Core<TFeatures, TData> &
|
|
41
41
|
CachedRowModel_Expanded<TFeatures, TData> &
|
|
42
42
|
CachedRowModel_Faceted<TFeatures, TData> &
|
|
@@ -44,4 +44,4 @@ export type CachedRowModel_All<
|
|
|
44
44
|
CachedRowModel_Grouped<TFeatures, TData> &
|
|
45
45
|
CachedRowModel_Paginated<TFeatures, TData> &
|
|
46
46
|
CachedRowModel_Sorted<TFeatures, TData>
|
|
47
|
-
>
|
|
47
|
+
> {}
|
package/src/types/RowModelFns.ts
CHANGED
|
@@ -22,11 +22,11 @@ export type RowModelFns<
|
|
|
22
22
|
ExtractFeatureMapTypes<TFeatures, RowModelFns_FeatureMap<TFeatures, TData>>
|
|
23
23
|
>
|
|
24
24
|
|
|
25
|
-
export
|
|
26
|
-
TFeatures extends TableFeatures,
|
|
27
|
-
TData extends RowData,
|
|
28
|
-
>
|
|
25
|
+
export interface RowModelFns_All<
|
|
26
|
+
in out TFeatures extends TableFeatures,
|
|
27
|
+
in out TData extends RowData,
|
|
28
|
+
> extends Partial<
|
|
29
29
|
RowModelFns_ColumnFiltering<TFeatures, TData> &
|
|
30
30
|
RowModelFns_ColumnGrouping<TFeatures, TData> &
|
|
31
31
|
RowModelFns_RowSorting<TFeatures, TData>
|
|
32
|
-
>
|
|
32
|
+
> {}
|
package/src/types/Table.ts
CHANGED
|
@@ -36,14 +36,16 @@ import type { DebugOptions, TableOptions_All } from './TableOptions'
|
|
|
36
36
|
* The core table object that only includes the core table functionality such as column, header, row, and table APIS.
|
|
37
37
|
* No features are included.
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
40
|
-
TFeatures extends TableFeatures,
|
|
41
|
-
TData extends RowData,
|
|
42
|
-
>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
export interface Table_Core<
|
|
40
|
+
in out TFeatures extends TableFeatures,
|
|
41
|
+
in out TData extends RowData,
|
|
42
|
+
>
|
|
43
|
+
extends
|
|
44
|
+
Table_Table<TFeatures, TData>,
|
|
45
|
+
Table_Columns<TFeatures, TData>,
|
|
46
|
+
Table_Rows<TFeatures, TData>,
|
|
47
|
+
Table_RowModels<TFeatures, TData>,
|
|
48
|
+
Table_Headers<TFeatures, TData> {}
|
|
47
49
|
|
|
48
50
|
export interface Table_FeatureMap<
|
|
49
51
|
in out TFeatures extends TableFeatures,
|
|
@@ -88,15 +90,6 @@ type Table_InternalBroadenedKeys =
|
|
|
88
90
|
|
|
89
91
|
/**
|
|
90
92
|
* Internal broad table shape used by feature implementations.
|
|
91
|
-
*
|
|
92
|
-
* Declared as an interface extending every stock feature's table API (rather
|
|
93
|
-
* than the feature-conditional `Table` intersection) so that the compiler can
|
|
94
|
-
* relate `Table_Internal` instantiations nominally instead of structurally
|
|
95
|
-
* re-expanding the feature-map conditional for every internal call site.
|
|
96
|
-
* Mirrors the `*_All` convention used for options, state, and row models.
|
|
97
|
-
* Type parameters are annotated `in out` (invariant) so the checker can relate
|
|
98
|
-
* instantiations by their type arguments without measuring variance or falling
|
|
99
|
-
* back to member-by-member structural comparison.
|
|
100
93
|
*/
|
|
101
94
|
export interface Table_Internal<
|
|
102
95
|
in out TFeatures extends TableFeatures,
|
|
@@ -107,21 +100,7 @@ export interface Table_Internal<
|
|
|
107
100
|
Table_Columns<TFeatures, TData>,
|
|
108
101
|
Table_Rows<TFeatures, TData>,
|
|
109
102
|
Table_RowModels<TFeatures, TData>,
|
|
110
|
-
Table_Headers<TFeatures, TData
|
|
111
|
-
Table_ColumnFiltering,
|
|
112
|
-
Table_ColumnGrouping<TFeatures, TData>,
|
|
113
|
-
Table_ColumnOrdering<TFeatures, TData>,
|
|
114
|
-
Table_ColumnPinning<TFeatures, TData>,
|
|
115
|
-
Table_ColumnResizing,
|
|
116
|
-
Table_ColumnSizing,
|
|
117
|
-
Table_ColumnVisibility<TFeatures, TData>,
|
|
118
|
-
Table_ColumnFaceting<TFeatures, TData>,
|
|
119
|
-
Table_GlobalFiltering<TFeatures, TData>,
|
|
120
|
-
Table_RowExpanding<TFeatures, TData>,
|
|
121
|
-
Table_RowPagination<TFeatures, TData>,
|
|
122
|
-
Table_RowPinning<TFeatures, TData>,
|
|
123
|
-
Table_RowSelection<TFeatures, TData>,
|
|
124
|
-
Table_RowSorting<TFeatures, TData> {
|
|
103
|
+
Table_Headers<TFeatures, TData> {
|
|
125
104
|
_rowModels: CachedRowModel_All<TFeatures, TData>
|
|
126
105
|
_rowModelFns: RowModelFns_All<TFeatures, TData>
|
|
127
106
|
options: DebugOptions<TableFeatures> &
|
package/src/types/TableState.ts
CHANGED
|
@@ -44,4 +44,18 @@ export type TableState<TFeatures extends TableFeatures> =
|
|
|
44
44
|
* Feature internals use this when they may need to inspect optional slices owned
|
|
45
45
|
* by other features.
|
|
46
46
|
*/
|
|
47
|
-
export
|
|
47
|
+
export interface TableState_All extends Partial<
|
|
48
|
+
TableState_ColumnFiltering &
|
|
49
|
+
TableState_ColumnGrouping &
|
|
50
|
+
TableState_ColumnOrdering &
|
|
51
|
+
TableState_ColumnPinning &
|
|
52
|
+
TableState_ColumnResizing &
|
|
53
|
+
TableState_ColumnSizing &
|
|
54
|
+
TableState_ColumnVisibility &
|
|
55
|
+
TableState_GlobalFiltering &
|
|
56
|
+
TableState_RowExpanding &
|
|
57
|
+
TableState_RowPagination &
|
|
58
|
+
TableState_RowPinning &
|
|
59
|
+
TableState_RowSelection &
|
|
60
|
+
TableState_RowSorting
|
|
61
|
+
> {}
|