@tanstack/table-core 9.0.0-beta.11 → 9.0.0-beta.14
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/core/table/coreTablesFeature.utils.cjs +33 -11
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +3 -1
- package/dist/core/table/coreTablesFeature.utils.d.ts +3 -1
- package/dist/core/table/coreTablesFeature.utils.js +33 -11
- package/dist/core/table/coreTablesFeature.utils.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/core/table/coreTablesFeature.utils.ts +47 -18
- 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
|
@@ -4,7 +4,7 @@ import { TableFeatures } from "./TableFeatures.js";
|
|
|
4
4
|
|
|
5
5
|
//#region src/types/HeaderGroup.d.ts
|
|
6
6
|
interface HeaderGroup_Core<in out TFeatures extends TableFeatures, in out TData extends RowData> extends HeaderGroup_Header<TFeatures, TData> {}
|
|
7
|
-
|
|
7
|
+
interface HeaderGroup<in out TFeatures extends TableFeatures, in out TData extends RowData> extends HeaderGroup_Core<TFeatures, TData> {}
|
|
8
8
|
//#endregion
|
|
9
9
|
export { HeaderGroup, HeaderGroup_Core };
|
|
10
10
|
//# sourceMappingURL=HeaderGroup.d.ts.map
|
|
@@ -20,7 +20,7 @@ interface CachedRowModels_FeatureMap<in out TFeatures extends TableFeatures, in
|
|
|
20
20
|
type CachedRowModels<TFeatures extends TableFeatures, TData extends RowData> = {
|
|
21
21
|
CachedRowModel_Core: () => RowModel<TFeatures, TData>;
|
|
22
22
|
} & ExtractFeatureMapTypes<TFeatures, CachedRowModels_FeatureMap<TFeatures, TData>>;
|
|
23
|
-
|
|
23
|
+
interface CachedRowModel_All<in out TFeatures extends TableFeatures, in out TData extends RowData = any> extends Partial<CachedRowModel_Core<TFeatures, TData> & CachedRowModel_Expanded<TFeatures, TData> & CachedRowModel_Faceted<TFeatures, TData> & CachedRowModel_Filtered<TFeatures, TData> & CachedRowModel_Grouped<TFeatures, TData> & CachedRowModel_Paginated<TFeatures, TData> & CachedRowModel_Sorted<TFeatures, TData>> {}
|
|
24
24
|
//#endregion
|
|
25
25
|
export { CachedRowModel_All, CachedRowModels, CachedRowModels_FeatureMap };
|
|
26
26
|
//# sourceMappingURL=RowModel.d.cts.map
|
package/dist/types/RowModel.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ interface CachedRowModels_FeatureMap<in out TFeatures extends TableFeatures, in
|
|
|
20
20
|
type CachedRowModels<TFeatures extends TableFeatures, TData extends RowData> = {
|
|
21
21
|
CachedRowModel_Core: () => RowModel<TFeatures, TData>;
|
|
22
22
|
} & ExtractFeatureMapTypes<TFeatures, CachedRowModels_FeatureMap<TFeatures, TData>>;
|
|
23
|
-
|
|
23
|
+
interface CachedRowModel_All<in out TFeatures extends TableFeatures, in out TData extends RowData = any> extends Partial<CachedRowModel_Core<TFeatures, TData> & CachedRowModel_Expanded<TFeatures, TData> & CachedRowModel_Faceted<TFeatures, TData> & CachedRowModel_Filtered<TFeatures, TData> & CachedRowModel_Grouped<TFeatures, TData> & CachedRowModel_Paginated<TFeatures, TData> & CachedRowModel_Sorted<TFeatures, TData>> {}
|
|
24
24
|
//#endregion
|
|
25
25
|
export { CachedRowModel_All, CachedRowModels, CachedRowModels_FeatureMap };
|
|
26
26
|
//# sourceMappingURL=RowModel.d.ts.map
|
|
@@ -12,7 +12,7 @@ interface RowModelFns_FeatureMap<in out TFeatures extends TableFeatures, in out
|
|
|
12
12
|
rowSortingFeature: RowModelFns_RowSorting<TFeatures, TData>;
|
|
13
13
|
}
|
|
14
14
|
type RowModelFns<TFeatures extends TableFeatures, TData extends RowData> = Partial<ExtractFeatureMapTypes<TFeatures, RowModelFns_FeatureMap<TFeatures, TData>>>;
|
|
15
|
-
|
|
15
|
+
interface RowModelFns_All<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Partial<RowModelFns_ColumnFiltering<TFeatures, TData> & RowModelFns_ColumnGrouping<TFeatures, TData> & RowModelFns_RowSorting<TFeatures, TData>> {}
|
|
16
16
|
//#endregion
|
|
17
17
|
export { RowModelFns, RowModelFns_All, RowModelFns_Core, RowModelFns_FeatureMap };
|
|
18
18
|
//# sourceMappingURL=RowModelFns.d.cts.map
|
|
@@ -12,7 +12,7 @@ interface RowModelFns_FeatureMap<in out TFeatures extends TableFeatures, in out
|
|
|
12
12
|
rowSortingFeature: RowModelFns_RowSorting<TFeatures, TData>;
|
|
13
13
|
}
|
|
14
14
|
type RowModelFns<TFeatures extends TableFeatures, TData extends RowData> = Partial<ExtractFeatureMapTypes<TFeatures, RowModelFns_FeatureMap<TFeatures, TData>>>;
|
|
15
|
-
|
|
15
|
+
interface RowModelFns_All<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Partial<RowModelFns_ColumnFiltering<TFeatures, TData> & RowModelFns_ColumnGrouping<TFeatures, TData> & RowModelFns_RowSorting<TFeatures, TData>> {}
|
|
16
16
|
//#endregion
|
|
17
17
|
export { RowModelFns, RowModelFns_All, RowModelFns_Core, RowModelFns_FeatureMap };
|
|
18
18
|
//# sourceMappingURL=RowModelFns.d.ts.map
|
package/dist/types/Table.d.cts
CHANGED
|
@@ -30,7 +30,7 @@ import { ReadonlyStore } from "@tanstack/store";
|
|
|
30
30
|
* The core table object that only includes the core table functionality such as column, header, row, and table APIS.
|
|
31
31
|
* No features are included.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
interface Table_Core<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Table_Table<TFeatures, TData>, Table_Columns<TFeatures, TData>, Table_Rows<TFeatures, TData>, Table_RowModels<TFeatures, TData>, Table_Headers<TFeatures, TData> {}
|
|
34
34
|
interface Table_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
35
35
|
columnFilteringFeature: Table_ColumnFiltering;
|
|
36
36
|
columnGroupingFeature: Table_ColumnGrouping<TFeatures, TData>;
|
|
@@ -59,17 +59,8 @@ type Table<TFeatures extends TableFeatures, TData extends RowData> = Table_Core<
|
|
|
59
59
|
type Table_InternalBroadenedKeys = '_rowModels' | '_rowModelFns' | 'options' | 'initialState' | 'store';
|
|
60
60
|
/**
|
|
61
61
|
* Internal broad table shape used by feature implementations.
|
|
62
|
-
*
|
|
63
|
-
* Declared as an interface extending every stock feature's table API (rather
|
|
64
|
-
* than the feature-conditional `Table` intersection) so that the compiler can
|
|
65
|
-
* relate `Table_Internal` instantiations nominally instead of structurally
|
|
66
|
-
* re-expanding the feature-map conditional for every internal call site.
|
|
67
|
-
* Mirrors the `*_All` convention used for options, state, and row models.
|
|
68
|
-
* Type parameters are annotated `in out` (invariant) so the checker can relate
|
|
69
|
-
* instantiations by their type arguments without measuring variance or falling
|
|
70
|
-
* back to member-by-member structural comparison.
|
|
71
62
|
*/
|
|
72
|
-
interface Table_Internal<in out TFeatures extends TableFeatures, in out TData extends RowData = any> extends Omit<Table_Table<TFeatures, TData>, Table_InternalBroadenedKeys>, Table_Columns<TFeatures, TData>, Table_Rows<TFeatures, TData>, Table_RowModels<TFeatures, TData>, Table_Headers<TFeatures, TData
|
|
63
|
+
interface Table_Internal<in out TFeatures extends TableFeatures, in out TData extends RowData = any> extends Omit<Table_Table<TFeatures, TData>, Table_InternalBroadenedKeys>, Table_Columns<TFeatures, TData>, Table_Rows<TFeatures, TData>, Table_RowModels<TFeatures, TData>, Table_Headers<TFeatures, TData> {
|
|
73
64
|
_rowModels: CachedRowModel_All<TFeatures, TData>;
|
|
74
65
|
_rowModelFns: RowModelFns_All<TFeatures, TData>;
|
|
75
66
|
options: DebugOptions<TableFeatures> & TableOptions_All<TFeatures, TData> & {
|
package/dist/types/Table.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import { ReadonlyStore } from "@tanstack/store";
|
|
|
30
30
|
* The core table object that only includes the core table functionality such as column, header, row, and table APIS.
|
|
31
31
|
* No features are included.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
interface Table_Core<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Table_Table<TFeatures, TData>, Table_Columns<TFeatures, TData>, Table_Rows<TFeatures, TData>, Table_RowModels<TFeatures, TData>, Table_Headers<TFeatures, TData> {}
|
|
34
34
|
interface Table_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
35
35
|
columnFilteringFeature: Table_ColumnFiltering;
|
|
36
36
|
columnGroupingFeature: Table_ColumnGrouping<TFeatures, TData>;
|
|
@@ -59,17 +59,8 @@ type Table<TFeatures extends TableFeatures, TData extends RowData> = Table_Core<
|
|
|
59
59
|
type Table_InternalBroadenedKeys = '_rowModels' | '_rowModelFns' | 'options' | 'initialState' | 'store';
|
|
60
60
|
/**
|
|
61
61
|
* Internal broad table shape used by feature implementations.
|
|
62
|
-
*
|
|
63
|
-
* Declared as an interface extending every stock feature's table API (rather
|
|
64
|
-
* than the feature-conditional `Table` intersection) so that the compiler can
|
|
65
|
-
* relate `Table_Internal` instantiations nominally instead of structurally
|
|
66
|
-
* re-expanding the feature-map conditional for every internal call site.
|
|
67
|
-
* Mirrors the `*_All` convention used for options, state, and row models.
|
|
68
|
-
* Type parameters are annotated `in out` (invariant) so the checker can relate
|
|
69
|
-
* instantiations by their type arguments without measuring variance or falling
|
|
70
|
-
* back to member-by-member structural comparison.
|
|
71
62
|
*/
|
|
72
|
-
interface Table_Internal<in out TFeatures extends TableFeatures, in out TData extends RowData = any> extends Omit<Table_Table<TFeatures, TData>, Table_InternalBroadenedKeys>, Table_Columns<TFeatures, TData>, Table_Rows<TFeatures, TData>, Table_RowModels<TFeatures, TData>, Table_Headers<TFeatures, TData
|
|
63
|
+
interface Table_Internal<in out TFeatures extends TableFeatures, in out TData extends RowData = any> extends Omit<Table_Table<TFeatures, TData>, Table_InternalBroadenedKeys>, Table_Columns<TFeatures, TData>, Table_Rows<TFeatures, TData>, Table_RowModels<TFeatures, TData>, Table_Headers<TFeatures, TData> {
|
|
73
64
|
_rowModels: CachedRowModel_All<TFeatures, TData>;
|
|
74
65
|
_rowModelFns: RowModelFns_All<TFeatures, TData>;
|
|
75
66
|
options: DebugOptions<TableFeatures> & TableOptions_All<TFeatures, TData> & {
|
|
@@ -42,7 +42,7 @@ type TableState<TFeatures extends TableFeatures> = ExtractFeatureMapTypes<TFeatu
|
|
|
42
42
|
* Feature internals use this when they may need to inspect optional slices owned
|
|
43
43
|
* by other features.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
interface TableState_All extends Partial<TableState_ColumnFiltering & TableState_ColumnGrouping & TableState_ColumnOrdering & TableState_ColumnPinning & TableState_ColumnResizing & TableState_ColumnSizing & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowPinning & TableState_RowSelection & TableState_RowSorting> {}
|
|
46
46
|
//#endregion
|
|
47
47
|
export { TableState, TableState_All, TableState_FeatureMap };
|
|
48
48
|
//# sourceMappingURL=TableState.d.cts.map
|
|
@@ -42,7 +42,7 @@ type TableState<TFeatures extends TableFeatures> = ExtractFeatureMapTypes<TFeatu
|
|
|
42
42
|
* Feature internals use this when they may need to inspect optional slices owned
|
|
43
43
|
* by other features.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
interface TableState_All extends Partial<TableState_ColumnFiltering & TableState_ColumnGrouping & TableState_ColumnOrdering & TableState_ColumnPinning & TableState_ColumnResizing & TableState_ColumnSizing & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowPinning & TableState_RowSelection & TableState_RowSorting> {}
|
|
46
46
|
//#endregion
|
|
47
47
|
export { TableState, TableState_All, TableState_FeatureMap };
|
|
48
48
|
//# sourceMappingURL=TableState.d.ts.map
|
package/package.json
CHANGED
|
@@ -113,7 +113,9 @@ export function buildHeaderGroups<
|
|
|
113
113
|
pendingParentHeaders.push(header)
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
headerGroup.headers.push(
|
|
116
|
+
headerGroup.headers.push(
|
|
117
|
+
headerToGroup as Header<TFeatures, TData, unknown>,
|
|
118
|
+
)
|
|
117
119
|
headerToGroup.headerGroup = headerGroup
|
|
118
120
|
})
|
|
119
121
|
|
|
@@ -68,7 +68,9 @@ export function table_reset<
|
|
|
68
68
|
* Merges new table options with the current resolved options.
|
|
69
69
|
*
|
|
70
70
|
* If `options.mergeOptions` is provided, it owns the merge behavior; otherwise
|
|
71
|
-
* options are shallow-merged.
|
|
71
|
+
* options are shallow-merged. Static options that should never change after
|
|
72
|
+
* initialization are restored on a fresh object so framework merge helpers may
|
|
73
|
+
* return readonly getter/proxy objects.
|
|
72
74
|
*
|
|
73
75
|
* @example
|
|
74
76
|
* ```ts
|
|
@@ -82,17 +84,52 @@ export function table_mergeOptions<
|
|
|
82
84
|
table: Table_Internal<TFeatures, TData>,
|
|
83
85
|
newOptions: TableOptions<TFeatures, TData>,
|
|
84
86
|
) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
const { features, atoms, initialState } = table.options
|
|
88
|
+
|
|
89
|
+
// simple merge if no mergeOptions is provided - performant
|
|
90
|
+
if (!table.options.mergeOptions) {
|
|
91
|
+
return {
|
|
92
|
+
...table.options,
|
|
93
|
+
...newOptions,
|
|
94
|
+
features,
|
|
95
|
+
atoms,
|
|
96
|
+
initialState,
|
|
97
|
+
}
|
|
90
98
|
}
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
// else use the mergeOptions function and preserve getters/setters
|
|
101
|
+
const mergedOptions = table.options.mergeOptions(
|
|
102
|
+
table.options as TableOptions<TFeatures, TData>,
|
|
103
|
+
newOptions,
|
|
104
|
+
)
|
|
105
|
+
const descriptors: PropertyDescriptorMap = {
|
|
106
|
+
...Object.getOwnPropertyDescriptors(mergedOptions),
|
|
95
107
|
}
|
|
108
|
+
|
|
109
|
+
return Object.defineProperties(
|
|
110
|
+
Object.create(Object.getPrototypeOf(mergedOptions)),
|
|
111
|
+
{
|
|
112
|
+
...descriptors,
|
|
113
|
+
features: {
|
|
114
|
+
value: features,
|
|
115
|
+
enumerable: true,
|
|
116
|
+
configurable: true,
|
|
117
|
+
writable: true,
|
|
118
|
+
},
|
|
119
|
+
atoms: {
|
|
120
|
+
value: atoms,
|
|
121
|
+
enumerable: true,
|
|
122
|
+
configurable: true,
|
|
123
|
+
writable: true,
|
|
124
|
+
},
|
|
125
|
+
initialState: {
|
|
126
|
+
value: initialState,
|
|
127
|
+
enumerable: true,
|
|
128
|
+
configurable: true,
|
|
129
|
+
writable: true,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
) as TableOptions<TFeatures, TData>
|
|
96
133
|
}
|
|
97
134
|
|
|
98
135
|
/**
|
|
@@ -117,15 +154,7 @@ export function table_setOptions<
|
|
|
117
154
|
updater,
|
|
118
155
|
table.options as TableOptions<TFeatures, TData>,
|
|
119
156
|
)
|
|
120
|
-
|
|
121
|
-
const { features, atoms, initialState } = table.options
|
|
122
|
-
const mergedOptions = Object.assign(table_mergeOptions(table, newOptions), {
|
|
123
|
-
// Once the table instance is created those properties should never change after initialization,
|
|
124
|
-
// so we assign them back preserving the `table_mergeOptions` object reference
|
|
125
|
-
features,
|
|
126
|
-
atoms,
|
|
127
|
-
initialState,
|
|
128
|
-
})
|
|
157
|
+
const mergedOptions = table_mergeOptions(table, newOptions)
|
|
129
158
|
|
|
130
159
|
if (table.optionsStore) {
|
|
131
160
|
table.optionsStore.set(() => mergedOptions)
|
|
@@ -323,7 +323,7 @@ export function shouldAutoRemoveFilter<
|
|
|
323
323
|
) {
|
|
324
324
|
return (
|
|
325
325
|
(filterFn && filterFn.autoRemove
|
|
326
|
-
? filterFn.autoRemove(value, column as
|
|
326
|
+
? filterFn.autoRemove(value, column as any)
|
|
327
327
|
: false) ||
|
|
328
328
|
typeof value === 'undefined' ||
|
|
329
329
|
(typeof value === 'string' && !value)
|
|
@@ -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
|
+
> {}
|