@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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { RowData } from "../types/type-utils.js";
|
|
2
|
+
|
|
3
|
+
//#region src/worker/tableWorkerProtocol.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Row model stages that can be offloaded to the worker, in pipeline order.
|
|
6
|
+
* Everything else in this module is derived from this list; adding a stage
|
|
7
|
+
* means adding an entry here and to `tableWorkerStageStateDeps`.
|
|
8
|
+
*/
|
|
9
|
+
declare const tableWorkerPipeline: readonly ["filtered", "grouped", "sorted", "expanded"];
|
|
10
|
+
type TableWorkerStage = (typeof tableWorkerPipeline)[number];
|
|
11
|
+
/**
|
|
12
|
+
* The state slices each stage's computation depends on. The main thread sends
|
|
13
|
+
* the union of deps for its registered stages; a change to any of them
|
|
14
|
+
* triggers one worker round trip.
|
|
15
|
+
*/
|
|
16
|
+
declare const tableWorkerStageStateDeps: Record<TableWorkerStage, Array<string>>;
|
|
17
|
+
/**
|
|
18
|
+
* A serialized synthetic (group) row. Leaf rows serialize as their position in
|
|
19
|
+
* `options.data`; group rows carry what `constructRow` + the grouped row model
|
|
20
|
+
* need to rebuild them, plus eagerly computed aggregate values so no
|
|
21
|
+
* aggregation runs on the main thread.
|
|
22
|
+
*/
|
|
23
|
+
interface TableWorkerGroupNode {
|
|
24
|
+
id: string;
|
|
25
|
+
groupingColumnId: string;
|
|
26
|
+
groupingValue: unknown;
|
|
27
|
+
index: number;
|
|
28
|
+
aggregates: Record<string, unknown>;
|
|
29
|
+
children: Array<TableWorkerRowNode>;
|
|
30
|
+
}
|
|
31
|
+
type TableWorkerRowNode = number | TableWorkerGroupNode;
|
|
32
|
+
/**
|
|
33
|
+
* A stage result. Flat models (every row is a data row) travel as a
|
|
34
|
+
* transferable index permutation; models containing synthetic rows (grouping)
|
|
35
|
+
* travel as a tree. The kind is chosen from the model's actual shape at
|
|
36
|
+
* runtime, not from the stage name: a sorted model is flat without grouping
|
|
37
|
+
* and a tree with it.
|
|
38
|
+
*
|
|
39
|
+
* `unchanged` means the stage's model is identical to the last one sent for
|
|
40
|
+
* this dataset (its memoized inputs did not change); the main thread keeps
|
|
41
|
+
* its previous result and skips the rebuild entirely.
|
|
42
|
+
*/
|
|
43
|
+
type TableWorkerStagePayload = {
|
|
44
|
+
kind: 'flat';
|
|
45
|
+
indices: Uint32Array;
|
|
46
|
+
} | {
|
|
47
|
+
kind: 'tree';
|
|
48
|
+
children: Array<TableWorkerRowNode>;
|
|
49
|
+
} | {
|
|
50
|
+
kind: 'unchanged';
|
|
51
|
+
};
|
|
52
|
+
type TableWorkerRequest<TData extends RowData = any> = {
|
|
53
|
+
type: 'data';
|
|
54
|
+
dataVersion: number;
|
|
55
|
+
data: Array<TData>;
|
|
56
|
+
} | {
|
|
57
|
+
type: 'process';
|
|
58
|
+
requestId: number;
|
|
59
|
+
dataVersion: number; /** The stages the main thread has worker-backed row models for. */
|
|
60
|
+
stages: Array<TableWorkerStage>; /** Serializable state slices (union of the stages' deps). */
|
|
61
|
+
state: Record<string, unknown>;
|
|
62
|
+
};
|
|
63
|
+
interface TableWorkerResult {
|
|
64
|
+
type: 'result';
|
|
65
|
+
requestId: number;
|
|
66
|
+
dataVersion: number;
|
|
67
|
+
stages: { [K in TableWorkerStage]?: TableWorkerStagePayload };
|
|
68
|
+
computeMs: number;
|
|
69
|
+
}
|
|
70
|
+
type TableWorkerResponse = TableWorkerResult;
|
|
71
|
+
/**
|
|
72
|
+
* The state slice added by `workerRowModelsFeature`. `version` bumps when a
|
|
73
|
+
* worker result lands (driving re-renders through the normal state path);
|
|
74
|
+
* `isPending` is true while a request is in flight. The timing fields expose
|
|
75
|
+
* the last result's worker compute time and full round trip for devtools and
|
|
76
|
+
* debugging.
|
|
77
|
+
*/
|
|
78
|
+
interface TableState_WorkerRowModels {
|
|
79
|
+
workerRowModels: {
|
|
80
|
+
version: number;
|
|
81
|
+
isPending: boolean;
|
|
82
|
+
lastComputeMs?: number;
|
|
83
|
+
lastRoundTripMs?: number;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { TableState_WorkerRowModels, TableWorkerGroupNode, TableWorkerRequest, TableWorkerResponse, TableWorkerResult, TableWorkerRowNode, TableWorkerStage, TableWorkerStagePayload, tableWorkerPipeline, tableWorkerStageStateDeps };
|
|
88
|
+
//# sourceMappingURL=tableWorkerProtocol.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/worker/tableWorkerProtocol.ts
|
|
2
|
+
/**
|
|
3
|
+
* Row model stages that can be offloaded to the worker, in pipeline order.
|
|
4
|
+
* Everything else in this module is derived from this list; adding a stage
|
|
5
|
+
* means adding an entry here and to `tableWorkerStageStateDeps`.
|
|
6
|
+
*/
|
|
7
|
+
const tableWorkerPipeline = [
|
|
8
|
+
"filtered",
|
|
9
|
+
"grouped",
|
|
10
|
+
"sorted",
|
|
11
|
+
"expanded"
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* The state slices each stage's computation depends on. The main thread sends
|
|
15
|
+
* the union of deps for its registered stages; a change to any of them
|
|
16
|
+
* triggers one worker round trip.
|
|
17
|
+
*/
|
|
18
|
+
const tableWorkerStageStateDeps = {
|
|
19
|
+
filtered: ["columnFilters", "globalFilter"],
|
|
20
|
+
grouped: ["grouping"],
|
|
21
|
+
sorted: ["sorting"],
|
|
22
|
+
expanded: ["expanded"]
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { tableWorkerPipeline, tableWorkerStageStateDeps };
|
|
27
|
+
//# sourceMappingURL=tableWorkerProtocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableWorkerProtocol.js","names":[],"sources":["../../src/worker/tableWorkerProtocol.ts"],"sourcesContent":["import type { RowData } from '../types/type-utils'\n\n/**\n * Row model stages that can be offloaded to the worker, in pipeline order.\n * Everything else in this module is derived from this list; adding a stage\n * means adding an entry here and to `tableWorkerStageStateDeps`.\n */\nexport const tableWorkerPipeline = [\n 'filtered',\n 'grouped',\n 'sorted',\n 'expanded',\n] as const\n\nexport type TableWorkerStage = (typeof tableWorkerPipeline)[number]\n\n/**\n * The state slices each stage's computation depends on. The main thread sends\n * the union of deps for its registered stages; a change to any of them\n * triggers one worker round trip.\n */\nexport const tableWorkerStageStateDeps: Record<\n TableWorkerStage,\n Array<string>\n> = {\n filtered: ['columnFilters', 'globalFilter'],\n grouped: ['grouping'],\n sorted: ['sorting'],\n expanded: ['expanded'],\n}\n\n/**\n * A serialized synthetic (group) row. Leaf rows serialize as their position in\n * `options.data`; group rows carry what `constructRow` + the grouped row model\n * need to rebuild them, plus eagerly computed aggregate values so no\n * aggregation runs on the main thread.\n */\nexport interface TableWorkerGroupNode {\n id: string\n groupingColumnId: string\n groupingValue: unknown\n index: number\n aggregates: Record<string, unknown>\n children: Array<TableWorkerRowNode>\n}\n\nexport type TableWorkerRowNode = number | TableWorkerGroupNode\n\n/**\n * A stage result. Flat models (every row is a data row) travel as a\n * transferable index permutation; models containing synthetic rows (grouping)\n * travel as a tree. The kind is chosen from the model's actual shape at\n * runtime, not from the stage name: a sorted model is flat without grouping\n * and a tree with it.\n *\n * `unchanged` means the stage's model is identical to the last one sent for\n * this dataset (its memoized inputs did not change); the main thread keeps\n * its previous result and skips the rebuild entirely.\n */\nexport type TableWorkerStagePayload =\n | { kind: 'flat'; indices: Uint32Array }\n | { kind: 'tree'; children: Array<TableWorkerRowNode> }\n | { kind: 'unchanged' }\n\nexport type TableWorkerRequest<TData extends RowData = any> =\n | {\n type: 'data'\n dataVersion: number\n data: Array<TData>\n }\n | {\n type: 'process'\n requestId: number\n dataVersion: number\n /** The stages the main thread has worker-backed row models for. */\n stages: Array<TableWorkerStage>\n /** Serializable state slices (union of the stages' deps). */\n state: Record<string, unknown>\n }\n\nexport interface TableWorkerResult {\n type: 'result'\n requestId: number\n dataVersion: number\n stages: { [K in TableWorkerStage]?: TableWorkerStagePayload }\n computeMs: number\n}\n\nexport type TableWorkerResponse = TableWorkerResult\n\n/**\n * The state slice added by `workerRowModelsFeature`. `version` bumps when a\n * worker result lands (driving re-renders through the normal state path);\n * `isPending` is true while a request is in flight. The timing fields expose\n * the last result's worker compute time and full round trip for devtools and\n * debugging.\n */\nexport interface TableState_WorkerRowModels {\n workerRowModels: {\n version: number\n isPending: boolean\n lastComputeMs?: number\n lastRoundTripMs?: number\n }\n}\n"],"mappings":";;;;;;AAOA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;AACF;;;;;;AASA,MAAa,4BAGT;CACF,UAAU,CAAC,iBAAiB,cAAc;CAC1C,SAAS,CAAC,UAAU;CACpB,QAAQ,CAAC,SAAS;CAClB,UAAU,CAAC,UAAU;AACvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.51",
|
|
4
4
|
"description": "Headless UI for building powerful tables & datagrids for TS/JS.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
"import": "./dist/index.js",
|
|
36
36
|
"require": "./dist/index.cjs"
|
|
37
37
|
},
|
|
38
|
+
"./experimental-worker-plugin": {
|
|
39
|
+
"import": "./dist/experimental-worker-plugin.js",
|
|
40
|
+
"require": "./dist/experimental-worker-plugin.cjs"
|
|
41
|
+
},
|
|
38
42
|
"./flex-render": {
|
|
39
43
|
"import": "./dist/flex-render.js",
|
|
40
44
|
"require": "./dist/flex-render.cjs"
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
},
|
|
56
60
|
"sideEffects": false,
|
|
57
61
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
62
|
+
"node": ">=20"
|
|
59
63
|
},
|
|
60
64
|
"files": [
|
|
61
65
|
"dist/",
|
|
@@ -69,10 +73,11 @@
|
|
|
69
73
|
"clean": "rimraf ./build && rimraf ./dist",
|
|
70
74
|
"lint:fix": "eslint ./src --fix",
|
|
71
75
|
"test:eslint": "eslint ./src",
|
|
76
|
+
"test:coverage": "vitest run --coverage",
|
|
72
77
|
"test:lib": "vitest",
|
|
73
78
|
"test:lib:dev": "pnpm test:lib --watch",
|
|
74
79
|
"test:types": "tsc && tsc -p tests/tsconfig.declaration-emit.json",
|
|
75
80
|
"test:build": "publint --strict",
|
|
76
|
-
"build": "tsdown"
|
|
81
|
+
"build": "tsdown && node ../../scripts/rewrite-table-core-dts.mjs"
|
|
77
82
|
}
|
|
78
83
|
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aggregation
|
|
3
|
+
description: >
|
|
4
|
+
Aggregate TanStack Table columns independently of grouping, including grand totals, caller-selected row totals, multiple keyed aggregations, custom context-based definitions, grouped merges, manual values, and worker constraints.
|
|
5
|
+
metadata:
|
|
6
|
+
{
|
|
7
|
+
type: sub-skill,
|
|
8
|
+
library: '@tanstack/table-core',
|
|
9
|
+
library_version: '9.0.0-beta.51',
|
|
10
|
+
}
|
|
11
|
+
requires: ['core', 'table-features']
|
|
12
|
+
sources:
|
|
13
|
+
- 'TanStack/table:docs/guide/aggregation.md'
|
|
14
|
+
- 'TanStack/table:docs/framework/react/guide/aggregation.md'
|
|
15
|
+
- 'TanStack/table:packages/table-core/src/features/row-aggregation'
|
|
16
|
+
- 'TanStack/table:examples/react/aggregation'
|
|
17
|
+
- 'TanStack/table:examples/react/grouped-aggregation'
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
This skill builds on `core` and `table-features`. Aggregation is independent
|
|
21
|
+
from grouping: use it alone for totals, or combine it with the `grouping` skill
|
|
22
|
+
for synthetic grouped rows.
|
|
23
|
+
|
|
24
|
+
## Setup
|
|
25
|
+
|
|
26
|
+
<!-- skill-snippet:check -->
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import {
|
|
30
|
+
rowAggregationFeature,
|
|
31
|
+
aggregationFn_mean,
|
|
32
|
+
aggregationFn_sum,
|
|
33
|
+
tableFeatures,
|
|
34
|
+
} from '@tanstack/table-core'
|
|
35
|
+
|
|
36
|
+
export const features = tableFeatures({
|
|
37
|
+
rowAggregationFeature,
|
|
38
|
+
aggregationFns: {
|
|
39
|
+
mean: aggregationFn_mean,
|
|
40
|
+
sum: aggregationFn_sum,
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Core Patterns
|
|
46
|
+
|
|
47
|
+
### Grand total and selected row scopes
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
const grandTotal = salaryColumn.getAggregationValue()
|
|
51
|
+
const filteredTotal = salaryColumn.getAggregationValue({
|
|
52
|
+
rows: table.getFilteredRowModel().rows,
|
|
53
|
+
})
|
|
54
|
+
const childTotal = salaryColumn.getAggregationValue({
|
|
55
|
+
rows: table.getCoreRowModel().rows,
|
|
56
|
+
maxDepth: 1,
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The default uses the pre-grouped row model. Explicit rows can come from any row
|
|
61
|
+
model or caller-selected subset. `maxAggregationDepth` defaults to `0`, which
|
|
62
|
+
selects the supplied roots; `1` selects direct sub-rows, and `Infinity` selects
|
|
63
|
+
terminal rows. Branches that end early contribute their deepest available row.
|
|
64
|
+
Default calls are cached; explicit-row calls intentionally are not because array
|
|
65
|
+
identity and contents are caller-owned. `table.getMaxSubRowDepth()` returns the
|
|
66
|
+
deepest structural depth in the core row model.
|
|
67
|
+
|
|
68
|
+
### Multiple aggregations
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
columnHelper.accessor('salary', {
|
|
72
|
+
aggregationFn: ['mean', { id: 'range', aggregationFn: 'extent' }],
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const value = salaryColumn.getAggregationValue<{
|
|
76
|
+
mean: number
|
|
77
|
+
range: [number, number]
|
|
78
|
+
}>()
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
A scalar option returns a scalar. An array returns a keyed object. Named
|
|
82
|
+
functions use their registry name; descriptors provide a stable `id`, which is
|
|
83
|
+
required for inline definitions in an array.
|
|
84
|
+
|
|
85
|
+
### Custom definitions
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
const weightedMean = constructAggregationFn({
|
|
89
|
+
aggregate: ({ rows, getValue }) => {
|
|
90
|
+
const total = rows.reduce((sum, row) => sum + Number(getValue(row)), 0)
|
|
91
|
+
return rows.length ? total / rows.length : undefined
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The context provides depth-selected `rows`, `maxDepth`, `getValue`, `column`,
|
|
97
|
+
`columnId`, `table`, and optional grouped-only `groupingRow` and `subRows`.
|
|
98
|
+
Every aggregation configured on a column receives the same row frontier. Add
|
|
99
|
+
`merge({ subRowResults, subRows, ...context })` when nested groups can more
|
|
100
|
+
efficiently combine already-computed sub-row results; otherwise the engine calls
|
|
101
|
+
`aggregate` with both row sets. `subRowResults[i]` corresponds to `subRows[i]`.
|
|
102
|
+
|
|
103
|
+
### Manual or remote values
|
|
104
|
+
|
|
105
|
+
Set a column definition's `getAggregationValue(context)` to return `{ value }`
|
|
106
|
+
for requests handled by a server or another execution environment. Returning
|
|
107
|
+
`undefined` falls back to the local definition. `manualAggregation: true`
|
|
108
|
+
disables that local fallback.
|
|
109
|
+
|
|
110
|
+
## Common Mistakes
|
|
111
|
+
|
|
112
|
+
### [HIGH] Adding grouping for a grand total
|
|
113
|
+
|
|
114
|
+
Wrong: registering `columnGroupingFeature` solely to total a column.
|
|
115
|
+
|
|
116
|
+
Correct: register `rowAggregationFeature` and call
|
|
117
|
+
`column.getAggregationValue()`. Grouping is only required for grouped rows.
|
|
118
|
+
|
|
119
|
+
### [HIGH] Passing a scope label and rows
|
|
120
|
+
|
|
121
|
+
There is no scope option. Call `getAggregationValue()` for the cached default,
|
|
122
|
+
or pass a single options object containing rows from the desired row model and
|
|
123
|
+
`maxDepth` when the desired frontier is below those rows.
|
|
124
|
+
|
|
125
|
+
### [HIGH] Reusing the legacy callable signature
|
|
126
|
+
|
|
127
|
+
Wrong: `(columnId, leafRows, childRows) => result`.
|
|
128
|
+
|
|
129
|
+
Correct: `constructAggregationFn({ aggregate: ({ rows, subRows, getValue }) => result })`.
|
|
130
|
+
|
|
131
|
+
### [MEDIUM] Assuming arbitrary totals run in the worker
|
|
132
|
+
|
|
133
|
+
The experimental worker computes grouped row-model aggregates. Public
|
|
134
|
+
`getAggregationValue(options?)` totals execute on the main thread, and custom
|
|
135
|
+
grouped results sent by the worker must be structured-cloneable.
|
|
136
|
+
|
|
137
|
+
## API Discovery
|
|
138
|
+
|
|
139
|
+
Inspect `node_modules/@tanstack/table-core/src/features/row-aggregation/` and the
|
|
140
|
+
Aggregation Guide. Use `Column_Aggregation`, `AggregationFnDef`,
|
|
141
|
+
`AggregationContext`, and `AggregationResult` for the typed public surface.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-not-found
|
|
3
|
+
description: >
|
|
4
|
+
Diagnose missing TanStack Table v9 exports, options, state slices, and instance methods. Load before inventing an API when code sees a type error, undefined feature method, absent object key, adapter mismatch, or v8-shaped example.
|
|
5
|
+
metadata:
|
|
6
|
+
type: sub-skill
|
|
7
|
+
library: '@tanstack/table-core'
|
|
8
|
+
library_version: '9.0.0-beta.51'
|
|
9
|
+
requires: ['core', 'table-features']
|
|
10
|
+
sources:
|
|
11
|
+
- 'TanStack/table:packages/table-core/src/index.ts'
|
|
12
|
+
- 'TanStack/table:packages/table-core/src/types/TableFeatures.ts'
|
|
13
|
+
- 'TanStack/table:docs/framework/react/guide/migrating.md'
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
This skill builds on `core` and `table-features`. Treat the installed package—not remembered docs—as exact API truth.
|
|
17
|
+
|
|
18
|
+
## Setup
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { readFile } from 'node:fs/promises'
|
|
22
|
+
|
|
23
|
+
const packageJson = JSON.parse(
|
|
24
|
+
await readFile('node_modules/@tanstack/table-core/package.json', 'utf8'),
|
|
25
|
+
)
|
|
26
|
+
const entrypoint = await readFile(
|
|
27
|
+
'node_modules/@tanstack/table-core/src/index.ts',
|
|
28
|
+
'utf8',
|
|
29
|
+
)
|
|
30
|
+
console.log(packageJson.version, entrypoint.includes('rowSortingFeature'))
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Core Patterns
|
|
34
|
+
|
|
35
|
+
### Trace an export to source
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
rg "export .*rowSortingFeature|rowSortingFeature" node_modules/@tanstack/table-core/src
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For an adapter API, start at `node_modules/@tanstack/<framework>-table/src/index.ts`.
|
|
42
|
+
|
|
43
|
+
### Check feature gating before replacement
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
const features = tableFeatures({ rowSortingFeature })
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If the export exists but the instance API does not, inspect `TableFeatures.ts` and the table's registry.
|
|
50
|
+
|
|
51
|
+
## Common Mistakes
|
|
52
|
+
|
|
53
|
+
### [CRITICAL] Substituting a remembered v8 API
|
|
54
|
+
|
|
55
|
+
Wrong:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
const options = { getSortedRowModel: getSortedRowModel() }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Correct:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
const features = tableFeatures({
|
|
65
|
+
rowSortingFeature,
|
|
66
|
+
sortedRowModel: createSortedRowModel(),
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
V9 moved row-model factories to named feature slots and renamed `get*` factories to `create*`.
|
|
71
|
+
|
|
72
|
+
Source: `docs/framework/react/guide/migrating.md#row-model-factories`
|
|
73
|
+
|
|
74
|
+
### [HIGH] Mistaking omitted feature for removal
|
|
75
|
+
|
|
76
|
+
Wrong:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
const features = tableFeatures({})
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Correct:
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
const features = tableFeatures({ columnVisibilityFeature })
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Optional APIs and state are typed and installed from the concrete feature registry.
|
|
89
|
+
|
|
90
|
+
Source: `packages/table-core/src/types/TableFeatures.ts`
|
|
91
|
+
|
|
92
|
+
### [HIGH] Discovering methods through own keys
|
|
93
|
+
|
|
94
|
+
Wrong:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
const methods = Object.keys(row).filter((key) => key.startsWith('get'))
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Correct:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
const value = row.getValue('name')
|
|
104
|
+
const prototype = Object.getPrototypeOf(row)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
V9 shares many instance methods through prototypes, so spread, serialization, and `Object.keys` omit them.
|
|
108
|
+
|
|
109
|
+
Source: `docs/framework/react/guide/migrating.md#instance-methods-must-be-called-on-their-instance`
|
|
110
|
+
|
|
111
|
+
## API Discovery
|
|
112
|
+
|
|
113
|
+
Use this order: installed `package.json` version, installed adapter `src/index.ts`, installed core `src/index.ts`, then the exported implementation or feature directory. If `src` is absent, inspect installed declarations for that exact version.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: client-vs-server
|
|
3
|
+
description: >
|
|
4
|
+
Choose client or server ownership for filtering, grouping, sorting, expanding, and pagination in TanStack Table v9. Load for manual* flags, mixed pipelines, server counts, or deciding which dataset each row-model stage receives.
|
|
5
|
+
metadata:
|
|
6
|
+
type: sub-skill
|
|
7
|
+
library: '@tanstack/table-core'
|
|
8
|
+
library_version: '9.0.0-beta.51'
|
|
9
|
+
requires: ['core', 'table-features']
|
|
10
|
+
sources:
|
|
11
|
+
- 'TanStack/table:docs/guide/row-models.md'
|
|
12
|
+
- 'TanStack/table:packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts'
|
|
13
|
+
- 'TanStack/table:examples/react/with-tanstack-query'
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
This skill builds on `core` and `table-features`. Read them first for the model pipeline and plugin slots.
|
|
17
|
+
|
|
18
|
+
## Setup
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import {
|
|
22
|
+
rowPaginationFeature,
|
|
23
|
+
rowSortingFeature,
|
|
24
|
+
tableFeatures,
|
|
25
|
+
} from '@tanstack/table-core'
|
|
26
|
+
|
|
27
|
+
export const features = tableFeatures({
|
|
28
|
+
rowSortingFeature,
|
|
29
|
+
rowPaginationFeature,
|
|
30
|
+
})
|
|
31
|
+
export const serverOptions = {
|
|
32
|
+
manualSorting: true,
|
|
33
|
+
manualPagination: true,
|
|
34
|
+
rowCount: 12_450,
|
|
35
|
+
} as const
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Core Patterns
|
|
39
|
+
|
|
40
|
+
### Client owns the complete pipeline
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
const features = tableFeatures({
|
|
44
|
+
columnFilteringFeature,
|
|
45
|
+
filteredRowModel: createFilteredRowModel(),
|
|
46
|
+
rowSortingFeature,
|
|
47
|
+
sortedRowModel: createSortedRowModel(),
|
|
48
|
+
rowPaginationFeature,
|
|
49
|
+
paginatedRowModel: createPaginatedRowModel(),
|
|
50
|
+
})
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Pass the full client dataset so each stage can process all rows.
|
|
54
|
+
|
|
55
|
+
### Server owns processing
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
const options = {
|
|
59
|
+
data: serverPage.rows,
|
|
60
|
+
manualFiltering: true,
|
|
61
|
+
manualSorting: true,
|
|
62
|
+
manualPagination: true,
|
|
63
|
+
rowCount: serverPage.total,
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Put controlled filter, sorting, and pagination state into the request/query key.
|
|
68
|
+
|
|
69
|
+
## Common Mistakes
|
|
70
|
+
|
|
71
|
+
### [CRITICAL] Treating manual flags as requests
|
|
72
|
+
|
|
73
|
+
Wrong:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
const options = { manualSorting: true, data: unsortedRows }
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Correct:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
const sortedPage = await fetchPage({ sorting })
|
|
83
|
+
const options = { manualSorting: true, data: sortedPage.rows }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`manualSorting` only bypasses client sorting; it never calls a backend.
|
|
87
|
+
|
|
88
|
+
Source: `packages/table-core/src/features/row-sorting/rowSortingFeature.types.ts`
|
|
89
|
+
|
|
90
|
+
### [HIGH] Expecting manual pagination to slice
|
|
91
|
+
|
|
92
|
+
Wrong:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
const options = { data: allRows, manualPagination: true }
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Correct:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
const page = await fetchPage({ pageIndex, pageSize })
|
|
102
|
+
const options = {
|
|
103
|
+
data: page.rows,
|
|
104
|
+
manualPagination: true,
|
|
105
|
+
rowCount: page.rowCount,
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Manual pagination assumes `data` already represents the intended page. Pass the stable page result directly. If the application deliberately performs custom local slicing instead, derive it with the framework's memo/computed primitive and keep the reference stable until its actual inputs change.
|
|
110
|
+
|
|
111
|
+
Source: `docs/framework/react/guide/pagination.md#manual-server-side-pagination`
|
|
112
|
+
|
|
113
|
+
### [HIGH] Sorting only the loaded page accidentally
|
|
114
|
+
|
|
115
|
+
Wrong:
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
const options = {
|
|
119
|
+
data: serverPage.rows,
|
|
120
|
+
manualPagination: true,
|
|
121
|
+
manualSorting: false,
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Correct:
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
const options = {
|
|
129
|
+
data: serverPage.rows,
|
|
130
|
+
manualPagination: true,
|
|
131
|
+
manualSorting: true,
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Client sorting can see only loaded rows, so it cannot produce database-wide order.
|
|
136
|
+
|
|
137
|
+
Source: `docs/guide/row-models.md`
|
|
138
|
+
|
|
139
|
+
### [HIGH] Recreating processed data or columns inline
|
|
140
|
+
|
|
141
|
+
Wrong:
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
const options = {
|
|
145
|
+
data: allRows.filter(matchesFilters).slice(pageStart, pageEnd),
|
|
146
|
+
columns: makeColumns(),
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Correct:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
const processedRows = pageResult.rows
|
|
154
|
+
const columns = sharedColumns
|
|
155
|
+
const options = { data: processedRows, columns }
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
`data` and `columns` are model inputs. Keep both references stable between meaningful changes with module constants, state, or the adapter's memo/computed primitive; otherwise Table repeatedly invalidates row and column models and some adapters can enter render loops. “Manual” describes processing ownership, not permission to derive new arrays inside table options.
|
|
159
|
+
|
|
160
|
+
Source: `docs/guide/data.md`
|
|
161
|
+
|
|
162
|
+
## API Discovery
|
|
163
|
+
|
|
164
|
+
Inspect `node_modules/@tanstack/table-core/src/core/row-models/coreRowModelsFeature.utils.ts` for pipeline order and each feature's `.types.ts` for its `manual*` contract.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: column-faceting
|
|
3
|
+
description: >
|
|
4
|
+
Build faceted filter UIs with columnFacetingFeature, facetedRowModel, facetedUniqueValues, and facetedMinMaxValues. Load for facet counts, numeric ranges, own-filter exclusion, or server-page facet completeness.
|
|
5
|
+
metadata:
|
|
6
|
+
{
|
|
7
|
+
type: sub-skill,
|
|
8
|
+
library: '@tanstack/table-core',
|
|
9
|
+
library_version: '9.0.0-beta.51',
|
|
10
|
+
}
|
|
11
|
+
requires: ['core', 'table-features', 'column-filtering']
|
|
12
|
+
sources:
|
|
13
|
+
- 'TanStack/table:docs/framework/react/guide/column-faceting.md'
|
|
14
|
+
- 'TanStack/table:packages/table-core/src/features/column-faceting'
|
|
15
|
+
- 'TanStack/table:examples/react/filters-faceted'
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
This skill builds on `core`, `table-features`, and `column-filtering`. Faceting derives filter choices; it does not render controls.
|
|
19
|
+
|
|
20
|
+
## Setup
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import {
|
|
24
|
+
columnFacetingFeature,
|
|
25
|
+
columnFilteringFeature,
|
|
26
|
+
createFacetedMinMaxValues,
|
|
27
|
+
createFacetedRowModel,
|
|
28
|
+
createFacetedUniqueValues,
|
|
29
|
+
createFilteredRowModel,
|
|
30
|
+
filterFn_includesString,
|
|
31
|
+
filterFn_inNumberRange,
|
|
32
|
+
tableFeatures,
|
|
33
|
+
} from '@tanstack/table-core'
|
|
34
|
+
|
|
35
|
+
export const features = tableFeatures({
|
|
36
|
+
columnFilteringFeature,
|
|
37
|
+
filteredRowModel: createFilteredRowModel(),
|
|
38
|
+
filterFns: {
|
|
39
|
+
includesString: filterFn_includesString,
|
|
40
|
+
inNumberRange: filterFn_inNumberRange,
|
|
41
|
+
},
|
|
42
|
+
columnFacetingFeature,
|
|
43
|
+
facetedRowModel: createFacetedRowModel(),
|
|
44
|
+
facetedUniqueValues: createFacetedUniqueValues(),
|
|
45
|
+
facetedMinMaxValues: createFacetedMinMaxValues(),
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Core Patterns
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
const counts = table.getColumn('status')?.getFacetedUniqueValues() ?? new Map()
|
|
53
|
+
const range = table.getColumn('age')?.getFacetedMinMaxValues()
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Use unique values for discrete controls and min/max only for numeric ranges.
|
|
57
|
+
The filtered model makes facets respond to the table's other active filters.
|
|
58
|
+
Register individually imported built-ins under their conventional keys so
|
|
59
|
+
columns can reference them by string name; a column may instead receive a
|
|
60
|
+
filter function directly without registering it. The full `filterFns` registry
|
|
61
|
+
object still works but bundles every built-in.
|
|
62
|
+
|
|
63
|
+
## Common Mistakes
|
|
64
|
+
|
|
65
|
+
### [HIGH] Registering APIs without model slots
|
|
66
|
+
|
|
67
|
+
Wrong: `tableFeatures({ columnFilteringFeature, columnFacetingFeature })`
|
|
68
|
+
|
|
69
|
+
Correct: `tableFeatures({ columnFilteringFeature, columnFacetingFeature, facetedRowModel: createFacetedRowModel(), facetedUniqueValues: createFacetedUniqueValues() })`
|
|
70
|
+
|
|
71
|
+
Each faceting getter needs its matching factory slot.
|
|
72
|
+
|
|
73
|
+
Source: `packages/table-core/src/features/column-faceting/columnFacetingFeature.ts`
|
|
74
|
+
|
|
75
|
+
### [MEDIUM] Expecting facet to apply itself
|
|
76
|
+
|
|
77
|
+
Wrong: `column.getFacetedUniqueValues().get(activeValue) === 0`
|
|
78
|
+
|
|
79
|
+
Correct: `column.getFacetedUniqueValues().get(activeValue) ?? 0`
|
|
80
|
+
|
|
81
|
+
A column facet intentionally excludes that column's own filter while applying other filters.
|
|
82
|
+
|
|
83
|
+
Source: `docs/framework/react/guide/column-faceting.md`
|
|
84
|
+
|
|
85
|
+
### [HIGH] Treating page facets as global
|
|
86
|
+
|
|
87
|
+
Wrong: `const globalCounts = column.getFacetedUniqueValues()`
|
|
88
|
+
|
|
89
|
+
Correct: `const globalCounts = await fetchFacetCounts(activeFilters)`
|
|
90
|
+
|
|
91
|
+
With server pagination, client faceting sees only loaded data.
|
|
92
|
+
|
|
93
|
+
Source: `docs/framework/react/guide/column-faceting.md#custom-server-side-faceting`
|
|
94
|
+
|
|
95
|
+
## API Discovery
|
|
96
|
+
|
|
97
|
+
Inspect `node_modules/@tanstack/table-core/src/features/column-faceting/` for exact getters and factory return types.
|