@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
|
@@ -3,13 +3,14 @@ const require_constructCell = require('../cells/constructCell.cjs');
|
|
|
3
3
|
|
|
4
4
|
//#region src/core/rows/coreRowsFeature.utils.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Reads and caches this row's value for a column.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* The value is produced by the column accessor. Missing columns or display
|
|
9
|
+
* columns without an accessor return `undefined`.
|
|
9
10
|
*
|
|
10
11
|
* @example
|
|
11
12
|
* ```ts
|
|
12
|
-
* const
|
|
13
|
+
* const firstName = row_getValue(row, 'firstName')
|
|
13
14
|
* ```
|
|
14
15
|
*/
|
|
15
16
|
function row_getValue(row, columnId) {
|
|
@@ -20,13 +21,14 @@ function row_getValue(row, columnId) {
|
|
|
20
21
|
return row._valuesCache[columnId];
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* Reads and caches the values used by faceting/grouping for a column.
|
|
24
25
|
*
|
|
25
|
-
*
|
|
26
|
+
* If the column defines `getUniqueValues`, that result is used. Otherwise the
|
|
27
|
+
* row's accessor value is wrapped in a single-item array.
|
|
26
28
|
*
|
|
27
29
|
* @example
|
|
28
30
|
* ```ts
|
|
29
|
-
* const
|
|
31
|
+
* const values = row_getUniqueValues(row, 'tags')
|
|
30
32
|
* ```
|
|
31
33
|
*/
|
|
32
34
|
function row_getUniqueValues(row, columnId) {
|
|
@@ -48,46 +50,47 @@ function row_getUniqueValues(row, columnId) {
|
|
|
48
50
|
*
|
|
49
51
|
* @example
|
|
50
52
|
* ```ts
|
|
51
|
-
* const value = row_renderValue(row)
|
|
53
|
+
* const value = row_renderValue(row, 'firstName')
|
|
52
54
|
* ```
|
|
53
55
|
*/
|
|
54
56
|
function row_renderValue(row, columnId) {
|
|
55
57
|
return row.getValue(columnId) ?? row.table.options.renderFallbackValue;
|
|
56
58
|
}
|
|
57
59
|
/**
|
|
58
|
-
*
|
|
60
|
+
* Flattens this row's descendant tree into leaf rows.
|
|
59
61
|
*
|
|
60
|
-
*
|
|
62
|
+
* The row itself is not included; only nested `subRows` are walked.
|
|
61
63
|
*
|
|
62
64
|
* @example
|
|
63
65
|
* ```ts
|
|
64
|
-
* const
|
|
66
|
+
* const descendants = row_getLeafRows(row)
|
|
65
67
|
* ```
|
|
66
68
|
*/
|
|
67
69
|
function row_getLeafRows(row) {
|
|
68
70
|
return require_utils.flattenBy(row.subRows, (d) => d.subRows);
|
|
69
71
|
}
|
|
70
72
|
/**
|
|
71
|
-
*
|
|
73
|
+
* Looks up this row's direct parent, if it has one.
|
|
72
74
|
*
|
|
73
|
-
*
|
|
75
|
+
* Parent lookup searches the pre-pagination row model so parent relationships
|
|
76
|
+
* are available even when the parent is not on the current page.
|
|
74
77
|
*
|
|
75
78
|
* @example
|
|
76
79
|
* ```ts
|
|
77
|
-
* const
|
|
80
|
+
* const parent = row_getParentRow(row)
|
|
78
81
|
* ```
|
|
79
82
|
*/
|
|
80
83
|
function row_getParentRow(row) {
|
|
81
84
|
return row.parentId ? row.table.getRow(row.parentId, true) : void 0;
|
|
82
85
|
}
|
|
83
86
|
/**
|
|
84
|
-
*
|
|
87
|
+
* Collects this row's ancestor chain from root to direct parent.
|
|
85
88
|
*
|
|
86
|
-
*
|
|
89
|
+
* The current row is not included. Rows without a parent return an empty array.
|
|
87
90
|
*
|
|
88
91
|
* @example
|
|
89
92
|
* ```ts
|
|
90
|
-
* const
|
|
93
|
+
* const ancestors = row_getParentRows(row)
|
|
91
94
|
* ```
|
|
92
95
|
*/
|
|
93
96
|
function row_getParentRows(row) {
|
|
@@ -102,43 +105,50 @@ function row_getParentRows(row) {
|
|
|
102
105
|
return parentRows.reverse();
|
|
103
106
|
}
|
|
104
107
|
/**
|
|
105
|
-
*
|
|
108
|
+
* Constructs one cell for each leaf column in this row.
|
|
106
109
|
*
|
|
107
|
-
*
|
|
110
|
+
* The result follows `table.getAllLeafColumns()` order and includes hidden
|
|
111
|
+
* columns; visibility-specific APIs filter this list later.
|
|
108
112
|
*
|
|
109
113
|
* @example
|
|
110
114
|
* ```ts
|
|
111
|
-
* const
|
|
115
|
+
* const cells = row_getAllCells(row)
|
|
112
116
|
* ```
|
|
113
117
|
*/
|
|
114
118
|
function row_getAllCells(row) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
const columns = row.table.getAllLeafColumns();
|
|
120
|
+
const cells = new Array(columns.length);
|
|
121
|
+
for (let i = 0; i < columns.length; i++) cells[i] = require_constructCell.constructCell(columns[i], row, row.table);
|
|
122
|
+
return cells;
|
|
118
123
|
}
|
|
119
124
|
/**
|
|
120
|
-
*
|
|
125
|
+
* Builds a lookup map of this row's cells keyed by column id.
|
|
121
126
|
*
|
|
122
|
-
* This is the static implementation behind
|
|
127
|
+
* This is the static implementation behind `row.getAllCellsByColumnId()`.
|
|
123
128
|
*
|
|
124
129
|
* @example
|
|
125
130
|
* ```ts
|
|
126
|
-
* const
|
|
131
|
+
* const cellsById = row_getAllCellsByColumnId(row)
|
|
127
132
|
* ```
|
|
128
133
|
*/
|
|
129
134
|
function row_getAllCellsByColumnId(row) {
|
|
130
135
|
const result = {};
|
|
131
|
-
|
|
136
|
+
const cells = row.getAllCells();
|
|
137
|
+
for (let i = 0; i < cells.length; i++) {
|
|
138
|
+
const cell = cells[i];
|
|
139
|
+
result[cell.column.id] = cell;
|
|
140
|
+
}
|
|
132
141
|
return result;
|
|
133
142
|
}
|
|
134
143
|
/**
|
|
135
|
-
*
|
|
144
|
+
* Resolves the stable id for a row.
|
|
136
145
|
*
|
|
137
|
-
*
|
|
146
|
+
* `options.getRowId` wins when provided. Otherwise root rows use their index
|
|
147
|
+
* and child rows append their index to the parent id, such as `0.2`.
|
|
138
148
|
*
|
|
139
149
|
* @example
|
|
140
150
|
* ```ts
|
|
141
|
-
* const
|
|
151
|
+
* const id = table_getRowId(originalRow, table, index, parentRow)
|
|
142
152
|
* ```
|
|
143
153
|
*/
|
|
144
154
|
function table_getRowId(originalRow, table, index, parent) {
|
|
@@ -146,13 +156,14 @@ function table_getRowId(originalRow, table, index, parent) {
|
|
|
146
156
|
return ((_table$options$getRow = (_table$options = table.options).getRowId) === null || _table$options$getRow === void 0 ? void 0 : _table$options$getRow.call(_table$options, originalRow, index, parent)) ?? `${parent ? [parent.id, index].join(".") : index}`;
|
|
147
157
|
}
|
|
148
158
|
/**
|
|
149
|
-
*
|
|
159
|
+
* Looks up a row by id from the current or full row model.
|
|
150
160
|
*
|
|
151
|
-
*
|
|
161
|
+
* By default this searches `table.getRowModel()`. Passing `searchAll` searches
|
|
162
|
+
* the pre-pagination model first, then falls back to the core model.
|
|
152
163
|
*
|
|
153
164
|
* @example
|
|
154
165
|
* ```ts
|
|
155
|
-
* const
|
|
166
|
+
* const row = table_getRow(table, rowId, true)
|
|
156
167
|
* ```
|
|
157
168
|
*/
|
|
158
169
|
function table_getRow(table, rowId, searchAll) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreRowsFeature.utils.cjs","names":["flattenBy","constructCell"],"sources":["../../../src/core/rows/coreRowsFeature.utils.ts"],"sourcesContent":["import { flattenBy } from '../../utils'\nimport { constructCell } from '../cells/constructCell'\nimport type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"coreRowsFeature.utils.cjs","names":["flattenBy","constructCell"],"sources":["../../../src/core/rows/coreRowsFeature.utils.ts"],"sourcesContent":["import { flattenBy } from '../../utils'\nimport { constructCell } from '../cells/constructCell'\nimport type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\n\n/**\n * Reads and caches this row's value for a column.\n *\n * The value is produced by the column accessor. Missing columns or display\n * columns without an accessor return `undefined`.\n *\n * @example\n * ```ts\n * const firstName = row_getValue(row, 'firstName')\n * ```\n */\nexport function row_getValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._valuesCache.hasOwnProperty(columnId)) {\n return row._valuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n row._valuesCache[columnId] = column.accessorFn(row.original, row.index)\n\n return row._valuesCache[columnId]\n}\n\n/**\n * Reads and caches the values used by faceting/grouping for a column.\n *\n * If the column defines `getUniqueValues`, that result is used. Otherwise the\n * row's accessor value is wrapped in a single-item array.\n *\n * @example\n * ```ts\n * const values = row_getUniqueValues(row, 'tags')\n * ```\n */\nexport function row_getUniqueValues<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._uniqueValuesCache.hasOwnProperty(columnId)) {\n return row._uniqueValuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n if (!column.columnDef.getUniqueValues) {\n row._uniqueValuesCache[columnId] = [row.getValue(columnId)]\n return row._uniqueValuesCache[columnId]\n }\n\n row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(\n row.original,\n row.index,\n )\n\n return row._uniqueValuesCache[columnId]\n}\n\n/**\n * Returns a renderable row value for a column.\n *\n * If the accessor value is nullish, the table's `renderFallbackValue` is used\n * instead.\n *\n * @example\n * ```ts\n * const value = row_renderValue(row, 'firstName')\n * ```\n */\nexport function row_renderValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n return row.getValue(columnId) ?? row.table.options.renderFallbackValue\n}\n\n/**\n * Flattens this row's descendant tree into leaf rows.\n *\n * The row itself is not included; only nested `subRows` are walked.\n *\n * @example\n * ```ts\n * const descendants = row_getLeafRows(row)\n * ```\n */\nexport function row_getLeafRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return flattenBy(row.subRows, (d) => d.subRows)\n}\n\n/**\n * Looks up this row's direct parent, if it has one.\n *\n * Parent lookup searches the pre-pagination row model so parent relationships\n * are available even when the parent is not on the current page.\n *\n * @example\n * ```ts\n * const parent = row_getParentRow(row)\n * ```\n */\nexport function row_getParentRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n return row.parentId ? row.table.getRow(row.parentId, true) : undefined\n}\n\n/**\n * Collects this row's ancestor chain from root to direct parent.\n *\n * The current row is not included. Rows without a parent return an empty array.\n *\n * @example\n * ```ts\n * const ancestors = row_getParentRows(row)\n * ```\n */\nexport function row_getParentRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const parentRows: Array<Row<TFeatures, TData>> = []\n let currentRow = row\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const parentRow = currentRow.getParentRow()\n if (!parentRow) break\n parentRows.push(parentRow)\n currentRow = parentRow\n }\n return parentRows.reverse()\n}\n\n/**\n * Constructs one cell for each leaf column in this row.\n *\n * The result follows `table.getAllLeafColumns()` order and includes hidden\n * columns; visibility-specific APIs filter this list later.\n *\n * @example\n * ```ts\n * const cells = row_getAllCells(row)\n * ```\n */\nexport function row_getAllCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {\n const columns = row.table.getAllLeafColumns()\n const cells: Array<Cell<TFeatures, TData, unknown>> = new Array(\n columns.length,\n )\n for (let i = 0; i < columns.length; i++) {\n cells[i] = constructCell(columns[i]!, row, row.table)\n }\n return cells\n}\n\n/**\n * Builds a lookup map of this row's cells keyed by column id.\n *\n * This is the static implementation behind `row.getAllCellsByColumnId()`.\n *\n * @example\n * ```ts\n * const cellsById = row_getAllCellsByColumnId(row)\n * ```\n */\nexport function row_getAllCellsByColumnId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const result: Record<string, Cell<TFeatures, TData, unknown>> = {}\n const cells = row.getAllCells()\n for (let i = 0; i < cells.length; i++) {\n const cell = cells[i]!\n result[cell.column.id] = cell\n }\n return result\n}\n\n/**\n * Resolves the stable id for a row.\n *\n * `options.getRowId` wins when provided. Otherwise root rows use their index\n * and child rows append their index to the parent id, such as `0.2`.\n *\n * @example\n * ```ts\n * const id = table_getRowId(originalRow, table, index, parentRow)\n * ```\n */\nexport function table_getRowId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n originalRow: TData,\n table: Table_Internal<TFeatures, TData>,\n index: number,\n parent?: Row<TFeatures, TData>,\n) {\n return (\n table.options.getRowId?.(originalRow, index, parent) ??\n `${parent ? [parent.id, index].join('.') : index}`\n )\n}\n\n/**\n * Looks up a row by id from the current or full row model.\n *\n * By default this searches `table.getRowModel()`. Passing `searchAll` searches\n * the pre-pagination model first, then falls back to the core model.\n *\n * @example\n * ```ts\n * const row = table_getRow(table, rowId, true)\n * ```\n */\nexport function table_getRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n rowId: string,\n searchAll?: boolean,\n): Row<TFeatures, TData> {\n // TODO - simplify this across different row models\n let row = (searchAll ? table.getPrePaginatedRowModel() : table.getRowModel())\n .rowsById[rowId]\n\n if (!row) {\n row = table.getCoreRowModel().rowsById[rowId]\n if (!row) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(`getRow could not find row with ID: ${rowId}`)\n }\n throw new Error()\n }\n }\n\n return row\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,aAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,aAAa,eAAe,SAAS,EAC3C,OAAO,IAAI,aAAa;CAG1B,MAAM,SAAS,IAAI,MAAM,UAAU,SAAS;CAE5C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,aAAa,YAAY,OAAO,WAAW,IAAI,UAAU,IAAI,MAAM;CAEvE,OAAO,IAAI,aAAa;;;;;;;;;;;;;AAc1B,SAAgB,oBAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,mBAAmB,eAAe,SAAS,EACjD,OAAO,IAAI,mBAAmB;CAGhC,MAAM,SAAS,IAAI,MAAM,UAAU,SAAS;CAE5C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,CAAC,OAAO,UAAU,iBAAiB;EACrC,IAAI,mBAAmB,YAAY,CAAC,IAAI,SAAS,SAAS,CAAC;EAC3D,OAAO,IAAI,mBAAmB;;CAGhC,IAAI,mBAAmB,YAAY,OAAO,UAAU,gBAClD,IAAI,UACJ,IAAI,MACL;CAED,OAAO,IAAI,mBAAmB;;;;;;;;;;;;;AAchC,SAAgB,gBAGd,KAA4B,UAAkB;CAC9C,OAAO,IAAI,SAAS,SAAS,IAAI,IAAI,MAAM,QAAQ;;;;;;;;;;;;AAarD,SAAgB,gBAGd,KAA0D;CAC1D,OAAOA,wBAAU,IAAI,UAAU,MAAM,EAAE,QAAQ;;;;;;;;;;;;;AAcjD,SAAgB,iBAGd,KAA4B;CAC5B,OAAO,IAAI,WAAW,IAAI,MAAM,OAAO,IAAI,UAAU,KAAK,GAAG;;;;;;;;;;;;AAa/D,SAAgB,kBAGd,KAA4B;CAC5B,MAAM,aAA2C,EAAE;CACnD,IAAI,aAAa;CAEjB,OAAO,MAAM;EACX,MAAM,YAAY,WAAW,cAAc;EAC3C,IAAI,CAAC,WAAW;EAChB,WAAW,KAAK,UAAU;EAC1B,aAAa;;CAEf,OAAO,WAAW,SAAS;;;;;;;;;;;;;AAc7B,SAAgB,gBAGd,KAAoE;CACpE,MAAM,UAAU,IAAI,MAAM,mBAAmB;CAC7C,MAAM,QAAgD,IAAI,MACxD,QAAQ,OACT;CACD,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAClC,MAAM,KAAKC,oCAAc,QAAQ,IAAK,KAAK,IAAI,MAAM;CAEvD,OAAO;;;;;;;;;;;;AAaT,SAAgB,0BAGd,KAA4B;CAC5B,MAAM,SAA0D,EAAE;CAClE,MAAM,QAAQ,IAAI,aAAa;CAC/B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,OAAO,MAAM;EACnB,OAAO,KAAK,OAAO,MAAM;;CAE3B,OAAO;;;;;;;;;;;;;AAcT,SAAgB,eAId,aACA,OACA,OACA,QACA;;CACA,mDACE,MAAM,SAAQ,6GAAW,aAAa,OAAO,OAAO,KACpD,GAAG,SAAS,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,IAAI,GAAG;;;;;;;;;;;;;AAe/C,SAAgB,aAId,OACA,OACA,WACuB;CAEvB,IAAI,OAAO,YAAY,MAAM,yBAAyB,GAAG,MAAM,aAAa,EACzE,SAAS;CAEZ,IAAI,CAAC,KAAK;EACR,MAAM,MAAM,iBAAiB,CAAC,SAAS;EACvC,IAAI,CAAC,KAAK;GACR,IAAI,QAAQ,IAAI,aAAa,eAC3B,MAAM,IAAI,MAAM,sCAAsC,QAAQ;GAEhE,MAAM,IAAI,OAAO;;;CAIrB,OAAO"}
|
|
@@ -6,24 +6,26 @@ import { Cell } from "../../types/Cell.cjs";
|
|
|
6
6
|
|
|
7
7
|
//#region src/core/rows/coreRowsFeature.utils.d.ts
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Reads and caches this row's value for a column.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* The value is produced by the column accessor. Missing columns or display
|
|
12
|
+
* columns without an accessor return `undefined`.
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```ts
|
|
15
|
-
* const
|
|
16
|
+
* const firstName = row_getValue(row, 'firstName')
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
19
|
declare function row_getValue<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string): unknown;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Reads and caches the values used by faceting/grouping for a column.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
+
* If the column defines `getUniqueValues`, that result is used. Otherwise the
|
|
24
|
+
* row's accessor value is wrapped in a single-item array.
|
|
23
25
|
*
|
|
24
26
|
* @example
|
|
25
27
|
* ```ts
|
|
26
|
-
* const
|
|
28
|
+
* const values = row_getUniqueValues(row, 'tags')
|
|
27
29
|
* ```
|
|
28
30
|
*/
|
|
29
31
|
declare function row_getUniqueValues<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string): unknown;
|
|
@@ -35,84 +37,88 @@ declare function row_getUniqueValues<TFeatures extends TableFeatures, TData exte
|
|
|
35
37
|
*
|
|
36
38
|
* @example
|
|
37
39
|
* ```ts
|
|
38
|
-
* const value = row_renderValue(row)
|
|
40
|
+
* const value = row_renderValue(row, 'firstName')
|
|
39
41
|
* ```
|
|
40
42
|
*/
|
|
41
43
|
declare function row_renderValue<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string): any;
|
|
42
44
|
/**
|
|
43
|
-
*
|
|
45
|
+
* Flattens this row's descendant tree into leaf rows.
|
|
44
46
|
*
|
|
45
|
-
*
|
|
47
|
+
* The row itself is not included; only nested `subRows` are walked.
|
|
46
48
|
*
|
|
47
49
|
* @example
|
|
48
50
|
* ```ts
|
|
49
|
-
* const
|
|
51
|
+
* const descendants = row_getLeafRows(row)
|
|
50
52
|
* ```
|
|
51
53
|
*/
|
|
52
54
|
declare function row_getLeafRows<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Array<Row<TFeatures, TData>>;
|
|
53
55
|
/**
|
|
54
|
-
*
|
|
56
|
+
* Looks up this row's direct parent, if it has one.
|
|
55
57
|
*
|
|
56
|
-
*
|
|
58
|
+
* Parent lookup searches the pre-pagination row model so parent relationships
|
|
59
|
+
* are available even when the parent is not on the current page.
|
|
57
60
|
*
|
|
58
61
|
* @example
|
|
59
62
|
* ```ts
|
|
60
|
-
* const
|
|
63
|
+
* const parent = row_getParentRow(row)
|
|
61
64
|
* ```
|
|
62
65
|
*/
|
|
63
66
|
declare function row_getParentRow<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Row<TFeatures, TData> | undefined;
|
|
64
67
|
/**
|
|
65
|
-
*
|
|
68
|
+
* Collects this row's ancestor chain from root to direct parent.
|
|
66
69
|
*
|
|
67
|
-
*
|
|
70
|
+
* The current row is not included. Rows without a parent return an empty array.
|
|
68
71
|
*
|
|
69
72
|
* @example
|
|
70
73
|
* ```ts
|
|
71
|
-
* const
|
|
74
|
+
* const ancestors = row_getParentRows(row)
|
|
72
75
|
* ```
|
|
73
76
|
*/
|
|
74
77
|
declare function row_getParentRows<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Row<TFeatures, TData>[];
|
|
75
78
|
/**
|
|
76
|
-
*
|
|
79
|
+
* Constructs one cell for each leaf column in this row.
|
|
77
80
|
*
|
|
78
|
-
*
|
|
81
|
+
* The result follows `table.getAllLeafColumns()` order and includes hidden
|
|
82
|
+
* columns; visibility-specific APIs filter this list later.
|
|
79
83
|
*
|
|
80
84
|
* @example
|
|
81
85
|
* ```ts
|
|
82
|
-
* const
|
|
86
|
+
* const cells = row_getAllCells(row)
|
|
83
87
|
* ```
|
|
84
88
|
*/
|
|
85
89
|
declare function row_getAllCells<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>>;
|
|
86
90
|
/**
|
|
87
|
-
*
|
|
91
|
+
* Builds a lookup map of this row's cells keyed by column id.
|
|
88
92
|
*
|
|
89
|
-
* This is the static implementation behind
|
|
93
|
+
* This is the static implementation behind `row.getAllCellsByColumnId()`.
|
|
90
94
|
*
|
|
91
95
|
* @example
|
|
92
96
|
* ```ts
|
|
93
|
-
* const
|
|
97
|
+
* const cellsById = row_getAllCellsByColumnId(row)
|
|
94
98
|
* ```
|
|
95
99
|
*/
|
|
96
100
|
declare function row_getAllCellsByColumnId<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Record<string, Cell<TFeatures, TData, unknown>>;
|
|
97
101
|
/**
|
|
98
|
-
*
|
|
102
|
+
* Resolves the stable id for a row.
|
|
99
103
|
*
|
|
100
|
-
*
|
|
104
|
+
* `options.getRowId` wins when provided. Otherwise root rows use their index
|
|
105
|
+
* and child rows append their index to the parent id, such as `0.2`.
|
|
101
106
|
*
|
|
102
107
|
* @example
|
|
103
108
|
* ```ts
|
|
104
|
-
* const
|
|
109
|
+
* const id = table_getRowId(originalRow, table, index, parentRow)
|
|
105
110
|
* ```
|
|
106
111
|
*/
|
|
107
112
|
declare function table_getRowId<TFeatures extends TableFeatures, TData extends RowData>(originalRow: TData, table: Table_Internal<TFeatures, TData>, index: number, parent?: Row<TFeatures, TData>): string;
|
|
108
113
|
/**
|
|
109
|
-
*
|
|
114
|
+
* Looks up a row by id from the current or full row model.
|
|
110
115
|
*
|
|
111
|
-
*
|
|
116
|
+
* By default this searches `table.getRowModel()`. Passing `searchAll` searches
|
|
117
|
+
* the pre-pagination model first, then falls back to the core model.
|
|
112
118
|
*
|
|
113
119
|
* @example
|
|
114
120
|
* ```ts
|
|
115
|
-
* const
|
|
121
|
+
* const row = table_getRow(table, rowId, true)
|
|
116
122
|
* ```
|
|
117
123
|
*/
|
|
118
124
|
declare function table_getRow<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, rowId: string, searchAll?: boolean): Row<TFeatures, TData>;
|
|
@@ -6,24 +6,26 @@ import { Cell } from "../../types/Cell.js";
|
|
|
6
6
|
|
|
7
7
|
//#region src/core/rows/coreRowsFeature.utils.d.ts
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Reads and caches this row's value for a column.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* The value is produced by the column accessor. Missing columns or display
|
|
12
|
+
* columns without an accessor return `undefined`.
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```ts
|
|
15
|
-
* const
|
|
16
|
+
* const firstName = row_getValue(row, 'firstName')
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
19
|
declare function row_getValue<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string): unknown;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Reads and caches the values used by faceting/grouping for a column.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
+
* If the column defines `getUniqueValues`, that result is used. Otherwise the
|
|
24
|
+
* row's accessor value is wrapped in a single-item array.
|
|
23
25
|
*
|
|
24
26
|
* @example
|
|
25
27
|
* ```ts
|
|
26
|
-
* const
|
|
28
|
+
* const values = row_getUniqueValues(row, 'tags')
|
|
27
29
|
* ```
|
|
28
30
|
*/
|
|
29
31
|
declare function row_getUniqueValues<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string): unknown;
|
|
@@ -35,84 +37,88 @@ declare function row_getUniqueValues<TFeatures extends TableFeatures, TData exte
|
|
|
35
37
|
*
|
|
36
38
|
* @example
|
|
37
39
|
* ```ts
|
|
38
|
-
* const value = row_renderValue(row)
|
|
40
|
+
* const value = row_renderValue(row, 'firstName')
|
|
39
41
|
* ```
|
|
40
42
|
*/
|
|
41
43
|
declare function row_renderValue<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string): any;
|
|
42
44
|
/**
|
|
43
|
-
*
|
|
45
|
+
* Flattens this row's descendant tree into leaf rows.
|
|
44
46
|
*
|
|
45
|
-
*
|
|
47
|
+
* The row itself is not included; only nested `subRows` are walked.
|
|
46
48
|
*
|
|
47
49
|
* @example
|
|
48
50
|
* ```ts
|
|
49
|
-
* const
|
|
51
|
+
* const descendants = row_getLeafRows(row)
|
|
50
52
|
* ```
|
|
51
53
|
*/
|
|
52
54
|
declare function row_getLeafRows<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Array<Row<TFeatures, TData>>;
|
|
53
55
|
/**
|
|
54
|
-
*
|
|
56
|
+
* Looks up this row's direct parent, if it has one.
|
|
55
57
|
*
|
|
56
|
-
*
|
|
58
|
+
* Parent lookup searches the pre-pagination row model so parent relationships
|
|
59
|
+
* are available even when the parent is not on the current page.
|
|
57
60
|
*
|
|
58
61
|
* @example
|
|
59
62
|
* ```ts
|
|
60
|
-
* const
|
|
63
|
+
* const parent = row_getParentRow(row)
|
|
61
64
|
* ```
|
|
62
65
|
*/
|
|
63
66
|
declare function row_getParentRow<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Row<TFeatures, TData> | undefined;
|
|
64
67
|
/**
|
|
65
|
-
*
|
|
68
|
+
* Collects this row's ancestor chain from root to direct parent.
|
|
66
69
|
*
|
|
67
|
-
*
|
|
70
|
+
* The current row is not included. Rows without a parent return an empty array.
|
|
68
71
|
*
|
|
69
72
|
* @example
|
|
70
73
|
* ```ts
|
|
71
|
-
* const
|
|
74
|
+
* const ancestors = row_getParentRows(row)
|
|
72
75
|
* ```
|
|
73
76
|
*/
|
|
74
77
|
declare function row_getParentRows<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Row<TFeatures, TData>[];
|
|
75
78
|
/**
|
|
76
|
-
*
|
|
79
|
+
* Constructs one cell for each leaf column in this row.
|
|
77
80
|
*
|
|
78
|
-
*
|
|
81
|
+
* The result follows `table.getAllLeafColumns()` order and includes hidden
|
|
82
|
+
* columns; visibility-specific APIs filter this list later.
|
|
79
83
|
*
|
|
80
84
|
* @example
|
|
81
85
|
* ```ts
|
|
82
|
-
* const
|
|
86
|
+
* const cells = row_getAllCells(row)
|
|
83
87
|
* ```
|
|
84
88
|
*/
|
|
85
89
|
declare function row_getAllCells<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>>;
|
|
86
90
|
/**
|
|
87
|
-
*
|
|
91
|
+
* Builds a lookup map of this row's cells keyed by column id.
|
|
88
92
|
*
|
|
89
|
-
* This is the static implementation behind
|
|
93
|
+
* This is the static implementation behind `row.getAllCellsByColumnId()`.
|
|
90
94
|
*
|
|
91
95
|
* @example
|
|
92
96
|
* ```ts
|
|
93
|
-
* const
|
|
97
|
+
* const cellsById = row_getAllCellsByColumnId(row)
|
|
94
98
|
* ```
|
|
95
99
|
*/
|
|
96
100
|
declare function row_getAllCellsByColumnId<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Record<string, Cell<TFeatures, TData, unknown>>;
|
|
97
101
|
/**
|
|
98
|
-
*
|
|
102
|
+
* Resolves the stable id for a row.
|
|
99
103
|
*
|
|
100
|
-
*
|
|
104
|
+
* `options.getRowId` wins when provided. Otherwise root rows use their index
|
|
105
|
+
* and child rows append their index to the parent id, such as `0.2`.
|
|
101
106
|
*
|
|
102
107
|
* @example
|
|
103
108
|
* ```ts
|
|
104
|
-
* const
|
|
109
|
+
* const id = table_getRowId(originalRow, table, index, parentRow)
|
|
105
110
|
* ```
|
|
106
111
|
*/
|
|
107
112
|
declare function table_getRowId<TFeatures extends TableFeatures, TData extends RowData>(originalRow: TData, table: Table_Internal<TFeatures, TData>, index: number, parent?: Row<TFeatures, TData>): string;
|
|
108
113
|
/**
|
|
109
|
-
*
|
|
114
|
+
* Looks up a row by id from the current or full row model.
|
|
110
115
|
*
|
|
111
|
-
*
|
|
116
|
+
* By default this searches `table.getRowModel()`. Passing `searchAll` searches
|
|
117
|
+
* the pre-pagination model first, then falls back to the core model.
|
|
112
118
|
*
|
|
113
119
|
* @example
|
|
114
120
|
* ```ts
|
|
115
|
-
* const
|
|
121
|
+
* const row = table_getRow(table, rowId, true)
|
|
116
122
|
* ```
|
|
117
123
|
*/
|
|
118
124
|
declare function table_getRow<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, rowId: string, searchAll?: boolean): Row<TFeatures, TData>;
|