@tanstack/table-core 9.0.0-beta.5 → 9.0.0-beta.51
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/README.md +2 -0
- package/dist/core/cells/constructCell.cjs +1 -4
- package/dist/core/cells/constructCell.cjs.map +1 -1
- package/dist/core/cells/constructCell.d.cts +4 -4
- package/dist/core/cells/constructCell.d.ts +4 -4
- package/dist/core/cells/constructCell.js +1 -4
- package/dist/core/cells/constructCell.js.map +1 -1
- package/dist/core/cells/coreCellsFeature.types.d.cts +7 -7
- package/dist/core/cells/coreCellsFeature.types.d.ts +7 -7
- package/dist/core/cells/coreCellsFeature.utils.d.cts +4 -4
- package/dist/core/cells/coreCellsFeature.utils.d.ts +4 -4
- package/dist/core/columns/constructColumn.cjs +4 -5
- package/dist/core/columns/constructColumn.cjs.map +1 -1
- package/dist/core/columns/constructColumn.d.cts +3 -3
- package/dist/core/columns/constructColumn.d.ts +3 -3
- package/dist/core/columns/constructColumn.js +4 -5
- package/dist/core/columns/constructColumn.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.cjs +12 -18
- package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.js +12 -18
- package/dist/core/columns/coreColumnsFeature.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.types.d.cts +7 -7
- package/dist/core/columns/coreColumnsFeature.types.d.ts +7 -7
- package/dist/core/columns/coreColumnsFeature.utils.cjs +4 -8
- package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +9 -9
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +9 -9
- package/dist/core/columns/coreColumnsFeature.utils.js +5 -9
- package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
- package/dist/core/coreFeatures.cjs.map +1 -1
- package/dist/core/coreFeatures.d.cts +1 -1
- package/dist/core/coreFeatures.d.ts +1 -1
- package/dist/core/coreFeatures.js.map +1 -1
- package/dist/core/headers/buildHeaderGroups.cjs +1 -2
- package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
- package/dist/core/headers/buildHeaderGroups.d.cts +2 -2
- package/dist/core/headers/buildHeaderGroups.d.ts +2 -2
- package/dist/core/headers/buildHeaderGroups.js +1 -2
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/constructHeader.cjs +1 -4
- package/dist/core/headers/constructHeader.cjs.map +1 -1
- package/dist/core/headers/constructHeader.d.cts +2 -2
- package/dist/core/headers/constructHeader.d.ts +2 -2
- package/dist/core/headers/constructHeader.js +1 -4
- package/dist/core/headers/constructHeader.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.cjs +8 -11
- package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.js +8 -11
- package/dist/core/headers/coreHeadersFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.types.d.cts +6 -6
- package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -6
- package/dist/core/headers/coreHeadersFeature.utils.cjs +8 -10
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +6 -6
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +6 -6
- package/dist/core/headers/coreHeadersFeature.utils.js +8 -10
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.types.d.cts +7 -15
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +7 -15
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs +8 -26
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +16 -16
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +16 -16
- package/dist/core/row-models/coreRowModelsFeature.utils.js +8 -26
- package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
- package/dist/core/row-models/createCoreRowModel.cjs +4 -6
- package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
- package/dist/core/row-models/createCoreRowModel.d.cts +2 -2
- package/dist/core/row-models/createCoreRowModel.d.ts +2 -2
- package/dist/core/row-models/createCoreRowModel.js +5 -7
- package/dist/core/row-models/createCoreRowModel.js.map +1 -1
- package/dist/core/rows/constructRow.cjs +6 -10
- package/dist/core/rows/constructRow.cjs.map +1 -1
- package/dist/core/rows/constructRow.d.cts +2 -2
- package/dist/core/rows/constructRow.d.ts +2 -2
- package/dist/core/rows/constructRow.js +7 -10
- package/dist/core/rows/constructRow.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.cjs +18 -2
- package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.js +19 -3
- package/dist/core/rows/coreRowsFeature.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.types.d.cts +41 -7
- package/dist/core/rows/coreRowsFeature.types.d.ts +41 -7
- package/dist/core/rows/coreRowsFeature.utils.cjs +62 -8
- package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.utils.d.cts +24 -5
- package/dist/core/rows/coreRowsFeature.utils.d.ts +24 -5
- package/dist/core/rows/coreRowsFeature.utils.js +61 -10
- package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
- package/dist/core/table/constructTable.cjs +24 -14
- package/dist/core/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.d.cts +1 -1
- package/dist/core/table/constructTable.d.ts +1 -1
- package/dist/core/table/constructTable.js +24 -14
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +32 -19
- package/dist/core/table/coreTablesFeature.types.d.ts +32 -19
- package/dist/core/table/coreTablesFeature.utils.cjs +38 -14
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +10 -7
- package/dist/core/table/coreTablesFeature.utils.d.ts +10 -7
- package/dist/core/table/coreTablesFeature.utils.js +38 -14
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/experimental-worker-plugin.cjs +14 -0
- package/dist/experimental-worker-plugin.d.cts +5 -0
- package/dist/experimental-worker-plugin.d.ts +5 -0
- package/dist/experimental-worker-plugin.js +6 -0
- package/dist/features/column-faceting/columnFacetingFeature.cjs +12 -18
- package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.js +12 -18
- package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +15 -33
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +15 -33
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +23 -12
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +9 -9
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +9 -9
- package/dist/features/column-faceting/columnFacetingFeature.utils.js +24 -12
- package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs +7 -4
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.js +8 -5
- package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.cjs +10 -15
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.d.cts +2 -2
- package/dist/features/column-faceting/createFacetedRowModel.d.ts +2 -2
- package/dist/features/column-faceting/createFacetedRowModel.js +10 -15
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs +10 -6
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.js +11 -7
- package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.cjs +2 -2
- package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.js +3 -3
- package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +83 -29
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +83 -29
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +23 -17
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +18 -14
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +18 -14
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +23 -17
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.cjs +29 -25
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.cts +10 -4
- package/dist/features/column-filtering/createFilteredRowModel.d.ts +10 -4
- package/dist/features/column-filtering/createFilteredRowModel.js +30 -26
- package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
- package/dist/features/column-filtering/filterFns.cjs +399 -0
- package/dist/features/column-filtering/filterFns.cjs.map +1 -0
- package/dist/features/column-filtering/filterFns.d.cts +210 -0
- package/dist/features/column-filtering/filterFns.d.ts +210 -0
- package/dist/features/column-filtering/filterFns.js +375 -0
- package/dist/features/column-filtering/filterFns.js.map +1 -0
- package/dist/features/column-filtering/filterRowsUtils.cjs +3 -2
- package/dist/features/column-filtering/filterRowsUtils.cjs.map +1 -1
- package/dist/features/column-filtering/filterRowsUtils.js +3 -2
- package/dist/features/column-filtering/filterRowsUtils.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.cjs +4 -16
- package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.cts +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.ts +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.js +6 -18
- package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +14 -50
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +14 -50
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +6 -61
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +12 -49
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +12 -49
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +8 -60
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.cjs +37 -24
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.d.cts +6 -4
- package/dist/features/column-grouping/createGroupedRowModel.d.ts +6 -4
- package/dist/features/column-grouping/createGroupedRowModel.js +39 -26
- package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.cjs +17 -21
- package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.js +18 -22
- package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +28 -3
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +28 -3
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +35 -15
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +26 -14
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +26 -14
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +36 -17
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.cjs +124 -143
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.d.cts +6 -1
- package/dist/features/column-pinning/columnPinningFeature.d.ts +6 -1
- package/dist/features/column-pinning/columnPinningFeature.js +125 -144
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +52 -41
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +52 -41
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +161 -162
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +101 -92
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +101 -92
- package/dist/features/column-pinning/columnPinningFeature.utils.js +148 -149
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +1 -4
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +1 -4
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +84 -44
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +6 -6
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +6 -6
- package/dist/features/column-resizing/columnResizingFeature.utils.js +85 -45
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +33 -67
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.js +34 -68
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +52 -9
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +52 -9
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +88 -45
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +43 -25
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +43 -25
- package/dist/features/column-sizing/columnSizingFeature.utils.js +88 -46
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +25 -36
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.js +25 -36
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +30 -29
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +18 -18
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +18 -18
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +31 -30
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.cjs +1 -2
- package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.js +1 -2
- package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +2 -2
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +2 -2
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +6 -6
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +8 -11
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +8 -11
- package/dist/features/global-filtering/globalFilteringFeature.utils.js +6 -6
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/features/row-aggregation/aggregationFns.cjs +246 -0
- package/dist/features/row-aggregation/aggregationFns.cjs.map +1 -0
- package/dist/features/row-aggregation/aggregationFns.d.cts +68 -0
- package/dist/features/row-aggregation/aggregationFns.d.ts +68 -0
- package/dist/features/row-aggregation/aggregationFns.js +235 -0
- package/dist/features/row-aggregation/aggregationFns.js.map +1 -0
- package/dist/features/row-aggregation/rowAggregationFeature.cjs +39 -0
- package/dist/features/row-aggregation/rowAggregationFeature.cjs.map +1 -0
- package/dist/features/row-aggregation/rowAggregationFeature.d.cts +10 -0
- package/dist/features/row-aggregation/rowAggregationFeature.d.ts +10 -0
- package/dist/features/row-aggregation/rowAggregationFeature.js +39 -0
- package/dist/features/row-aggregation/rowAggregationFeature.js.map +1 -0
- package/dist/features/row-aggregation/rowAggregationFeature.types.cjs +13 -0
- package/dist/features/row-aggregation/rowAggregationFeature.types.cjs.map +1 -0
- package/dist/features/row-aggregation/rowAggregationFeature.types.d.cts +195 -0
- package/dist/features/row-aggregation/rowAggregationFeature.types.d.ts +195 -0
- package/dist/features/row-aggregation/rowAggregationFeature.types.js +12 -0
- package/dist/features/row-aggregation/rowAggregationFeature.types.js.map +1 -0
- package/dist/features/row-aggregation/rowAggregationFeature.utils.cjs +212 -0
- package/dist/features/row-aggregation/rowAggregationFeature.utils.cjs.map +1 -0
- package/dist/features/row-aggregation/rowAggregationFeature.utils.d.cts +34 -0
- package/dist/features/row-aggregation/rowAggregationFeature.utils.d.ts +34 -0
- package/dist/features/row-aggregation/rowAggregationFeature.utils.js +206 -0
- package/dist/features/row-aggregation/rowAggregationFeature.utils.js.map +1 -0
- package/dist/features/row-expanding/createExpandedRowModel.cjs +6 -10
- package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.d.cts +2 -2
- package/dist/features/row-expanding/createExpandedRowModel.d.ts +2 -2
- package/dist/features/row-expanding/createExpandedRowModel.js +6 -10
- package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +6 -15
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +6 -15
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +28 -26
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +10 -10
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +10 -10
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +29 -27
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.cjs +6 -10
- package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.d.cts +2 -2
- package/dist/features/row-pagination/createPaginatedRowModel.d.ts +2 -2
- package/dist/features/row-pagination/createPaginatedRowModel.js +6 -10
- package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +5 -14
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +5 -14
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +9 -15
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +17 -17
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +17 -17
- package/dist/features/row-pagination/rowPaginationFeature.utils.js +9 -15
- package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.cjs +4 -16
- package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.js +4 -16
- package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.types.d.cts +2 -2
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +2 -2
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +9 -14
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +7 -7
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +7 -7
- package/dist/features/row-pinning/rowPinningFeature.utils.js +9 -14
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs +66 -22
- package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.js +67 -23
- package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +49 -11
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +49 -11
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +128 -72
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +57 -30
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +57 -30
- package/dist/features/row-selection/rowSelectionFeature.utils.js +129 -74
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs +69 -50
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.d.cts +10 -4
- package/dist/features/row-sorting/createSortedRowModel.d.ts +10 -4
- package/dist/features/row-sorting/createSortedRowModel.js +70 -51
- package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +54 -22
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +54 -22
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +31 -17
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +16 -16
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +16 -16
- package/dist/features/row-sorting/rowSortingFeature.utils.js +31 -17
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/sortFns.cjs +226 -0
- package/dist/features/row-sorting/sortFns.cjs.map +1 -0
- package/dist/features/row-sorting/sortFns.d.cts +98 -0
- package/dist/features/row-sorting/sortFns.d.ts +98 -0
- package/dist/features/row-sorting/sortFns.js +217 -0
- package/dist/features/row-sorting/sortFns.js.map +1 -0
- package/dist/features/stockFeatures.cjs +2 -0
- package/dist/features/stockFeatures.cjs.map +1 -1
- package/dist/features/stockFeatures.d.cts +2 -0
- package/dist/features/stockFeatures.d.ts +2 -0
- package/dist/features/stockFeatures.js +2 -0
- package/dist/features/stockFeatures.js.map +1 -1
- package/dist/flex-render.d.cts +1 -1
- package/dist/flex-render.d.ts +1 -1
- package/dist/helpers/columnHelper.cjs.map +1 -1
- package/dist/helpers/columnHelper.d.cts +2 -2
- package/dist/helpers/columnHelper.d.ts +2 -2
- package/dist/helpers/columnHelper.js.map +1 -1
- package/dist/helpers/metaHelper.cjs +30 -0
- package/dist/helpers/metaHelper.cjs.map +1 -0
- package/dist/helpers/metaHelper.d.cts +26 -0
- package/dist/helpers/metaHelper.d.ts +26 -0
- package/dist/helpers/metaHelper.js +29 -0
- package/dist/helpers/metaHelper.js.map +1 -0
- package/dist/helpers/tableFeatures.cjs +32 -3
- package/dist/helpers/tableFeatures.cjs.map +1 -1
- package/dist/helpers/tableFeatures.d.cts +34 -5
- package/dist/helpers/tableFeatures.d.ts +34 -5
- package/dist/helpers/tableFeatures.js +32 -3
- package/dist/helpers/tableFeatures.js.map +1 -1
- package/dist/index.cjs +23 -3
- package/dist/index.d.cts +31 -28
- package/dist/index.d.ts +31 -28
- package/dist/index.js +8 -5
- package/dist/static-functions.cjs +30 -19
- package/dist/static-functions.d.cts +8 -7
- package/dist/static-functions.d.ts +8 -7
- package/dist/static-functions.js +8 -7
- package/dist/store-reactivity-bindings.cjs +3 -3
- package/dist/store-reactivity-bindings.cjs.map +1 -1
- package/dist/store-reactivity-bindings.d.cts +1 -1
- package/dist/store-reactivity-bindings.d.ts +1 -1
- package/dist/store-reactivity-bindings.js +3 -3
- package/dist/store-reactivity-bindings.js.map +1 -1
- package/dist/types/Cell.d.cts +4 -2
- package/dist/types/Cell.d.ts +4 -2
- package/dist/types/Column.d.cts +15 -15
- package/dist/types/Column.d.ts +15 -15
- package/dist/types/ColumnDef.d.cts +30 -14
- package/dist/types/ColumnDef.d.ts +30 -14
- package/dist/types/Header.d.cts +2 -2
- package/dist/types/Header.d.ts +2 -2
- package/dist/types/HeaderGroup.d.cts +2 -2
- package/dist/types/HeaderGroup.d.ts +2 -2
- package/dist/types/Row.d.cts +6 -4
- package/dist/types/Row.d.ts +6 -4
- package/dist/types/RowModel.d.cts +11 -23
- package/dist/types/RowModel.d.ts +11 -23
- package/dist/types/RowModelFns.d.cts +4 -4
- package/dist/types/RowModelFns.d.ts +4 -4
- package/dist/types/Table.d.cts +26 -31
- package/dist/types/Table.d.ts +26 -31
- package/dist/types/TableFeatures.d.cts +350 -22
- package/dist/types/TableFeatures.d.ts +350 -22
- package/dist/types/TableOptions.d.cts +22 -14
- package/dist/types/TableOptions.d.ts +22 -14
- package/dist/types/TableState.d.cts +6 -6
- package/dist/types/TableState.d.ts +6 -6
- package/dist/types/type-utils.d.cts +8 -1
- package/dist/types/type-utils.d.ts +8 -1
- package/dist/utils.cjs +51 -29
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +30 -8
- package/dist/utils.d.ts +30 -8
- package/dist/utils.js +49 -30
- package/dist/utils.js.map +1 -1
- package/dist/worker/createTableWorker.cjs +189 -0
- package/dist/worker/createTableWorker.cjs.map +1 -0
- package/dist/worker/createTableWorker.d.cts +102 -0
- package/dist/worker/createTableWorker.d.ts +102 -0
- package/dist/worker/createTableWorker.js +186 -0
- package/dist/worker/createTableWorker.js.map +1 -0
- package/dist/worker/createWorkerRowModel.cjs +78 -0
- package/dist/worker/createWorkerRowModel.cjs.map +1 -0
- package/dist/worker/createWorkerRowModel.d.cts +42 -0
- package/dist/worker/createWorkerRowModel.d.ts +42 -0
- package/dist/worker/createWorkerRowModel.js +78 -0
- package/dist/worker/createWorkerRowModel.js.map +1 -0
- package/dist/worker/initTableWorker.cjs +100 -0
- package/dist/worker/initTableWorker.cjs.map +1 -0
- package/dist/worker/initTableWorker.d.cts +33 -0
- package/dist/worker/initTableWorker.d.ts +33 -0
- package/dist/worker/initTableWorker.js +100 -0
- package/dist/worker/initTableWorker.js.map +1 -0
- package/dist/worker/rebuildRowModel.cjs +72 -0
- package/dist/worker/rebuildRowModel.cjs.map +1 -0
- package/dist/worker/rebuildRowModel.d.cts +9 -0
- package/dist/worker/rebuildRowModel.d.ts +9 -0
- package/dist/worker/rebuildRowModel.js +72 -0
- package/dist/worker/rebuildRowModel.js.map +1 -0
- package/dist/worker/serializeRowModel.cjs +53 -0
- package/dist/worker/serializeRowModel.cjs.map +1 -0
- package/dist/worker/serializeRowModel.js +52 -0
- package/dist/worker/serializeRowModel.js.map +1 -0
- package/dist/worker/tableWorkerProtocol.cjs +29 -0
- package/dist/worker/tableWorkerProtocol.cjs.map +1 -0
- package/dist/worker/tableWorkerProtocol.d.cts +88 -0
- package/dist/worker/tableWorkerProtocol.d.ts +88 -0
- package/dist/worker/tableWorkerProtocol.js +27 -0
- package/dist/worker/tableWorkerProtocol.js.map +1 -0
- package/package.json +8 -3
- package/skills/aggregation/SKILL.md +141 -0
- package/skills/api-not-found/SKILL.md +113 -0
- package/skills/client-vs-server/SKILL.md +164 -0
- package/skills/column-faceting/SKILL.md +97 -0
- package/skills/column-filtering/SKILL.md +87 -0
- package/skills/column-ordering/SKILL.md +75 -0
- package/skills/column-pinning/SKILL.md +89 -0
- package/skills/column-resizing/SKILL.md +91 -0
- package/skills/column-sizing/SKILL.md +72 -0
- package/skills/column-visibility/SKILL.md +75 -0
- package/skills/core/SKILL.md +175 -0
- package/skills/custom-features/SKILL.md +235 -0
- package/skills/expanding/SKILL.md +80 -0
- package/skills/global-filtering/SKILL.md +84 -0
- package/skills/grouping/SKILL.md +51 -401
- package/skills/migrate-v8-to-v9/SKILL.md +274 -416
- package/skills/pagination/SKILL.md +37 -344
- package/skills/row-pinning/SKILL.md +47 -234
- package/skills/row-selection/SKILL.md +75 -302
- package/skills/sorting/SKILL.md +45 -303
- package/skills/table-features/SKILL.md +159 -0
- package/skills/typescript/SKILL.md +126 -0
- package/src/core/cells/coreCellsFeature.types.ts +6 -6
- package/src/core/columns/constructColumn.ts +6 -0
- package/src/core/columns/coreColumnsFeature.types.ts +8 -8
- package/src/core/columns/coreColumnsFeature.utils.ts +4 -4
- package/src/core/coreFeatures.ts +1 -1
- package/src/core/headers/buildHeaderGroups.ts +4 -2
- package/src/core/headers/coreHeadersFeature.types.ts +12 -12
- package/src/core/headers/coreHeadersFeature.utils.ts +7 -8
- package/src/core/row-models/coreRowModelsFeature.types.ts +6 -20
- package/src/core/row-models/coreRowModelsFeature.utils.ts +8 -8
- package/src/core/row-models/createCoreRowModel.ts +7 -6
- package/src/core/rows/constructRow.ts +4 -2
- package/src/core/rows/coreRowsFeature.ts +21 -0
- package/src/core/rows/coreRowsFeature.types.ts +45 -8
- package/src/core/rows/coreRowsFeature.utils.ts +93 -5
- package/src/core/table/constructTable.ts +44 -6
- package/src/core/table/coreTablesFeature.types.ts +45 -20
- package/src/core/table/coreTablesFeature.utils.ts +59 -19
- package/src/experimental-worker-plugin.ts +22 -0
- package/src/features/column-faceting/columnFacetingFeature.types.ts +17 -48
- package/src/features/column-faceting/columnFacetingFeature.utils.ts +53 -18
- package/src/features/column-faceting/createFacetedMinMaxValues.ts +33 -7
- package/src/features/column-faceting/createFacetedRowModel.ts +8 -1
- package/src/features/column-faceting/createFacetedUniqueValues.ts +41 -10
- package/src/features/column-filtering/columnFilteringFeature.ts +3 -2
- package/src/features/column-filtering/columnFilteringFeature.types.ts +117 -41
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +37 -23
- package/src/features/column-filtering/createFilteredRowModel.ts +28 -17
- package/src/features/column-filtering/filterFns.ts +533 -0
- package/src/features/column-filtering/filterRowsUtils.ts +3 -2
- package/src/features/column-grouping/columnGroupingFeature.ts +3 -21
- package/src/features/column-grouping/columnGroupingFeature.types.ts +21 -95
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +4 -87
- package/src/features/column-grouping/createGroupedRowModel.ts +46 -45
- package/src/features/column-ordering/columnOrderingFeature.ts +12 -7
- package/src/features/column-ordering/columnOrderingFeature.types.ts +29 -3
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +59 -8
- package/src/features/column-pinning/columnPinningFeature.ts +76 -59
- package/src/features/column-pinning/columnPinningFeature.types.ts +53 -42
- package/src/features/column-pinning/columnPinningFeature.utils.ts +184 -170
- package/src/features/column-resizing/columnResizingFeature.types.ts +1 -4
- package/src/features/column-resizing/columnResizingFeature.utils.ts +120 -52
- package/src/features/column-sizing/columnSizingFeature.ts +24 -24
- package/src/features/column-sizing/columnSizingFeature.types.ts +53 -8
- package/src/features/column-sizing/columnSizingFeature.utils.ts +143 -62
- package/src/features/column-visibility/columnVisibilityFeature.ts +4 -0
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +4 -4
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +48 -30
- package/src/features/global-filtering/globalFilteringFeature.types.ts +4 -4
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +13 -5
- package/src/features/row-aggregation/aggregationFns.ts +345 -0
- package/src/features/row-aggregation/rowAggregationFeature.ts +60 -0
- package/src/features/row-aggregation/rowAggregationFeature.types.ts +339 -0
- package/src/features/row-aggregation/rowAggregationFeature.utils.ts +430 -0
- package/src/features/row-expanding/rowExpandingFeature.types.ts +8 -23
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +38 -13
- package/src/features/row-pagination/createPaginatedRowModel.ts +1 -1
- package/src/features/row-pagination/rowPaginationFeature.types.ts +6 -21
- package/src/features/row-pagination/rowPaginationFeature.utils.ts +1 -1
- package/src/features/row-pinning/rowPinningFeature.types.ts +4 -4
- package/src/features/row-selection/rowSelectionFeature.ts +53 -3
- package/src/features/row-selection/rowSelectionFeature.types.ts +54 -10
- package/src/features/row-selection/rowSelectionFeature.utils.ts +273 -91
- package/src/features/row-sorting/createSortedRowModel.ts +107 -75
- package/src/features/row-sorting/rowSortingFeature.types.ts +87 -34
- package/src/features/row-sorting/rowSortingFeature.utils.ts +49 -23
- package/src/features/row-sorting/sortFns.ts +366 -0
- package/src/features/stockFeatures.ts +3 -0
- package/src/helpers/columnHelper.ts +4 -4
- package/src/helpers/metaHelper.ts +24 -0
- package/src/helpers/tableFeatures.ts +37 -5
- package/src/index.ts +8 -8
- package/src/static-functions.ts +1 -0
- package/src/store-reactivity-bindings.ts +1 -1
- package/src/types/Cell.ts +4 -2
- package/src/types/Column.ts +13 -9
- package/src/types/ColumnDef.ts +40 -10
- package/src/types/Header.ts +2 -2
- package/src/types/HeaderGroup.ts +6 -6
- package/src/types/Row.ts +6 -4
- package/src/types/RowModel.ts +19 -74
- package/src/types/RowModelFns.ts +10 -10
- package/src/types/Table.ts +52 -27
- package/src/types/TableFeatures.ts +392 -14
- package/src/types/TableOptions.ts +67 -14
- package/src/types/TableState.ts +15 -1
- package/src/types/type-utils.ts +8 -0
- package/src/utils.ts +60 -8
- package/src/worker/createTableWorker.ts +357 -0
- package/src/worker/createWorkerRowModel.ts +121 -0
- package/src/worker/initTableWorker.ts +164 -0
- package/src/worker/rebuildRowModel.ts +120 -0
- package/src/worker/serializeRowModel.ts +80 -0
- package/src/worker/tableWorkerProtocol.ts +105 -0
- package/dist/fns/aggregationFns.cjs +0 -161
- package/dist/fns/aggregationFns.cjs.map +0 -1
- package/dist/fns/aggregationFns.d.cts +0 -85
- package/dist/fns/aggregationFns.d.ts +0 -85
- package/dist/fns/aggregationFns.js +0 -151
- package/dist/fns/aggregationFns.js.map +0 -1
- package/dist/fns/filterFns.cjs +0 -201
- package/dist/fns/filterFns.cjs.map +0 -1
- package/dist/fns/filterFns.d.cts +0 -167
- package/dist/fns/filterFns.d.ts +0 -167
- package/dist/fns/filterFns.js +0 -185
- package/dist/fns/filterFns.js.map +0 -1
- package/dist/fns/sortFns.cjs +0 -118
- package/dist/fns/sortFns.cjs.map +0 -1
- package/dist/fns/sortFns.d.cts +0 -65
- package/dist/fns/sortFns.d.ts +0 -65
- package/dist/fns/sortFns.js +0 -110
- package/dist/fns/sortFns.js.map +0 -1
- package/skills/column-definitions/SKILL.md +0 -333
- package/skills/column-layout/SKILL.md +0 -328
- package/skills/column-layout/references/subsystems.md +0 -220
- package/skills/customizing-feature-behavior/SKILL.md +0 -416
- package/skills/filtering/SKILL.md +0 -357
- package/skills/filtering/references/faceting-and-fuzzy.md +0 -191
- package/skills/row-expanding/SKILL.md +0 -348
- package/skills/setup/SKILL.md +0 -400
- package/skills/state-management/SKILL.md +0 -388
- package/src/fns/aggregationFns.ts +0 -245
- package/src/fns/filterFns.ts +0 -382
- package/src/fns/sortFns.ts +0 -217
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RowData } from "../../types/type-utils.js";
|
|
2
2
|
import { TableState } from "../../types/TableState.js";
|
|
3
3
|
import { TableOptions } from "../../types/TableOptions.js";
|
|
4
|
-
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
5
4
|
import { Table } from "../../types/Table.js";
|
|
5
|
+
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
6
|
|
|
7
7
|
//#region src/core/table/constructTable.d.ts
|
|
8
8
|
/**
|
|
@@ -11,8 +11,7 @@ import { atomToStore } from "../reactivity/coreReactivityFeature.utils.js";
|
|
|
11
11
|
*/
|
|
12
12
|
function getInitialTableState(features, initialState = {}) {
|
|
13
13
|
Object.values(features).forEach((feature) => {
|
|
14
|
-
|
|
15
|
-
initialState = ((_feature$getInitialSt = feature.getInitialState) === null || _feature$getInitialSt === void 0 ? void 0 : _feature$getInitialSt.call(feature, initialState)) ?? initialState;
|
|
14
|
+
initialState = feature.getInitialState?.(initialState) ?? initialState;
|
|
16
15
|
});
|
|
17
16
|
return cloneState(initialState);
|
|
18
17
|
}
|
|
@@ -22,23 +21,27 @@ function getInitialTableState(features, initialState = {}) {
|
|
|
22
21
|
* This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.
|
|
23
22
|
*/
|
|
24
23
|
function constructTable(tableOptions) {
|
|
25
|
-
const _reactivity = tableOptions.features.
|
|
24
|
+
const _reactivity = tableOptions.features.coreReactivityFeature;
|
|
25
|
+
const { aggregationFns, columnMeta: _columnMeta, coreRowModel, expandedRowModel, facetedMinMaxValues, facetedRowModel, facetedUniqueValues, filterFns, filterMeta: _filterMeta, filteredRowModel, groupedRowModel, paginatedRowModel, sortFns, sortedRowModel, tableMeta: _tableMeta, ...features } = tableOptions.features;
|
|
26
26
|
const table = {
|
|
27
27
|
_reactivity,
|
|
28
28
|
_features: {
|
|
29
29
|
...coreFeatures,
|
|
30
|
-
...
|
|
30
|
+
...features
|
|
31
31
|
},
|
|
32
32
|
_rowModels: {},
|
|
33
|
-
_rowModelFns: {
|
|
33
|
+
_rowModelFns: {
|
|
34
|
+
aggregationFns,
|
|
35
|
+
filterFns,
|
|
36
|
+
sortFns
|
|
37
|
+
},
|
|
34
38
|
baseAtoms: {},
|
|
35
39
|
atoms: {}
|
|
36
40
|
};
|
|
37
41
|
const featuresList = Object.values(table._features);
|
|
38
42
|
const mergedOptions = {
|
|
39
43
|
...featuresList.reduce((obj, feature) => {
|
|
40
|
-
|
|
41
|
-
return Object.assign(obj, (_feature$getDefaultTa = feature.getDefaultTableOptions) === null || _feature$getDefaultTa === void 0 ? void 0 : _feature$getDefaultTa.call(feature, table));
|
|
44
|
+
return Object.assign(obj, feature.getDefaultTableOptions?.(table));
|
|
42
45
|
}, {}),
|
|
43
46
|
...tableOptions
|
|
44
47
|
};
|
|
@@ -78,8 +81,7 @@ function constructTable(tableOptions) {
|
|
|
78
81
|
const key = stateKeys[i];
|
|
79
82
|
table.baseAtoms[key] = _reactivity.createWritableAtom(table.initialState[key], { debugName: `table/baseAtoms/${key}` });
|
|
80
83
|
table.atoms[key] = _reactivity.createReadonlyAtom(() => {
|
|
81
|
-
const
|
|
82
|
-
const externalAtom = externalAtoms === null || externalAtoms === void 0 ? void 0 : externalAtoms[key];
|
|
84
|
+
const externalAtom = table.options.atoms?.[key];
|
|
83
85
|
if (externalAtom) return externalAtom.get();
|
|
84
86
|
return table.baseAtoms[key].get();
|
|
85
87
|
}, { debugName: `table/atoms/${key}` });
|
|
@@ -93,9 +95,20 @@ function constructTable(tableOptions) {
|
|
|
93
95
|
}
|
|
94
96
|
return snapshot;
|
|
95
97
|
}, { debugName: "table/store" }));
|
|
98
|
+
for (let i = 0; i < featuresList.length; i++) featuresList[i].initTableInstanceData?.(table);
|
|
96
99
|
if (process.env.NODE_ENV === "development" && (tableOptions.debugAll || tableOptions.debugTable)) {
|
|
97
100
|
const features = Object.keys(table._features);
|
|
98
|
-
const rowModels = Object.
|
|
101
|
+
const rowModels = Object.entries({
|
|
102
|
+
coreRowModel,
|
|
103
|
+
filteredRowModel,
|
|
104
|
+
groupedRowModel,
|
|
105
|
+
sortedRowModel,
|
|
106
|
+
expandedRowModel,
|
|
107
|
+
paginatedRowModel,
|
|
108
|
+
facetedRowModel,
|
|
109
|
+
facetedMinMaxValues,
|
|
110
|
+
facetedUniqueValues
|
|
111
|
+
}).filter(([, factory]) => factory).map(([key]) => key);
|
|
99
112
|
const states = Object.keys(table.initialState);
|
|
100
113
|
console.log(`Constructing Table Instance
|
|
101
114
|
|
|
@@ -105,10 +118,7 @@ function constructTable(tableOptions) {
|
|
|
105
118
|
|
|
106
119
|
States: ${states.join("\n ")}\n`, { table });
|
|
107
120
|
}
|
|
108
|
-
for (let i = 0; i < featuresList.length; i++)
|
|
109
|
-
var _constructTableAPIs, _ref;
|
|
110
|
-
(_constructTableAPIs = (_ref = featuresList[i]).constructTableAPIs) === null || _constructTableAPIs === void 0 || _constructTableAPIs.call(_ref, table);
|
|
111
|
-
}
|
|
121
|
+
for (let i = 0; i < featuresList.length; i++) featuresList[i].constructTableAPIs?.(table);
|
|
112
122
|
return table;
|
|
113
123
|
}
|
|
114
124
|
|
|
@@ -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, 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.
|
|
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.coreReactivityFeature!\n\n // Strip the non-feature slots: type-only meta slots, row model factories,\n // and row model fn registries all live on the `features` option but are not\n // table features themselves.\n const {\n aggregationFns,\n columnMeta: _columnMeta,\n coreRowModel,\n expandedRowModel,\n facetedMinMaxValues,\n facetedRowModel,\n facetedUniqueValues,\n filterFns,\n filterMeta: _filterMeta,\n filteredRowModel,\n groupedRowModel,\n paginatedRowModel,\n sortFns,\n sortedRowModel,\n tableMeta: _tableMeta,\n ...features\n } = tableOptions.features\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...features },\n _rowModels: {},\n _rowModelFns: { aggregationFns, filterFns, sortFns },\n baseAtoms: {},\n atoms: {},\n } as unknown 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 for (let i = 0; i < featuresList.length; i++) {\n featuresList[i]!.initTableInstanceData?.(table)\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.entries({\n coreRowModel,\n filteredRowModel,\n groupedRowModel,\n sortedRowModel,\n expandedRowModel,\n paginatedRowModel,\n facetedRowModel,\n facetedMinMaxValues,\n facetedUniqueValues,\n })\n .filter(([, factory]) => factory)\n .map(([key]) => key)\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 as unknown as Table<TFeatures, TData>\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAgB,qBACd,UACA,eAA2D,CAAC,GACrC;CACvB,OAAO,OAAO,QAAQ,CAAC,CAAC,SAAS,YAAY;EAC3C,eAAe,QAAQ,kBAAkB,YAAY,KAAK;CAC5D,CAAC;CACD,OAAO,WAAW,YAAY;AAChC;;;;;;AAOA,SAAgB,eAGd,cAAuE;CACvE,MAAM,cAAc,aAAa,SAAS;CAK1C,MAAM,EACJ,gBACA,YAAY,aACZ,cACA,kBACA,qBACA,iBACA,qBACA,WACA,YAAY,aACZ,kBACA,iBACA,mBACA,SACA,gBACA,WAAW,YACX,GAAG,aACD,aAAa;CAEjB,MAAM,QAAQ;EACZ;EACA,WAAW;GAAE,GAAG;GAAc,GAAG;EAAS;EAC1C,YAAY,CAAC;EACb,cAAc;GAAE;GAAgB;GAAW;EAAQ;EACnD,WAAW,CAAC;EACZ,OAAO,CAAC;CACV;CAEA,MAAM,eAAoC,OAAO,OAAO,MAAM,SAAS;CAMvE,MAAM,gBAAgB;EAAE,GAJD,aAAa,QAAQ,KAAK,YAAY;GAC3D,OAAO,OAAO,OAAO,KAAK,QAAQ,yBAAyB,KAAK,CAAC;EACnE,GAAG,CAAC,CAEoC;EAAG,GAAG;CAAa;CAE3D,IAAI,YAAY,qBAAqB,cAAc,OACjD,KAAK,MAAM,CAAC,SAAS,UAAU,OAAO,QAAQ,cAAc,KAAK,GAAG;EAClE,MAAM,OAAO;EACb,MAAM,cAAc,YAAY,mBAAmB,KAAK,IAAI,GAAG,EAC7D,WAAW,gBAAgB,UAC7B,CAAC;EACA,AAAC,cAAc,MAAc,WAAW;EAEzC,IAAI,eAAe;EACnB,MAAM,uBAAuB,KAAK,WAAW,UAAU;GACrD,IAAI,cAAc;GAClB,YAAY,IAAI,KAAK;EACvB,CAAC;EACD,MAAM,uBAAuB,YAAY,WAAW,UAAU;GAC5D,eAAe;GACf,KAAK,IAAI,KAAK;GACd,eAAe;EACjB,CAAC;EACD,YAAY,gBAAgB,oBAAoB;EAChD,YAAY,gBAAgB,oBAAoB;CAClD;CAGF,IAAI,YAAY,oBAAoB;EAElC,MAAM,eAAe,YAAY,mBAE/B,eAAe,EAAE,WAAW,qBAAqB,CAAC;EACpD,OAAO,eAAe,OAAO,WAAW;GACtC,cAAc;GACd,YAAY;GACZ,MAAM;IACJ,OAAO,MAAM,aAAc,IAAI;GACjC;GACA,IAAI,OAAO;IACT,MAAM,aAAc,UAAU,KAAK;GACrC;EACF,CAAC;CACH,OACE,MAAM,UAAU;CAGlB,MAAM,eAAe,qBACnB,MAAM,WACN,MAAM,QAAQ,YAChB;CAEA,MAAM,YAAY,OAAO,KAAK,MAAM,YAAY;CAIhD,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;EACzC,MAAM,MAAM,UAAU;EACtB,MAAM,UAAU,OAAO,YAAY,mBACjC,MAAM,aAAa,MACnB,EACE,WAAW,mBAAmB,MAChC,CACF;EAGC,AAAC,MAAM,MAAc,OAAO,YAAY,yBACjC;GAIJ,MAAM,eAHgB,MAAM,QAAQ,QAGC;GACrC,IAAI,cACF,OAAO,aAAa,IAAI;GAE1B,OAAO,MAAM,UAAU,IAAI,CAAE,IAAI;EACnC,GACA,EAAE,WAAW,eAAe,MAAM,CACpC;CACF;CAEA,mCAAmC,KAAK;CAExC,MAAM,QAAQ,YACZ,YAAY,yBACJ;EACJ,MAAM,WAAW,CAAC;EAClB,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;GACzC,MAAM,MAAM,UAAU;GACrB,AAAC,SAAqC,OAAO,MAAM,MAAM,IAAI,CAAE,IAAI;EACtE;EACA,OAAO;CACT,GACA,EAAE,WAAW,cAAc,CAC7B,CACF;CAEA,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KACvC,aAAa,EAAE,CAAE,wBAAwB,KAAK;CAGhD,IACE,QAAQ,IAAI,aAAa,kBACxB,aAAa,YAAY,aAAa,aACvC;EACA,MAAM,WAAW,OAAO,KAAK,MAAM,SAAS;EAC5C,MAAM,YAAY,OAAO,QAAQ;GAC/B;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC,CAAC,CACC,QAAQ,GAAG,aAAa,OAAO,CAAC,CAChC,KAAK,CAAC,SAAS,GAAG;EACrB,MAAM,SAAS,OAAO,KAAK,MAAM,YAAY;EAE7C,QAAQ,IACN;;gBAEU,SAAS,KAAK,kBAAkB,EAAE;;gBAElC,UAAU,SAAS,UAAU,KAAK,kBAAkB,IAAI,SAAS;;gBAEjE,OAAO,KAAK,kBAAkB,EAAE,KAC1C,EAAE,MAAM,CACV;CACF;CAEA,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KACvC,aAAa,EAAE,CAAE,qBAAqB,KAAK;CAG7C,OAAO;AACT"}
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { RowData, Updater } from "../../types/type-utils.cjs";
|
|
2
2
|
import { TableReactivityBindings } from "../reactivity/coreReactivityFeature.types.cjs";
|
|
3
3
|
import { CoreFeatures } from "../coreFeatures.cjs";
|
|
4
|
+
import { CachedRowModels } from "../../types/RowModel.cjs";
|
|
4
5
|
import { RowModelFns } from "../../types/RowModelFns.cjs";
|
|
5
|
-
import { CachedRowModels, CreateRowModels_All } from "../../types/RowModel.cjs";
|
|
6
6
|
import { TableState, TableState_All } from "../../types/TableState.cjs";
|
|
7
7
|
import { TableOptions } from "../../types/TableOptions.cjs";
|
|
8
|
-
import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
8
|
+
import { IsAny, TableFeatures, ValidateFeatureSlots } from "../../types/TableFeatures.cjs";
|
|
9
9
|
import { Atom, ReadonlyAtom, ReadonlyStore } from "@tanstack/store";
|
|
10
10
|
|
|
11
11
|
//#region src/core/table/coreTablesFeature.types.d.ts
|
|
12
|
-
interface TableMeta<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
12
|
+
interface TableMeta<in out TFeatures extends TableFeatures, in out TData extends RowData> {}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the type of `options.meta` for a feature set.
|
|
15
|
+
*
|
|
16
|
+
* When the features object declares a `tableMeta` type-only slot
|
|
17
|
+
* (`tableFeatures({ ..., tableMeta: {} as MyTableMeta })`), that type wins.
|
|
18
|
+
* Otherwise this falls back to the global declaration-merged `TableMeta`
|
|
19
|
+
* interface.
|
|
20
|
+
*/
|
|
21
|
+
type ExtractTableMeta<TFeatures extends TableFeatures, TData extends RowData> = IsAny<TFeatures> extends true ? TableMeta<TFeatures, TData> : TFeatures extends {
|
|
22
|
+
tableMeta: infer TMeta extends object;
|
|
23
|
+
} ? TMeta : TableMeta<TFeatures, TData>;
|
|
13
24
|
/**
|
|
14
25
|
* A map of writable atoms, one per `TableState` slice. These are the internal
|
|
15
26
|
* writable atoms that the library always writes to via `makeStateUpdater`.
|
|
@@ -30,7 +41,7 @@ type Atoms<TFeatures extends TableFeatures> = { [K in keyof TableState<TFeatures
|
|
|
30
41
|
*/
|
|
31
42
|
type ExternalAtoms<TFeatures extends TableFeatures> = Partial<{ [K in keyof TableState<TFeatures>]: Atom<TableState<TFeatures>[K]> }>;
|
|
32
43
|
/**
|
|
33
|
-
* Internal "all features" flat variants of the atom types. `
|
|
44
|
+
* Internal "all features" flat variants of the atom types. `Table`
|
|
34
45
|
* uses these so feature code (written generically over `TFeatures`) can access
|
|
35
46
|
* any slice atom (e.g. `table.atoms.columnPinning`) without TypeScript
|
|
36
47
|
* narrowing away slices that aren't in the current `TFeatures` union.
|
|
@@ -39,22 +50,20 @@ type ExternalAtoms<TFeatures extends TableFeatures> = Partial<{ [K in keyof Tabl
|
|
|
39
50
|
* but those slices may not be registered on the current table. Consumers must
|
|
40
51
|
* use optional chaining (`table.atoms.columnPinning?.get() ?? default`).
|
|
41
52
|
*/
|
|
42
|
-
type BaseAtoms_All = { [K in keyof TableState_All]?: Atom<TableState_All[K]
|
|
53
|
+
type BaseAtoms_All = { [K in keyof TableState_All]?: Atom<Exclude<TableState_All[K], undefined>> };
|
|
43
54
|
type Atoms_All = { [K in keyof TableState_All]?: ReadonlyAtom<TableState_All[K]> };
|
|
44
|
-
type ExternalAtoms_All = Partial<{ [K in keyof TableState_All]: Atom<TableState_All[K]
|
|
45
|
-
interface TableOptions_Table<TFeatures extends TableFeatures, TData extends RowData> {
|
|
55
|
+
type ExternalAtoms_All = Partial<{ [K in keyof TableState_All]: Atom<Exclude<TableState_All[K], undefined>> }>;
|
|
56
|
+
interface TableOptions_Table<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
46
57
|
/**
|
|
47
58
|
* The feature modules registered on this table instance.
|
|
48
59
|
*
|
|
49
60
|
* Feature registration controls which state slices, options, and prototype
|
|
50
|
-
* APIs are available.
|
|
61
|
+
* APIs are available. This object also carries the table's row model
|
|
62
|
+
* factories (`sortedRowModel`, `filteredRowModel`, etc.), row model function
|
|
63
|
+
* registries (`sortFns`, `filterFns`, `aggregationFns`), and type-only meta
|
|
64
|
+
* slots (`tableMeta`, `columnMeta`).
|
|
51
65
|
*/
|
|
52
|
-
readonly features: TFeatures
|
|
53
|
-
/**
|
|
54
|
-
* Row model factories used by features such as filtering, grouping, sorting,
|
|
55
|
-
* expansion, and pagination.
|
|
56
|
-
*/
|
|
57
|
-
readonly rowModels?: CreateRowModels_All<TFeatures, TData>;
|
|
66
|
+
readonly features: TFeatures & ValidateFeatureSlots<TFeatures>;
|
|
58
67
|
/**
|
|
59
68
|
* Optionally, provide your own external writable atoms for individual state slices.
|
|
60
69
|
* When an atom is provided for a given slice, it takes precedence over `options.state[key]`
|
|
@@ -91,8 +100,11 @@ interface TableOptions_Table<TFeatures extends TableFeatures, TData extends RowD
|
|
|
91
100
|
readonly mergeOptions?: (defaultOptions: TableOptions<TFeatures, TData>, options: Partial<TableOptions<TFeatures, TData>>) => TableOptions<TFeatures, TData>;
|
|
92
101
|
/**
|
|
93
102
|
* You can pass any object to `options.meta` and access it anywhere the `table` is available via `table.options.meta`.
|
|
103
|
+
*
|
|
104
|
+
* Declare its type per-table via the `tableMeta` type-only slot on the
|
|
105
|
+
* `features` option, or globally via declaration merging on `TableMeta`.
|
|
94
106
|
*/
|
|
95
|
-
readonly meta?:
|
|
107
|
+
readonly meta?: ExtractTableMeta<TFeatures, TData>;
|
|
96
108
|
/**
|
|
97
109
|
* Optionally provide externally managed values for individual state slices.
|
|
98
110
|
*
|
|
@@ -102,7 +114,7 @@ interface TableOptions_Table<TFeatures extends TableFeatures, TData extends RowD
|
|
|
102
114
|
*/
|
|
103
115
|
readonly state?: Partial<TableState<TFeatures>>;
|
|
104
116
|
}
|
|
105
|
-
interface Table_CoreProperties<TFeatures extends TableFeatures, TData extends RowData> {
|
|
117
|
+
interface Table_CoreProperties<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
106
118
|
/**
|
|
107
119
|
* Table reactivity bindings for interacting with TanStack Store.
|
|
108
120
|
*/
|
|
@@ -166,13 +178,14 @@ interface Table_CoreProperties<TFeatures extends TableFeatures, TData extends Ro
|
|
|
166
178
|
*/
|
|
167
179
|
readonly store: ReadonlyStore<TableState<TFeatures>>;
|
|
168
180
|
}
|
|
169
|
-
interface Table_Table<TFeatures extends TableFeatures, TData extends RowData> extends Table_CoreProperties<TFeatures, TData> {
|
|
181
|
+
interface Table_Table<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Table_CoreProperties<TFeatures, TData> {
|
|
170
182
|
/**
|
|
171
183
|
* Resets the table's internal base atoms to `table.initialState`.
|
|
172
184
|
*
|
|
173
185
|
* Prefer feature-specific reset APIs, such as `resetPagination`, when a state
|
|
174
186
|
* slice may be owned by an external atom or needs that feature's blank/default
|
|
175
|
-
* reset behavior.
|
|
187
|
+
* reset behavior. After resetting internal atoms, this also invokes feature
|
|
188
|
+
* reset hooks for mutable, transient table-instance data.
|
|
176
189
|
*/
|
|
177
190
|
reset: () => void;
|
|
178
191
|
/**
|
|
@@ -182,5 +195,5 @@ interface Table_Table<TFeatures extends TableFeatures, TData extends RowData> ex
|
|
|
182
195
|
setOptions: (newOptions: Updater<TableOptions<TFeatures, TData>>) => void;
|
|
183
196
|
}
|
|
184
197
|
//#endregion
|
|
185
|
-
export { Atoms, Atoms_All, BaseAtoms, BaseAtoms_All, ExternalAtoms, ExternalAtoms_All, TableMeta, TableOptions_Table, Table_CoreProperties, Table_Table };
|
|
198
|
+
export { Atoms, Atoms_All, BaseAtoms, BaseAtoms_All, ExternalAtoms, ExternalAtoms_All, ExtractTableMeta, TableMeta, TableOptions_Table, Table_CoreProperties, Table_Table };
|
|
186
199
|
//# sourceMappingURL=coreTablesFeature.types.d.cts.map
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { RowData, Updater } from "../../types/type-utils.js";
|
|
2
2
|
import { TableReactivityBindings } from "../reactivity/coreReactivityFeature.types.js";
|
|
3
3
|
import { CoreFeatures } from "../coreFeatures.js";
|
|
4
|
+
import { CachedRowModels } from "../../types/RowModel.js";
|
|
4
5
|
import { RowModelFns } from "../../types/RowModelFns.js";
|
|
5
|
-
import { CachedRowModels, CreateRowModels_All } from "../../types/RowModel.js";
|
|
6
6
|
import { TableState, TableState_All } from "../../types/TableState.js";
|
|
7
7
|
import { TableOptions } from "../../types/TableOptions.js";
|
|
8
|
-
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
8
|
+
import { IsAny, TableFeatures, ValidateFeatureSlots } from "../../types/TableFeatures.js";
|
|
9
9
|
import { Atom, ReadonlyAtom, ReadonlyStore } from "@tanstack/store";
|
|
10
10
|
|
|
11
11
|
//#region src/core/table/coreTablesFeature.types.d.ts
|
|
12
|
-
interface TableMeta<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
12
|
+
interface TableMeta<in out TFeatures extends TableFeatures, in out TData extends RowData> {}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the type of `options.meta` for a feature set.
|
|
15
|
+
*
|
|
16
|
+
* When the features object declares a `tableMeta` type-only slot
|
|
17
|
+
* (`tableFeatures({ ..., tableMeta: {} as MyTableMeta })`), that type wins.
|
|
18
|
+
* Otherwise this falls back to the global declaration-merged `TableMeta`
|
|
19
|
+
* interface.
|
|
20
|
+
*/
|
|
21
|
+
type ExtractTableMeta<TFeatures extends TableFeatures, TData extends RowData> = IsAny<TFeatures> extends true ? TableMeta<TFeatures, TData> : TFeatures extends {
|
|
22
|
+
tableMeta: infer TMeta extends object;
|
|
23
|
+
} ? TMeta : TableMeta<TFeatures, TData>;
|
|
13
24
|
/**
|
|
14
25
|
* A map of writable atoms, one per `TableState` slice. These are the internal
|
|
15
26
|
* writable atoms that the library always writes to via `makeStateUpdater`.
|
|
@@ -30,7 +41,7 @@ type Atoms<TFeatures extends TableFeatures> = { [K in keyof TableState<TFeatures
|
|
|
30
41
|
*/
|
|
31
42
|
type ExternalAtoms<TFeatures extends TableFeatures> = Partial<{ [K in keyof TableState<TFeatures>]: Atom<TableState<TFeatures>[K]> }>;
|
|
32
43
|
/**
|
|
33
|
-
* Internal "all features" flat variants of the atom types. `
|
|
44
|
+
* Internal "all features" flat variants of the atom types. `Table`
|
|
34
45
|
* uses these so feature code (written generically over `TFeatures`) can access
|
|
35
46
|
* any slice atom (e.g. `table.atoms.columnPinning`) without TypeScript
|
|
36
47
|
* narrowing away slices that aren't in the current `TFeatures` union.
|
|
@@ -39,22 +50,20 @@ type ExternalAtoms<TFeatures extends TableFeatures> = Partial<{ [K in keyof Tabl
|
|
|
39
50
|
* but those slices may not be registered on the current table. Consumers must
|
|
40
51
|
* use optional chaining (`table.atoms.columnPinning?.get() ?? default`).
|
|
41
52
|
*/
|
|
42
|
-
type BaseAtoms_All = { [K in keyof TableState_All]?: Atom<TableState_All[K]
|
|
53
|
+
type BaseAtoms_All = { [K in keyof TableState_All]?: Atom<Exclude<TableState_All[K], undefined>> };
|
|
43
54
|
type Atoms_All = { [K in keyof TableState_All]?: ReadonlyAtom<TableState_All[K]> };
|
|
44
|
-
type ExternalAtoms_All = Partial<{ [K in keyof TableState_All]: Atom<TableState_All[K]
|
|
45
|
-
interface TableOptions_Table<TFeatures extends TableFeatures, TData extends RowData> {
|
|
55
|
+
type ExternalAtoms_All = Partial<{ [K in keyof TableState_All]: Atom<Exclude<TableState_All[K], undefined>> }>;
|
|
56
|
+
interface TableOptions_Table<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
46
57
|
/**
|
|
47
58
|
* The feature modules registered on this table instance.
|
|
48
59
|
*
|
|
49
60
|
* Feature registration controls which state slices, options, and prototype
|
|
50
|
-
* APIs are available.
|
|
61
|
+
* APIs are available. This object also carries the table's row model
|
|
62
|
+
* factories (`sortedRowModel`, `filteredRowModel`, etc.), row model function
|
|
63
|
+
* registries (`sortFns`, `filterFns`, `aggregationFns`), and type-only meta
|
|
64
|
+
* slots (`tableMeta`, `columnMeta`).
|
|
51
65
|
*/
|
|
52
|
-
readonly features: TFeatures
|
|
53
|
-
/**
|
|
54
|
-
* Row model factories used by features such as filtering, grouping, sorting,
|
|
55
|
-
* expansion, and pagination.
|
|
56
|
-
*/
|
|
57
|
-
readonly rowModels?: CreateRowModels_All<TFeatures, TData>;
|
|
66
|
+
readonly features: TFeatures & ValidateFeatureSlots<TFeatures>;
|
|
58
67
|
/**
|
|
59
68
|
* Optionally, provide your own external writable atoms for individual state slices.
|
|
60
69
|
* When an atom is provided for a given slice, it takes precedence over `options.state[key]`
|
|
@@ -91,8 +100,11 @@ interface TableOptions_Table<TFeatures extends TableFeatures, TData extends RowD
|
|
|
91
100
|
readonly mergeOptions?: (defaultOptions: TableOptions<TFeatures, TData>, options: Partial<TableOptions<TFeatures, TData>>) => TableOptions<TFeatures, TData>;
|
|
92
101
|
/**
|
|
93
102
|
* You can pass any object to `options.meta` and access it anywhere the `table` is available via `table.options.meta`.
|
|
103
|
+
*
|
|
104
|
+
* Declare its type per-table via the `tableMeta` type-only slot on the
|
|
105
|
+
* `features` option, or globally via declaration merging on `TableMeta`.
|
|
94
106
|
*/
|
|
95
|
-
readonly meta?:
|
|
107
|
+
readonly meta?: ExtractTableMeta<TFeatures, TData>;
|
|
96
108
|
/**
|
|
97
109
|
* Optionally provide externally managed values for individual state slices.
|
|
98
110
|
*
|
|
@@ -102,7 +114,7 @@ interface TableOptions_Table<TFeatures extends TableFeatures, TData extends RowD
|
|
|
102
114
|
*/
|
|
103
115
|
readonly state?: Partial<TableState<TFeatures>>;
|
|
104
116
|
}
|
|
105
|
-
interface Table_CoreProperties<TFeatures extends TableFeatures, TData extends RowData> {
|
|
117
|
+
interface Table_CoreProperties<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
106
118
|
/**
|
|
107
119
|
* Table reactivity bindings for interacting with TanStack Store.
|
|
108
120
|
*/
|
|
@@ -166,13 +178,14 @@ interface Table_CoreProperties<TFeatures extends TableFeatures, TData extends Ro
|
|
|
166
178
|
*/
|
|
167
179
|
readonly store: ReadonlyStore<TableState<TFeatures>>;
|
|
168
180
|
}
|
|
169
|
-
interface Table_Table<TFeatures extends TableFeatures, TData extends RowData> extends Table_CoreProperties<TFeatures, TData> {
|
|
181
|
+
interface Table_Table<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Table_CoreProperties<TFeatures, TData> {
|
|
170
182
|
/**
|
|
171
183
|
* Resets the table's internal base atoms to `table.initialState`.
|
|
172
184
|
*
|
|
173
185
|
* Prefer feature-specific reset APIs, such as `resetPagination`, when a state
|
|
174
186
|
* slice may be owned by an external atom or needs that feature's blank/default
|
|
175
|
-
* reset behavior.
|
|
187
|
+
* reset behavior. After resetting internal atoms, this also invokes feature
|
|
188
|
+
* reset hooks for mutable, transient table-instance data.
|
|
176
189
|
*/
|
|
177
190
|
reset: () => void;
|
|
178
191
|
/**
|
|
@@ -182,5 +195,5 @@ interface Table_Table<TFeatures extends TableFeatures, TData extends RowData> ex
|
|
|
182
195
|
setOptions: (newOptions: Updater<TableOptions<TFeatures, TData>>) => void;
|
|
183
196
|
}
|
|
184
197
|
//#endregion
|
|
185
|
-
export { Atoms, Atoms_All, BaseAtoms, BaseAtoms_All, ExternalAtoms, ExternalAtoms_All, TableMeta, TableOptions_Table, Table_CoreProperties, Table_Table };
|
|
198
|
+
export { Atoms, Atoms_All, BaseAtoms, BaseAtoms_All, ExternalAtoms, ExternalAtoms_All, ExtractTableMeta, TableMeta, TableOptions_Table, Table_CoreProperties, Table_Table };
|
|
186
199
|
//# sourceMappingURL=coreTablesFeature.types.d.ts.map
|
|
@@ -20,12 +20,13 @@ function table_syncExternalStateToBaseAtoms(table) {
|
|
|
20
20
|
const baseAtom = table.baseAtoms[key];
|
|
21
21
|
if (!baseAtom) continue;
|
|
22
22
|
const externalState = state[key];
|
|
23
|
-
if (externalState !== baseAtom.get()) baseAtom.set(() => externalState);
|
|
23
|
+
if (externalState !== table._reactivity.untrack(() => baseAtom.get())) baseAtom.set(() => externalState);
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Resets all internal table base atoms to `table.initialState
|
|
28
|
+
* Resets all internal table base atoms to `table.initialState`, then clears
|
|
29
|
+
* transient instance data through registered feature reset hooks.
|
|
29
30
|
*
|
|
30
31
|
* This resets internally owned state slices in a single reactivity batch. Use
|
|
31
32
|
* feature-specific reset APIs when a slice may be externally owned.
|
|
@@ -44,12 +45,16 @@ function table_reset(table) {
|
|
|
44
45
|
table.baseAtoms[key].set(snap[key]);
|
|
45
46
|
}
|
|
46
47
|
});
|
|
48
|
+
const features = Object.values(table._features);
|
|
49
|
+
for (let i = 0; i < features.length; i++) features[i].resetTableInstanceData?.(table);
|
|
47
50
|
}
|
|
48
51
|
/**
|
|
49
52
|
* Merges new table options with the current resolved options.
|
|
50
53
|
*
|
|
51
54
|
* If `options.mergeOptions` is provided, it owns the merge behavior; otherwise
|
|
52
|
-
* options are shallow-merged.
|
|
55
|
+
* options are shallow-merged. Static options that should never change after
|
|
56
|
+
* initialization are restored on a fresh object so framework merge helpers may
|
|
57
|
+
* return readonly getter/proxy objects.
|
|
53
58
|
*
|
|
54
59
|
* @example
|
|
55
60
|
* ```ts
|
|
@@ -57,11 +62,37 @@ function table_reset(table) {
|
|
|
57
62
|
* ```
|
|
58
63
|
*/
|
|
59
64
|
function table_mergeOptions(table, newOptions) {
|
|
60
|
-
|
|
61
|
-
return {
|
|
65
|
+
const { features, atoms, initialState } = table.options;
|
|
66
|
+
if (!table.options.mergeOptions) return {
|
|
62
67
|
...table.options,
|
|
63
|
-
...newOptions
|
|
68
|
+
...newOptions,
|
|
69
|
+
features,
|
|
70
|
+
atoms,
|
|
71
|
+
initialState
|
|
64
72
|
};
|
|
73
|
+
const mergedOptions = table.options.mergeOptions(table.options, newOptions);
|
|
74
|
+
const descriptors = { ...Object.getOwnPropertyDescriptors(mergedOptions) };
|
|
75
|
+
return Object.defineProperties(Object.create(Object.getPrototypeOf(mergedOptions)), {
|
|
76
|
+
...descriptors,
|
|
77
|
+
features: {
|
|
78
|
+
value: features,
|
|
79
|
+
enumerable: true,
|
|
80
|
+
configurable: true,
|
|
81
|
+
writable: true
|
|
82
|
+
},
|
|
83
|
+
atoms: {
|
|
84
|
+
value: atoms,
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true,
|
|
87
|
+
writable: true
|
|
88
|
+
},
|
|
89
|
+
initialState: {
|
|
90
|
+
value: initialState,
|
|
91
|
+
enumerable: true,
|
|
92
|
+
configurable: true,
|
|
93
|
+
writable: true
|
|
94
|
+
}
|
|
95
|
+
});
|
|
65
96
|
}
|
|
66
97
|
/**
|
|
67
98
|
* Updates the table options object.
|
|
@@ -75,14 +106,7 @@ function table_mergeOptions(table, newOptions) {
|
|
|
75
106
|
* ```
|
|
76
107
|
*/
|
|
77
108
|
function table_setOptions(table, updater) {
|
|
78
|
-
const
|
|
79
|
-
const { rowModels, features, atoms, initialState } = table.options;
|
|
80
|
-
const mergedOptions = Object.assign(table_mergeOptions(table, newOptions), {
|
|
81
|
-
rowModels,
|
|
82
|
-
features,
|
|
83
|
-
atoms,
|
|
84
|
-
initialState
|
|
85
|
-
});
|
|
109
|
+
const mergedOptions = table_mergeOptions(table, require_utils.functionalUpdate(updater, table.options));
|
|
86
110
|
if (table.optionsStore) table.optionsStore.set(() => mergedOptions);
|
|
87
111
|
else table.options = mergedOptions;
|
|
88
112
|
table_syncExternalStateToBaseAtoms(table);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreTablesFeature.utils.cjs","names":["cloneState","functionalUpdate"],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\n/**\n * Synchronizes externally controlled state slices into the table's base atoms.\n *\n * This keeps legacy `options.state` values reflected in the atom graph so\n * derived atoms, stores, and table APIs read a consistent snapshot.\n *\n * @example\n * ```ts\n * table_syncExternalStateToBaseAtoms(table)\n * ```\n */\nexport function table_syncExternalStateToBaseAtoms<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const state = table.options.state\n if (!state) {\n return\n }\n\n table._reactivity.batch(() => {\n for (const key in state) {\n const baseAtom = (table.baseAtoms as Record<string, any>)[key]\n if (!baseAtom) {\n continue\n }\n\n const externalState = state[key as keyof typeof state]\n if (externalState !== baseAtom.get()) {\n baseAtom.set(() => externalState)\n }\n }\n })\n}\n\n/**\n * Resets all internal table base atoms to `table.initialState
|
|
1
|
+
{"version":3,"file":"coreTablesFeature.utils.cjs","names":["cloneState","functionalUpdate"],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\n/**\n * Synchronizes externally controlled state slices into the table's base atoms.\n *\n * This keeps legacy `options.state` values reflected in the atom graph so\n * derived atoms, stores, and table APIs read a consistent snapshot.\n *\n * @example\n * ```ts\n * table_syncExternalStateToBaseAtoms(table)\n * ```\n */\nexport function table_syncExternalStateToBaseAtoms<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const state = table.options.state\n if (!state) {\n return\n }\n\n table._reactivity.batch(() => {\n for (const key in state) {\n const baseAtom = (table.baseAtoms as Record<string, any>)[key]\n if (!baseAtom) {\n continue\n }\n\n const externalState = state[key as keyof typeof state]\n if (externalState !== table._reactivity.untrack(() => baseAtom.get())) {\n baseAtom.set(() => externalState)\n }\n }\n })\n}\n\n/**\n * Resets all internal table base atoms to `table.initialState`, then clears\n * transient instance data through registered feature reset hooks.\n *\n * This resets internally owned state slices in a single reactivity batch. Use\n * feature-specific reset APIs when a slice may be externally owned.\n *\n * @example\n * ```ts\n * table_reset(table)\n * ```\n */\nexport function table_reset<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const snap = cloneState(table.initialState)\n table._reactivity.batch(() => {\n const keys = Object.keys(snap) as Array<keyof typeof snap>\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]!\n ;(table.baseAtoms as any)[key].set(snap[key])\n }\n })\n\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.resetTableInstanceData?.(table)\n }\n}\n\n/**\n * Merges new table options with the current resolved options.\n *\n * If `options.mergeOptions` is provided, it owns the merge behavior; otherwise\n * options are shallow-merged. Static options that should never change after\n * initialization are restored on a fresh object so framework merge helpers may\n * return readonly getter/proxy objects.\n *\n * @example\n * ```ts\n * const options = table_mergeOptions(table, nextOptions)\n * ```\n */\nexport function table_mergeOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n newOptions: TableOptions<TFeatures, TData>,\n) {\n const { features, atoms, initialState } = table.options\n\n // simple merge if no mergeOptions is provided - performant\n if (!table.options.mergeOptions) {\n return {\n ...table.options,\n ...newOptions,\n features,\n atoms,\n initialState,\n }\n }\n\n // else use the mergeOptions function and preserve getters/setters\n const mergedOptions = table.options.mergeOptions(\n table.options as TableOptions<TFeatures, TData>,\n newOptions,\n )\n const descriptors: PropertyDescriptorMap = {\n ...Object.getOwnPropertyDescriptors(mergedOptions),\n }\n\n return Object.defineProperties(\n Object.create(Object.getPrototypeOf(mergedOptions)),\n {\n ...descriptors,\n features: {\n value: features,\n enumerable: true,\n configurable: true,\n writable: true,\n },\n atoms: {\n value: atoms,\n enumerable: true,\n configurable: true,\n writable: true,\n },\n initialState: {\n value: initialState,\n enumerable: true,\n configurable: true,\n writable: true,\n },\n },\n ) as TableOptions<TFeatures, TData>\n}\n\n/**\n * Updates the table options object.\n *\n * The updater receives the current resolved options and the merged result is\n * immediately assigned to the table instance.\n *\n * @example\n * ```ts\n * table_setOptions(table, (old) => old)\n * ```\n */\nexport function table_setOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<TableOptions<TFeatures, TData>>,\n): void {\n const newOptions = functionalUpdate(\n updater,\n table.options as TableOptions<TFeatures, TData>,\n )\n const mergedOptions = table_mergeOptions(table, newOptions)\n\n if (table.optionsStore) {\n table.optionsStore.set(() => mergedOptions)\n } else {\n table.options = mergedOptions\n }\n table_syncExternalStateToBaseAtoms(table)\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,mCAGd,OAA+C;CAC/C,MAAM,QAAQ,MAAM,QAAQ;CAC5B,IAAI,CAAC,OACH;CAGF,MAAM,YAAY,YAAY;EAC5B,KAAK,MAAM,OAAO,OAAO;GACvB,MAAM,WAAY,MAAM,UAAkC;GAC1D,IAAI,CAAC,UACH;GAGF,MAAM,gBAAgB,MAAM;GAC5B,IAAI,kBAAkB,MAAM,YAAY,cAAc,SAAS,IAAI,CAAC,GAClE,SAAS,UAAU,aAAa;EAEpC;CACF,CAAC;AACH;;;;;;;;;;;;;AAcA,SAAgB,YAGd,OAA+C;CAC/C,MAAM,OAAOA,yBAAW,MAAM,YAAY;CAC1C,MAAM,YAAY,YAAY;EAC5B,MAAM,OAAO,OAAO,KAAK,IAAI;EAC7B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;GACpC,MAAM,MAAM,KAAK;GAChB,AAAC,MAAM,UAAkB,IAAI,CAAC,IAAI,KAAK,IAAI;EAC9C;CACF,CAAC;CAED,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;CAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KACnC,SAAS,EAAE,CAAE,yBAAyB,KAAK;AAE/C;;;;;;;;;;;;;;AAeA,SAAgB,mBAId,OACA,YACA;CACA,MAAM,EAAE,UAAU,OAAO,iBAAiB,MAAM;CAGhD,IAAI,CAAC,MAAM,QAAQ,cACjB,OAAO;EACL,GAAG,MAAM;EACT,GAAG;EACH;EACA;EACA;CACF;CAIF,MAAM,gBAAgB,MAAM,QAAQ,aAClC,MAAM,SACN,UACF;CACA,MAAM,cAAqC,EACzC,GAAG,OAAO,0BAA0B,aAAa,EACnD;CAEA,OAAO,OAAO,iBACZ,OAAO,OAAO,OAAO,eAAe,aAAa,CAAC,GAClD;EACE,GAAG;EACH,UAAU;GACR,OAAO;GACP,YAAY;GACZ,cAAc;GACd,UAAU;EACZ;EACA,OAAO;GACL,OAAO;GACP,YAAY;GACZ,cAAc;GACd,UAAU;EACZ;EACA,cAAc;GACZ,OAAO;GACP,YAAY;GACZ,cAAc;GACd,UAAU;EACZ;CACF,CACF;AACF;;;;;;;;;;;;AAaA,SAAgB,iBAId,OACA,SACM;CAKN,MAAM,gBAAgB,mBAAmB,OAJtBC,+BACjB,SACA,MAAM,OAEiD,CAAC;CAE1D,IAAI,MAAM,cACR,MAAM,aAAa,UAAU,aAAa;MAE1C,MAAM,UAAU;CAElB,mCAAmC,KAAK;AAC1C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RowData, Updater } from "../../types/type-utils.cjs";
|
|
2
2
|
import { TableOptions } from "../../types/TableOptions.cjs";
|
|
3
|
+
import { Table } from "../../types/Table.cjs";
|
|
3
4
|
import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
4
|
-
import { Table_Internal } from "../../types/Table.cjs";
|
|
5
5
|
|
|
6
6
|
//#region src/core/table/coreTablesFeature.utils.d.ts
|
|
7
7
|
/**
|
|
@@ -15,9 +15,10 @@ import { Table_Internal } from "../../types/Table.cjs";
|
|
|
15
15
|
* table_syncExternalStateToBaseAtoms(table)
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatures, TData extends RowData>(table:
|
|
18
|
+
declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>): void;
|
|
19
19
|
/**
|
|
20
|
-
* Resets all internal table base atoms to `table.initialState
|
|
20
|
+
* Resets all internal table base atoms to `table.initialState`, then clears
|
|
21
|
+
* transient instance data through registered feature reset hooks.
|
|
21
22
|
*
|
|
22
23
|
* This resets internally owned state slices in a single reactivity batch. Use
|
|
23
24
|
* feature-specific reset APIs when a slice may be externally owned.
|
|
@@ -27,19 +28,21 @@ declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatu
|
|
|
27
28
|
* table_reset(table)
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
|
-
declare function table_reset<TFeatures extends TableFeatures, TData extends RowData>(table:
|
|
31
|
+
declare function table_reset<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>): void;
|
|
31
32
|
/**
|
|
32
33
|
* Merges new table options with the current resolved options.
|
|
33
34
|
*
|
|
34
35
|
* If `options.mergeOptions` is provided, it owns the merge behavior; otherwise
|
|
35
|
-
* options are shallow-merged.
|
|
36
|
+
* options are shallow-merged. Static options that should never change after
|
|
37
|
+
* initialization are restored on a fresh object so framework merge helpers may
|
|
38
|
+
* return readonly getter/proxy objects.
|
|
36
39
|
*
|
|
37
40
|
* @example
|
|
38
41
|
* ```ts
|
|
39
42
|
* const options = table_mergeOptions(table, nextOptions)
|
|
40
43
|
* ```
|
|
41
44
|
*/
|
|
42
|
-
declare function table_mergeOptions<TFeatures extends TableFeatures, TData extends RowData>(table:
|
|
45
|
+
declare function table_mergeOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>, newOptions: TableOptions<TFeatures, TData>): TableOptions<TFeatures, TData>;
|
|
43
46
|
/**
|
|
44
47
|
* Updates the table options object.
|
|
45
48
|
*
|
|
@@ -51,7 +54,7 @@ declare function table_mergeOptions<TFeatures extends TableFeatures, TData exten
|
|
|
51
54
|
* table_setOptions(table, (old) => old)
|
|
52
55
|
* ```
|
|
53
56
|
*/
|
|
54
|
-
declare function table_setOptions<TFeatures extends TableFeatures, TData extends RowData>(table:
|
|
57
|
+
declare function table_setOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>, updater: Updater<TableOptions<TFeatures, TData>>): void;
|
|
55
58
|
//#endregion
|
|
56
59
|
export { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms };
|
|
57
60
|
//# sourceMappingURL=coreTablesFeature.utils.d.cts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RowData, Updater } from "../../types/type-utils.js";
|
|
2
2
|
import { TableOptions } from "../../types/TableOptions.js";
|
|
3
|
+
import { Table } from "../../types/Table.js";
|
|
3
4
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
4
|
-
import { Table_Internal } from "../../types/Table.js";
|
|
5
5
|
|
|
6
6
|
//#region src/core/table/coreTablesFeature.utils.d.ts
|
|
7
7
|
/**
|
|
@@ -15,9 +15,10 @@ import { Table_Internal } from "../../types/Table.js";
|
|
|
15
15
|
* table_syncExternalStateToBaseAtoms(table)
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatures, TData extends RowData>(table:
|
|
18
|
+
declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>): void;
|
|
19
19
|
/**
|
|
20
|
-
* Resets all internal table base atoms to `table.initialState
|
|
20
|
+
* Resets all internal table base atoms to `table.initialState`, then clears
|
|
21
|
+
* transient instance data through registered feature reset hooks.
|
|
21
22
|
*
|
|
22
23
|
* This resets internally owned state slices in a single reactivity batch. Use
|
|
23
24
|
* feature-specific reset APIs when a slice may be externally owned.
|
|
@@ -27,19 +28,21 @@ declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatu
|
|
|
27
28
|
* table_reset(table)
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
|
-
declare function table_reset<TFeatures extends TableFeatures, TData extends RowData>(table:
|
|
31
|
+
declare function table_reset<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>): void;
|
|
31
32
|
/**
|
|
32
33
|
* Merges new table options with the current resolved options.
|
|
33
34
|
*
|
|
34
35
|
* If `options.mergeOptions` is provided, it owns the merge behavior; otherwise
|
|
35
|
-
* options are shallow-merged.
|
|
36
|
+
* options are shallow-merged. Static options that should never change after
|
|
37
|
+
* initialization are restored on a fresh object so framework merge helpers may
|
|
38
|
+
* return readonly getter/proxy objects.
|
|
36
39
|
*
|
|
37
40
|
* @example
|
|
38
41
|
* ```ts
|
|
39
42
|
* const options = table_mergeOptions(table, nextOptions)
|
|
40
43
|
* ```
|
|
41
44
|
*/
|
|
42
|
-
declare function table_mergeOptions<TFeatures extends TableFeatures, TData extends RowData>(table:
|
|
45
|
+
declare function table_mergeOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>, newOptions: TableOptions<TFeatures, TData>): TableOptions<TFeatures, TData>;
|
|
43
46
|
/**
|
|
44
47
|
* Updates the table options object.
|
|
45
48
|
*
|
|
@@ -51,7 +54,7 @@ declare function table_mergeOptions<TFeatures extends TableFeatures, TData exten
|
|
|
51
54
|
* table_setOptions(table, (old) => old)
|
|
52
55
|
* ```
|
|
53
56
|
*/
|
|
54
|
-
declare function table_setOptions<TFeatures extends TableFeatures, TData extends RowData>(table:
|
|
57
|
+
declare function table_setOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>, updater: Updater<TableOptions<TFeatures, TData>>): void;
|
|
55
58
|
//#endregion
|
|
56
59
|
export { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms };
|
|
57
60
|
//# sourceMappingURL=coreTablesFeature.utils.d.ts.map
|