@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,14 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assignPrototypeAPIs,
|
|
3
3
|
assignTableAPIs,
|
|
4
|
+
makeObjectMap,
|
|
4
5
|
makeStateUpdater,
|
|
5
6
|
} from '../../utils'
|
|
6
7
|
import {
|
|
7
|
-
cell_getIsAggregated,
|
|
8
8
|
cell_getIsGrouped,
|
|
9
9
|
cell_getIsPlaceholder,
|
|
10
|
-
column_getAggregationFn,
|
|
11
|
-
column_getAutoAggregationFn,
|
|
12
10
|
column_getCanGroup,
|
|
13
11
|
column_getGroupedIndex,
|
|
14
12
|
column_getIsGrouped,
|
|
@@ -23,7 +21,7 @@ import {
|
|
|
23
21
|
import type { TableFeature } from '../../types/TableFeatures'
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
|
-
* Feature that adds column grouping state
|
|
24
|
+
* Feature that adds column grouping state and grouped row APIs.
|
|
27
25
|
*/
|
|
28
26
|
export const columnGroupingFeature: TableFeature = {
|
|
29
27
|
getInitialState: (initialState) => {
|
|
@@ -33,13 +31,6 @@ export const columnGroupingFeature: TableFeature = {
|
|
|
33
31
|
}
|
|
34
32
|
},
|
|
35
33
|
|
|
36
|
-
getDefaultColumnDef: () => {
|
|
37
|
-
return {
|
|
38
|
-
aggregatedCell: ({ getValue }: any) => getValue()?.toString?.() ?? null,
|
|
39
|
-
aggregationFn: 'auto',
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
|
|
43
34
|
getDefaultTableOptions: (table) => {
|
|
44
35
|
return {
|
|
45
36
|
onGroupingChange: makeStateUpdater('grouping', table),
|
|
@@ -55,9 +46,6 @@ export const columnGroupingFeature: TableFeature = {
|
|
|
55
46
|
cell_getIsPlaceholder: {
|
|
56
47
|
fn: (cell) => cell_getIsPlaceholder(cell),
|
|
57
48
|
},
|
|
58
|
-
cell_getIsAggregated: {
|
|
59
|
-
fn: (cell) => cell_getIsAggregated(cell),
|
|
60
|
-
},
|
|
61
49
|
})
|
|
62
50
|
},
|
|
63
51
|
|
|
@@ -78,12 +66,6 @@ export const columnGroupingFeature: TableFeature = {
|
|
|
78
66
|
column_getToggleGroupingHandler: {
|
|
79
67
|
fn: (column) => column_getToggleGroupingHandler(column),
|
|
80
68
|
},
|
|
81
|
-
column_getAutoAggregationFn: {
|
|
82
|
-
fn: (column) => column_getAutoAggregationFn(column),
|
|
83
|
-
},
|
|
84
|
-
column_getAggregationFn: {
|
|
85
|
-
fn: (column) => column_getAggregationFn(column),
|
|
86
|
-
},
|
|
87
69
|
})
|
|
88
70
|
},
|
|
89
71
|
|
|
@@ -99,7 +81,7 @@ export const columnGroupingFeature: TableFeature = {
|
|
|
99
81
|
},
|
|
100
82
|
|
|
101
83
|
initRowInstanceData: (row) => {
|
|
102
|
-
;(row as any)._groupingValuesCache =
|
|
84
|
+
;(row as any)._groupingValuesCache = makeObjectMap()
|
|
103
85
|
},
|
|
104
86
|
|
|
105
87
|
constructTableAPIs: (table) => {
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'
|
|
2
|
-
import type {
|
|
3
|
-
import type { BuiltInAggregationFn } from '../../fns/aggregationFns'
|
|
4
|
-
import type {
|
|
5
|
-
CellData,
|
|
6
|
-
OnChangeFn,
|
|
7
|
-
RowData,
|
|
8
|
-
Updater,
|
|
9
|
-
} from '../../types/type-utils'
|
|
2
|
+
import type { OnChangeFn, RowData, Updater } from '../../types/type-utils'
|
|
10
3
|
import type { TableFeatures } from '../../types/TableFeatures'
|
|
11
4
|
import type { Row } from '../../types/Row'
|
|
12
|
-
import type { Cell } from '../../types/Cell'
|
|
13
|
-
import type { ColumnDefTemplate } from '../../types/ColumnDef'
|
|
14
5
|
|
|
15
6
|
export type GroupingState = Array<string>
|
|
16
7
|
|
|
@@ -18,53 +9,10 @@ export interface TableState_ColumnGrouping {
|
|
|
18
9
|
grouping: GroupingState
|
|
19
10
|
}
|
|
20
11
|
|
|
21
|
-
export interface RowModelFns_ColumnGrouping<
|
|
22
|
-
TFeatures extends TableFeatures,
|
|
23
|
-
TData extends RowData,
|
|
24
|
-
> {
|
|
25
|
-
aggregationFns: Record<keyof AggregationFns, AggregationFn<TFeatures, TData>>
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface AggregationFns {}
|
|
29
|
-
|
|
30
|
-
export type AggregationFn<
|
|
31
|
-
TFeatures extends TableFeatures,
|
|
32
|
-
TData extends RowData,
|
|
33
|
-
> = (
|
|
34
|
-
columnId: string,
|
|
35
|
-
leafRows: Array<Row<TFeatures, TData>>,
|
|
36
|
-
childRows: Array<Row<TFeatures, TData>>,
|
|
37
|
-
) => any
|
|
38
|
-
|
|
39
|
-
export type CustomAggregationFns<
|
|
40
|
-
TFeatures extends TableFeatures,
|
|
41
|
-
TData extends RowData,
|
|
42
|
-
> = Record<string, AggregationFn<TFeatures, TData>>
|
|
43
|
-
|
|
44
|
-
export type AggregationFnOption<
|
|
45
|
-
TFeatures extends TableFeatures,
|
|
46
|
-
TData extends RowData,
|
|
47
|
-
> =
|
|
48
|
-
| 'auto'
|
|
49
|
-
| keyof AggregationFns
|
|
50
|
-
| BuiltInAggregationFn
|
|
51
|
-
| AggregationFn<TFeatures, TData>
|
|
52
|
-
|
|
53
12
|
export interface ColumnDef_ColumnGrouping<
|
|
54
|
-
TFeatures extends TableFeatures,
|
|
55
|
-
TData extends RowData,
|
|
56
|
-
TValue extends CellData = CellData,
|
|
13
|
+
in out TFeatures extends TableFeatures,
|
|
14
|
+
in out TData extends RowData,
|
|
57
15
|
> {
|
|
58
|
-
/**
|
|
59
|
-
* The cell to display each row for the column if the cell is an aggregate. If a function is passed, it will be passed a props object with the context of the cell and should return the property type for your adapter (the exact type depends on the adapter being used).
|
|
60
|
-
*/
|
|
61
|
-
aggregatedCell?: ColumnDefTemplate<
|
|
62
|
-
ReturnType<Cell<TFeatures, TData, TValue>['getContext']>
|
|
63
|
-
>
|
|
64
|
-
/**
|
|
65
|
-
* The resolved aggregation function for the column.
|
|
66
|
-
*/
|
|
67
|
-
aggregationFn?: AggregationFnOption<TFeatures, TData>
|
|
68
16
|
/**
|
|
69
17
|
* Allows this column to be added to grouping state.
|
|
70
18
|
*
|
|
@@ -72,23 +20,19 @@ export interface ColumnDef_ColumnGrouping<
|
|
|
72
20
|
*/
|
|
73
21
|
enableGrouping?: boolean
|
|
74
22
|
/**
|
|
75
|
-
*
|
|
76
|
-
|
|
77
|
-
|
|
23
|
+
* Returns the value used to group rows for this column.
|
|
24
|
+
*
|
|
25
|
+
* When omitted, grouping uses the value derived from this column's
|
|
26
|
+
* `accessorKey` or `accessorFn`.
|
|
27
|
+
*/
|
|
28
|
+
getGroupingValue?: (
|
|
29
|
+
originalRow: TData,
|
|
30
|
+
index: number,
|
|
31
|
+
row: Row<TFeatures, TData>,
|
|
32
|
+
) => any
|
|
78
33
|
}
|
|
79
34
|
|
|
80
|
-
export interface Column_ColumnGrouping
|
|
81
|
-
TFeatures extends TableFeatures,
|
|
82
|
-
TData extends RowData,
|
|
83
|
-
> {
|
|
84
|
-
/**
|
|
85
|
-
* Returns the aggregation function for the column.
|
|
86
|
-
*/
|
|
87
|
-
getAggregationFn: () => AggregationFn<TFeatures, TData> | undefined
|
|
88
|
-
/**
|
|
89
|
-
* Returns the automatically inferred aggregation function for the column.
|
|
90
|
-
*/
|
|
91
|
-
getAutoAggregationFn: () => AggregationFn<TFeatures, TData> | undefined
|
|
35
|
+
export interface Column_ColumnGrouping {
|
|
92
36
|
/**
|
|
93
37
|
* Checks whether this column can currently be grouped.
|
|
94
38
|
*/
|
|
@@ -132,10 +76,6 @@ export interface Row_ColumnGrouping {
|
|
|
132
76
|
}
|
|
133
77
|
|
|
134
78
|
export interface Cell_ColumnGrouping {
|
|
135
|
-
/**
|
|
136
|
-
* Checks whether this cell should render an aggregated value.
|
|
137
|
-
*/
|
|
138
|
-
getIsAggregated: () => boolean
|
|
139
79
|
/**
|
|
140
80
|
* Checks whether this cell represents the active grouping column.
|
|
141
81
|
*/
|
|
@@ -175,8 +115,8 @@ export interface TableOptions_ColumnGrouping {
|
|
|
175
115
|
export type GroupingColumnMode = false | 'reorder' | 'remove'
|
|
176
116
|
|
|
177
117
|
export interface Table_ColumnGrouping<
|
|
178
|
-
|
|
179
|
-
|
|
118
|
+
in out _TFeatures extends TableFeatures,
|
|
119
|
+
in out _TData extends RowData,
|
|
180
120
|
> {
|
|
181
121
|
/**
|
|
182
122
|
* Resets `grouping` to `initialState.grouping`.
|
|
@@ -191,11 +131,11 @@ export interface Table_ColumnGrouping<
|
|
|
191
131
|
}
|
|
192
132
|
|
|
193
133
|
export interface Table_RowModels_Grouped<
|
|
194
|
-
TFeatures extends TableFeatures,
|
|
195
|
-
TData extends RowData,
|
|
134
|
+
in out TFeatures extends TableFeatures,
|
|
135
|
+
in out TData extends RowData,
|
|
196
136
|
> {
|
|
197
137
|
/**
|
|
198
|
-
* Resolves the row model after grouping
|
|
138
|
+
* Resolves the row model after grouping has been applied.
|
|
199
139
|
*/
|
|
200
140
|
getGroupedRowModel: () => RowModel<TFeatures, TData>
|
|
201
141
|
/**
|
|
@@ -204,23 +144,9 @@ export interface Table_RowModels_Grouped<
|
|
|
204
144
|
getPreGroupedRowModel: () => RowModel<TFeatures, TData>
|
|
205
145
|
}
|
|
206
146
|
|
|
207
|
-
export interface CreateRowModel_Grouped<
|
|
208
|
-
TFeatures extends TableFeatures,
|
|
209
|
-
TData extends RowData,
|
|
210
|
-
> {
|
|
211
|
-
/**
|
|
212
|
-
* Factory used to retrieve the grouped row model. If using server-side
|
|
213
|
-
* grouping, this is not required. To use client-side grouping, pass
|
|
214
|
-
* `createGroupedRowModel()` or implement your own factory.
|
|
215
|
-
*/
|
|
216
|
-
groupedRowModel?: (
|
|
217
|
-
table: Table<TFeatures, TData>,
|
|
218
|
-
) => () => RowModel<TFeatures, TData>
|
|
219
|
-
}
|
|
220
|
-
|
|
221
147
|
export interface CachedRowModel_Grouped<
|
|
222
|
-
TFeatures extends TableFeatures,
|
|
223
|
-
TData extends RowData,
|
|
148
|
+
in out TFeatures extends TableFeatures,
|
|
149
|
+
in out TData extends RowData,
|
|
224
150
|
> {
|
|
225
151
|
groupedRowModel: () => RowModel<TFeatures, TData>
|
|
226
152
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cloneState,
|
|
1
|
+
import { cloneState, hasOwn } from '../../utils'
|
|
2
2
|
import type { Column_Internal } from '../../types/Column'
|
|
3
3
|
import type { CellData, RowData, Updater } from '../../types/type-utils'
|
|
4
4
|
import type { TableFeatures } from '../../types/TableFeatures'
|
|
@@ -6,7 +6,6 @@ import type { Table_Internal } from '../../types/Table'
|
|
|
6
6
|
import type { Row } from '../../types/Row'
|
|
7
7
|
import type { Cell } from '../../types/Cell'
|
|
8
8
|
import type {
|
|
9
|
-
AggregationFn,
|
|
10
9
|
GroupingState,
|
|
11
10
|
Row_ColumnGrouping,
|
|
12
11
|
} from './columnGroupingFeature.types'
|
|
@@ -135,67 +134,6 @@ export function column_getToggleGroupingHandler<
|
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
/**
|
|
139
|
-
* Chooses a built-in aggregation function from the first core row value.
|
|
140
|
-
*
|
|
141
|
-
* Numeric columns default to `sum`, date-like values default to `extent`, and
|
|
142
|
-
* other value types leave aggregation unspecified.
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* ```ts
|
|
146
|
-
* const aggregationFn = column_getAutoAggregationFn(column)
|
|
147
|
-
* ```
|
|
148
|
-
*/
|
|
149
|
-
export function column_getAutoAggregationFn<
|
|
150
|
-
TFeatures extends TableFeatures,
|
|
151
|
-
TData extends RowData,
|
|
152
|
-
TValue extends CellData = CellData,
|
|
153
|
-
>(column: Column_Internal<TFeatures, TData, TValue>) {
|
|
154
|
-
const aggregationFns:
|
|
155
|
-
| Record<string, AggregationFn<TFeatures, TData>>
|
|
156
|
-
| undefined = column.table._rowModelFns.aggregationFns
|
|
157
|
-
|
|
158
|
-
const firstRow = column.table.getCoreRowModel().flatRows[0]
|
|
159
|
-
|
|
160
|
-
const value = firstRow?.getValue(column.id)
|
|
161
|
-
|
|
162
|
-
if (typeof value === 'number') {
|
|
163
|
-
return aggregationFns?.sum
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
167
|
-
return aggregationFns?.extent
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Resolves the aggregation function configured for a column.
|
|
173
|
-
*
|
|
174
|
-
* Function-valued `columnDef.aggregationFn` is returned directly, `'auto'`
|
|
175
|
-
* delegates to `column_getAutoAggregationFn`, and string values are looked up in
|
|
176
|
-
* the table's aggregation function registry.
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* ```ts
|
|
180
|
-
* const aggregationFn = column_getAggregationFn(column)
|
|
181
|
-
* ```
|
|
182
|
-
*/
|
|
183
|
-
export function column_getAggregationFn<
|
|
184
|
-
TFeatures extends TableFeatures,
|
|
185
|
-
TData extends RowData,
|
|
186
|
-
TValue extends CellData = CellData,
|
|
187
|
-
>(column: Column_Internal<TFeatures, TData, TValue>) {
|
|
188
|
-
const aggregationFns:
|
|
189
|
-
| Record<string, AggregationFn<TFeatures, TData>>
|
|
190
|
-
| undefined = column.table._rowModelFns.aggregationFns
|
|
191
|
-
|
|
192
|
-
return isFunction(column.columnDef.aggregationFn)
|
|
193
|
-
? column.columnDef.aggregationFn
|
|
194
|
-
: column.columnDef.aggregationFn === 'auto'
|
|
195
|
-
? column_getAutoAggregationFn(column)
|
|
196
|
-
: aggregationFns?.[column.columnDef.aggregationFn as string]
|
|
197
|
-
}
|
|
198
|
-
|
|
199
137
|
/**
|
|
200
138
|
* Routes a grouping updater through the table's grouping change handler.
|
|
201
139
|
*
|
|
@@ -268,7 +206,7 @@ export function row_getGroupingValue<
|
|
|
268
206
|
TFeatures extends TableFeatures,
|
|
269
207
|
TData extends RowData,
|
|
270
208
|
>(row: Row<TFeatures, TData> & Partial<Row_ColumnGrouping>, columnId: string) {
|
|
271
|
-
if (row._groupingValuesCache
|
|
209
|
+
if (row._groupingValuesCache && hasOwn(row._groupingValuesCache, columnId)) {
|
|
272
210
|
return row._groupingValuesCache[columnId]
|
|
273
211
|
}
|
|
274
212
|
|
|
@@ -284,6 +222,8 @@ export function row_getGroupingValue<
|
|
|
284
222
|
if (row._groupingValuesCache) {
|
|
285
223
|
row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(
|
|
286
224
|
row.original,
|
|
225
|
+
row.index,
|
|
226
|
+
row,
|
|
287
227
|
)
|
|
288
228
|
}
|
|
289
229
|
|
|
@@ -329,26 +269,3 @@ export function cell_getIsPlaceholder<
|
|
|
329
269
|
>(cell: Cell<TFeatures, TData, TValue>) {
|
|
330
270
|
return !cell_getIsGrouped(cell) && column_getIsGrouped(cell.column)
|
|
331
271
|
}
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Checks whether this cell should render an aggregated value.
|
|
335
|
-
*
|
|
336
|
-
* Aggregated cells are non-placeholder, non-grouped cells on rows that have
|
|
337
|
-
* subRows.
|
|
338
|
-
*
|
|
339
|
-
* @example
|
|
340
|
-
* ```ts
|
|
341
|
-
* const isAggregated = cell_getIsAggregated(cell)
|
|
342
|
-
* ```
|
|
343
|
-
*/
|
|
344
|
-
export function cell_getIsAggregated<
|
|
345
|
-
TFeatures extends TableFeatures,
|
|
346
|
-
TData extends RowData,
|
|
347
|
-
TValue extends CellData = CellData,
|
|
348
|
-
>(cell: Cell<TFeatures, TData, TValue>) {
|
|
349
|
-
return (
|
|
350
|
-
!cell_getIsGrouped(cell) &&
|
|
351
|
-
!cell_getIsPlaceholder(cell) &&
|
|
352
|
-
!!cell.row.subRows.length
|
|
353
|
-
)
|
|
354
|
-
}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { hasOwn, makeObjectMap, tableMemo } from '../../utils'
|
|
2
2
|
import { constructRow } from '../../core/rows/constructRow'
|
|
3
3
|
import { table_getColumn } from '../../core/columns/coreColumnsFeature.utils'
|
|
4
4
|
import { table_autoResetExpanded } from '../row-expanding/rowExpandingFeature.utils'
|
|
5
5
|
import { table_autoResetPageIndex } from '../row-pagination/rowPaginationFeature.utils'
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from '
|
|
10
|
-
import
|
|
11
|
-
import type {
|
|
12
|
-
AggregationFn,
|
|
13
|
-
AggregationFns,
|
|
14
|
-
Row_ColumnGrouping,
|
|
15
|
-
} from './columnGroupingFeature.types'
|
|
7
|
+
aggregateColumnValue,
|
|
8
|
+
normalizeAggregationRows,
|
|
9
|
+
} from '../row-aggregation/rowAggregationFeature.utils'
|
|
10
|
+
import { row_getGroupingValue } from './columnGroupingFeature.utils'
|
|
11
|
+
import type { Row_ColumnGrouping } from './columnGroupingFeature.types'
|
|
16
12
|
import type { TableFeatures } from '../../types/TableFeatures'
|
|
17
13
|
import type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'
|
|
18
14
|
import type { Table, Table_Internal } from '../../types/Table'
|
|
@@ -23,17 +19,16 @@ import type { RowData } from '../../types/type-utils'
|
|
|
23
19
|
* Creates a memoized grouped row model factory.
|
|
24
20
|
*
|
|
25
21
|
* The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.
|
|
22
|
+
*
|
|
23
|
+
* When rowAggregationFeature is also registered, grouped rows use its shared
|
|
24
|
+
* executor for non-group values. Grouping remains useful without aggregation.
|
|
26
25
|
*/
|
|
27
26
|
export function createGroupedRowModel<
|
|
28
27
|
TFeatures extends TableFeatures,
|
|
29
28
|
TData extends RowData = any,
|
|
30
|
-
>(
|
|
31
|
-
aggregationFns: Record<keyof AggregationFns, AggregationFn<TFeatures, TData>>,
|
|
32
|
-
): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {
|
|
29
|
+
>(): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {
|
|
33
30
|
return (_table) => {
|
|
34
31
|
const table = _table as unknown as Table_Internal<TFeatures, TData>
|
|
35
|
-
if (!table._rowModelFns.aggregationFns)
|
|
36
|
-
table._rowModelFns.aggregationFns = aggregationFns
|
|
37
32
|
return tableMemo({
|
|
38
33
|
feature: 'columnGroupingFeature',
|
|
39
34
|
table,
|
|
@@ -41,6 +36,7 @@ export function createGroupedRowModel<
|
|
|
41
36
|
memoDeps: () => [
|
|
42
37
|
table.atoms.grouping?.get(),
|
|
43
38
|
table.getPreGroupedRowModel(),
|
|
39
|
+
table.options.columns,
|
|
44
40
|
],
|
|
45
41
|
fn: () => _createGroupedRowModel(table),
|
|
46
42
|
onAfterUpdate: () => {
|
|
@@ -73,7 +69,7 @@ function _createGroupedRowModel<
|
|
|
73
69
|
|
|
74
70
|
const groupedFlatRows: Array<Row<TFeatures, TData>> &
|
|
75
71
|
Partial<Row_ColumnGrouping> = []
|
|
76
|
-
const groupedRowsById
|
|
72
|
+
const groupedRowsById = makeObjectMap<Row<TFeatures, TData>>()
|
|
77
73
|
|
|
78
74
|
// Recursively group the data
|
|
79
75
|
const groupUpRecursively = (
|
|
@@ -87,11 +83,17 @@ function _createGroupedRowModel<
|
|
|
87
83
|
return rows.map((row) => {
|
|
88
84
|
row.depth = depth
|
|
89
85
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
// Every row is pushed into flatRows/rowsById exactly once, by its
|
|
87
|
+
// parent frame: rows returned here are pushed by the caller (the
|
|
88
|
+
// parent group's loop or the root loop), so only descendants below
|
|
89
|
+
// the terminal depth are pushed here.
|
|
93
90
|
if (row.subRows.length) {
|
|
94
91
|
row.subRows = groupUpRecursively(row.subRows, depth + 1, row.id)
|
|
92
|
+
for (let i = 0; i < row.subRows.length; i++) {
|
|
93
|
+
const subRow = row.subRows[i]!
|
|
94
|
+
groupedFlatRows.push(subRow)
|
|
95
|
+
groupedRowsById[subRow.id] = subRow
|
|
96
|
+
}
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
return row
|
|
@@ -116,10 +118,7 @@ function _createGroupedRowModel<
|
|
|
116
118
|
subRow.parentId = id
|
|
117
119
|
})
|
|
118
120
|
|
|
119
|
-
|
|
120
|
-
const leafRows = depth
|
|
121
|
-
? flattenBy(groupedRows, (row) => row.subRows)
|
|
122
|
-
: groupedRows
|
|
121
|
+
const leafRows = normalizeAggregationRows(groupedRows, Infinity)
|
|
123
122
|
|
|
124
123
|
const row = constructRow(
|
|
125
124
|
table,
|
|
@@ -137,9 +136,13 @@ function _createGroupedRowModel<
|
|
|
137
136
|
subRows,
|
|
138
137
|
leafRows,
|
|
139
138
|
getValue: (colId: string) => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
const groupingIndex = existingGrouping.indexOf(colId)
|
|
140
|
+
|
|
141
|
+
// The active grouping column and ancestor grouping columns expose
|
|
142
|
+
// their inherited grouping values. Columns grouped at deeper
|
|
143
|
+
// levels are still eligible for aggregation here.
|
|
144
|
+
if (groupingIndex !== -1 && groupingIndex <= depth) {
|
|
145
|
+
if (hasOwn(row._valuesCache, colId)) {
|
|
143
146
|
return row._valuesCache[colId]
|
|
144
147
|
}
|
|
145
148
|
|
|
@@ -151,27 +154,25 @@ function _createGroupedRowModel<
|
|
|
151
154
|
return row._valuesCache[colId]
|
|
152
155
|
}
|
|
153
156
|
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
const aggregationCache = (row as any)._aggregationValuesCache as
|
|
158
|
+
| Record<string, unknown>
|
|
159
|
+
| undefined
|
|
160
|
+
if (aggregationCache && hasOwn(aggregationCache, colId)) {
|
|
161
|
+
return aggregationCache[colId]
|
|
156
162
|
}
|
|
157
163
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
groupedRows,
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
return row._groupingValuesCache[colId]
|
|
174
|
-
}
|
|
164
|
+
const column = table.getColumn(colId) as any
|
|
165
|
+
if (typeof column.getAggregationFns !== 'function') return undefined
|
|
166
|
+
|
|
167
|
+
const cache = ((row as any)._aggregationValuesCache ??=
|
|
168
|
+
makeObjectMap())
|
|
169
|
+
cache[colId] = aggregateColumnValue({
|
|
170
|
+
subRows,
|
|
171
|
+
column,
|
|
172
|
+
groupingRow: row,
|
|
173
|
+
rows: groupedRows,
|
|
174
|
+
})
|
|
175
|
+
return cache[colId]
|
|
175
176
|
},
|
|
176
177
|
})
|
|
177
178
|
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
column_getIsFirstColumn,
|
|
9
9
|
column_getIsLastColumn,
|
|
10
10
|
getDefaultColumnOrderState,
|
|
11
|
+
table_getColumnIndexes,
|
|
11
12
|
table_getOrderColumnsFn,
|
|
12
13
|
table_resetColumnOrder,
|
|
13
14
|
table_setColumnOrder,
|
|
@@ -35,13 +36,6 @@ export const columnOrderingFeature: TableFeature = {
|
|
|
35
36
|
assignPrototypeAPIs('columnOrderingFeature', prototype, table, {
|
|
36
37
|
column_getIndex: {
|
|
37
38
|
fn: (column, position) => column_getIndex(column, position),
|
|
38
|
-
memoDeps: (column, position) => [
|
|
39
|
-
position,
|
|
40
|
-
column.table.atoms.columnOrder?.get(),
|
|
41
|
-
column.table.atoms.columnPinning?.get(),
|
|
42
|
-
column.table.atoms.grouping?.get(),
|
|
43
|
-
column.table.atoms.columnVisibility?.get(),
|
|
44
|
-
],
|
|
45
39
|
},
|
|
46
40
|
column_getIsFirstColumn: {
|
|
47
41
|
fn: (column, position) => column_getIsFirstColumn(column, position),
|
|
@@ -54,6 +48,17 @@ export const columnOrderingFeature: TableFeature = {
|
|
|
54
48
|
|
|
55
49
|
constructTableAPIs: (table) => {
|
|
56
50
|
assignTableAPIs('columnOrderingFeature', table, {
|
|
51
|
+
table_getColumnIndexes: {
|
|
52
|
+
fn: () => table_getColumnIndexes(table),
|
|
53
|
+
memoDeps: () => [
|
|
54
|
+
table.options.columns,
|
|
55
|
+
table.atoms.columnOrder?.get(),
|
|
56
|
+
table.atoms.columnPinning?.get(),
|
|
57
|
+
table.atoms.columnVisibility?.get(),
|
|
58
|
+
table.atoms.grouping?.get(),
|
|
59
|
+
table.options.groupedColumnMode,
|
|
60
|
+
],
|
|
61
|
+
},
|
|
57
62
|
table_setColumnOrder: {
|
|
58
63
|
fn: (updater) => table_setColumnOrder(table, updater),
|
|
59
64
|
},
|
|
@@ -4,6 +4,25 @@ import type { ColumnPinningPosition } from '../column-pinning/columnPinningFeatu
|
|
|
4
4
|
|
|
5
5
|
export type ColumnOrderState = Array<string>
|
|
6
6
|
|
|
7
|
+
export interface ColumnIndexes {
|
|
8
|
+
/**
|
|
9
|
+
* Maps each visible leaf column id to its index in the full visible column list.
|
|
10
|
+
*/
|
|
11
|
+
all: Record<string, number>
|
|
12
|
+
/**
|
|
13
|
+
* Maps each unpinned visible leaf column id to its index within the center region.
|
|
14
|
+
*/
|
|
15
|
+
center: Record<string, number>
|
|
16
|
+
/**
|
|
17
|
+
* Maps each start-pinned visible leaf column id to its index within the start region.
|
|
18
|
+
*/
|
|
19
|
+
start: Record<string, number>
|
|
20
|
+
/**
|
|
21
|
+
* Maps each end-pinned visible leaf column id to its index within the end region.
|
|
22
|
+
*/
|
|
23
|
+
end: Record<string, number>
|
|
24
|
+
}
|
|
25
|
+
|
|
7
26
|
export interface TableState_ColumnOrdering {
|
|
8
27
|
columnOrder: ColumnOrderState
|
|
9
28
|
}
|
|
@@ -21,7 +40,7 @@ export interface Column_ColumnOrdering {
|
|
|
21
40
|
/**
|
|
22
41
|
* Finds this column's zero-based index among visible columns.
|
|
23
42
|
*
|
|
24
|
-
* Pass `'
|
|
43
|
+
* Pass `'start'`, `'center'`, or `'end'` to measure within that pinned
|
|
25
44
|
* region instead of the full visible leaf order.
|
|
26
45
|
*/
|
|
27
46
|
getIndex: (position?: ColumnPinningPosition | 'center') => number
|
|
@@ -44,9 +63,16 @@ export interface ColumnOrderDefaultOptions {
|
|
|
44
63
|
}
|
|
45
64
|
|
|
46
65
|
export interface Table_ColumnOrdering<
|
|
47
|
-
|
|
48
|
-
|
|
66
|
+
in out _TFeatures extends TableFeatures,
|
|
67
|
+
in out _TData extends RowData,
|
|
49
68
|
> {
|
|
69
|
+
/**
|
|
70
|
+
* Builds column-id to index records for each visible pinning region.
|
|
71
|
+
*
|
|
72
|
+
* This is the memoized source that `column.getIndex` reads from; most apps
|
|
73
|
+
* will not need to call it directly.
|
|
74
|
+
*/
|
|
75
|
+
getColumnIndexes: () => ColumnIndexes
|
|
50
76
|
/**
|
|
51
77
|
* Resets `columnOrder` to `initialState.columnOrder`.
|
|
52
78
|
*
|