@tanstack/table-core 9.0.0-beta.7 → 9.0.0-beta.70
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 +5 -1
- package/dist/core/cells/constructCell.d.ts +4 -6
- package/dist/core/cells/constructCell.js +4 -6
- package/dist/core/cells/coreCellsFeature.d.ts +1 -3
- package/dist/core/cells/coreCellsFeature.js +1 -2
- package/dist/core/cells/coreCellsFeature.types.d.ts +7 -9
- package/dist/core/cells/coreCellsFeature.utils.d.ts +5 -5
- package/dist/core/cells/coreCellsFeature.utils.js +1 -2
- package/dist/core/columns/constructColumn.d.ts +4 -6
- package/dist/core/columns/constructColumn.js +8 -9
- package/dist/core/columns/coreColumnsFeature.d.ts +1 -3
- package/dist/core/columns/coreColumnsFeature.js +13 -20
- package/dist/core/columns/coreColumnsFeature.types.d.ts +13 -15
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +10 -12
- package/dist/core/columns/coreColumnsFeature.utils.js +19 -20
- package/dist/core/coreFeatures.d.ts +3 -3
- package/dist/core/coreFeatures.js +1 -2
- package/dist/core/headers/buildHeaderGroups.d.ts +3 -5
- package/dist/core/headers/buildHeaderGroups.js +99 -85
- package/dist/core/headers/constructHeader.d.ts +3 -5
- package/dist/core/headers/constructHeader.js +4 -6
- package/dist/core/headers/coreHeadersFeature.d.ts +1 -3
- package/dist/core/headers/coreHeadersFeature.js +9 -13
- package/dist/core/headers/coreHeadersFeature.types.d.ts +21 -11
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +8 -8
- package/dist/core/headers/coreHeadersFeature.utils.js +14 -17
- package/dist/core/reactivity/coreReactivityFeature.types.d.ts +8 -3
- package/dist/core/reactivity/coreReactivityFeature.utils.d.ts +1 -3
- package/dist/core/reactivity/coreReactivityFeature.utils.js +1 -2
- package/dist/core/reactivity/renderPhaseReactivity.d.ts +80 -0
- package/dist/core/reactivity/renderPhaseReactivity.js +95 -0
- package/dist/core/row-models/coreRowModelsFeature.d.ts +1 -3
- package/dist/core/row-models/coreRowModelsFeature.js +1 -2
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +7 -17
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +17 -19
- package/dist/core/row-models/coreRowModelsFeature.utils.js +9 -28
- package/dist/core/row-models/createCoreRowModel.d.ts +3 -5
- package/dist/core/row-models/createCoreRowModel.js +25 -24
- package/dist/core/rows/constructRow.d.ts +3 -5
- package/dist/core/rows/constructRow.js +9 -13
- package/dist/core/rows/coreRowsFeature.d.ts +1 -3
- package/dist/core/rows/coreRowsFeature.js +20 -5
- package/dist/core/rows/coreRowsFeature.types.d.ts +42 -10
- package/dist/core/rows/coreRowsFeature.utils.d.ts +26 -9
- package/dist/core/rows/coreRowsFeature.utils.js +65 -14
- package/dist/core/table/constructTable.d.ts +2 -4
- package/dist/core/table/constructTable.js +52 -23
- package/dist/core/table/coreTablesFeature.d.ts +1 -3
- package/dist/core/table/coreTablesFeature.js +1 -2
- package/dist/core/table/coreTablesFeature.types.d.ts +56 -25
- package/dist/core/table/coreTablesFeature.utils.d.ts +34 -12
- package/dist/core/table/coreTablesFeature.utils.js +69 -24
- package/dist/experimental-worker-plugin.d.ts +5 -0
- package/dist/experimental-worker-plugin.js +6 -0
- package/dist/features/cell-selection/cellSelectionFeature.d.ts +8 -0
- package/dist/features/cell-selection/cellSelectionFeature.js +128 -0
- package/dist/features/cell-selection/cellSelectionFeature.types.d.ts +296 -0
- package/dist/features/cell-selection/cellSelectionFeature.utils.d.ts +306 -0
- package/dist/features/cell-selection/cellSelectionFeature.utils.js +873 -0
- package/dist/features/cell-selection/cellSelectionGeometry.js +121 -0
- package/dist/features/cell-spanning/cellSpanningFeature.d.ts +13 -0
- package/dist/features/cell-spanning/cellSpanningFeature.js +47 -0
- package/dist/features/cell-spanning/cellSpanningFeature.types.d.ts +150 -0
- package/dist/features/cell-spanning/cellSpanningFeature.utils.d.ts +74 -0
- package/dist/features/cell-spanning/cellSpanningFeature.utils.js +262 -0
- package/dist/features/column-faceting/columnFacetingFeature.d.ts +1 -3
- package/dist/features/column-faceting/columnFacetingFeature.js +13 -20
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +15 -35
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +10 -12
- package/dist/features/column-faceting/columnFacetingFeature.utils.js +25 -14
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +2 -4
- package/dist/features/column-faceting/createFacetedMinMaxValues.js +9 -7
- package/dist/features/column-faceting/createFacetedRowModel.d.ts +3 -5
- package/dist/features/column-faceting/createFacetedRowModel.js +12 -17
- package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +2 -4
- package/dist/features/column-faceting/createFacetedUniqueValues.js +12 -9
- package/dist/features/column-filtering/columnFilteringFeature.d.ts +1 -3
- package/dist/features/column-filtering/columnFilteringFeature.js +4 -5
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +85 -33
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +19 -17
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +33 -21
- package/dist/features/column-filtering/createFilteredRowModel.d.ts +11 -7
- package/dist/features/column-filtering/createFilteredRowModel.js +33 -29
- package/dist/features/column-filtering/filterFns.d.ts +208 -0
- package/dist/features/column-filtering/filterFns.js +374 -0
- package/dist/features/column-filtering/filterRowsUtils.js +4 -4
- package/dist/features/column-grouping/columnGroupingFeature.d.ts +2 -4
- package/dist/features/column-grouping/columnGroupingFeature.js +7 -20
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +14 -52
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +12 -51
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +8 -61
- package/dist/features/column-grouping/createGroupedRowModel.d.ts +7 -7
- package/dist/features/column-grouping/createGroupedRowModel.js +69 -38
- package/dist/features/column-ordering/columnOrderingFeature.d.ts +1 -3
- package/dist/features/column-ordering/columnOrderingFeature.js +19 -24
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +28 -5
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +26 -16
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +36 -18
- package/dist/features/column-pinning/columnPinningFeature.d.ts +7 -4
- package/dist/features/column-pinning/columnPinningFeature.js +126 -146
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +53 -44
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +100 -93
- package/dist/features/column-pinning/columnPinningFeature.utils.js +148 -150
- package/dist/features/column-resizing/columnResizingFeature.d.ts +1 -3
- package/dist/features/column-resizing/columnResizingFeature.js +1 -2
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +2 -7
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +7 -9
- package/dist/features/column-resizing/columnResizingFeature.utils.js +86 -48
- package/dist/features/column-sizing/columnSizingFeature.d.ts +1 -3
- package/dist/features/column-sizing/columnSizingFeature.js +35 -70
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +52 -11
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +43 -27
- package/dist/features/column-sizing/columnSizingFeature.utils.js +95 -54
- package/dist/features/column-visibility/columnVisibilityFeature.d.ts +1 -3
- package/dist/features/column-visibility/columnVisibilityFeature.js +26 -38
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +4 -6
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +20 -20
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +32 -32
- package/dist/features/global-filtering/globalFilteringFeature.d.ts +1 -3
- package/dist/features/global-filtering/globalFilteringFeature.js +3 -4
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +4 -6
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +10 -13
- package/dist/features/global-filtering/globalFilteringFeature.utils.js +7 -8
- package/dist/features/row-aggregation/aggregationFns.d.ts +66 -0
- package/dist/features/row-aggregation/aggregationFns.js +279 -0
- package/dist/features/row-aggregation/rowAggregationFeature.d.ts +8 -0
- package/dist/features/row-aggregation/rowAggregationFeature.js +35 -0
- package/dist/features/row-aggregation/rowAggregationFeature.types.d.ts +193 -0
- package/dist/features/row-aggregation/rowAggregationFeature.types.js +11 -0
- package/dist/features/row-aggregation/rowAggregationFeature.utils.d.ts +46 -0
- package/dist/features/row-aggregation/rowAggregationFeature.utils.js +235 -0
- package/dist/features/row-expanding/createExpandedRowModel.d.ts +3 -5
- package/dist/features/row-expanding/createExpandedRowModel.js +9 -13
- package/dist/features/row-expanding/rowExpandingFeature.d.ts +1 -3
- package/dist/features/row-expanding/rowExpandingFeature.js +1 -2
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +6 -17
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +11 -16
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +30 -33
- package/dist/features/row-pagination/createPaginatedRowModel.d.ts +3 -5
- package/dist/features/row-pagination/createPaginatedRowModel.js +7 -12
- package/dist/features/row-pagination/rowPaginationFeature.d.ts +1 -3
- package/dist/features/row-pagination/rowPaginationFeature.js +1 -2
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +5 -16
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +18 -20
- package/dist/features/row-pagination/rowPaginationFeature.utils.js +10 -17
- package/dist/features/row-pinning/rowPinningFeature.d.ts +1 -3
- package/dist/features/row-pinning/rowPinningFeature.js +5 -18
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +3 -5
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +8 -10
- package/dist/features/row-pinning/rowPinningFeature.utils.js +10 -16
- package/dist/features/row-selection/rowSelectionFeature.d.ts +1 -3
- package/dist/features/row-selection/rowSelectionFeature.js +68 -25
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +51 -15
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +60 -35
- package/dist/features/row-selection/rowSelectionFeature.utils.js +142 -89
- package/dist/features/row-sorting/createSortedRowModel.d.ts +11 -7
- package/dist/features/row-sorting/createSortedRowModel.js +71 -53
- package/dist/features/row-sorting/rowSortingFeature.d.ts +1 -3
- package/dist/features/row-sorting/rowSortingFeature.js +1 -2
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +54 -24
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +19 -22
- package/dist/features/row-sorting/rowSortingFeature.utils.js +36 -25
- package/dist/features/row-sorting/sortFns.d.ts +96 -0
- package/dist/features/row-sorting/sortFns.js +216 -0
- package/dist/features/stockFeatures.d.ts +7 -3
- package/dist/features/stockFeatures.js +7 -2
- package/dist/flex-render.d.ts +2 -4
- package/dist/flex-render.js +10 -3
- package/dist/helpers/columnHelper.d.ts +3 -5
- package/dist/helpers/columnHelper.js +1 -2
- package/dist/helpers/metaHelper.d.ts +25 -0
- package/dist/helpers/metaHelper.js +28 -0
- package/dist/helpers/tableFeatures.d.ts +35 -8
- package/dist/helpers/tableFeatures.js +33 -5
- package/dist/helpers/tableOptions.d.ts +1 -3
- package/dist/helpers/tableOptions.js +1 -2
- package/dist/index.d.ts +34 -27
- package/dist/index.js +10 -5
- package/dist/reactivity.d.ts +2 -1
- package/dist/reactivity.js +2 -1
- package/dist/static-functions.d.ts +11 -8
- package/dist/static-functions.js +11 -8
- package/dist/store-reactivity-bindings.d.ts +2 -4
- package/dist/store-reactivity-bindings.js +4 -5
- package/dist/types/Cell.d.ts +9 -5
- package/dist/types/Column.d.ts +13 -15
- package/dist/types/ColumnDef.d.ts +39 -21
- package/dist/types/Header.d.ts +3 -5
- package/dist/types/HeaderGroup.d.ts +3 -5
- package/dist/types/Row.d.ts +7 -7
- package/dist/types/RowModel.d.ts +11 -25
- package/dist/types/RowModelFns.d.ts +5 -7
- package/dist/types/Table.d.ts +29 -32
- package/dist/types/TableFeatures.d.ts +388 -24
- package/dist/types/TableOptions.d.ts +24 -14
- package/dist/types/TableState.d.ts +8 -8
- package/dist/types/type-utils.d.ts +10 -4
- package/dist/utils.d.ts +32 -26
- package/dist/utils.js +52 -32
- package/dist/worker/createTableWorker.d.ts +100 -0
- package/dist/worker/createTableWorker.js +185 -0
- package/dist/worker/createWorkerRowModel.d.ts +40 -0
- package/dist/worker/createWorkerRowModel.js +77 -0
- package/dist/worker/initTableWorker.d.ts +31 -0
- package/dist/worker/initTableWorker.js +99 -0
- package/dist/worker/rebuildRowModel.d.ts +11 -0
- package/dist/worker/rebuildRowModel.js +71 -0
- package/dist/worker/serializeRowModel.js +51 -0
- package/dist/worker/tableWorkerProtocol.d.ts +88 -0
- package/dist/worker/tableWorkerProtocol.js +26 -0
- package/package.json +12 -28
- package/skills/aggregation/SKILL.md +141 -0
- package/skills/api-not-found/SKILL.md +113 -0
- package/skills/cell-selection/SKILL.md +204 -0
- package/skills/cell-spanning/SKILL.md +162 -0
- package/skills/client-vs-server/SKILL.md +164 -0
- package/skills/column-faceting/SKILL.md +97 -0
- package/skills/column-filtering/SKILL.md +87 -0
- package/skills/column-ordering/SKILL.md +75 -0
- package/skills/column-pinning/SKILL.md +89 -0
- package/skills/column-resizing/SKILL.md +91 -0
- package/skills/column-sizing/SKILL.md +72 -0
- package/skills/column-visibility/SKILL.md +75 -0
- package/skills/core/SKILL.md +175 -0
- package/skills/custom-features/SKILL.md +235 -0
- package/skills/expanding/SKILL.md +80 -0
- package/skills/global-filtering/SKILL.md +84 -0
- package/skills/grouping/SKILL.md +51 -401
- package/skills/migrate-v8-to-v9/SKILL.md +275 -416
- package/skills/pagination/SKILL.md +37 -344
- package/skills/row-pinning/SKILL.md +47 -234
- package/skills/row-selection/SKILL.md +75 -302
- package/skills/sorting/SKILL.md +45 -303
- package/skills/table-features/SKILL.md +159 -0
- package/skills/typescript/SKILL.md +126 -0
- package/dist/core/cells/constructCell.cjs +0 -34
- package/dist/core/cells/constructCell.cjs.map +0 -1
- package/dist/core/cells/constructCell.d.cts +0 -17
- package/dist/core/cells/constructCell.js.map +0 -1
- package/dist/core/cells/coreCellsFeature.cjs +0 -21
- package/dist/core/cells/coreCellsFeature.cjs.map +0 -1
- package/dist/core/cells/coreCellsFeature.d.cts +0 -10
- package/dist/core/cells/coreCellsFeature.js.map +0 -1
- package/dist/core/cells/coreCellsFeature.types.d.cts +0 -57
- package/dist/core/cells/coreCellsFeature.utils.cjs +0 -57
- package/dist/core/cells/coreCellsFeature.utils.cjs.map +0 -1
- package/dist/core/cells/coreCellsFeature.utils.d.cts +0 -53
- package/dist/core/cells/coreCellsFeature.utils.js.map +0 -1
- package/dist/core/columns/constructColumn.cjs +0 -61
- package/dist/core/columns/constructColumn.cjs.map +0 -1
- package/dist/core/columns/constructColumn.d.cts +0 -16
- package/dist/core/columns/constructColumn.js.map +0 -1
- package/dist/core/columns/coreColumnsFeature.cjs +0 -70
- package/dist/core/columns/coreColumnsFeature.cjs.map +0 -1
- package/dist/core/columns/coreColumnsFeature.d.cts +0 -10
- package/dist/core/columns/coreColumnsFeature.js.map +0 -1
- package/dist/core/columns/coreColumnsFeature.types.d.cts +0 -94
- package/dist/core/columns/coreColumnsFeature.utils.cjs +0 -187
- package/dist/core/columns/coreColumnsFeature.utils.cjs.map +0 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +0 -119
- package/dist/core/columns/coreColumnsFeature.utils.js.map +0 -1
- package/dist/core/coreFeatures.cjs +0 -25
- package/dist/core/coreFeatures.cjs.map +0 -1
- package/dist/core/coreFeatures.d.cts +0 -26
- package/dist/core/coreFeatures.js.map +0 -1
- package/dist/core/headers/buildHeaderGroups.cjs +0 -103
- package/dist/core/headers/buildHeaderGroups.cjs.map +0 -1
- package/dist/core/headers/buildHeaderGroups.d.cts +0 -16
- package/dist/core/headers/buildHeaderGroups.js.map +0 -1
- package/dist/core/headers/constructHeader.cjs +0 -41
- package/dist/core/headers/constructHeader.cjs.map +0 -1
- package/dist/core/headers/constructHeader.d.cts +0 -22
- package/dist/core/headers/constructHeader.js.map +0 -1
- package/dist/core/headers/coreHeadersFeature.cjs +0 -55
- package/dist/core/headers/coreHeadersFeature.cjs.map +0 -1
- package/dist/core/headers/coreHeadersFeature.d.cts +0 -10
- package/dist/core/headers/coreHeadersFeature.js.map +0 -1
- package/dist/core/headers/coreHeadersFeature.types.d.cts +0 -106
- package/dist/core/headers/coreHeadersFeature.utils.cjs +0 -142
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +0 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +0 -85
- package/dist/core/headers/coreHeadersFeature.utils.js.map +0 -1
- package/dist/core/reactivity/coreReactivityFeature.types.d.cts +0 -48
- package/dist/core/reactivity/coreReactivityFeature.utils.cjs +0 -24
- package/dist/core/reactivity/coreReactivityFeature.utils.cjs.map +0 -1
- package/dist/core/reactivity/coreReactivityFeature.utils.d.cts +0 -24
- package/dist/core/reactivity/coreReactivityFeature.utils.js.map +0 -1
- package/dist/core/row-models/coreRowModelsFeature.cjs +0 -27
- package/dist/core/row-models/coreRowModelsFeature.cjs.map +0 -1
- package/dist/core/row-models/coreRowModelsFeature.d.cts +0 -10
- package/dist/core/row-models/coreRowModelsFeature.js.map +0 -1
- package/dist/core/row-models/coreRowModelsFeature.types.d.cts +0 -41
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs +0 -215
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +0 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +0 -153
- package/dist/core/row-models/coreRowModelsFeature.utils.js.map +0 -1
- package/dist/core/row-models/createCoreRowModel.cjs +0 -52
- package/dist/core/row-models/createCoreRowModel.cjs.map +0 -1
- package/dist/core/row-models/createCoreRowModel.d.cts +0 -15
- package/dist/core/row-models/createCoreRowModel.js.map +0 -1
- package/dist/core/rows/constructRow.cjs +0 -44
- package/dist/core/rows/constructRow.cjs.map +0 -1
- package/dist/core/rows/constructRow.d.cts +0 -15
- package/dist/core/rows/constructRow.js.map +0 -1
- package/dist/core/rows/coreRowsFeature.cjs +0 -37
- package/dist/core/rows/coreRowsFeature.cjs.map +0 -1
- package/dist/core/rows/coreRowsFeature.d.cts +0 -10
- package/dist/core/rows/coreRowsFeature.js.map +0 -1
- package/dist/core/rows/coreRowsFeature.types.d.cts +0 -99
- package/dist/core/rows/coreRowsFeature.utils.cjs +0 -192
- package/dist/core/rows/coreRowsFeature.utils.cjs.map +0 -1
- package/dist/core/rows/coreRowsFeature.utils.d.cts +0 -127
- package/dist/core/rows/coreRowsFeature.utils.js.map +0 -1
- package/dist/core/table/constructTable.cjs +0 -118
- package/dist/core/table/constructTable.cjs.map +0 -1
- package/dist/core/table/constructTable.d.cts +0 -22
- package/dist/core/table/constructTable.js.map +0 -1
- package/dist/core/table/coreTablesFeature.cjs +0 -17
- package/dist/core/table/coreTablesFeature.cjs.map +0 -1
- package/dist/core/table/coreTablesFeature.d.cts +0 -10
- package/dist/core/table/coreTablesFeature.js.map +0 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +0 -186
- package/dist/core/table/coreTablesFeature.utils.cjs +0 -96
- package/dist/core/table/coreTablesFeature.utils.cjs.map +0 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +0 -57
- package/dist/core/table/coreTablesFeature.utils.js.map +0 -1
- package/dist/features/column-faceting/columnFacetingFeature.cjs +0 -61
- package/dist/features/column-faceting/columnFacetingFeature.cjs.map +0 -1
- package/dist/features/column-faceting/columnFacetingFeature.d.cts +0 -10
- package/dist/features/column-faceting/columnFacetingFeature.js.map +0 -1
- package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +0 -85
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +0 -103
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +0 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +0 -84
- package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +0 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs +0 -44
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +0 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +0 -14
- package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +0 -1
- package/dist/features/column-faceting/createFacetedRowModel.cjs +0 -50
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +0 -1
- package/dist/features/column-faceting/createFacetedRowModel.d.cts +0 -15
- package/dist/features/column-faceting/createFacetedRowModel.js.map +0 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs +0 -41
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +0 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +0 -14
- package/dist/features/column-faceting/createFacetedUniqueValues.js.map +0 -1
- package/dist/features/column-filtering/columnFilteringFeature.cjs +0 -50
- package/dist/features/column-filtering/columnFilteringFeature.cjs.map +0 -1
- package/dist/features/column-filtering/columnFilteringFeature.d.cts +0 -10
- package/dist/features/column-filtering/columnFilteringFeature.js.map +0 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +0 -160
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +0 -212
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +0 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +0 -143
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +0 -1
- package/dist/features/column-filtering/createFilteredRowModel.cjs +0 -110
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +0 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.cts +0 -16
- package/dist/features/column-filtering/createFilteredRowModel.js.map +0 -1
- package/dist/features/column-filtering/filterRowsUtils.cjs +0 -81
- package/dist/features/column-filtering/filterRowsUtils.cjs.map +0 -1
- package/dist/features/column-filtering/filterRowsUtils.js.map +0 -1
- package/dist/features/column-grouping/columnGroupingFeature.cjs +0 -67
- package/dist/features/column-grouping/columnGroupingFeature.cjs.map +0 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.cts +0 -10
- package/dist/features/column-grouping/columnGroupingFeature.js.map +0 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +0 -165
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +0 -250
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +0 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +0 -190
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +0 -1
- package/dist/features/column-grouping/createGroupedRowModel.cjs +0 -119
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +0 -1
- package/dist/features/column-grouping/createGroupedRowModel.d.cts +0 -16
- package/dist/features/column-grouping/createGroupedRowModel.js.map +0 -1
- package/dist/features/column-ordering/columnOrderingFeature.cjs +0 -58
- package/dist/features/column-ordering/columnOrderingFeature.cjs.map +0 -1
- package/dist/features/column-ordering/columnOrderingFeature.d.cts +0 -10
- package/dist/features/column-ordering/columnOrderingFeature.js.map +0 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +0 -56
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +0 -172
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +0 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +0 -107
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +0 -1
- package/dist/features/column-pinning/columnPinningFeature.cjs +0 -221
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +0 -1
- package/dist/features/column-pinning/columnPinningFeature.d.cts +0 -10
- package/dist/features/column-pinning/columnPinningFeature.js.map +0 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +0 -178
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +0 -585
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +0 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +0 -375
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +0 -1
- package/dist/features/column-resizing/columnResizingFeature.cjs +0 -41
- package/dist/features/column-resizing/columnResizingFeature.cjs.map +0 -1
- package/dist/features/column-resizing/columnResizingFeature.d.cts +0 -10
- package/dist/features/column-resizing/columnResizingFeature.js.map +0 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +0 -81
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +0 -246
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +0 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +0 -109
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +0 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +0 -124
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +0 -1
- package/dist/features/column-sizing/columnSizingFeature.d.cts +0 -10
- package/dist/features/column-sizing/columnSizingFeature.js.map +0 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +0 -96
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +0 -256
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +0 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +0 -182
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +0 -1
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +0 -94
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +0 -1
- package/dist/features/column-visibility/columnVisibilityFeature.d.cts +0 -10
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +0 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +0 -97
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +0 -283
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +0 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +0 -189
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +0 -1
- package/dist/features/global-filtering/globalFilteringFeature.cjs +0 -41
- package/dist/features/global-filtering/globalFilteringFeature.cjs.map +0 -1
- package/dist/features/global-filtering/globalFilteringFeature.d.cts +0 -10
- package/dist/features/global-filtering/globalFilteringFeature.js.map +0 -1
- package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +0 -71
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +0 -88
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +0 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +0 -74
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +0 -1
- package/dist/features/row-expanding/createExpandedRowModel.cjs +0 -59
- package/dist/features/row-expanding/createExpandedRowModel.cjs.map +0 -1
- package/dist/features/row-expanding/createExpandedRowModel.d.cts +0 -21
- package/dist/features/row-expanding/createExpandedRowModel.js.map +0 -1
- package/dist/features/row-expanding/rowExpandingFeature.cjs +0 -47
- package/dist/features/row-expanding/rowExpandingFeature.cjs.map +0 -1
- package/dist/features/row-expanding/rowExpandingFeature.d.cts +0 -10
- package/dist/features/row-expanding/rowExpandingFeature.js.map +0 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +0 -127
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +0 -281
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +0 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +0 -191
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +0 -1
- package/dist/features/row-pagination/createPaginatedRowModel.cjs +0 -62
- package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +0 -1
- package/dist/features/row-pagination/createPaginatedRowModel.d.cts +0 -15
- package/dist/features/row-pagination/createPaginatedRowModel.js.map +0 -1
- package/dist/features/row-pagination/rowPaginationFeature.cjs +0 -45
- package/dist/features/row-pagination/rowPaginationFeature.cjs.map +0 -1
- package/dist/features/row-pagination/rowPaginationFeature.d.cts +0 -10
- package/dist/features/row-pagination/rowPaginationFeature.js.map +0 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +0 -135
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +0 -312
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +0 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +0 -218
- package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +0 -1
- package/dist/features/row-pinning/rowPinningFeature.cjs +0 -67
- package/dist/features/row-pinning/rowPinningFeature.cjs.map +0 -1
- package/dist/features/row-pinning/rowPinningFeature.d.cts +0 -10
- package/dist/features/row-pinning/rowPinningFeature.js.map +0 -1
- package/dist/features/row-pinning/rowPinningFeature.types.d.cts +0 -83
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +0 -229
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +0 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +0 -143
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +0 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs +0 -75
- package/dist/features/row-selection/rowSelectionFeature.cjs.map +0 -1
- package/dist/features/row-selection/rowSelectionFeature.d.cts +0 -10
- package/dist/features/row-selection/rowSelectionFeature.js.map +0 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +0 -136
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +0 -514
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +0 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +0 -318
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +0 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs +0 -95
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +0 -1
- package/dist/features/row-sorting/createSortedRowModel.d.cts +0 -16
- package/dist/features/row-sorting/createSortedRowModel.js.map +0 -1
- package/dist/features/row-sorting/rowSortingFeature.cjs +0 -55
- package/dist/features/row-sorting/rowSortingFeature.cjs.map +0 -1
- package/dist/features/row-sorting/rowSortingFeature.d.cts +0 -10
- package/dist/features/row-sorting/rowSortingFeature.js.map +0 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +0 -188
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +0 -305
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +0 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +0 -193
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +0 -1
- package/dist/features/stockFeatures.cjs +0 -41
- package/dist/features/stockFeatures.cjs.map +0 -1
- package/dist/features/stockFeatures.d.cts +0 -41
- package/dist/features/stockFeatures.js.map +0 -1
- package/dist/flex-render.cjs +0 -29
- package/dist/flex-render.cjs.map +0 -1
- package/dist/flex-render.d.cts +0 -34
- package/dist/flex-render.js.map +0 -1
- package/dist/fns/aggregationFns.cjs +0 -161
- package/dist/fns/aggregationFns.cjs.map +0 -1
- package/dist/fns/aggregationFns.d.cts +0 -85
- package/dist/fns/aggregationFns.d.ts +0 -85
- package/dist/fns/aggregationFns.js +0 -151
- package/dist/fns/aggregationFns.js.map +0 -1
- package/dist/fns/filterFns.cjs +0 -201
- package/dist/fns/filterFns.cjs.map +0 -1
- package/dist/fns/filterFns.d.cts +0 -167
- package/dist/fns/filterFns.d.ts +0 -167
- package/dist/fns/filterFns.js +0 -185
- package/dist/fns/filterFns.js.map +0 -1
- package/dist/fns/sortFns.cjs +0 -130
- package/dist/fns/sortFns.cjs.map +0 -1
- package/dist/fns/sortFns.d.cts +0 -65
- package/dist/fns/sortFns.d.ts +0 -65
- package/dist/fns/sortFns.js +0 -122
- package/dist/fns/sortFns.js.map +0 -1
- package/dist/helpers/columnHelper.cjs +0 -41
- package/dist/helpers/columnHelper.cjs.map +0 -1
- package/dist/helpers/columnHelper.d.cts +0 -71
- package/dist/helpers/columnHelper.js.map +0 -1
- package/dist/helpers/tableFeatures.cjs +0 -20
- package/dist/helpers/tableFeatures.cjs.map +0 -1
- package/dist/helpers/tableFeatures.d.cts +0 -18
- package/dist/helpers/tableFeatures.js.map +0 -1
- package/dist/helpers/tableOptions.cjs +0 -15
- package/dist/helpers/tableOptions.cjs.map +0 -1
- package/dist/helpers/tableOptions.d.cts +0 -57
- package/dist/helpers/tableOptions.js.map +0 -1
- package/dist/index.cjs +0 -133
- package/dist/index.d.cts +0 -78
- package/dist/reactivity.cjs +0 -4
- package/dist/reactivity.d.cts +0 -3
- package/dist/static-functions.cjs +0 -263
- package/dist/static-functions.d.cts +0 -21
- package/dist/store-reactivity-bindings.cjs +0 -44
- package/dist/store-reactivity-bindings.cjs.map +0 -1
- package/dist/store-reactivity-bindings.d.cts +0 -22
- package/dist/store-reactivity-bindings.js.map +0 -1
- package/dist/types/Cell.d.cts +0 -14
- package/dist/types/Column.d.cts +0 -36
- package/dist/types/ColumnDef.d.cts +0 -109
- package/dist/types/Header.d.cts +0 -16
- package/dist/types/HeaderGroup.d.cts +0 -10
- package/dist/types/Row.d.cts +0 -26
- package/dist/types/RowModel.d.cts +0 -36
- package/dist/types/RowModelFns.d.cts +0 -18
- package/dist/types/Table.d.cts +0 -70
- package/dist/types/TableFeatures.d.cts +0 -53
- package/dist/types/TableOptions.d.cts +0 -69
- package/dist/types/TableState.d.cts +0 -48
- package/dist/types/type-utils.d.cts +0 -23
- package/dist/utils.cjs +0 -243
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.d.cts +0 -114
- package/dist/utils.js.map +0 -1
- package/skills/column-definitions/SKILL.md +0 -333
- package/skills/column-layout/SKILL.md +0 -328
- package/skills/column-layout/references/subsystems.md +0 -220
- package/skills/customizing-feature-behavior/SKILL.md +0 -416
- package/skills/filtering/SKILL.md +0 -357
- package/skills/filtering/references/faceting-and-fuzzy.md +0 -191
- package/skills/row-expanding/SKILL.md +0 -348
- package/skills/setup/SKILL.md +0 -400
- package/skills/state-management/SKILL.md +0 -388
- package/src/core/cells/constructCell.ts +0 -55
- package/src/core/cells/coreCellsFeature.ts +0 -27
- package/src/core/cells/coreCellsFeature.types.ts +0 -68
- package/src/core/cells/coreCellsFeature.utils.ts +0 -68
- package/src/core/columns/constructColumn.ts +0 -119
- package/src/core/columns/coreColumnsFeature.ts +0 -73
- package/src/core/columns/coreColumnsFeature.types.ts +0 -108
- package/src/core/columns/coreColumnsFeature.utils.ts +0 -275
- package/src/core/coreFeatures.ts +0 -31
- package/src/core/headers/buildHeaderGroups.ts +0 -182
- package/src/core/headers/constructHeader.ts +0 -67
- package/src/core/headers/coreHeadersFeature.ts +0 -56
- package/src/core/headers/coreHeadersFeature.types.ts +0 -125
- package/src/core/headers/coreHeadersFeature.utils.ts +0 -200
- package/src/core/reactivity/coreReactivityFeature.types.ts +0 -56
- package/src/core/reactivity/coreReactivityFeature.utils.ts +0 -44
- package/src/core/row-models/coreRowModelsFeature.ts +0 -62
- package/src/core/row-models/coreRowModelsFeature.types.ts +0 -64
- package/src/core/row-models/coreRowModelsFeature.utils.ts +0 -272
- package/src/core/row-models/createCoreRowModel.ts +0 -93
- package/src/core/rows/constructRow.ts +0 -66
- package/src/core/rows/coreRowsFeature.ts +0 -62
- package/src/core/rows/coreRowsFeature.types.ts +0 -117
- package/src/core/rows/coreRowsFeature.utils.ts +0 -264
- package/src/core/table/constructTable.ts +0 -172
- package/src/core/table/coreTablesFeature.ts +0 -19
- package/src/core/table/coreTablesFeature.types.ts +0 -216
- package/src/core/table/coreTablesFeature.utils.ts +0 -131
- package/src/features/column-faceting/columnFacetingFeature.ts +0 -89
- package/src/features/column-faceting/columnFacetingFeature.types.ts +0 -109
- package/src/features/column-faceting/columnFacetingFeature.utils.ts +0 -145
- package/src/features/column-faceting/createFacetedMinMaxValues.ts +0 -66
- package/src/features/column-faceting/createFacetedRowModel.ts +0 -85
- package/src/features/column-faceting/createFacetedUniqueValues.ts +0 -66
- package/src/features/column-filtering/columnFilteringFeature.ts +0 -86
- package/src/features/column-filtering/columnFilteringFeature.types.ts +0 -232
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +0 -331
- package/src/features/column-filtering/createFilteredRowModel.ts +0 -183
- package/src/features/column-filtering/filterRowsUtils.ts +0 -157
- package/src/features/column-grouping/columnGroupingFeature.ts +0 -115
- package/src/features/column-grouping/columnGroupingFeature.types.ts +0 -226
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +0 -354
- package/src/features/column-grouping/createGroupedRowModel.ts +0 -220
- package/src/features/column-ordering/columnOrderingFeature.ts +0 -73
- package/src/features/column-ordering/columnOrderingFeature.types.ts +0 -60
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +0 -241
- package/src/features/column-pinning/columnPinningFeature.ts +0 -316
- package/src/features/column-pinning/columnPinningFeature.types.ts +0 -192
- package/src/features/column-pinning/columnPinningFeature.utils.ts +0 -908
- package/src/features/column-resizing/columnResizingFeature.ts +0 -65
- package/src/features/column-resizing/columnResizingFeature.types.ts +0 -89
- package/src/features/column-resizing/columnResizingFeature.utils.ts +0 -364
- package/src/features/column-sizing/columnSizingFeature.ts +0 -145
- package/src/features/column-sizing/columnSizingFeature.types.ts +0 -102
- package/src/features/column-sizing/columnSizingFeature.utils.ts +0 -381
- package/src/features/column-visibility/columnVisibilityFeature.ts +0 -122
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +0 -112
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +0 -384
- package/src/features/global-filtering/globalFilteringFeature.ts +0 -65
- package/src/features/global-filtering/globalFilteringFeature.types.ts +0 -91
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +0 -118
- package/src/features/row-expanding/createExpandedRowModel.ts +0 -82
- package/src/features/row-expanding/rowExpandingFeature.ts +0 -94
- package/src/features/row-expanding/rowExpandingFeature.types.ts +0 -147
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +0 -374
- package/src/features/row-pagination/createPaginatedRowModel.ts +0 -83
- package/src/features/row-pagination/rowPaginationFeature.ts +0 -95
- package/src/features/row-pagination/rowPaginationFeature.types.ts +0 -152
- package/src/features/row-pagination/rowPaginationFeature.utils.ts +0 -400
- package/src/features/row-pinning/rowPinningFeature.ts +0 -97
- package/src/features/row-pinning/rowPinningFeature.types.ts +0 -95
- package/src/features/row-pinning/rowPinningFeature.utils.ts +0 -323
- package/src/features/row-selection/rowSelectionFeature.ts +0 -140
- package/src/features/row-selection/rowSelectionFeature.types.ts +0 -151
- package/src/features/row-selection/rowSelectionFeature.utils.ts +0 -745
- package/src/features/row-sorting/createSortedRowModel.ts +0 -157
- package/src/features/row-sorting/rowSortingFeature.ts +0 -103
- package/src/features/row-sorting/rowSortingFeature.types.ts +0 -235
- package/src/features/row-sorting/rowSortingFeature.utils.ts +0 -489
- package/src/features/stockFeatures.ts +0 -53
- package/src/flex-render.ts +0 -70
- package/src/fns/aggregationFns.ts +0 -245
- package/src/fns/filterFns.ts +0 -382
- package/src/fns/sortFns.ts +0 -240
- package/src/helpers/columnHelper.ts +0 -122
- package/src/helpers/tableFeatures.ts +0 -24
- package/src/helpers/tableOptions.ts +0 -117
- package/src/index.ts +0 -138
- package/src/process-env.d.ts +0 -6
- package/src/reactivity.ts +0 -2
- package/src/static-functions.ts +0 -31
- package/src/store-reactivity-bindings.ts +0 -47
- package/src/types/Cell.ts +0 -21
- package/src/types/Column.ts +0 -51
- package/src/types/ColumnDef.ts +0 -228
- package/src/types/Header.ts +0 -23
- package/src/types/HeaderGroup.ts +0 -13
- package/src/types/Row.ts +0 -34
- package/src/types/RowModel.ts +0 -98
- package/src/types/RowModelFns.ts +0 -32
- package/src/types/Table.ts +0 -91
- package/src/types/TableFeatures.ts +0 -101
- package/src/types/TableOptions.ts +0 -101
- package/src/types/TableState.ts +0 -47
- package/src/types/type-utils.ts +0 -84
- package/src/utils.ts +0 -441
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
const require_utils = require('../../utils.cjs');
|
|
2
|
-
const require_columnOrderingFeature_utils = require('../../features/column-ordering/columnOrderingFeature.utils.cjs');
|
|
3
|
-
const require_constructColumn = require('./constructColumn.cjs');
|
|
4
|
-
|
|
5
|
-
//#region src/core/columns/coreColumnsFeature.utils.ts
|
|
6
|
-
/**
|
|
7
|
-
* Flattens this column and every descendant column into a single array.
|
|
8
|
-
*
|
|
9
|
-
* Group columns appear before their child columns, which matches the normalized
|
|
10
|
-
* column hierarchy produced during table construction.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const flatColumns = column_getFlatColumns(column)
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
function column_getFlatColumns(column) {
|
|
18
|
-
return [column, ...column.columns.flatMap((col) => col.getFlatColumns())];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Collects the terminal leaf columns below this column.
|
|
22
|
-
*
|
|
23
|
-
* Group columns return their ordered descendants. Non-group columns return an
|
|
24
|
-
* array containing only the column itself.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const leafColumns = column_getLeafColumns(column)
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
function column_getLeafColumns(column) {
|
|
32
|
-
if (column.columns.length) {
|
|
33
|
-
const leafColumns = column.columns.flatMap((col) => col.getLeafColumns());
|
|
34
|
-
return require_utils.callMemoOrStaticFn(column.table, "getOrderColumns", require_columnOrderingFeature_utils.table_getOrderColumnsFn)(leafColumns);
|
|
35
|
-
}
|
|
36
|
-
return [column];
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Merges built-in, feature, and user default column definitions.
|
|
40
|
-
*
|
|
41
|
-
* Built-in defaults provide a header and fallback cell renderer, feature
|
|
42
|
-
* defaults can add feature-specific column options, and
|
|
43
|
-
* `options.defaultColumn` wins last.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```ts
|
|
47
|
-
* const defaultColumn = table_getDefaultColumnDef(table)
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
function table_getDefaultColumnDef(table) {
|
|
51
|
-
return {
|
|
52
|
-
header: (props) => {
|
|
53
|
-
const resolvedColumnDef = props.header.column.columnDef;
|
|
54
|
-
if (resolvedColumnDef.accessorKey) return resolvedColumnDef.accessorKey;
|
|
55
|
-
if (resolvedColumnDef.accessorFn) return resolvedColumnDef.id;
|
|
56
|
-
return null;
|
|
57
|
-
},
|
|
58
|
-
cell: (props) => {
|
|
59
|
-
var _props$renderValue, _props$renderValue$to;
|
|
60
|
-
return ((_props$renderValue = props.renderValue()) === null || _props$renderValue === void 0 || (_props$renderValue$to = _props$renderValue.toString) === null || _props$renderValue$to === void 0 ? void 0 : _props$renderValue$to.call(_props$renderValue)) ?? null;
|
|
61
|
-
},
|
|
62
|
-
...Object.values(table._features).reduce((obj, feature) => {
|
|
63
|
-
var _feature$getDefaultCo;
|
|
64
|
-
return Object.assign(obj, (_feature$getDefaultCo = feature.getDefaultColumnDef) === null || _feature$getDefaultCo === void 0 ? void 0 : _feature$getDefaultCo.call(feature));
|
|
65
|
-
}, {}),
|
|
66
|
-
...table.options.defaultColumn
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Normalizes `options.columns` into the table's nested column tree.
|
|
71
|
-
*
|
|
72
|
-
* Each column definition is constructed with its parent and depth, and group
|
|
73
|
-
* column children are recursively constructed.
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* ```ts
|
|
77
|
-
* const columns = table_getAllColumns(table)
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
function table_getAllColumns(table) {
|
|
81
|
-
const recurseColumns = (colDefs, parent, depth = 0) => {
|
|
82
|
-
return colDefs.map((columnDef) => {
|
|
83
|
-
const column = require_constructColumn.constructColumn(table, columnDef, depth, parent);
|
|
84
|
-
const groupingColumnDef = columnDef;
|
|
85
|
-
column.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column, depth + 1) : [];
|
|
86
|
-
return column;
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
return recurseColumns(table.options.columns);
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Flattens every table column, including group columns and leaf columns.
|
|
93
|
-
*
|
|
94
|
-
* Use this when parent/group columns must be included in addition to data leaf
|
|
95
|
-
* columns.
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```ts
|
|
99
|
-
* const flatColumns = table_getAllFlatColumns(table)
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
function table_getAllFlatColumns(table) {
|
|
103
|
-
return table.getAllColumns().flatMap((column) => column.getFlatColumns());
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Builds an id lookup for every flat column in the table.
|
|
107
|
-
*
|
|
108
|
-
* Group columns and leaf columns are included. Later columns with the same id
|
|
109
|
-
* replace earlier entries.
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* ```ts
|
|
113
|
-
* const columnsById = table_getAllFlatColumnsById(table)
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
function table_getAllFlatColumnsById(table) {
|
|
117
|
-
const result = {};
|
|
118
|
-
const flatColumns = table.getAllFlatColumns();
|
|
119
|
-
for (let i = 0; i < flatColumns.length; i++) {
|
|
120
|
-
const column = flatColumns[i];
|
|
121
|
-
result[column.id] = column;
|
|
122
|
-
}
|
|
123
|
-
return result;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Collects all terminal leaf columns in their current table order.
|
|
127
|
-
*
|
|
128
|
-
* Column ordering features can reorder the collected leaves before the result
|
|
129
|
-
* is returned.
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* ```ts
|
|
133
|
-
* const leafColumns = table_getAllLeafColumns(table)
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
function table_getAllLeafColumns(table) {
|
|
137
|
-
const leafColumns = table.getAllColumns().flatMap((c) => c.getLeafColumns());
|
|
138
|
-
return require_utils.callMemoOrStaticFn(table, "getOrderColumns", require_columnOrderingFeature_utils.table_getOrderColumnsFn)(leafColumns);
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Builds an id lookup for terminal leaf columns only.
|
|
142
|
-
*
|
|
143
|
-
* Parent/group columns are excluded, making this lookup appropriate for row
|
|
144
|
-
* cells and feature state keyed by data columns.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* const leavesById = table_getAllLeafColumnsById(table)
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
151
|
-
function table_getAllLeafColumnsById(table) {
|
|
152
|
-
const result = {};
|
|
153
|
-
const leafColumns = table.getAllLeafColumns();
|
|
154
|
-
for (let i = 0; i < leafColumns.length; i++) {
|
|
155
|
-
const column = leafColumns[i];
|
|
156
|
-
result[column.id] = column;
|
|
157
|
-
}
|
|
158
|
-
return result;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Looks up a column by id from the flat column map.
|
|
162
|
-
*
|
|
163
|
-
* The lookup can return group columns or leaf columns. In development, a
|
|
164
|
-
* missing id logs a warning to help catch stale column references.
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```ts
|
|
168
|
-
* const column = table_getColumn(table, 'firstName')
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
|
-
function table_getColumn(table, columnId) {
|
|
172
|
-
const column = table.getAllFlatColumnsById()[columnId];
|
|
173
|
-
if (process.env.NODE_ENV === "development" && !column) console.warn(`[Table] Column with id '${columnId}' does not exist.`);
|
|
174
|
-
return column;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
//#endregion
|
|
178
|
-
exports.column_getFlatColumns = column_getFlatColumns;
|
|
179
|
-
exports.column_getLeafColumns = column_getLeafColumns;
|
|
180
|
-
exports.table_getAllColumns = table_getAllColumns;
|
|
181
|
-
exports.table_getAllFlatColumns = table_getAllFlatColumns;
|
|
182
|
-
exports.table_getAllFlatColumnsById = table_getAllFlatColumnsById;
|
|
183
|
-
exports.table_getAllLeafColumns = table_getAllLeafColumns;
|
|
184
|
-
exports.table_getAllLeafColumnsById = table_getAllLeafColumnsById;
|
|
185
|
-
exports.table_getColumn = table_getColumn;
|
|
186
|
-
exports.table_getDefaultColumnDef = table_getDefaultColumnDef;
|
|
187
|
-
//# sourceMappingURL=coreColumnsFeature.utils.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreColumnsFeature.utils.cjs","names":["callMemoOrStaticFn","table_getOrderColumnsFn","constructColumn"],"sources":["../../../src/core/columns/coreColumnsFeature.utils.ts"],"sourcesContent":["import { callMemoOrStaticFn } from '../../utils'\nimport { table_getOrderColumnsFn } from '../../features/column-ordering/columnOrderingFeature.utils'\nimport { constructColumn } from './constructColumn'\nimport type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type {\n ColumnDef,\n ColumnDefResolved,\n GroupColumnDef,\n} from '../../types/ColumnDef'\nimport type { Column } from '../../types/Column'\n\n/**\n * Flattens this column and every descendant column into a single array.\n *\n * Group columns appear before their child columns, which matches the normalized\n * column hierarchy produced during table construction.\n *\n * @example\n * ```ts\n * const flatColumns = column_getFlatColumns(column)\n * ```\n */\nexport function column_getFlatColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n column: Column<TFeatures, TData, TValue>,\n): Array<Column<TFeatures, TData, TValue>> {\n return [column, ...column.columns.flatMap((col) => col.getFlatColumns())]\n}\n\n/**\n * Collects the terminal leaf columns below this column.\n *\n * Group columns return their ordered descendants. Non-group columns return an\n * array containing only the column itself.\n *\n * @example\n * ```ts\n * const leafColumns = column_getLeafColumns(column)\n * ```\n */\nexport function column_getLeafColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n column: Column<TFeatures, TData, TValue>,\n): Array<Column<TFeatures, TData, TValue>> {\n if (column.columns.length) {\n const leafColumns = column.columns.flatMap(\n (col) => col.getLeafColumns(), // recursive\n )\n\n return callMemoOrStaticFn(\n column.table,\n 'getOrderColumns',\n table_getOrderColumnsFn,\n )(leafColumns as any) as any\n }\n\n return [column]\n}\n\n/**\n * Merges built-in, feature, and user default column definitions.\n *\n * Built-in defaults provide a header and fallback cell renderer, feature\n * defaults can add feature-specific column options, and\n * `options.defaultColumn` wins last.\n *\n * @example\n * ```ts\n * const defaultColumn = table_getDefaultColumnDef(table)\n * ```\n */\nexport function table_getDefaultColumnDef<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Partial<ColumnDef<TFeatures, TData, unknown>> {\n return {\n header: (props) => {\n const resolvedColumnDef = props.header.column\n .columnDef as ColumnDefResolved<{}, TData>\n\n if (resolvedColumnDef.accessorKey) {\n return resolvedColumnDef.accessorKey\n }\n\n if (resolvedColumnDef.accessorFn) {\n return resolvedColumnDef.id\n }\n\n return null\n },\n cell: (props) => props.renderValue<any>()?.toString?.() ?? null,\n ...Object.values(table._features).reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultColumnDef?.())\n }, {}),\n ...table.options.defaultColumn,\n } as Partial<ColumnDef<TFeatures, TData, unknown>>\n}\n\n/**\n * Normalizes `options.columns` into the table's nested column tree.\n *\n * Each column definition is constructed with its parent and depth, and group\n * column children are recursively constructed.\n *\n * @example\n * ```ts\n * const columns = table_getAllColumns(table)\n * ```\n */\nexport function table_getAllColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Array<Column<TFeatures, TData, unknown>> {\n const recurseColumns = (\n colDefs: ReadonlyArray<ColumnDef<TFeatures, TData, unknown>>,\n parent?: Column<TFeatures, TData, unknown>,\n depth = 0,\n ): Array<Column<TFeatures, TData, unknown>> => {\n return colDefs.map((columnDef) => {\n const column = constructColumn(table, columnDef, depth, parent)\n\n const groupingColumnDef = columnDef as GroupColumnDef<\n TFeatures,\n TData,\n unknown\n >\n\n column.columns = groupingColumnDef.columns\n ? recurseColumns(groupingColumnDef.columns, column, depth + 1)\n : []\n\n return column\n })\n }\n\n return recurseColumns(table.options.columns)\n}\n\n/**\n * Flattens every table column, including group columns and leaf columns.\n *\n * Use this when parent/group columns must be included in addition to data leaf\n * columns.\n *\n * @example\n * ```ts\n * const flatColumns = table_getAllFlatColumns(table)\n * ```\n */\nexport function table_getAllFlatColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Array<Column<TFeatures, TData, unknown>> {\n return table.getAllColumns().flatMap((column) => column.getFlatColumns())\n}\n\n/**\n * Builds an id lookup for every flat column in the table.\n *\n * Group columns and leaf columns are included. Later columns with the same id\n * replace earlier entries.\n *\n * @example\n * ```ts\n * const columnsById = table_getAllFlatColumnsById(table)\n * ```\n */\nexport function table_getAllFlatColumnsById<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Record<string, Column<TFeatures, TData, unknown>> {\n const result: Record<string, Column<TFeatures, TData, unknown>> = {}\n const flatColumns = table.getAllFlatColumns()\n for (let i = 0; i < flatColumns.length; i++) {\n const column = flatColumns[i]!\n result[column.id] = column\n }\n return result\n}\n\n/**\n * Collects all terminal leaf columns in their current table order.\n *\n * Column ordering features can reorder the collected leaves before the result\n * is returned.\n *\n * @example\n * ```ts\n * const leafColumns = table_getAllLeafColumns(table)\n * ```\n */\nexport function table_getAllLeafColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Array<Column<TFeatures, TData, unknown>> {\n const leafColumns = table.getAllColumns().flatMap(\n (c) => c.getLeafColumns(), // recursive\n )\n return callMemoOrStaticFn(\n table,\n 'getOrderColumns',\n table_getOrderColumnsFn,\n )(leafColumns)\n}\n\n/**\n * Builds an id lookup for terminal leaf columns only.\n *\n * Parent/group columns are excluded, making this lookup appropriate for row\n * cells and feature state keyed by data columns.\n *\n * @example\n * ```ts\n * const leavesById = table_getAllLeafColumnsById(table)\n * ```\n */\nexport function table_getAllLeafColumnsById<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Record<string, Column<TFeatures, TData, unknown>> {\n const result: Record<string, Column<TFeatures, TData, unknown>> = {}\n const leafColumns = table.getAllLeafColumns()\n for (let i = 0; i < leafColumns.length; i++) {\n const column = leafColumns[i]!\n result[column.id] = column\n }\n return result\n}\n\n/**\n * Looks up a column by id from the flat column map.\n *\n * The lookup can return group columns or leaf columns. In development, a\n * missing id logs a warning to help catch stale column references.\n *\n * @example\n * ```ts\n * const column = table_getColumn(table, 'firstName')\n * ```\n */\nexport function table_getColumn<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n columnId: string,\n): Column<TFeatures, TData, unknown> | undefined {\n const column = table.getAllFlatColumnsById()[columnId]\n\n if (process.env.NODE_ENV === 'development' && !column) {\n console.warn(`[Table] Column with id '${columnId}' does not exist.`)\n }\n\n return column\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,SAAgB,sBAKd,QACyC;CACzC,OAAO,CAAC,QAAQ,GAAG,OAAO,QAAQ,SAAS,QAAQ,IAAI,eAAe,CAAC,CAAC;AAC1E;;;;;;;;;;;;AAaA,SAAgB,sBAKd,QACyC;CACzC,IAAI,OAAO,QAAQ,QAAQ;EACzB,MAAM,cAAc,OAAO,QAAQ,SAChC,QAAQ,IAAI,eAAe,CAC9B;EAEA,OAAOA,iCACL,OAAO,OACP,mBACAC,2DACF,CAAC,CAAC,WAAkB;CACtB;CAEA,OAAO,CAAC,MAAM;AAChB;;;;;;;;;;;;;AAcA,SAAgB,0BAId,OAC+C;CAC/C,OAAO;EACL,SAAS,UAAU;GACjB,MAAM,oBAAoB,MAAM,OAAO,OACpC;GAEH,IAAI,kBAAkB,aACpB,OAAO,kBAAkB;GAG3B,IAAI,kBAAkB,YACpB,OAAO,kBAAkB;GAG3B,OAAO;EACT;EACA,OAAO,UAAU;;uCAAM,YAAiB,4FAAG,+GAAW,MAAK;EAAG;EAC9D,GAAG,OAAO,OAAO,MAAM,SAAS,CAAC,CAAC,QAAQ,KAAK,YAAY;;GACzD,OAAO,OAAO,OAAO,8BAAK,QAAQ,+GAAsB,CAAC;EAC3D,GAAG,CAAC,CAAC;EACL,GAAG,MAAM,QAAQ;CACnB;AACF;;;;;;;;;;;;AAaA,SAAgB,oBAId,OAC0C;CAC1C,MAAM,kBACJ,SACA,QACA,QAAQ,MACqC;EAC7C,OAAO,QAAQ,KAAK,cAAc;GAChC,MAAM,SAASC,wCAAgB,OAAO,WAAW,OAAO,MAAM;GAE9D,MAAM,oBAAoB;GAM1B,OAAO,UAAU,kBAAkB,UAC/B,eAAe,kBAAkB,SAAS,QAAQ,QAAQ,CAAC,IAC3D,CAAC;GAEL,OAAO;EACT,CAAC;CACH;CAEA,OAAO,eAAe,MAAM,QAAQ,OAAO;AAC7C;;;;;;;;;;;;AAaA,SAAgB,wBAId,OAC0C;CAC1C,OAAO,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,OAAO,eAAe,CAAC;AAC1E;;;;;;;;;;;;AAaA,SAAgB,4BAId,OACmD;CACnD,MAAM,SAA4D,CAAC;CACnE,MAAM,cAAc,MAAM,kBAAkB;CAC5C,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;EAC3C,MAAM,SAAS,YAAY;EAC3B,OAAO,OAAO,MAAM;CACtB;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,wBAId,OAC0C;CAC1C,MAAM,cAAc,MAAM,cAAc,CAAC,CAAC,SACvC,MAAM,EAAE,eAAe,CAC1B;CACA,OAAOF,iCACL,OACA,mBACAC,2DACF,CAAC,CAAC,WAAW;AACf;;;;;;;;;;;;AAaA,SAAgB,4BAId,OACmD;CACnD,MAAM,SAA4D,CAAC;CACnE,MAAM,cAAc,MAAM,kBAAkB;CAC5C,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;EAC3C,MAAM,SAAS,YAAY;EAC3B,OAAO,OAAO,MAAM;CACtB;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,gBAId,OACA,UAC+C;CAC/C,MAAM,SAAS,MAAM,sBAAsB,CAAC,CAAC;CAE7C,IAAI,QAAQ,IAAI,aAAa,iBAAiB,CAAC,QAC7C,QAAQ,KAAK,2BAA2B,SAAS,kBAAkB;CAGrE,OAAO;AACT"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { CellData, RowData } from "../../types/type-utils.cjs";
|
|
2
|
-
import { Column } from "../../types/Column.cjs";
|
|
3
|
-
import { ColumnDef } from "../../types/ColumnDef.cjs";
|
|
4
|
-
import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
5
|
-
import { Table_Internal } from "../../types/Table.cjs";
|
|
6
|
-
|
|
7
|
-
//#region src/core/columns/coreColumnsFeature.utils.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Flattens this column and every descendant column into a single array.
|
|
10
|
-
*
|
|
11
|
-
* Group columns appear before their child columns, which matches the normalized
|
|
12
|
-
* column hierarchy produced during table construction.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* const flatColumns = column_getFlatColumns(column)
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
declare function column_getFlatColumns<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column<TFeatures, TData, TValue>): Array<Column<TFeatures, TData, TValue>>;
|
|
20
|
-
/**
|
|
21
|
-
* Collects the terminal leaf columns below this column.
|
|
22
|
-
*
|
|
23
|
-
* Group columns return their ordered descendants. Non-group columns return an
|
|
24
|
-
* array containing only the column itself.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const leafColumns = column_getLeafColumns(column)
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
declare function column_getLeafColumns<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column<TFeatures, TData, TValue>): Array<Column<TFeatures, TData, TValue>>;
|
|
32
|
-
/**
|
|
33
|
-
* Merges built-in, feature, and user default column definitions.
|
|
34
|
-
*
|
|
35
|
-
* Built-in defaults provide a header and fallback cell renderer, feature
|
|
36
|
-
* defaults can add feature-specific column options, and
|
|
37
|
-
* `options.defaultColumn` wins last.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* const defaultColumn = table_getDefaultColumnDef(table)
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
declare function table_getDefaultColumnDef<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Partial<ColumnDef<TFeatures, TData, unknown>>;
|
|
45
|
-
/**
|
|
46
|
-
* Normalizes `options.columns` into the table's nested column tree.
|
|
47
|
-
*
|
|
48
|
-
* Each column definition is constructed with its parent and depth, and group
|
|
49
|
-
* column children are recursively constructed.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* const columns = table_getAllColumns(table)
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
declare function table_getAllColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Column<TFeatures, TData, unknown>>;
|
|
57
|
-
/**
|
|
58
|
-
* Flattens every table column, including group columns and leaf columns.
|
|
59
|
-
*
|
|
60
|
-
* Use this when parent/group columns must be included in addition to data leaf
|
|
61
|
-
* columns.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```ts
|
|
65
|
-
* const flatColumns = table_getAllFlatColumns(table)
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
declare function table_getAllFlatColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Column<TFeatures, TData, unknown>>;
|
|
69
|
-
/**
|
|
70
|
-
* Builds an id lookup for every flat column in the table.
|
|
71
|
-
*
|
|
72
|
-
* Group columns and leaf columns are included. Later columns with the same id
|
|
73
|
-
* replace earlier entries.
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* ```ts
|
|
77
|
-
* const columnsById = table_getAllFlatColumnsById(table)
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
declare function table_getAllFlatColumnsById<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Record<string, Column<TFeatures, TData, unknown>>;
|
|
81
|
-
/**
|
|
82
|
-
* Collects all terminal leaf columns in their current table order.
|
|
83
|
-
*
|
|
84
|
-
* Column ordering features can reorder the collected leaves before the result
|
|
85
|
-
* is returned.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```ts
|
|
89
|
-
* const leafColumns = table_getAllLeafColumns(table)
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
declare function table_getAllLeafColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Column<TFeatures, TData, unknown>>;
|
|
93
|
-
/**
|
|
94
|
-
* Builds an id lookup for terminal leaf columns only.
|
|
95
|
-
*
|
|
96
|
-
* Parent/group columns are excluded, making this lookup appropriate for row
|
|
97
|
-
* cells and feature state keyed by data columns.
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```ts
|
|
101
|
-
* const leavesById = table_getAllLeafColumnsById(table)
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
|
-
declare function table_getAllLeafColumnsById<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Record<string, Column<TFeatures, TData, unknown>>;
|
|
105
|
-
/**
|
|
106
|
-
* Looks up a column by id from the flat column map.
|
|
107
|
-
*
|
|
108
|
-
* The lookup can return group columns or leaf columns. In development, a
|
|
109
|
-
* missing id logs a warning to help catch stale column references.
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* ```ts
|
|
113
|
-
* const column = table_getColumn(table, 'firstName')
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
declare function table_getColumn<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, columnId: string): Column<TFeatures, TData, unknown> | undefined;
|
|
117
|
-
//#endregion
|
|
118
|
-
export { column_getFlatColumns, column_getLeafColumns, table_getAllColumns, table_getAllFlatColumns, table_getAllFlatColumnsById, table_getAllLeafColumns, table_getAllLeafColumnsById, table_getColumn, table_getDefaultColumnDef };
|
|
119
|
-
//# sourceMappingURL=coreColumnsFeature.utils.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreColumnsFeature.utils.js","names":[],"sources":["../../../src/core/columns/coreColumnsFeature.utils.ts"],"sourcesContent":["import { callMemoOrStaticFn } from '../../utils'\nimport { table_getOrderColumnsFn } from '../../features/column-ordering/columnOrderingFeature.utils'\nimport { constructColumn } from './constructColumn'\nimport type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type {\n ColumnDef,\n ColumnDefResolved,\n GroupColumnDef,\n} from '../../types/ColumnDef'\nimport type { Column } from '../../types/Column'\n\n/**\n * Flattens this column and every descendant column into a single array.\n *\n * Group columns appear before their child columns, which matches the normalized\n * column hierarchy produced during table construction.\n *\n * @example\n * ```ts\n * const flatColumns = column_getFlatColumns(column)\n * ```\n */\nexport function column_getFlatColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n column: Column<TFeatures, TData, TValue>,\n): Array<Column<TFeatures, TData, TValue>> {\n return [column, ...column.columns.flatMap((col) => col.getFlatColumns())]\n}\n\n/**\n * Collects the terminal leaf columns below this column.\n *\n * Group columns return their ordered descendants. Non-group columns return an\n * array containing only the column itself.\n *\n * @example\n * ```ts\n * const leafColumns = column_getLeafColumns(column)\n * ```\n */\nexport function column_getLeafColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n column: Column<TFeatures, TData, TValue>,\n): Array<Column<TFeatures, TData, TValue>> {\n if (column.columns.length) {\n const leafColumns = column.columns.flatMap(\n (col) => col.getLeafColumns(), // recursive\n )\n\n return callMemoOrStaticFn(\n column.table,\n 'getOrderColumns',\n table_getOrderColumnsFn,\n )(leafColumns as any) as any\n }\n\n return [column]\n}\n\n/**\n * Merges built-in, feature, and user default column definitions.\n *\n * Built-in defaults provide a header and fallback cell renderer, feature\n * defaults can add feature-specific column options, and\n * `options.defaultColumn` wins last.\n *\n * @example\n * ```ts\n * const defaultColumn = table_getDefaultColumnDef(table)\n * ```\n */\nexport function table_getDefaultColumnDef<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Partial<ColumnDef<TFeatures, TData, unknown>> {\n return {\n header: (props) => {\n const resolvedColumnDef = props.header.column\n .columnDef as ColumnDefResolved<{}, TData>\n\n if (resolvedColumnDef.accessorKey) {\n return resolvedColumnDef.accessorKey\n }\n\n if (resolvedColumnDef.accessorFn) {\n return resolvedColumnDef.id\n }\n\n return null\n },\n cell: (props) => props.renderValue<any>()?.toString?.() ?? null,\n ...Object.values(table._features).reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultColumnDef?.())\n }, {}),\n ...table.options.defaultColumn,\n } as Partial<ColumnDef<TFeatures, TData, unknown>>\n}\n\n/**\n * Normalizes `options.columns` into the table's nested column tree.\n *\n * Each column definition is constructed with its parent and depth, and group\n * column children are recursively constructed.\n *\n * @example\n * ```ts\n * const columns = table_getAllColumns(table)\n * ```\n */\nexport function table_getAllColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Array<Column<TFeatures, TData, unknown>> {\n const recurseColumns = (\n colDefs: ReadonlyArray<ColumnDef<TFeatures, TData, unknown>>,\n parent?: Column<TFeatures, TData, unknown>,\n depth = 0,\n ): Array<Column<TFeatures, TData, unknown>> => {\n return colDefs.map((columnDef) => {\n const column = constructColumn(table, columnDef, depth, parent)\n\n const groupingColumnDef = columnDef as GroupColumnDef<\n TFeatures,\n TData,\n unknown\n >\n\n column.columns = groupingColumnDef.columns\n ? recurseColumns(groupingColumnDef.columns, column, depth + 1)\n : []\n\n return column\n })\n }\n\n return recurseColumns(table.options.columns)\n}\n\n/**\n * Flattens every table column, including group columns and leaf columns.\n *\n * Use this when parent/group columns must be included in addition to data leaf\n * columns.\n *\n * @example\n * ```ts\n * const flatColumns = table_getAllFlatColumns(table)\n * ```\n */\nexport function table_getAllFlatColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Array<Column<TFeatures, TData, unknown>> {\n return table.getAllColumns().flatMap((column) => column.getFlatColumns())\n}\n\n/**\n * Builds an id lookup for every flat column in the table.\n *\n * Group columns and leaf columns are included. Later columns with the same id\n * replace earlier entries.\n *\n * @example\n * ```ts\n * const columnsById = table_getAllFlatColumnsById(table)\n * ```\n */\nexport function table_getAllFlatColumnsById<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Record<string, Column<TFeatures, TData, unknown>> {\n const result: Record<string, Column<TFeatures, TData, unknown>> = {}\n const flatColumns = table.getAllFlatColumns()\n for (let i = 0; i < flatColumns.length; i++) {\n const column = flatColumns[i]!\n result[column.id] = column\n }\n return result\n}\n\n/**\n * Collects all terminal leaf columns in their current table order.\n *\n * Column ordering features can reorder the collected leaves before the result\n * is returned.\n *\n * @example\n * ```ts\n * const leafColumns = table_getAllLeafColumns(table)\n * ```\n */\nexport function table_getAllLeafColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Array<Column<TFeatures, TData, unknown>> {\n const leafColumns = table.getAllColumns().flatMap(\n (c) => c.getLeafColumns(), // recursive\n )\n return callMemoOrStaticFn(\n table,\n 'getOrderColumns',\n table_getOrderColumnsFn,\n )(leafColumns)\n}\n\n/**\n * Builds an id lookup for terminal leaf columns only.\n *\n * Parent/group columns are excluded, making this lookup appropriate for row\n * cells and feature state keyed by data columns.\n *\n * @example\n * ```ts\n * const leavesById = table_getAllLeafColumnsById(table)\n * ```\n */\nexport function table_getAllLeafColumnsById<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): Record<string, Column<TFeatures, TData, unknown>> {\n const result: Record<string, Column<TFeatures, TData, unknown>> = {}\n const leafColumns = table.getAllLeafColumns()\n for (let i = 0; i < leafColumns.length; i++) {\n const column = leafColumns[i]!\n result[column.id] = column\n }\n return result\n}\n\n/**\n * Looks up a column by id from the flat column map.\n *\n * The lookup can return group columns or leaf columns. In development, a\n * missing id logs a warning to help catch stale column references.\n *\n * @example\n * ```ts\n * const column = table_getColumn(table, 'firstName')\n * ```\n */\nexport function table_getColumn<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n columnId: string,\n): Column<TFeatures, TData, unknown> | undefined {\n const column = table.getAllFlatColumnsById()[columnId]\n\n if (process.env.NODE_ENV === 'development' && !column) {\n console.warn(`[Table] Column with id '${columnId}' does not exist.`)\n }\n\n return column\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwBA,SAAgB,sBAKd,QACyC;CACzC,OAAO,CAAC,QAAQ,GAAG,OAAO,QAAQ,SAAS,QAAQ,IAAI,eAAe,CAAC,CAAC;AAC1E;;;;;;;;;;;;AAaA,SAAgB,sBAKd,QACyC;CACzC,IAAI,OAAO,QAAQ,QAAQ;EACzB,MAAM,cAAc,OAAO,QAAQ,SAChC,QAAQ,IAAI,eAAe,CAC9B;EAEA,OAAO,mBACL,OAAO,OACP,mBACA,uBACF,CAAC,CAAC,WAAkB;CACtB;CAEA,OAAO,CAAC,MAAM;AAChB;;;;;;;;;;;;;AAcA,SAAgB,0BAId,OAC+C;CAC/C,OAAO;EACL,SAAS,UAAU;GACjB,MAAM,oBAAoB,MAAM,OAAO,OACpC;GAEH,IAAI,kBAAkB,aACpB,OAAO,kBAAkB;GAG3B,IAAI,kBAAkB,YACpB,OAAO,kBAAkB;GAG3B,OAAO;EACT;EACA,OAAO,UAAU;;uCAAM,YAAiB,4FAAG,+GAAW,MAAK;EAAG;EAC9D,GAAG,OAAO,OAAO,MAAM,SAAS,CAAC,CAAC,QAAQ,KAAK,YAAY;;GACzD,OAAO,OAAO,OAAO,8BAAK,QAAQ,+GAAsB,CAAC;EAC3D,GAAG,CAAC,CAAC;EACL,GAAG,MAAM,QAAQ;CACnB;AACF;;;;;;;;;;;;AAaA,SAAgB,oBAId,OAC0C;CAC1C,MAAM,kBACJ,SACA,QACA,QAAQ,MACqC;EAC7C,OAAO,QAAQ,KAAK,cAAc;GAChC,MAAM,SAAS,gBAAgB,OAAO,WAAW,OAAO,MAAM;GAE9D,MAAM,oBAAoB;GAM1B,OAAO,UAAU,kBAAkB,UAC/B,eAAe,kBAAkB,SAAS,QAAQ,QAAQ,CAAC,IAC3D,CAAC;GAEL,OAAO;EACT,CAAC;CACH;CAEA,OAAO,eAAe,MAAM,QAAQ,OAAO;AAC7C;;;;;;;;;;;;AAaA,SAAgB,wBAId,OAC0C;CAC1C,OAAO,MAAM,cAAc,CAAC,CAAC,SAAS,WAAW,OAAO,eAAe,CAAC;AAC1E;;;;;;;;;;;;AAaA,SAAgB,4BAId,OACmD;CACnD,MAAM,SAA4D,CAAC;CACnE,MAAM,cAAc,MAAM,kBAAkB;CAC5C,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;EAC3C,MAAM,SAAS,YAAY;EAC3B,OAAO,OAAO,MAAM;CACtB;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,wBAId,OAC0C;CAC1C,MAAM,cAAc,MAAM,cAAc,CAAC,CAAC,SACvC,MAAM,EAAE,eAAe,CAC1B;CACA,OAAO,mBACL,OACA,mBACA,uBACF,CAAC,CAAC,WAAW;AACf;;;;;;;;;;;;AAaA,SAAgB,4BAId,OACmD;CACnD,MAAM,SAA4D,CAAC;CACnE,MAAM,cAAc,MAAM,kBAAkB;CAC5C,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;EAC3C,MAAM,SAAS,YAAY;EAC3B,OAAO,OAAO,MAAM;CACtB;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,gBAId,OACA,UAC+C;CAC/C,MAAM,SAAS,MAAM,sBAAsB,CAAC,CAAC;CAE7C,IAAI,QAAQ,IAAI,aAAa,iBAAiB,CAAC,QAC7C,QAAQ,KAAK,2BAA2B,SAAS,kBAAkB;CAGrE,OAAO;AACT"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const require_coreCellsFeature = require('./cells/coreCellsFeature.cjs');
|
|
2
|
-
const require_coreColumnsFeature = require('./columns/coreColumnsFeature.cjs');
|
|
3
|
-
const require_coreHeadersFeature = require('./headers/coreHeadersFeature.cjs');
|
|
4
|
-
const require_coreRowModelsFeature = require('./row-models/coreRowModelsFeature.cjs');
|
|
5
|
-
const require_coreRowsFeature = require('./rows/coreRowsFeature.cjs');
|
|
6
|
-
const require_coreTablesFeature = require('./table/coreTablesFeature.cjs');
|
|
7
|
-
|
|
8
|
-
//#region src/core/coreFeatures.ts
|
|
9
|
-
/**
|
|
10
|
-
* The built-in core feature set required by every table.
|
|
11
|
-
*
|
|
12
|
-
* These features provide table, column, row, header, cell, and core row-model behavior before optional feature plugins are added.
|
|
13
|
-
*/
|
|
14
|
-
const coreFeatures = {
|
|
15
|
-
coreCellsFeature: require_coreCellsFeature.coreCellsFeature,
|
|
16
|
-
coreColumnsFeature: require_coreColumnsFeature.coreColumnsFeature,
|
|
17
|
-
coreHeadersFeature: require_coreHeadersFeature.coreHeadersFeature,
|
|
18
|
-
coreRowModelsFeature: require_coreRowModelsFeature.coreRowModelsFeature,
|
|
19
|
-
coreRowsFeature: require_coreRowsFeature.coreRowsFeature,
|
|
20
|
-
coreTablesFeature: require_coreTablesFeature.coreTablesFeature
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
exports.coreFeatures = coreFeatures;
|
|
25
|
-
//# sourceMappingURL=coreFeatures.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreFeatures.cjs","names":[],"sources":["../../src/core/coreFeatures.ts"],"sourcesContent":["import { coreCellsFeature } from './cells/coreCellsFeature'\nimport { coreColumnsFeature } from './columns/coreColumnsFeature'\nimport { coreHeadersFeature } from './headers/coreHeadersFeature'\nimport { coreRowModelsFeature } from './row-models/coreRowModelsFeature'\nimport { coreRowsFeature } from './rows/coreRowsFeature'\nimport { coreTablesFeature } from './table/coreTablesFeature'\nimport type { TableReactivityBindings } from '../reactivity'\n\nexport interface CoreFeatures {\n coreReativityFeature?: TableReactivityBindings\n coreCellsFeature: typeof coreCellsFeature\n coreColumnsFeature: typeof coreColumnsFeature\n coreHeadersFeature: typeof coreHeadersFeature\n coreRowModelsFeature: typeof coreRowModelsFeature\n coreRowsFeature: typeof coreRowsFeature\n coreTablesFeature: typeof coreTablesFeature\n}\n\n/**\n * The built-in core feature set required by every table.\n *\n * These features provide table, column, row, header, cell, and core row-model behavior before optional feature plugins are added.\n */\nexport const coreFeatures: CoreFeatures = {\n coreCellsFeature,\n coreColumnsFeature,\n coreHeadersFeature,\n coreRowModelsFeature,\n coreRowsFeature,\n coreTablesFeature,\n}\n"],"mappings":";;;;;;;;;;;;;AAuBA,MAAa,eAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { coreCellsFeature } from "./cells/coreCellsFeature.cjs";
|
|
2
|
-
import { coreColumnsFeature } from "./columns/coreColumnsFeature.cjs";
|
|
3
|
-
import { coreHeadersFeature } from "./headers/coreHeadersFeature.cjs";
|
|
4
|
-
import { coreRowModelsFeature } from "./row-models/coreRowModelsFeature.cjs";
|
|
5
|
-
import { coreRowsFeature } from "./rows/coreRowsFeature.cjs";
|
|
6
|
-
import { coreTablesFeature } from "./table/coreTablesFeature.cjs";
|
|
7
|
-
import { TableReactivityBindings } from "./reactivity/coreReactivityFeature.types.cjs";
|
|
8
|
-
//#region src/core/coreFeatures.d.ts
|
|
9
|
-
interface CoreFeatures {
|
|
10
|
-
coreReativityFeature?: TableReactivityBindings;
|
|
11
|
-
coreCellsFeature: typeof coreCellsFeature;
|
|
12
|
-
coreColumnsFeature: typeof coreColumnsFeature;
|
|
13
|
-
coreHeadersFeature: typeof coreHeadersFeature;
|
|
14
|
-
coreRowModelsFeature: typeof coreRowModelsFeature;
|
|
15
|
-
coreRowsFeature: typeof coreRowsFeature;
|
|
16
|
-
coreTablesFeature: typeof coreTablesFeature;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The built-in core feature set required by every table.
|
|
20
|
-
*
|
|
21
|
-
* These features provide table, column, row, header, cell, and core row-model behavior before optional feature plugins are added.
|
|
22
|
-
*/
|
|
23
|
-
declare const coreFeatures: CoreFeatures;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { CoreFeatures, coreFeatures };
|
|
26
|
-
//# sourceMappingURL=coreFeatures.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreFeatures.js","names":[],"sources":["../../src/core/coreFeatures.ts"],"sourcesContent":["import { coreCellsFeature } from './cells/coreCellsFeature'\nimport { coreColumnsFeature } from './columns/coreColumnsFeature'\nimport { coreHeadersFeature } from './headers/coreHeadersFeature'\nimport { coreRowModelsFeature } from './row-models/coreRowModelsFeature'\nimport { coreRowsFeature } from './rows/coreRowsFeature'\nimport { coreTablesFeature } from './table/coreTablesFeature'\nimport type { TableReactivityBindings } from '../reactivity'\n\nexport interface CoreFeatures {\n coreReativityFeature?: TableReactivityBindings\n coreCellsFeature: typeof coreCellsFeature\n coreColumnsFeature: typeof coreColumnsFeature\n coreHeadersFeature: typeof coreHeadersFeature\n coreRowModelsFeature: typeof coreRowModelsFeature\n coreRowsFeature: typeof coreRowsFeature\n coreTablesFeature: typeof coreTablesFeature\n}\n\n/**\n * The built-in core feature set required by every table.\n *\n * These features provide table, column, row, header, cell, and core row-model behavior before optional feature plugins are added.\n */\nexport const coreFeatures: CoreFeatures = {\n coreCellsFeature,\n coreColumnsFeature,\n coreHeadersFeature,\n coreRowModelsFeature,\n coreRowsFeature,\n coreTablesFeature,\n}\n"],"mappings":";;;;;;;;;;;;;AAuBA,MAAa,eAA6B;CACxC;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
const require_utils = require('../../utils.cjs');
|
|
2
|
-
const require_columnVisibilityFeature_utils = require('../../features/column-visibility/columnVisibilityFeature.utils.cjs');
|
|
3
|
-
const require_constructHeader = require('./constructHeader.cjs');
|
|
4
|
-
|
|
5
|
-
//#region src/core/headers/buildHeaderGroups.ts
|
|
6
|
-
/**
|
|
7
|
-
* Builds the nested header group structure for a table.
|
|
8
|
-
*
|
|
9
|
-
* The result accounts for visible leaf columns, pinned column groups, and placeholder headers needed to render multi-level headers.
|
|
10
|
-
*/
|
|
11
|
-
function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
|
|
12
|
-
var _headerGroups$;
|
|
13
|
-
let maxDepth = 0;
|
|
14
|
-
const findMaxDepth = (columns, depth = 1) => {
|
|
15
|
-
maxDepth = Math.max(maxDepth, depth);
|
|
16
|
-
for (let i = 0; i < columns.length; i++) {
|
|
17
|
-
const column = columns[i];
|
|
18
|
-
if (require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible)) {
|
|
19
|
-
if (column.columns.length) findMaxDepth(column.columns, depth + 1);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
findMaxDepth(allColumns);
|
|
24
|
-
const headerGroups = [];
|
|
25
|
-
const constructHeaderGroup = (headersToGroup, depth) => {
|
|
26
|
-
const headerGroup = {
|
|
27
|
-
depth,
|
|
28
|
-
id: [headerFamily, `${depth}`].filter(Boolean).join("_"),
|
|
29
|
-
headers: []
|
|
30
|
-
};
|
|
31
|
-
const pendingParentHeaders = [];
|
|
32
|
-
headersToGroup.forEach((headerToGroup) => {
|
|
33
|
-
const latestPendingParentHeader = pendingParentHeaders[pendingParentHeaders.length - 1];
|
|
34
|
-
const isLeafHeader = headerToGroup.column.depth === headerGroup.depth;
|
|
35
|
-
let column;
|
|
36
|
-
let isPlaceholder = false;
|
|
37
|
-
if (isLeafHeader && headerToGroup.column.parent) column = headerToGroup.column.parent;
|
|
38
|
-
else {
|
|
39
|
-
column = headerToGroup.column;
|
|
40
|
-
isPlaceholder = true;
|
|
41
|
-
}
|
|
42
|
-
if (latestPendingParentHeader && latestPendingParentHeader.column === column) latestPendingParentHeader.subHeaders.push(headerToGroup);
|
|
43
|
-
else {
|
|
44
|
-
const header = require_constructHeader.constructHeader(table, column, {
|
|
45
|
-
id: [
|
|
46
|
-
headerFamily,
|
|
47
|
-
depth,
|
|
48
|
-
column.id,
|
|
49
|
-
headerToGroup.id
|
|
50
|
-
].filter(Boolean).join("_"),
|
|
51
|
-
isPlaceholder,
|
|
52
|
-
placeholderId: isPlaceholder ? `${pendingParentHeaders.filter((d) => d.column === column).length}` : void 0,
|
|
53
|
-
depth,
|
|
54
|
-
index: pendingParentHeaders.length
|
|
55
|
-
});
|
|
56
|
-
header.subHeaders.push(headerToGroup);
|
|
57
|
-
pendingParentHeaders.push(header);
|
|
58
|
-
}
|
|
59
|
-
headerGroup.headers.push(headerToGroup);
|
|
60
|
-
headerToGroup.headerGroup = headerGroup;
|
|
61
|
-
});
|
|
62
|
-
headerGroups.push(headerGroup);
|
|
63
|
-
if (depth > 0) constructHeaderGroup(pendingParentHeaders, depth - 1);
|
|
64
|
-
};
|
|
65
|
-
constructHeaderGroup(columnsToGroup.map((column, index) => require_constructHeader.constructHeader(table, column, {
|
|
66
|
-
depth: maxDepth,
|
|
67
|
-
index
|
|
68
|
-
})), maxDepth - 1);
|
|
69
|
-
headerGroups.reverse();
|
|
70
|
-
const recurseHeadersForSpans = (headers) => {
|
|
71
|
-
const results = [];
|
|
72
|
-
for (let i = 0; i < headers.length; i++) {
|
|
73
|
-
const header = headers[i];
|
|
74
|
-
if (!require_utils.callMemoOrStaticFn(header.column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible)) continue;
|
|
75
|
-
let colSpan = 0;
|
|
76
|
-
let minChildRowSpan = Infinity;
|
|
77
|
-
if (header.subHeaders.length) {
|
|
78
|
-
const childSpans = recurseHeadersForSpans(header.subHeaders);
|
|
79
|
-
for (let j = 0; j < childSpans.length; j++) {
|
|
80
|
-
const child = childSpans[j];
|
|
81
|
-
colSpan += child.colSpan;
|
|
82
|
-
if (child.rowSpan < minChildRowSpan) minChildRowSpan = child.rowSpan;
|
|
83
|
-
}
|
|
84
|
-
} else {
|
|
85
|
-
colSpan = 1;
|
|
86
|
-
minChildRowSpan = 0;
|
|
87
|
-
}
|
|
88
|
-
header.colSpan = colSpan;
|
|
89
|
-
header.rowSpan = minChildRowSpan;
|
|
90
|
-
results.push({
|
|
91
|
-
colSpan,
|
|
92
|
-
rowSpan: header.rowSpan
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
return results;
|
|
96
|
-
};
|
|
97
|
-
recurseHeadersForSpans(((_headerGroups$ = headerGroups[0]) === null || _headerGroups$ === void 0 ? void 0 : _headerGroups$.headers) ?? []);
|
|
98
|
-
return headerGroups;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
//#endregion
|
|
102
|
-
exports.buildHeaderGroups = buildHeaderGroups;
|
|
103
|
-
//# sourceMappingURL=buildHeaderGroups.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildHeaderGroups.cjs","names":["callMemoOrStaticFn","column_getIsVisible","constructHeader"],"sources":["../../../src/core/headers/buildHeaderGroups.ts"],"sourcesContent":["import { callMemoOrStaticFn } from '../../utils'\nimport { column_getIsVisible } from '../../features/column-visibility/columnVisibilityFeature.utils'\nimport { constructHeader } from './constructHeader'\nimport type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header } from '../../types/Header'\nimport type { HeaderGroup } from '../../types/HeaderGroup'\nimport type { Column } from '../../types/Column'\n\n/**\n * Builds the nested header group structure for a table.\n *\n * The result accounts for visible leaf columns, pinned column groups, and placeholder headers needed to render multi-level headers.\n */\nexport function buildHeaderGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n allColumns: Array<Column<TFeatures, TData, TValue>>,\n columnsToGroup: Array<Column<TFeatures, TData, TValue>>,\n table: Table_Internal<TFeatures, TData>,\n headerFamily?: 'center' | 'left' | 'right',\n) {\n // Find the max depth of the columns:\n // build the leaf column row\n // build each buffer row going up\n // placeholder for non-existent level\n // real column for existing level\n\n let maxDepth = 0\n\n const findMaxDepth = (\n columns: Array<Column<TFeatures, TData, TValue>>,\n depth = 1,\n ) => {\n maxDepth = Math.max(maxDepth, depth)\n\n for (let i = 0; i < columns.length; i++) {\n const column = columns[i]!\n if (callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)) {\n if (column.columns.length) {\n findMaxDepth(column.columns, depth + 1)\n }\n }\n }\n }\n\n findMaxDepth(allColumns)\n\n const headerGroups: Array<HeaderGroup<TFeatures, TData>> = []\n\n const constructHeaderGroup = (\n headersToGroup: Array<Header<TFeatures, TData, TValue>>,\n depth: number,\n ) => {\n // The header group we are creating\n const headerGroup: HeaderGroup<TFeatures, TData> = {\n depth,\n id: [headerFamily, `${depth}`].filter(Boolean).join('_'),\n headers: [],\n }\n\n // The parent columns we're going to scan next\n const pendingParentHeaders: Array<Header<TFeatures, TData, TValue>> = []\n\n // Scan each column for parents\n headersToGroup.forEach((headerToGroup) => {\n // What is the latest (last) parent column?\n\n const latestPendingParentHeader =\n pendingParentHeaders[pendingParentHeaders.length - 1]\n\n const isLeafHeader = headerToGroup.column.depth === headerGroup.depth\n\n let column: Column<TFeatures, TData, TValue>\n let isPlaceholder = false\n\n if (isLeafHeader && headerToGroup.column.parent) {\n // The parent header is new\n column = headerToGroup.column.parent\n } else {\n // The parent header is repeated\n column = headerToGroup.column\n isPlaceholder = true\n }\n\n if (\n latestPendingParentHeader &&\n latestPendingParentHeader.column === column\n ) {\n // This column is repeated. Add it as a sub header to the next batch\n latestPendingParentHeader.subHeaders.push(headerToGroup)\n } else {\n // This is a new header. Let's create it\n const header = constructHeader(table, column, {\n id: [headerFamily, depth, column.id, headerToGroup.id]\n .filter(Boolean)\n .join('_'),\n isPlaceholder,\n placeholderId: isPlaceholder\n ? `${pendingParentHeaders.filter((d) => d.column === column).length}`\n : undefined,\n depth,\n index: pendingParentHeaders.length,\n })\n\n // Add the headerToGroup as a subHeader of the new header\n header.subHeaders.push(headerToGroup)\n // Add the new header to the pendingParentHeaders to get grouped\n // in the next batch\n pendingParentHeaders.push(header)\n }\n\n headerGroup.headers.push(headerToGroup)\n headerToGroup.headerGroup = headerGroup\n })\n\n headerGroups.push(headerGroup)\n\n if (depth > 0) {\n constructHeaderGroup(pendingParentHeaders, depth - 1)\n }\n }\n\n const bottomHeaders = columnsToGroup.map((column, index) =>\n constructHeader(table, column, {\n depth: maxDepth,\n index,\n }),\n )\n\n constructHeaderGroup(bottomHeaders, maxDepth - 1)\n\n headerGroups.reverse()\n\n const recurseHeadersForSpans = (\n headers: Array<Header<TFeatures, TData, TValue>>,\n ): Array<{ colSpan: number; rowSpan: number }> => {\n const results: Array<{ colSpan: number; rowSpan: number }> = []\n\n for (let i = 0; i < headers.length; i++) {\n const header = headers[i]!\n if (\n !callMemoOrStaticFn(header.column, 'getIsVisible', column_getIsVisible)\n ) {\n continue\n }\n\n let colSpan = 0\n let minChildRowSpan = Infinity\n\n if (header.subHeaders.length) {\n const childSpans = recurseHeadersForSpans(header.subHeaders)\n for (let j = 0; j < childSpans.length; j++) {\n const child = childSpans[j]!\n colSpan += child.colSpan\n if (child.rowSpan < minChildRowSpan) {\n minChildRowSpan = child.rowSpan\n }\n }\n } else {\n colSpan = 1\n minChildRowSpan = 0\n }\n\n header.colSpan = colSpan\n header.rowSpan = minChildRowSpan\n\n results.push({ colSpan, rowSpan: header.rowSpan })\n }\n\n return results\n }\n\n recurseHeadersForSpans(\n (headerGroups[0]?.headers ?? []) as Array<Header<TFeatures, TData, TValue>>,\n )\n\n return headerGroups\n}\n"],"mappings":";;;;;;;;;;AAeA,SAAgB,kBAKd,YACA,gBACA,OACA,cACA;;CAOA,IAAI,WAAW;CAEf,MAAM,gBACJ,SACA,QAAQ,MACL;EACH,WAAW,KAAK,IAAI,UAAU,KAAK;EAEnC,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACvC,MAAM,SAAS,QAAQ;GACvB,IAAIA,iCAAmB,QAAQ,gBAAgBC,yDAAmB,GAChE;QAAI,OAAO,QAAQ,QACjB,aAAa,OAAO,SAAS,QAAQ,CAAC;GACxC;EAEJ;CACF;CAEA,aAAa,UAAU;CAEvB,MAAM,eAAqD,CAAC;CAE5D,MAAM,wBACJ,gBACA,UACG;EAEH,MAAM,cAA6C;GACjD;GACA,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GACvD,SAAS,CAAC;EACZ;EAGA,MAAM,uBAAgE,CAAC;EAGvE,eAAe,SAAS,kBAAkB;GAGxC,MAAM,4BACJ,qBAAqB,qBAAqB,SAAS;GAErD,MAAM,eAAe,cAAc,OAAO,UAAU,YAAY;GAEhE,IAAI;GACJ,IAAI,gBAAgB;GAEpB,IAAI,gBAAgB,cAAc,OAAO,QAEvC,SAAS,cAAc,OAAO;QACzB;IAEL,SAAS,cAAc;IACvB,gBAAgB;GAClB;GAEA,IACE,6BACA,0BAA0B,WAAW,QAGrC,0BAA0B,WAAW,KAAK,aAAa;QAClD;IAEL,MAAM,SAASC,wCAAgB,OAAO,QAAQ;KAC5C,IAAI;MAAC;MAAc;MAAO,OAAO;MAAI,cAAc;KAAE,CAAC,CACnD,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;KACX;KACA,eAAe,gBACX,GAAG,qBAAqB,QAAQ,MAAM,EAAE,WAAW,MAAM,CAAC,CAAC,WAC3D;KACJ;KACA,OAAO,qBAAqB;IAC9B,CAAC;IAGD,OAAO,WAAW,KAAK,aAAa;IAGpC,qBAAqB,KAAK,MAAM;GAClC;GAEA,YAAY,QAAQ,KAAK,aAAa;GACtC,cAAc,cAAc;EAC9B,CAAC;EAED,aAAa,KAAK,WAAW;EAE7B,IAAI,QAAQ,GACV,qBAAqB,sBAAsB,QAAQ,CAAC;CAExD;CASA,qBAPsB,eAAe,KAAK,QAAQ,UAChDA,wCAAgB,OAAO,QAAQ;EAC7B,OAAO;EACP;CACF,CAAC,CAG8B,GAAG,WAAW,CAAC;CAEhD,aAAa,QAAQ;CAErB,MAAM,0BACJ,YACgD;EAChD,MAAM,UAAuD,CAAC;EAE9D,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACvC,MAAM,SAAS,QAAQ;GACvB,IACE,CAACF,iCAAmB,OAAO,QAAQ,gBAAgBC,yDAAmB,GAEtE;GAGF,IAAI,UAAU;GACd,IAAI,kBAAkB;GAEtB,IAAI,OAAO,WAAW,QAAQ;IAC5B,MAAM,aAAa,uBAAuB,OAAO,UAAU;IAC3D,KAAK,IAAI,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;KAC1C,MAAM,QAAQ,WAAW;KACzB,WAAW,MAAM;KACjB,IAAI,MAAM,UAAU,iBAClB,kBAAkB,MAAM;IAE5B;GACF,OAAO;IACL,UAAU;IACV,kBAAkB;GACpB;GAEA,OAAO,UAAU;GACjB,OAAO,UAAU;GAEjB,QAAQ,KAAK;IAAE;IAAS,SAAS,OAAO;GAAQ,CAAC;EACnD;EAEA,OAAO;CACT;CAEA,0CACG,aAAa,oEAAI,YAAW,CAAC,CAChC;CAEA,OAAO;AACT"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CellData, RowData } from "../../types/type-utils.cjs";
|
|
2
|
-
import { HeaderGroup } from "../../types/HeaderGroup.cjs";
|
|
3
|
-
import { Column } from "../../types/Column.cjs";
|
|
4
|
-
import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
5
|
-
import { Table_Internal } from "../../types/Table.cjs";
|
|
6
|
-
|
|
7
|
-
//#region src/core/headers/buildHeaderGroups.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Builds the nested header group structure for a table.
|
|
10
|
-
*
|
|
11
|
-
* The result accounts for visible leaf columns, pinned column groups, and placeholder headers needed to render multi-level headers.
|
|
12
|
-
*/
|
|
13
|
-
declare function buildHeaderGroups<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(allColumns: Array<Column<TFeatures, TData, TValue>>, columnsToGroup: Array<Column<TFeatures, TData, TValue>>, table: Table_Internal<TFeatures, TData>, headerFamily?: 'center' | 'left' | 'right'): HeaderGroup<TFeatures, TData>[];
|
|
14
|
-
//#endregion
|
|
15
|
-
export { buildHeaderGroups };
|
|
16
|
-
//# sourceMappingURL=buildHeaderGroups.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildHeaderGroups.js","names":[],"sources":["../../../src/core/headers/buildHeaderGroups.ts"],"sourcesContent":["import { callMemoOrStaticFn } from '../../utils'\nimport { column_getIsVisible } from '../../features/column-visibility/columnVisibilityFeature.utils'\nimport { constructHeader } from './constructHeader'\nimport type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header } from '../../types/Header'\nimport type { HeaderGroup } from '../../types/HeaderGroup'\nimport type { Column } from '../../types/Column'\n\n/**\n * Builds the nested header group structure for a table.\n *\n * The result accounts for visible leaf columns, pinned column groups, and placeholder headers needed to render multi-level headers.\n */\nexport function buildHeaderGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n allColumns: Array<Column<TFeatures, TData, TValue>>,\n columnsToGroup: Array<Column<TFeatures, TData, TValue>>,\n table: Table_Internal<TFeatures, TData>,\n headerFamily?: 'center' | 'left' | 'right',\n) {\n // Find the max depth of the columns:\n // build the leaf column row\n // build each buffer row going up\n // placeholder for non-existent level\n // real column for existing level\n\n let maxDepth = 0\n\n const findMaxDepth = (\n columns: Array<Column<TFeatures, TData, TValue>>,\n depth = 1,\n ) => {\n maxDepth = Math.max(maxDepth, depth)\n\n for (let i = 0; i < columns.length; i++) {\n const column = columns[i]!\n if (callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)) {\n if (column.columns.length) {\n findMaxDepth(column.columns, depth + 1)\n }\n }\n }\n }\n\n findMaxDepth(allColumns)\n\n const headerGroups: Array<HeaderGroup<TFeatures, TData>> = []\n\n const constructHeaderGroup = (\n headersToGroup: Array<Header<TFeatures, TData, TValue>>,\n depth: number,\n ) => {\n // The header group we are creating\n const headerGroup: HeaderGroup<TFeatures, TData> = {\n depth,\n id: [headerFamily, `${depth}`].filter(Boolean).join('_'),\n headers: [],\n }\n\n // The parent columns we're going to scan next\n const pendingParentHeaders: Array<Header<TFeatures, TData, TValue>> = []\n\n // Scan each column for parents\n headersToGroup.forEach((headerToGroup) => {\n // What is the latest (last) parent column?\n\n const latestPendingParentHeader =\n pendingParentHeaders[pendingParentHeaders.length - 1]\n\n const isLeafHeader = headerToGroup.column.depth === headerGroup.depth\n\n let column: Column<TFeatures, TData, TValue>\n let isPlaceholder = false\n\n if (isLeafHeader && headerToGroup.column.parent) {\n // The parent header is new\n column = headerToGroup.column.parent\n } else {\n // The parent header is repeated\n column = headerToGroup.column\n isPlaceholder = true\n }\n\n if (\n latestPendingParentHeader &&\n latestPendingParentHeader.column === column\n ) {\n // This column is repeated. Add it as a sub header to the next batch\n latestPendingParentHeader.subHeaders.push(headerToGroup)\n } else {\n // This is a new header. Let's create it\n const header = constructHeader(table, column, {\n id: [headerFamily, depth, column.id, headerToGroup.id]\n .filter(Boolean)\n .join('_'),\n isPlaceholder,\n placeholderId: isPlaceholder\n ? `${pendingParentHeaders.filter((d) => d.column === column).length}`\n : undefined,\n depth,\n index: pendingParentHeaders.length,\n })\n\n // Add the headerToGroup as a subHeader of the new header\n header.subHeaders.push(headerToGroup)\n // Add the new header to the pendingParentHeaders to get grouped\n // in the next batch\n pendingParentHeaders.push(header)\n }\n\n headerGroup.headers.push(headerToGroup)\n headerToGroup.headerGroup = headerGroup\n })\n\n headerGroups.push(headerGroup)\n\n if (depth > 0) {\n constructHeaderGroup(pendingParentHeaders, depth - 1)\n }\n }\n\n const bottomHeaders = columnsToGroup.map((column, index) =>\n constructHeader(table, column, {\n depth: maxDepth,\n index,\n }),\n )\n\n constructHeaderGroup(bottomHeaders, maxDepth - 1)\n\n headerGroups.reverse()\n\n const recurseHeadersForSpans = (\n headers: Array<Header<TFeatures, TData, TValue>>,\n ): Array<{ colSpan: number; rowSpan: number }> => {\n const results: Array<{ colSpan: number; rowSpan: number }> = []\n\n for (let i = 0; i < headers.length; i++) {\n const header = headers[i]!\n if (\n !callMemoOrStaticFn(header.column, 'getIsVisible', column_getIsVisible)\n ) {\n continue\n }\n\n let colSpan = 0\n let minChildRowSpan = Infinity\n\n if (header.subHeaders.length) {\n const childSpans = recurseHeadersForSpans(header.subHeaders)\n for (let j = 0; j < childSpans.length; j++) {\n const child = childSpans[j]!\n colSpan += child.colSpan\n if (child.rowSpan < minChildRowSpan) {\n minChildRowSpan = child.rowSpan\n }\n }\n } else {\n colSpan = 1\n minChildRowSpan = 0\n }\n\n header.colSpan = colSpan\n header.rowSpan = minChildRowSpan\n\n results.push({ colSpan, rowSpan: header.rowSpan })\n }\n\n return results\n }\n\n recurseHeadersForSpans(\n (headerGroups[0]?.headers ?? []) as Array<Header<TFeatures, TData, TValue>>,\n )\n\n return headerGroups\n}\n"],"mappings":";;;;;;;;;;AAeA,SAAgB,kBAKd,YACA,gBACA,OACA,cACA;;CAOA,IAAI,WAAW;CAEf,MAAM,gBACJ,SACA,QAAQ,MACL;EACH,WAAW,KAAK,IAAI,UAAU,KAAK;EAEnC,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACvC,MAAM,SAAS,QAAQ;GACvB,IAAI,mBAAmB,QAAQ,gBAAgB,mBAAmB,GAChE;QAAI,OAAO,QAAQ,QACjB,aAAa,OAAO,SAAS,QAAQ,CAAC;GACxC;EAEJ;CACF;CAEA,aAAa,UAAU;CAEvB,MAAM,eAAqD,CAAC;CAE5D,MAAM,wBACJ,gBACA,UACG;EAEH,MAAM,cAA6C;GACjD;GACA,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GACvD,SAAS,CAAC;EACZ;EAGA,MAAM,uBAAgE,CAAC;EAGvE,eAAe,SAAS,kBAAkB;GAGxC,MAAM,4BACJ,qBAAqB,qBAAqB,SAAS;GAErD,MAAM,eAAe,cAAc,OAAO,UAAU,YAAY;GAEhE,IAAI;GACJ,IAAI,gBAAgB;GAEpB,IAAI,gBAAgB,cAAc,OAAO,QAEvC,SAAS,cAAc,OAAO;QACzB;IAEL,SAAS,cAAc;IACvB,gBAAgB;GAClB;GAEA,IACE,6BACA,0BAA0B,WAAW,QAGrC,0BAA0B,WAAW,KAAK,aAAa;QAClD;IAEL,MAAM,SAAS,gBAAgB,OAAO,QAAQ;KAC5C,IAAI;MAAC;MAAc;MAAO,OAAO;MAAI,cAAc;KAAE,CAAC,CACnD,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;KACX;KACA,eAAe,gBACX,GAAG,qBAAqB,QAAQ,MAAM,EAAE,WAAW,MAAM,CAAC,CAAC,WAC3D;KACJ;KACA,OAAO,qBAAqB;IAC9B,CAAC;IAGD,OAAO,WAAW,KAAK,aAAa;IAGpC,qBAAqB,KAAK,MAAM;GAClC;GAEA,YAAY,QAAQ,KAAK,aAAa;GACtC,cAAc,cAAc;EAC9B,CAAC;EAED,aAAa,KAAK,WAAW;EAE7B,IAAI,QAAQ,GACV,qBAAqB,sBAAsB,QAAQ,CAAC;CAExD;CASA,qBAPsB,eAAe,KAAK,QAAQ,UAChD,gBAAgB,OAAO,QAAQ;EAC7B,OAAO;EACP;CACF,CAAC,CAG8B,GAAG,WAAW,CAAC;CAEhD,aAAa,QAAQ;CAErB,MAAM,0BACJ,YACgD;EAChD,MAAM,UAAuD,CAAC;EAE9D,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACvC,MAAM,SAAS,QAAQ;GACvB,IACE,CAAC,mBAAmB,OAAO,QAAQ,gBAAgB,mBAAmB,GAEtE;GAGF,IAAI,UAAU;GACd,IAAI,kBAAkB;GAEtB,IAAI,OAAO,WAAW,QAAQ;IAC5B,MAAM,aAAa,uBAAuB,OAAO,UAAU;IAC3D,KAAK,IAAI,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;KAC1C,MAAM,QAAQ,WAAW;KACzB,WAAW,MAAM;KACjB,IAAI,MAAM,UAAU,iBAClB,kBAAkB,MAAM;IAE5B;GACF,OAAO;IACL,UAAU;IACV,kBAAkB;GACpB;GAEA,OAAO,UAAU;GACjB,OAAO,UAAU;GAEjB,QAAQ,KAAK;IAAE;IAAS,SAAS,OAAO;GAAQ,CAAC;EACnD;EAEA,OAAO;CACT;CAEA,0CACG,aAAa,oEAAI,YAAW,CAAC,CAChC;CAEA,OAAO;AACT"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/core/headers/constructHeader.ts
|
|
3
|
-
/**
|
|
4
|
-
* Creates or retrieves the header prototype for a table.
|
|
5
|
-
* The prototype is cached on the table and shared by all header instances.
|
|
6
|
-
*/
|
|
7
|
-
function getHeaderPrototype(table) {
|
|
8
|
-
if (!table._headerPrototype) {
|
|
9
|
-
table._headerPrototype = { table };
|
|
10
|
-
const features = Object.values(table._features);
|
|
11
|
-
for (let i = 0; i < features.length; i++) {
|
|
12
|
-
var _assignHeaderPrototyp, _ref;
|
|
13
|
-
(_assignHeaderPrototyp = (_ref = features[i]).assignHeaderPrototype) === null || _assignHeaderPrototyp === void 0 || _assignHeaderPrototyp.call(_ref, table._headerPrototype, table);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return table._headerPrototype;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Constructs a header instance from normalized table internals.
|
|
20
|
-
*
|
|
21
|
-
* This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.
|
|
22
|
-
*/
|
|
23
|
-
function constructHeader(table, column, options) {
|
|
24
|
-
const headerPrototype = getHeaderPrototype(table);
|
|
25
|
-
const header = Object.create(headerPrototype);
|
|
26
|
-
header.colSpan = 0;
|
|
27
|
-
header.column = column;
|
|
28
|
-
header.depth = options.depth;
|
|
29
|
-
header.headerGroup = null;
|
|
30
|
-
header.id = options.id ?? column.id;
|
|
31
|
-
header.index = options.index;
|
|
32
|
-
header.isPlaceholder = !!options.isPlaceholder;
|
|
33
|
-
header.placeholderId = options.placeholderId;
|
|
34
|
-
header.rowSpan = 0;
|
|
35
|
-
header.subHeaders = [];
|
|
36
|
-
return header;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
exports.constructHeader = constructHeader;
|
|
41
|
-
//# sourceMappingURL=constructHeader.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constructHeader.cjs","names":[],"sources":["../../../src/core/headers/constructHeader.ts"],"sourcesContent":["import type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header } from '../../types/Header'\nimport type { Column } from '../../types/Column'\nimport type { Header_CoreProperties } from './coreHeadersFeature.types'\n\n/**\n * Creates or retrieves the header prototype for a table.\n * The prototype is cached on the table and shared by all header instances.\n */\nfunction getHeaderPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._headerPrototype) {\n table._headerPrototype = { table }\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.assignHeaderPrototype?.(table._headerPrototype, table)\n }\n }\n return table._headerPrototype\n}\n\n/**\n * Constructs a header instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructHeader<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n table: Table_Internal<TFeatures, TData>,\n column: Column<TFeatures, TData, TValue>,\n options: {\n id?: string\n isPlaceholder?: boolean\n placeholderId?: string\n index: number\n depth: number\n },\n): Header<TFeatures, TData, TValue> {\n // Create header with shared prototype for memory efficiency\n const headerPrototype = getHeaderPrototype(table)\n const header = Object.create(headerPrototype) as Header_CoreProperties<\n TFeatures,\n TData,\n TValue\n >\n\n // Only assign instance-specific properties\n header.colSpan = 0\n header.column = column\n header.depth = options.depth\n header.headerGroup = null\n header.id = options.id ?? column.id\n header.index = options.index\n header.isPlaceholder = !!options.isPlaceholder\n header.placeholderId = options.placeholderId\n header.rowSpan = 0\n header.subHeaders = []\n\n return header as Header<TFeatures, TData, TValue>\n}\n"],"mappings":";;;;;;AAWA,SAAS,mBAGP,OAAiD;CACjD,IAAI,CAAC,MAAM,kBAAkB;EAC3B,MAAM,mBAAmB,EAAE,MAAM;EACjC,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;EAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;;GACxC,0CAAS,IAAI,wGAAwB,MAAM,kBAAkB,KAAK;EACpE;CACF;CACA,OAAO,MAAM;AACf;;;;;;AAOA,SAAgB,gBAKd,OACA,QACA,SAOkC;CAElC,MAAM,kBAAkB,mBAAmB,KAAK;CAChD,MAAM,SAAS,OAAO,OAAO,eAAe;CAO5C,OAAO,UAAU;CACjB,OAAO,SAAS;CAChB,OAAO,QAAQ,QAAQ;CACvB,OAAO,cAAc;CACrB,OAAO,KAAK,QAAQ,MAAM,OAAO;CACjC,OAAO,QAAQ,QAAQ;CACvB,OAAO,gBAAgB,CAAC,CAAC,QAAQ;CACjC,OAAO,gBAAgB,QAAQ;CAC/B,OAAO,UAAU;CACjB,OAAO,aAAa,CAAC;CAErB,OAAO;AACT"}
|