@tanstack/table-core 9.0.0-alpha.0 → 9.0.0-alpha.11
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/dist/esm/core/cells/constructCell.d.ts +7 -0
- package/dist/esm/core/cells/constructCell.js +21 -0
- package/dist/esm/core/cells/constructCell.js.map +1 -0
- package/dist/esm/core/cells/coreCellsFeature.d.ts +10 -0
- package/dist/esm/core/cells/coreCellsFeature.js +26 -0
- package/dist/esm/core/cells/coreCellsFeature.js.map +1 -0
- package/dist/esm/core/cells/coreCellsFeature.types.d.ts +52 -0
- package/dist/esm/core/cells/coreCellsFeature.utils.d.ts +13 -0
- package/dist/esm/core/cells/coreCellsFeature.utils.js +23 -0
- package/dist/esm/core/cells/coreCellsFeature.utils.js.map +1 -0
- package/dist/esm/core/columns/constructColumn.d.ts +6 -0
- package/dist/esm/core/columns/constructColumn.js +60 -0
- package/dist/esm/core/columns/constructColumn.js.map +1 -0
- package/dist/esm/core/columns/coreColumnsFeature.d.ts +10 -0
- package/dist/esm/core/columns/coreColumnsFeature.js +61 -0
- package/dist/esm/core/columns/coreColumnsFeature.js.map +1 -0
- package/dist/esm/core/columns/coreColumnsFeature.types.d.ts +84 -0
- package/dist/esm/core/columns/coreColumnsFeature.utils.d.ts +13 -0
- package/dist/esm/core/columns/coreColumnsFeature.utils.js +91 -0
- package/dist/esm/core/columns/coreColumnsFeature.utils.js.map +1 -0
- package/dist/esm/core/coreFeatures.d.ts +15 -0
- package/dist/esm/core/coreFeatures.js +18 -0
- package/dist/esm/core/coreFeatures.js.map +1 -0
- package/dist/esm/core/headers/buildHeaderGroups.d.ts +6 -0
- package/dist/esm/core/headers/buildHeaderGroups.js +99 -0
- package/dist/esm/core/headers/buildHeaderGroups.js.map +1 -0
- package/dist/esm/core/headers/constructHeader.d.ts +12 -0
- package/dist/esm/core/headers/constructHeader.js +28 -0
- package/dist/esm/core/headers/constructHeader.js.map +1 -0
- package/dist/esm/core/headers/coreHeadersFeature.d.ts +10 -0
- package/dist/esm/core/headers/coreHeadersFeature.js +68 -0
- package/dist/esm/core/headers/coreHeadersFeature.js.map +1 -0
- package/dist/esm/core/headers/coreHeadersFeature.types.d.ts +99 -0
- package/dist/esm/core/headers/coreHeadersFeature.utils.d.ts +15 -0
- package/dist/esm/core/headers/coreHeadersFeature.utils.js +85 -0
- package/dist/esm/core/headers/coreHeadersFeature.utils.js.map +1 -0
- package/dist/esm/core/row-models/coreRowModelsFeature.d.ts +10 -0
- package/dist/esm/core/row-models/coreRowModelsFeature.js +52 -0
- package/dist/esm/core/row-models/coreRowModelsFeature.js.map +1 -0
- package/dist/esm/core/row-models/coreRowModelsFeature.types.d.ts +39 -0
- package/dist/esm/core/row-models/coreRowModelsFeature.utils.d.ts +16 -0
- package/dist/esm/core/row-models/coreRowModelsFeature.utils.js +85 -0
- package/dist/esm/core/row-models/coreRowModelsFeature.utils.js.map +1 -0
- package/dist/esm/core/row-models/createCoreRowModel.d.ts +5 -0
- package/dist/esm/core/row-models/createCoreRowModel.js +54 -0
- package/dist/esm/core/row-models/createCoreRowModel.js.map +1 -0
- package/dist/esm/core/rows/constructRow.d.ts +5 -0
- package/dist/esm/core/rows/constructRow.js +29 -0
- package/dist/esm/core/rows/constructRow.js.map +1 -0
- package/dist/esm/core/rows/coreRowsFeature.d.ts +10 -0
- package/dist/esm/core/rows/coreRowsFeature.js +52 -0
- package/dist/esm/core/rows/coreRowsFeature.js.map +1 -0
- package/dist/esm/core/rows/coreRowsFeature.types.d.ts +91 -0
- package/dist/esm/core/rows/coreRowsFeature.utils.d.ts +15 -0
- package/dist/esm/core/rows/coreRowsFeature.utils.js +94 -0
- package/dist/esm/core/rows/coreRowsFeature.utils.js.map +1 -0
- package/dist/esm/core/table/constructTable.d.ts +9 -0
- package/dist/esm/core/table/constructTable.js +65 -0
- package/dist/esm/core/table/constructTable.js.map +1 -0
- package/dist/esm/core/table/coreTablesFeature.d.ts +10 -0
- package/dist/esm/core/table/coreTablesFeature.js +22 -0
- package/dist/esm/core/table/coreTablesFeature.js.map +1 -0
- package/dist/esm/core/table/coreTablesFeature.types.d.ts +105 -0
- package/dist/esm/core/table/coreTablesFeature.utils.d.ts +7 -0
- package/dist/esm/core/table/coreTablesFeature.utils.js +23 -0
- package/dist/esm/core/table/coreTablesFeature.utils.js.map +1 -0
- package/dist/esm/features/column-faceting/columnFacetingFeature.d.ts +10 -0
- package/dist/esm/features/column-faceting/columnFacetingFeature.js +80 -0
- package/dist/esm/features/column-faceting/columnFacetingFeature.js.map +1 -0
- package/dist/esm/features/column-faceting/columnFacetingFeature.types.d.ts +68 -0
- package/dist/esm/features/column-faceting/columnFacetingFeature.utils.d.ts +11 -0
- package/dist/esm/features/column-faceting/columnFacetingFeature.utils.js +33 -0
- package/dist/esm/features/column-faceting/columnFacetingFeature.utils.js.map +1 -0
- package/dist/esm/features/column-faceting/createFacetedMinMaxValues.d.ts +4 -0
- package/dist/esm/features/column-faceting/createFacetedMinMaxValues.js +41 -0
- package/dist/esm/features/column-faceting/createFacetedMinMaxValues.js.map +1 -0
- package/dist/esm/features/column-faceting/createFacetedRowModel.d.ts +5 -0
- package/dist/esm/features/column-faceting/createFacetedRowModel.js +47 -0
- package/dist/esm/features/column-faceting/createFacetedRowModel.js.map +1 -0
- package/dist/esm/features/column-faceting/createFacetedUniqueValues.d.ts +4 -0
- package/dist/esm/features/column-faceting/createFacetedUniqueValues.js +46 -0
- package/dist/esm/features/column-faceting/createFacetedUniqueValues.js.map +1 -0
- package/dist/esm/features/column-filtering/columnFilteringFeature.d.ts +11 -0
- package/dist/esm/features/column-filtering/columnFilteringFeature.js +69 -0
- package/dist/esm/features/column-filtering/columnFilteringFeature.js.map +1 -0
- package/dist/esm/features/column-filtering/columnFilteringFeature.types.d.ts +145 -0
- package/dist/esm/features/column-filtering/columnFilteringFeature.utils.d.ts +16 -0
- package/dist/esm/features/column-filtering/columnFilteringFeature.utils.js +118 -0
- package/dist/esm/features/column-filtering/columnFilteringFeature.utils.js.map +1 -0
- package/dist/esm/features/column-filtering/createFilteredRowModel.d.ts +6 -0
- package/dist/esm/features/column-filtering/createFilteredRowModel.js +110 -0
- package/dist/esm/features/column-filtering/createFilteredRowModel.js.map +1 -0
- package/dist/esm/features/column-filtering/filterRowsUtils.d.ts +6 -0
- package/dist/esm/{utils → features/column-filtering}/filterRowsUtils.js +15 -19
- package/dist/esm/features/column-filtering/filterRowsUtils.js.map +1 -0
- package/dist/esm/features/column-grouping/columnGroupingFeature.d.ts +10 -0
- package/dist/esm/features/column-grouping/columnGroupingFeature.js +91 -0
- package/dist/esm/features/column-grouping/columnGroupingFeature.js.map +1 -0
- package/dist/esm/features/column-grouping/columnGroupingFeature.types.d.ts +153 -0
- package/dist/esm/features/column-grouping/columnGroupingFeature.utils.d.ts +22 -0
- package/dist/esm/features/column-grouping/columnGroupingFeature.utils.js +99 -0
- package/dist/esm/features/column-grouping/columnGroupingFeature.utils.js.map +1 -0
- package/dist/esm/features/column-grouping/createGroupedRowModel.d.ts +6 -0
- package/dist/esm/features/column-grouping/createGroupedRowModel.js +144 -0
- package/dist/esm/features/column-grouping/createGroupedRowModel.js.map +1 -0
- package/dist/esm/features/column-ordering/columnOrderingFeature.d.ts +10 -0
- package/dist/esm/features/column-ordering/columnOrderingFeature.js +60 -0
- package/dist/esm/features/column-ordering/columnOrderingFeature.js.map +1 -0
- package/dist/{cjs/features/ColumnOrdering.d.cts → esm/features/column-ordering/columnOrderingFeature.types.d.ts} +8 -22
- package/dist/esm/features/column-ordering/columnOrderingFeature.utils.d.ts +14 -0
- package/dist/esm/features/column-ordering/columnOrderingFeature.utils.js +72 -0
- package/dist/esm/features/column-ordering/columnOrderingFeature.utils.js.map +1 -0
- package/dist/esm/features/column-pinning/columnPinningFeature.d.ts +10 -0
- package/dist/esm/features/column-pinning/columnPinningFeature.js +260 -0
- package/dist/esm/features/column-pinning/columnPinningFeature.js.map +1 -0
- package/dist/esm/features/column-pinning/columnPinningFeature.types.d.ts +157 -0
- package/dist/esm/features/column-pinning/columnPinningFeature.utils.d.ts +39 -0
- package/dist/esm/features/column-pinning/columnPinningFeature.utils.js +325 -0
- package/dist/esm/features/column-pinning/columnPinningFeature.utils.js.map +1 -0
- package/dist/esm/features/column-resizing/columnResizingFeature.d.ts +11 -0
- package/dist/esm/features/column-resizing/columnResizingFeature.js +52 -0
- package/dist/esm/features/column-resizing/columnResizingFeature.js.map +1 -0
- package/dist/esm/features/column-resizing/columnResizingFeature.types.d.ts +68 -0
- package/dist/esm/features/column-resizing/columnResizingFeature.utils.d.ts +14 -0
- package/dist/esm/features/column-resizing/columnResizingFeature.utils.js +193 -0
- package/dist/esm/features/column-resizing/columnResizingFeature.utils.js.map +1 -0
- package/dist/esm/features/column-sizing/columnSizingFeature.d.ts +11 -0
- package/dist/esm/features/column-sizing/columnSizingFeature.js +95 -0
- package/dist/esm/features/column-sizing/columnSizingFeature.js.map +1 -0
- package/dist/esm/features/column-sizing/columnSizingFeature.types.d.ts +81 -0
- package/dist/esm/features/column-sizing/columnSizingFeature.utils.d.ts +25 -0
- package/dist/esm/features/column-sizing/columnSizingFeature.utils.js +128 -0
- package/dist/esm/features/column-sizing/columnSizingFeature.utils.js.map +1 -0
- package/dist/esm/features/column-visibility/columnVisibilityFeature.d.ts +10 -0
- package/dist/esm/features/column-visibility/columnVisibilityFeature.js +100 -0
- package/dist/esm/features/column-visibility/columnVisibilityFeature.js.map +1 -0
- package/dist/esm/features/column-visibility/columnVisibilityFeature.types.d.ts +84 -0
- package/dist/esm/features/column-visibility/columnVisibilityFeature.utils.d.ts +22 -0
- package/dist/esm/features/column-visibility/columnVisibilityFeature.utils.js +105 -0
- package/dist/esm/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -0
- package/dist/esm/features/global-filtering/globalFilteringFeature.d.ts +11 -0
- package/dist/esm/features/global-filtering/globalFilteringFeature.js +51 -0
- package/dist/esm/features/global-filtering/globalFilteringFeature.js.map +1 -0
- package/dist/esm/features/global-filtering/globalFilteringFeature.types.d.ts +59 -0
- package/dist/esm/features/global-filtering/globalFilteringFeature.utils.d.ts +10 -0
- package/dist/esm/features/global-filtering/globalFilteringFeature.utils.js +30 -0
- package/dist/esm/features/global-filtering/globalFilteringFeature.utils.js.map +1 -0
- package/dist/esm/features/row-expanding/createExpandedRowModel.d.ts +6 -0
- package/dist/esm/features/row-expanding/createExpandedRowModel.js +49 -0
- package/dist/esm/features/row-expanding/createExpandedRowModel.js.map +1 -0
- package/dist/esm/features/row-expanding/rowExpandingFeature.d.ts +10 -0
- package/dist/esm/features/row-expanding/rowExpandingFeature.js +74 -0
- package/dist/esm/features/row-expanding/rowExpandingFeature.js.map +1 -0
- package/dist/esm/features/row-expanding/rowExpandingFeature.types.d.ts +116 -0
- package/dist/esm/features/row-expanding/rowExpandingFeature.utils.d.ts +20 -0
- package/dist/esm/features/row-expanding/rowExpandingFeature.utils.js +125 -0
- package/dist/esm/features/row-expanding/rowExpandingFeature.utils.js.map +1 -0
- package/dist/esm/features/row-pagination/createPaginatedRowModel.d.ts +5 -0
- package/dist/esm/features/row-pagination/createPaginatedRowModel.js +58 -0
- package/dist/esm/features/row-pagination/createPaginatedRowModel.js.map +1 -0
- package/dist/esm/features/row-pagination/rowPaginationFeature.d.ts +10 -0
- package/dist/esm/features/row-pagination/rowPaginationFeature.js +78 -0
- package/dist/esm/features/row-pagination/rowPaginationFeature.js.map +1 -0
- package/dist/esm/features/row-pagination/rowPaginationFeature.types.d.ts +119 -0
- package/dist/esm/features/row-pagination/rowPaginationFeature.utils.d.ts +21 -0
- package/dist/esm/features/row-pagination/rowPaginationFeature.utils.js +126 -0
- package/dist/esm/features/row-pagination/rowPaginationFeature.utils.js.map +1 -0
- package/dist/esm/features/row-pinning/rowPinningFeature.d.ts +10 -0
- package/dist/esm/features/row-pinning/rowPinningFeature.js +80 -0
- package/dist/esm/features/row-pinning/rowPinningFeature.js.map +1 -0
- package/dist/esm/features/row-pinning/rowPinningFeature.types.d.ts +72 -0
- package/dist/esm/features/row-pinning/rowPinningFeature.utils.d.ts +16 -0
- package/dist/esm/features/row-pinning/rowPinningFeature.utils.js +115 -0
- package/dist/esm/features/row-pinning/rowPinningFeature.utils.js.map +1 -0
- package/dist/esm/features/row-selection/rowSelectionFeature.d.ts +10 -0
- package/dist/esm/features/row-selection/rowSelectionFeature.js +112 -0
- package/dist/esm/features/row-selection/rowSelectionFeature.js.map +1 -0
- package/dist/esm/features/row-selection/rowSelectionFeature.types.d.ts +123 -0
- package/dist/esm/features/row-selection/rowSelectionFeature.utils.d.ts +34 -0
- package/dist/esm/features/row-selection/rowSelectionFeature.utils.js +290 -0
- package/dist/esm/features/row-selection/rowSelectionFeature.utils.js.map +1 -0
- package/dist/esm/features/row-sorting/createSortedRowModel.d.ts +6 -0
- package/dist/esm/features/row-sorting/createSortedRowModel.js +94 -0
- package/dist/esm/features/row-sorting/createSortedRowModel.js.map +1 -0
- package/dist/esm/features/row-sorting/rowSortingFeature.d.ts +10 -0
- package/dist/esm/features/row-sorting/rowSortingFeature.js +82 -0
- package/dist/esm/features/row-sorting/rowSortingFeature.js.map +1 -0
- package/dist/esm/features/row-sorting/rowSortingFeature.types.d.ts +178 -0
- package/dist/esm/features/row-sorting/rowSortingFeature.utils.d.ts +20 -0
- package/dist/esm/features/row-sorting/rowSortingFeature.utils.js +181 -0
- package/dist/esm/features/row-sorting/rowSortingFeature.utils.js.map +1 -0
- package/dist/esm/features/stockFeatures.d.ts +31 -0
- package/dist/esm/features/stockFeatures.js +34 -0
- package/dist/esm/features/stockFeatures.js.map +1 -0
- package/dist/esm/fns/aggregationFns.d.ts +49 -0
- package/dist/esm/fns/aggregationFns.js +110 -0
- package/dist/esm/fns/aggregationFns.js.map +1 -0
- package/dist/esm/fns/filterFns.d.ts +76 -0
- package/dist/esm/fns/filterFns.js +134 -0
- package/dist/esm/fns/filterFns.js.map +1 -0
- package/dist/esm/fns/sortFns.d.ts +17 -0
- package/dist/esm/{sortingFns.js → fns/sortFns.js} +21 -15
- package/dist/esm/fns/sortFns.js.map +1 -0
- package/dist/esm/helpers/columnHelper.d.ts +61 -0
- package/dist/esm/{columnHelper.js → helpers/columnHelper.js} +1 -0
- package/dist/esm/helpers/columnHelper.js.map +1 -0
- package/dist/esm/helpers/tableFeatures.d.ts +13 -0
- package/dist/esm/helpers/tableFeatures.js +7 -0
- package/dist/esm/helpers/tableFeatures.js.map +1 -0
- package/dist/esm/helpers/tableHelper.d.ts +25 -0
- package/dist/esm/helpers/tableHelper.js +13 -0
- package/dist/esm/helpers/tableHelper.js.map +1 -0
- package/dist/esm/helpers/tableOptions.d.ts +23 -0
- package/dist/esm/helpers/tableOptions.js +7 -0
- package/dist/esm/helpers/tableOptions.js.map +1 -0
- package/dist/esm/index.d.ts +109 -33
- package/dist/esm/index.js +397 -65
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Cell.d.ts +13 -0
- package/dist/esm/types/Column.d.ts +26 -0
- package/dist/esm/types/ColumnDef.d.ts +64 -0
- package/dist/esm/types/Header.d.ts +14 -0
- package/dist/esm/types/HeaderGroup.d.ts +12 -0
- package/dist/esm/types/Row.d.ts +19 -0
- package/dist/esm/types/RowModel.d.ts +23 -0
- package/dist/esm/types/RowModelFns.d.ts +15 -0
- package/dist/esm/types/Table.d.ts +53 -0
- package/dist/esm/types/TableFeatures.d.ts +77 -0
- package/dist/esm/types/TableOptions.d.ts +39 -0
- package/dist/esm/types/TableState.d.ts +23 -0
- package/dist/esm/types/type-utils.d.ts +22 -0
- package/dist/esm/utils.d.ts +66 -33
- package/dist/esm/utils.js +183 -52
- package/dist/esm/utils.js.map +1 -1
- package/package.json +21 -12
- package/src/core/cells/constructCell.ts +49 -0
- package/src/core/cells/coreCellsFeature.ts +44 -0
- package/src/core/cells/coreCellsFeature.types.ts +68 -0
- package/src/core/cells/coreCellsFeature.utils.ts +35 -0
- package/src/core/columns/constructColumn.ts +111 -0
- package/src/core/columns/coreColumnsFeature.ts +90 -0
- package/src/core/columns/coreColumnsFeature.types.ts +103 -0
- package/src/core/columns/coreColumnsFeature.utils.ts +160 -0
- package/src/core/coreFeatures.ts +24 -0
- package/src/core/headers/buildHeaderGroups.ts +177 -0
- package/src/core/headers/constructHeader.ts +61 -0
- package/src/core/headers/coreHeadersFeature.ts +98 -0
- package/src/core/headers/coreHeadersFeature.types.ts +123 -0
- package/src/core/headers/coreHeadersFeature.utils.ts +131 -0
- package/src/core/row-models/coreRowModelsFeature.ts +78 -0
- package/src/core/row-models/coreRowModelsFeature.types.ts +67 -0
- package/src/core/row-models/coreRowModelsFeature.utils.ts +140 -0
- package/src/core/row-models/createCoreRowModel.ts +88 -0
- package/src/core/rows/constructRow.ts +59 -0
- package/src/core/rows/coreRowsFeature.ts +84 -0
- package/src/core/rows/coreRowsFeature.types.ts +111 -0
- package/src/core/rows/coreRowsFeature.utils.ts +152 -0
- package/src/core/table/constructTable.ts +95 -0
- package/src/core/table/coreTablesFeature.ts +36 -0
- package/src/core/table/coreTablesFeature.types.ts +123 -0
- package/src/core/table/coreTablesFeature.utils.ts +40 -0
- package/src/features/column-faceting/columnFacetingFeature.ts +112 -0
- package/src/features/column-faceting/columnFacetingFeature.types.ts +97 -0
- package/src/features/column-faceting/columnFacetingFeature.utils.ts +77 -0
- package/src/features/column-faceting/createFacetedMinMaxValues.ts +63 -0
- package/src/features/column-faceting/createFacetedRowModel.ts +76 -0
- package/src/features/column-faceting/createFacetedUniqueValues.ts +60 -0
- package/src/features/column-filtering/columnFilteringFeature.ts +121 -0
- package/src/features/column-filtering/columnFilteringFeature.types.ts +219 -0
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +213 -0
- package/src/features/column-filtering/createFilteredRowModel.ts +171 -0
- package/src/features/column-filtering/filterRowsUtils.ts +152 -0
- package/src/features/column-grouping/columnGroupingFeature.ts +151 -0
- package/src/features/column-grouping/columnGroupingFeature.types.ts +218 -0
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +192 -0
- package/src/features/column-grouping/createGroupedRowModel.ts +215 -0
- package/src/features/column-ordering/columnOrderingFeature.ts +96 -0
- package/src/features/column-ordering/columnOrderingFeature.types.ts +49 -0
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +133 -0
- package/src/features/column-pinning/columnPinningFeature.ts +324 -0
- package/src/features/column-pinning/columnPinningFeature.types.ts +176 -0
- package/src/features/column-pinning/columnPinningFeature.utils.ts +537 -0
- package/src/features/column-resizing/columnResizingFeature.ts +92 -0
- package/src/features/column-resizing/columnResizingFeature.types.ts +81 -0
- package/src/features/column-resizing/columnResizingFeature.utils.ts +265 -0
- package/src/features/column-sizing/columnSizingFeature.ts +146 -0
- package/src/features/column-sizing/columnSizingFeature.types.ts +92 -0
- package/src/features/column-sizing/columnSizingFeature.utils.ts +211 -0
- package/src/features/column-visibility/columnVisibilityFeature.ts +155 -0
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +101 -0
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +183 -0
- package/src/features/global-filtering/globalFilteringFeature.ts +92 -0
- package/src/features/global-filtering/globalFilteringFeature.types.ts +84 -0
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +60 -0
- package/src/features/row-expanding/createExpandedRowModel.ts +72 -0
- package/src/features/row-expanding/rowExpandingFeature.ts +122 -0
- package/src/features/row-expanding/rowExpandingFeature.types.ts +141 -0
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +207 -0
- package/src/features/row-pagination/createPaginatedRowModel.ts +78 -0
- package/src/features/row-pagination/rowPaginationFeature.ts +121 -0
- package/src/features/row-pagination/rowPaginationFeature.types.ts +141 -0
- package/src/features/row-pagination/rowPaginationFeature.utils.ts +204 -0
- package/src/features/row-pinning/rowPinningFeature.ts +121 -0
- package/src/features/row-pinning/rowPinningFeature.types.ts +89 -0
- package/src/features/row-pinning/rowPinningFeature.utils.ts +197 -0
- package/src/features/row-selection/rowSelectionFeature.ts +164 -0
- package/src/features/row-selection/rowSelectionFeature.types.ts +143 -0
- package/src/features/row-selection/rowSelectionFeature.utils.ts +464 -0
- package/src/features/row-sorting/createSortedRowModel.ts +147 -0
- package/src/features/row-sorting/rowSortingFeature.ts +136 -0
- package/src/features/row-sorting/rowSortingFeature.types.ts +229 -0
- package/src/features/row-sorting/rowSortingFeature.utils.ts +320 -0
- package/src/features/stockFeatures.ts +48 -0
- package/src/fns/aggregationFns.ts +220 -0
- package/src/fns/filterFns.ts +379 -0
- package/src/{sortingFns.ts → fns/sortFns.ts} +66 -21
- package/src/helpers/columnHelper.ts +117 -0
- package/src/helpers/tableFeatures.ts +24 -0
- package/src/helpers/tableHelper.ts +61 -0
- package/src/helpers/tableOptions.ts +82 -0
- package/src/index.ts +156 -42
- package/src/types/Cell.ts +41 -0
- package/src/types/Column.ts +86 -0
- package/src/types/ColumnDef.ts +217 -0
- package/src/types/Header.ts +45 -0
- package/src/types/HeaderGroup.ts +24 -0
- package/src/types/Row.ts +55 -0
- package/src/types/RowModel.ts +137 -0
- package/src/types/RowModelFns.ts +51 -0
- package/src/types/Table.ts +125 -0
- package/src/types/TableFeatures.ts +150 -0
- package/src/types/TableOptions.ts +125 -0
- package/src/types/TableState.ts +88 -0
- package/src/types/type-utils.ts +84 -0
- package/src/utils.ts +344 -163
- package/dist/cjs/aggregationFns.cjs +0 -98
- package/dist/cjs/aggregationFns.cjs.map +0 -1
- package/dist/cjs/aggregationFns.d.cts +0 -14
- package/dist/cjs/columnHelper.cjs +0 -19
- package/dist/cjs/columnHelper.cjs.map +0 -1
- package/dist/cjs/columnHelper.d.cts +0 -9
- package/dist/cjs/core/cell.cjs +0 -38
- package/dist/cjs/core/cell.cjs.map +0 -1
- package/dist/cjs/core/cell.d.cts +0 -50
- package/dist/cjs/core/column.cjs +0 -81
- package/dist/cjs/core/column.cjs.map +0 -1
- package/dist/cjs/core/column.d.cts +0 -56
- package/dist/cjs/core/headers.cjs +0 -310
- package/dist/cjs/core/headers.cjs.map +0 -1
- package/dist/cjs/core/headers.d.cts +0 -195
- package/dist/cjs/core/row.cjs +0 -93
- package/dist/cjs/core/row.cjs.map +0 -1
- package/dist/cjs/core/row.d.cts +0 -92
- package/dist/cjs/core/table.cjs +0 -228
- package/dist/cjs/core/table.cjs.map +0 -1
- package/dist/cjs/core/table.d.cts +0 -221
- package/dist/cjs/features/ColumnFaceting.cjs +0 -29
- package/dist/cjs/features/ColumnFaceting.cjs.map +0 -1
- package/dist/cjs/features/ColumnFaceting.d.cts +0 -35
- package/dist/cjs/features/ColumnFiltering.cjs +0 -137
- package/dist/cjs/features/ColumnFiltering.cjs.map +0 -1
- package/dist/cjs/features/ColumnFiltering.d.cts +0 -195
- package/dist/cjs/features/ColumnGrouping.cjs +0 -134
- package/dist/cjs/features/ColumnGrouping.cjs.map +0 -1
- package/dist/cjs/features/ColumnGrouping.d.cts +0 -202
- package/dist/cjs/features/ColumnOrdering.cjs +0 -76
- package/dist/cjs/features/ColumnOrdering.cjs.map +0 -1
- package/dist/cjs/features/ColumnPinning.cjs +0 -145
- package/dist/cjs/features/ColumnPinning.cjs.map +0 -1
- package/dist/cjs/features/ColumnPinning.d.cts +0 -127
- package/dist/cjs/features/ColumnSizing.cjs +0 -308
- package/dist/cjs/features/ColumnSizing.cjs.map +0 -1
- package/dist/cjs/features/ColumnSizing.d.cts +0 -194
- package/dist/cjs/features/ColumnVisibility.cjs +0 -144
- package/dist/cjs/features/ColumnVisibility.cjs.map +0 -1
- package/dist/cjs/features/ColumnVisibility.d.cts +0 -130
- package/dist/cjs/features/GlobalFaceting.cjs +0 -29
- package/dist/cjs/features/GlobalFaceting.cjs.map +0 -1
- package/dist/cjs/features/GlobalFaceting.d.cts +0 -27
- package/dist/cjs/features/GlobalFiltering.cjs +0 -50
- package/dist/cjs/features/GlobalFiltering.cjs.map +0 -1
- package/dist/cjs/features/GlobalFiltering.d.cts +0 -80
- package/dist/cjs/features/RowExpanding.cjs +0 -154
- package/dist/cjs/features/RowExpanding.cjs.map +0 -1
- package/dist/cjs/features/RowExpanding.d.cts +0 -155
- package/dist/cjs/features/RowPagination.cjs +0 -162
- package/dist/cjs/features/RowPagination.cjs.map +0 -1
- package/dist/cjs/features/RowPagination.d.cts +0 -166
- package/dist/cjs/features/RowPinning.cjs +0 -133
- package/dist/cjs/features/RowPinning.cjs.map +0 -1
- package/dist/cjs/features/RowPinning.d.cts +0 -99
- package/dist/cjs/features/RowSelection.cjs +0 -298
- package/dist/cjs/features/RowSelection.cjs.map +0 -1
- package/dist/cjs/features/RowSelection.d.cts +0 -177
- package/dist/cjs/features/RowSorting.cjs +0 -201
- package/dist/cjs/features/RowSorting.cjs.map +0 -1
- package/dist/cjs/features/RowSorting.d.cts +0 -238
- package/dist/cjs/filterFns.cjs +0 -88
- package/dist/cjs/filterFns.cjs.map +0 -1
- package/dist/cjs/filterFns.d.cts +0 -14
- package/dist/cjs/index.cjs +0 -87
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/index.d.cts +0 -34
- package/dist/cjs/sortingFns.cjs +0 -91
- package/dist/cjs/sortingFns.cjs.map +0 -1
- package/dist/cjs/sortingFns.d.cts +0 -12
- package/dist/cjs/types.d.cts +0 -120
- package/dist/cjs/utils/filterRowsUtils.cjs +0 -99
- package/dist/cjs/utils/filterRowsUtils.cjs.map +0 -1
- package/dist/cjs/utils/filterRowsUtils.d.cts +0 -3
- package/dist/cjs/utils/getCoreRowModel.cjs +0 -54
- package/dist/cjs/utils/getCoreRowModel.cjs.map +0 -1
- package/dist/cjs/utils/getCoreRowModel.d.cts +0 -3
- package/dist/cjs/utils/getExpandedRowModel.cjs +0 -41
- package/dist/cjs/utils/getExpandedRowModel.cjs.map +0 -1
- package/dist/cjs/utils/getExpandedRowModel.d.cts +0 -8
- package/dist/cjs/utils/getFacetedMinMaxValues.cjs +0 -36
- package/dist/cjs/utils/getFacetedMinMaxValues.cjs.map +0 -1
- package/dist/cjs/utils/getFacetedMinMaxValues.d.cts +0 -3
- package/dist/cjs/utils/getFacetedRowModel.cjs +0 -35
- package/dist/cjs/utils/getFacetedRowModel.cjs.map +0 -1
- package/dist/cjs/utils/getFacetedRowModel.d.cts +0 -3
- package/dist/cjs/utils/getFacetedUniqueValues.cjs +0 -38
- package/dist/cjs/utils/getFacetedUniqueValues.cjs.map +0 -1
- package/dist/cjs/utils/getFacetedUniqueValues.d.cts +0 -3
- package/dist/cjs/utils/getFilteredRowModel.cjs +0 -116
- package/dist/cjs/utils/getFilteredRowModel.cjs.map +0 -1
- package/dist/cjs/utils/getFilteredRowModel.d.cts +0 -3
- package/dist/cjs/utils/getGroupedRowModel.cjs +0 -118
- package/dist/cjs/utils/getGroupedRowModel.cjs.map +0 -1
- package/dist/cjs/utils/getGroupedRowModel.d.cts +0 -3
- package/dist/cjs/utils/getPaginationRowModel.cjs +0 -49
- package/dist/cjs/utils/getPaginationRowModel.cjs.map +0 -1
- package/dist/cjs/utils/getPaginationRowModel.d.cts +0 -5
- package/dist/cjs/utils/getSortedRowModel.cjs +0 -91
- package/dist/cjs/utils/getSortedRowModel.cjs.map +0 -1
- package/dist/cjs/utils/getSortedRowModel.d.cts +0 -3
- package/dist/cjs/utils.cjs +0 -100
- package/dist/cjs/utils.cjs.map +0 -1
- package/dist/cjs/utils.d.cts +0 -39
- package/dist/esm/aggregationFns.d.ts +0 -14
- package/dist/esm/aggregationFns.js +0 -98
- package/dist/esm/aggregationFns.js.map +0 -1
- package/dist/esm/columnHelper.d.ts +0 -9
- package/dist/esm/columnHelper.js.map +0 -1
- package/dist/esm/core/cell.d.ts +0 -50
- package/dist/esm/core/cell.js +0 -38
- package/dist/esm/core/cell.js.map +0 -1
- package/dist/esm/core/column.d.ts +0 -56
- package/dist/esm/core/column.js +0 -81
- package/dist/esm/core/column.js.map +0 -1
- package/dist/esm/core/headers.d.ts +0 -195
- package/dist/esm/core/headers.js +0 -310
- package/dist/esm/core/headers.js.map +0 -1
- package/dist/esm/core/row.d.ts +0 -92
- package/dist/esm/core/row.js +0 -93
- package/dist/esm/core/row.js.map +0 -1
- package/dist/esm/core/table.d.ts +0 -221
- package/dist/esm/core/table.js +0 -228
- package/dist/esm/core/table.js.map +0 -1
- package/dist/esm/features/ColumnFaceting.d.ts +0 -35
- package/dist/esm/features/ColumnFaceting.js +0 -29
- package/dist/esm/features/ColumnFaceting.js.map +0 -1
- package/dist/esm/features/ColumnFiltering.d.ts +0 -195
- package/dist/esm/features/ColumnFiltering.js +0 -137
- package/dist/esm/features/ColumnFiltering.js.map +0 -1
- package/dist/esm/features/ColumnGrouping.d.ts +0 -202
- package/dist/esm/features/ColumnGrouping.js +0 -134
- package/dist/esm/features/ColumnGrouping.js.map +0 -1
- package/dist/esm/features/ColumnOrdering.d.ts +0 -54
- package/dist/esm/features/ColumnOrdering.js +0 -76
- package/dist/esm/features/ColumnOrdering.js.map +0 -1
- package/dist/esm/features/ColumnPinning.d.ts +0 -127
- package/dist/esm/features/ColumnPinning.js +0 -145
- package/dist/esm/features/ColumnPinning.js.map +0 -1
- package/dist/esm/features/ColumnSizing.d.ts +0 -194
- package/dist/esm/features/ColumnSizing.js +0 -308
- package/dist/esm/features/ColumnSizing.js.map +0 -1
- package/dist/esm/features/ColumnVisibility.d.ts +0 -130
- package/dist/esm/features/ColumnVisibility.js +0 -144
- package/dist/esm/features/ColumnVisibility.js.map +0 -1
- package/dist/esm/features/GlobalFaceting.d.ts +0 -27
- package/dist/esm/features/GlobalFaceting.js +0 -29
- package/dist/esm/features/GlobalFaceting.js.map +0 -1
- package/dist/esm/features/GlobalFiltering.d.ts +0 -80
- package/dist/esm/features/GlobalFiltering.js +0 -50
- package/dist/esm/features/GlobalFiltering.js.map +0 -1
- package/dist/esm/features/RowExpanding.d.ts +0 -155
- package/dist/esm/features/RowExpanding.js +0 -154
- package/dist/esm/features/RowExpanding.js.map +0 -1
- package/dist/esm/features/RowPagination.d.ts +0 -166
- package/dist/esm/features/RowPagination.js +0 -162
- package/dist/esm/features/RowPagination.js.map +0 -1
- package/dist/esm/features/RowPinning.d.ts +0 -99
- package/dist/esm/features/RowPinning.js +0 -133
- package/dist/esm/features/RowPinning.js.map +0 -1
- package/dist/esm/features/RowSelection.d.ts +0 -177
- package/dist/esm/features/RowSelection.js +0 -298
- package/dist/esm/features/RowSelection.js.map +0 -1
- package/dist/esm/features/RowSorting.d.ts +0 -238
- package/dist/esm/features/RowSorting.js +0 -201
- package/dist/esm/features/RowSorting.js.map +0 -1
- package/dist/esm/filterFns.d.ts +0 -14
- package/dist/esm/filterFns.js +0 -88
- package/dist/esm/filterFns.js.map +0 -1
- package/dist/esm/sortingFns.d.ts +0 -12
- package/dist/esm/sortingFns.js.map +0 -1
- package/dist/esm/types.d.ts +0 -120
- package/dist/esm/utils/filterRowsUtils.d.ts +0 -3
- package/dist/esm/utils/filterRowsUtils.js.map +0 -1
- package/dist/esm/utils/getCoreRowModel.d.ts +0 -3
- package/dist/esm/utils/getCoreRowModel.js +0 -54
- package/dist/esm/utils/getCoreRowModel.js.map +0 -1
- package/dist/esm/utils/getExpandedRowModel.d.ts +0 -8
- package/dist/esm/utils/getExpandedRowModel.js +0 -41
- package/dist/esm/utils/getExpandedRowModel.js.map +0 -1
- package/dist/esm/utils/getFacetedMinMaxValues.d.ts +0 -3
- package/dist/esm/utils/getFacetedMinMaxValues.js +0 -36
- package/dist/esm/utils/getFacetedMinMaxValues.js.map +0 -1
- package/dist/esm/utils/getFacetedRowModel.d.ts +0 -3
- package/dist/esm/utils/getFacetedRowModel.js +0 -35
- package/dist/esm/utils/getFacetedRowModel.js.map +0 -1
- package/dist/esm/utils/getFacetedUniqueValues.d.ts +0 -3
- package/dist/esm/utils/getFacetedUniqueValues.js +0 -38
- package/dist/esm/utils/getFacetedUniqueValues.js.map +0 -1
- package/dist/esm/utils/getFilteredRowModel.d.ts +0 -3
- package/dist/esm/utils/getFilteredRowModel.js +0 -116
- package/dist/esm/utils/getFilteredRowModel.js.map +0 -1
- package/dist/esm/utils/getGroupedRowModel.d.ts +0 -3
- package/dist/esm/utils/getGroupedRowModel.js +0 -118
- package/dist/esm/utils/getGroupedRowModel.js.map +0 -1
- package/dist/esm/utils/getPaginationRowModel.d.ts +0 -5
- package/dist/esm/utils/getPaginationRowModel.js +0 -49
- package/dist/esm/utils/getPaginationRowModel.js.map +0 -1
- package/dist/esm/utils/getSortedRowModel.d.ts +0 -3
- package/dist/esm/utils/getSortedRowModel.js +0 -91
- package/dist/esm/utils/getSortedRowModel.js.map +0 -1
- package/src/aggregationFns.ts +0 -123
- package/src/columnHelper.ts +0 -91
- package/src/core/cell.ts +0 -91
- package/src/core/column.ts +0 -165
- package/src/core/headers.ts +0 -639
- package/src/core/row.ts +0 -201
- package/src/core/table.ts +0 -527
- package/src/features/ColumnFaceting.ts +0 -84
- package/src/features/ColumnFiltering.ts +0 -429
- package/src/features/ColumnGrouping.ts +0 -422
- package/src/features/ColumnOrdering.ts +0 -161
- package/src/features/ColumnPinning.ts +0 -336
- package/src/features/ColumnSizing.ts +0 -579
- package/src/features/ColumnVisibility.ts +0 -317
- package/src/features/GlobalFaceting.ts +0 -66
- package/src/features/GlobalFiltering.ts +0 -162
- package/src/features/RowExpanding.ts +0 -355
- package/src/features/RowPagination.ts +0 -396
- package/src/features/RowPinning.ts +0 -273
- package/src/features/RowSelection.ts +0 -668
- package/src/features/RowSorting.ts +0 -542
- package/src/filterFns.ts +0 -150
- package/src/types.ts +0 -361
- package/src/utils/filterRowsUtils.ts +0 -130
- package/src/utils/getCoreRowModel.ts +0 -82
- package/src/utils/getExpandedRowModel.ts +0 -51
- package/src/utils/getFacetedMinMaxValues.ts +0 -42
- package/src/utils/getFacetedRowModel.ts +0 -44
- package/src/utils/getFacetedUniqueValues.ts +0 -42
- package/src/utils/getFilteredRowModel.ts +0 -151
- package/src/utils/getGroupedRowModel.ts +0 -181
- package/src/utils/getPaginationRowModel.ts +0 -60
- package/src/utils/getSortedRowModel.ts +0 -121
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Table_Internal } from '../../types/Table.js';
|
|
2
|
+
import { CellData, RowData } from '../../types/type-utils.js';
|
|
3
|
+
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
4
|
+
import { Row } from '../../types/Row.js';
|
|
5
|
+
import { Cell } from '../../types/Cell.js';
|
|
6
|
+
import { Column } from '../../types/Column.js';
|
|
7
|
+
export declare function constructCell<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column<TFeatures, TData, TValue>, row: Row<TFeatures, TData>, table: Table_Internal<TFeatures, TData>): Cell<TFeatures, TData, TValue>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function getCellPrototype(table) {
|
|
2
|
+
if (!table._cellPrototype) {
|
|
3
|
+
table._cellPrototype = { table };
|
|
4
|
+
for (const feature of Object.values(table._features)) {
|
|
5
|
+
feature.assignCellPrototype?.(table._cellPrototype, table);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return table._cellPrototype;
|
|
9
|
+
}
|
|
10
|
+
function constructCell(column, row, table) {
|
|
11
|
+
const cellPrototype = getCellPrototype(table);
|
|
12
|
+
const cell = Object.create(cellPrototype);
|
|
13
|
+
cell.column = column;
|
|
14
|
+
cell.id = `${row.id}_${column.id}`;
|
|
15
|
+
cell.row = row;
|
|
16
|
+
return cell;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
constructCell
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=constructCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructCell.js","sources":["../../../../src/core/cells/constructCell.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 { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\nimport type { Column } from '../../types/Column'\nimport type { Cell_CoreProperties } from './coreCellsFeature.types'\n\n/**\n * Creates or retrieves the cell prototype for a table.\n * The prototype is cached on the table and shared by all cell instances.\n */\nfunction getCellPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._cellPrototype) {\n table._cellPrototype = { table }\n for (const feature of Object.values(table._features)) {\n feature.assignCellPrototype?.(table._cellPrototype, table)\n }\n }\n return table._cellPrototype\n}\n\nexport function constructCell<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n column: Column<TFeatures, TData, TValue>,\n row: Row<TFeatures, TData>,\n table: Table_Internal<TFeatures, TData>,\n): Cell<TFeatures, TData, TValue> {\n // Create cell with shared prototype for memory efficiency\n const cellPrototype = getCellPrototype(table)\n const cell = Object.create(cellPrototype) as Cell_CoreProperties<\n TFeatures,\n TData,\n TValue\n >\n\n // Only assign instance-specific properties\n cell.column = column\n cell.id = `${row.id}_${column.id}`\n cell.row = row\n\n return cell as Cell<TFeatures, TData, TValue>\n}\n"],"names":[],"mappings":"AAYA,SAAS,iBAGP,OAAiD;AACjD,MAAI,CAAC,MAAM,gBAAgB;AACzB,UAAM,iBAAiB,EAAE,MAAA;AACzB,eAAW,WAAW,OAAO,OAAO,MAAM,SAAS,GAAG;AACpD,cAAQ,sBAAsB,MAAM,gBAAgB,KAAK;AAAA,IAC3D;AAAA,EACF;AACA,SAAO,MAAM;AACf;AAEO,SAAS,cAKd,QACA,KACA,OACgC;AAEhC,QAAM,gBAAgB,iBAAiB,KAAK;AAC5C,QAAM,OAAO,OAAO,OAAO,aAAa;AAOxC,OAAK,SAAS;AACd,OAAK,KAAK,GAAG,IAAI,EAAE,IAAI,OAAO,EAAE;AAChC,OAAK,MAAM;AAEX,SAAO;AACT;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RowData } from '../../types/type-utils.js';
|
|
2
|
+
import { TableFeature, TableFeatures } from '../../types/TableFeatures.js';
|
|
3
|
+
interface CoreCellsFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {
|
|
4
|
+
}
|
|
5
|
+
export declare function constructCoreCellsFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<CoreCellsFeatureConstructors<TFeatures, TData>>;
|
|
6
|
+
/**
|
|
7
|
+
* The Core Cells feature provides the core cell functionality.
|
|
8
|
+
*/
|
|
9
|
+
export declare const coreCellsFeature: TableFeature<CoreCellsFeatureConstructors<TableFeatures, RowData>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { assignPrototypeAPIs } from "../../utils.js";
|
|
2
|
+
import { cell_getContext, cell_renderValue, cell_getValue } from "./coreCellsFeature.utils.js";
|
|
3
|
+
function constructCoreCellsFeature() {
|
|
4
|
+
return {
|
|
5
|
+
assignCellPrototype: (prototype, table) => {
|
|
6
|
+
assignPrototypeAPIs("coreCellsFeature", prototype, table, {
|
|
7
|
+
cell_getValue: {
|
|
8
|
+
fn: (cell) => cell_getValue(cell)
|
|
9
|
+
},
|
|
10
|
+
cell_renderValue: {
|
|
11
|
+
fn: (cell) => cell_renderValue(cell)
|
|
12
|
+
},
|
|
13
|
+
cell_getContext: {
|
|
14
|
+
fn: (cell) => cell_getContext(cell),
|
|
15
|
+
memoDeps: (cell) => [cell]
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const coreCellsFeature = constructCoreCellsFeature();
|
|
22
|
+
export {
|
|
23
|
+
constructCoreCellsFeature,
|
|
24
|
+
coreCellsFeature
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=coreCellsFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreCellsFeature.js","sources":["../../../../src/core/cells/coreCellsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs } from '../../utils'\nimport {\n cell_getContext,\n cell_getValue,\n cell_renderValue,\n} from './coreCellsFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type { Cell_Cell, TableOptions_Cell } from './coreCellsFeature.types'\n\ninterface CoreCellsFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Cell: Cell_Cell<TableFeatures, RowData>\n // TableOptions: TableOptions_Cell\n}\n\nexport function constructCoreCellsFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<CoreCellsFeatureConstructors<TFeatures, TData>> {\n return {\n assignCellPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreCellsFeature', prototype, table, {\n cell_getValue: {\n fn: (cell) => cell_getValue(cell),\n },\n cell_renderValue: {\n fn: (cell) => cell_renderValue(cell),\n },\n cell_getContext: {\n fn: (cell) => cell_getContext(cell),\n memoDeps: (cell) => [cell],\n },\n })\n },\n }\n}\n\n/**\n * The Core Cells feature provides the core cell functionality.\n */\nexport const coreCellsFeature = constructCoreCellsFeature()\n"],"names":[],"mappings":";;AAkBO,SAAS,4BAGkD;AAChE,SAAO;AAAA,IACL,qBAAqB,CAAC,WAAW,UAAU;AACzC,0BAAoB,oBAAoB,WAAW,OAAO;AAAA,QACxD,eAAe;AAAA,UACb,IAAI,CAAC,SAAS,cAAc,IAAI;AAAA,QAAA;AAAA,QAElC,kBAAkB;AAAA,UAChB,IAAI,CAAC,SAAS,iBAAiB,IAAI;AAAA,QAAA;AAAA,QAErC,iBAAiB;AAAA,UACf,IAAI,CAAC,SAAS,gBAAgB,IAAI;AAAA,UAClC,UAAU,CAAC,SAAS,CAAC,IAAI;AAAA,QAAA;AAAA,MAC3B,CACD;AAAA,IACH;AAAA,EAAA;AAEJ;AAKO,MAAM,mBAAmB,0BAAA;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CellData, Getter, RowData } from '../../types/type-utils.js';
|
|
2
|
+
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
3
|
+
import { Table, Table_Internal } from '../../types/Table.js';
|
|
4
|
+
import { Row } from '../../types/Row.js';
|
|
5
|
+
import { Cell } from '../../types/Cell.js';
|
|
6
|
+
import { Column } from '../../types/Column.js';
|
|
7
|
+
export interface CellContext<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
|
|
8
|
+
cell: Cell<TFeatures, TData, TValue>;
|
|
9
|
+
column: Column<TFeatures, TData, TValue>;
|
|
10
|
+
getValue: Getter<TValue>;
|
|
11
|
+
renderValue: Getter<TValue | null>;
|
|
12
|
+
row: Row<TFeatures, TData>;
|
|
13
|
+
table: Table<TFeatures, TData>;
|
|
14
|
+
}
|
|
15
|
+
export interface Cell_CoreProperties<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
|
|
16
|
+
/**
|
|
17
|
+
* The associated Column object for the cell.
|
|
18
|
+
*/
|
|
19
|
+
column: Column<TFeatures, TData, TValue>;
|
|
20
|
+
/**
|
|
21
|
+
* The unique ID for the cell across the entire table.
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* The associated Row object for the cell.
|
|
26
|
+
*/
|
|
27
|
+
row: Row<TFeatures, TData>;
|
|
28
|
+
/**
|
|
29
|
+
* Reference to the parent table instance.
|
|
30
|
+
*/
|
|
31
|
+
table: Table_Internal<TFeatures, TData>;
|
|
32
|
+
}
|
|
33
|
+
export interface Cell_Cell<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> extends Cell_CoreProperties<TFeatures, TData, TValue> {
|
|
34
|
+
/**
|
|
35
|
+
* Returns the rendering context (or props) for cell-based components like cells and aggregated cells. Use these props with your framework's `flexRender` utility to render these using the template of your choice:
|
|
36
|
+
*/
|
|
37
|
+
getContext: () => CellContext<TFeatures, TData, TValue>;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the value for the cell, accessed via the associated column's accessor key or accessor function.
|
|
40
|
+
*/
|
|
41
|
+
getValue: CellContext<TFeatures, TData, TValue>['getValue'];
|
|
42
|
+
/**
|
|
43
|
+
* Renders the value for a cell the same as `getValue`, but will return the `renderFallbackValue` if no value is found.
|
|
44
|
+
*/
|
|
45
|
+
renderValue: CellContext<TFeatures, TData, TValue>['renderValue'];
|
|
46
|
+
}
|
|
47
|
+
export interface TableOptions_Cell {
|
|
48
|
+
/**
|
|
49
|
+
* Value used when the desired value is not found in the data.
|
|
50
|
+
*/
|
|
51
|
+
renderFallbackValue?: any;
|
|
52
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CellData, RowData } from '../../types/type-utils.js';
|
|
2
|
+
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
3
|
+
import { Cell } from '../../types/Cell.js';
|
|
4
|
+
export declare function cell_getValue<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(cell: Cell<TFeatures, TData, TValue>): TValue;
|
|
5
|
+
export declare function cell_renderValue<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(cell: Cell<TFeatures, TData, TValue>): any;
|
|
6
|
+
export declare function cell_getContext<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(cell: Cell<TFeatures, TData, TValue>): {
|
|
7
|
+
table: import('../..').Table_Internal<TFeatures, TData>;
|
|
8
|
+
column: import('../..').Column<TFeatures, TData, TValue>;
|
|
9
|
+
row: import('../..').Row<TFeatures, TData>;
|
|
10
|
+
cell: Cell<TFeatures, TData, TValue>;
|
|
11
|
+
getValue: () => import('../..').NoInfer<TValue>;
|
|
12
|
+
renderValue: () => import('../..').NoInfer<TValue | null>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function cell_getValue(cell) {
|
|
2
|
+
return cell.row.getValue(cell.column.id);
|
|
3
|
+
}
|
|
4
|
+
function cell_renderValue(cell) {
|
|
5
|
+
return cell.getValue() ?? cell.table.options.renderFallbackValue;
|
|
6
|
+
}
|
|
7
|
+
function cell_getContext(cell) {
|
|
8
|
+
return {
|
|
9
|
+
table: cell.table,
|
|
10
|
+
column: cell.column,
|
|
11
|
+
row: cell.row,
|
|
12
|
+
cell,
|
|
13
|
+
// Wrap in arrow functions to preserve `this` binding (methods are on prototype)
|
|
14
|
+
getValue: () => cell.getValue(),
|
|
15
|
+
renderValue: () => cell.renderValue()
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
cell_getContext,
|
|
20
|
+
cell_getValue,
|
|
21
|
+
cell_renderValue
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=coreCellsFeature.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreCellsFeature.utils.js","sources":["../../../../src/core/cells/coreCellsFeature.utils.ts"],"sourcesContent":["import type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Cell } from '../../types/Cell'\n\nexport function cell_getValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(cell: Cell<TFeatures, TData, TValue>): TValue {\n return cell.row.getValue(cell.column.id)\n}\n\nexport function cell_renderValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(cell: Cell<TFeatures, TData, TValue>) {\n return cell.getValue() ?? cell.table.options.renderFallbackValue\n}\n\nexport function cell_getContext<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(cell: Cell<TFeatures, TData, TValue>) {\n return {\n table: cell.table,\n column: cell.column,\n row: cell.row,\n cell: cell,\n // Wrap in arrow functions to preserve `this` binding (methods are on prototype)\n getValue: () => cell.getValue(),\n renderValue: () => cell.renderValue(),\n }\n}\n"],"names":[],"mappings":"AAIO,SAAS,cAId,MAA8C;AAC9C,SAAO,KAAK,IAAI,SAAS,KAAK,OAAO,EAAE;AACzC;AAEO,SAAS,iBAId,MAAsC;AACtC,SAAO,KAAK,SAAA,KAAc,KAAK,MAAM,QAAQ;AAC/C;AAEO,SAAS,gBAId,MAAsC;AACtC,SAAO;AAAA,IACL,OAAO,KAAK;AAAA,IACZ,QAAQ,KAAK;AAAA,IACb,KAAK,KAAK;AAAA,IACV;AAAA;AAAA,IAEA,UAAU,MAAM,KAAK,SAAA;AAAA,IACrB,aAAa,MAAM,KAAK,YAAA;AAAA,EAAY;AAExC;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Table_Internal } from '../../types/Table.js';
|
|
2
|
+
import { CellData, RowData } from '../../types/type-utils.js';
|
|
3
|
+
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
4
|
+
import { ColumnDef } from '../../types/ColumnDef.js';
|
|
5
|
+
import { Column } from '../../types/Column.js';
|
|
6
|
+
export declare function constructColumn<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(table: Table_Internal<TFeatures, TData>, columnDef: ColumnDef<TFeatures, TData, TValue>, depth: number, parent?: Column<TFeatures, TData, TValue>): Column<TFeatures, TData, TValue>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
function getColumnPrototype(table) {
|
|
2
|
+
if (!table._columnPrototype) {
|
|
3
|
+
table._columnPrototype = { table };
|
|
4
|
+
for (const feature of Object.values(table._features)) {
|
|
5
|
+
feature.assignColumnPrototype?.(table._columnPrototype, table);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return table._columnPrototype;
|
|
9
|
+
}
|
|
10
|
+
function constructColumn(table, columnDef, depth, parent) {
|
|
11
|
+
const defaultColumn = table.getDefaultColumnDef();
|
|
12
|
+
const resolvedColumnDef = {
|
|
13
|
+
...defaultColumn,
|
|
14
|
+
...columnDef
|
|
15
|
+
};
|
|
16
|
+
const accessorKey = resolvedColumnDef.accessorKey;
|
|
17
|
+
const id = resolvedColumnDef.id ?? (accessorKey ? accessorKey.replaceAll(".", "_") : void 0) ?? (typeof resolvedColumnDef.header === "string" ? resolvedColumnDef.header : void 0);
|
|
18
|
+
let accessorFn;
|
|
19
|
+
if (resolvedColumnDef.accessorFn) {
|
|
20
|
+
accessorFn = resolvedColumnDef.accessorFn;
|
|
21
|
+
} else if (accessorKey) {
|
|
22
|
+
if (accessorKey.includes(".")) {
|
|
23
|
+
accessorFn = (originalRow) => {
|
|
24
|
+
let result = originalRow;
|
|
25
|
+
for (const key of accessorKey.split(".")) {
|
|
26
|
+
result = result?.[key];
|
|
27
|
+
if (process.env.NODE_ENV === "development" && result === void 0) {
|
|
28
|
+
console.warn(
|
|
29
|
+
`"${key}" in deeply nested key "${accessorKey}" returned undefined.`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
} else {
|
|
36
|
+
accessorFn = (originalRow) => originalRow[resolvedColumnDef.accessorKey];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (!id) {
|
|
40
|
+
if (process.env.NODE_ENV === "development") {
|
|
41
|
+
throw new Error(
|
|
42
|
+
resolvedColumnDef.accessorFn ? `coreColumnsFeature require an id when using an accessorFn` : `coreColumnsFeature require an id when using a non-string header`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
throw new Error();
|
|
46
|
+
}
|
|
47
|
+
const columnPrototype = getColumnPrototype(table);
|
|
48
|
+
const column = Object.create(columnPrototype);
|
|
49
|
+
column.accessorFn = accessorFn;
|
|
50
|
+
column.columnDef = resolvedColumnDef;
|
|
51
|
+
column.columns = [];
|
|
52
|
+
column.depth = depth;
|
|
53
|
+
column.id = `${String(id)}`;
|
|
54
|
+
column.parent = parent;
|
|
55
|
+
return column;
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
constructColumn
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=constructColumn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructColumn.js","sources":["../../../../src/core/columns/constructColumn.ts"],"sourcesContent":["import {} from '../../utils'\nimport type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type {\n AccessorFn,\n ColumnDef,\n ColumnDefResolved,\n} from '../../types/ColumnDef'\nimport type { Column } from '../../types/Column'\nimport type { Column_CoreProperties } from './coreColumnsFeature.types'\n\n/**\n * Creates or retrieves the column prototype for a table.\n * The prototype is cached on the table and shared by all column instances.\n */\nfunction getColumnPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._columnPrototype) {\n table._columnPrototype = { table }\n for (const feature of Object.values(table._features)) {\n feature.assignColumnPrototype?.(table._columnPrototype, table)\n }\n }\n return table._columnPrototype\n}\n\nexport function constructColumn<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n table: Table_Internal<TFeatures, TData>,\n columnDef: ColumnDef<TFeatures, TData, TValue>,\n depth: number,\n parent?: Column<TFeatures, TData, TValue>,\n): Column<TFeatures, TData, TValue> {\n const defaultColumn = table.getDefaultColumnDef()\n\n const resolvedColumnDef = {\n ...defaultColumn,\n ...columnDef,\n } as ColumnDefResolved<{}, TData, TValue>\n\n const accessorKey = resolvedColumnDef.accessorKey\n\n const id =\n resolvedColumnDef.id ??\n (accessorKey ? accessorKey.replaceAll('.', '_') : undefined) ??\n (typeof resolvedColumnDef.header === 'string'\n ? resolvedColumnDef.header\n : undefined)\n\n let accessorFn: AccessorFn<TData, TValue> | undefined\n\n if (resolvedColumnDef.accessorFn) {\n accessorFn = resolvedColumnDef.accessorFn\n } else if (accessorKey) {\n // Support deep accessor keys\n if (accessorKey.includes('.')) {\n accessorFn = (originalRow: TData) => {\n let result = originalRow as Record<string, any> | undefined\n\n for (const key of accessorKey.split('.')) {\n result = result?.[key]\n if (process.env.NODE_ENV === 'development' && result === undefined) {\n console.warn(\n `\"${key}\" in deeply nested key \"${accessorKey}\" returned undefined.`,\n )\n }\n }\n\n return result as TValue\n }\n } else {\n accessorFn = (originalRow: TData) =>\n (originalRow as any)[resolvedColumnDef.accessorKey]\n }\n }\n\n if (!id) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(\n resolvedColumnDef.accessorFn\n ? `coreColumnsFeature require an id when using an accessorFn`\n : `coreColumnsFeature require an id when using a non-string header`,\n )\n }\n throw new Error()\n }\n\n // Create column with shared prototype for memory efficiency\n const columnPrototype = getColumnPrototype(table)\n const column = Object.create(columnPrototype) as Column_CoreProperties<\n TFeatures,\n TData,\n TValue\n >\n\n // Only assign instance-specific properties\n column.accessorFn = accessorFn\n column.columnDef = resolvedColumnDef as ColumnDef<TFeatures, TData, TValue>\n column.columns = []\n column.depth = depth\n column.id = `${String(id)}`\n column.parent = parent\n\n return column as Column<TFeatures, TData, TValue>\n}\n"],"names":[],"mappings":"AAgBA,SAAS,mBAGP,OAAiD;AACjD,MAAI,CAAC,MAAM,kBAAkB;AAC3B,UAAM,mBAAmB,EAAE,MAAA;AAC3B,eAAW,WAAW,OAAO,OAAO,MAAM,SAAS,GAAG;AACpD,cAAQ,wBAAwB,MAAM,kBAAkB,KAAK;AAAA,IAC/D;AAAA,EACF;AACA,SAAO,MAAM;AACf;AAEO,SAAS,gBAKd,OACA,WACA,OACA,QACkC;AAClC,QAAM,gBAAgB,MAAM,oBAAA;AAE5B,QAAM,oBAAoB;AAAA,IACxB,GAAG;AAAA,IACH,GAAG;AAAA,EAAA;AAGL,QAAM,cAAc,kBAAkB;AAEtC,QAAM,KACJ,kBAAkB,OACjB,cAAc,YAAY,WAAW,KAAK,GAAG,IAAI,YACjD,OAAO,kBAAkB,WAAW,WACjC,kBAAkB,SAClB;AAEN,MAAI;AAEJ,MAAI,kBAAkB,YAAY;AAChC,iBAAa,kBAAkB;AAAA,EACjC,WAAW,aAAa;AAEtB,QAAI,YAAY,SAAS,GAAG,GAAG;AAC7B,mBAAa,CAAC,gBAAuB;AACnC,YAAI,SAAS;AAEb,mBAAW,OAAO,YAAY,MAAM,GAAG,GAAG;AACxC,mBAAS,SAAS,GAAG;AACrB,cAAI,QAAQ,IAAI,aAAa,iBAAiB,WAAW,QAAW;AAClE,oBAAQ;AAAA,cACN,IAAI,GAAG,2BAA2B,WAAW;AAAA,YAAA;AAAA,UAEjD;AAAA,QACF;AAEA,eAAO;AAAA,MACT;AAAA,IACF,OAAO;AACL,mBAAa,CAAC,gBACX,YAAoB,kBAAkB,WAAW;AAAA,IACtD;AAAA,EACF;AAEA,MAAI,CAAC,IAAI;AACP,QAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,YAAM,IAAI;AAAA,QACR,kBAAkB,aACd,8DACA;AAAA,MAAA;AAAA,IAER;AACA,UAAM,IAAI,MAAA;AAAA,EACZ;AAGA,QAAM,kBAAkB,mBAAmB,KAAK;AAChD,QAAM,SAAS,OAAO,OAAO,eAAe;AAO5C,SAAO,aAAa;AACpB,SAAO,YAAY;AACnB,SAAO,UAAU,CAAA;AACjB,SAAO,QAAQ;AACf,SAAO,KAAK,GAAG,OAAO,EAAE,CAAC;AACzB,SAAO,SAAS;AAEhB,SAAO;AACT;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RowData } from '../../types/type-utils.js';
|
|
2
|
+
import { TableFeature, TableFeatures } from '../../types/TableFeatures.js';
|
|
3
|
+
interface CoreColumnsFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {
|
|
4
|
+
}
|
|
5
|
+
export declare function constructCoreColumnsFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<CoreColumnsFeatureConstructors<TFeatures, TData>>;
|
|
6
|
+
/**
|
|
7
|
+
* The Core Columns feature provides the core column functionality.
|
|
8
|
+
*/
|
|
9
|
+
export declare const coreColumnsFeature: TableFeature<CoreColumnsFeatureConstructors<TableFeatures, RowData>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { assignTableAPIs, assignPrototypeAPIs } from "../../utils.js";
|
|
2
|
+
import { table_getColumn, table_getAllLeafColumns, table_getAllFlatColumnsById, table_getAllFlatColumns, table_getAllColumns, table_getDefaultColumnDef, column_getLeafColumns, column_getFlatColumns } from "./coreColumnsFeature.utils.js";
|
|
3
|
+
function constructCoreColumnsFeature() {
|
|
4
|
+
return {
|
|
5
|
+
assignColumnPrototype: (prototype, table) => {
|
|
6
|
+
assignPrototypeAPIs("coreColumnsFeature", prototype, table, {
|
|
7
|
+
column_getFlatColumns: {
|
|
8
|
+
fn: (column) => column_getFlatColumns(column),
|
|
9
|
+
memoDeps: (column) => [column.table.options.columns]
|
|
10
|
+
},
|
|
11
|
+
column_getLeafColumns: {
|
|
12
|
+
fn: (column) => column_getLeafColumns(column),
|
|
13
|
+
memoDeps: (column) => [
|
|
14
|
+
column.table.store.state.columnOrder,
|
|
15
|
+
column.table.store.state.grouping,
|
|
16
|
+
column.table.options.columns,
|
|
17
|
+
column.table.options.groupedColumnMode
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
constructTableAPIs: (table) => {
|
|
23
|
+
assignTableAPIs("coreColumnsFeature", table, {
|
|
24
|
+
table_getDefaultColumnDef: {
|
|
25
|
+
fn: () => table_getDefaultColumnDef(table),
|
|
26
|
+
memoDeps: () => [table.options.defaultColumn]
|
|
27
|
+
},
|
|
28
|
+
table_getAllColumns: {
|
|
29
|
+
fn: () => table_getAllColumns(table),
|
|
30
|
+
memoDeps: () => [table.options.columns]
|
|
31
|
+
},
|
|
32
|
+
table_getAllFlatColumns: {
|
|
33
|
+
fn: () => table_getAllFlatColumns(table),
|
|
34
|
+
memoDeps: () => [table.options.columns]
|
|
35
|
+
},
|
|
36
|
+
table_getAllFlatColumnsById: {
|
|
37
|
+
fn: () => table_getAllFlatColumnsById(table),
|
|
38
|
+
memoDeps: () => [table.options.columns]
|
|
39
|
+
},
|
|
40
|
+
table_getAllLeafColumns: {
|
|
41
|
+
fn: () => table_getAllLeafColumns(table),
|
|
42
|
+
memoDeps: () => [
|
|
43
|
+
table.store.state.columnOrder,
|
|
44
|
+
table.store.state.grouping,
|
|
45
|
+
table.options.columns,
|
|
46
|
+
table.options.groupedColumnMode
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
table_getColumn: {
|
|
50
|
+
fn: (columnId) => table_getColumn(table, columnId)
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const coreColumnsFeature = constructCoreColumnsFeature();
|
|
57
|
+
export {
|
|
58
|
+
constructCoreColumnsFeature,
|
|
59
|
+
coreColumnsFeature
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=coreColumnsFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreColumnsFeature.js","sources":["../../../../src/core/columns/coreColumnsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n column_getFlatColumns,\n column_getLeafColumns,\n table_getAllColumns,\n table_getAllFlatColumns,\n table_getAllFlatColumnsById,\n table_getAllLeafColumns,\n table_getColumn,\n table_getDefaultColumnDef,\n} from './coreColumnsFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// Column_Column,\n// TableOptions_Columns,\n// Table_Columns,\n// } from './coreColumnsFeature.types'\n\ninterface CoreColumnsFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Column: Column_Column<TFeatures, TData>\n // Table: Table_Columns<TFeatures, TData>\n // TableOptions: TableOptions_Columns<TFeatures, TData>\n}\n\nexport function constructCoreColumnsFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<CoreColumnsFeatureConstructors<TFeatures, TData>> {\n return {\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreColumnsFeature', prototype, table, {\n column_getFlatColumns: {\n fn: (column) => column_getFlatColumns(column),\n memoDeps: (column) => [column.table.options.columns],\n },\n column_getLeafColumns: {\n fn: (column) => column_getLeafColumns(column),\n memoDeps: (column) => [\n column.table.store.state.columnOrder,\n column.table.store.state.grouping,\n column.table.options.columns,\n column.table.options.groupedColumnMode,\n ],\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('coreColumnsFeature', table, {\n table_getDefaultColumnDef: {\n fn: () => table_getDefaultColumnDef(table),\n memoDeps: () => [table.options.defaultColumn],\n },\n table_getAllColumns: {\n fn: () => table_getAllColumns(table),\n memoDeps: () => [table.options.columns],\n },\n table_getAllFlatColumns: {\n fn: () => table_getAllFlatColumns(table),\n memoDeps: () => [table.options.columns],\n },\n table_getAllFlatColumnsById: {\n fn: () => table_getAllFlatColumnsById(table),\n memoDeps: () => [table.options.columns],\n },\n table_getAllLeafColumns: {\n fn: () => table_getAllLeafColumns(table),\n memoDeps: () => [\n table.store.state.columnOrder,\n table.store.state.grouping,\n table.options.columns,\n table.options.groupedColumnMode,\n ],\n },\n table_getColumn: {\n fn: (columnId) => table_getColumn(table, columnId),\n },\n })\n },\n }\n}\n\n/**\n * The Core Columns feature provides the core column functionality.\n */\nexport const coreColumnsFeature = constructCoreColumnsFeature()\n"],"names":[],"mappings":";;AA4BO,SAAS,8BAGoD;AAClE,SAAO;AAAA,IACL,uBAAuB,CAAC,WAAW,UAAU;AAC3C,0BAAoB,sBAAsB,WAAW,OAAO;AAAA,QAC1D,uBAAuB;AAAA,UACrB,IAAI,CAAC,WAAW,sBAAsB,MAAM;AAAA,UAC5C,UAAU,CAAC,WAAW,CAAC,OAAO,MAAM,QAAQ,OAAO;AAAA,QAAA;AAAA,QAErD,uBAAuB;AAAA,UACrB,IAAI,CAAC,WAAW,sBAAsB,MAAM;AAAA,UAC5C,UAAU,CAAC,WAAW;AAAA,YACpB,OAAO,MAAM,MAAM,MAAM;AAAA,YACzB,OAAO,MAAM,MAAM,MAAM;AAAA,YACzB,OAAO,MAAM,QAAQ;AAAA,YACrB,OAAO,MAAM,QAAQ;AAAA,UAAA;AAAA,QACvB;AAAA,MACF,CACD;AAAA,IACH;AAAA,IAEA,oBAAoB,CAAC,UAAU;AAC7B,sBAAgB,sBAAsB,OAAO;AAAA,QAC3C,2BAA2B;AAAA,UACzB,IAAI,MAAM,0BAA0B,KAAK;AAAA,UACzC,UAAU,MAAM,CAAC,MAAM,QAAQ,aAAa;AAAA,QAAA;AAAA,QAE9C,qBAAqB;AAAA,UACnB,IAAI,MAAM,oBAAoB,KAAK;AAAA,UACnC,UAAU,MAAM,CAAC,MAAM,QAAQ,OAAO;AAAA,QAAA;AAAA,QAExC,yBAAyB;AAAA,UACvB,IAAI,MAAM,wBAAwB,KAAK;AAAA,UACvC,UAAU,MAAM,CAAC,MAAM,QAAQ,OAAO;AAAA,QAAA;AAAA,QAExC,6BAA6B;AAAA,UAC3B,IAAI,MAAM,4BAA4B,KAAK;AAAA,UAC3C,UAAU,MAAM,CAAC,MAAM,QAAQ,OAAO;AAAA,QAAA;AAAA,QAExC,yBAAyB;AAAA,UACvB,IAAI,MAAM,wBAAwB,KAAK;AAAA,UACvC,UAAU,MAAM;AAAA,YACd,MAAM,MAAM,MAAM;AAAA,YAClB,MAAM,MAAM,MAAM;AAAA,YAClB,MAAM,QAAQ;AAAA,YACd,MAAM,QAAQ;AAAA,UAAA;AAAA,QAChB;AAAA,QAEF,iBAAiB;AAAA,UACf,IAAI,CAAC,aAAa,gBAAgB,OAAO,QAAQ;AAAA,QAAA;AAAA,MACnD,CACD;AAAA,IACH;AAAA,EAAA;AAEJ;AAKO,MAAM,qBAAqB,4BAAA;"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Table_Internal } from '../../types/Table.js';
|
|
2
|
+
import { CellData, RowData } from '../../types/type-utils.js';
|
|
3
|
+
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
4
|
+
import { AccessorFn, ColumnDef } from '../../types/ColumnDef.js';
|
|
5
|
+
import { Column } from '../../types/Column.js';
|
|
6
|
+
export interface Column_CoreProperties<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
|
|
7
|
+
/**
|
|
8
|
+
* The resolved accessor function to use when extracting the value for the column from each row. Will only be defined if the column def has a valid accessor key or function defined.
|
|
9
|
+
*/
|
|
10
|
+
accessorFn?: AccessorFn<TData, TValue>;
|
|
11
|
+
/**
|
|
12
|
+
* The original column def used to create the column.
|
|
13
|
+
*/
|
|
14
|
+
columnDef: ColumnDef<TFeatures, TData, TValue>;
|
|
15
|
+
/**
|
|
16
|
+
* The child column (if the column is a group column). Will be an empty array if the column is not a group column.
|
|
17
|
+
*/
|
|
18
|
+
columns: Array<Column<TFeatures, TData, TValue>>;
|
|
19
|
+
/**
|
|
20
|
+
* The depth of the column (if grouped) relative to the root column def array.
|
|
21
|
+
*/
|
|
22
|
+
depth: number;
|
|
23
|
+
/**
|
|
24
|
+
* The resolved unique identifier for the column resolved in this priority:
|
|
25
|
+
- A manual `id` property from the column def
|
|
26
|
+
- The accessor key from the column def
|
|
27
|
+
- The header string from the column def
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* The parent column for this column. Will be undefined if this is a root column.
|
|
32
|
+
*/
|
|
33
|
+
parent?: Column<TFeatures, TData, TValue>;
|
|
34
|
+
/**
|
|
35
|
+
* Reference to the parent table instance.
|
|
36
|
+
*/
|
|
37
|
+
table: Table_Internal<TFeatures, TData>;
|
|
38
|
+
}
|
|
39
|
+
export interface Column_Column<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> extends Column_CoreProperties<TFeatures, TData, TValue> {
|
|
40
|
+
/**
|
|
41
|
+
* Returns the flattened array of this column and all child/grand-child columns for this column.
|
|
42
|
+
*/
|
|
43
|
+
getFlatColumns: () => Array<Column<TFeatures, TData, TValue>>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns an array of all leaf-node columns for this column. If a column has no children, it is considered the only leaf-node column.
|
|
46
|
+
*/
|
|
47
|
+
getLeafColumns: () => Array<Column<TFeatures, TData, TValue>>;
|
|
48
|
+
}
|
|
49
|
+
export interface TableOptions_Columns<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
|
|
50
|
+
/**
|
|
51
|
+
* The array of column defs to use for the table.
|
|
52
|
+
*/
|
|
53
|
+
columns: Array<ColumnDef<TFeatures, TData, TValue>>;
|
|
54
|
+
/**
|
|
55
|
+
* Default column options to use for all column defs supplied to the table.
|
|
56
|
+
*/
|
|
57
|
+
defaultColumn?: Partial<ColumnDef<TFeatures, TData, TValue>>;
|
|
58
|
+
}
|
|
59
|
+
export interface Table_Columns<TFeatures extends TableFeatures, TData extends RowData> {
|
|
60
|
+
/**
|
|
61
|
+
* Returns a map of all flat columns by their ID.
|
|
62
|
+
*/
|
|
63
|
+
getAllFlatColumnsById: () => Record<string, Column<TFeatures, TData, unknown>>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the default column options to use for all column defs supplied to the table.
|
|
66
|
+
*/
|
|
67
|
+
getDefaultColumnDef: () => Partial<ColumnDef<TFeatures, TData, unknown>>;
|
|
68
|
+
/**
|
|
69
|
+
* Returns all columns in the table in their normalized and nested hierarchy.
|
|
70
|
+
*/
|
|
71
|
+
getAllColumns: () => Array<Column<TFeatures, TData, unknown>>;
|
|
72
|
+
/**
|
|
73
|
+
* Returns all columns in the table flattened to a single level.
|
|
74
|
+
*/
|
|
75
|
+
getAllFlatColumns: () => Array<Column<TFeatures, TData, unknown>>;
|
|
76
|
+
/**
|
|
77
|
+
* Returns all leaf-node columns in the table flattened to a single level. This does not include parent columns.
|
|
78
|
+
*/
|
|
79
|
+
getAllLeafColumns: () => Array<Column<TFeatures, TData, unknown>>;
|
|
80
|
+
/**
|
|
81
|
+
* Returns a single column by its ID.
|
|
82
|
+
*/
|
|
83
|
+
getColumn: (columnId: string) => Column<TFeatures, TData, unknown> | undefined;
|
|
84
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Table_Internal } from '../../types/Table.js';
|
|
2
|
+
import { CellData, RowData } from '../../types/type-utils.js';
|
|
3
|
+
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
4
|
+
import { ColumnDef } from '../../types/ColumnDef.js';
|
|
5
|
+
import { Column } from '../../types/Column.js';
|
|
6
|
+
export declare function column_getFlatColumns<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column<TFeatures, TData, TValue>): Array<Column<TFeatures, TData, TValue>>;
|
|
7
|
+
export declare function column_getLeafColumns<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column<TFeatures, TData, TValue>): Array<Column<TFeatures, TData, TValue>>;
|
|
8
|
+
export declare function table_getDefaultColumnDef<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Partial<ColumnDef<TFeatures, TData, unknown>>;
|
|
9
|
+
export declare function table_getAllColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Column<TFeatures, TData, unknown>>;
|
|
10
|
+
export declare function table_getAllFlatColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Column<TFeatures, TData, unknown>>;
|
|
11
|
+
export declare function table_getAllFlatColumnsById<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Record<string, Column<TFeatures, TData, unknown>>;
|
|
12
|
+
export declare function table_getAllLeafColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Column<TFeatures, TData, unknown>>;
|
|
13
|
+
export declare function table_getColumn<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, columnId: string): Column<TFeatures, TData, unknown> | undefined;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { callMemoOrStaticFn } from "../../utils.js";
|
|
2
|
+
import { table_getOrderColumnsFn } from "../../features/column-ordering/columnOrderingFeature.utils.js";
|
|
3
|
+
import { constructColumn } from "./constructColumn.js";
|
|
4
|
+
function column_getFlatColumns(column) {
|
|
5
|
+
return [column, ...column.columns.flatMap((col) => col.getFlatColumns())];
|
|
6
|
+
}
|
|
7
|
+
function column_getLeafColumns(column) {
|
|
8
|
+
if (column.columns.length) {
|
|
9
|
+
const leafColumns = column.columns.flatMap(
|
|
10
|
+
(col) => col.getLeafColumns()
|
|
11
|
+
// recursive
|
|
12
|
+
);
|
|
13
|
+
return callMemoOrStaticFn(
|
|
14
|
+
column.table,
|
|
15
|
+
"getOrderColumns",
|
|
16
|
+
table_getOrderColumnsFn
|
|
17
|
+
)(leafColumns);
|
|
18
|
+
}
|
|
19
|
+
return [column];
|
|
20
|
+
}
|
|
21
|
+
function table_getDefaultColumnDef(table) {
|
|
22
|
+
return {
|
|
23
|
+
header: (props) => {
|
|
24
|
+
const resolvedColumnDef = props.header.column.columnDef;
|
|
25
|
+
if (resolvedColumnDef.accessorKey) {
|
|
26
|
+
return resolvedColumnDef.accessorKey;
|
|
27
|
+
}
|
|
28
|
+
if (resolvedColumnDef.accessorFn) {
|
|
29
|
+
return resolvedColumnDef.id;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
},
|
|
33
|
+
cell: (props) => props.renderValue()?.toString?.() ?? null,
|
|
34
|
+
...Object.values(table._features).reduce((obj, feature) => {
|
|
35
|
+
return Object.assign(obj, feature.getDefaultColumnDef?.());
|
|
36
|
+
}, {}),
|
|
37
|
+
...table.options.defaultColumn
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function table_getAllColumns(table) {
|
|
41
|
+
const recurseColumns = (colDefs, parent, depth = 0) => {
|
|
42
|
+
return colDefs.map((columnDef) => {
|
|
43
|
+
const column = constructColumn(table, columnDef, depth, parent);
|
|
44
|
+
const groupingColumnDef = columnDef;
|
|
45
|
+
column.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column, depth + 1) : [];
|
|
46
|
+
return column;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
return recurseColumns(table.options.columns);
|
|
50
|
+
}
|
|
51
|
+
function table_getAllFlatColumns(table) {
|
|
52
|
+
return table.getAllColumns().flatMap((column) => column.getFlatColumns());
|
|
53
|
+
}
|
|
54
|
+
function table_getAllFlatColumnsById(table) {
|
|
55
|
+
return table.getAllFlatColumns().reduce(
|
|
56
|
+
(acc, column) => {
|
|
57
|
+
acc[column.id] = column;
|
|
58
|
+
return acc;
|
|
59
|
+
},
|
|
60
|
+
{}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function table_getAllLeafColumns(table) {
|
|
64
|
+
const leafColumns = table.getAllColumns().flatMap(
|
|
65
|
+
(c) => c.getLeafColumns()
|
|
66
|
+
// recursive
|
|
67
|
+
);
|
|
68
|
+
return callMemoOrStaticFn(
|
|
69
|
+
table,
|
|
70
|
+
"getOrderColumns",
|
|
71
|
+
table_getOrderColumnsFn
|
|
72
|
+
)(leafColumns);
|
|
73
|
+
}
|
|
74
|
+
function table_getColumn(table, columnId) {
|
|
75
|
+
const column = table.getAllFlatColumnsById()[columnId];
|
|
76
|
+
if (process.env.NODE_ENV === "development" && !column) {
|
|
77
|
+
console.warn(`[Table] Column with id '${columnId}' does not exist.`);
|
|
78
|
+
}
|
|
79
|
+
return column;
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
column_getFlatColumns,
|
|
83
|
+
column_getLeafColumns,
|
|
84
|
+
table_getAllColumns,
|
|
85
|
+
table_getAllFlatColumns,
|
|
86
|
+
table_getAllFlatColumnsById,
|
|
87
|
+
table_getAllLeafColumns,
|
|
88
|
+
table_getColumn,
|
|
89
|
+
table_getDefaultColumnDef
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=coreColumnsFeature.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreColumnsFeature.utils.js","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\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\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\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\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: Array<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 as any)\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\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 return table.getAllFlatColumns().reduce(\n (acc, column) => {\n acc[column.id] = column\n return acc\n },\n {} as Record<string, Column<TFeatures, TData, unknown>>,\n )\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 as any) as any\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"],"names":[],"mappings":";;;AAaO,SAAS,sBAKd,QACyC;AACzC,SAAO,CAAC,QAAQ,GAAG,OAAO,QAAQ,QAAQ,CAAC,QAAQ,IAAI,eAAA,CAAgB,CAAC;AAC1E;AAEO,SAAS,sBAKd,QACyC;AACzC,MAAI,OAAO,QAAQ,QAAQ;AACzB,UAAM,cAAc,OAAO,QAAQ;AAAA,MACjC,CAAC,QAAQ,IAAI,eAAA;AAAA;AAAA,IAAe;AAG9B,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,IAAA,EACA,WAAkB;AAAA,EACtB;AAEA,SAAO,CAAC,MAAM;AAChB;AAEO,SAAS,0BAId,OAC+C;AAC/C,SAAO;AAAA,IACL,QAAQ,CAAC,UAAU;AACjB,YAAM,oBAAoB,MAAM,OAAO,OACpC;AAEH,UAAI,kBAAkB,aAAa;AACjC,eAAO,kBAAkB;AAAA,MAC3B;AAEA,UAAI,kBAAkB,YAAY;AAChC,eAAO,kBAAkB;AAAA,MAC3B;AAEA,aAAO;AAAA,IACT;AAAA,IACA,MAAM,CAAC,UAAU,MAAM,YAAA,GAAoB,gBAAgB;AAAA,IAC3D,GAAG,OAAO,OAAO,MAAM,SAAS,EAAE,OAAO,CAAC,KAAK,YAAY;AACzD,aAAO,OAAO,OAAO,KAAK,QAAQ,uBAAuB;AAAA,IAC3D,GAAG,CAAA,CAAE;AAAA,IACL,GAAG,MAAM,QAAQ;AAAA,EAAA;AAErB;AAEO,SAAS,oBAId,OAC0C;AAC1C,QAAM,iBAAiB,CACrB,SACA,QACA,QAAQ,MACqC;AAC7C,WAAO,QAAQ,IAAI,CAAC,cAAc;AAChC,YAAM,SAAS,gBAAgB,OAAO,WAAW,OAAO,MAAM;AAE9D,YAAM,oBAAoB;AAM1B,aAAO,UAAU,kBAAkB,UAC/B,eAAe,kBAAkB,SAAS,QAAQ,QAAQ,CAAC,IAC3D,CAAA;AAEJ,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SAAO,eAAe,MAAM,QAAQ,OAAc;AACpD;AAEO,SAAS,wBAId,OAC0C;AAC1C,SAAO,MAAM,gBAAgB,QAAQ,CAAC,WAAW,OAAO,gBAAgB;AAC1E;AAEO,SAAS,4BAId,OACmD;AACnD,SAAO,MAAM,oBAAoB;AAAA,IAC/B,CAAC,KAAK,WAAW;AACf,UAAI,OAAO,EAAE,IAAI;AACjB,aAAO;AAAA,IACT;AAAA,IACA,CAAA;AAAA,EAAC;AAEL;AAEO,SAAS,wBAId,OAC0C;AAC1C,QAAM,cAAc,MAAM,cAAA,EAAgB;AAAA,IACxC,CAAC,MAAM,EAAE,eAAA;AAAA;AAAA,EAAe;AAE1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,WAAkB;AACtB;AAEO,SAAS,gBAId,OACA,UAC+C;AAC/C,QAAM,SAAS,MAAM,sBAAA,EAAwB,QAAQ;AAErD,MAAI,QAAQ,IAAI,aAAa,iBAAiB,CAAC,QAAQ;AACrD,YAAQ,KAAK,2BAA2B,QAAQ,mBAAmB;AAAA,EACrE;AAEA,SAAO;AACT;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { coreCellsFeature } from './cells/coreCellsFeature.js';
|
|
2
|
+
import { coreColumnsFeature } from './columns/coreColumnsFeature.js';
|
|
3
|
+
import { coreHeadersFeature } from './headers/coreHeadersFeature.js';
|
|
4
|
+
import { coreRowModelsFeature } from './row-models/coreRowModelsFeature.js';
|
|
5
|
+
import { coreRowsFeature } from './rows/coreRowsFeature.js';
|
|
6
|
+
import { coreTablesFeature } from './table/coreTablesFeature.js';
|
|
7
|
+
export interface CoreFeatures {
|
|
8
|
+
coreCellsFeature: typeof coreCellsFeature;
|
|
9
|
+
coreColumnsFeature: typeof coreColumnsFeature;
|
|
10
|
+
coreHeadersFeature: typeof coreHeadersFeature;
|
|
11
|
+
coreRowModelsFeature: typeof coreRowModelsFeature;
|
|
12
|
+
coreRowsFeature: typeof coreRowsFeature;
|
|
13
|
+
coreTablesFeature: typeof coreTablesFeature;
|
|
14
|
+
}
|
|
15
|
+
export declare const coreFeatures: CoreFeatures;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { coreCellsFeature } from "./cells/coreCellsFeature.js";
|
|
2
|
+
import { coreColumnsFeature } from "./columns/coreColumnsFeature.js";
|
|
3
|
+
import { coreHeadersFeature } from "./headers/coreHeadersFeature.js";
|
|
4
|
+
import { coreRowModelsFeature } from "./row-models/coreRowModelsFeature.js";
|
|
5
|
+
import { coreRowsFeature } from "./rows/coreRowsFeature.js";
|
|
6
|
+
import { coreTablesFeature } from "./table/coreTablesFeature.js";
|
|
7
|
+
const coreFeatures = {
|
|
8
|
+
coreCellsFeature,
|
|
9
|
+
coreColumnsFeature,
|
|
10
|
+
coreHeadersFeature,
|
|
11
|
+
coreRowModelsFeature,
|
|
12
|
+
coreRowsFeature,
|
|
13
|
+
coreTablesFeature
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
coreFeatures
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=coreFeatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coreFeatures.js","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'\n\nexport interface CoreFeatures {\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\nexport const coreFeatures: CoreFeatures = {\n coreCellsFeature,\n coreColumnsFeature,\n coreHeadersFeature,\n coreRowModelsFeature,\n coreRowsFeature,\n coreTablesFeature,\n}\n"],"names":[],"mappings":";;;;;;AAgBO,MAAM,eAA6B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Table_Internal } from '../../types/Table.js';
|
|
2
|
+
import { CellData, RowData } from '../../types/type-utils.js';
|
|
3
|
+
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
4
|
+
import { HeaderGroup } from '../../types/HeaderGroup.js';
|
|
5
|
+
import { Column } from '../../types/Column.js';
|
|
6
|
+
export 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>[];
|