@tanstack/table-core 9.0.0-beta.1 → 9.0.0-beta.5
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/cells/coreCellsFeature.cjs +11 -20
- package/dist/core/cells/coreCellsFeature.cjs.map +1 -1
- package/dist/core/cells/coreCellsFeature.d.cts +4 -12
- package/dist/core/cells/coreCellsFeature.d.ts +4 -12
- package/dist/core/cells/coreCellsFeature.js +12 -20
- package/dist/core/cells/coreCellsFeature.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.cjs +59 -68
- package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.d.cts +4 -12
- package/dist/core/columns/coreColumnsFeature.d.ts +4 -12
- package/dist/core/columns/coreColumnsFeature.js +60 -68
- package/dist/core/columns/coreColumnsFeature.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/headers/coreHeadersFeature.cjs +44 -53
- package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.d.cts +4 -12
- package/dist/core/headers/coreHeadersFeature.d.ts +4 -12
- package/dist/core/headers/coreHeadersFeature.js +45 -53
- package/dist/core/headers/coreHeadersFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.cjs +17 -26
- package/dist/core/row-models/coreRowModelsFeature.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.d.cts +4 -12
- package/dist/core/row-models/coreRowModelsFeature.d.ts +4 -12
- package/dist/core/row-models/coreRowModelsFeature.js +18 -26
- package/dist/core/row-models/coreRowModelsFeature.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.types.d.cts +3 -5
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +3 -5
- package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
- package/dist/core/row-models/createCoreRowModel.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.cjs +27 -36
- package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.d.cts +4 -12
- package/dist/core/rows/coreRowsFeature.d.ts +4 -12
- package/dist/core/rows/coreRowsFeature.js +28 -36
- package/dist/core/rows/coreRowsFeature.js.map +1 -1
- package/dist/core/table/constructTable.cjs +2 -2
- package/dist/core/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.js +2 -2
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/core/table/coreTablesFeature.cjs +7 -16
- package/dist/core/table/coreTablesFeature.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.d.cts +4 -12
- package/dist/core/table/coreTablesFeature.d.ts +4 -12
- package/dist/core/table/coreTablesFeature.js +8 -16
- package/dist/core/table/coreTablesFeature.js.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.cjs +49 -61
- package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.d.cts +4 -15
- package/dist/features/column-faceting/columnFacetingFeature.d.ts +4 -15
- package/dist/features/column-faceting/columnFacetingFeature.js +50 -61
- package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.cjs +40 -53
- package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.d.cts +4 -16
- package/dist/features/column-filtering/columnFilteringFeature.d.ts +4 -16
- package/dist/features/column-filtering/columnFilteringFeature.js +41 -53
- package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +3 -3
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +3 -3
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.cts +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.ts +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.cjs +57 -69
- package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.cts +4 -15
- package/dist/features/column-grouping/columnGroupingFeature.d.ts +4 -15
- package/dist/features/column-grouping/columnGroupingFeature.js +58 -69
- package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.cjs +47 -59
- package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.d.cts +4 -15
- package/dist/features/column-ordering/columnOrderingFeature.d.ts +4 -15
- package/dist/features/column-ordering/columnOrderingFeature.js +48 -59
- package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.cjs +209 -221
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.d.cts +4 -15
- package/dist/features/column-pinning/columnPinningFeature.d.ts +4 -15
- package/dist/features/column-pinning/columnPinningFeature.js +210 -221
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +12 -12
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +12 -12
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.cjs +31 -43
- package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.d.cts +4 -15
- package/dist/features/column-resizing/columnResizingFeature.d.ts +4 -15
- package/dist/features/column-resizing/columnResizingFeature.js +32 -43
- package/dist/features/column-resizing/columnResizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +112 -125
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.d.cts +4 -16
- package/dist/features/column-sizing/columnSizingFeature.d.ts +4 -16
- package/dist/features/column-sizing/columnSizingFeature.js +113 -125
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +3 -3
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +83 -95
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.d.cts +4 -15
- package/dist/features/column-visibility/columnVisibilityFeature.d.ts +4 -15
- package/dist/features/column-visibility/columnVisibilityFeature.js +84 -95
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.cjs +31 -43
- package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.d.cts +4 -15
- package/dist/features/global-filtering/globalFilteringFeature.d.ts +4 -15
- package/dist/features/global-filtering/globalFilteringFeature.js +32 -43
- package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +4 -2
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +4 -2
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.cjs +37 -49
- package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.d.cts +4 -15
- package/dist/features/row-expanding/rowExpandingFeature.d.ts +4 -15
- package/dist/features/row-expanding/rowExpandingFeature.js +38 -49
- package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.cjs +35 -47
- package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.d.cts +4 -15
- package/dist/features/row-pagination/rowPaginationFeature.d.ts +4 -15
- package/dist/features/row-pagination/rowPaginationFeature.js +36 -47
- package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.cjs +55 -67
- package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.d.cts +4 -15
- package/dist/features/row-pinning/rowPinningFeature.d.ts +4 -15
- package/dist/features/row-pinning/rowPinningFeature.js +56 -67
- package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs +65 -77
- package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.d.cts +4 -15
- package/dist/features/row-selection/rowSelectionFeature.d.ts +4 -15
- package/dist/features/row-selection/rowSelectionFeature.js +66 -77
- package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.cjs +45 -57
- package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.d.cts +4 -15
- package/dist/features/row-sorting/rowSortingFeature.d.ts +4 -15
- package/dist/features/row-sorting/rowSortingFeature.js +46 -57
- package/dist/features/row-sorting/rowSortingFeature.js.map +1 -1
- package/dist/fns/aggregationFns.cjs +18 -18
- package/dist/fns/aggregationFns.cjs.map +1 -1
- package/dist/fns/aggregationFns.d.cts +21 -19
- package/dist/fns/aggregationFns.d.ts +21 -19
- package/dist/fns/aggregationFns.js +18 -18
- package/dist/fns/aggregationFns.js.map +1 -1
- package/dist/fns/filterFns.cjs +51 -65
- package/dist/fns/filterFns.cjs.map +1 -1
- package/dist/fns/filterFns.d.cts +82 -28
- package/dist/fns/filterFns.d.ts +82 -28
- package/dist/fns/filterFns.js +51 -65
- package/dist/fns/filterFns.js.map +1 -1
- package/dist/fns/sortFns.cjs.map +1 -1
- package/dist/fns/sortFns.d.cts +15 -13
- package/dist/fns/sortFns.d.ts +15 -13
- package/dist/fns/sortFns.js.map +1 -1
- package/dist/index.cjs +0 -20
- package/dist/index.d.cts +34 -34
- package/dist/index.d.ts +34 -34
- package/dist/index.js +21 -21
- package/dist/types/Cell.d.cts +7 -9
- package/dist/types/Cell.d.ts +7 -9
- package/dist/types/Column.d.cts +16 -9
- package/dist/types/Column.d.ts +16 -9
- package/dist/types/ColumnDef.d.cts +13 -8
- package/dist/types/ColumnDef.d.ts +13 -8
- package/dist/types/Header.d.cts +8 -9
- package/dist/types/Header.d.ts +8 -9
- package/dist/types/HeaderGroup.d.cts +3 -8
- package/dist/types/HeaderGroup.d.ts +3 -8
- package/dist/types/Row.d.cts +13 -9
- package/dist/types/Row.d.ts +13 -9
- package/dist/types/RowModel.d.cts +21 -11
- package/dist/types/RowModel.d.ts +21 -11
- package/dist/types/RowModelFns.d.cts +9 -9
- package/dist/types/RowModelFns.d.ts +9 -9
- package/dist/types/Table.d.cts +20 -9
- package/dist/types/Table.d.ts +20 -9
- package/dist/types/TableFeatures.d.cts +14 -38
- package/dist/types/TableFeatures.d.ts +14 -38
- package/dist/types/TableOptions.d.cts +20 -5
- package/dist/types/TableOptions.d.ts +20 -5
- package/dist/types/TableState.d.cts +20 -11
- package/dist/types/TableState.d.ts +20 -11
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/core/cells/coreCellsFeature.ts +17 -39
- package/src/core/columns/coreColumnsFeature.ts +56 -83
- package/src/core/headers/buildHeaderGroups.ts +1 -1
- package/src/core/headers/coreHeadersFeature.ts +42 -64
- package/src/core/headers/coreHeadersFeature.utils.ts +1 -1
- package/src/core/row-models/coreRowModelsFeature.ts +43 -64
- package/src/core/row-models/coreRowModelsFeature.types.ts +2 -6
- package/src/core/row-models/createCoreRowModel.ts +1 -1
- package/src/core/rows/coreRowsFeature.ts +45 -72
- package/src/core/table/constructTable.ts +10 -7
- package/src/core/table/coreTablesFeature.ts +13 -35
- package/src/core/table/coreTablesFeature.utils.ts +1 -1
- package/src/features/column-faceting/columnFacetingFeature.ts +71 -102
- package/src/features/column-faceting/createFacetedMinMaxValues.ts +1 -1
- package/src/features/column-faceting/createFacetedRowModel.ts +1 -1
- package/src/features/column-faceting/createFacetedUniqueValues.ts +1 -1
- package/src/features/column-filtering/columnFilteringFeature.ts +60 -103
- package/src/features/column-filtering/columnFilteringFeature.types.ts +3 -3
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +4 -4
- package/src/features/column-filtering/createFilteredRowModel.ts +2 -2
- package/src/features/column-grouping/columnGroupingFeature.ts +82 -126
- package/src/features/column-grouping/createGroupedRowModel.ts +1 -1
- package/src/features/column-ordering/columnOrderingFeature.ts +52 -84
- package/src/features/column-pinning/columnPinningFeature.ts +268 -304
- package/src/features/column-pinning/columnPinningFeature.utils.ts +5 -5
- package/src/features/column-resizing/columnResizingFeature.ts +44 -78
- package/src/features/column-sizing/columnSizingFeature.ts +115 -152
- package/src/features/column-visibility/columnVisibilityFeature.ts +92 -129
- package/src/features/global-filtering/globalFilteringFeature.ts +45 -79
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +4 -2
- package/src/features/row-expanding/createExpandedRowModel.ts +1 -1
- package/src/features/row-expanding/rowExpandingFeature.ts +65 -101
- package/src/features/row-pagination/createPaginatedRowModel.ts +1 -1
- package/src/features/row-pagination/rowPaginationFeature.ts +69 -103
- package/src/features/row-pinning/rowPinningFeature.ts +72 -104
- package/src/features/row-selection/rowSelectionFeature.ts +103 -135
- package/src/features/row-sorting/createSortedRowModel.ts +1 -1
- package/src/features/row-sorting/rowSortingFeature.ts +73 -114
- package/src/fns/aggregationFns.ts +26 -42
- package/src/fns/filterFns.ts +231 -264
- package/src/fns/sortFns.ts +18 -19
- package/src/types/Cell.ts +8 -28
- package/src/types/Column.ts +18 -53
- package/src/types/ColumnDef.ts +20 -47
- package/src/types/Header.ts +8 -30
- package/src/types/HeaderGroup.ts +2 -13
- package/src/types/Row.ts +15 -36
- package/src/types/RowModel.ts +28 -67
- package/src/types/RowModelFns.ts +11 -30
- package/src/types/Table.ts +23 -64
- package/src/types/TableFeatures.ts +60 -109
- package/src/types/TableOptions.ts +32 -71
- package/src/types/TableState.ts +20 -73
- package/src/utils.ts +5 -4
package/src/types/Table.ts
CHANGED
|
@@ -17,8 +17,8 @@ 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 { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
22
22
|
import type { Table_Columns } from '../core/columns/coreColumnsFeature.types'
|
|
23
23
|
import type { Table_Headers } from '../core/headers/coreHeadersFeature.types'
|
|
24
24
|
import type { Table_Rows } from '../core/rows/coreRowsFeature.types'
|
|
@@ -30,15 +30,6 @@ import type {
|
|
|
30
30
|
} from '../core/table/coreTablesFeature.types'
|
|
31
31
|
import type { TableOptions_All } from './TableOptions'
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
35
|
-
* Note: This will affect the types of all tables in your project.
|
|
36
|
-
*/
|
|
37
|
-
export interface Table_Plugins<
|
|
38
|
-
TFeatures extends TableFeatures,
|
|
39
|
-
TData extends RowData,
|
|
40
|
-
> {}
|
|
41
|
-
|
|
42
33
|
/**
|
|
43
34
|
* The core table object that only includes the core table functionality such as column, header, row, and table APIS.
|
|
44
35
|
* No features are included.
|
|
@@ -52,6 +43,26 @@ export type Table_Core<
|
|
|
52
43
|
Table_RowModels<TFeatures, TData> &
|
|
53
44
|
Table_Headers<TFeatures, TData>
|
|
54
45
|
|
|
46
|
+
export interface Table_FeatureMap<
|
|
47
|
+
TFeatures extends TableFeatures,
|
|
48
|
+
TData extends RowData,
|
|
49
|
+
> {
|
|
50
|
+
columnFilteringFeature: Table_ColumnFiltering
|
|
51
|
+
columnGroupingFeature: Table_ColumnGrouping<TFeatures, TData>
|
|
52
|
+
columnOrderingFeature: Table_ColumnOrdering<TFeatures, TData>
|
|
53
|
+
columnPinningFeature: Table_ColumnPinning<TFeatures, TData>
|
|
54
|
+
columnResizingFeature: Table_ColumnResizing
|
|
55
|
+
columnSizingFeature: Table_ColumnSizing
|
|
56
|
+
columnVisibilityFeature: Table_ColumnVisibility<TFeatures, TData>
|
|
57
|
+
columnFacetingFeature: Table_ColumnFaceting<TFeatures, TData>
|
|
58
|
+
globalFilteringFeature: Table_GlobalFiltering<TFeatures, TData>
|
|
59
|
+
rowExpandingFeature: Table_RowExpanding<TFeatures, TData>
|
|
60
|
+
rowPaginationFeature: Table_RowPagination<TFeatures, TData>
|
|
61
|
+
rowPinningFeature: Table_RowPinning<TFeatures, TData>
|
|
62
|
+
rowSelectionFeature: Table_RowSelection<TFeatures, TData>
|
|
63
|
+
rowSortingFeature: Table_RowSorting<TFeatures, TData>
|
|
64
|
+
}
|
|
65
|
+
|
|
55
66
|
/**
|
|
56
67
|
* The table object that includes both the core table functionality and the features that are enabled via the `features` table option.
|
|
57
68
|
*/
|
|
@@ -59,59 +70,7 @@ export type Table<
|
|
|
59
70
|
TFeatures extends TableFeatures,
|
|
60
71
|
TData extends RowData,
|
|
61
72
|
> = 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
|
-
> &
|
|
106
|
-
ExtractFeatureTypes<'Table', TFeatures> &
|
|
107
|
-
Table_Plugins<TFeatures, TData>
|
|
108
|
-
|
|
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>
|
|
73
|
+
ExtractFeatureMapTypes<TFeatures, Table_FeatureMap<TFeatures, TData>>
|
|
115
74
|
|
|
116
75
|
export type Table_Internal<
|
|
117
76
|
TFeatures extends TableFeatures,
|
|
@@ -7,144 +7,95 @@ import type { TableOptions_All } from './TableOptions'
|
|
|
7
7
|
import type { TableState_All } from './TableState'
|
|
8
8
|
import type { StockFeatures } from '../features/stockFeatures'
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
>
|
|
14
|
-
{
|
|
15
|
-
[K in keyof TFeatures]: K extends 'coreReativityFeature'
|
|
16
|
-
? never
|
|
17
|
-
: TFeatures[K] extends TableFeature<infer FeatureConstructorOptions>
|
|
18
|
-
? TKey extends keyof FeatureConstructorOptions
|
|
19
|
-
? FeatureConstructorOptions[TKey]
|
|
20
|
-
: never
|
|
21
|
-
: any
|
|
22
|
-
}[keyof TFeatures]
|
|
23
|
-
>
|
|
10
|
+
type IsAny<T> = 0 extends 1 & T ? true : false
|
|
11
|
+
type UnionToIntersectionOrEmpty<T> = [T] extends [never]
|
|
12
|
+
? {}
|
|
13
|
+
: UnionToIntersection<T> & {}
|
|
24
14
|
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
RowModelFns?: any
|
|
35
|
-
Table?: any
|
|
36
|
-
TableOptions?: any
|
|
37
|
-
TableState?: any
|
|
38
|
-
}
|
|
15
|
+
export type ExtractFeatureMapTypes<
|
|
16
|
+
TFeatures extends TableFeatures,
|
|
17
|
+
TFeatureMap extends object,
|
|
18
|
+
> =
|
|
19
|
+
IsAny<TFeatures> extends true
|
|
20
|
+
? UnionToIntersection<TFeatureMap[keyof TFeatureMap]>
|
|
21
|
+
: UnionToIntersectionOrEmpty<
|
|
22
|
+
TFeatureMap[Extract<keyof TFeatures, keyof TFeatureMap>]
|
|
23
|
+
>
|
|
39
24
|
|
|
40
25
|
export interface Plugins {}
|
|
41
26
|
|
|
42
27
|
export interface TableFeatures
|
|
43
28
|
extends Partial<CoreFeatures>, Partial<StockFeatures>, Partial<Plugins> {}
|
|
44
29
|
|
|
45
|
-
export
|
|
46
|
-
TFeatures extends TableFeatures,
|
|
47
|
-
TData extends RowData,
|
|
48
|
-
>(
|
|
49
|
-
table: Table_Internal<TFeatures, TData> &
|
|
50
|
-
Partial<TConstructors['Table']> & {
|
|
51
|
-
options: Partial<TConstructors['TableOptions']>
|
|
52
|
-
},
|
|
53
|
-
) => void
|
|
54
|
-
|
|
55
|
-
export type GetDefaultColumnDef<TConstructors extends FeatureConstructors> = <
|
|
56
|
-
TFeatures extends TableFeatures,
|
|
57
|
-
TData extends RowData,
|
|
58
|
-
TValue extends CellData = CellData,
|
|
59
|
-
>() => ColumnDefBase_All<TFeatures, TData, TValue> &
|
|
60
|
-
Partial<TConstructors['ColumnDef']>
|
|
61
|
-
|
|
62
|
-
export type GetDefaultTableOptions<TConstructors extends FeatureConstructors> =
|
|
63
|
-
<TFeatures extends TableFeatures, TData extends RowData>(
|
|
64
|
-
table: Table_Internal<TFeatures, TData> & Partial<TConstructors['Table']>,
|
|
65
|
-
) => Partial<TableOptions_All<TFeatures, TData>> &
|
|
66
|
-
Partial<TConstructors['TableOptions']>
|
|
67
|
-
|
|
68
|
-
export type GetInitialState<TConstructors extends FeatureConstructors> = (
|
|
69
|
-
initialState: Partial<TableState_All> & Partial<TConstructors['TableState']>,
|
|
70
|
-
) => TableState_All & Partial<TConstructors['TableState']>
|
|
71
|
-
|
|
72
|
-
export type GetDefaultStateSelector<TConstructors extends FeatureConstructors> =
|
|
73
|
-
(
|
|
74
|
-
state: TableState_All,
|
|
75
|
-
) => Partial<TableState_All> & Partial<TConstructors['TableState']>
|
|
76
|
-
|
|
77
|
-
export type AssignCellPrototype<TConstructors extends FeatureConstructors> = <
|
|
78
|
-
TFeatures extends TableFeatures,
|
|
79
|
-
TData extends RowData,
|
|
80
|
-
>(
|
|
81
|
-
prototype: Record<string, any>,
|
|
82
|
-
table: Table_Internal<TFeatures, TData>,
|
|
83
|
-
) => void
|
|
84
|
-
|
|
85
|
-
export type AssignColumnPrototype<TConstructors extends FeatureConstructors> = <
|
|
86
|
-
TFeatures extends TableFeatures,
|
|
87
|
-
TData extends RowData,
|
|
88
|
-
>(
|
|
89
|
-
prototype: Record<string, any>,
|
|
90
|
-
table: Table_Internal<TFeatures, TData>,
|
|
91
|
-
) => void
|
|
92
|
-
|
|
93
|
-
export type AssignHeaderPrototype<TConstructors extends FeatureConstructors> = <
|
|
94
|
-
TFeatures extends TableFeatures,
|
|
95
|
-
TData extends RowData,
|
|
96
|
-
>(
|
|
97
|
-
prototype: Record<string, any>,
|
|
98
|
-
table: Table_Internal<TFeatures, TData>,
|
|
99
|
-
) => void
|
|
100
|
-
|
|
101
|
-
export type AssignRowPrototype<TConstructors extends FeatureConstructors> = <
|
|
102
|
-
TFeatures extends TableFeatures,
|
|
103
|
-
TData extends RowData,
|
|
104
|
-
>(
|
|
105
|
-
prototype: Record<string, any>,
|
|
106
|
-
table: Table_Internal<TFeatures, TData>,
|
|
107
|
-
) => void
|
|
108
|
-
|
|
109
|
-
export type InitRowInstanceData<TConstructors extends FeatureConstructors> = <
|
|
110
|
-
TFeatures extends TableFeatures,
|
|
111
|
-
TData extends RowData,
|
|
112
|
-
>(
|
|
113
|
-
row: Row<TFeatures, TData> & Partial<TConstructors['Row']>,
|
|
114
|
-
) => void
|
|
115
|
-
|
|
116
|
-
export interface TableFeature<TConstructors extends FeatureConstructors> {
|
|
30
|
+
export interface TableFeature {
|
|
117
31
|
/**
|
|
118
32
|
* Assigns Cell APIs to the cell prototype for memory-efficient method sharing.
|
|
119
33
|
* This is called once per table to build a shared prototype for all cells.
|
|
120
34
|
*/
|
|
121
|
-
assignCellPrototype?:
|
|
35
|
+
assignCellPrototype?: <
|
|
36
|
+
TFeatures extends TableFeatures,
|
|
37
|
+
TData extends RowData,
|
|
38
|
+
>(
|
|
39
|
+
prototype: Record<string, any>,
|
|
40
|
+
table: Table_Internal<TFeatures, TData>,
|
|
41
|
+
) => void
|
|
122
42
|
/**
|
|
123
43
|
* Assigns Column APIs to the column prototype for memory-efficient method sharing.
|
|
124
44
|
* This is called once per table to build a shared prototype for all columns.
|
|
125
45
|
*/
|
|
126
|
-
assignColumnPrototype?:
|
|
46
|
+
assignColumnPrototype?: <
|
|
47
|
+
TFeatures extends TableFeatures,
|
|
48
|
+
TData extends RowData,
|
|
49
|
+
>(
|
|
50
|
+
prototype: Record<string, any>,
|
|
51
|
+
table: Table_Internal<TFeatures, TData>,
|
|
52
|
+
) => void
|
|
127
53
|
/**
|
|
128
54
|
* Assigns Header APIs to the header prototype for memory-efficient method sharing.
|
|
129
55
|
* This is called once per table to build a shared prototype for all headers.
|
|
130
56
|
*/
|
|
131
|
-
assignHeaderPrototype?:
|
|
57
|
+
assignHeaderPrototype?: <
|
|
58
|
+
TFeatures extends TableFeatures,
|
|
59
|
+
TData extends RowData,
|
|
60
|
+
>(
|
|
61
|
+
prototype: Record<string, any>,
|
|
62
|
+
table: Table_Internal<TFeatures, TData>,
|
|
63
|
+
) => void
|
|
132
64
|
/**
|
|
133
65
|
* Assigns Row APIs to the row prototype for memory-efficient method sharing.
|
|
134
66
|
* This is called once per table to build a shared prototype for all rows.
|
|
135
67
|
*/
|
|
136
|
-
assignRowPrototype?:
|
|
68
|
+
assignRowPrototype?: <TFeatures extends TableFeatures, TData extends RowData>(
|
|
69
|
+
prototype: Record<string, any>,
|
|
70
|
+
table: Table_Internal<TFeatures, TData>,
|
|
71
|
+
) => void
|
|
137
72
|
/**
|
|
138
73
|
* Assigns Table APIs to the table instance.
|
|
139
74
|
* Unlike row/cell/column/header, the table is a singleton so methods are assigned directly.
|
|
140
75
|
*/
|
|
141
|
-
constructTableAPIs?:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
76
|
+
constructTableAPIs?: <TFeatures extends TableFeatures, TData extends RowData>(
|
|
77
|
+
table: Table_Internal<TFeatures, TData>,
|
|
78
|
+
) => void
|
|
79
|
+
getDefaultColumnDef?: <
|
|
80
|
+
TFeatures extends TableFeatures,
|
|
81
|
+
TData extends RowData,
|
|
82
|
+
TValue extends CellData = CellData,
|
|
83
|
+
>() => ColumnDefBase_All<TFeatures, TData, TValue>
|
|
84
|
+
getDefaultTableOptions?: <
|
|
85
|
+
TFeatures extends TableFeatures,
|
|
86
|
+
TData extends RowData,
|
|
87
|
+
>(
|
|
88
|
+
table: Table_Internal<TFeatures, TData>,
|
|
89
|
+
) => Partial<TableOptions_All<TFeatures, TData>>
|
|
90
|
+
getInitialState?: (initialState: Partial<TableState_All>) => TableState_All
|
|
145
91
|
/**
|
|
146
92
|
* Initializes instance-specific data on each row (e.g., caches).
|
|
147
93
|
* Methods should be assigned via assignRowPrototype instead.
|
|
148
94
|
*/
|
|
149
|
-
initRowInstanceData?:
|
|
95
|
+
initRowInstanceData?: <
|
|
96
|
+
TFeatures extends TableFeatures,
|
|
97
|
+
TData extends RowData,
|
|
98
|
+
>(
|
|
99
|
+
row: Row<TFeatures, TData>,
|
|
100
|
+
) => void
|
|
150
101
|
}
|
|
@@ -17,12 +17,7 @@ import type { TableOptions_RowPinning } from '../features/row-pinning/rowPinning
|
|
|
17
17
|
import type { TableOptions_RowSelection } from '../features/row-selection/rowSelectionFeature.types'
|
|
18
18
|
import type { TableOptions_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
|
|
19
19
|
import type { RowData, UnionToIntersection } from './type-utils'
|
|
20
|
-
import type {
|
|
21
|
-
|
|
22
|
-
export interface TableOptions_Plugins<
|
|
23
|
-
TFeatures extends TableFeatures,
|
|
24
|
-
TData extends RowData,
|
|
25
|
-
> {}
|
|
20
|
+
import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
26
21
|
|
|
27
22
|
/**
|
|
28
23
|
* Core options that are always available on a table, before optional feature
|
|
@@ -52,6 +47,35 @@ export type DebugOptions<TFeatures extends TableFeatures> = {
|
|
|
52
47
|
debugTable?: boolean
|
|
53
48
|
} & DebugKeysFor<CoreFeatures & TFeatures>
|
|
54
49
|
|
|
50
|
+
export interface TableOptions_FeatureMap<
|
|
51
|
+
TFeatures extends TableFeatures,
|
|
52
|
+
TData extends RowData,
|
|
53
|
+
> {
|
|
54
|
+
columnFilteringFeature: TableOptions_ColumnFiltering<TFeatures, TData>
|
|
55
|
+
columnGroupingFeature: TableOptions_ColumnGrouping
|
|
56
|
+
columnOrderingFeature: TableOptions_ColumnOrdering
|
|
57
|
+
columnPinningFeature: TableOptions_ColumnPinning
|
|
58
|
+
columnResizingFeature: TableOptions_ColumnResizing
|
|
59
|
+
columnSizingFeature: TableOptions_ColumnSizing
|
|
60
|
+
columnVisibilityFeature: TableOptions_ColumnVisibility
|
|
61
|
+
globalFilteringFeature: TableOptions_GlobalFiltering<TFeatures, TData>
|
|
62
|
+
rowExpandingFeature: TableOptions_RowExpanding<TFeatures, TData>
|
|
63
|
+
rowPaginationFeature: TableOptions_RowPagination
|
|
64
|
+
rowPinningFeature: TableOptions_RowPinning<TFeatures, TData>
|
|
65
|
+
rowSelectionFeature: TableOptions_RowSelection<TFeatures, TData>
|
|
66
|
+
rowSortingFeature: TableOptions_RowSorting
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type TableOptions_FeatureMap_All<
|
|
70
|
+
TFeatures extends TableFeatures,
|
|
71
|
+
TData extends RowData,
|
|
72
|
+
> = UnionToIntersection<
|
|
73
|
+
TableOptions_FeatureMap<TFeatures, TData>[keyof TableOptions_FeatureMap<
|
|
74
|
+
TFeatures,
|
|
75
|
+
TData
|
|
76
|
+
>]
|
|
77
|
+
>
|
|
78
|
+
|
|
55
79
|
/**
|
|
56
80
|
* Complete table options for a specific feature set.
|
|
57
81
|
*
|
|
@@ -63,58 +87,9 @@ export type TableOptions<
|
|
|
63
87
|
TFeatures extends TableFeatures,
|
|
64
88
|
TData extends RowData,
|
|
65
89
|
> = TableOptions_Core<TFeatures, TData> &
|
|
66
|
-
|
|
67
|
-
| ('columnFilteringFeature' extends keyof TFeatures
|
|
68
|
-
? TableOptions_ColumnFiltering<TFeatures, TData>
|
|
69
|
-
: never)
|
|
70
|
-
| ('columnGroupingFeature' extends keyof TFeatures
|
|
71
|
-
? TableOptions_ColumnGrouping
|
|
72
|
-
: never)
|
|
73
|
-
| ('columnOrderingFeature' extends keyof TFeatures
|
|
74
|
-
? TableOptions_ColumnOrdering
|
|
75
|
-
: never)
|
|
76
|
-
| ('columnPinningFeature' extends keyof TFeatures
|
|
77
|
-
? TableOptions_ColumnPinning
|
|
78
|
-
: never)
|
|
79
|
-
| ('columnResizingFeature' extends keyof TFeatures
|
|
80
|
-
? TableOptions_ColumnResizing
|
|
81
|
-
: never)
|
|
82
|
-
| ('columnSizingFeature' extends keyof TFeatures
|
|
83
|
-
? TableOptions_ColumnSizing
|
|
84
|
-
: never)
|
|
85
|
-
| ('columnVisibilityFeature' extends keyof TFeatures
|
|
86
|
-
? TableOptions_ColumnVisibility
|
|
87
|
-
: never)
|
|
88
|
-
| ('globalFilteringFeature' extends keyof TFeatures
|
|
89
|
-
? TableOptions_GlobalFiltering<TFeatures, TData>
|
|
90
|
-
: never)
|
|
91
|
-
| ('rowExpandingFeature' extends keyof TFeatures
|
|
92
|
-
? TableOptions_RowExpanding<TFeatures, TData>
|
|
93
|
-
: never)
|
|
94
|
-
| ('rowPaginationFeature' extends keyof TFeatures
|
|
95
|
-
? TableOptions_RowPagination
|
|
96
|
-
: never)
|
|
97
|
-
| ('rowPinningFeature' extends keyof TFeatures
|
|
98
|
-
? TableOptions_RowPinning<TFeatures, TData>
|
|
99
|
-
: never)
|
|
100
|
-
| ('rowSelectionFeature' extends keyof TFeatures
|
|
101
|
-
? TableOptions_RowSelection<TFeatures, TData>
|
|
102
|
-
: never)
|
|
103
|
-
| ('rowSortingFeature' extends keyof TFeatures
|
|
104
|
-
? TableOptions_RowSorting
|
|
105
|
-
: never)
|
|
106
|
-
> &
|
|
107
|
-
ExtractFeatureTypes<'TableOptions', TFeatures> &
|
|
108
|
-
TableOptions_Plugins<TFeatures, TData> &
|
|
90
|
+
ExtractFeatureMapTypes<TFeatures, TableOptions_FeatureMap<TFeatures, TData>> &
|
|
109
91
|
DebugOptions<TFeatures>
|
|
110
92
|
|
|
111
|
-
// export type TableOptions<
|
|
112
|
-
// TFeatures extends TableFeatures,
|
|
113
|
-
// TData extends RowData,
|
|
114
|
-
// > = TableOptions_Core<TFeatures, TData> &
|
|
115
|
-
// ExtractFeatureTypes<'TableOptions', TFeatures> &
|
|
116
|
-
// TableOptions_Plugins<TFeatures, TData>
|
|
117
|
-
|
|
118
93
|
/**
|
|
119
94
|
* Internal broad option shape used where feature code may need to read options
|
|
120
95
|
* from features that are not present in the current generic feature set.
|
|
@@ -123,18 +98,4 @@ export type TableOptions_All<
|
|
|
123
98
|
TFeatures extends TableFeatures,
|
|
124
99
|
TData extends RowData,
|
|
125
100
|
> = TableOptions_Core<TFeatures, TData> &
|
|
126
|
-
Partial<
|
|
127
|
-
TableOptions_ColumnFiltering<TFeatures, TData> &
|
|
128
|
-
TableOptions_ColumnGrouping &
|
|
129
|
-
TableOptions_ColumnOrdering &
|
|
130
|
-
TableOptions_ColumnPinning &
|
|
131
|
-
TableOptions_ColumnResizing &
|
|
132
|
-
TableOptions_ColumnSizing &
|
|
133
|
-
TableOptions_ColumnVisibility &
|
|
134
|
-
TableOptions_GlobalFiltering<TFeatures, TData> &
|
|
135
|
-
TableOptions_RowExpanding<TFeatures, TData> &
|
|
136
|
-
TableOptions_RowPagination &
|
|
137
|
-
TableOptions_RowPinning<TFeatures, TData> &
|
|
138
|
-
TableOptions_RowSelection<TFeatures, TData> &
|
|
139
|
-
TableOptions_RowSorting
|
|
140
|
-
>
|
|
101
|
+
Partial<TableOptions_FeatureMap_All<TFeatures, TData>>
|
package/src/types/TableState.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { UnionToIntersection } from './type-utils'
|
|
2
1
|
import type { TableState_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
3
2
|
import type { TableState_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
4
3
|
import type { TableState_ColumnOrdering } from '../features/column-ordering/columnOrderingFeature.types'
|
|
@@ -12,13 +11,23 @@ import type { TableState_RowPagination } from '../features/row-pagination/rowPag
|
|
|
12
11
|
import type { TableState_RowPinning } from '../features/row-pinning/rowPinningFeature.types'
|
|
13
12
|
import type { TableState_RowSelection } from '../features/row-selection/rowSelectionFeature.types'
|
|
14
13
|
import type { TableState_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
|
|
15
|
-
import type {
|
|
14
|
+
import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export interface TableState_FeatureMap {
|
|
17
|
+
columnFilteringFeature: TableState_ColumnFiltering
|
|
18
|
+
columnGroupingFeature: TableState_ColumnGrouping
|
|
19
|
+
columnOrderingFeature: TableState_ColumnOrdering
|
|
20
|
+
columnPinningFeature: TableState_ColumnPinning
|
|
21
|
+
columnResizingFeature: TableState_ColumnResizing
|
|
22
|
+
columnSizingFeature: TableState_ColumnSizing
|
|
23
|
+
columnVisibilityFeature: TableState_ColumnVisibility
|
|
24
|
+
globalFilteringFeature: TableState_GlobalFiltering
|
|
25
|
+
rowExpandingFeature: TableState_RowExpanding
|
|
26
|
+
rowPaginationFeature: TableState_RowPagination
|
|
27
|
+
rowPinningFeature: TableState_RowPinning
|
|
28
|
+
rowSelectionFeature: TableState_RowSelection
|
|
29
|
+
rowSortingFeature: TableState_RowSorting
|
|
30
|
+
}
|
|
22
31
|
|
|
23
32
|
/**
|
|
24
33
|
* Complete table state for a specific feature set.
|
|
@@ -26,75 +35,13 @@ export interface TableState_Plugins<TFeatures extends TableFeatures> {}
|
|
|
26
35
|
* State slices are included only when their feature is present in `TFeatures`,
|
|
27
36
|
* then custom feature/plugin state is mixed in.
|
|
28
37
|
*/
|
|
29
|
-
export type TableState<TFeatures extends TableFeatures> =
|
|
30
|
-
|
|
31
|
-
? TableState_ColumnFiltering
|
|
32
|
-
: never)
|
|
33
|
-
| ('columnGroupingFeature' extends keyof TFeatures
|
|
34
|
-
? TableState_ColumnGrouping
|
|
35
|
-
: never)
|
|
36
|
-
| ('columnOrderingFeature' extends keyof TFeatures
|
|
37
|
-
? TableState_ColumnOrdering
|
|
38
|
-
: never)
|
|
39
|
-
| ('columnPinningFeature' extends keyof TFeatures
|
|
40
|
-
? TableState_ColumnPinning
|
|
41
|
-
: never)
|
|
42
|
-
| ('columnResizingFeature' extends keyof TFeatures
|
|
43
|
-
? TableState_ColumnResizing
|
|
44
|
-
: never)
|
|
45
|
-
| ('columnSizingFeature' extends keyof TFeatures
|
|
46
|
-
? TableState_ColumnSizing
|
|
47
|
-
: never)
|
|
48
|
-
| ('columnVisibilityFeature' extends keyof TFeatures
|
|
49
|
-
? TableState_ColumnVisibility
|
|
50
|
-
: never)
|
|
51
|
-
| ('globalFilteringFeature' extends keyof TFeatures
|
|
52
|
-
? TableState_GlobalFiltering
|
|
53
|
-
: never)
|
|
54
|
-
| ('rowExpandingFeature' extends keyof TFeatures
|
|
55
|
-
? TableState_RowExpanding
|
|
56
|
-
: never)
|
|
57
|
-
| ('rowPaginationFeature' extends keyof TFeatures
|
|
58
|
-
? TableState_RowPagination
|
|
59
|
-
: never)
|
|
60
|
-
| ('rowPinningFeature' extends keyof TFeatures
|
|
61
|
-
? TableState_RowPinning
|
|
62
|
-
: never)
|
|
63
|
-
| ('rowSelectionFeature' extends keyof TFeatures
|
|
64
|
-
? TableState_RowSelection
|
|
65
|
-
: never)
|
|
66
|
-
| ('rowSortingFeature' extends keyof TFeatures
|
|
67
|
-
? TableState_RowSorting
|
|
68
|
-
: never)
|
|
69
|
-
> &
|
|
70
|
-
ExtractFeatureTypes<'TableState', TFeatures> &
|
|
71
|
-
TableState_Plugins<TFeatures>
|
|
72
|
-
|
|
73
|
-
// export type TableState<TFeatures extends TableFeatures> = ExtractFeatureTypes<
|
|
74
|
-
// export type TableState<TFeatures extends TableFeatures> = ExtractFeatureTypes<
|
|
75
|
-
// 'TableState',
|
|
76
|
-
// TFeatures
|
|
77
|
-
// > &
|
|
78
|
-
// TableState_Plugins<TFeatures>
|
|
38
|
+
export type TableState<TFeatures extends TableFeatures> =
|
|
39
|
+
ExtractFeatureMapTypes<TFeatures, TableState_FeatureMap>
|
|
79
40
|
|
|
80
41
|
/**
|
|
81
|
-
* Internal broad state shape containing every
|
|
42
|
+
* Internal broad state shape containing every registered feature state slice.
|
|
82
43
|
*
|
|
83
44
|
* Feature internals use this when they may need to inspect optional slices owned
|
|
84
45
|
* by other features.
|
|
85
46
|
*/
|
|
86
|
-
export type TableState_All = Partial<
|
|
87
|
-
TableState_ColumnFiltering &
|
|
88
|
-
TableState_ColumnGrouping &
|
|
89
|
-
TableState_ColumnOrdering &
|
|
90
|
-
TableState_ColumnPinning &
|
|
91
|
-
TableState_ColumnResizing &
|
|
92
|
-
TableState_ColumnSizing &
|
|
93
|
-
TableState_ColumnVisibility &
|
|
94
|
-
TableState_GlobalFiltering &
|
|
95
|
-
TableState_RowExpanding &
|
|
96
|
-
TableState_RowPagination &
|
|
97
|
-
TableState_RowPinning &
|
|
98
|
-
TableState_RowSelection &
|
|
99
|
-
TableState_RowSorting
|
|
100
|
-
>
|
|
47
|
+
export type TableState_All = Partial<TableState<TableFeatures>>
|
package/src/utils.ts
CHANGED
|
@@ -427,13 +427,14 @@ export function assignPrototypeAPIs<
|
|
|
427
427
|
*/
|
|
428
428
|
export function callMemoOrStaticFn<
|
|
429
429
|
TObject extends Record<string, any>,
|
|
430
|
-
|
|
430
|
+
TArgs extends Array<any>,
|
|
431
|
+
TReturn,
|
|
431
432
|
>(
|
|
432
433
|
obj: TObject,
|
|
433
434
|
fnKey: string,
|
|
434
|
-
staticFn:
|
|
435
|
-
...args:
|
|
436
|
-
):
|
|
435
|
+
staticFn: (obj: TObject, ...args: TArgs) => TReturn,
|
|
436
|
+
...args: TArgs
|
|
437
|
+
): TReturn {
|
|
437
438
|
return (
|
|
438
439
|
(obj[fnKey] as Function | undefined)?.(...args) ?? staticFn(obj, ...args)
|
|
439
440
|
)
|