@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
|
@@ -3,33 +3,25 @@ import { table_getCoreRowModel, table_getExpandedRowModel, table_getFilteredRowM
|
|
|
3
3
|
|
|
4
4
|
//#region src/core/row-models/coreRowModelsFeature.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
6
|
+
* Core feature that wires table row-model accessors and row-model caches.
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} };
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* The Core Row Models feature provides the core row model functionality.
|
|
30
|
-
*/
|
|
31
|
-
const coreRowModelsFeature = constructCoreRowModelsFeature();
|
|
8
|
+
const coreRowModelsFeature = { constructTableAPIs: (table) => {
|
|
9
|
+
assignTableAPIs("coreRowModelsFeature", table, {
|
|
10
|
+
table_getCoreRowModel: { fn: () => table_getCoreRowModel(table) },
|
|
11
|
+
table_getPreFilteredRowModel: { fn: () => table_getPreFilteredRowModel(table) },
|
|
12
|
+
table_getFilteredRowModel: { fn: () => table_getFilteredRowModel(table) },
|
|
13
|
+
table_getPreGroupedRowModel: { fn: () => table_getPreGroupedRowModel(table) },
|
|
14
|
+
table_getGroupedRowModel: { fn: () => table_getGroupedRowModel(table) },
|
|
15
|
+
table_getPreSortedRowModel: { fn: () => table_getPreSortedRowModel(table) },
|
|
16
|
+
table_getSortedRowModel: { fn: () => table_getSortedRowModel(table) },
|
|
17
|
+
table_getPreExpandedRowModel: { fn: () => table_getPreExpandedRowModel(table) },
|
|
18
|
+
table_getExpandedRowModel: { fn: () => table_getExpandedRowModel(table) },
|
|
19
|
+
table_getPrePaginatedRowModel: { fn: () => table_getPrePaginatedRowModel(table) },
|
|
20
|
+
table_getPaginatedRowModel: { fn: () => table_getPaginatedRowModel(table) },
|
|
21
|
+
table_getRowModel: { fn: () => table_getRowModel(table) }
|
|
22
|
+
});
|
|
23
|
+
} };
|
|
32
24
|
|
|
33
25
|
//#endregion
|
|
34
|
-
export {
|
|
26
|
+
export { coreRowModelsFeature };
|
|
35
27
|
//# sourceMappingURL=coreRowModelsFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreRowModelsFeature.js","names":[],"sources":["../../../src/core/row-models/coreRowModelsFeature.ts"],"sourcesContent":["import { assignTableAPIs } from '../../utils'\nimport {\n table_getCoreRowModel,\n table_getExpandedRowModel,\n table_getFilteredRowModel,\n table_getGroupedRowModel,\n table_getPaginatedRowModel,\n table_getPreExpandedRowModel,\n table_getPreFilteredRowModel,\n table_getPreGroupedRowModel,\n table_getPrePaginatedRowModel,\n table_getPreSortedRowModel,\n table_getRowModel,\n table_getSortedRowModel,\n} from './coreRowModelsFeature.utils'\nimport type {
|
|
1
|
+
{"version":3,"file":"coreRowModelsFeature.js","names":[],"sources":["../../../src/core/row-models/coreRowModelsFeature.ts"],"sourcesContent":["import { assignTableAPIs } from '../../utils'\nimport {\n table_getCoreRowModel,\n table_getExpandedRowModel,\n table_getFilteredRowModel,\n table_getGroupedRowModel,\n table_getPaginatedRowModel,\n table_getPreExpandedRowModel,\n table_getPreFilteredRowModel,\n table_getPreGroupedRowModel,\n table_getPrePaginatedRowModel,\n table_getPreSortedRowModel,\n table_getRowModel,\n table_getSortedRowModel,\n} from './coreRowModelsFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that wires table row-model accessors and row-model caches.\n */\nexport const coreRowModelsFeature: TableFeature = {\n constructTableAPIs: (table) => {\n assignTableAPIs('coreRowModelsFeature', table, {\n table_getCoreRowModel: {\n fn: () => table_getCoreRowModel(table),\n },\n table_getPreFilteredRowModel: {\n fn: () => table_getPreFilteredRowModel(table),\n },\n table_getFilteredRowModel: {\n fn: () => table_getFilteredRowModel(table),\n },\n table_getPreGroupedRowModel: {\n fn: () => table_getPreGroupedRowModel(table),\n },\n table_getGroupedRowModel: {\n fn: () => table_getGroupedRowModel(table),\n },\n table_getPreSortedRowModel: {\n fn: () => table_getPreSortedRowModel(table),\n },\n table_getSortedRowModel: {\n fn: () => table_getSortedRowModel(table),\n },\n table_getPreExpandedRowModel: {\n fn: () => table_getPreExpandedRowModel(table),\n },\n table_getExpandedRowModel: {\n fn: () => table_getExpandedRowModel(table),\n },\n table_getPrePaginatedRowModel: {\n fn: () => table_getPrePaginatedRowModel(table),\n },\n table_getPaginatedRowModel: {\n fn: () => table_getPaginatedRowModel(table),\n },\n table_getRowModel: {\n fn: () => table_getRowModel(table),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAoBA,MAAa,uBAAqC,EAChD,qBAAqB,UAAU;CAC7B,gBAAgB,wBAAwB,OAAO;EAC7C,uBAAuB,EACrB,UAAU,sBAAsB,KAAK,EACvC;EACA,8BAA8B,EAC5B,UAAU,6BAA6B,KAAK,EAC9C;EACA,2BAA2B,EACzB,UAAU,0BAA0B,KAAK,EAC3C;EACA,6BAA6B,EAC3B,UAAU,4BAA4B,KAAK,EAC7C;EACA,0BAA0B,EACxB,UAAU,yBAAyB,KAAK,EAC1C;EACA,4BAA4B,EAC1B,UAAU,2BAA2B,KAAK,EAC5C;EACA,yBAAyB,EACvB,UAAU,wBAAwB,KAAK,EACzC;EACA,8BAA8B,EAC5B,UAAU,6BAA6B,KAAK,EAC9C;EACA,2BAA2B,EACzB,UAAU,0BAA0B,KAAK,EAC3C;EACA,+BAA+B,EAC7B,UAAU,8BAA8B,KAAK,EAC/C;EACA,4BAA4B,EAC1B,UAAU,2BAA2B,KAAK,EAC5C;EACA,mBAAmB,EACjB,UAAU,kBAAkB,KAAK,EACnC;CACF,CAAC;AACH,EACF"}
|
|
@@ -15,16 +15,14 @@ interface RowModel<TFeatures extends TableFeatures, TData extends RowData> {
|
|
|
15
15
|
flatRows: Array<Row<TFeatures, TData>>;
|
|
16
16
|
rowsById: Record<string, Row<TFeatures, TData>>;
|
|
17
17
|
}
|
|
18
|
-
interface
|
|
19
|
-
interface CreateRowModel_Core<TFeatures extends TableFeatures, TData extends RowData> extends CreateRowModel_Plugins {
|
|
18
|
+
interface CreateRowModel_Core<TFeatures extends TableFeatures, TData extends RowData> {
|
|
20
19
|
/**
|
|
21
20
|
* Optional factory for the core row model. When omitted, the built-in
|
|
22
21
|
* `createCoreRowModel()` factory is used.
|
|
23
22
|
*/
|
|
24
23
|
coreRowModel?: (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData>;
|
|
25
24
|
}
|
|
26
|
-
interface
|
|
27
|
-
interface CachedRowModel_Core<TFeatures extends TableFeatures, TData extends RowData> extends CachedRowModel_Plugins {
|
|
25
|
+
interface CachedRowModel_Core<TFeatures extends TableFeatures, TData extends RowData> {
|
|
28
26
|
coreRowModel: () => RowModel<TFeatures, TData>;
|
|
29
27
|
}
|
|
30
28
|
interface Table_RowModels_Core<TFeatures extends TableFeatures, TData extends RowData> {
|
|
@@ -39,5 +37,5 @@ interface Table_RowModels_Core<TFeatures extends TableFeatures, TData extends Ro
|
|
|
39
37
|
}
|
|
40
38
|
type Table_RowModels<TFeatures extends TableFeatures, TData extends RowData> = Table_RowModels_Core<TFeatures, TData> & Table_RowModels_Faceted<TFeatures, TData> & Table_RowModels_Filtered<TFeatures, TData> & Table_RowModels_Grouped<TFeatures, TData> & Table_RowModels_Expanded<TFeatures, TData> & Table_RowModels_Paginated<TFeatures, TData> & Table_RowModels_Sorted<TFeatures, TData>;
|
|
41
39
|
//#endregion
|
|
42
|
-
export { CachedRowModel_Core,
|
|
40
|
+
export { CachedRowModel_Core, CreateRowModel_Core, RowModel, Table_RowModels, Table_RowModels_Core };
|
|
43
41
|
//# sourceMappingURL=coreRowModelsFeature.types.d.cts.map
|
|
@@ -15,16 +15,14 @@ interface RowModel<TFeatures extends TableFeatures, TData extends RowData> {
|
|
|
15
15
|
flatRows: Array<Row<TFeatures, TData>>;
|
|
16
16
|
rowsById: Record<string, Row<TFeatures, TData>>;
|
|
17
17
|
}
|
|
18
|
-
interface
|
|
19
|
-
interface CreateRowModel_Core<TFeatures extends TableFeatures, TData extends RowData> extends CreateRowModel_Plugins {
|
|
18
|
+
interface CreateRowModel_Core<TFeatures extends TableFeatures, TData extends RowData> {
|
|
20
19
|
/**
|
|
21
20
|
* Optional factory for the core row model. When omitted, the built-in
|
|
22
21
|
* `createCoreRowModel()` factory is used.
|
|
23
22
|
*/
|
|
24
23
|
coreRowModel?: (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData>;
|
|
25
24
|
}
|
|
26
|
-
interface
|
|
27
|
-
interface CachedRowModel_Core<TFeatures extends TableFeatures, TData extends RowData> extends CachedRowModel_Plugins {
|
|
25
|
+
interface CachedRowModel_Core<TFeatures extends TableFeatures, TData extends RowData> {
|
|
28
26
|
coreRowModel: () => RowModel<TFeatures, TData>;
|
|
29
27
|
}
|
|
30
28
|
interface Table_RowModels_Core<TFeatures extends TableFeatures, TData extends RowData> {
|
|
@@ -39,5 +37,5 @@ interface Table_RowModels_Core<TFeatures extends TableFeatures, TData extends Ro
|
|
|
39
37
|
}
|
|
40
38
|
type Table_RowModels<TFeatures extends TableFeatures, TData extends RowData> = Table_RowModels_Core<TFeatures, TData> & Table_RowModels_Faceted<TFeatures, TData> & Table_RowModels_Filtered<TFeatures, TData> & Table_RowModels_Grouped<TFeatures, TData> & Table_RowModels_Expanded<TFeatures, TData> & Table_RowModels_Paginated<TFeatures, TData> & Table_RowModels_Sorted<TFeatures, TData>;
|
|
41
39
|
//#endregion
|
|
42
|
-
export { CachedRowModel_Core,
|
|
40
|
+
export { CachedRowModel_Core, CreateRowModel_Core, RowModel, Table_RowModels, Table_RowModels_Core };
|
|
43
41
|
//# sourceMappingURL=coreRowModelsFeature.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCoreRowModel.cjs","names":["tableMemo","table_autoResetPageIndex","constructRow"],"sources":["../../../src/core/row-models/createCoreRowModel.ts"],"sourcesContent":["import { constructRow } from '../rows/constructRow'\nimport { tableMemo } from '../../utils'\nimport { table_autoResetPageIndex } from '../../features/row-pagination/rowPaginationFeature.utils'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { RowModel } from './coreRowModelsFeature.types'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Creates a memoized core row model factory.\n *\n * The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.\n */\nexport function createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {\n return (_table) => {\n const table
|
|
1
|
+
{"version":3,"file":"createCoreRowModel.cjs","names":["tableMemo","table_autoResetPageIndex","constructRow"],"sources":["../../../src/core/row-models/createCoreRowModel.ts"],"sourcesContent":["import { constructRow } from '../rows/constructRow'\nimport { tableMemo } from '../../utils'\nimport { table_autoResetPageIndex } from '../../features/row-pagination/rowPaginationFeature.utils'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { RowModel } from './coreRowModelsFeature.types'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Creates a memoized core row model factory.\n *\n * The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.\n */\nexport function createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {\n return (_table) => {\n const table = _table as unknown as Table_Internal<TFeatures, TData>\n return tableMemo({\n feature: 'coreRowModelsFeature',\n table,\n fnName: 'table.getCoreRowModel',\n memoDeps: () => [table.options.data],\n fn: () => _createCoreRowModel(table, table.options.data),\n onAfterUpdate: () => table_autoResetPageIndex(table),\n })\n }\n}\n\nfunction _createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n data: ReadonlyArray<TData>,\n): {\n rows: Array<Row<TFeatures, TData>>\n flatRows: Array<Row<TFeatures, TData>>\n rowsById: Record<string, Row<TFeatures, TData>>\n} {\n const rowModel: RowModel<TFeatures, TData> = {\n rows: [],\n flatRows: [],\n rowsById: {},\n }\n\n const accessRows = (\n originalRows: ReadonlyArray<TData>,\n depth = 0,\n parentRow?: Row<TFeatures, TData>,\n ): Array<Row<TFeatures, TData>> => {\n const rows = [] as Array<Row<TFeatures, TData>>\n\n for (let i = 0; i < originalRows.length; i++) {\n const originalRow = originalRows[i]!\n // Make the row\n const row = constructRow(\n table,\n table.getRowId(originalRow, i, parentRow),\n originalRow,\n i,\n depth,\n undefined,\n parentRow?.id,\n )\n\n // Keep track of every row in a flat array\n rowModel.flatRows.push(row)\n // Also keep track of every row by its ID\n rowModel.rowsById[row.id] = row\n // Push table row into parent\n rows.push(row)\n\n // Get the original subrows\n if (table.options.getSubRows) {\n row.originalSubRows = table.options.getSubRows(originalRow, i)\n\n // Then recursively access them\n if (row.originalSubRows?.length) {\n row.subRows = accessRows(row.originalSubRows, depth + 1, row)\n }\n }\n }\n\n return rows\n }\n\n rowModel.rows = accessRows(data)\n\n return rowModel\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,qBAG0D;CACxE,QAAQ,WAAW;EACjB,MAAM,QAAQ;EACd,OAAOA,wBAAU;GACf,SAAS;GACT;GACA,QAAQ;GACR,gBAAgB,CAAC,MAAM,QAAQ,IAAI;GACnC,UAAU,oBAAoB,OAAO,MAAM,QAAQ,IAAI;GACvD,qBAAqBC,4DAAyB,KAAK;EACrD,CAAC;CACH;AACF;AAEA,SAAS,oBAIP,OACA,MAKA;CACA,MAAM,WAAuC;EAC3C,MAAM,CAAC;EACP,UAAU,CAAC;EACX,UAAU,CAAC;CACb;CAEA,MAAM,cACJ,cACA,QAAQ,GACR,cACiC;EACjC,MAAM,OAAO,CAAC;EAEd,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;GAC5C,MAAM,cAAc,aAAa;GAEjC,MAAM,MAAMC,kCACV,OACA,MAAM,SAAS,aAAa,GAAG,SAAS,GACxC,aACA,GACA,OACA,8DACA,UAAW,EACb;GAGA,SAAS,SAAS,KAAK,GAAG;GAE1B,SAAS,SAAS,IAAI,MAAM;GAE5B,KAAK,KAAK,GAAG;GAGb,IAAI,MAAM,QAAQ,YAAY;;IAC5B,IAAI,kBAAkB,MAAM,QAAQ,WAAW,aAAa,CAAC;IAG7D,4BAAI,IAAI,6FAAiB,QACvB,IAAI,UAAU,WAAW,IAAI,iBAAiB,QAAQ,GAAG,GAAG;GAEhE;EACF;EAEA,OAAO;CACT;CAEA,SAAS,OAAO,WAAW,IAAI;CAE/B,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCoreRowModel.js","names":[],"sources":["../../../src/core/row-models/createCoreRowModel.ts"],"sourcesContent":["import { constructRow } from '../rows/constructRow'\nimport { tableMemo } from '../../utils'\nimport { table_autoResetPageIndex } from '../../features/row-pagination/rowPaginationFeature.utils'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { RowModel } from './coreRowModelsFeature.types'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Creates a memoized core row model factory.\n *\n * The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.\n */\nexport function createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {\n return (_table) => {\n const table
|
|
1
|
+
{"version":3,"file":"createCoreRowModel.js","names":[],"sources":["../../../src/core/row-models/createCoreRowModel.ts"],"sourcesContent":["import { constructRow } from '../rows/constructRow'\nimport { tableMemo } from '../../utils'\nimport { table_autoResetPageIndex } from '../../features/row-pagination/rowPaginationFeature.utils'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { RowModel } from './coreRowModelsFeature.types'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Creates a memoized core row model factory.\n *\n * The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.\n */\nexport function createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {\n return (_table) => {\n const table = _table as unknown as Table_Internal<TFeatures, TData>\n return tableMemo({\n feature: 'coreRowModelsFeature',\n table,\n fnName: 'table.getCoreRowModel',\n memoDeps: () => [table.options.data],\n fn: () => _createCoreRowModel(table, table.options.data),\n onAfterUpdate: () => table_autoResetPageIndex(table),\n })\n }\n}\n\nfunction _createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n data: ReadonlyArray<TData>,\n): {\n rows: Array<Row<TFeatures, TData>>\n flatRows: Array<Row<TFeatures, TData>>\n rowsById: Record<string, Row<TFeatures, TData>>\n} {\n const rowModel: RowModel<TFeatures, TData> = {\n rows: [],\n flatRows: [],\n rowsById: {},\n }\n\n const accessRows = (\n originalRows: ReadonlyArray<TData>,\n depth = 0,\n parentRow?: Row<TFeatures, TData>,\n ): Array<Row<TFeatures, TData>> => {\n const rows = [] as Array<Row<TFeatures, TData>>\n\n for (let i = 0; i < originalRows.length; i++) {\n const originalRow = originalRows[i]!\n // Make the row\n const row = constructRow(\n table,\n table.getRowId(originalRow, i, parentRow),\n originalRow,\n i,\n depth,\n undefined,\n parentRow?.id,\n )\n\n // Keep track of every row in a flat array\n rowModel.flatRows.push(row)\n // Also keep track of every row by its ID\n rowModel.rowsById[row.id] = row\n // Push table row into parent\n rows.push(row)\n\n // Get the original subrows\n if (table.options.getSubRows) {\n row.originalSubRows = table.options.getSubRows(originalRow, i)\n\n // Then recursively access them\n if (row.originalSubRows?.length) {\n row.subRows = accessRows(row.originalSubRows, depth + 1, row)\n }\n }\n }\n\n return rows\n }\n\n rowModel.rows = accessRows(data)\n\n return rowModel\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,qBAG0D;CACxE,QAAQ,WAAW;EACjB,MAAM,QAAQ;EACd,OAAO,UAAU;GACf,SAAS;GACT;GACA,QAAQ;GACR,gBAAgB,CAAC,MAAM,QAAQ,IAAI;GACnC,UAAU,oBAAoB,OAAO,MAAM,QAAQ,IAAI;GACvD,qBAAqB,yBAAyB,KAAK;EACrD,CAAC;CACH;AACF;AAEA,SAAS,oBAIP,OACA,MAKA;CACA,MAAM,WAAuC;EAC3C,MAAM,CAAC;EACP,UAAU,CAAC;EACX,UAAU,CAAC;CACb;CAEA,MAAM,cACJ,cACA,QAAQ,GACR,cACiC;EACjC,MAAM,OAAO,CAAC;EAEd,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;GAC5C,MAAM,cAAc,aAAa;GAEjC,MAAM,MAAM,aACV,OACA,MAAM,SAAS,aAAa,GAAG,SAAS,GACxC,aACA,GACA,OACA,8DACA,UAAW,EACb;GAGA,SAAS,SAAS,KAAK,GAAG;GAE1B,SAAS,SAAS,IAAI,MAAM;GAE5B,KAAK,KAAK,GAAG;GAGb,IAAI,MAAM,QAAQ,YAAY;;IAC5B,IAAI,kBAAkB,MAAM,QAAQ,WAAW,aAAa,CAAC;IAG7D,4BAAI,IAAI,6FAAiB,QACvB,IAAI,UAAU,WAAW,IAAI,iBAAiB,QAAQ,GAAG,GAAG;GAEhE;EACF;EAEA,OAAO;CACT;CAEA,SAAS,OAAO,WAAW,IAAI;CAE/B,OAAO;AACT"}
|
|
@@ -3,44 +3,35 @@ const require_coreRowsFeature_utils = require('./coreRowsFeature.utils.cjs');
|
|
|
3
3
|
|
|
4
4
|
//#region src/core/rows/coreRowsFeature.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
6
|
+
* Core feature that creates row APIs for values, cells, and tree traversal.
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The Core Rows feature provides the core row functionality.
|
|
40
|
-
*/
|
|
41
|
-
const coreRowsFeature = constructCoreRowsFeature();
|
|
8
|
+
const coreRowsFeature = {
|
|
9
|
+
assignRowPrototype: (prototype, table) => {
|
|
10
|
+
require_utils.assignPrototypeAPIs("coreRowsFeature", prototype, table, {
|
|
11
|
+
row_getAllCellsByColumnId: {
|
|
12
|
+
fn: (row) => require_coreRowsFeature_utils.row_getAllCellsByColumnId(row),
|
|
13
|
+
memoDeps: (row) => [row.getAllCells()]
|
|
14
|
+
},
|
|
15
|
+
row_getAllCells: {
|
|
16
|
+
fn: (row) => require_coreRowsFeature_utils.row_getAllCells(row),
|
|
17
|
+
memoDeps: (row) => [row.table.getAllLeafColumns()]
|
|
18
|
+
},
|
|
19
|
+
row_getLeafRows: { fn: (row) => require_coreRowsFeature_utils.row_getLeafRows(row) },
|
|
20
|
+
row_getParentRow: { fn: (row) => require_coreRowsFeature_utils.row_getParentRow(row) },
|
|
21
|
+
row_getParentRows: { fn: (row) => require_coreRowsFeature_utils.row_getParentRows(row) },
|
|
22
|
+
row_getUniqueValues: { fn: (row, columnId) => require_coreRowsFeature_utils.row_getUniqueValues(row, columnId) },
|
|
23
|
+
row_getValue: { fn: (row, columnId) => require_coreRowsFeature_utils.row_getValue(row, columnId) },
|
|
24
|
+
row_renderValue: { fn: (row, columnId) => require_coreRowsFeature_utils.row_renderValue(row, columnId) }
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
constructTableAPIs: (table) => {
|
|
28
|
+
require_utils.assignTableAPIs("coreRowsFeature", table, {
|
|
29
|
+
table_getRowId: { fn: (originalRow, index, parent) => require_coreRowsFeature_utils.table_getRowId(originalRow, table, index, parent) },
|
|
30
|
+
table_getRow: { fn: (id, searchAll) => require_coreRowsFeature_utils.table_getRow(table, id, searchAll) }
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
42
34
|
|
|
43
35
|
//#endregion
|
|
44
|
-
exports.constructCoreRowsFeature = constructCoreRowsFeature;
|
|
45
36
|
exports.coreRowsFeature = coreRowsFeature;
|
|
46
37
|
//# sourceMappingURL=coreRowsFeature.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreRowsFeature.cjs","names":["row_getAllCellsByColumnId","row_getAllCells","row_getLeafRows","row_getParentRow","row_getParentRows","row_getUniqueValues","row_getValue","row_renderValue","table_getRowId","table_getRow"],"sources":["../../../src/core/rows/coreRowsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n row_getAllCells,\n row_getAllCellsByColumnId,\n row_getLeafRows,\n row_getParentRow,\n row_getParentRows,\n row_getUniqueValues,\n row_getValue,\n row_renderValue,\n table_getRow,\n table_getRowId,\n} from './coreRowsFeature.utils'\nimport type {
|
|
1
|
+
{"version":3,"file":"coreRowsFeature.cjs","names":["row_getAllCellsByColumnId","row_getAllCells","row_getLeafRows","row_getParentRow","row_getParentRows","row_getUniqueValues","row_getValue","row_renderValue","table_getRowId","table_getRow"],"sources":["../../../src/core/rows/coreRowsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n row_getAllCells,\n row_getAllCellsByColumnId,\n row_getLeafRows,\n row_getParentRow,\n row_getParentRows,\n row_getUniqueValues,\n row_getValue,\n row_renderValue,\n table_getRow,\n table_getRowId,\n} from './coreRowsFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that creates row APIs for values, cells, and tree traversal.\n */\nexport const coreRowsFeature: TableFeature = {\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreRowsFeature', prototype, table, {\n row_getAllCellsByColumnId: {\n fn: (row) => row_getAllCellsByColumnId(row),\n memoDeps: (row) => [row.getAllCells()],\n },\n row_getAllCells: {\n fn: (row) => row_getAllCells(row),\n memoDeps: (row) => [row.table.getAllLeafColumns()],\n },\n row_getLeafRows: {\n fn: (row) => row_getLeafRows(row),\n },\n row_getParentRow: {\n fn: (row) => row_getParentRow(row),\n },\n row_getParentRows: {\n fn: (row) => row_getParentRows(row),\n },\n row_getUniqueValues: {\n fn: (row, columnId) => row_getUniqueValues(row, columnId),\n },\n row_getValue: {\n fn: (row, columnId) => row_getValue(row, columnId),\n },\n row_renderValue: {\n fn: (row, columnId) => row_renderValue(row, columnId),\n },\n })\n },\n constructTableAPIs: (table) => {\n assignTableAPIs('coreRowsFeature', table, {\n table_getRowId: {\n fn: (originalRow, index, parent) =>\n table_getRowId(originalRow, table, index, parent),\n },\n table_getRow: {\n fn: (id: string, searchAll?: boolean) =>\n table_getRow(table, id, searchAll),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAkBA,MAAa,kBAAgC;CAC3C,qBAAqB,WAAW,UAAU;EACxC,kCAAoB,mBAAmB,WAAW,OAAO;GACvD,2BAA2B;IACzB,KAAK,QAAQA,wDAA0B,GAAG;IAC1C,WAAW,QAAQ,CAAC,IAAI,YAAY,CAAC;GACvC;GACA,iBAAiB;IACf,KAAK,QAAQC,8CAAgB,GAAG;IAChC,WAAW,QAAQ,CAAC,IAAI,MAAM,kBAAkB,CAAC;GACnD;GACA,iBAAiB,EACf,KAAK,QAAQC,8CAAgB,GAAG,EAClC;GACA,kBAAkB,EAChB,KAAK,QAAQC,+CAAiB,GAAG,EACnC;GACA,mBAAmB,EACjB,KAAK,QAAQC,gDAAkB,GAAG,EACpC;GACA,qBAAqB,EACnB,KAAK,KAAK,aAAaC,kDAAoB,KAAK,QAAQ,EAC1D;GACA,cAAc,EACZ,KAAK,KAAK,aAAaC,2CAAa,KAAK,QAAQ,EACnD;GACA,iBAAiB,EACf,KAAK,KAAK,aAAaC,8CAAgB,KAAK,QAAQ,EACtD;EACF,CAAC;CACH;CACA,qBAAqB,UAAU;EAC7B,8BAAgB,mBAAmB,OAAO;GACxC,gBAAgB,EACd,KAAK,aAAa,OAAO,WACvBC,6CAAe,aAAa,OAAO,OAAO,MAAM,EACpD;GACA,cAAc,EACZ,KAAK,IAAY,cACfC,2CAAa,OAAO,IAAI,SAAS,EACrC;EACF,CAAC;CACH;AACF"}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TableFeature, TableFeatures } from "../../types/TableFeatures.cjs";
|
|
1
|
+
import { TableFeature } from "../../types/TableFeatures.cjs";
|
|
3
2
|
|
|
4
3
|
//#region src/core/rows/coreRowsFeature.d.ts
|
|
5
|
-
interface CoreRowsFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
5
|
+
* Core feature that creates row APIs for values, cells, and tree traversal.
|
|
10
6
|
*/
|
|
11
|
-
declare
|
|
12
|
-
/**
|
|
13
|
-
* The Core Rows feature provides the core row functionality.
|
|
14
|
-
*/
|
|
15
|
-
declare const coreRowsFeature: TableFeature<CoreRowsFeatureConstructors<TableFeatures, RowData>>;
|
|
7
|
+
declare const coreRowsFeature: TableFeature;
|
|
16
8
|
//#endregion
|
|
17
|
-
export {
|
|
9
|
+
export { coreRowsFeature };
|
|
18
10
|
//# sourceMappingURL=coreRowsFeature.d.cts.map
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TableFeature, TableFeatures } from "../../types/TableFeatures.js";
|
|
1
|
+
import { TableFeature } from "../../types/TableFeatures.js";
|
|
3
2
|
|
|
4
3
|
//#region src/core/rows/coreRowsFeature.d.ts
|
|
5
|
-
interface CoreRowsFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
5
|
+
* Core feature that creates row APIs for values, cells, and tree traversal.
|
|
10
6
|
*/
|
|
11
|
-
declare
|
|
12
|
-
/**
|
|
13
|
-
* The Core Rows feature provides the core row functionality.
|
|
14
|
-
*/
|
|
15
|
-
declare const coreRowsFeature: TableFeature<CoreRowsFeatureConstructors<TableFeatures, RowData>>;
|
|
7
|
+
declare const coreRowsFeature: TableFeature;
|
|
16
8
|
//#endregion
|
|
17
|
-
export {
|
|
9
|
+
export { coreRowsFeature };
|
|
18
10
|
//# sourceMappingURL=coreRowsFeature.d.ts.map
|
|
@@ -3,43 +3,35 @@ import { row_getAllCells, row_getAllCellsByColumnId, row_getLeafRows, row_getPar
|
|
|
3
3
|
|
|
4
4
|
//#region src/core/rows/coreRowsFeature.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
6
|
+
* Core feature that creates row APIs for values, cells, and tree traversal.
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The Core Rows feature provides the core row functionality.
|
|
40
|
-
*/
|
|
41
|
-
const coreRowsFeature = constructCoreRowsFeature();
|
|
8
|
+
const coreRowsFeature = {
|
|
9
|
+
assignRowPrototype: (prototype, table) => {
|
|
10
|
+
assignPrototypeAPIs("coreRowsFeature", prototype, table, {
|
|
11
|
+
row_getAllCellsByColumnId: {
|
|
12
|
+
fn: (row) => row_getAllCellsByColumnId(row),
|
|
13
|
+
memoDeps: (row) => [row.getAllCells()]
|
|
14
|
+
},
|
|
15
|
+
row_getAllCells: {
|
|
16
|
+
fn: (row) => row_getAllCells(row),
|
|
17
|
+
memoDeps: (row) => [row.table.getAllLeafColumns()]
|
|
18
|
+
},
|
|
19
|
+
row_getLeafRows: { fn: (row) => row_getLeafRows(row) },
|
|
20
|
+
row_getParentRow: { fn: (row) => row_getParentRow(row) },
|
|
21
|
+
row_getParentRows: { fn: (row) => row_getParentRows(row) },
|
|
22
|
+
row_getUniqueValues: { fn: (row, columnId) => row_getUniqueValues(row, columnId) },
|
|
23
|
+
row_getValue: { fn: (row, columnId) => row_getValue(row, columnId) },
|
|
24
|
+
row_renderValue: { fn: (row, columnId) => row_renderValue(row, columnId) }
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
constructTableAPIs: (table) => {
|
|
28
|
+
assignTableAPIs("coreRowsFeature", table, {
|
|
29
|
+
table_getRowId: { fn: (originalRow, index, parent) => table_getRowId(originalRow, table, index, parent) },
|
|
30
|
+
table_getRow: { fn: (id, searchAll) => table_getRow(table, id, searchAll) }
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
42
34
|
|
|
43
35
|
//#endregion
|
|
44
|
-
export {
|
|
36
|
+
export { coreRowsFeature };
|
|
45
37
|
//# sourceMappingURL=coreRowsFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreRowsFeature.js","names":[],"sources":["../../../src/core/rows/coreRowsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n row_getAllCells,\n row_getAllCellsByColumnId,\n row_getLeafRows,\n row_getParentRow,\n row_getParentRows,\n row_getUniqueValues,\n row_getValue,\n row_renderValue,\n table_getRow,\n table_getRowId,\n} from './coreRowsFeature.utils'\nimport type {
|
|
1
|
+
{"version":3,"file":"coreRowsFeature.js","names":[],"sources":["../../../src/core/rows/coreRowsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n row_getAllCells,\n row_getAllCellsByColumnId,\n row_getLeafRows,\n row_getParentRow,\n row_getParentRows,\n row_getUniqueValues,\n row_getValue,\n row_renderValue,\n table_getRow,\n table_getRowId,\n} from './coreRowsFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that creates row APIs for values, cells, and tree traversal.\n */\nexport const coreRowsFeature: TableFeature = {\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreRowsFeature', prototype, table, {\n row_getAllCellsByColumnId: {\n fn: (row) => row_getAllCellsByColumnId(row),\n memoDeps: (row) => [row.getAllCells()],\n },\n row_getAllCells: {\n fn: (row) => row_getAllCells(row),\n memoDeps: (row) => [row.table.getAllLeafColumns()],\n },\n row_getLeafRows: {\n fn: (row) => row_getLeafRows(row),\n },\n row_getParentRow: {\n fn: (row) => row_getParentRow(row),\n },\n row_getParentRows: {\n fn: (row) => row_getParentRows(row),\n },\n row_getUniqueValues: {\n fn: (row, columnId) => row_getUniqueValues(row, columnId),\n },\n row_getValue: {\n fn: (row, columnId) => row_getValue(row, columnId),\n },\n row_renderValue: {\n fn: (row, columnId) => row_renderValue(row, columnId),\n },\n })\n },\n constructTableAPIs: (table) => {\n assignTableAPIs('coreRowsFeature', table, {\n table_getRowId: {\n fn: (originalRow, index, parent) =>\n table_getRowId(originalRow, table, index, parent),\n },\n table_getRow: {\n fn: (id: string, searchAll?: boolean) =>\n table_getRow(table, id, searchAll),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAkBA,MAAa,kBAAgC;CAC3C,qBAAqB,WAAW,UAAU;EACxC,oBAAoB,mBAAmB,WAAW,OAAO;GACvD,2BAA2B;IACzB,KAAK,QAAQ,0BAA0B,GAAG;IAC1C,WAAW,QAAQ,CAAC,IAAI,YAAY,CAAC;GACvC;GACA,iBAAiB;IACf,KAAK,QAAQ,gBAAgB,GAAG;IAChC,WAAW,QAAQ,CAAC,IAAI,MAAM,kBAAkB,CAAC;GACnD;GACA,iBAAiB,EACf,KAAK,QAAQ,gBAAgB,GAAG,EAClC;GACA,kBAAkB,EAChB,KAAK,QAAQ,iBAAiB,GAAG,EACnC;GACA,mBAAmB,EACjB,KAAK,QAAQ,kBAAkB,GAAG,EACpC;GACA,qBAAqB,EACnB,KAAK,KAAK,aAAa,oBAAoB,KAAK,QAAQ,EAC1D;GACA,cAAc,EACZ,KAAK,KAAK,aAAa,aAAa,KAAK,QAAQ,EACnD;GACA,iBAAiB,EACf,KAAK,KAAK,aAAa,gBAAgB,KAAK,QAAQ,EACtD;EACF,CAAC;CACH;CACA,qBAAqB,UAAU;EAC7B,gBAAgB,mBAAmB,OAAO;GACxC,gBAAgB,EACd,KAAK,aAAa,OAAO,WACvB,eAAe,aAAa,OAAO,OAAO,MAAM,EACpD;GACA,cAAc,EACZ,KAAK,IAAY,cACf,aAAa,OAAO,IAAI,SAAS,EACrC;EACF,CAAC;CACH;AACF"}
|
|
@@ -78,8 +78,8 @@ function constructTable(tableOptions) {
|
|
|
78
78
|
const key = stateKeys[i];
|
|
79
79
|
table.baseAtoms[key] = _reactivity.createWritableAtom(table.initialState[key], { debugName: `table/baseAtoms/${key}` });
|
|
80
80
|
table.atoms[key] = _reactivity.createReadonlyAtom(() => {
|
|
81
|
-
|
|
82
|
-
const externalAtom =
|
|
81
|
+
const externalAtoms = table.options.atoms;
|
|
82
|
+
const externalAtom = externalAtoms === null || externalAtoms === void 0 ? void 0 : externalAtoms[key];
|
|
83
83
|
if (externalAtom) return externalAtom.get();
|
|
84
84
|
return table.baseAtoms[key].get();
|
|
85
85
|
}, { debugName: `table/atoms/${key}` });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructTable.cjs","names":["cloneState","coreFeatures","atomToStore"],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { Atom } from '@tanstack/store'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions.features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions.features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature
|
|
1
|
+
{"version":3,"file":"constructTable.cjs","names":["cloneState","coreFeatures","atomToStore"],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { Atom } from '@tanstack/store'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState, TableState_All } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions.features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions.features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.wrapExternalAtoms && mergedOptions.atoms) {\n for (const [atomKey, _atom] of Object.entries(mergedOptions.atoms)) {\n const atom = _atom as Atom<any>\n const wrappedAtom = _reactivity.createWritableAtom(atom.get(), {\n debugName: `externalAtom/${atomKey}`,\n })\n ;(mergedOptions.atoms as any)[atomKey] = wrappedAtom\n // Two-way syncing between the original atom and the wrapped one.\n let syncExternal = false\n const syncAtomToWrappedSub = atom.subscribe((value) => {\n if (syncExternal) return\n wrappedAtom.set(value)\n })\n const syncWrappedToAtomSub = wrappedAtom.subscribe((value) => {\n syncExternal = true\n atom.set(value)\n syncExternal = false\n })\n _reactivity.addSubscription(syncAtomToWrappedSub)\n _reactivity.addSubscription(syncWrappedToAtomSub)\n }\n }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState_All\n >\n\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtoms = table.options.atoms as\n | Partial<Record<keyof TableState_All, Atom<unknown>>>\n | undefined\n const externalAtom = externalAtoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key]!.get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures> & TableState_All\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n ;(snapshot as Record<string, unknown>)[key] = table.atoms[key]!.get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.keys(table.options.rowModels || {})\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (let i = 0; i < featuresList.length; i++) {\n featuresList[i]!.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":"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"}
|
|
@@ -78,8 +78,8 @@ function constructTable(tableOptions) {
|
|
|
78
78
|
const key = stateKeys[i];
|
|
79
79
|
table.baseAtoms[key] = _reactivity.createWritableAtom(table.initialState[key], { debugName: `table/baseAtoms/${key}` });
|
|
80
80
|
table.atoms[key] = _reactivity.createReadonlyAtom(() => {
|
|
81
|
-
|
|
82
|
-
const externalAtom =
|
|
81
|
+
const externalAtoms = table.options.atoms;
|
|
82
|
+
const externalAtom = externalAtoms === null || externalAtoms === void 0 ? void 0 : externalAtoms[key];
|
|
83
83
|
if (externalAtom) return externalAtom.get();
|
|
84
84
|
return table.baseAtoms[key].get();
|
|
85
85
|
}, { debugName: `table/atoms/${key}` });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructTable.js","names":[],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { Atom } from '@tanstack/store'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions.features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions.features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature
|
|
1
|
+
{"version":3,"file":"constructTable.js","names":[],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { Atom } from '@tanstack/store'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState, TableState_All } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions.features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions.features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.wrapExternalAtoms && mergedOptions.atoms) {\n for (const [atomKey, _atom] of Object.entries(mergedOptions.atoms)) {\n const atom = _atom as Atom<any>\n const wrappedAtom = _reactivity.createWritableAtom(atom.get(), {\n debugName: `externalAtom/${atomKey}`,\n })\n ;(mergedOptions.atoms as any)[atomKey] = wrappedAtom\n // Two-way syncing between the original atom and the wrapped one.\n let syncExternal = false\n const syncAtomToWrappedSub = atom.subscribe((value) => {\n if (syncExternal) return\n wrappedAtom.set(value)\n })\n const syncWrappedToAtomSub = wrappedAtom.subscribe((value) => {\n syncExternal = true\n atom.set(value)\n syncExternal = false\n })\n _reactivity.addSubscription(syncAtomToWrappedSub)\n _reactivity.addSubscription(syncWrappedToAtomSub)\n }\n }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState_All\n >\n\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtoms = table.options.atoms as\n | Partial<Record<keyof TableState_All, Atom<unknown>>>\n | undefined\n const externalAtom = externalAtoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key]!.get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures> & TableState_All\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n ;(snapshot as Record<string, unknown>)[key] = table.atoms[key]!.get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.keys(table.options.rowModels || {})\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (let i = 0; i < featuresList.length; i++) {\n featuresList[i]!.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":"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"}
|
|
@@ -3,24 +3,15 @@ const require_coreTablesFeature_utils = require('./coreTablesFeature.utils.cjs')
|
|
|
3
3
|
|
|
4
4
|
//#region src/core/table/coreTablesFeature.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
6
|
+
* Core feature that adds base table instance APIs such as reset and setOptions.
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} };
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The Core Tables feature provides the core table functionality for handling state and options.
|
|
20
|
-
*/
|
|
21
|
-
const coreTablesFeature = constructCoreTablesFeature();
|
|
8
|
+
const coreTablesFeature = { constructTableAPIs: (table) => {
|
|
9
|
+
require_utils.assignTableAPIs("coreTablesFeature", table, {
|
|
10
|
+
table_reset: { fn: () => require_coreTablesFeature_utils.table_reset(table) },
|
|
11
|
+
table_setOptions: { fn: (updater) => require_coreTablesFeature_utils.table_setOptions(table, updater) }
|
|
12
|
+
});
|
|
13
|
+
} };
|
|
22
14
|
|
|
23
15
|
//#endregion
|
|
24
|
-
exports.constructCoreTablesFeature = constructCoreTablesFeature;
|
|
25
16
|
exports.coreTablesFeature = coreTablesFeature;
|
|
26
17
|
//# sourceMappingURL=coreTablesFeature.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreTablesFeature.cjs","names":["table_reset","table_setOptions"],"sources":["../../../src/core/table/coreTablesFeature.ts"],"sourcesContent":["import { assignTableAPIs } from '../../utils'\nimport { table_reset, table_setOptions } from './coreTablesFeature.utils'\nimport type {
|
|
1
|
+
{"version":3,"file":"coreTablesFeature.cjs","names":["table_reset","table_setOptions"],"sources":["../../../src/core/table/coreTablesFeature.ts"],"sourcesContent":["import { assignTableAPIs } from '../../utils'\nimport { table_reset, table_setOptions } from './coreTablesFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that adds base table instance APIs such as reset and setOptions.\n */\nexport const coreTablesFeature: TableFeature = {\n constructTableAPIs: (table) => {\n assignTableAPIs('coreTablesFeature', table, {\n table_reset: {\n fn: () => table_reset(table),\n },\n table_setOptions: {\n fn: (updater) => table_setOptions(table, updater),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAOA,MAAa,oBAAkC,EAC7C,qBAAqB,UAAU;CAC7B,8BAAgB,qBAAqB,OAAO;EAC1C,aAAa,EACX,UAAUA,4CAAY,KAAK,EAC7B;EACA,kBAAkB,EAChB,KAAK,YAAYC,iDAAiB,OAAO,OAAO,EAClD;CACF,CAAC;AACH,EACF"}
|