@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
|
@@ -13,13 +13,14 @@ import type {
|
|
|
13
13
|
} from './columnGroupingFeature.types'
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Creates the default grouping state.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* The feature default is an empty array, meaning no columns are grouped. Reset
|
|
19
|
+
* APIs use this value when `defaultState` is `true`.
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* ```ts
|
|
22
|
-
* const
|
|
23
|
+
* const grouping = getDefaultGroupingState()
|
|
23
24
|
* ```
|
|
24
25
|
*/
|
|
25
26
|
export function getDefaultGroupingState(): GroupingState {
|
|
@@ -27,9 +28,10 @@ export function getDefaultGroupingState(): GroupingState {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* Adds or removes this column id from the grouping state.
|
|
31
32
|
*
|
|
32
|
-
*
|
|
33
|
+
* Existing grouped columns keep their order. A column already present in
|
|
34
|
+
* `state.grouping` is removed; otherwise it is appended.
|
|
33
35
|
*
|
|
34
36
|
* @example
|
|
35
37
|
* ```ts
|
|
@@ -52,13 +54,14 @@ export function column_toggleGrouping<
|
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
/**
|
|
55
|
-
*
|
|
57
|
+
* Checks whether this column can be used for grouping.
|
|
56
58
|
*
|
|
57
|
-
*
|
|
59
|
+
* Grouping must be enabled at the column and table level, and the column must
|
|
60
|
+
* either have an accessor or provide `getGroupingValue`.
|
|
58
61
|
*
|
|
59
62
|
* @example
|
|
60
63
|
* ```ts
|
|
61
|
-
* const
|
|
64
|
+
* const canGroup = column_getCanGroup(column)
|
|
62
65
|
* ```
|
|
63
66
|
*/
|
|
64
67
|
export function column_getCanGroup<
|
|
@@ -74,13 +77,14 @@ export function column_getCanGroup<
|
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
/**
|
|
77
|
-
*
|
|
80
|
+
* Checks whether this column id is present in `state.grouping`.
|
|
78
81
|
*
|
|
79
|
-
*
|
|
82
|
+
* The result only reflects grouping state, not whether the grouped row model has
|
|
83
|
+
* been calculated yet.
|
|
80
84
|
*
|
|
81
85
|
* @example
|
|
82
86
|
* ```ts
|
|
83
|
-
* const
|
|
87
|
+
* const isGrouped = column_getIsGrouped(column)
|
|
84
88
|
* ```
|
|
85
89
|
*/
|
|
86
90
|
export function column_getIsGrouped<
|
|
@@ -92,13 +96,13 @@ export function column_getIsGrouped<
|
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
/**
|
|
95
|
-
*
|
|
99
|
+
* Finds this column's position in the ordered grouping state.
|
|
96
100
|
*
|
|
97
|
-
*
|
|
101
|
+
* The result is `-1` when the column is not grouped.
|
|
98
102
|
*
|
|
99
103
|
* @example
|
|
100
104
|
* ```ts
|
|
101
|
-
* const
|
|
105
|
+
* const index = column_getGroupedIndex(column)
|
|
102
106
|
* ```
|
|
103
107
|
*/
|
|
104
108
|
export function column_getGroupedIndex<
|
|
@@ -110,13 +114,13 @@ export function column_getGroupedIndex<
|
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
/**
|
|
113
|
-
*
|
|
117
|
+
* Creates a header/control handler that toggles grouping for this column.
|
|
114
118
|
*
|
|
115
|
-
* The handler is
|
|
119
|
+
* The handler is a no-op when `column_getCanGroup(column)` is false.
|
|
116
120
|
*
|
|
117
121
|
* @example
|
|
118
122
|
* ```ts
|
|
119
|
-
* const
|
|
123
|
+
* const onClick = column_getToggleGroupingHandler(column)
|
|
120
124
|
* ```
|
|
121
125
|
*/
|
|
122
126
|
export function column_getToggleGroupingHandler<
|
|
@@ -133,13 +137,14 @@ export function column_getToggleGroupingHandler<
|
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
/**
|
|
136
|
-
*
|
|
140
|
+
* Chooses a built-in aggregation function from the first core row value.
|
|
137
141
|
*
|
|
138
|
-
*
|
|
142
|
+
* Numeric columns default to `sum`, date-like values default to `extent`, and
|
|
143
|
+
* other value types leave aggregation unspecified.
|
|
139
144
|
*
|
|
140
145
|
* @example
|
|
141
146
|
* ```ts
|
|
142
|
-
* const
|
|
147
|
+
* const aggregationFn = column_getAutoAggregationFn(column)
|
|
143
148
|
* ```
|
|
144
149
|
*/
|
|
145
150
|
export function column_getAutoAggregationFn<
|
|
@@ -165,13 +170,15 @@ export function column_getAutoAggregationFn<
|
|
|
165
170
|
}
|
|
166
171
|
|
|
167
172
|
/**
|
|
168
|
-
*
|
|
173
|
+
* Resolves the aggregation function configured for a column.
|
|
169
174
|
*
|
|
170
|
-
*
|
|
175
|
+
* Function-valued `columnDef.aggregationFn` is returned directly, `'auto'`
|
|
176
|
+
* delegates to `column_getAutoAggregationFn`, and string values are looked up in
|
|
177
|
+
* the table's aggregation function registry.
|
|
171
178
|
*
|
|
172
179
|
* @example
|
|
173
180
|
* ```ts
|
|
174
|
-
* const
|
|
181
|
+
* const aggregationFn = column_getAggregationFn(column)
|
|
175
182
|
* ```
|
|
176
183
|
*/
|
|
177
184
|
export function column_getAggregationFn<
|
|
@@ -191,13 +198,14 @@ export function column_getAggregationFn<
|
|
|
191
198
|
}
|
|
192
199
|
|
|
193
200
|
/**
|
|
194
|
-
*
|
|
201
|
+
* Routes a grouping updater through the table's grouping change handler.
|
|
195
202
|
*
|
|
196
|
-
* The updater
|
|
203
|
+
* The updater may be a next `GroupingState` array or a function of the previous
|
|
204
|
+
* grouping state, matching the instance `table.setGrouping` behavior.
|
|
197
205
|
*
|
|
198
206
|
* @example
|
|
199
207
|
* ```ts
|
|
200
|
-
* table_setGrouping(table, (old) => old)
|
|
208
|
+
* table_setGrouping(table, (old) => [...old, 'status'])
|
|
201
209
|
* ```
|
|
202
210
|
*/
|
|
203
211
|
export function table_setGrouping<
|
|
@@ -208,9 +216,10 @@ export function table_setGrouping<
|
|
|
208
216
|
}
|
|
209
217
|
|
|
210
218
|
/**
|
|
211
|
-
* Resets the
|
|
219
|
+
* Resets `grouping` to the configured initial state or feature default.
|
|
212
220
|
*
|
|
213
|
-
*
|
|
221
|
+
* With no argument, the reset clones `table.initialState.grouping` when it
|
|
222
|
+
* exists. Passing `true` ignores initial state and resets to `[]`.
|
|
214
223
|
*
|
|
215
224
|
* @example
|
|
216
225
|
* ```ts
|
|
@@ -229,13 +238,13 @@ export function table_resetGrouping<
|
|
|
229
238
|
}
|
|
230
239
|
|
|
231
240
|
/**
|
|
232
|
-
*
|
|
241
|
+
* Checks whether this row was created as a grouped row.
|
|
233
242
|
*
|
|
234
|
-
*
|
|
243
|
+
* Grouped rows carry a `groupingColumnId`; ordinary leaf rows do not.
|
|
235
244
|
*
|
|
236
245
|
* @example
|
|
237
246
|
* ```ts
|
|
238
|
-
* const
|
|
247
|
+
* const isGrouped = row_getIsGrouped(row)
|
|
239
248
|
* ```
|
|
240
249
|
*/
|
|
241
250
|
export function row_getIsGrouped<
|
|
@@ -246,13 +255,14 @@ export function row_getIsGrouped<
|
|
|
246
255
|
}
|
|
247
256
|
|
|
248
257
|
/**
|
|
249
|
-
*
|
|
258
|
+
* Reads and caches this row's grouping value for a column.
|
|
250
259
|
*
|
|
251
|
-
*
|
|
260
|
+
* `columnDef.getGroupingValue` wins when provided; otherwise the normal row
|
|
261
|
+
* accessor value is used.
|
|
252
262
|
*
|
|
253
263
|
* @example
|
|
254
264
|
* ```ts
|
|
255
|
-
* const
|
|
265
|
+
* const groupValue = row_getGroupingValue(row, 'status')
|
|
256
266
|
* ```
|
|
257
267
|
*/
|
|
258
268
|
export function row_getGroupingValue<
|
|
@@ -282,13 +292,13 @@ export function row_getGroupingValue<
|
|
|
282
292
|
}
|
|
283
293
|
|
|
284
294
|
/**
|
|
285
|
-
*
|
|
295
|
+
* Checks whether this cell represents the grouped column for a grouped row.
|
|
286
296
|
*
|
|
287
|
-
* This is the
|
|
297
|
+
* This is the cell that usually renders the grouped value and expansion control.
|
|
288
298
|
*
|
|
289
299
|
* @example
|
|
290
300
|
* ```ts
|
|
291
|
-
* const
|
|
301
|
+
* const isGroupedCell = cell_getIsGrouped(cell)
|
|
292
302
|
* ```
|
|
293
303
|
*/
|
|
294
304
|
export function cell_getIsGrouped<
|
|
@@ -303,13 +313,14 @@ export function cell_getIsGrouped<
|
|
|
303
313
|
}
|
|
304
314
|
|
|
305
315
|
/**
|
|
306
|
-
*
|
|
316
|
+
* Checks whether this cell is a placeholder hidden by grouping.
|
|
307
317
|
*
|
|
308
|
-
*
|
|
318
|
+
* Placeholder cells belong to grouped columns other than the row's active
|
|
319
|
+
* grouping column.
|
|
309
320
|
*
|
|
310
321
|
* @example
|
|
311
322
|
* ```ts
|
|
312
|
-
* const
|
|
323
|
+
* const isPlaceholder = cell_getIsPlaceholder(cell)
|
|
313
324
|
* ```
|
|
314
325
|
*/
|
|
315
326
|
export function cell_getIsPlaceholder<
|
|
@@ -321,13 +332,14 @@ export function cell_getIsPlaceholder<
|
|
|
321
332
|
}
|
|
322
333
|
|
|
323
334
|
/**
|
|
324
|
-
*
|
|
335
|
+
* Checks whether this cell should render an aggregated value.
|
|
325
336
|
*
|
|
326
|
-
*
|
|
337
|
+
* Aggregated cells are non-placeholder, non-grouped cells on rows that have
|
|
338
|
+
* subRows.
|
|
327
339
|
*
|
|
328
340
|
* @example
|
|
329
341
|
* ```ts
|
|
330
|
-
* const
|
|
342
|
+
* const isAggregated = cell_getIsAggregated(cell)
|
|
331
343
|
* ```
|
|
332
344
|
*/
|
|
333
345
|
export function cell_getIsAggregated<
|
|
@@ -19,15 +19,22 @@ export interface TableOptions_ColumnOrdering {
|
|
|
19
19
|
|
|
20
20
|
export interface Column_ColumnOrdering {
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Finds this column's zero-based index among visible columns.
|
|
23
|
+
*
|
|
24
|
+
* Pass `'left'`, `'center'`, or `'right'` to measure within that pinned
|
|
25
|
+
* region instead of the full visible leaf order.
|
|
23
26
|
*/
|
|
24
27
|
getIndex: (position?: ColumnPinningPosition | 'center') => number
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
29
|
+
* Checks whether this column is the first visible column.
|
|
30
|
+
*
|
|
31
|
+
* Pass a pinned region to check the first column within that region.
|
|
27
32
|
*/
|
|
28
33
|
getIsFirstColumn: (position?: ColumnPinningPosition | 'center') => boolean
|
|
29
34
|
/**
|
|
30
|
-
*
|
|
35
|
+
* Checks whether this column is the last visible column.
|
|
36
|
+
*
|
|
37
|
+
* Pass a pinned region to check the last column within that region.
|
|
31
38
|
*/
|
|
32
39
|
getIsLastColumn: (position?: ColumnPinningPosition | 'center') => boolean
|
|
33
40
|
}
|
|
@@ -41,11 +48,13 @@ export interface Table_ColumnOrdering<
|
|
|
41
48
|
TData extends RowData,
|
|
42
49
|
> {
|
|
43
50
|
/**
|
|
44
|
-
* Resets
|
|
51
|
+
* Resets `columnOrder` to `initialState.columnOrder`.
|
|
52
|
+
*
|
|
53
|
+
* Pass `true` to ignore initial state and reset to `[]`.
|
|
45
54
|
*/
|
|
46
55
|
resetColumnOrder: (defaultState?: boolean) => void
|
|
47
56
|
/**
|
|
48
|
-
*
|
|
57
|
+
* Updates column order state with a next ordered id array or updater function.
|
|
49
58
|
*/
|
|
50
59
|
setColumnOrder: (updater: Updater<ColumnOrderState>) => void
|
|
51
60
|
}
|
|
@@ -9,13 +9,14 @@ import type { ColumnPinningPosition } from '../column-pinning/columnPinningFeatu
|
|
|
9
9
|
import type { ColumnOrderState } from './columnOrderingFeature.types'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Creates the default column order state.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* The feature default is an empty array, meaning leaf columns keep their natural
|
|
15
|
+
* definition order. Reset APIs use this value when `defaultState` is `true`.
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* ```ts
|
|
18
|
-
* const
|
|
19
|
+
* const order = getDefaultColumnOrderState()
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
22
|
export function getDefaultColumnOrderState(): ColumnOrderState {
|
|
@@ -23,13 +24,14 @@ export function getDefaultColumnOrderState(): ColumnOrderState {
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* Finds this column's index within a visible pinning region.
|
|
27
28
|
*
|
|
28
|
-
*
|
|
29
|
+
* Pass `'left'`, `'center'`, or `'right'` to search that region; omit the
|
|
30
|
+
* position to search the full visible leaf column list.
|
|
29
31
|
*
|
|
30
32
|
* @example
|
|
31
33
|
* ```ts
|
|
32
|
-
* const
|
|
34
|
+
* const index = column_getIndex(column, 'center')
|
|
33
35
|
* ```
|
|
34
36
|
*/
|
|
35
37
|
export function column_getIndex<
|
|
@@ -45,13 +47,13 @@ export function column_getIndex<
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
|
-
*
|
|
50
|
+
* Checks whether this column is the first visible column in a pinning region.
|
|
49
51
|
*
|
|
50
|
-
*
|
|
52
|
+
* The same `position` semantics as `column_getIndex` apply.
|
|
51
53
|
*
|
|
52
54
|
* @example
|
|
53
55
|
* ```ts
|
|
54
|
-
* const
|
|
56
|
+
* const isFirst = column_getIsFirstColumn(column, 'left')
|
|
55
57
|
* ```
|
|
56
58
|
*/
|
|
57
59
|
export function column_getIsFirstColumn<
|
|
@@ -67,13 +69,13 @@ export function column_getIsFirstColumn<
|
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
|
-
*
|
|
72
|
+
* Checks whether this column is the last visible column in a pinning region.
|
|
71
73
|
*
|
|
72
|
-
*
|
|
74
|
+
* The same `position` semantics as `column_getIndex` apply.
|
|
73
75
|
*
|
|
74
76
|
* @example
|
|
75
77
|
* ```ts
|
|
76
|
-
* const
|
|
78
|
+
* const isLast = column_getIsLastColumn(column, 'right')
|
|
77
79
|
* ```
|
|
78
80
|
*/
|
|
79
81
|
export function column_getIsLastColumn<
|
|
@@ -89,13 +91,14 @@ export function column_getIsLastColumn<
|
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
/**
|
|
92
|
-
*
|
|
94
|
+
* Routes a column order updater through the table's column-order change handler.
|
|
93
95
|
*
|
|
94
|
-
* The updater
|
|
96
|
+
* The updater may be a next ordered id array or a function of the previous
|
|
97
|
+
* array, matching the instance `table.setColumnOrder` behavior.
|
|
95
98
|
*
|
|
96
99
|
* @example
|
|
97
100
|
* ```ts
|
|
98
|
-
* table_setColumnOrder(table,
|
|
101
|
+
* table_setColumnOrder(table, ['firstName', 'lastName', 'age'])
|
|
99
102
|
* ```
|
|
100
103
|
*/
|
|
101
104
|
export function table_setColumnOrder<
|
|
@@ -106,9 +109,10 @@ export function table_setColumnOrder<
|
|
|
106
109
|
}
|
|
107
110
|
|
|
108
111
|
/**
|
|
109
|
-
* Resets the
|
|
112
|
+
* Resets `columnOrder` to the configured initial state or feature default.
|
|
110
113
|
*
|
|
111
|
-
*
|
|
114
|
+
* With no argument, the reset clones `table.initialState.columnOrder` when it
|
|
115
|
+
* exists. Passing `true` ignores initial state and resets to `[]`.
|
|
112
116
|
*
|
|
113
117
|
* @example
|
|
114
118
|
* ```ts
|
|
@@ -127,13 +131,14 @@ export function table_resetColumnOrder<
|
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
/**
|
|
130
|
-
*
|
|
134
|
+
* Creates the ordering function used to arrange leaf columns.
|
|
131
135
|
*
|
|
132
|
-
*
|
|
136
|
+
* The returned function applies `state.columnOrder`, preserves unspecified
|
|
137
|
+
* columns in their original order, then delegates to grouping rules.
|
|
133
138
|
*
|
|
134
139
|
* @example
|
|
135
140
|
* ```ts
|
|
136
|
-
* const
|
|
141
|
+
* const orderColumnsForTable = table_getOrderColumnsFn(table)
|
|
137
142
|
* ```
|
|
138
143
|
*/
|
|
139
144
|
export function table_getOrderColumnsFn<
|
|
@@ -156,11 +161,15 @@ export function table_getOrderColumnsFn<
|
|
|
156
161
|
string,
|
|
157
162
|
Column_Internal<TFeatures, TData, unknown>
|
|
158
163
|
>()
|
|
159
|
-
for (
|
|
164
|
+
for (let i = 0; i < columns.length; i++) {
|
|
165
|
+
const column = columns[i]!
|
|
166
|
+
remaining.set(column.id, column)
|
|
167
|
+
}
|
|
160
168
|
|
|
161
169
|
// Place columns in the requested order, removing each as it's used
|
|
162
170
|
// (handles duplicates and unknown ids in columnOrder)
|
|
163
|
-
for (
|
|
171
|
+
for (let i = 0; i < columnOrder.length; i++) {
|
|
172
|
+
const id = columnOrder[i]!
|
|
164
173
|
const column = remaining.get(id)
|
|
165
174
|
if (column) {
|
|
166
175
|
orderedColumns.push(column)
|
|
@@ -169,7 +178,8 @@ export function table_getOrderColumnsFn<
|
|
|
169
178
|
}
|
|
170
179
|
|
|
171
180
|
// Append leftover columns in their original order
|
|
172
|
-
for (
|
|
181
|
+
for (let i = 0; i < columns.length; i++) {
|
|
182
|
+
const column = columns[i]!
|
|
173
183
|
if (remaining.has(column.id)) orderedColumns.push(column)
|
|
174
184
|
}
|
|
175
185
|
}
|
|
@@ -179,13 +189,15 @@ export function table_getOrderColumnsFn<
|
|
|
179
189
|
}
|
|
180
190
|
|
|
181
191
|
/**
|
|
182
|
-
*
|
|
192
|
+
* Applies grouped-column placement rules to an already ordered leaf-column list.
|
|
183
193
|
*
|
|
184
|
-
*
|
|
194
|
+
* `groupedColumnMode: 'remove'` drops grouped columns from the list.
|
|
195
|
+
* `groupedColumnMode: 'reorder'` moves grouped columns to the front in grouping
|
|
196
|
+
* state order.
|
|
185
197
|
*
|
|
186
198
|
* @example
|
|
187
199
|
* ```ts
|
|
188
|
-
* const orderedColumns = orderColumns(
|
|
200
|
+
* const orderedColumns = orderColumns(table, leafColumns)
|
|
189
201
|
* ```
|
|
190
202
|
*/
|
|
191
203
|
export function orderColumns<
|
|
@@ -214,11 +226,14 @@ export function orderColumns<
|
|
|
214
226
|
string,
|
|
215
227
|
Column_Internal<TFeatures, TData, unknown>
|
|
216
228
|
>()
|
|
217
|
-
for (
|
|
229
|
+
for (let i = 0; i < leafColumns.length; i++) {
|
|
230
|
+
const col = leafColumns[i]!
|
|
231
|
+
leafColumnsById.set(col.id, col)
|
|
232
|
+
}
|
|
218
233
|
|
|
219
234
|
const groupingColumns: Array<Column_Internal<TFeatures, TData, unknown>> = []
|
|
220
|
-
for (
|
|
221
|
-
const col = leafColumnsById.get(
|
|
235
|
+
for (let i = 0; i < grouping.length; i++) {
|
|
236
|
+
const col = leafColumnsById.get(grouping[i]!)
|
|
222
237
|
if (col) groupingColumns.push(col)
|
|
223
238
|
}
|
|
224
239
|
|