@tanstack/table-core 9.0.0-beta.2 → 9.0.0-beta.7
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/features/row-sorting/rowSortingFeature.utils.cjs +8 -5
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.js +8 -5
- package/dist/features/row-sorting/rowSortingFeature.utils.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 +18 -6
- 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 +18 -6
- 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 +3 -8
- package/dist/types/Cell.d.ts +3 -8
- package/dist/types/Column.d.cts +3 -8
- package/dist/types/Column.d.ts +3 -8
- package/dist/types/ColumnDef.d.cts +3 -8
- package/dist/types/ColumnDef.d.ts +3 -8
- package/dist/types/Header.d.cts +3 -8
- package/dist/types/Header.d.ts +3 -8
- package/dist/types/HeaderGroup.d.cts +3 -8
- package/dist/types/HeaderGroup.d.ts +3 -8
- package/dist/types/Row.d.cts +3 -8
- package/dist/types/Row.d.ts +3 -8
- package/dist/types/RowModel.d.cts +4 -10
- package/dist/types/RowModel.d.ts +4 -10
- package/dist/types/RowModelFns.d.cts +3 -8
- package/dist/types/RowModelFns.d.ts +3 -8
- package/dist/types/Table.d.cts +3 -8
- package/dist/types/Table.d.ts +3 -8
- package/dist/types/TableFeatures.d.cts +13 -39
- package/dist/types/TableFeatures.d.ts +13 -39
- package/dist/types/TableOptions.d.cts +3 -4
- package/dist/types/TableOptions.d.ts +3 -4
- package/dist/types/TableState.d.cts +5 -10
- package/dist/types/TableState.d.ts +5 -10
- 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/features/row-sorting/rowSortingFeature.utils.ts +8 -6
- package/src/fns/aggregationFns.ts +26 -42
- package/src/fns/filterFns.ts +231 -264
- package/src/fns/sortFns.ts +51 -29
- package/src/types/Cell.ts +3 -19
- package/src/types/Column.ts +2 -18
- package/src/types/ColumnDef.ts +2 -18
- package/src/types/Header.ts +2 -18
- package/src/types/HeaderGroup.ts +2 -13
- package/src/types/Row.ts +2 -17
- package/src/types/RowModel.ts +3 -25
- package/src/types/RowModelFns.ts +2 -17
- package/src/types/Table.ts +2 -17
- package/src/types/TableFeatures.ts +51 -112
- package/src/types/TableOptions.ts +1 -12
- package/src/types/TableState.ts +4 -30
- package/src/utils.ts +5 -4
|
@@ -16,114 +16,82 @@ import {
|
|
|
16
16
|
table_resetRowPinning,
|
|
17
17
|
table_setRowPinning,
|
|
18
18
|
} from './rowPinningFeature.utils'
|
|
19
|
-
import type {
|
|
20
|
-
import type { TableFeature, TableFeatures } from '../../types/TableFeatures'
|
|
21
|
-
// import type {
|
|
22
|
-
// Row_RowPinning,
|
|
23
|
-
// TableOptions_RowPinning,
|
|
24
|
-
// TableState_RowPinning,
|
|
25
|
-
// Table_RowPinning,
|
|
26
|
-
// } from './rowPinningFeature.types'
|
|
27
|
-
|
|
28
|
-
export interface RowPinningFeatureConstructors<
|
|
29
|
-
TFeatures extends TableFeatures,
|
|
30
|
-
TData extends RowData,
|
|
31
|
-
> {
|
|
32
|
-
// Row: Row_RowPinning
|
|
33
|
-
// Table: Table_RowPinning<TFeatures, RowData>
|
|
34
|
-
// TableOptions: TableOptions_RowPinning<TFeatures, RowData>
|
|
35
|
-
// TableState: TableState_RowPinning
|
|
36
|
-
}
|
|
19
|
+
import type { TableFeature } from '../../types/TableFeatures'
|
|
37
20
|
|
|
38
21
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
22
|
+
* Feature that adds row pinning state and APIs for top, center, and bottom rows.
|
|
42
23
|
*/
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
...initialState.rowPinning,
|
|
54
|
-
},
|
|
55
|
-
}
|
|
56
|
-
},
|
|
24
|
+
export const rowPinningFeature: TableFeature = {
|
|
25
|
+
getInitialState: (initialState) => {
|
|
26
|
+
return {
|
|
27
|
+
...initialState,
|
|
28
|
+
rowPinning: {
|
|
29
|
+
...getDefaultRowPinningState(),
|
|
30
|
+
...initialState.rowPinning,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
},
|
|
57
34
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
35
|
+
getDefaultTableOptions: (table) => {
|
|
36
|
+
return {
|
|
37
|
+
onRowPinningChange: makeStateUpdater('rowPinning', table),
|
|
38
|
+
}
|
|
39
|
+
},
|
|
63
40
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
41
|
+
assignRowPrototype: (prototype, table) => {
|
|
42
|
+
assignPrototypeAPIs('rowPinningFeature', prototype, table, {
|
|
43
|
+
row_getCanPin: {
|
|
44
|
+
fn: (row) => row_getCanPin(row),
|
|
45
|
+
},
|
|
46
|
+
row_getIsPinned: {
|
|
47
|
+
fn: (row) => row_getIsPinned(row),
|
|
48
|
+
},
|
|
49
|
+
row_getPinnedIndex: {
|
|
50
|
+
fn: (row) => row_getPinnedIndex(row),
|
|
51
|
+
memoDeps: (row) => [
|
|
52
|
+
row.table.getRowModel().rows,
|
|
53
|
+
row.table.atoms.rowPinning?.get(),
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
row_pin: {
|
|
57
|
+
fn: (row, position, includeLeafRows, includeParentRows) =>
|
|
58
|
+
row_pin(row, position, includeLeafRows, includeParentRows),
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
},
|
|
85
62
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
63
|
+
constructTableAPIs: (table) => {
|
|
64
|
+
assignTableAPIs('rowPinningFeature', table, {
|
|
65
|
+
table_setRowPinning: {
|
|
66
|
+
fn: (updater) => table_setRowPinning(table, updater),
|
|
67
|
+
},
|
|
68
|
+
table_resetRowPinning: {
|
|
69
|
+
fn: (defaultState) => table_resetRowPinning(table, defaultState),
|
|
70
|
+
},
|
|
71
|
+
table_getIsSomeRowsPinned: {
|
|
72
|
+
fn: (position) => table_getIsSomeRowsPinned(table, position),
|
|
73
|
+
},
|
|
74
|
+
table_getTopRows: {
|
|
75
|
+
fn: () => table_getTopRows(table),
|
|
76
|
+
memoDeps: () => [
|
|
77
|
+
table.getRowModel().rows,
|
|
78
|
+
table.atoms.rowPinning?.get()?.top,
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
table_getBottomRows: {
|
|
82
|
+
fn: () => table_getBottomRows(table),
|
|
83
|
+
memoDeps: () => [
|
|
84
|
+
table.getRowModel().rows,
|
|
85
|
+
table.atoms.rowPinning?.get()?.bottom,
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
table_getCenterRows: {
|
|
89
|
+
fn: () => table_getCenterRows(table),
|
|
90
|
+
memoDeps: () => [
|
|
91
|
+
table.getRowModel().rows,
|
|
92
|
+
table.atoms.rowPinning?.get(),
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
},
|
|
121
97
|
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The stock row pinning feature.
|
|
125
|
-
*
|
|
126
|
-
* Register this feature to add row pinning state and APIs for deriving top,
|
|
127
|
-
* center, and bottom row regions.
|
|
128
|
-
*/
|
|
129
|
-
export const rowPinningFeature = constructRowPinningFeature()
|
|
@@ -28,145 +28,113 @@ import {
|
|
|
28
28
|
table_toggleAllPageRowsSelected,
|
|
29
29
|
table_toggleAllRowsSelected,
|
|
30
30
|
} from './rowSelectionFeature.utils'
|
|
31
|
-
import type {
|
|
32
|
-
import type { TableFeature, TableFeatures } from '../../types/TableFeatures'
|
|
33
|
-
// import type {
|
|
34
|
-
// Row_RowSelection,
|
|
35
|
-
// TableOptions_RowSelection,
|
|
36
|
-
// TableState_RowSelection,
|
|
37
|
-
// Table_RowSelection,
|
|
38
|
-
// } from './rowSelectionFeature.types'
|
|
39
|
-
|
|
40
|
-
export interface RowSelectionFeatureConstructors<
|
|
41
|
-
TFeatures extends TableFeatures,
|
|
42
|
-
TData extends RowData,
|
|
43
|
-
> {
|
|
44
|
-
// Row: Row_RowSelection
|
|
45
|
-
// Table: Table_RowSelection<TFeatures, TData>
|
|
46
|
-
// TableOptions: TableOptions_RowSelection<TFeatures, TData>
|
|
47
|
-
// TableState: TableState_RowSelection
|
|
48
|
-
}
|
|
31
|
+
import type { TableFeature } from '../../types/TableFeatures'
|
|
49
32
|
|
|
50
33
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
34
|
+
* Feature that adds row selection state and APIs for row and page selection.
|
|
54
35
|
*/
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
rowSelection: getDefaultRowSelectionState(),
|
|
63
|
-
...initialState,
|
|
64
|
-
}
|
|
65
|
-
},
|
|
36
|
+
export const rowSelectionFeature: TableFeature = {
|
|
37
|
+
getInitialState: (initialState) => {
|
|
38
|
+
return {
|
|
39
|
+
rowSelection: getDefaultRowSelectionState(),
|
|
40
|
+
...initialState,
|
|
41
|
+
}
|
|
42
|
+
},
|
|
66
43
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
44
|
+
getDefaultTableOptions: (table) => {
|
|
45
|
+
return {
|
|
46
|
+
onRowSelectionChange: makeStateUpdater('rowSelection', table),
|
|
47
|
+
enableRowSelection: true,
|
|
48
|
+
enableMultiRowSelection: true,
|
|
49
|
+
enableSubRowSelection: true,
|
|
50
|
+
}
|
|
51
|
+
},
|
|
75
52
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
53
|
+
assignRowPrototype: (prototype, table) => {
|
|
54
|
+
assignPrototypeAPIs('rowSelectionFeature', prototype, table, {
|
|
55
|
+
row_toggleSelected: {
|
|
56
|
+
fn: (row, value, opts) => row_toggleSelected(row, value, opts),
|
|
57
|
+
},
|
|
58
|
+
row_getIsSelected: {
|
|
59
|
+
fn: (row) => row_getIsSelected(row),
|
|
60
|
+
},
|
|
61
|
+
row_getIsSomeSelected: {
|
|
62
|
+
fn: (row) => row_getIsSomeSelected(row),
|
|
63
|
+
},
|
|
64
|
+
row_getIsAllSubRowsSelected: {
|
|
65
|
+
fn: (row) => row_getIsAllSubRowsSelected(row),
|
|
66
|
+
},
|
|
67
|
+
row_getCanSelect: {
|
|
68
|
+
fn: (row) => row_getCanSelect(row),
|
|
69
|
+
},
|
|
70
|
+
row_getCanSelectSubRows: {
|
|
71
|
+
fn: (row) => row_getCanSelectSubRows(row),
|
|
72
|
+
},
|
|
73
|
+
row_getCanMultiSelect: {
|
|
74
|
+
fn: (row) => row_getCanMultiSelect(row),
|
|
75
|
+
},
|
|
76
|
+
row_getToggleSelectedHandler: {
|
|
77
|
+
fn: (row) => row_getToggleSelectedHandler(row),
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
},
|
|
104
81
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
82
|
+
constructTableAPIs: (table) => {
|
|
83
|
+
assignTableAPIs('rowSelectionFeature', table, {
|
|
84
|
+
table_setRowSelection: {
|
|
85
|
+
fn: (updater) => table_setRowSelection(table, updater),
|
|
86
|
+
},
|
|
87
|
+
table_resetRowSelection: {
|
|
88
|
+
fn: (defaultState) => table_resetRowSelection(table, defaultState),
|
|
89
|
+
},
|
|
90
|
+
table_toggleAllRowsSelected: {
|
|
91
|
+
fn: (value) => table_toggleAllRowsSelected(table, value),
|
|
92
|
+
},
|
|
93
|
+
table_toggleAllPageRowsSelected: {
|
|
94
|
+
fn: (value) => table_toggleAllPageRowsSelected(table, value),
|
|
95
|
+
},
|
|
96
|
+
table_getPreSelectedRowModel: {
|
|
97
|
+
fn: () => table_getPreSelectedRowModel(table),
|
|
98
|
+
},
|
|
99
|
+
table_getSelectedRowModel: {
|
|
100
|
+
fn: () => table_getSelectedRowModel(table),
|
|
101
|
+
memoDeps: () => [
|
|
102
|
+
table.atoms.rowSelection?.get(),
|
|
103
|
+
table.getCoreRowModel(),
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
table_getFilteredSelectedRowModel: {
|
|
107
|
+
fn: () => table_getFilteredSelectedRowModel(table),
|
|
108
|
+
memoDeps: () => [
|
|
109
|
+
table.atoms.rowSelection?.get(),
|
|
110
|
+
table.getFilteredRowModel(),
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
table_getGroupedSelectedRowModel: {
|
|
114
|
+
fn: () => table_getGroupedSelectedRowModel(table),
|
|
115
|
+
memoDeps: () => [
|
|
116
|
+
table.atoms.rowSelection?.get(),
|
|
117
|
+
table.getSortedRowModel(),
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
table_getIsAllRowsSelected: {
|
|
121
|
+
fn: () => table_getIsAllRowsSelected(table),
|
|
122
|
+
},
|
|
123
|
+
table_getIsAllPageRowsSelected: {
|
|
124
|
+
fn: () => table_getIsAllPageRowsSelected(table),
|
|
125
|
+
},
|
|
126
|
+
table_getIsSomeRowsSelected: {
|
|
127
|
+
fn: () => table_getIsSomeRowsSelected(table),
|
|
128
|
+
},
|
|
129
|
+
table_getIsSomePageRowsSelected: {
|
|
130
|
+
fn: () => table_getIsSomePageRowsSelected(table),
|
|
131
|
+
},
|
|
132
|
+
table_getToggleAllRowsSelectedHandler: {
|
|
133
|
+
fn: () => table_getToggleAllRowsSelectedHandler(table),
|
|
134
|
+
},
|
|
135
|
+
table_getToggleAllPageRowsSelectedHandler: {
|
|
136
|
+
fn: () => table_getToggleAllPageRowsSelectedHandler(table),
|
|
137
|
+
},
|
|
138
|
+
})
|
|
139
|
+
},
|
|
164
140
|
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* The stock row selection feature.
|
|
168
|
-
*
|
|
169
|
-
* Register this feature to add row selection state, selected row-model helpers,
|
|
170
|
-
* and table/row APIs for checkbox and bulk-selection UI.
|
|
171
|
-
*/
|
|
172
|
-
export const rowSelectionFeature = constructRowSelectionFeature()
|
|
@@ -21,7 +21,7 @@ export function createSortedRowModel<
|
|
|
21
21
|
sortFns: Record<keyof SortFns, SortFn<TFeatures, TData>>,
|
|
22
22
|
): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {
|
|
23
23
|
return (_table) => {
|
|
24
|
-
const table
|
|
24
|
+
const table = _table as unknown as Table_Internal<TFeatures, TData>
|
|
25
25
|
if (!table._rowModelFns.sortFns) table._rowModelFns.sortFns = sortFns
|
|
26
26
|
return tableMemo({
|
|
27
27
|
feature: 'rowSortingFeature',
|
|
@@ -20,125 +20,84 @@ import {
|
|
|
20
20
|
table_resetSorting,
|
|
21
21
|
table_setSorting,
|
|
22
22
|
} from './rowSortingFeature.utils'
|
|
23
|
-
import type {
|
|
24
|
-
import type { TableFeature, TableFeatures } from '../../types/TableFeatures'
|
|
25
|
-
// import type {
|
|
26
|
-
// CachedRowModel_Sorted,
|
|
27
|
-
// ColumnDef_RowSorting,
|
|
28
|
-
// Column_RowSorting,
|
|
29
|
-
// CreateRowModel_Sorted,
|
|
30
|
-
// RowModelFns_RowSorting,
|
|
31
|
-
// TableOptions_RowSorting,
|
|
32
|
-
// TableState_RowSorting,
|
|
33
|
-
// Table_RowSorting,
|
|
34
|
-
// } from './rowSortingFeature.types'
|
|
35
|
-
|
|
36
|
-
export interface RowSortingFeatureConstructors<
|
|
37
|
-
TFeatures extends TableFeatures,
|
|
38
|
-
TData extends RowData,
|
|
39
|
-
> {
|
|
40
|
-
// CachedRowModel: CachedRowModel_Sorted<TFeatures, TData>
|
|
41
|
-
// Column: Column_RowSorting<TFeatures, TData>
|
|
42
|
-
// ColumnDef: ColumnDef_RowSorting<TFeatures, TData>
|
|
43
|
-
// CreateRowModels: CreateRowModel_Sorted<TFeatures, TData>
|
|
44
|
-
// RowModelFns: RowModelFns_RowSorting<TFeatures, TData>
|
|
45
|
-
// Table: Table_RowSorting<TFeatures, TData>
|
|
46
|
-
// TableOptions: TableOptions_RowSorting
|
|
47
|
-
// TableState: TableState_RowSorting
|
|
48
|
-
}
|
|
23
|
+
import type { TableFeature } from '../../types/TableFeatures'
|
|
49
24
|
|
|
50
25
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
26
|
+
* Feature that adds row sorting state, defaults, and column/table sorting APIs.
|
|
54
27
|
*/
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
sorting: getDefaultSortingState(),
|
|
63
|
-
...initialState,
|
|
64
|
-
}
|
|
65
|
-
},
|
|
28
|
+
export const rowSortingFeature: TableFeature = {
|
|
29
|
+
getInitialState(initialState) {
|
|
30
|
+
return {
|
|
31
|
+
sorting: getDefaultSortingState(),
|
|
32
|
+
...initialState,
|
|
33
|
+
}
|
|
34
|
+
},
|
|
66
35
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
36
|
+
getDefaultColumnDef() {
|
|
37
|
+
return {
|
|
38
|
+
sortFn: 'auto',
|
|
39
|
+
sortUndefined: 1,
|
|
40
|
+
}
|
|
41
|
+
},
|
|
73
42
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
43
|
+
getDefaultTableOptions(table) {
|
|
44
|
+
return {
|
|
45
|
+
onSortingChange: makeStateUpdater('sorting', table),
|
|
46
|
+
isMultiSortEvent: (e: unknown) => {
|
|
47
|
+
return (e as MouseEvent).shiftKey
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
},
|
|
82
51
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
},
|
|
52
|
+
assignColumnPrototype(prototype, table) {
|
|
53
|
+
assignPrototypeAPIs('rowSortingFeature', prototype, table, {
|
|
54
|
+
column_getAutoSortFn: {
|
|
55
|
+
fn: (column) => column_getAutoSortFn(column),
|
|
56
|
+
},
|
|
57
|
+
column_getAutoSortDir: {
|
|
58
|
+
fn: (column) => column_getAutoSortDir(column),
|
|
59
|
+
},
|
|
60
|
+
column_getSortFn: {
|
|
61
|
+
fn: (column) => column_getSortFn(column),
|
|
62
|
+
},
|
|
63
|
+
column_toggleSorting: {
|
|
64
|
+
fn: (column, desc, multi) => column_toggleSorting(column, desc, multi),
|
|
65
|
+
},
|
|
66
|
+
column_getFirstSortDir: {
|
|
67
|
+
fn: (column) => column_getFirstSortDir(column),
|
|
68
|
+
},
|
|
69
|
+
column_getNextSortingOrder: {
|
|
70
|
+
fn: (column, multi) => column_getNextSortingOrder(column, multi),
|
|
71
|
+
},
|
|
72
|
+
column_getCanSort: {
|
|
73
|
+
fn: (column) => column_getCanSort(column),
|
|
74
|
+
},
|
|
75
|
+
column_getCanMultiSort: {
|
|
76
|
+
fn: (column) => column_getCanMultiSort(column),
|
|
77
|
+
},
|
|
78
|
+
column_getIsSorted: {
|
|
79
|
+
fn: (column) => column_getIsSorted(column),
|
|
80
|
+
},
|
|
81
|
+
column_getSortIndex: {
|
|
82
|
+
fn: (column) => column_getSortIndex(column),
|
|
83
|
+
},
|
|
84
|
+
column_clearSorting: {
|
|
85
|
+
fn: (column) => column_clearSorting(column),
|
|
86
|
+
},
|
|
87
|
+
column_getToggleSortingHandler: {
|
|
88
|
+
fn: (column) => column_getToggleSortingHandler(column),
|
|
89
|
+
},
|
|
90
|
+
})
|
|
91
|
+
},
|
|
124
92
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
93
|
+
constructTableAPIs(table) {
|
|
94
|
+
assignTableAPIs('rowSortingFeature', table, {
|
|
95
|
+
table_setSorting: {
|
|
96
|
+
fn: (updater) => table_setSorting(table, updater),
|
|
97
|
+
},
|
|
98
|
+
table_resetSorting: {
|
|
99
|
+
fn: (defaultState) => table_resetSorting(table, defaultState),
|
|
100
|
+
},
|
|
101
|
+
})
|
|
102
|
+
},
|
|
136
103
|
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* The stock row sorting feature.
|
|
140
|
-
*
|
|
141
|
-
* Register this feature to add sorting state, column sorting APIs, and sorted
|
|
142
|
-
* row-model support for client-side or manual sorting.
|
|
143
|
-
*/
|
|
144
|
-
export const rowSortingFeature = constructRowSortingFeature()
|