@tanstack/table-core 9.0.0-beta.1 → 9.0.0-beta.2
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/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/types/Cell.d.cts +7 -4
- package/dist/types/Cell.d.ts +7 -4
- package/dist/types/Column.d.cts +16 -4
- package/dist/types/Column.d.ts +16 -4
- package/dist/types/ColumnDef.d.cts +13 -3
- package/dist/types/ColumnDef.d.ts +13 -3
- package/dist/types/Header.d.cts +8 -4
- package/dist/types/Header.d.ts +8 -4
- package/dist/types/Row.d.cts +13 -4
- package/dist/types/Row.d.ts +13 -4
- package/dist/types/RowModel.d.cts +21 -5
- package/dist/types/RowModel.d.ts +21 -5
- package/dist/types/RowModelFns.d.cts +9 -4
- package/dist/types/RowModelFns.d.ts +9 -4
- package/dist/types/Table.d.cts +20 -4
- package/dist/types/Table.d.ts +20 -4
- package/dist/types/TableFeatures.d.cts +3 -1
- package/dist/types/TableFeatures.d.ts +3 -1
- package/dist/types/TableOptions.d.cts +20 -4
- package/dist/types/TableOptions.d.ts +20 -4
- package/dist/types/TableState.d.cts +18 -4
- package/dist/types/TableState.d.ts +18 -4
- package/package.json +1 -1
- package/src/core/table/constructTable.ts +1 -1
- package/src/types/Cell.ts +11 -15
- package/src/types/Column.ts +23 -42
- package/src/types/ColumnDef.ts +23 -34
- package/src/types/Header.ts +12 -18
- package/src/types/Row.ts +20 -26
- package/src/types/RowModel.ts +36 -53
- package/src/types/RowModelFns.ts +16 -20
- package/src/types/Table.ts +27 -53
- package/src/types/TableFeatures.ts +12 -0
- package/src/types/TableOptions.ts +36 -64
- package/src/types/TableState.ts +25 -52
package/src/types/Cell.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Cell_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
2
|
-
import type { CellData, RowData
|
|
3
|
-
import type {
|
|
2
|
+
import type { CellData, RowData } from './type-utils'
|
|
3
|
+
import type {
|
|
4
|
+
ExtractFeatureMapTypes,
|
|
5
|
+
ExtractFeatureTypes,
|
|
6
|
+
TableFeatures,
|
|
7
|
+
} from './TableFeatures'
|
|
4
8
|
import type { Cell_Cell } from '../core/cells/coreCellsFeature.types'
|
|
5
9
|
|
|
6
10
|
/**
|
|
@@ -19,23 +23,15 @@ export interface Cell_Core<
|
|
|
19
23
|
TValue extends CellData = CellData,
|
|
20
24
|
> extends Cell_Cell<TFeatures, TData, TValue> {}
|
|
21
25
|
|
|
26
|
+
export interface Cell_FeatureMap {
|
|
27
|
+
columnGroupingFeature: Cell_ColumnGrouping
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
export type Cell<
|
|
23
31
|
TFeatures extends TableFeatures,
|
|
24
32
|
TData extends RowData,
|
|
25
33
|
TValue extends CellData = CellData,
|
|
26
34
|
> = Cell_Cell<TFeatures, TData, TValue> &
|
|
27
|
-
|
|
28
|
-
'columnGroupingFeature' extends keyof TFeatures
|
|
29
|
-
? Cell_ColumnGrouping
|
|
30
|
-
: never
|
|
31
|
-
> &
|
|
35
|
+
ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap> &
|
|
32
36
|
ExtractFeatureTypes<'Cell', TFeatures> &
|
|
33
37
|
Cell_Plugins<TFeatures, TData, TValue>
|
|
34
|
-
|
|
35
|
-
// export type Cell<
|
|
36
|
-
// TFeatures extends TableFeatures,
|
|
37
|
-
// TData extends RowData,
|
|
38
|
-
// TValue extends CellData = CellData,
|
|
39
|
-
// > = Cell_Core<TFeatures, TData, TValue> &
|
|
40
|
-
// ExtractFeatureTypes<TFeatures, 'Cell'> &
|
|
41
|
-
// Cell_Plugins<TFeatures, TData, TValue>
|
package/src/types/Column.ts
CHANGED
|
@@ -9,8 +9,12 @@ import type { Column_ColumnResizing } from '../features/column-resizing/columnRe
|
|
|
9
9
|
import type { Column_ColumnSizing } from '../features/column-sizing/columnSizingFeature.types'
|
|
10
10
|
import type { Column_ColumnVisibility } from '../features/column-visibility/columnVisibilityFeature.types'
|
|
11
11
|
import type { ColumnDefBase_All } from './ColumnDef'
|
|
12
|
-
import type { RowData
|
|
13
|
-
import type {
|
|
12
|
+
import type { RowData } from './type-utils'
|
|
13
|
+
import type {
|
|
14
|
+
ExtractFeatureMapTypes,
|
|
15
|
+
ExtractFeatureTypes,
|
|
16
|
+
TableFeatures,
|
|
17
|
+
} from './TableFeatures'
|
|
14
18
|
import type { Column_Column } from '../core/columns/coreColumnsFeature.types'
|
|
15
19
|
|
|
16
20
|
/**
|
|
@@ -29,54 +33,31 @@ export interface Column_Core<
|
|
|
29
33
|
TValue = unknown,
|
|
30
34
|
> extends Column_Column<TFeatures, TData, TValue> {}
|
|
31
35
|
|
|
36
|
+
export interface Column_FeatureMap<
|
|
37
|
+
TFeatures extends TableFeatures,
|
|
38
|
+
TData extends RowData,
|
|
39
|
+
> {
|
|
40
|
+
columnFacetingFeature: Column_ColumnFaceting<TFeatures, TData>
|
|
41
|
+
columnFilteringFeature: Column_ColumnFiltering<TFeatures, TData>
|
|
42
|
+
columnGroupingFeature: Column_ColumnGrouping<TFeatures, TData>
|
|
43
|
+
columnOrderingFeature: Column_ColumnOrdering
|
|
44
|
+
columnPinningFeature: Column_ColumnPinning
|
|
45
|
+
columnResizingFeature: Column_ColumnResizing
|
|
46
|
+
columnSizingFeature: Column_ColumnSizing
|
|
47
|
+
columnVisibilityFeature: Column_ColumnVisibility
|
|
48
|
+
globalFilteringFeature: Column_GlobalFiltering
|
|
49
|
+
rowSortingFeature: Column_RowSorting<TFeatures, TData>
|
|
50
|
+
}
|
|
51
|
+
|
|
32
52
|
export type Column<
|
|
33
53
|
TFeatures extends TableFeatures,
|
|
34
54
|
TData extends RowData,
|
|
35
55
|
TValue = unknown,
|
|
36
56
|
> = Column_Core<TFeatures, TData, TValue> &
|
|
37
|
-
|
|
38
|
-
| ('columnFacetingFeature' extends keyof TFeatures
|
|
39
|
-
? Column_ColumnFaceting<TFeatures, TData>
|
|
40
|
-
: never)
|
|
41
|
-
| ('columnFilteringFeature' extends keyof TFeatures
|
|
42
|
-
? Column_ColumnFiltering<TFeatures, TData>
|
|
43
|
-
: never)
|
|
44
|
-
| ('columnGroupingFeature' extends keyof TFeatures
|
|
45
|
-
? Column_ColumnGrouping<TFeatures, TData>
|
|
46
|
-
: never)
|
|
47
|
-
| ('columnOrderingFeature' extends keyof TFeatures
|
|
48
|
-
? Column_ColumnOrdering
|
|
49
|
-
: never)
|
|
50
|
-
| ('columnPinningFeature' extends keyof TFeatures
|
|
51
|
-
? Column_ColumnPinning
|
|
52
|
-
: never)
|
|
53
|
-
| ('columnResizingFeature' extends keyof TFeatures
|
|
54
|
-
? Column_ColumnResizing
|
|
55
|
-
: never)
|
|
56
|
-
| ('columnSizingFeature' extends keyof TFeatures
|
|
57
|
-
? Column_ColumnSizing
|
|
58
|
-
: never)
|
|
59
|
-
| ('columnVisibilityFeature' extends keyof TFeatures
|
|
60
|
-
? Column_ColumnVisibility
|
|
61
|
-
: never)
|
|
62
|
-
| ('globalFilteringFeature' extends keyof TFeatures
|
|
63
|
-
? Column_GlobalFiltering
|
|
64
|
-
: never)
|
|
65
|
-
| ('rowSortingFeature' extends keyof TFeatures
|
|
66
|
-
? Column_RowSorting<TFeatures, TData>
|
|
67
|
-
: never)
|
|
68
|
-
> &
|
|
57
|
+
ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>> &
|
|
69
58
|
ExtractFeatureTypes<'Column', TFeatures> &
|
|
70
59
|
Column_Plugins<TFeatures, TData, TValue>
|
|
71
60
|
|
|
72
|
-
// export type Column<
|
|
73
|
-
// TFeatures extends TableFeatures,
|
|
74
|
-
// TData extends RowData,
|
|
75
|
-
// TValue = unknown,
|
|
76
|
-
// > = Column_Core<TFeatures, TData, TValue> &
|
|
77
|
-
// ExtractFeatureTypes<'Column', TFeatures> &
|
|
78
|
-
// Column_Plugins<TFeatures, TData, TValue>
|
|
79
|
-
|
|
80
61
|
export type Column_Internal<
|
|
81
62
|
TFeatures extends TableFeatures,
|
|
82
63
|
TData extends RowData,
|
package/src/types/ColumnDef.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { CellData, RowData, UnionToIntersection } from './type-utils'
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
ExtractFeatureMapTypes,
|
|
4
|
+
ExtractFeatureTypes,
|
|
5
|
+
TableFeatures,
|
|
6
|
+
} from './TableFeatures'
|
|
3
7
|
import type { CellContext } from '../core/cells/coreCellsFeature.types'
|
|
4
8
|
import type { HeaderContext } from '../core/headers/coreHeadersFeature.types'
|
|
5
9
|
import type { ColumnDef_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
@@ -110,48 +114,33 @@ interface ColumnDefBase_Core<
|
|
|
110
114
|
meta?: ColumnMeta<TFeatures, TData, TValue>
|
|
111
115
|
}
|
|
112
116
|
|
|
117
|
+
export interface ColumnDef_FeatureMap<
|
|
118
|
+
TFeatures extends TableFeatures,
|
|
119
|
+
TData extends RowData,
|
|
120
|
+
TValue extends CellData,
|
|
121
|
+
> {
|
|
122
|
+
columnVisibilityFeature: ColumnDef_ColumnVisibility
|
|
123
|
+
columnPinningFeature: ColumnDef_ColumnPinning
|
|
124
|
+
columnFilteringFeature: ColumnDef_ColumnFiltering<TFeatures, TData>
|
|
125
|
+
globalFilteringFeature: ColumnDef_GlobalFiltering
|
|
126
|
+
rowSortingFeature: ColumnDef_RowSorting<TFeatures, TData>
|
|
127
|
+
columnGroupingFeature: ColumnDef_ColumnGrouping<TFeatures, TData, TValue>
|
|
128
|
+
columnSizingFeature: ColumnDef_ColumnSizing
|
|
129
|
+
columnResizingFeature: ColumnDef_ColumnResizing
|
|
130
|
+
}
|
|
131
|
+
|
|
113
132
|
export type ColumnDefBase<
|
|
114
133
|
TFeatures extends TableFeatures,
|
|
115
134
|
TData extends RowData,
|
|
116
135
|
TValue extends CellData = CellData,
|
|
117
136
|
> = ColumnDefBase_Core<TFeatures, TData, TValue> &
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
: never)
|
|
122
|
-
| ('columnPinningFeature' extends keyof TFeatures
|
|
123
|
-
? ColumnDef_ColumnPinning
|
|
124
|
-
: never)
|
|
125
|
-
| ('columnFilteringFeature' extends keyof TFeatures
|
|
126
|
-
? ColumnDef_ColumnFiltering<TFeatures, TData>
|
|
127
|
-
: never)
|
|
128
|
-
| ('globalFilteringFeature' extends keyof TFeatures
|
|
129
|
-
? ColumnDef_GlobalFiltering
|
|
130
|
-
: never)
|
|
131
|
-
| ('rowSortingFeature' extends keyof TFeatures
|
|
132
|
-
? ColumnDef_RowSorting<TFeatures, TData>
|
|
133
|
-
: never)
|
|
134
|
-
| ('columnGroupingFeature' extends keyof TFeatures
|
|
135
|
-
? ColumnDef_ColumnGrouping<TFeatures, TData, TValue>
|
|
136
|
-
: never)
|
|
137
|
-
| ('columnSizingFeature' extends keyof TFeatures
|
|
138
|
-
? ColumnDef_ColumnSizing
|
|
139
|
-
: never)
|
|
140
|
-
| ('columnResizingFeature' extends keyof TFeatures
|
|
141
|
-
? ColumnDef_ColumnResizing
|
|
142
|
-
: never)
|
|
137
|
+
ExtractFeatureMapTypes<
|
|
138
|
+
TFeatures,
|
|
139
|
+
ColumnDef_FeatureMap<TFeatures, TData, TValue>
|
|
143
140
|
> &
|
|
144
141
|
ExtractFeatureTypes<'ColumnDef', TFeatures> &
|
|
145
142
|
ColumnDef_Plugins<TFeatures, TData, TValue>
|
|
146
143
|
|
|
147
|
-
// export type ColumnDefBase<
|
|
148
|
-
// TFeatures extends TableFeatures,
|
|
149
|
-
// TData extends RowData,
|
|
150
|
-
// TValue extends CellData = CellData,
|
|
151
|
-
// > = ColumnDefBase_Core<TFeatures, TData, TValue> &
|
|
152
|
-
// ExtractFeatureTypes<'ColumnDef', TFeatures> &
|
|
153
|
-
// ColumnDef_Plugins<TFeatures, TData, TValue>
|
|
154
|
-
|
|
155
144
|
export type ColumnDefBase_All<
|
|
156
145
|
TFeatures extends TableFeatures,
|
|
157
146
|
TData extends RowData,
|
package/src/types/Header.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Header_ColumnSizing } from '../features/column-sizing/columnSizingFeature.types'
|
|
2
|
-
import type { CellData, RowData
|
|
3
|
-
import type {
|
|
2
|
+
import type { CellData, RowData } from './type-utils'
|
|
3
|
+
import type {
|
|
4
|
+
ExtractFeatureMapTypes,
|
|
5
|
+
ExtractFeatureTypes,
|
|
6
|
+
TableFeatures,
|
|
7
|
+
} from './TableFeatures'
|
|
4
8
|
import type { Header_Header } from '../core/headers/coreHeadersFeature.types'
|
|
5
9
|
import type { Header_ColumnResizing } from '../features/column-resizing/columnResizingFeature.types'
|
|
6
10
|
|
|
@@ -20,26 +24,16 @@ export interface Header_Core<
|
|
|
20
24
|
TValue extends CellData = CellData,
|
|
21
25
|
> extends Header_Header<TFeatures, TData, TValue> {}
|
|
22
26
|
|
|
27
|
+
export interface Header_FeatureMap {
|
|
28
|
+
columnSizingFeature: Header_ColumnSizing
|
|
29
|
+
columnResizingFeature: Header_ColumnResizing
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
export type Header<
|
|
24
33
|
TFeatures extends TableFeatures,
|
|
25
34
|
TData extends RowData,
|
|
26
35
|
TValue extends CellData = CellData,
|
|
27
36
|
> = Header_Core<TFeatures, TData, TValue> &
|
|
28
|
-
|
|
29
|
-
| ('columnSizingFeature' extends keyof TFeatures
|
|
30
|
-
? Header_ColumnSizing
|
|
31
|
-
: never)
|
|
32
|
-
| ('columnResizingFeature' extends keyof TFeatures
|
|
33
|
-
? Header_ColumnResizing
|
|
34
|
-
: never)
|
|
35
|
-
> &
|
|
37
|
+
ExtractFeatureMapTypes<TFeatures, Header_FeatureMap> &
|
|
36
38
|
ExtractFeatureTypes<'Header', TFeatures> &
|
|
37
39
|
Header_Plugins<TFeatures, TData, TValue>
|
|
38
|
-
|
|
39
|
-
// export type Header<
|
|
40
|
-
// TFeatures extends TableFeatures,
|
|
41
|
-
// TData extends RowData,
|
|
42
|
-
// TValue extends CellData = CellData,
|
|
43
|
-
// > = Header_Core<TFeatures, TData, TValue> &
|
|
44
|
-
// ExtractFeatureTypes<'Header', TFeatures> &
|
|
45
|
-
// Header_Plugins<TFeatures, TData, TValue>
|
package/src/types/Row.ts
CHANGED
|
@@ -2,11 +2,15 @@ import type { Row_ColumnVisibility } from '../features/column-visibility/columnV
|
|
|
2
2
|
import type { Row_ColumnPinning } from '../features/column-pinning/columnPinningFeature.types'
|
|
3
3
|
import type { Row_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
4
4
|
import type { Row_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
5
|
-
import type { RowData
|
|
5
|
+
import type { RowData } from './type-utils'
|
|
6
6
|
import type { Row_RowExpanding } from '../features/row-expanding/rowExpandingFeature.types'
|
|
7
7
|
import type { Row_RowPinning } from '../features/row-pinning/rowPinningFeature.types'
|
|
8
8
|
import type { Row_RowSelection } from '../features/row-selection/rowSelectionFeature.types'
|
|
9
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
ExtractFeatureMapTypes,
|
|
11
|
+
ExtractFeatureTypes,
|
|
12
|
+
TableFeatures,
|
|
13
|
+
} from './TableFeatures'
|
|
10
14
|
import type { Row_Row } from '../core/rows/coreRowsFeature.types'
|
|
11
15
|
|
|
12
16
|
/**
|
|
@@ -23,33 +27,23 @@ export interface Row_Core<
|
|
|
23
27
|
TData extends RowData,
|
|
24
28
|
> extends Row_Row<TFeatures, TData> {}
|
|
25
29
|
|
|
30
|
+
export interface Row_FeatureMap<
|
|
31
|
+
TFeatures extends TableFeatures,
|
|
32
|
+
TData extends RowData,
|
|
33
|
+
> {
|
|
34
|
+
columnFilteringFeature: Row_ColumnFiltering<TFeatures, TData>
|
|
35
|
+
columnGroupingFeature: Row_ColumnGrouping
|
|
36
|
+
columnPinningFeature: Row_ColumnPinning<TFeatures, TData>
|
|
37
|
+
columnVisibilityFeature: Row_ColumnVisibility<TFeatures, TData>
|
|
38
|
+
rowExpandingFeature: Row_RowExpanding
|
|
39
|
+
rowPinningFeature: Row_RowPinning
|
|
40
|
+
rowSelectionFeature: Row_RowSelection
|
|
41
|
+
}
|
|
42
|
+
|
|
26
43
|
export type Row<
|
|
27
44
|
TFeatures extends TableFeatures,
|
|
28
45
|
TData extends RowData,
|
|
29
46
|
> = Row_Core<TFeatures, TData> &
|
|
30
|
-
|
|
31
|
-
| ('columnFilteringFeature' extends keyof TFeatures
|
|
32
|
-
? Row_ColumnFiltering<TFeatures, TData>
|
|
33
|
-
: never)
|
|
34
|
-
| ('columnGroupingFeature' extends keyof TFeatures
|
|
35
|
-
? Row_ColumnGrouping
|
|
36
|
-
: never)
|
|
37
|
-
| ('columnPinningFeature' extends keyof TFeatures
|
|
38
|
-
? Row_ColumnPinning<TFeatures, TData>
|
|
39
|
-
: never)
|
|
40
|
-
| ('columnVisibilityFeature' extends keyof TFeatures
|
|
41
|
-
? Row_ColumnVisibility<TFeatures, TData>
|
|
42
|
-
: never)
|
|
43
|
-
| ('rowExpandingFeature' extends keyof TFeatures ? Row_RowExpanding : never)
|
|
44
|
-
| ('rowPinningFeature' extends keyof TFeatures ? Row_RowPinning : never)
|
|
45
|
-
| ('rowSelectionFeature' extends keyof TFeatures ? Row_RowSelection : never)
|
|
46
|
-
> &
|
|
47
|
+
ExtractFeatureMapTypes<TFeatures, Row_FeatureMap<TFeatures, TData>> &
|
|
47
48
|
ExtractFeatureTypes<'Row', TFeatures> &
|
|
48
49
|
Row_Plugins<TFeatures, TData>
|
|
49
|
-
|
|
50
|
-
// export type Row<
|
|
51
|
-
// TFeatures extends TableFeatures,
|
|
52
|
-
// TData extends RowData,
|
|
53
|
-
// > = Row_Core<TFeatures, TData> &
|
|
54
|
-
// ExtractFeatureTypes<'Row', TFeatures> &
|
|
55
|
-
// Row_Plugins<TFeatures, TData>
|
package/src/types/RowModel.ts
CHANGED
|
@@ -27,8 +27,12 @@ import type {
|
|
|
27
27
|
CachedRowModel_Sorted,
|
|
28
28
|
CreateRowModel_Sorted,
|
|
29
29
|
} from '../features/row-sorting/rowSortingFeature.types'
|
|
30
|
-
import type { RowData
|
|
31
|
-
import type {
|
|
30
|
+
import type { RowData } from './type-utils'
|
|
31
|
+
import type {
|
|
32
|
+
ExtractFeatureMapTypes,
|
|
33
|
+
ExtractFeatureTypes,
|
|
34
|
+
TableFeatures,
|
|
35
|
+
} from './TableFeatures'
|
|
32
36
|
|
|
33
37
|
/**
|
|
34
38
|
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
@@ -39,40 +43,29 @@ export interface CreateRowModels_Plugins<
|
|
|
39
43
|
TData extends RowData,
|
|
40
44
|
> {}
|
|
41
45
|
|
|
46
|
+
export interface CreateRowModels_FeatureMap<
|
|
47
|
+
TFeatures extends TableFeatures,
|
|
48
|
+
TData extends RowData,
|
|
49
|
+
> {
|
|
50
|
+
columnFacetingFeature: CreateRowModel_Faceted<TFeatures, TData>
|
|
51
|
+
columnFilteringFeature: CreateRowModel_Filtered<TFeatures, TData>
|
|
52
|
+
rowExpandingFeature: CreateRowModel_Expanded<TFeatures, TData>
|
|
53
|
+
columnGroupingFeature: CreateRowModel_Grouped<TFeatures, TData>
|
|
54
|
+
rowPaginationFeature: CreateRowModel_Paginated<TFeatures, TData>
|
|
55
|
+
rowSortingFeature: CreateRowModel_Sorted<TFeatures, TData>
|
|
56
|
+
}
|
|
57
|
+
|
|
42
58
|
export type CreateRowModels<
|
|
43
59
|
TFeatures extends TableFeatures,
|
|
44
60
|
TData extends RowData,
|
|
45
61
|
> = CreateRowModel_Core<TFeatures, TData> &
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
: never)
|
|
50
|
-
| ('columnFilteringFeature' extends keyof TFeatures
|
|
51
|
-
? CreateRowModel_Filtered<TFeatures, TData>
|
|
52
|
-
: never)
|
|
53
|
-
| ('rowExpandingFeature' extends keyof TFeatures
|
|
54
|
-
? CreateRowModel_Expanded<TFeatures, TData>
|
|
55
|
-
: never)
|
|
56
|
-
| ('columnGroupingFeature' extends keyof TFeatures
|
|
57
|
-
? CreateRowModel_Grouped<TFeatures, TData>
|
|
58
|
-
: never)
|
|
59
|
-
| ('rowPaginationFeature' extends keyof TFeatures
|
|
60
|
-
? CreateRowModel_Paginated<TFeatures, TData>
|
|
61
|
-
: never)
|
|
62
|
-
| ('rowSortingFeature' extends keyof TFeatures
|
|
63
|
-
? CreateRowModel_Sorted<TFeatures, TData>
|
|
64
|
-
: never)
|
|
62
|
+
ExtractFeatureMapTypes<
|
|
63
|
+
TFeatures,
|
|
64
|
+
CreateRowModels_FeatureMap<TFeatures, TData>
|
|
65
65
|
> &
|
|
66
66
|
ExtractFeatureTypes<'CreateRowModels', TFeatures> &
|
|
67
67
|
CreateRowModels_Plugins<TFeatures, TData>
|
|
68
68
|
|
|
69
|
-
// export type CreateRowModels<
|
|
70
|
-
// TFeatures extends TableFeatures,
|
|
71
|
-
// TData extends RowData,
|
|
72
|
-
// > = CreateRowModel_Core<TFeatures, TData> &
|
|
73
|
-
// ExtractFeatureTypes<'CreateRowModels', TFeatures> &
|
|
74
|
-
// CreateRowModels_Plugins<TFeatures, TData>
|
|
75
|
-
|
|
76
69
|
export type CreateRowModels_All<
|
|
77
70
|
TFeatures extends TableFeatures,
|
|
78
71
|
TData extends RowData,
|
|
@@ -89,40 +82,30 @@ export interface CachedRowModels_Plugins<
|
|
|
89
82
|
TData extends RowData,
|
|
90
83
|
> {}
|
|
91
84
|
|
|
85
|
+
export interface CachedRowModels_FeatureMap<
|
|
86
|
+
TFeatures extends TableFeatures,
|
|
87
|
+
TData extends RowData,
|
|
88
|
+
> {
|
|
89
|
+
columnFacetingFeature: CachedRowModel_Faceted<TFeatures, TData>
|
|
90
|
+
columnFilteringFeature: CachedRowModel_Filtered<TFeatures, TData>
|
|
91
|
+
rowExpandingFeature: CachedRowModel_Expanded<TFeatures, TData>
|
|
92
|
+
columnGroupingFeature: CachedRowModel_Grouped<TFeatures, TData>
|
|
93
|
+
rowPaginationFeature: CachedRowModel_Paginated<TFeatures, TData>
|
|
94
|
+
rowSortingFeature: CachedRowModel_Sorted<TFeatures, TData>
|
|
95
|
+
}
|
|
96
|
+
|
|
92
97
|
export type CachedRowModels<
|
|
93
98
|
TFeatures extends TableFeatures,
|
|
94
99
|
TData extends RowData,
|
|
95
100
|
> = {
|
|
96
101
|
CachedRowModel_Core: () => RowModel<TFeatures, TData>
|
|
97
|
-
} &
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
: never)
|
|
101
|
-
| ('columnFilteringFeature' extends keyof TFeatures
|
|
102
|
-
? CachedRowModel_Filtered<TFeatures, TData>
|
|
103
|
-
: never)
|
|
104
|
-
| ('rowExpandingFeature' extends keyof TFeatures
|
|
105
|
-
? CachedRowModel_Expanded<TFeatures, TData>
|
|
106
|
-
: never)
|
|
107
|
-
| ('columnGroupingFeature' extends keyof TFeatures
|
|
108
|
-
? CachedRowModel_Grouped<TFeatures, TData>
|
|
109
|
-
: never)
|
|
110
|
-
| ('rowPaginationFeature' extends keyof TFeatures
|
|
111
|
-
? CachedRowModel_Paginated<TFeatures, TData>
|
|
112
|
-
: never)
|
|
113
|
-
| ('rowSortingFeature' extends keyof TFeatures
|
|
114
|
-
? CachedRowModel_Sorted<TFeatures, TData>
|
|
115
|
-
: never)
|
|
102
|
+
} & ExtractFeatureMapTypes<
|
|
103
|
+
TFeatures,
|
|
104
|
+
CachedRowModels_FeatureMap<TFeatures, TData>
|
|
116
105
|
> &
|
|
117
106
|
ExtractFeatureTypes<'CachedRowModel', TFeatures> &
|
|
118
107
|
CachedRowModels_Plugins<TFeatures, TData>
|
|
119
108
|
|
|
120
|
-
// export type CachedRowModels<
|
|
121
|
-
// TFeatures extends TableFeatures,
|
|
122
|
-
// TData extends RowData,
|
|
123
|
-
// > = ExtractFeatureTypes<'CachedRowModel', TFeatures> &
|
|
124
|
-
// CachedRowModels_Plugins<TFeatures, TData>
|
|
125
|
-
|
|
126
109
|
export type CachedRowModel_All<
|
|
127
110
|
TFeatures extends TableFeatures,
|
|
128
111
|
TData extends RowData = any,
|
package/src/types/RowModelFns.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { RowModelFns_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
|
|
2
2
|
import type { RowModelFns_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
3
|
-
import type { RowData
|
|
3
|
+
import type { RowData } from './type-utils'
|
|
4
4
|
import type { RowModelFns_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
ExtractFeatureMapTypes,
|
|
7
|
+
ExtractFeatureTypes,
|
|
8
|
+
TableFeatures,
|
|
9
|
+
} from './TableFeatures'
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
@@ -15,32 +19,24 @@ export interface RowModelFns_Plugins<
|
|
|
15
19
|
|
|
16
20
|
export interface RowModelFns_Core {}
|
|
17
21
|
|
|
22
|
+
export interface RowModelFns_FeatureMap<
|
|
23
|
+
TFeatures extends TableFeatures,
|
|
24
|
+
TData extends RowData,
|
|
25
|
+
> {
|
|
26
|
+
columnFilteringFeature: RowModelFns_ColumnFiltering<TFeatures, TData>
|
|
27
|
+
columnGroupingFeature: RowModelFns_ColumnGrouping<TFeatures, TData>
|
|
28
|
+
rowSortingFeature: RowModelFns_RowSorting<TFeatures, TData>
|
|
29
|
+
}
|
|
30
|
+
|
|
18
31
|
export type RowModelFns<
|
|
19
32
|
TFeatures extends TableFeatures,
|
|
20
33
|
TData extends RowData,
|
|
21
34
|
> = Partial<
|
|
22
|
-
|
|
23
|
-
| ('columnFilteringFeature' extends keyof TFeatures
|
|
24
|
-
? RowModelFns_ColumnFiltering<TFeatures, TData>
|
|
25
|
-
: never)
|
|
26
|
-
| ('columnGroupingFeature' extends keyof TFeatures
|
|
27
|
-
? RowModelFns_ColumnGrouping<TFeatures, TData>
|
|
28
|
-
: never)
|
|
29
|
-
| ('rowSortingFeature' extends keyof TFeatures
|
|
30
|
-
? RowModelFns_RowSorting<TFeatures, TData>
|
|
31
|
-
: never)
|
|
32
|
-
> &
|
|
35
|
+
ExtractFeatureMapTypes<TFeatures, RowModelFns_FeatureMap<TFeatures, TData>> &
|
|
33
36
|
ExtractFeatureTypes<'RowModelFns', TFeatures> &
|
|
34
37
|
RowModelFns_Plugins<TFeatures, TData>
|
|
35
38
|
>
|
|
36
39
|
|
|
37
|
-
// export type RowModelFns<
|
|
38
|
-
// TFeatures extends TableFeatures,
|
|
39
|
-
// TData extends RowData,
|
|
40
|
-
// > = RowModelFns_Core &
|
|
41
|
-
// ExtractFeatureTypes<'RowModelFns', TFeatures> &
|
|
42
|
-
// RowModelFns_Plugins<TFeatures, TData>
|
|
43
|
-
|
|
44
40
|
export type RowModelFns_All<
|
|
45
41
|
TFeatures extends TableFeatures,
|
|
46
42
|
TData extends RowData,
|
package/src/types/Table.ts
CHANGED
|
@@ -17,8 +17,12 @@ import type { Table_RowModels } from '../core/row-models/coreRowModelsFeature.ty
|
|
|
17
17
|
import type { CachedRowModel_All, CreateRowModels_All } from './RowModel'
|
|
18
18
|
import type { RowModelFns_All } from './RowModelFns'
|
|
19
19
|
import type { TableState_All } from './TableState'
|
|
20
|
-
import type { RowData
|
|
21
|
-
import type {
|
|
20
|
+
import type { RowData } from './type-utils'
|
|
21
|
+
import type {
|
|
22
|
+
ExtractFeatureMapTypes,
|
|
23
|
+
ExtractFeatureTypes,
|
|
24
|
+
TableFeatures,
|
|
25
|
+
} from './TableFeatures'
|
|
22
26
|
import type { Table_Columns } from '../core/columns/coreColumnsFeature.types'
|
|
23
27
|
import type { Table_Headers } from '../core/headers/coreHeadersFeature.types'
|
|
24
28
|
import type { Table_Rows } from '../core/rows/coreRowsFeature.types'
|
|
@@ -52,6 +56,26 @@ export type Table_Core<
|
|
|
52
56
|
Table_RowModels<TFeatures, TData> &
|
|
53
57
|
Table_Headers<TFeatures, TData>
|
|
54
58
|
|
|
59
|
+
export interface Table_FeatureMap<
|
|
60
|
+
TFeatures extends TableFeatures,
|
|
61
|
+
TData extends RowData,
|
|
62
|
+
> {
|
|
63
|
+
columnFilteringFeature: Table_ColumnFiltering
|
|
64
|
+
columnGroupingFeature: Table_ColumnGrouping<TFeatures, TData>
|
|
65
|
+
columnOrderingFeature: Table_ColumnOrdering<TFeatures, TData>
|
|
66
|
+
columnPinningFeature: Table_ColumnPinning<TFeatures, TData>
|
|
67
|
+
columnResizingFeature: Table_ColumnResizing
|
|
68
|
+
columnSizingFeature: Table_ColumnSizing
|
|
69
|
+
columnVisibilityFeature: Table_ColumnVisibility<TFeatures, TData>
|
|
70
|
+
columnFacetingFeature: Table_ColumnFaceting<TFeatures, TData>
|
|
71
|
+
globalFilteringFeature: Table_GlobalFiltering<TFeatures, TData>
|
|
72
|
+
rowExpandingFeature: Table_RowExpanding<TFeatures, TData>
|
|
73
|
+
rowPaginationFeature: Table_RowPagination<TFeatures, TData>
|
|
74
|
+
rowPinningFeature: Table_RowPinning<TFeatures, TData>
|
|
75
|
+
rowSelectionFeature: Table_RowSelection<TFeatures, TData>
|
|
76
|
+
rowSortingFeature: Table_RowSorting<TFeatures, TData>
|
|
77
|
+
}
|
|
78
|
+
|
|
55
79
|
/**
|
|
56
80
|
* The table object that includes both the core table functionality and the features that are enabled via the `features` table option.
|
|
57
81
|
*/
|
|
@@ -59,60 +83,10 @@ export type Table<
|
|
|
59
83
|
TFeatures extends TableFeatures,
|
|
60
84
|
TData extends RowData,
|
|
61
85
|
> = Table_Core<TFeatures, TData> &
|
|
62
|
-
|
|
63
|
-
| ('columnFilteringFeature' extends keyof TFeatures
|
|
64
|
-
? Table_ColumnFiltering
|
|
65
|
-
: never)
|
|
66
|
-
| ('columnGroupingFeature' extends keyof TFeatures
|
|
67
|
-
? Table_ColumnGrouping<TFeatures, TData>
|
|
68
|
-
: never)
|
|
69
|
-
| ('columnOrderingFeature' extends keyof TFeatures
|
|
70
|
-
? Table_ColumnOrdering<TFeatures, TData>
|
|
71
|
-
: never)
|
|
72
|
-
| ('columnPinningFeature' extends keyof TFeatures
|
|
73
|
-
? Table_ColumnPinning<TFeatures, TData>
|
|
74
|
-
: never)
|
|
75
|
-
| ('columnResizingFeature' extends keyof TFeatures
|
|
76
|
-
? Table_ColumnResizing
|
|
77
|
-
: never)
|
|
78
|
-
| ('columnSizingFeature' extends keyof TFeatures
|
|
79
|
-
? Table_ColumnSizing
|
|
80
|
-
: never)
|
|
81
|
-
| ('columnVisibilityFeature' extends keyof TFeatures
|
|
82
|
-
? Table_ColumnVisibility<TFeatures, TData>
|
|
83
|
-
: never)
|
|
84
|
-
| ('columnFacetingFeature' extends keyof TFeatures
|
|
85
|
-
? Table_ColumnFaceting<TFeatures, TData>
|
|
86
|
-
: never)
|
|
87
|
-
| ('globalFilteringFeature' extends keyof TFeatures
|
|
88
|
-
? Table_GlobalFiltering<TFeatures, TData>
|
|
89
|
-
: never)
|
|
90
|
-
| ('rowExpandingFeature' extends keyof TFeatures
|
|
91
|
-
? Table_RowExpanding<TFeatures, TData>
|
|
92
|
-
: never)
|
|
93
|
-
| ('rowPaginationFeature' extends keyof TFeatures
|
|
94
|
-
? Table_RowPagination<TFeatures, TData>
|
|
95
|
-
: never)
|
|
96
|
-
| ('rowPinningFeature' extends keyof TFeatures
|
|
97
|
-
? Table_RowPinning<TFeatures, TData>
|
|
98
|
-
: never)
|
|
99
|
-
| ('rowSelectionFeature' extends keyof TFeatures
|
|
100
|
-
? Table_RowSelection<TFeatures, TData>
|
|
101
|
-
: never)
|
|
102
|
-
| ('rowSortingFeature' extends keyof TFeatures
|
|
103
|
-
? Table_RowSorting<TFeatures, TData>
|
|
104
|
-
: never)
|
|
105
|
-
> &
|
|
86
|
+
ExtractFeatureMapTypes<TFeatures, Table_FeatureMap<TFeatures, TData>> &
|
|
106
87
|
ExtractFeatureTypes<'Table', TFeatures> &
|
|
107
88
|
Table_Plugins<TFeatures, TData>
|
|
108
89
|
|
|
109
|
-
// export type Table<
|
|
110
|
-
// TFeatures extends TableFeatures,
|
|
111
|
-
// TData extends RowData,
|
|
112
|
-
// > = Table_Core<TFeatures, TData> &
|
|
113
|
-
// ExtractFeatureTypes<'Table', TFeatures> &
|
|
114
|
-
// Table_Plugins<TFeatures, TData>
|
|
115
|
-
|
|
116
90
|
export type Table_Internal<
|
|
117
91
|
TFeatures extends TableFeatures,
|
|
118
92
|
TData extends RowData = any,
|
|
@@ -22,6 +22,18 @@ export type ExtractFeatureTypes<
|
|
|
22
22
|
}[keyof TFeatures]
|
|
23
23
|
>
|
|
24
24
|
|
|
25
|
+
type IsAny<T> = 0 extends 1 & T ? true : false
|
|
26
|
+
|
|
27
|
+
export type ExtractFeatureMapTypes<
|
|
28
|
+
TFeatures extends TableFeatures,
|
|
29
|
+
TFeatureMap extends object,
|
|
30
|
+
> =
|
|
31
|
+
IsAny<TFeatures> extends true
|
|
32
|
+
? UnionToIntersection<TFeatureMap[keyof TFeatureMap]>
|
|
33
|
+
: UnionToIntersection<
|
|
34
|
+
TFeatureMap[Extract<keyof TFeatures, keyof TFeatureMap>]
|
|
35
|
+
>
|
|
36
|
+
|
|
25
37
|
export interface FeatureConstructors {
|
|
26
38
|
CachedRowModel?: any
|
|
27
39
|
Cell?: any
|