@tanstack/table-core 9.0.0-alpha.46 → 9.0.0-alpha.48
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 +10 -0
- package/dist/core/cells/constructCell.cjs +4 -3
- package/dist/core/cells/constructCell.cjs.map +1 -1
- package/dist/core/cells/constructCell.js +4 -3
- package/dist/core/cells/constructCell.js.map +1 -1
- package/dist/core/cells/coreCellsFeature.utils.cjs +11 -8
- package/dist/core/cells/coreCellsFeature.utils.cjs.map +1 -1
- package/dist/core/cells/coreCellsFeature.utils.d.cts +11 -8
- package/dist/core/cells/coreCellsFeature.utils.d.ts +11 -8
- package/dist/core/cells/coreCellsFeature.utils.js +11 -8
- package/dist/core/cells/coreCellsFeature.utils.js.map +1 -1
- package/dist/core/columns/constructColumn.cjs +6 -4
- package/dist/core/columns/constructColumn.cjs.map +1 -1
- package/dist/core/columns/constructColumn.js +6 -4
- package/dist/core/columns/constructColumn.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.types.d.cts +7 -6
- package/dist/core/columns/coreColumnsFeature.types.d.ts +7 -6
- package/dist/core/columns/coreColumnsFeature.utils.cjs +47 -29
- package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.js +47 -29
- package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
- package/dist/core/headers/buildHeaderGroups.cjs +27 -19
- package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
- package/dist/core/headers/buildHeaderGroups.js +27 -19
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/constructHeader.cjs +4 -3
- package/dist/core/headers/constructHeader.cjs.map +1 -1
- package/dist/core/headers/constructHeader.js +4 -3
- package/dist/core/headers/constructHeader.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.cjs +1 -6
- package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.js +2 -7
- package/dist/core/headers/coreHeadersFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.types.d.cts +6 -4
- package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -4
- package/dist/core/headers/coreHeadersFeature.utils.cjs +43 -36
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +24 -19
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +24 -19
- package/dist/core/headers/coreHeadersFeature.utils.js +44 -37
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/reactivity/coreReactivityFeature.types.d.cts +4 -0
- package/dist/core/reactivity/coreReactivityFeature.types.d.ts +4 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.js +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
- package/dist/core/rows/constructRow.cjs +8 -6
- package/dist/core/rows/constructRow.cjs.map +1 -1
- package/dist/core/rows/constructRow.js +8 -6
- package/dist/core/rows/constructRow.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.types.d.cts +4 -4
- package/dist/core/rows/coreRowsFeature.types.d.ts +4 -4
- package/dist/core/rows/coreRowsFeature.utils.cjs +43 -32
- package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.utils.d.cts +34 -28
- package/dist/core/rows/coreRowsFeature.utils.d.ts +34 -28
- package/dist/core/rows/coreRowsFeature.utils.js +43 -32
- package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
- package/dist/core/table/constructTable.cjs +9 -5
- package/dist/core/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.js +9 -5
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +6 -2
- package/dist/core/table/coreTablesFeature.types.d.ts +6 -2
- package/dist/core/table/coreTablesFeature.utils.cjs +7 -3
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +2 -2
- package/dist/core/table/coreTablesFeature.utils.d.ts +2 -2
- package/dist/core/table/coreTablesFeature.utils.js +7 -3
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +16 -10
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +16 -10
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.js +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs +8 -5
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +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 +8 -3
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.js +8 -3
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs +7 -4
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.js +7 -4
- package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +21 -11
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +21 -11
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.cjs +11 -5
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.js +11 -5
- package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +18 -14
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +18 -14
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +14 -5
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +14 -5
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +46 -29
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +46 -29
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +43 -31
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +43 -31
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +152 -115
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +116 -95
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +116 -95
- package/dist/features/column-pinning/columnPinningFeature.utils.js +153 -116
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +9 -9
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +9 -9
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.js +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +28 -4
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.js +28 -4
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +19 -12
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +19 -12
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.js +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +23 -14
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.js +24 -15
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +19 -12
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +19 -12
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +91 -52
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +63 -40
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +63 -40
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +91 -53
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +10 -5
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +10 -5
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.js +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +16 -15
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +16 -15
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +58 -43
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +58 -43
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +19 -12
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +19 -12
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.js +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.types.d.cts +12 -8
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +12 -8
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +52 -36
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.js +52 -36
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +30 -24
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +30 -24
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +95 -72
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.js +95 -72
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs +13 -8
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.js +13 -8
- package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +10 -8
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +10 -8
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +63 -46
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.js +63 -46
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
- package/dist/fns/aggregationFns.cjs +47 -16
- package/dist/fns/aggregationFns.cjs.map +1 -1
- package/dist/fns/aggregationFns.d.cts +33 -9
- package/dist/fns/aggregationFns.d.ts +33 -9
- package/dist/fns/aggregationFns.js +47 -17
- package/dist/fns/aggregationFns.js.map +1 -1
- package/dist/fns/filterFns.cjs +48 -17
- package/dist/fns/filterFns.cjs.map +1 -1
- package/dist/fns/filterFns.d.cts +42 -15
- package/dist/fns/filterFns.d.ts +42 -15
- package/dist/fns/filterFns.js +48 -17
- package/dist/fns/filterFns.js.map +1 -1
- package/dist/helpers/columnHelper.cjs +9 -4
- package/dist/helpers/columnHelper.cjs.map +1 -1
- package/dist/helpers/columnHelper.d.cts +9 -4
- package/dist/helpers/columnHelper.d.ts +9 -4
- package/dist/helpers/columnHelper.js +9 -4
- package/dist/helpers/columnHelper.js.map +1 -1
- package/dist/helpers/tableOptions.cjs.map +1 -1
- package/dist/helpers/tableOptions.d.cts +12 -9
- package/dist/helpers/tableOptions.d.ts +12 -9
- package/dist/helpers/tableOptions.js.map +1 -1
- package/dist/index.cjs +0 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/static-functions.cjs +1 -0
- package/dist/static-functions.d.cts +2 -2
- package/dist/static-functions.d.ts +2 -2
- package/dist/static-functions.js +2 -2
- package/dist/store-reactivity-bindings.cjs +1 -0
- package/dist/store-reactivity-bindings.cjs.map +1 -1
- package/dist/store-reactivity-bindings.js +1 -0
- package/dist/store-reactivity-bindings.js.map +1 -1
- package/dist/types/ColumnDef.d.cts +38 -0
- package/dist/types/ColumnDef.d.ts +38 -0
- package/dist/types/TableOptions.d.cts +15 -0
- package/dist/types/TableOptions.d.ts +15 -0
- package/dist/types/TableState.d.cts +12 -0
- package/dist/types/TableState.d.ts +12 -0
- package/dist/utils.cjs +18 -39
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -23
- package/dist/utils.d.ts +1 -23
- package/dist/utils.js +19 -36
- package/dist/utils.js.map +1 -1
- package/package.json +5 -3
- package/skills/column-definitions/SKILL.md +333 -0
- package/skills/column-layout/SKILL.md +328 -0
- package/skills/column-layout/references/subsystems.md +220 -0
- package/skills/customizing-feature-behavior/SKILL.md +416 -0
- package/skills/filtering/SKILL.md +357 -0
- package/skills/filtering/references/faceting-and-fuzzy.md +191 -0
- package/skills/grouping/SKILL.md +448 -0
- package/skills/migrate-v8-to-v9/SKILL.md +495 -0
- package/skills/pagination/SKILL.md +385 -0
- package/skills/row-expanding/SKILL.md +348 -0
- package/skills/row-pinning/SKILL.md +269 -0
- package/skills/row-selection/SKILL.md +391 -0
- package/skills/setup/SKILL.md +400 -0
- package/skills/sorting/SKILL.md +344 -0
- package/skills/state-management/SKILL.md +388 -0
- package/src/core/cells/constructCell.ts +3 -2
- package/src/core/cells/coreCellsFeature.utils.ts +11 -8
- package/src/core/columns/constructColumn.ts +5 -3
- package/src/core/columns/coreColumnsFeature.types.ts +7 -6
- package/src/core/columns/coreColumnsFeature.utils.ts +43 -29
- package/src/core/headers/buildHeaderGroups.ts +29 -30
- package/src/core/headers/constructHeader.ts +3 -2
- package/src/core/headers/coreHeadersFeature.ts +2 -27
- package/src/core/headers/coreHeadersFeature.types.ts +6 -4
- package/src/core/headers/coreHeadersFeature.utils.ts +52 -61
- package/src/core/reactivity/coreReactivityFeature.types.ts +4 -0
- package/src/core/row-models/coreRowModelsFeature.utils.ts +48 -36
- package/src/core/rows/constructRow.ts +6 -4
- package/src/core/rows/coreRowsFeature.types.ts +4 -4
- package/src/core/rows/coreRowsFeature.utils.ts +45 -32
- package/src/core/table/constructTable.ts +6 -4
- package/src/core/table/coreTablesFeature.types.ts +6 -2
- package/src/core/table/coreTablesFeature.utils.ts +5 -3
- package/src/features/column-faceting/columnFacetingFeature.types.ts +16 -10
- package/src/features/column-faceting/columnFacetingFeature.utils.ts +26 -18
- package/src/features/column-faceting/createFacetedMinMaxValues.ts +8 -10
- package/src/features/column-faceting/createFacetedRowModel.ts +10 -6
- package/src/features/column-faceting/createFacetedUniqueValues.ts +4 -3
- package/src/features/column-filtering/columnFilteringFeature.types.ts +21 -11
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +39 -28
- package/src/features/column-filtering/createFilteredRowModel.ts +14 -8
- package/src/features/column-grouping/columnGroupingFeature.types.ts +18 -14
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +55 -43
- package/src/features/column-ordering/columnOrderingFeature.types.ts +14 -5
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +44 -29
- package/src/features/column-pinning/columnPinningFeature.types.ts +43 -31
- package/src/features/column-pinning/columnPinningFeature.utils.ts +164 -128
- package/src/features/column-resizing/columnResizingFeature.types.ts +9 -9
- package/src/features/column-resizing/columnResizingFeature.utils.ts +28 -19
- package/src/features/column-sizing/columnSizingFeature.ts +16 -0
- package/src/features/column-sizing/columnSizingFeature.types.ts +19 -12
- package/src/features/column-sizing/columnSizingFeature.utils.ts +52 -41
- package/src/features/column-visibility/columnVisibilityFeature.ts +8 -0
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +22 -12
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +101 -56
- package/src/features/global-filtering/globalFilteringFeature.types.ts +10 -5
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +20 -14
- package/src/features/row-expanding/rowExpandingFeature.types.ts +16 -15
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +58 -43
- package/src/features/row-pagination/rowPaginationFeature.types.ts +19 -12
- package/src/features/row-pagination/rowPaginationFeature.utils.ts +49 -32
- package/src/features/row-pinning/rowPinningFeature.types.ts +12 -8
- package/src/features/row-pinning/rowPinningFeature.utils.ts +59 -47
- package/src/features/row-selection/rowSelectionFeature.types.ts +30 -24
- package/src/features/row-selection/rowSelectionFeature.utils.ts +109 -88
- package/src/features/row-sorting/createSortedRowModel.ts +16 -13
- package/src/features/row-sorting/rowSortingFeature.types.ts +10 -8
- package/src/features/row-sorting/rowSortingFeature.utils.ts +63 -46
- package/src/fns/aggregationFns.ts +53 -17
- package/src/fns/filterFns.ts +48 -17
- package/src/helpers/columnHelper.ts +9 -4
- package/src/helpers/tableOptions.ts +12 -9
- package/src/store-reactivity-bindings.ts +1 -0
- package/src/types/ColumnDef.ts +38 -0
- package/src/types/TableOptions.ts +15 -0
- package/src/types/TableState.ts +12 -0
- package/src/utils.ts +19 -46
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
column_getIsVisible,
|
|
3
3
|
row_getVisibleCells,
|
|
4
|
+
row_getVisibleCellsByColumnId,
|
|
4
5
|
table_getVisibleLeafColumns,
|
|
5
6
|
} from '../column-visibility/columnVisibilityFeature.utils'
|
|
6
7
|
import { buildHeaderGroups } from '../../core/headers/buildHeaderGroups'
|
|
7
8
|
import { callMemoOrStaticFn, cloneState } from '../../utils'
|
|
9
|
+
import type { Header } from '../../types/Header'
|
|
8
10
|
import type { HeaderGroup } from '../../types/HeaderGroup'
|
|
9
11
|
import type { Cell } from '../../types/Cell'
|
|
10
12
|
import type { Row } from '../../types/Row'
|
|
@@ -20,13 +22,14 @@ import type {
|
|
|
20
22
|
// State
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
25
|
+
* Creates the default column pinning state.
|
|
24
26
|
*
|
|
25
|
-
*
|
|
27
|
+
* Both pinning regions start empty. Reset APIs use this value when
|
|
28
|
+
* `defaultState` is `true`.
|
|
26
29
|
*
|
|
27
30
|
* @example
|
|
28
31
|
* ```ts
|
|
29
|
-
* const
|
|
32
|
+
* const pinning = getDefaultColumnPinningState()
|
|
30
33
|
* ```
|
|
31
34
|
*/
|
|
32
35
|
export function getDefaultColumnPinningState(): ColumnPinningState {
|
|
@@ -39,9 +42,11 @@ export function getDefaultColumnPinningState(): ColumnPinningState {
|
|
|
39
42
|
// Column APIs
|
|
40
43
|
|
|
41
44
|
/**
|
|
42
|
-
*
|
|
45
|
+
* Moves this column's leaf column ids into a pinning region.
|
|
43
46
|
*
|
|
44
|
-
*
|
|
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 `'left'` or `'right'`
|
|
49
|
+
* region. Passing `false` unpins them back to the center.
|
|
45
50
|
*
|
|
46
51
|
* @example
|
|
47
52
|
* ```ts
|
|
@@ -56,10 +61,13 @@ export function column_pin<
|
|
|
56
61
|
column: Column_Internal<TFeatures, TData, TValue>,
|
|
57
62
|
position: ColumnPinningPosition,
|
|
58
63
|
) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
// Single pass: collect non-empty leaf-column ids.
|
|
65
|
+
const leafColumns = column.getLeafColumns()
|
|
66
|
+
const columnIds: Array<string> = []
|
|
67
|
+
for (let i = 0; i < leafColumns.length; i++) {
|
|
68
|
+
const id = leafColumns[i]!.id
|
|
69
|
+
if (id) columnIds.push(id)
|
|
70
|
+
}
|
|
63
71
|
|
|
64
72
|
table_setColumnPinning(column.table, (old) => {
|
|
65
73
|
if (position === 'right') {
|
|
@@ -87,13 +95,14 @@ export function column_pin<
|
|
|
87
95
|
}
|
|
88
96
|
|
|
89
97
|
/**
|
|
90
|
-
*
|
|
98
|
+
* Checks whether this column or any of its leaf columns can be pinned.
|
|
91
99
|
*
|
|
92
|
-
*
|
|
100
|
+
* Column-level `enablePinning` and table `enableColumnPinning` both default to
|
|
101
|
+
* `true`; at least one leaf column must allow pinning.
|
|
93
102
|
*
|
|
94
103
|
* @example
|
|
95
104
|
* ```ts
|
|
96
|
-
* const
|
|
105
|
+
* const canPin = column_getCanPin(column)
|
|
97
106
|
* ```
|
|
98
107
|
*/
|
|
99
108
|
export function column_getCanPin<
|
|
@@ -113,13 +122,14 @@ export function column_getCanPin<
|
|
|
113
122
|
}
|
|
114
123
|
|
|
115
124
|
/**
|
|
116
|
-
*
|
|
125
|
+
* Reads this column's current pinning region.
|
|
117
126
|
*
|
|
118
|
-
*
|
|
127
|
+
* Group columns report `'left'` or `'right'` when any leaf column is pinned in
|
|
128
|
+
* that region. Unpinned columns return `false`.
|
|
119
129
|
*
|
|
120
130
|
* @example
|
|
121
131
|
* ```ts
|
|
122
|
-
* const
|
|
132
|
+
* const position = column_getIsPinned(column)
|
|
123
133
|
* ```
|
|
124
134
|
*/
|
|
125
135
|
export function column_getIsPinned<
|
|
@@ -141,13 +151,14 @@ export function column_getIsPinned<
|
|
|
141
151
|
}
|
|
142
152
|
|
|
143
153
|
/**
|
|
144
|
-
*
|
|
154
|
+
* Finds this column's index within its pinned region.
|
|
145
155
|
*
|
|
146
|
-
*
|
|
156
|
+
* Unpinned columns return `0`; pinned columns return their position in
|
|
157
|
+
* `state.columnPinning.left` or `state.columnPinning.right`.
|
|
147
158
|
*
|
|
148
159
|
* @example
|
|
149
160
|
* ```ts
|
|
150
|
-
* const
|
|
161
|
+
* const index = column_getPinnedIndex(column)
|
|
151
162
|
* ```
|
|
152
163
|
*/
|
|
153
164
|
export function column_getPinnedIndex<
|
|
@@ -166,13 +177,13 @@ export function column_getPinnedIndex<
|
|
|
166
177
|
// Row APIs
|
|
167
178
|
|
|
168
179
|
/**
|
|
169
|
-
*
|
|
180
|
+
* Collects visible cells whose columns are not pinned left or right.
|
|
170
181
|
*
|
|
171
|
-
*
|
|
182
|
+
* The result preserves the row's visible-cell order for center columns.
|
|
172
183
|
*
|
|
173
184
|
* @example
|
|
174
185
|
* ```ts
|
|
175
|
-
* const
|
|
186
|
+
* const centerCells = row_getCenterVisibleCells(row)
|
|
176
187
|
* ```
|
|
177
188
|
*/
|
|
178
189
|
export function row_getCenterVisibleCells<
|
|
@@ -191,13 +202,14 @@ export function row_getCenterVisibleCells<
|
|
|
191
202
|
}
|
|
192
203
|
|
|
193
204
|
/**
|
|
194
|
-
*
|
|
205
|
+
* Collects visible cells for columns pinned to the left region.
|
|
195
206
|
*
|
|
196
|
-
*
|
|
207
|
+
* Cells are returned in `state.columnPinning.left` order and are marked with
|
|
208
|
+
* `cell.position = 'left'`.
|
|
197
209
|
*
|
|
198
210
|
* @example
|
|
199
211
|
* ```ts
|
|
200
|
-
* const
|
|
212
|
+
* const leftCells = row_getLeftVisibleCells(row)
|
|
201
213
|
* ```
|
|
202
214
|
*/
|
|
203
215
|
export function row_getLeftVisibleCells<
|
|
@@ -209,12 +221,13 @@ export function row_getLeftVisibleCells<
|
|
|
209
221
|
if (!left.length) return []
|
|
210
222
|
const allVisibleCells = callMemoOrStaticFn(
|
|
211
223
|
row,
|
|
212
|
-
'
|
|
213
|
-
|
|
224
|
+
'getVisibleCellsByColumnId',
|
|
225
|
+
row_getVisibleCellsByColumnId,
|
|
214
226
|
)
|
|
215
|
-
const cells:
|
|
216
|
-
for (
|
|
217
|
-
const
|
|
227
|
+
const cells: Array<Cell<TFeatures, TData, unknown>> = []
|
|
228
|
+
for (let i = 0; i < left.length; i++) {
|
|
229
|
+
const columnId = left[i]!
|
|
230
|
+
const cell = allVisibleCells[columnId]
|
|
218
231
|
if (cell) {
|
|
219
232
|
// Assign position property directly to preserve prototype chain
|
|
220
233
|
cell.position = 'left'
|
|
@@ -225,13 +238,14 @@ export function row_getLeftVisibleCells<
|
|
|
225
238
|
}
|
|
226
239
|
|
|
227
240
|
/**
|
|
228
|
-
*
|
|
241
|
+
* Collects visible cells for columns pinned to the right region.
|
|
229
242
|
*
|
|
230
|
-
*
|
|
243
|
+
* Cells are returned in `state.columnPinning.right` order and are marked with
|
|
244
|
+
* `cell.position = 'right'`.
|
|
231
245
|
*
|
|
232
246
|
* @example
|
|
233
247
|
* ```ts
|
|
234
|
-
* const
|
|
248
|
+
* const rightCells = row_getRightVisibleCells(row)
|
|
235
249
|
* ```
|
|
236
250
|
*/
|
|
237
251
|
export function row_getRightVisibleCells<
|
|
@@ -243,12 +257,13 @@ export function row_getRightVisibleCells<
|
|
|
243
257
|
if (!right.length) return [] as Array<Cell<TFeatures, TData, unknown>>
|
|
244
258
|
const allVisibleCells = callMemoOrStaticFn(
|
|
245
259
|
row,
|
|
246
|
-
'
|
|
247
|
-
|
|
260
|
+
'getVisibleCellsByColumnId',
|
|
261
|
+
row_getVisibleCellsByColumnId,
|
|
248
262
|
)
|
|
249
|
-
const cells:
|
|
250
|
-
for (
|
|
251
|
-
const
|
|
263
|
+
const cells: Array<Cell<TFeatures, TData, unknown>> = []
|
|
264
|
+
for (let i = 0; i < right.length; i++) {
|
|
265
|
+
const columnId = right[i]!
|
|
266
|
+
const cell = allVisibleCells[columnId]
|
|
252
267
|
if (cell) {
|
|
253
268
|
// Assign position property directly to preserve prototype chain
|
|
254
269
|
cell.position = 'right'
|
|
@@ -261,13 +276,14 @@ export function row_getRightVisibleCells<
|
|
|
261
276
|
// Table APIs
|
|
262
277
|
|
|
263
278
|
/**
|
|
264
|
-
*
|
|
279
|
+
* Routes a column pinning updater through the table's pinning change handler.
|
|
265
280
|
*
|
|
266
|
-
* The updater
|
|
281
|
+
* The updater may be a next `{ left, right }` state or a function of the
|
|
282
|
+
* previous state, matching the instance `table.setColumnPinning` behavior.
|
|
267
283
|
*
|
|
268
284
|
* @example
|
|
269
285
|
* ```ts
|
|
270
|
-
* table_setColumnPinning(table, (old) => old)
|
|
286
|
+
* table_setColumnPinning(table, (old) => ({ ...old, left: ['select'] }))
|
|
271
287
|
* ```
|
|
272
288
|
*/
|
|
273
289
|
export function table_setColumnPinning<
|
|
@@ -281,9 +297,11 @@ export function table_setColumnPinning<
|
|
|
281
297
|
}
|
|
282
298
|
|
|
283
299
|
/**
|
|
284
|
-
* Resets the
|
|
300
|
+
* Resets `columnPinning` to the configured initial state or feature default.
|
|
285
301
|
*
|
|
286
|
-
*
|
|
302
|
+
* With no argument, the reset clones `table.initialState.columnPinning` when it
|
|
303
|
+
* exists. Passing `true` ignores initial state and resets to empty left/right
|
|
304
|
+
* arrays.
|
|
287
305
|
*
|
|
288
306
|
* @example
|
|
289
307
|
* ```ts
|
|
@@ -306,13 +324,14 @@ export function table_resetColumnPinning<
|
|
|
306
324
|
}
|
|
307
325
|
|
|
308
326
|
/**
|
|
309
|
-
*
|
|
327
|
+
* Checks whether any columns are pinned.
|
|
310
328
|
*
|
|
311
|
-
*
|
|
329
|
+
* Omit `position` to check both sides, or pass `'left'`/`'right'` to inspect a
|
|
330
|
+
* single pinning region.
|
|
312
331
|
*
|
|
313
332
|
* @example
|
|
314
333
|
* ```ts
|
|
315
|
-
* const
|
|
334
|
+
* const hasPinnedColumns = table_getIsSomeColumnsPinned(table)
|
|
316
335
|
* ```
|
|
317
336
|
*/
|
|
318
337
|
export function table_getIsSomeColumnsPinned<
|
|
@@ -330,13 +349,14 @@ export function table_getIsSomeColumnsPinned<
|
|
|
330
349
|
// header groups
|
|
331
350
|
|
|
332
351
|
/**
|
|
333
|
-
*
|
|
352
|
+
* Builds header groups for visible columns pinned to the left region.
|
|
334
353
|
*
|
|
335
|
-
*
|
|
354
|
+
* The leaf columns are read in `state.columnPinning.left` order and then passed
|
|
355
|
+
* through the same header-group builder as the unpinned table.
|
|
336
356
|
*
|
|
337
357
|
* @example
|
|
338
358
|
* ```ts
|
|
339
|
-
* const
|
|
359
|
+
* const headerGroups = table_getLeftHeaderGroups(table)
|
|
340
360
|
* ```
|
|
341
361
|
*/
|
|
342
362
|
export function table_getLeftHeaderGroups<
|
|
@@ -353,8 +373,8 @@ export function table_getLeftHeaderGroups<
|
|
|
353
373
|
|
|
354
374
|
const orderedLeafColumns: Array<Column_Internal<TFeatures, TData, unknown>> =
|
|
355
375
|
[]
|
|
356
|
-
for (
|
|
357
|
-
const column = leafColumnsById[
|
|
376
|
+
for (let i = 0; i < left.length; i++) {
|
|
377
|
+
const column = leafColumnsById[left[i]!]
|
|
358
378
|
if (
|
|
359
379
|
column &&
|
|
360
380
|
callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)
|
|
@@ -367,13 +387,14 @@ export function table_getLeftHeaderGroups<
|
|
|
367
387
|
}
|
|
368
388
|
|
|
369
389
|
/**
|
|
370
|
-
*
|
|
390
|
+
* Builds header groups for visible columns pinned to the right region.
|
|
371
391
|
*
|
|
372
|
-
*
|
|
392
|
+
* The leaf columns are read in `state.columnPinning.right` order and then
|
|
393
|
+
* passed through the same header-group builder as the unpinned table.
|
|
373
394
|
*
|
|
374
395
|
* @example
|
|
375
396
|
* ```ts
|
|
376
|
-
* const
|
|
397
|
+
* const headerGroups = table_getRightHeaderGroups(table)
|
|
377
398
|
* ```
|
|
378
399
|
*/
|
|
379
400
|
export function table_getRightHeaderGroups<
|
|
@@ -390,8 +411,8 @@ export function table_getRightHeaderGroups<
|
|
|
390
411
|
|
|
391
412
|
const orderedLeafColumns: Array<Column_Internal<TFeatures, TData, unknown>> =
|
|
392
413
|
[]
|
|
393
|
-
for (
|
|
394
|
-
const column = leafColumnsById[
|
|
414
|
+
for (let i = 0; i < right.length; i++) {
|
|
415
|
+
const column = leafColumnsById[right[i]!]
|
|
395
416
|
if (
|
|
396
417
|
column &&
|
|
397
418
|
callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)
|
|
@@ -404,13 +425,14 @@ export function table_getRightHeaderGroups<
|
|
|
404
425
|
}
|
|
405
426
|
|
|
406
427
|
/**
|
|
407
|
-
*
|
|
428
|
+
* Builds header groups for visible columns that are not pinned.
|
|
408
429
|
*
|
|
409
|
-
*
|
|
430
|
+
* Left- and right-pinned column ids are removed from the visible leaf column
|
|
431
|
+
* list before header groups are built for the center region.
|
|
410
432
|
*
|
|
411
433
|
* @example
|
|
412
434
|
* ```ts
|
|
413
|
-
* const
|
|
435
|
+
* const headerGroups = table_getCenterHeaderGroups(table)
|
|
414
436
|
* ```
|
|
415
437
|
*/
|
|
416
438
|
export function table_getCenterHeaderGroups<
|
|
@@ -438,13 +460,13 @@ export function table_getCenterHeaderGroups<
|
|
|
438
460
|
// footer groups
|
|
439
461
|
|
|
440
462
|
/**
|
|
441
|
-
*
|
|
463
|
+
* Builds footer groups for the left pinned region.
|
|
442
464
|
*
|
|
443
|
-
*
|
|
465
|
+
* Footer groups reuse the left header groups in reverse order.
|
|
444
466
|
*
|
|
445
467
|
* @example
|
|
446
468
|
* ```ts
|
|
447
|
-
* const
|
|
469
|
+
* const footerGroups = table_getLeftFooterGroups(table)
|
|
448
470
|
* ```
|
|
449
471
|
*/
|
|
450
472
|
export function table_getLeftFooterGroups<
|
|
@@ -460,13 +482,13 @@ export function table_getLeftFooterGroups<
|
|
|
460
482
|
}
|
|
461
483
|
|
|
462
484
|
/**
|
|
463
|
-
*
|
|
485
|
+
* Builds footer groups for the right pinned region.
|
|
464
486
|
*
|
|
465
|
-
*
|
|
487
|
+
* Footer groups reuse the right header groups in reverse order.
|
|
466
488
|
*
|
|
467
489
|
* @example
|
|
468
490
|
* ```ts
|
|
469
|
-
* const
|
|
491
|
+
* const footerGroups = table_getRightFooterGroups(table)
|
|
470
492
|
* ```
|
|
471
493
|
*/
|
|
472
494
|
export function table_getRightFooterGroups<
|
|
@@ -482,13 +504,13 @@ export function table_getRightFooterGroups<
|
|
|
482
504
|
}
|
|
483
505
|
|
|
484
506
|
/**
|
|
485
|
-
*
|
|
507
|
+
* Builds footer groups for the center, unpinned region.
|
|
486
508
|
*
|
|
487
|
-
*
|
|
509
|
+
* Footer groups reuse the center header groups in reverse order.
|
|
488
510
|
*
|
|
489
511
|
* @example
|
|
490
512
|
* ```ts
|
|
491
|
-
* const
|
|
513
|
+
* const footerGroups = table_getCenterFooterGroups(table)
|
|
492
514
|
* ```
|
|
493
515
|
*/
|
|
494
516
|
export function table_getCenterFooterGroups<
|
|
@@ -506,13 +528,13 @@ export function table_getCenterFooterGroups<
|
|
|
506
528
|
// flat headers
|
|
507
529
|
|
|
508
530
|
/**
|
|
509
|
-
*
|
|
531
|
+
* Flattens every header from the left pinned header groups.
|
|
510
532
|
*
|
|
511
|
-
*
|
|
533
|
+
* Parent headers and placeholder headers are included.
|
|
512
534
|
*
|
|
513
535
|
* @example
|
|
514
536
|
* ```ts
|
|
515
|
-
* const
|
|
537
|
+
* const headers = table_getLeftFlatHeaders(table)
|
|
516
538
|
* ```
|
|
517
539
|
*/
|
|
518
540
|
export function table_getLeftFlatHeaders<
|
|
@@ -524,21 +546,24 @@ export function table_getLeftFlatHeaders<
|
|
|
524
546
|
'getLeftHeaderGroups',
|
|
525
547
|
table_getLeftHeaderGroups,
|
|
526
548
|
)
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
549
|
+
const result: Array<Header<TFeatures, TData, unknown>> = []
|
|
550
|
+
for (let i = 0; i < leftHeaderGroups.length; i++) {
|
|
551
|
+
const headers = leftHeaderGroups[i]!.headers
|
|
552
|
+
for (let j = 0; j < headers.length; j++) {
|
|
553
|
+
result.push(headers[j])
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
return result
|
|
532
557
|
}
|
|
533
558
|
|
|
534
559
|
/**
|
|
535
|
-
*
|
|
560
|
+
* Flattens every header from the right pinned header groups.
|
|
536
561
|
*
|
|
537
|
-
*
|
|
562
|
+
* Parent headers and placeholder headers are included.
|
|
538
563
|
*
|
|
539
564
|
* @example
|
|
540
565
|
* ```ts
|
|
541
|
-
* const
|
|
566
|
+
* const headers = table_getRightFlatHeaders(table)
|
|
542
567
|
* ```
|
|
543
568
|
*/
|
|
544
569
|
export function table_getRightFlatHeaders<
|
|
@@ -550,21 +575,24 @@ export function table_getRightFlatHeaders<
|
|
|
550
575
|
'getRightHeaderGroups',
|
|
551
576
|
table_getRightHeaderGroups,
|
|
552
577
|
)
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
578
|
+
const result: Array<Header<TFeatures, TData, unknown>> = []
|
|
579
|
+
for (let i = 0; i < rightHeaderGroups.length; i++) {
|
|
580
|
+
const headers = rightHeaderGroups[i]!.headers
|
|
581
|
+
for (let j = 0; j < headers.length; j++) {
|
|
582
|
+
result.push(headers[j])
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
return result
|
|
558
586
|
}
|
|
559
587
|
|
|
560
588
|
/**
|
|
561
|
-
*
|
|
589
|
+
* Flattens every header from the center header groups.
|
|
562
590
|
*
|
|
563
|
-
*
|
|
591
|
+
* Parent headers and placeholder headers are included.
|
|
564
592
|
*
|
|
565
593
|
* @example
|
|
566
594
|
* ```ts
|
|
567
|
-
* const
|
|
595
|
+
* const headers = table_getCenterFlatHeaders(table)
|
|
568
596
|
* ```
|
|
569
597
|
*/
|
|
570
598
|
export function table_getCenterFlatHeaders<
|
|
@@ -576,23 +604,26 @@ export function table_getCenterFlatHeaders<
|
|
|
576
604
|
'getCenterHeaderGroups',
|
|
577
605
|
table_getCenterHeaderGroups,
|
|
578
606
|
)
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
607
|
+
const result: Array<Header<TFeatures, TData, unknown>> = []
|
|
608
|
+
for (let i = 0; i < centerHeaderGroups.length; i++) {
|
|
609
|
+
const headers = centerHeaderGroups[i]!.headers
|
|
610
|
+
for (let j = 0; j < headers.length; j++) {
|
|
611
|
+
result.push(headers[j])
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return result
|
|
584
615
|
}
|
|
585
616
|
|
|
586
617
|
// leaf headers
|
|
587
618
|
|
|
588
619
|
/**
|
|
589
|
-
*
|
|
620
|
+
* Collects leaf headers for the left pinned region.
|
|
590
621
|
*
|
|
591
|
-
*
|
|
622
|
+
* Parent headers are filtered out from the left flat header list.
|
|
592
623
|
*
|
|
593
624
|
* @example
|
|
594
625
|
* ```ts
|
|
595
|
-
* const
|
|
626
|
+
* const headers = table_getLeftLeafHeaders(table)
|
|
596
627
|
* ```
|
|
597
628
|
*/
|
|
598
629
|
export function table_getLeftLeafHeaders<
|
|
@@ -607,13 +638,13 @@ export function table_getLeftLeafHeaders<
|
|
|
607
638
|
}
|
|
608
639
|
|
|
609
640
|
/**
|
|
610
|
-
*
|
|
641
|
+
* Collects leaf headers for the right pinned region.
|
|
611
642
|
*
|
|
612
|
-
*
|
|
643
|
+
* Parent headers are filtered out from the right flat header list.
|
|
613
644
|
*
|
|
614
645
|
* @example
|
|
615
646
|
* ```ts
|
|
616
|
-
* const
|
|
647
|
+
* const headers = table_getRightLeafHeaders(table)
|
|
617
648
|
* ```
|
|
618
649
|
*/
|
|
619
650
|
export function table_getRightLeafHeaders<
|
|
@@ -628,13 +659,13 @@ export function table_getRightLeafHeaders<
|
|
|
628
659
|
}
|
|
629
660
|
|
|
630
661
|
/**
|
|
631
|
-
*
|
|
662
|
+
* Collects leaf headers for the center, unpinned region.
|
|
632
663
|
*
|
|
633
|
-
*
|
|
664
|
+
* Parent headers are filtered out from the center flat header list.
|
|
634
665
|
*
|
|
635
666
|
* @example
|
|
636
667
|
* ```ts
|
|
637
|
-
* const
|
|
668
|
+
* const headers = table_getCenterLeafHeaders(table)
|
|
638
669
|
* ```
|
|
639
670
|
*/
|
|
640
671
|
export function table_getCenterLeafHeaders<
|
|
@@ -651,13 +682,14 @@ export function table_getCenterLeafHeaders<
|
|
|
651
682
|
// leaf columns
|
|
652
683
|
|
|
653
684
|
/**
|
|
654
|
-
*
|
|
685
|
+
* Resolves leaf columns pinned to the left region.
|
|
655
686
|
*
|
|
656
|
-
*
|
|
687
|
+
* The result follows `state.columnPinning.left` order and skips stale ids that
|
|
688
|
+
* no longer correspond to a leaf column.
|
|
657
689
|
*
|
|
658
690
|
* @example
|
|
659
691
|
* ```ts
|
|
660
|
-
* const
|
|
692
|
+
* const columns = table_getLeftLeafColumns(table)
|
|
661
693
|
* ```
|
|
662
694
|
*/
|
|
663
695
|
export function table_getLeftLeafColumns<
|
|
@@ -668,21 +700,22 @@ export function table_getLeftLeafColumns<
|
|
|
668
700
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
669
701
|
const leafColumnsById = table.getAllLeafColumnsById()
|
|
670
702
|
const result: Array<Column_Internal<TFeatures, TData, unknown>> = []
|
|
671
|
-
for (
|
|
672
|
-
const column = leafColumnsById[
|
|
703
|
+
for (let i = 0; i < left.length; i++) {
|
|
704
|
+
const column = leafColumnsById[left[i]!]
|
|
673
705
|
if (column) result.push(column)
|
|
674
706
|
}
|
|
675
707
|
return result
|
|
676
708
|
}
|
|
677
709
|
|
|
678
710
|
/**
|
|
679
|
-
*
|
|
711
|
+
* Resolves leaf columns pinned to the right region.
|
|
680
712
|
*
|
|
681
|
-
*
|
|
713
|
+
* The result follows `state.columnPinning.right` order and skips stale ids that
|
|
714
|
+
* no longer correspond to a leaf column.
|
|
682
715
|
*
|
|
683
716
|
* @example
|
|
684
717
|
* ```ts
|
|
685
|
-
* const
|
|
718
|
+
* const columns = table_getRightLeafColumns(table)
|
|
686
719
|
* ```
|
|
687
720
|
*/
|
|
688
721
|
export function table_getRightLeafColumns<
|
|
@@ -693,21 +726,21 @@ export function table_getRightLeafColumns<
|
|
|
693
726
|
table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
|
|
694
727
|
const leafColumnsById = table.getAllLeafColumnsById()
|
|
695
728
|
const result: Array<Column_Internal<TFeatures, TData, unknown>> = []
|
|
696
|
-
for (
|
|
697
|
-
const column = leafColumnsById[
|
|
729
|
+
for (let i = 0; i < right.length; i++) {
|
|
730
|
+
const column = leafColumnsById[right[i]!]
|
|
698
731
|
if (column) result.push(column)
|
|
699
732
|
}
|
|
700
733
|
return result
|
|
701
734
|
}
|
|
702
735
|
|
|
703
736
|
/**
|
|
704
|
-
*
|
|
737
|
+
* Resolves leaf columns that are not pinned to either side.
|
|
705
738
|
*
|
|
706
|
-
*
|
|
739
|
+
* Left- and right-pinned ids are removed from `table.getAllLeafColumns()`.
|
|
707
740
|
*
|
|
708
741
|
* @example
|
|
709
742
|
* ```ts
|
|
710
|
-
* const
|
|
743
|
+
* const columns = table_getCenterLeafColumns(table)
|
|
711
744
|
* ```
|
|
712
745
|
*/
|
|
713
746
|
export function table_getCenterLeafColumns<
|
|
@@ -721,13 +754,14 @@ export function table_getCenterLeafColumns<
|
|
|
721
754
|
}
|
|
722
755
|
|
|
723
756
|
/**
|
|
724
|
-
*
|
|
757
|
+
* Resolves leaf columns for a requested pinning region.
|
|
725
758
|
*
|
|
726
|
-
*
|
|
759
|
+
* Pass `'left'`, `'center'`, or `'right'` for a partition, or pass `false` to
|
|
760
|
+
* read all leaf columns without partitioning.
|
|
727
761
|
*
|
|
728
762
|
* @example
|
|
729
763
|
* ```ts
|
|
730
|
-
* const
|
|
764
|
+
* const columns = table_getPinnedLeafColumns(table, 'center')
|
|
731
765
|
* ```
|
|
732
766
|
*/
|
|
733
767
|
export function table_getPinnedLeafColumns<
|
|
@@ -761,13 +795,13 @@ export function table_getPinnedLeafColumns<
|
|
|
761
795
|
// visible leaf columns
|
|
762
796
|
|
|
763
797
|
/**
|
|
764
|
-
*
|
|
798
|
+
* Resolves visible leaf columns pinned to the left region.
|
|
765
799
|
*
|
|
766
|
-
*
|
|
800
|
+
* Hidden pinned columns are filtered out after the left pin order is applied.
|
|
767
801
|
*
|
|
768
802
|
* @example
|
|
769
803
|
* ```ts
|
|
770
|
-
* const
|
|
804
|
+
* const columns = table_getLeftVisibleLeafColumns(table)
|
|
771
805
|
* ```
|
|
772
806
|
*/
|
|
773
807
|
export function table_getLeftVisibleLeafColumns<
|
|
@@ -784,13 +818,13 @@ export function table_getLeftVisibleLeafColumns<
|
|
|
784
818
|
}
|
|
785
819
|
|
|
786
820
|
/**
|
|
787
|
-
*
|
|
821
|
+
* Resolves visible leaf columns pinned to the right region.
|
|
788
822
|
*
|
|
789
|
-
*
|
|
823
|
+
* Hidden pinned columns are filtered out after the right pin order is applied.
|
|
790
824
|
*
|
|
791
825
|
* @example
|
|
792
826
|
* ```ts
|
|
793
|
-
* const
|
|
827
|
+
* const columns = table_getRightVisibleLeafColumns(table)
|
|
794
828
|
* ```
|
|
795
829
|
*/
|
|
796
830
|
export function table_getRightVisibleLeafColumns<
|
|
@@ -807,13 +841,14 @@ export function table_getRightVisibleLeafColumns<
|
|
|
807
841
|
}
|
|
808
842
|
|
|
809
843
|
/**
|
|
810
|
-
*
|
|
844
|
+
* Resolves visible leaf columns that are not pinned.
|
|
811
845
|
*
|
|
812
|
-
* This
|
|
846
|
+
* This is the center partition used by layouts that render pinned columns
|
|
847
|
+
* separately from the scrollable middle region.
|
|
813
848
|
*
|
|
814
849
|
* @example
|
|
815
850
|
* ```ts
|
|
816
|
-
* const
|
|
851
|
+
* const columns = table_getCenterVisibleLeafColumns(table)
|
|
817
852
|
* ```
|
|
818
853
|
*/
|
|
819
854
|
export function table_getCenterVisibleLeafColumns<
|
|
@@ -830,13 +865,14 @@ export function table_getCenterVisibleLeafColumns<
|
|
|
830
865
|
}
|
|
831
866
|
|
|
832
867
|
/**
|
|
833
|
-
*
|
|
868
|
+
* Resolves visible leaf columns for a requested pinning region.
|
|
834
869
|
*
|
|
835
|
-
*
|
|
870
|
+
* Omit `position` to get all visible leaf columns, or pass `'left'`, `'center'`,
|
|
871
|
+
* or `'right'` to get one partition.
|
|
836
872
|
*
|
|
837
873
|
* @example
|
|
838
874
|
* ```ts
|
|
839
|
-
* const
|
|
875
|
+
* const columns = table_getPinnedVisibleLeafColumns(table, 'left')
|
|
840
876
|
* ```
|
|
841
877
|
*/
|
|
842
878
|
export function table_getPinnedVisibleLeafColumns<
|