@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
|
@@ -13,7 +13,7 @@ import type { Row } from '../../types/Row'
|
|
|
13
13
|
import type { CellData, RowData, Updater } from '../../types/type-utils'
|
|
14
14
|
import type { TableFeatures } from '../../types/TableFeatures'
|
|
15
15
|
import type { Table_Internal } from '../../types/Table'
|
|
16
|
-
import type { Column_Internal } from '../../types/Column'
|
|
16
|
+
import type { Column, Column_Internal } from '../../types/Column'
|
|
17
17
|
import type {
|
|
18
18
|
ColumnPinningPosition,
|
|
19
19
|
ColumnPinningState,
|
|
@@ -34,8 +34,8 @@ import type {
|
|
|
34
34
|
*/
|
|
35
35
|
export function getDefaultColumnPinningState(): ColumnPinningState {
|
|
36
36
|
return {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
start: [],
|
|
38
|
+
end: [],
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -45,12 +45,16 @@ export function getDefaultColumnPinningState(): ColumnPinningState {
|
|
|
45
45
|
* Moves this column's leaf column ids into a pinning region.
|
|
46
46
|
*
|
|
47
47
|
* Pinning a group column pins all of its leaves. The leaf ids are first removed
|
|
48
|
-
* from both regions, then appended to the requested `'
|
|
48
|
+
* from both regions, then appended to the requested `'start'` or `'end'`
|
|
49
49
|
* region. Passing `false` unpins them back to the center.
|
|
50
50
|
*
|
|
51
|
+
* `start` and `end` are logical positions. In LTR languages/layouts, `start`
|
|
52
|
+
* usually corresponds to left and `end` to right. In RTL languages/layouts,
|
|
53
|
+
* `start` usually corresponds to right and `end` to left.
|
|
54
|
+
*
|
|
51
55
|
* @example
|
|
52
56
|
* ```ts
|
|
53
|
-
* column_pin(column, '
|
|
57
|
+
* column_pin(column, 'start')
|
|
54
58
|
* ```
|
|
55
59
|
*/
|
|
56
60
|
export function column_pin<
|
|
@@ -70,26 +74,26 @@ export function column_pin<
|
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
table_setColumnPinning(column.table, (old) => {
|
|
73
|
-
if (position === '
|
|
77
|
+
if (position === 'end') {
|
|
74
78
|
return {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
...old.right.filter((d) => !columnIds.includes(d)),
|
|
78
|
-
...columnIds,
|
|
79
|
-
],
|
|
79
|
+
start: old.start.filter((d) => !columnIds.includes(d)),
|
|
80
|
+
end: [...old.end.filter((d) => !columnIds.includes(d)), ...columnIds],
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
if (position === '
|
|
84
|
+
if (position === 'start') {
|
|
84
85
|
return {
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
start: [
|
|
87
|
+
...old.start.filter((d) => !columnIds.includes(d)),
|
|
88
|
+
...columnIds,
|
|
89
|
+
],
|
|
90
|
+
end: old.end.filter((d) => !columnIds.includes(d)),
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
return {
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
start: old.start.filter((d) => !columnIds.includes(d)),
|
|
96
|
+
end: old.end.filter((d) => !columnIds.includes(d)),
|
|
93
97
|
}
|
|
94
98
|
})
|
|
95
99
|
}
|
|
@@ -124,9 +128,13 @@ export function column_getCanPin<
|
|
|
124
128
|
/**
|
|
125
129
|
* Reads this column's current pinning region.
|
|
126
130
|
*
|
|
127
|
-
* Group columns report `'
|
|
131
|
+
* Group columns report `'start'` or `'end'` when any leaf column is pinned in
|
|
128
132
|
* that region. Unpinned columns return `false`.
|
|
129
133
|
*
|
|
134
|
+
* `start` and `end` are logical positions. In LTR languages/layouts, `start`
|
|
135
|
+
* usually corresponds to left and `end` to right. In RTL languages/layouts,
|
|
136
|
+
* `start` usually corresponds to right and `end` to left.
|
|
137
|
+
*
|
|
130
138
|
* @example
|
|
131
139
|
* ```ts
|
|
132
140
|
* const position = column_getIsPinned(column)
|
|
@@ -139,22 +147,29 @@ export function column_getIsPinned<
|
|
|
139
147
|
>(
|
|
140
148
|
column: Column_Internal<TFeatures, TData, TValue>,
|
|
141
149
|
): ColumnPinningPosition | false {
|
|
142
|
-
const
|
|
150
|
+
const leafColumns = column.getLeafColumns()
|
|
143
151
|
|
|
144
|
-
const {
|
|
152
|
+
const { start, end } =
|
|
145
153
|
column.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
146
154
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
for (let i = 0; i < leafColumns.length; i++) {
|
|
156
|
+
if (start.includes(leafColumns[i]!.id)) {
|
|
157
|
+
return 'start'
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
for (let i = 0; i < leafColumns.length; i++) {
|
|
161
|
+
if (end.includes(leafColumns[i]!.id)) {
|
|
162
|
+
return 'end'
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return false
|
|
151
166
|
}
|
|
152
167
|
|
|
153
168
|
/**
|
|
154
169
|
* Finds this column's index within its pinned region.
|
|
155
170
|
*
|
|
156
171
|
* Unpinned columns return `0`; pinned columns return their position in
|
|
157
|
-
* `state.columnPinning.
|
|
172
|
+
* `state.columnPinning.start` or `state.columnPinning.end`.
|
|
158
173
|
*
|
|
159
174
|
* @example
|
|
160
175
|
* ```ts
|
|
@@ -177,7 +192,7 @@ export function column_getPinnedIndex<
|
|
|
177
192
|
// Row APIs
|
|
178
193
|
|
|
179
194
|
/**
|
|
180
|
-
* Collects visible cells whose columns are not pinned
|
|
195
|
+
* Collects visible cells whose columns are not pinned start or end.
|
|
181
196
|
*
|
|
182
197
|
* The result preserves the row's visible-cell order for center columns.
|
|
183
198
|
*
|
|
@@ -195,42 +210,45 @@ export function row_getCenterVisibleCells<
|
|
|
195
210
|
'getVisibleCells',
|
|
196
211
|
row_getVisibleCells,
|
|
197
212
|
)
|
|
198
|
-
const {
|
|
213
|
+
const { start, end } =
|
|
199
214
|
row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
200
|
-
|
|
201
|
-
|
|
215
|
+
if (!start.length && !end.length) {
|
|
216
|
+
return allCells
|
|
217
|
+
}
|
|
218
|
+
const startAndEnd: Array<string> = [...start, ...end]
|
|
219
|
+
return allCells.filter((d) => !startAndEnd.includes(d.column.id))
|
|
202
220
|
}
|
|
203
221
|
|
|
204
222
|
/**
|
|
205
|
-
* Collects visible cells for columns pinned to the
|
|
223
|
+
* Collects visible cells for columns pinned to the start region.
|
|
206
224
|
*
|
|
207
|
-
* Cells are returned in `state.columnPinning.
|
|
208
|
-
* `cell.position = '
|
|
225
|
+
* Cells are returned in `state.columnPinning.start` order and are marked with
|
|
226
|
+
* `cell.position = 'start'`.
|
|
209
227
|
*
|
|
210
228
|
* @example
|
|
211
229
|
* ```ts
|
|
212
|
-
* const
|
|
230
|
+
* const startCells = row_getStartVisibleCells(row)
|
|
213
231
|
* ```
|
|
214
232
|
*/
|
|
215
|
-
export function
|
|
233
|
+
export function row_getStartVisibleCells<
|
|
216
234
|
TFeatures extends TableFeatures,
|
|
217
235
|
TData extends RowData,
|
|
218
236
|
>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {
|
|
219
|
-
const {
|
|
237
|
+
const { start } =
|
|
220
238
|
row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
221
|
-
if (!
|
|
239
|
+
if (!start.length) return []
|
|
222
240
|
const allVisibleCells = callMemoOrStaticFn(
|
|
223
241
|
row,
|
|
224
242
|
'getVisibleCellsByColumnId',
|
|
225
243
|
row_getVisibleCellsByColumnId,
|
|
226
244
|
)
|
|
227
245
|
const cells: Array<Cell<TFeatures, TData, unknown>> = []
|
|
228
|
-
for (let i = 0; i <
|
|
229
|
-
const columnId =
|
|
246
|
+
for (let i = 0; i < start.length; i++) {
|
|
247
|
+
const columnId = start[i]!
|
|
230
248
|
const cell = allVisibleCells[columnId]
|
|
231
249
|
if (cell) {
|
|
232
250
|
// Assign position property directly to preserve prototype chain
|
|
233
|
-
;(cell as any).position = '
|
|
251
|
+
;(cell as any).position = 'start'
|
|
234
252
|
cells.push(cell)
|
|
235
253
|
}
|
|
236
254
|
}
|
|
@@ -238,35 +256,35 @@ export function row_getLeftVisibleCells<
|
|
|
238
256
|
}
|
|
239
257
|
|
|
240
258
|
/**
|
|
241
|
-
* Collects visible cells for columns pinned to the
|
|
259
|
+
* Collects visible cells for columns pinned to the end region.
|
|
242
260
|
*
|
|
243
|
-
* Cells are returned in `state.columnPinning.
|
|
244
|
-
* `cell.position = '
|
|
261
|
+
* Cells are returned in `state.columnPinning.end` order and are marked with
|
|
262
|
+
* `cell.position = 'end'`.
|
|
245
263
|
*
|
|
246
264
|
* @example
|
|
247
265
|
* ```ts
|
|
248
|
-
* const
|
|
266
|
+
* const endCells = row_getEndVisibleCells(row)
|
|
249
267
|
* ```
|
|
250
268
|
*/
|
|
251
|
-
export function
|
|
269
|
+
export function row_getEndVisibleCells<
|
|
252
270
|
TFeatures extends TableFeatures,
|
|
253
271
|
TData extends RowData,
|
|
254
272
|
>(row: Row<TFeatures, TData>) {
|
|
255
|
-
const {
|
|
273
|
+
const { end } =
|
|
256
274
|
row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
257
|
-
if (!
|
|
275
|
+
if (!end.length) return [] as Array<Cell<TFeatures, TData, unknown>>
|
|
258
276
|
const allVisibleCells = callMemoOrStaticFn(
|
|
259
277
|
row,
|
|
260
278
|
'getVisibleCellsByColumnId',
|
|
261
279
|
row_getVisibleCellsByColumnId,
|
|
262
280
|
)
|
|
263
281
|
const cells: Array<Cell<TFeatures, TData, unknown>> = []
|
|
264
|
-
for (let i = 0; i <
|
|
265
|
-
const columnId =
|
|
282
|
+
for (let i = 0; i < end.length; i++) {
|
|
283
|
+
const columnId = end[i]!
|
|
266
284
|
const cell = allVisibleCells[columnId]
|
|
267
285
|
if (cell) {
|
|
268
286
|
// Assign position property directly to preserve prototype chain
|
|
269
|
-
;(cell as any).position = '
|
|
287
|
+
;(cell as any).position = 'end'
|
|
270
288
|
cells.push(cell)
|
|
271
289
|
}
|
|
272
290
|
}
|
|
@@ -278,12 +296,12 @@ export function row_getRightVisibleCells<
|
|
|
278
296
|
/**
|
|
279
297
|
* Routes a column pinning updater through the table's pinning change handler.
|
|
280
298
|
*
|
|
281
|
-
* The updater may be a next `{
|
|
299
|
+
* The updater may be a next `{ start, end }` state or a function of the
|
|
282
300
|
* previous state, matching the instance `table.setColumnPinning` behavior.
|
|
283
301
|
*
|
|
284
302
|
* @example
|
|
285
303
|
* ```ts
|
|
286
|
-
* table_setColumnPinning(table, (old) => ({ ...old,
|
|
304
|
+
* table_setColumnPinning(table, (old) => ({ ...old, start: ['select'] }))
|
|
287
305
|
* ```
|
|
288
306
|
*/
|
|
289
307
|
export function table_setColumnPinning<
|
|
@@ -300,7 +318,7 @@ export function table_setColumnPinning<
|
|
|
300
318
|
* Resets `columnPinning` to the configured initial state or feature default.
|
|
301
319
|
*
|
|
302
320
|
* With no argument, the reset clones `table.initialState.columnPinning` when it
|
|
303
|
-
* exists. Passing `true` ignores initial state and resets to empty
|
|
321
|
+
* exists. Passing `true` ignores initial state and resets to empty start/end
|
|
304
322
|
* arrays.
|
|
305
323
|
*
|
|
306
324
|
* @example
|
|
@@ -326,7 +344,7 @@ export function table_resetColumnPinning<
|
|
|
326
344
|
/**
|
|
327
345
|
* Checks whether any columns are pinned.
|
|
328
346
|
*
|
|
329
|
-
* Omit `position` to check both sides, or pass `'
|
|
347
|
+
* Omit `position` to check both sides, or pass `'start'`/`'end'` to inspect a
|
|
330
348
|
* single pinning region.
|
|
331
349
|
*
|
|
332
350
|
* @example
|
|
@@ -341,7 +359,7 @@ export function table_getIsSomeColumnsPinned<
|
|
|
341
359
|
const pinningState = table.atoms.columnPinning?.get()
|
|
342
360
|
|
|
343
361
|
if (!position) {
|
|
344
|
-
return Boolean(pinningState?.
|
|
362
|
+
return Boolean(pinningState?.start.length || pinningState?.end.length)
|
|
345
363
|
}
|
|
346
364
|
return Boolean(pinningState?.[position].length)
|
|
347
365
|
}
|
|
@@ -349,32 +367,28 @@ export function table_getIsSomeColumnsPinned<
|
|
|
349
367
|
// header groups
|
|
350
368
|
|
|
351
369
|
/**
|
|
352
|
-
* Builds header groups for visible columns pinned to the
|
|
370
|
+
* Builds header groups for visible columns pinned to the start region.
|
|
353
371
|
*
|
|
354
|
-
* The leaf columns are read in `state.columnPinning.
|
|
372
|
+
* The leaf columns are read in `state.columnPinning.start` order and then passed
|
|
355
373
|
* through the same header-group builder as the unpinned table.
|
|
356
374
|
*
|
|
357
375
|
* @example
|
|
358
376
|
* ```ts
|
|
359
|
-
* const headerGroups =
|
|
377
|
+
* const headerGroups = table_getStartHeaderGroups(table)
|
|
360
378
|
* ```
|
|
361
379
|
*/
|
|
362
|
-
export function
|
|
380
|
+
export function table_getStartHeaderGroups<
|
|
363
381
|
TFeatures extends TableFeatures,
|
|
364
382
|
TData extends RowData,
|
|
365
383
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
366
384
|
const allColumns = table.getAllColumns()
|
|
367
|
-
const leafColumnsById = table.getAllLeafColumnsById()
|
|
368
|
-
|
|
369
|
-
Column_Internal<TFeatures, TData, unknown>
|
|
370
|
-
>
|
|
371
|
-
const { left } =
|
|
385
|
+
const leafColumnsById = table.getAllLeafColumnsById()
|
|
386
|
+
const { start } =
|
|
372
387
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
373
388
|
|
|
374
|
-
const orderedLeafColumns: Array<
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
const column = leafColumnsById[left[i]!]
|
|
389
|
+
const orderedLeafColumns: Array<Column<TFeatures, TData, unknown>> = []
|
|
390
|
+
for (let i = 0; i < start.length; i++) {
|
|
391
|
+
const column = leafColumnsById[start[i]!]
|
|
378
392
|
if (
|
|
379
393
|
column &&
|
|
380
394
|
callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)
|
|
@@ -383,36 +397,32 @@ export function table_getLeftHeaderGroups<
|
|
|
383
397
|
}
|
|
384
398
|
}
|
|
385
399
|
|
|
386
|
-
return buildHeaderGroups(allColumns, orderedLeafColumns, table, '
|
|
400
|
+
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'start')
|
|
387
401
|
}
|
|
388
402
|
|
|
389
403
|
/**
|
|
390
|
-
* Builds header groups for visible columns pinned to the
|
|
404
|
+
* Builds header groups for visible columns pinned to the end region.
|
|
391
405
|
*
|
|
392
|
-
* The leaf columns are read in `state.columnPinning.
|
|
406
|
+
* The leaf columns are read in `state.columnPinning.end` order and then
|
|
393
407
|
* passed through the same header-group builder as the unpinned table.
|
|
394
408
|
*
|
|
395
409
|
* @example
|
|
396
410
|
* ```ts
|
|
397
|
-
* const headerGroups =
|
|
411
|
+
* const headerGroups = table_getEndHeaderGroups(table)
|
|
398
412
|
* ```
|
|
399
413
|
*/
|
|
400
|
-
export function
|
|
414
|
+
export function table_getEndHeaderGroups<
|
|
401
415
|
TFeatures extends TableFeatures,
|
|
402
416
|
TData extends RowData,
|
|
403
417
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
404
418
|
const allColumns = table.getAllColumns()
|
|
405
|
-
const leafColumnsById = table.getAllLeafColumnsById()
|
|
406
|
-
|
|
407
|
-
Column_Internal<TFeatures, TData, unknown>
|
|
408
|
-
>
|
|
409
|
-
const { right } =
|
|
419
|
+
const leafColumnsById = table.getAllLeafColumnsById()
|
|
420
|
+
const { end } =
|
|
410
421
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
411
422
|
|
|
412
|
-
const orderedLeafColumns: Array<
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
const column = leafColumnsById[right[i]!]
|
|
423
|
+
const orderedLeafColumns: Array<Column<TFeatures, TData, unknown>> = []
|
|
424
|
+
for (let i = 0; i < end.length; i++) {
|
|
425
|
+
const column = leafColumnsById[end[i]!]
|
|
416
426
|
if (
|
|
417
427
|
column &&
|
|
418
428
|
callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)
|
|
@@ -421,13 +431,13 @@ export function table_getRightHeaderGroups<
|
|
|
421
431
|
}
|
|
422
432
|
}
|
|
423
433
|
|
|
424
|
-
return buildHeaderGroups(allColumns, orderedLeafColumns, table, '
|
|
434
|
+
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'end')
|
|
425
435
|
}
|
|
426
436
|
|
|
427
437
|
/**
|
|
428
438
|
* Builds header groups for visible columns that are not pinned.
|
|
429
439
|
*
|
|
430
|
-
*
|
|
440
|
+
* Start- and end-pinned column ids are removed from the visible leaf column
|
|
431
441
|
* list before header groups are built for the center region.
|
|
432
442
|
*
|
|
433
443
|
* @example
|
|
@@ -446,59 +456,60 @@ export function table_getCenterHeaderGroups<
|
|
|
446
456
|
table,
|
|
447
457
|
'getVisibleLeafColumns',
|
|
448
458
|
table_getVisibleLeafColumns,
|
|
449
|
-
) as unknown as Array<Column_Internal<TFeatures, TData, unknown>>
|
|
450
|
-
const { left, right } =
|
|
451
|
-
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
452
|
-
const leftAndRight: Array<string> = [...left, ...right]
|
|
453
|
-
|
|
454
|
-
leafColumns = leafColumns.filter(
|
|
455
|
-
(column) => !leftAndRight.includes(column.id),
|
|
456
459
|
)
|
|
460
|
+
const { start, end } =
|
|
461
|
+
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
462
|
+
if (start.length || end.length) {
|
|
463
|
+
const startAndEnd: Array<string> = [...start, ...end]
|
|
464
|
+
leafColumns = leafColumns.filter(
|
|
465
|
+
(column) => !startAndEnd.includes(column.id),
|
|
466
|
+
)
|
|
467
|
+
}
|
|
457
468
|
return buildHeaderGroups(allColumns, leafColumns, table, 'center')
|
|
458
469
|
}
|
|
459
470
|
|
|
460
471
|
// footer groups
|
|
461
472
|
|
|
462
473
|
/**
|
|
463
|
-
* Builds footer groups for the
|
|
474
|
+
* Builds footer groups for the start pinned region.
|
|
464
475
|
*
|
|
465
|
-
* Footer groups reuse the
|
|
476
|
+
* Footer groups reuse the start header groups in reverse order.
|
|
466
477
|
*
|
|
467
478
|
* @example
|
|
468
479
|
* ```ts
|
|
469
|
-
* const footerGroups =
|
|
480
|
+
* const footerGroups = table_getStartFooterGroups(table)
|
|
470
481
|
* ```
|
|
471
482
|
*/
|
|
472
|
-
export function
|
|
483
|
+
export function table_getStartFooterGroups<
|
|
473
484
|
TFeatures extends TableFeatures,
|
|
474
485
|
TData extends RowData,
|
|
475
486
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
476
487
|
const headerGroups = callMemoOrStaticFn(
|
|
477
488
|
table,
|
|
478
|
-
'
|
|
479
|
-
|
|
489
|
+
'getStartHeaderGroups',
|
|
490
|
+
table_getStartHeaderGroups,
|
|
480
491
|
)
|
|
481
492
|
return [...headerGroups].reverse()
|
|
482
493
|
}
|
|
483
494
|
|
|
484
495
|
/**
|
|
485
|
-
* Builds footer groups for the
|
|
496
|
+
* Builds footer groups for the end pinned region.
|
|
486
497
|
*
|
|
487
|
-
* Footer groups reuse the
|
|
498
|
+
* Footer groups reuse the end header groups in reverse order.
|
|
488
499
|
*
|
|
489
500
|
* @example
|
|
490
501
|
* ```ts
|
|
491
|
-
* const footerGroups =
|
|
502
|
+
* const footerGroups = table_getEndFooterGroups(table)
|
|
492
503
|
* ```
|
|
493
504
|
*/
|
|
494
|
-
export function
|
|
505
|
+
export function table_getEndFooterGroups<
|
|
495
506
|
TFeatures extends TableFeatures,
|
|
496
507
|
TData extends RowData,
|
|
497
508
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
498
509
|
const headerGroups = callMemoOrStaticFn(
|
|
499
510
|
table,
|
|
500
|
-
'
|
|
501
|
-
|
|
511
|
+
'getEndHeaderGroups',
|
|
512
|
+
table_getEndHeaderGroups,
|
|
502
513
|
)
|
|
503
514
|
return [...headerGroups].reverse()
|
|
504
515
|
}
|
|
@@ -528,23 +539,23 @@ export function table_getCenterFooterGroups<
|
|
|
528
539
|
// flat headers
|
|
529
540
|
|
|
530
541
|
/**
|
|
531
|
-
* Flattens every header from the
|
|
542
|
+
* Flattens every header from the start pinned header groups.
|
|
532
543
|
*
|
|
533
544
|
* Parent headers and placeholder headers are included.
|
|
534
545
|
*
|
|
535
546
|
* @example
|
|
536
547
|
* ```ts
|
|
537
|
-
* const headers =
|
|
548
|
+
* const headers = table_getStartFlatHeaders(table)
|
|
538
549
|
* ```
|
|
539
550
|
*/
|
|
540
|
-
export function
|
|
551
|
+
export function table_getStartFlatHeaders<
|
|
541
552
|
TFeatures extends TableFeatures,
|
|
542
553
|
TData extends RowData,
|
|
543
554
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
544
555
|
const leftHeaderGroups = callMemoOrStaticFn(
|
|
545
556
|
table,
|
|
546
|
-
'
|
|
547
|
-
|
|
557
|
+
'getStartHeaderGroups',
|
|
558
|
+
table_getStartHeaderGroups,
|
|
548
559
|
)
|
|
549
560
|
const result: Array<Header<TFeatures, TData, unknown>> = []
|
|
550
561
|
for (let i = 0; i < leftHeaderGroups.length; i++) {
|
|
@@ -557,23 +568,23 @@ export function table_getLeftFlatHeaders<
|
|
|
557
568
|
}
|
|
558
569
|
|
|
559
570
|
/**
|
|
560
|
-
* Flattens every header from the
|
|
571
|
+
* Flattens every header from the end pinned header groups.
|
|
561
572
|
*
|
|
562
573
|
* Parent headers and placeholder headers are included.
|
|
563
574
|
*
|
|
564
575
|
* @example
|
|
565
576
|
* ```ts
|
|
566
|
-
* const headers =
|
|
577
|
+
* const headers = table_getEndFlatHeaders(table)
|
|
567
578
|
* ```
|
|
568
579
|
*/
|
|
569
|
-
export function
|
|
580
|
+
export function table_getEndFlatHeaders<
|
|
570
581
|
TFeatures extends TableFeatures,
|
|
571
582
|
TData extends RowData,
|
|
572
583
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
573
584
|
const rightHeaderGroups = callMemoOrStaticFn(
|
|
574
585
|
table,
|
|
575
|
-
'
|
|
576
|
-
|
|
586
|
+
'getEndHeaderGroups',
|
|
587
|
+
table_getEndHeaderGroups,
|
|
577
588
|
)
|
|
578
589
|
const result: Array<Header<TFeatures, TData, unknown>> = []
|
|
579
590
|
for (let i = 0; i < rightHeaderGroups.length; i++) {
|
|
@@ -617,44 +628,44 @@ export function table_getCenterFlatHeaders<
|
|
|
617
628
|
// leaf headers
|
|
618
629
|
|
|
619
630
|
/**
|
|
620
|
-
* Collects leaf headers for the
|
|
631
|
+
* Collects leaf headers for the start pinned region.
|
|
621
632
|
*
|
|
622
|
-
* Parent headers are filtered out from the
|
|
633
|
+
* Parent headers are filtered out from the start flat header list.
|
|
623
634
|
*
|
|
624
635
|
* @example
|
|
625
636
|
* ```ts
|
|
626
|
-
* const headers =
|
|
637
|
+
* const headers = table_getStartLeafHeaders(table)
|
|
627
638
|
* ```
|
|
628
639
|
*/
|
|
629
|
-
export function
|
|
640
|
+
export function table_getStartLeafHeaders<
|
|
630
641
|
TFeatures extends TableFeatures,
|
|
631
642
|
TData extends RowData,
|
|
632
643
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
633
644
|
return callMemoOrStaticFn(
|
|
634
645
|
table,
|
|
635
|
-
'
|
|
636
|
-
|
|
646
|
+
'getStartFlatHeaders',
|
|
647
|
+
table_getStartFlatHeaders,
|
|
637
648
|
).filter((header) => !header.subHeaders.length)
|
|
638
649
|
}
|
|
639
650
|
|
|
640
651
|
/**
|
|
641
|
-
* Collects leaf headers for the
|
|
652
|
+
* Collects leaf headers for the end pinned region.
|
|
642
653
|
*
|
|
643
|
-
* Parent headers are filtered out from the
|
|
654
|
+
* Parent headers are filtered out from the end flat header list.
|
|
644
655
|
*
|
|
645
656
|
* @example
|
|
646
657
|
* ```ts
|
|
647
|
-
* const headers =
|
|
658
|
+
* const headers = table_getEndLeafHeaders(table)
|
|
648
659
|
* ```
|
|
649
660
|
*/
|
|
650
|
-
export function
|
|
661
|
+
export function table_getEndLeafHeaders<
|
|
651
662
|
TFeatures extends TableFeatures,
|
|
652
663
|
TData extends RowData,
|
|
653
664
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
654
665
|
return callMemoOrStaticFn(
|
|
655
666
|
table,
|
|
656
|
-
'
|
|
657
|
-
|
|
667
|
+
'getEndFlatHeaders',
|
|
668
|
+
table_getEndFlatHeaders,
|
|
658
669
|
).filter((header) => !header.subHeaders.length)
|
|
659
670
|
}
|
|
660
671
|
|
|
@@ -682,61 +693,61 @@ export function table_getCenterLeafHeaders<
|
|
|
682
693
|
// leaf columns
|
|
683
694
|
|
|
684
695
|
/**
|
|
685
|
-
* Resolves leaf columns pinned to the
|
|
696
|
+
* Resolves leaf columns pinned to the start region.
|
|
686
697
|
*
|
|
687
|
-
* The result follows `state.columnPinning.
|
|
698
|
+
* The result follows `state.columnPinning.start` order and skips stale ids that
|
|
688
699
|
* no longer correspond to a leaf column.
|
|
689
700
|
*
|
|
690
701
|
* @example
|
|
691
702
|
* ```ts
|
|
692
|
-
* const columns =
|
|
703
|
+
* const columns = table_getStartLeafColumns(table)
|
|
693
704
|
* ```
|
|
694
705
|
*/
|
|
695
|
-
export function
|
|
706
|
+
export function table_getStartLeafColumns<
|
|
696
707
|
TFeatures extends TableFeatures,
|
|
697
708
|
TData extends RowData,
|
|
698
709
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
699
|
-
const {
|
|
710
|
+
const { start } =
|
|
700
711
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
701
712
|
const leafColumnsById = table.getAllLeafColumnsById()
|
|
702
713
|
const result: Array<Column_Internal<TFeatures, TData, unknown>> = []
|
|
703
|
-
for (let i = 0; i <
|
|
704
|
-
const column = leafColumnsById[
|
|
714
|
+
for (let i = 0; i < start.length; i++) {
|
|
715
|
+
const column = leafColumnsById[start[i]!]
|
|
705
716
|
if (column) result.push(column)
|
|
706
717
|
}
|
|
707
718
|
return result
|
|
708
719
|
}
|
|
709
720
|
|
|
710
721
|
/**
|
|
711
|
-
* Resolves leaf columns pinned to the
|
|
722
|
+
* Resolves leaf columns pinned to the end region.
|
|
712
723
|
*
|
|
713
|
-
* The result follows `state.columnPinning.
|
|
724
|
+
* The result follows `state.columnPinning.end` order and skips stale ids that
|
|
714
725
|
* no longer correspond to a leaf column.
|
|
715
726
|
*
|
|
716
727
|
* @example
|
|
717
728
|
* ```ts
|
|
718
|
-
* const columns =
|
|
729
|
+
* const columns = table_getEndLeafColumns(table)
|
|
719
730
|
* ```
|
|
720
731
|
*/
|
|
721
|
-
export function
|
|
732
|
+
export function table_getEndLeafColumns<
|
|
722
733
|
TFeatures extends TableFeatures,
|
|
723
734
|
TData extends RowData,
|
|
724
735
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
725
|
-
const {
|
|
736
|
+
const { end } =
|
|
726
737
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
727
738
|
const leafColumnsById = table.getAllLeafColumnsById()
|
|
728
739
|
const result: Array<Column_Internal<TFeatures, TData, unknown>> = []
|
|
729
|
-
for (let i = 0; i <
|
|
730
|
-
const column = leafColumnsById[
|
|
740
|
+
for (let i = 0; i < end.length; i++) {
|
|
741
|
+
const column = leafColumnsById[end[i]!]
|
|
731
742
|
if (column) result.push(column)
|
|
732
743
|
}
|
|
733
744
|
return result
|
|
734
745
|
}
|
|
735
746
|
|
|
736
747
|
/**
|
|
737
|
-
* Resolves leaf columns that are not pinned to either side.
|
|
748
|
+
* Resolves leaf columns that are not pinned to either logical side.
|
|
738
749
|
*
|
|
739
|
-
*
|
|
750
|
+
* Start- and end-pinned ids are removed from `table.getAllLeafColumns()`.
|
|
740
751
|
*
|
|
741
752
|
* @example
|
|
742
753
|
* ```ts
|
|
@@ -747,16 +758,19 @@ export function table_getCenterLeafColumns<
|
|
|
747
758
|
TFeatures extends TableFeatures,
|
|
748
759
|
TData extends RowData,
|
|
749
760
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
750
|
-
const {
|
|
761
|
+
const { start, end } =
|
|
751
762
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
752
|
-
|
|
753
|
-
|
|
763
|
+
if (!start.length && !end.length) {
|
|
764
|
+
return table.getAllLeafColumns()
|
|
765
|
+
}
|
|
766
|
+
const startAndEnd: Array<string> = [...start, ...end]
|
|
767
|
+
return table.getAllLeafColumns().filter((d) => !startAndEnd.includes(d.id))
|
|
754
768
|
}
|
|
755
769
|
|
|
756
770
|
/**
|
|
757
771
|
* Resolves leaf columns for a requested pinning region.
|
|
758
772
|
*
|
|
759
|
-
* Pass `'
|
|
773
|
+
* Pass `'start'`, `'center'`, or `'end'` for a partition, or pass `false` to
|
|
760
774
|
* read all leaf columns without partitioning.
|
|
761
775
|
*
|
|
762
776
|
* @example
|
|
@@ -773,17 +787,17 @@ export function table_getPinnedLeafColumns<
|
|
|
773
787
|
) {
|
|
774
788
|
return !position
|
|
775
789
|
? table.getAllLeafColumns()
|
|
776
|
-
: position === '
|
|
790
|
+
: position === 'start'
|
|
777
791
|
? callMemoOrStaticFn(
|
|
778
792
|
table,
|
|
779
|
-
'
|
|
780
|
-
|
|
793
|
+
'getStartLeafColumns',
|
|
794
|
+
table_getStartLeafColumns,
|
|
781
795
|
)
|
|
782
|
-
: position === '
|
|
796
|
+
: position === 'end'
|
|
783
797
|
? callMemoOrStaticFn(
|
|
784
798
|
table,
|
|
785
|
-
'
|
|
786
|
-
|
|
799
|
+
'getEndLeafColumns',
|
|
800
|
+
table_getEndLeafColumns,
|
|
787
801
|
)
|
|
788
802
|
: callMemoOrStaticFn(
|
|
789
803
|
table,
|
|
@@ -795,46 +809,46 @@ export function table_getPinnedLeafColumns<
|
|
|
795
809
|
// visible leaf columns
|
|
796
810
|
|
|
797
811
|
/**
|
|
798
|
-
* Resolves visible leaf columns pinned to the
|
|
812
|
+
* Resolves visible leaf columns pinned to the start region.
|
|
799
813
|
*
|
|
800
|
-
* Hidden pinned columns are filtered out after the
|
|
814
|
+
* Hidden pinned columns are filtered out after the start pin order is applied.
|
|
801
815
|
*
|
|
802
816
|
* @example
|
|
803
817
|
* ```ts
|
|
804
|
-
* const columns =
|
|
818
|
+
* const columns = table_getStartVisibleLeafColumns(table)
|
|
805
819
|
* ```
|
|
806
820
|
*/
|
|
807
|
-
export function
|
|
821
|
+
export function table_getStartVisibleLeafColumns<
|
|
808
822
|
TFeatures extends TableFeatures,
|
|
809
823
|
TData extends RowData,
|
|
810
824
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
811
825
|
return callMemoOrStaticFn(
|
|
812
826
|
table,
|
|
813
|
-
'
|
|
814
|
-
|
|
827
|
+
'getStartLeafColumns',
|
|
828
|
+
table_getStartLeafColumns,
|
|
815
829
|
).filter((column) =>
|
|
816
830
|
callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),
|
|
817
831
|
)
|
|
818
832
|
}
|
|
819
833
|
|
|
820
834
|
/**
|
|
821
|
-
* Resolves visible leaf columns pinned to the
|
|
835
|
+
* Resolves visible leaf columns pinned to the end region.
|
|
822
836
|
*
|
|
823
|
-
* Hidden pinned columns are filtered out after the
|
|
837
|
+
* Hidden pinned columns are filtered out after the end pin order is applied.
|
|
824
838
|
*
|
|
825
839
|
* @example
|
|
826
840
|
* ```ts
|
|
827
|
-
* const columns =
|
|
841
|
+
* const columns = table_getEndVisibleLeafColumns(table)
|
|
828
842
|
* ```
|
|
829
843
|
*/
|
|
830
|
-
export function
|
|
844
|
+
export function table_getEndVisibleLeafColumns<
|
|
831
845
|
TFeatures extends TableFeatures,
|
|
832
846
|
TData extends RowData,
|
|
833
847
|
>(table: Table_Internal<TFeatures, TData>) {
|
|
834
848
|
return callMemoOrStaticFn(
|
|
835
849
|
table,
|
|
836
|
-
'
|
|
837
|
-
|
|
850
|
+
'getEndLeafColumns',
|
|
851
|
+
table_getEndLeafColumns,
|
|
838
852
|
).filter((column) =>
|
|
839
853
|
callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),
|
|
840
854
|
)
|
|
@@ -867,12 +881,12 @@ export function table_getCenterVisibleLeafColumns<
|
|
|
867
881
|
/**
|
|
868
882
|
* Resolves visible leaf columns for a requested pinning region.
|
|
869
883
|
*
|
|
870
|
-
* Omit `position` to get all visible leaf columns, or pass `'
|
|
871
|
-
* or `'
|
|
884
|
+
* Omit `position` to get all visible leaf columns, or pass `'start'`, `'center'`,
|
|
885
|
+
* or `'end'` to get one partition.
|
|
872
886
|
*
|
|
873
887
|
* @example
|
|
874
888
|
* ```ts
|
|
875
|
-
* const columns = table_getPinnedVisibleLeafColumns(table, '
|
|
889
|
+
* const columns = table_getPinnedVisibleLeafColumns(table, 'start')
|
|
876
890
|
* ```
|
|
877
891
|
*/
|
|
878
892
|
export function table_getPinnedVisibleLeafColumns<
|
|
@@ -888,17 +902,17 @@ export function table_getPinnedVisibleLeafColumns<
|
|
|
888
902
|
'getVisibleLeafColumns',
|
|
889
903
|
table_getVisibleLeafColumns,
|
|
890
904
|
)
|
|
891
|
-
: position === '
|
|
905
|
+
: position === 'start'
|
|
892
906
|
? callMemoOrStaticFn(
|
|
893
907
|
table,
|
|
894
|
-
'
|
|
895
|
-
|
|
908
|
+
'getStartVisibleLeafColumns',
|
|
909
|
+
table_getStartVisibleLeafColumns,
|
|
896
910
|
)
|
|
897
|
-
: position === '
|
|
911
|
+
: position === 'end'
|
|
898
912
|
? callMemoOrStaticFn(
|
|
899
913
|
table,
|
|
900
|
-
'
|
|
901
|
-
|
|
914
|
+
'getEndVisibleLeafColumns',
|
|
915
|
+
table_getEndVisibleLeafColumns,
|
|
902
916
|
)
|
|
903
917
|
: callMemoOrStaticFn(
|
|
904
918
|
table,
|