@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/fns/sortFns.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { RowData } from '../types/type-utils'
|
|
2
2
|
import type { TableFeatures } from '../types/TableFeatures'
|
|
3
3
|
import type { Row } from '../types/Row'
|
|
4
|
-
import type { SortFn } from '../features/row-sorting/rowSortingFeature.types'
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Regular expression used to split mixed text and numeric chunks.
|
|
@@ -16,12 +15,12 @@ export const reSplitAlphaNumeric = /([0-9]+)/gm
|
|
|
16
15
|
*
|
|
17
16
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
18
17
|
*/
|
|
19
|
-
export const sortFn_alphanumeric
|
|
18
|
+
export const sortFn_alphanumeric = <
|
|
20
19
|
TFeatures extends TableFeatures,
|
|
21
20
|
TData extends RowData,
|
|
22
21
|
>(
|
|
23
|
-
rowA: Row<
|
|
24
|
-
rowB: Row<
|
|
22
|
+
rowA: Row<TFeatures, TData>,
|
|
23
|
+
rowB: Row<TFeatures, TData>,
|
|
25
24
|
columnId: string,
|
|
26
25
|
) => {
|
|
27
26
|
return compareAlphanumeric(
|
|
@@ -35,12 +34,12 @@ export const sortFn_alphanumeric: SortFn<any, any> = <
|
|
|
35
34
|
*
|
|
36
35
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
37
36
|
*/
|
|
38
|
-
export const sortFn_alphanumericCaseSensitive
|
|
37
|
+
export const sortFn_alphanumericCaseSensitive = <
|
|
39
38
|
TFeatures extends TableFeatures,
|
|
40
39
|
TData extends RowData,
|
|
41
40
|
>(
|
|
42
|
-
rowA: Row<
|
|
43
|
-
rowB: Row<
|
|
41
|
+
rowA: Row<TFeatures, TData>,
|
|
42
|
+
rowB: Row<TFeatures, TData>,
|
|
44
43
|
columnId: string,
|
|
45
44
|
) => {
|
|
46
45
|
return compareAlphanumeric(
|
|
@@ -56,12 +55,12 @@ export const sortFn_alphanumericCaseSensitive: SortFn<any, any> = <
|
|
|
56
55
|
*
|
|
57
56
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
58
57
|
*/
|
|
59
|
-
export const sortFn_text
|
|
58
|
+
export const sortFn_text = <
|
|
60
59
|
TFeatures extends TableFeatures,
|
|
61
60
|
TData extends RowData,
|
|
62
61
|
>(
|
|
63
|
-
rowA: Row<
|
|
64
|
-
rowB: Row<
|
|
62
|
+
rowA: Row<TFeatures, TData>,
|
|
63
|
+
rowB: Row<TFeatures, TData>,
|
|
65
64
|
columnId: string,
|
|
66
65
|
) => {
|
|
67
66
|
return compareBasic(
|
|
@@ -77,12 +76,12 @@ export const sortFn_text: SortFn<any, any> = <
|
|
|
77
76
|
*
|
|
78
77
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
79
78
|
*/
|
|
80
|
-
export const sortFn_textCaseSensitive
|
|
79
|
+
export const sortFn_textCaseSensitive = <
|
|
81
80
|
TFeatures extends TableFeatures,
|
|
82
81
|
TData extends RowData,
|
|
83
82
|
>(
|
|
84
|
-
rowA: Row<
|
|
85
|
-
rowB: Row<
|
|
83
|
+
rowA: Row<TFeatures, TData>,
|
|
84
|
+
rowB: Row<TFeatures, TData>,
|
|
86
85
|
columnId: string,
|
|
87
86
|
) => {
|
|
88
87
|
return compareBasic(
|
|
@@ -96,12 +95,12 @@ export const sortFn_textCaseSensitive: SortFn<any, any> = <
|
|
|
96
95
|
*
|
|
97
96
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
98
97
|
*/
|
|
99
|
-
export const sortFn_datetime
|
|
98
|
+
export const sortFn_datetime = <
|
|
100
99
|
TFeatures extends TableFeatures,
|
|
101
100
|
TData extends RowData,
|
|
102
101
|
>(
|
|
103
|
-
rowA: Row<
|
|
104
|
-
rowB: Row<
|
|
102
|
+
rowA: Row<TFeatures, TData>,
|
|
103
|
+
rowB: Row<TFeatures, TData>,
|
|
105
104
|
columnId: string,
|
|
106
105
|
) => {
|
|
107
106
|
const a: number | string = rowA.getValue(columnId)
|
|
@@ -118,12 +117,12 @@ export const sortFn_datetime: SortFn<any, any> = <
|
|
|
118
117
|
*
|
|
119
118
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
120
119
|
*/
|
|
121
|
-
export const sortFn_basic
|
|
120
|
+
export const sortFn_basic = <
|
|
122
121
|
TFeatures extends TableFeatures,
|
|
123
122
|
TData extends RowData,
|
|
124
123
|
>(
|
|
125
|
-
rowA: Row<
|
|
126
|
-
rowB: Row<
|
|
124
|
+
rowA: Row<TFeatures, TData>,
|
|
125
|
+
rowB: Row<TFeatures, TData>,
|
|
127
126
|
columnId: string,
|
|
128
127
|
) => {
|
|
129
128
|
return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId))
|
package/src/types/Cell.ts
CHANGED
|
@@ -1,41 +1,21 @@
|
|
|
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 { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
4
4
|
import type { Cell_Cell } from '../core/cells/coreCellsFeature.types'
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
8
|
-
* Note: This will affect the types of all tables in your project.
|
|
9
|
-
*/
|
|
10
|
-
export interface Cell_Plugins<
|
|
11
|
-
TFeatures extends TableFeatures,
|
|
12
|
-
TData extends RowData,
|
|
13
|
-
TValue extends CellData = CellData,
|
|
14
|
-
> {}
|
|
15
|
-
|
|
16
6
|
export interface Cell_Core<
|
|
17
7
|
TFeatures extends TableFeatures,
|
|
18
8
|
TData extends RowData,
|
|
19
9
|
TValue extends CellData = CellData,
|
|
20
10
|
> extends Cell_Cell<TFeatures, TData, TValue> {}
|
|
21
11
|
|
|
12
|
+
export interface Cell_FeatureMap {
|
|
13
|
+
columnGroupingFeature: Cell_ColumnGrouping
|
|
14
|
+
}
|
|
15
|
+
|
|
22
16
|
export type Cell<
|
|
23
17
|
TFeatures extends TableFeatures,
|
|
24
18
|
TData extends RowData,
|
|
25
19
|
TValue extends CellData = CellData,
|
|
26
|
-
> =
|
|
27
|
-
|
|
28
|
-
'columnGroupingFeature' extends keyof TFeatures
|
|
29
|
-
? Cell_ColumnGrouping
|
|
30
|
-
: never
|
|
31
|
-
> &
|
|
32
|
-
ExtractFeatureTypes<'Cell', TFeatures> &
|
|
33
|
-
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>
|
|
20
|
+
> = Cell_Core<TFeatures, TData, TValue> &
|
|
21
|
+
ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap>
|
package/src/types/Column.ts
CHANGED
|
@@ -9,73 +9,38 @@ 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 { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
14
14
|
import type { Column_Column } from '../core/columns/coreColumnsFeature.types'
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
18
|
-
* Note: This will affect the types of all tables in your project.
|
|
19
|
-
*/
|
|
20
|
-
export interface Column_Plugins<
|
|
16
|
+
export interface Column_Core<
|
|
21
17
|
TFeatures extends TableFeatures,
|
|
22
18
|
TData extends RowData,
|
|
23
19
|
TValue = unknown,
|
|
24
|
-
> {}
|
|
20
|
+
> extends Column_Column<TFeatures, TData, TValue> {}
|
|
25
21
|
|
|
26
|
-
export interface
|
|
22
|
+
export interface Column_FeatureMap<
|
|
27
23
|
TFeatures extends TableFeatures,
|
|
28
24
|
TData extends RowData,
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
> {
|
|
26
|
+
columnFacetingFeature: Column_ColumnFaceting<TFeatures, TData>
|
|
27
|
+
columnFilteringFeature: Column_ColumnFiltering<TFeatures, TData>
|
|
28
|
+
columnGroupingFeature: Column_ColumnGrouping<TFeatures, TData>
|
|
29
|
+
columnOrderingFeature: Column_ColumnOrdering
|
|
30
|
+
columnPinningFeature: Column_ColumnPinning
|
|
31
|
+
columnResizingFeature: Column_ColumnResizing
|
|
32
|
+
columnSizingFeature: Column_ColumnSizing
|
|
33
|
+
columnVisibilityFeature: Column_ColumnVisibility
|
|
34
|
+
globalFilteringFeature: Column_GlobalFiltering
|
|
35
|
+
rowSortingFeature: Column_RowSorting<TFeatures, TData>
|
|
36
|
+
}
|
|
31
37
|
|
|
32
38
|
export type Column<
|
|
33
39
|
TFeatures extends TableFeatures,
|
|
34
40
|
TData extends RowData,
|
|
35
41
|
TValue = unknown,
|
|
36
42
|
> = 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
|
-
> &
|
|
69
|
-
ExtractFeatureTypes<'Column', TFeatures> &
|
|
70
|
-
Column_Plugins<TFeatures, TData, TValue>
|
|
71
|
-
|
|
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>
|
|
43
|
+
ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>>
|
|
79
44
|
|
|
80
45
|
export type Column_Internal<
|
|
81
46
|
TFeatures extends TableFeatures,
|
package/src/types/ColumnDef.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CellData, RowData, UnionToIntersection } from './type-utils'
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
3
3
|
import type { CellContext } from '../core/cells/coreCellsFeature.types'
|
|
4
4
|
import type { HeaderContext } from '../core/headers/coreHeadersFeature.types'
|
|
5
5
|
import type { ColumnDef_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
@@ -11,16 +11,6 @@ import type { ColumnDef_ColumnVisibility } from '../features/column-visibility/c
|
|
|
11
11
|
import type { ColumnDef_GlobalFiltering } from '../features/global-filtering/globalFilteringFeature.types'
|
|
12
12
|
import type { ColumnDef_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
16
|
-
* Note: This will affect the types of all tables in your project.
|
|
17
|
-
*/
|
|
18
|
-
export interface ColumnDef_Plugins<
|
|
19
|
-
TFeatures extends TableFeatures,
|
|
20
|
-
TData extends RowData,
|
|
21
|
-
TValue extends CellData = CellData,
|
|
22
|
-
> {}
|
|
23
|
-
|
|
24
14
|
export interface ColumnMeta<
|
|
25
15
|
TFeatures extends TableFeatures,
|
|
26
16
|
TData extends RowData,
|
|
@@ -110,47 +100,30 @@ interface ColumnDefBase_Core<
|
|
|
110
100
|
meta?: ColumnMeta<TFeatures, TData, TValue>
|
|
111
101
|
}
|
|
112
102
|
|
|
103
|
+
export interface ColumnDef_FeatureMap<
|
|
104
|
+
TFeatures extends TableFeatures,
|
|
105
|
+
TData extends RowData,
|
|
106
|
+
TValue extends CellData,
|
|
107
|
+
> {
|
|
108
|
+
columnVisibilityFeature: ColumnDef_ColumnVisibility
|
|
109
|
+
columnPinningFeature: ColumnDef_ColumnPinning
|
|
110
|
+
columnFilteringFeature: ColumnDef_ColumnFiltering<TFeatures, TData>
|
|
111
|
+
globalFilteringFeature: ColumnDef_GlobalFiltering
|
|
112
|
+
rowSortingFeature: ColumnDef_RowSorting<TFeatures, TData>
|
|
113
|
+
columnGroupingFeature: ColumnDef_ColumnGrouping<TFeatures, TData, TValue>
|
|
114
|
+
columnSizingFeature: ColumnDef_ColumnSizing
|
|
115
|
+
columnResizingFeature: ColumnDef_ColumnResizing
|
|
116
|
+
}
|
|
117
|
+
|
|
113
118
|
export type ColumnDefBase<
|
|
114
119
|
TFeatures extends TableFeatures,
|
|
115
120
|
TData extends RowData,
|
|
116
121
|
TValue extends CellData = CellData,
|
|
117
122
|
> = ColumnDefBase_Core<TFeatures, TData, TValue> &
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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)
|
|
143
|
-
> &
|
|
144
|
-
ExtractFeatureTypes<'ColumnDef', TFeatures> &
|
|
145
|
-
ColumnDef_Plugins<TFeatures, TData, TValue>
|
|
146
|
-
|
|
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>
|
|
123
|
+
ExtractFeatureMapTypes<
|
|
124
|
+
TFeatures,
|
|
125
|
+
ColumnDef_FeatureMap<TFeatures, TData, TValue>
|
|
126
|
+
>
|
|
154
127
|
|
|
155
128
|
export type ColumnDefBase_All<
|
|
156
129
|
TFeatures extends TableFeatures,
|
package/src/types/Header.ts
CHANGED
|
@@ -1,45 +1,23 @@
|
|
|
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 { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
4
4
|
import type { Header_Header } from '../core/headers/coreHeadersFeature.types'
|
|
5
5
|
import type { Header_ColumnResizing } from '../features/column-resizing/columnResizingFeature.types'
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
9
|
-
* Note: This will affect the types of all tables in your project.
|
|
10
|
-
*/
|
|
11
|
-
export interface Header_Plugins<
|
|
12
|
-
TFeatures extends TableFeatures,
|
|
13
|
-
TData extends RowData,
|
|
14
|
-
TValue extends CellData = CellData,
|
|
15
|
-
> {}
|
|
16
|
-
|
|
17
7
|
export interface Header_Core<
|
|
18
8
|
TFeatures extends TableFeatures,
|
|
19
9
|
TData extends RowData,
|
|
20
10
|
TValue extends CellData = CellData,
|
|
21
11
|
> extends Header_Header<TFeatures, TData, TValue> {}
|
|
22
12
|
|
|
13
|
+
export interface Header_FeatureMap {
|
|
14
|
+
columnSizingFeature: Header_ColumnSizing
|
|
15
|
+
columnResizingFeature: Header_ColumnResizing
|
|
16
|
+
}
|
|
17
|
+
|
|
23
18
|
export type Header<
|
|
24
19
|
TFeatures extends TableFeatures,
|
|
25
20
|
TData extends RowData,
|
|
26
21
|
TValue extends CellData = CellData,
|
|
27
22
|
> = 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
|
-
> &
|
|
36
|
-
ExtractFeatureTypes<'Header', TFeatures> &
|
|
37
|
-
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>
|
|
23
|
+
ExtractFeatureMapTypes<TFeatures, Header_FeatureMap>
|
package/src/types/HeaderGroup.ts
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import type { HeaderGroup_Header } from '../core/headers/coreHeadersFeature.types'
|
|
2
|
-
import type {
|
|
2
|
+
import type { TableFeatures } from './TableFeatures'
|
|
3
3
|
import type { RowData } from './type-utils'
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
7
|
-
* Note: This will affect the types of all tables in your project.
|
|
8
|
-
*/
|
|
9
|
-
export interface HeaderGroup_Plugins<
|
|
10
|
-
TFeatures extends TableFeatures,
|
|
11
|
-
TData extends RowData,
|
|
12
|
-
> {}
|
|
13
|
-
|
|
14
5
|
export interface HeaderGroup_Core<
|
|
15
6
|
TFeatures extends TableFeatures,
|
|
16
7
|
TData extends RowData,
|
|
@@ -19,6 +10,4 @@ export interface HeaderGroup_Core<
|
|
|
19
10
|
export type HeaderGroup<
|
|
20
11
|
TFeatures extends TableFeatures,
|
|
21
12
|
TData extends RowData,
|
|
22
|
-
> = HeaderGroup_Core<TFeatures, TData>
|
|
23
|
-
ExtractFeatureTypes<'HeaderGroup', TFeatures> &
|
|
24
|
-
HeaderGroup_Plugins<TFeatures, TData>
|
|
13
|
+
> = HeaderGroup_Core<TFeatures, TData>
|
package/src/types/Row.ts
CHANGED
|
@@ -2,54 +2,33 @@ 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 { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
10
10
|
import type { Row_Row } from '../core/rows/coreRowsFeature.types'
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
14
|
-
* Note: This will affect the types of all tables in your project.
|
|
15
|
-
*/
|
|
16
|
-
export interface Row_Plugins<
|
|
12
|
+
export interface Row_Core<
|
|
17
13
|
TFeatures extends TableFeatures,
|
|
18
14
|
TData extends RowData,
|
|
19
|
-
> {}
|
|
15
|
+
> extends Row_Row<TFeatures, TData> {}
|
|
20
16
|
|
|
21
|
-
export interface
|
|
17
|
+
export interface Row_FeatureMap<
|
|
22
18
|
TFeatures extends TableFeatures,
|
|
23
19
|
TData extends RowData,
|
|
24
|
-
>
|
|
20
|
+
> {
|
|
21
|
+
columnFilteringFeature: Row_ColumnFiltering<TFeatures, TData>
|
|
22
|
+
columnGroupingFeature: Row_ColumnGrouping
|
|
23
|
+
columnPinningFeature: Row_ColumnPinning<TFeatures, TData>
|
|
24
|
+
columnVisibilityFeature: Row_ColumnVisibility<TFeatures, TData>
|
|
25
|
+
rowExpandingFeature: Row_RowExpanding
|
|
26
|
+
rowPinningFeature: Row_RowPinning
|
|
27
|
+
rowSelectionFeature: Row_RowSelection
|
|
28
|
+
}
|
|
25
29
|
|
|
26
30
|
export type Row<
|
|
27
31
|
TFeatures extends TableFeatures,
|
|
28
32
|
TData extends RowData,
|
|
29
33
|
> = 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
|
-
ExtractFeatureTypes<'Row', TFeatures> &
|
|
48
|
-
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>
|
|
34
|
+
ExtractFeatureMapTypes<TFeatures, Row_FeatureMap<TFeatures, TData>>
|
package/src/types/RowModel.ts
CHANGED
|
@@ -27,51 +27,29 @@ 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 { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
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 CreateRowModels_Plugins<
|
|
33
|
+
export interface CreateRowModels_FeatureMap<
|
|
38
34
|
TFeatures extends TableFeatures,
|
|
39
35
|
TData extends RowData,
|
|
40
|
-
> {
|
|
36
|
+
> {
|
|
37
|
+
columnFacetingFeature: CreateRowModel_Faceted<TFeatures, TData>
|
|
38
|
+
columnFilteringFeature: CreateRowModel_Filtered<TFeatures, TData>
|
|
39
|
+
rowExpandingFeature: CreateRowModel_Expanded<TFeatures, TData>
|
|
40
|
+
columnGroupingFeature: CreateRowModel_Grouped<TFeatures, TData>
|
|
41
|
+
rowPaginationFeature: CreateRowModel_Paginated<TFeatures, TData>
|
|
42
|
+
rowSortingFeature: CreateRowModel_Sorted<TFeatures, TData>
|
|
43
|
+
}
|
|
41
44
|
|
|
42
45
|
export type CreateRowModels<
|
|
43
46
|
TFeatures extends TableFeatures,
|
|
44
47
|
TData extends RowData,
|
|
45
48
|
> = CreateRowModel_Core<TFeatures, TData> &
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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)
|
|
65
|
-
> &
|
|
66
|
-
ExtractFeatureTypes<'CreateRowModels', TFeatures> &
|
|
67
|
-
CreateRowModels_Plugins<TFeatures, TData>
|
|
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>
|
|
49
|
+
ExtractFeatureMapTypes<
|
|
50
|
+
TFeatures,
|
|
51
|
+
CreateRowModels_FeatureMap<TFeatures, TData>
|
|
52
|
+
>
|
|
75
53
|
|
|
76
54
|
export type CreateRowModels_All<
|
|
77
55
|
TFeatures extends TableFeatures,
|
|
@@ -84,44 +62,27 @@ export type CreateRowModels_All<
|
|
|
84
62
|
CreateRowModel_Paginated<TFeatures, TData> &
|
|
85
63
|
CreateRowModel_Sorted<TFeatures, TData>
|
|
86
64
|
|
|
87
|
-
export interface
|
|
65
|
+
export interface CachedRowModels_FeatureMap<
|
|
88
66
|
TFeatures extends TableFeatures,
|
|
89
67
|
TData extends RowData,
|
|
90
|
-
> {
|
|
68
|
+
> {
|
|
69
|
+
columnFacetingFeature: CachedRowModel_Faceted<TFeatures, TData>
|
|
70
|
+
columnFilteringFeature: CachedRowModel_Filtered<TFeatures, TData>
|
|
71
|
+
rowExpandingFeature: CachedRowModel_Expanded<TFeatures, TData>
|
|
72
|
+
columnGroupingFeature: CachedRowModel_Grouped<TFeatures, TData>
|
|
73
|
+
rowPaginationFeature: CachedRowModel_Paginated<TFeatures, TData>
|
|
74
|
+
rowSortingFeature: CachedRowModel_Sorted<TFeatures, TData>
|
|
75
|
+
}
|
|
91
76
|
|
|
92
77
|
export type CachedRowModels<
|
|
93
78
|
TFeatures extends TableFeatures,
|
|
94
79
|
TData extends RowData,
|
|
95
80
|
> = {
|
|
96
81
|
CachedRowModel_Core: () => RowModel<TFeatures, TData>
|
|
97
|
-
} &
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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)
|
|
116
|
-
> &
|
|
117
|
-
ExtractFeatureTypes<'CachedRowModel', TFeatures> &
|
|
118
|
-
CachedRowModels_Plugins<TFeatures, TData>
|
|
119
|
-
|
|
120
|
-
// export type CachedRowModels<
|
|
121
|
-
// TFeatures extends TableFeatures,
|
|
122
|
-
// TData extends RowData,
|
|
123
|
-
// > = ExtractFeatureTypes<'CachedRowModel', TFeatures> &
|
|
124
|
-
// CachedRowModels_Plugins<TFeatures, TData>
|
|
82
|
+
} & ExtractFeatureMapTypes<
|
|
83
|
+
TFeatures,
|
|
84
|
+
CachedRowModels_FeatureMap<TFeatures, TData>
|
|
85
|
+
>
|
|
125
86
|
|
|
126
87
|
export type CachedRowModel_All<
|
|
127
88
|
TFeatures extends TableFeatures,
|
package/src/types/RowModelFns.ts
CHANGED
|
@@ -1,46 +1,27 @@
|
|
|
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 { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
export interface RowModelFns_Plugins<
|
|
7
|
+
export interface RowModelFns_Core {}
|
|
8
|
+
|
|
9
|
+
export interface RowModelFns_FeatureMap<
|
|
12
10
|
TFeatures extends TableFeatures,
|
|
13
11
|
TData extends RowData,
|
|
14
|
-
> {
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
> {
|
|
13
|
+
columnFilteringFeature: RowModelFns_ColumnFiltering<TFeatures, TData>
|
|
14
|
+
columnGroupingFeature: RowModelFns_ColumnGrouping<TFeatures, TData>
|
|
15
|
+
rowSortingFeature: RowModelFns_RowSorting<TFeatures, TData>
|
|
16
|
+
}
|
|
17
17
|
|
|
18
18
|
export type RowModelFns<
|
|
19
19
|
TFeatures extends TableFeatures,
|
|
20
20
|
TData extends RowData,
|
|
21
21
|
> = 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
|
-
> &
|
|
33
|
-
ExtractFeatureTypes<'RowModelFns', TFeatures> &
|
|
34
|
-
RowModelFns_Plugins<TFeatures, TData>
|
|
22
|
+
ExtractFeatureMapTypes<TFeatures, RowModelFns_FeatureMap<TFeatures, TData>>
|
|
35
23
|
>
|
|
36
24
|
|
|
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
25
|
export type RowModelFns_All<
|
|
45
26
|
TFeatures extends TableFeatures,
|
|
46
27
|
TData extends RowData,
|