@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
|
@@ -1,42 +1,80 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RowData } from '../types/type-utils'
|
|
2
|
+
import type { TableFeatures } from '../types/TableFeatures'
|
|
3
|
+
import type { Row } from '../types/Row'
|
|
4
|
+
import type { SortFn } from '../features/row-sorting/rowSortingFeature.types'
|
|
2
5
|
|
|
3
6
|
export const reSplitAlphaNumeric = /([0-9]+)/gm
|
|
4
7
|
|
|
5
|
-
const
|
|
8
|
+
export const sortFn_alphanumeric: SortFn<any, any> = <
|
|
9
|
+
TFeatures extends TableFeatures,
|
|
10
|
+
TData extends RowData,
|
|
11
|
+
>(
|
|
12
|
+
rowA: Row<any, any>,
|
|
13
|
+
rowB: Row<any, any>,
|
|
14
|
+
columnId: string,
|
|
15
|
+
) => {
|
|
6
16
|
return compareAlphanumeric(
|
|
7
17
|
toString(rowA.getValue(columnId)).toLowerCase(),
|
|
8
|
-
toString(rowB.getValue(columnId)).toLowerCase()
|
|
18
|
+
toString(rowB.getValue(columnId)).toLowerCase(),
|
|
9
19
|
)
|
|
10
20
|
}
|
|
11
21
|
|
|
12
|
-
const
|
|
22
|
+
export const sortFn_alphanumericCaseSensitive: SortFn<any, any> = <
|
|
23
|
+
TFeatures extends TableFeatures,
|
|
24
|
+
TData extends RowData,
|
|
25
|
+
>(
|
|
26
|
+
rowA: Row<any, any>,
|
|
27
|
+
rowB: Row<any, any>,
|
|
28
|
+
columnId: string,
|
|
29
|
+
) => {
|
|
13
30
|
return compareAlphanumeric(
|
|
14
31
|
toString(rowA.getValue(columnId)),
|
|
15
|
-
toString(rowB.getValue(columnId))
|
|
32
|
+
toString(rowB.getValue(columnId)),
|
|
16
33
|
)
|
|
17
34
|
}
|
|
18
35
|
|
|
19
36
|
// The text filter is more basic (less numeric support)
|
|
20
37
|
// but is much faster
|
|
21
|
-
const
|
|
38
|
+
export const sortFn_text: SortFn<any, any> = <
|
|
39
|
+
TFeatures extends TableFeatures,
|
|
40
|
+
TData extends RowData,
|
|
41
|
+
>(
|
|
42
|
+
rowA: Row<any, any>,
|
|
43
|
+
rowB: Row<any, any>,
|
|
44
|
+
columnId: string,
|
|
45
|
+
) => {
|
|
22
46
|
return compareBasic(
|
|
23
47
|
toString(rowA.getValue(columnId)).toLowerCase(),
|
|
24
|
-
toString(rowB.getValue(columnId)).toLowerCase()
|
|
48
|
+
toString(rowB.getValue(columnId)).toLowerCase(),
|
|
25
49
|
)
|
|
26
50
|
}
|
|
27
51
|
|
|
28
52
|
// The text filter is more basic (less numeric support)
|
|
29
53
|
// but is much faster
|
|
30
|
-
const
|
|
54
|
+
export const sortFn_textCaseSensitive: SortFn<any, any> = <
|
|
55
|
+
TFeatures extends TableFeatures,
|
|
56
|
+
TData extends RowData,
|
|
57
|
+
>(
|
|
58
|
+
rowA: Row<any, any>,
|
|
59
|
+
rowB: Row<any, any>,
|
|
60
|
+
columnId: string,
|
|
61
|
+
) => {
|
|
31
62
|
return compareBasic(
|
|
32
63
|
toString(rowA.getValue(columnId)),
|
|
33
|
-
toString(rowB.getValue(columnId))
|
|
64
|
+
toString(rowB.getValue(columnId)),
|
|
34
65
|
)
|
|
35
66
|
}
|
|
36
67
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
68
|
+
export const sortFn_datetime: SortFn<any, any> = <
|
|
69
|
+
TFeatures extends TableFeatures,
|
|
70
|
+
TData extends RowData,
|
|
71
|
+
>(
|
|
72
|
+
rowA: Row<any, any>,
|
|
73
|
+
rowB: Row<any, any>,
|
|
74
|
+
columnId: string,
|
|
75
|
+
) => {
|
|
76
|
+
const a: number | string = rowA.getValue(columnId)
|
|
77
|
+
const b: number | string = rowB.getValue(columnId)
|
|
40
78
|
|
|
41
79
|
// Can handle nullish values
|
|
42
80
|
// Use > and < because == (and ===) doesn't work with
|
|
@@ -44,7 +82,14 @@ const datetime: SortingFn<any> = (rowA, rowB, columnId) => {
|
|
|
44
82
|
return a > b ? 1 : a < b ? -1 : 0
|
|
45
83
|
}
|
|
46
84
|
|
|
47
|
-
const
|
|
85
|
+
export const sortFn_basic: SortFn<any, any> = <
|
|
86
|
+
TFeatures extends TableFeatures,
|
|
87
|
+
TData extends RowData,
|
|
88
|
+
>(
|
|
89
|
+
rowA: Row<any, any>,
|
|
90
|
+
rowB: Row<any, any>,
|
|
91
|
+
columnId: string,
|
|
92
|
+
) => {
|
|
48
93
|
return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId))
|
|
49
94
|
}
|
|
50
95
|
|
|
@@ -116,13 +161,13 @@ function compareAlphanumeric(aStr: string, bStr: string) {
|
|
|
116
161
|
|
|
117
162
|
// Exports
|
|
118
163
|
|
|
119
|
-
export const
|
|
120
|
-
alphanumeric,
|
|
121
|
-
alphanumericCaseSensitive,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
164
|
+
export const sortFns = {
|
|
165
|
+
alphanumeric: sortFn_alphanumeric,
|
|
166
|
+
alphanumericCaseSensitive: sortFn_alphanumericCaseSensitive,
|
|
167
|
+
basic: sortFn_basic,
|
|
168
|
+
datetime: sortFn_datetime,
|
|
169
|
+
text: sortFn_text,
|
|
170
|
+
textCaseSensitive: sortFn_textCaseSensitive,
|
|
126
171
|
}
|
|
127
172
|
|
|
128
|
-
export type
|
|
173
|
+
export type BuiltInSortFn = keyof typeof sortFns
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { DeepKeys, DeepValue, RowData } from '../types/type-utils'
|
|
2
|
+
import type { TableFeatures } from '../types/TableFeatures'
|
|
3
|
+
import type {
|
|
4
|
+
AccessorFn,
|
|
5
|
+
AccessorFnColumnDef,
|
|
6
|
+
AccessorKeyColumnDef,
|
|
7
|
+
ColumnDef,
|
|
8
|
+
DisplayColumnDef,
|
|
9
|
+
GroupColumnDef,
|
|
10
|
+
IdentifiedColumnDef,
|
|
11
|
+
} from '../types/ColumnDef'
|
|
12
|
+
|
|
13
|
+
export type ColumnHelper<
|
|
14
|
+
TFeatures extends TableFeatures,
|
|
15
|
+
TData extends RowData,
|
|
16
|
+
> = {
|
|
17
|
+
/**
|
|
18
|
+
* Creates a data column definition with an accessor key or function to extract the cell value.
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* helper.accessor('firstName', { cell: (info) => info.getValue() })
|
|
22
|
+
* helper.accessor((row) => row.lastName, { id: 'lastName' })
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
accessor: <
|
|
26
|
+
TAccessor extends AccessorFn<TData> | DeepKeys<TData>,
|
|
27
|
+
TValue extends TAccessor extends AccessorFn<TData, infer TReturn>
|
|
28
|
+
? TReturn
|
|
29
|
+
: TAccessor extends DeepKeys<TData>
|
|
30
|
+
? DeepValue<TData, TAccessor>
|
|
31
|
+
: never,
|
|
32
|
+
>(
|
|
33
|
+
accessor: TAccessor,
|
|
34
|
+
column: TAccessor extends AccessorFn<TData>
|
|
35
|
+
? DisplayColumnDef<TFeatures, TData, TValue>
|
|
36
|
+
: IdentifiedColumnDef<TFeatures, TData, TValue>,
|
|
37
|
+
) => TAccessor extends AccessorFn<TData>
|
|
38
|
+
? AccessorFnColumnDef<TFeatures, TData, TValue>
|
|
39
|
+
: AccessorKeyColumnDef<TFeatures, TData, TValue>
|
|
40
|
+
/**
|
|
41
|
+
* Wraps an array of column definitions to preserve each column's individual TValue type.
|
|
42
|
+
* Uses variadic tuple types to infer element types before checking constraints, preventing type widening.
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* helper.columns([helper.accessor('firstName', {}), helper.accessor('age', {})])
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
columns: <TColumns extends ReadonlyArray<ColumnDef<TFeatures, TData, any>>>(
|
|
49
|
+
columns: [...TColumns],
|
|
50
|
+
) => Array<ColumnDef<TFeatures, TData, any>> & [...TColumns]
|
|
51
|
+
/**
|
|
52
|
+
* Creates a display column definition for non-data columns like actions or row selection.
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* helper.display({ id: 'actions', header: 'Actions', cell: () => <button>Edit</button> })
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
display: (
|
|
59
|
+
column: DisplayColumnDef<TFeatures, TData>,
|
|
60
|
+
) => DisplayColumnDef<TFeatures, TData, unknown>
|
|
61
|
+
/**
|
|
62
|
+
* Creates a group column definition that contains nested child columns.
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* helper.group({
|
|
66
|
+
* id: 'name',
|
|
67
|
+
* header: 'Name',
|
|
68
|
+
* columns: helper.columns([
|
|
69
|
+
* helper.accessor('firstName', {}),
|
|
70
|
+
* helper.accessor('lastName', { id: 'lastName' }),
|
|
71
|
+
* ]),
|
|
72
|
+
* })
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
group: (
|
|
76
|
+
column: GroupColumnDef<TFeatures, TData, unknown>,
|
|
77
|
+
) => GroupColumnDef<TFeatures, TData, unknown>
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* A helper utility for creating column definitions with slightly better type inference for each individual column.
|
|
82
|
+
* The `TValue` generic is inferred based on the accessor key or function provided.
|
|
83
|
+
* **Note:** From a JavaScript perspective, the functions in these helpers do not do anything. They are only used to help TypeScript infer the correct types for the column definitions.
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* const helper = createColumnHelper<typeof _features, Person>() // _features is the result of `tableFeatures({})` helper
|
|
87
|
+
* const columns = [
|
|
88
|
+
* helper.display({ id: 'actions', header: 'Actions' }),
|
|
89
|
+
* helper.accessor('firstName', {}),
|
|
90
|
+
* helper.accessor((row) => row.lastName, {}
|
|
91
|
+
* ]
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export function createColumnHelper<
|
|
95
|
+
TFeatures extends TableFeatures,
|
|
96
|
+
TData extends RowData,
|
|
97
|
+
>(): ColumnHelper<TFeatures, TData> {
|
|
98
|
+
return {
|
|
99
|
+
accessor: (accessor, column) => {
|
|
100
|
+
return typeof accessor === 'function'
|
|
101
|
+
? ({
|
|
102
|
+
...column,
|
|
103
|
+
accessorFn: accessor,
|
|
104
|
+
} as any)
|
|
105
|
+
: {
|
|
106
|
+
...column,
|
|
107
|
+
accessorKey: accessor,
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
columns: <TColumns extends ReadonlyArray<ColumnDef<TFeatures, TData, any>>>(
|
|
111
|
+
columns: [...TColumns],
|
|
112
|
+
): Array<ColumnDef<TFeatures, TData, any>> & [...TColumns] =>
|
|
113
|
+
columns as Array<ColumnDef<TFeatures, TData, any>> & [...TColumns],
|
|
114
|
+
display: (column) => column,
|
|
115
|
+
group: (column) => column,
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TableFeatures } from '../types/TableFeatures'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A helper function to help define the features that are to be imported and applied to a table instance.
|
|
5
|
+
* Use this utility to make it easier to have the correct type inference for the features that are being imported.
|
|
6
|
+
* **Note:** It is recommended to use this utility statically outside of a component.
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* import { tableFeatures, columnVisibilityFeature, rowPinningFeature } from '@tanstack/react-table'
|
|
10
|
+
* const _features = tableFeatures({ columnVisibilityFeature, rowPinningFeature });
|
|
11
|
+
* const table = useTable({ _features, rowModels: {}, columns, data });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export function tableFeatures<TFeatures extends TableFeatures>(
|
|
15
|
+
features: TFeatures,
|
|
16
|
+
): TFeatures {
|
|
17
|
+
return features
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// test
|
|
21
|
+
|
|
22
|
+
// const features = tableFeatures({
|
|
23
|
+
// rowPinningFeature: {},
|
|
24
|
+
// });
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createColumnHelper } from './columnHelper'
|
|
2
|
+
import type { ColumnHelper } from './columnHelper'
|
|
3
|
+
import type { RowData } from '../types/type-utils'
|
|
4
|
+
import type { TableFeatures } from '../types/TableFeatures'
|
|
5
|
+
import type { Table } from '../types/Table'
|
|
6
|
+
import type { TableOptions } from '../types/TableOptions'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Options for creating a table helper to share common options across multiple tables
|
|
10
|
+
* coreColumnsFeature, data, and state are excluded from this type and reserved for only the `useTable`/`createTable` functions
|
|
11
|
+
*/
|
|
12
|
+
export type TableHelperOptions<TFeatures extends TableFeatures> = Omit<
|
|
13
|
+
TableOptions<TFeatures, any>,
|
|
14
|
+
'columns' | 'data' | 'store' | 'state' | 'initialState'
|
|
15
|
+
> & {
|
|
16
|
+
_features: TFeatures
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Internal type that each adapter package will build off of to create a table helper
|
|
21
|
+
*/
|
|
22
|
+
export type TableHelper_Core<TFeatures extends TableFeatures> = {
|
|
23
|
+
createColumnHelper: <TData extends RowData>() => ColumnHelper<
|
|
24
|
+
TFeatures,
|
|
25
|
+
TData
|
|
26
|
+
>
|
|
27
|
+
features: TFeatures
|
|
28
|
+
options: Omit<
|
|
29
|
+
TableOptions<TFeatures, any>,
|
|
30
|
+
'columns' | 'data' | 'store' | 'state' | 'initialState'
|
|
31
|
+
>
|
|
32
|
+
tableCreator: <TData extends RowData>(
|
|
33
|
+
tableOptions: Omit<
|
|
34
|
+
TableOptions<TFeatures, TData>,
|
|
35
|
+
'_features' | '_rowModels'
|
|
36
|
+
>,
|
|
37
|
+
selector?: any,
|
|
38
|
+
) => Table<TFeatures, TData>
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Internal function to create a table helper that each adapter package will use to create their own table helper
|
|
43
|
+
*/
|
|
44
|
+
export function constructTableHelper<TFeatures extends TableFeatures>(
|
|
45
|
+
tableCreator: <TData extends RowData>(
|
|
46
|
+
tableOptions: Omit<
|
|
47
|
+
TableOptions<TFeatures, TData>,
|
|
48
|
+
'_features' | '_rowModels'
|
|
49
|
+
>,
|
|
50
|
+
selector?: any,
|
|
51
|
+
) => Table<TFeatures, TData>,
|
|
52
|
+
tableHelperOptions: TableHelperOptions<TFeatures>,
|
|
53
|
+
): TableHelper_Core<TFeatures> {
|
|
54
|
+
return {
|
|
55
|
+
createColumnHelper,
|
|
56
|
+
features: tableHelperOptions._features,
|
|
57
|
+
options: tableHelperOptions,
|
|
58
|
+
tableCreator: (tableOptions, selector) =>
|
|
59
|
+
tableCreator({ ...tableHelperOptions, ...tableOptions }, selector),
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { RowData } from '../types/type-utils'
|
|
2
|
+
import type { TableFeatures } from '../types/TableFeatures'
|
|
3
|
+
import type { TableOptions } from '../types/TableOptions'
|
|
4
|
+
|
|
5
|
+
export function tableOptions<
|
|
6
|
+
TFeatures extends TableFeatures,
|
|
7
|
+
TData extends RowData = any,
|
|
8
|
+
>(
|
|
9
|
+
options: Omit<TableOptions<TFeatures, TData>, 'columns'> & {
|
|
10
|
+
_features: TFeatures
|
|
11
|
+
},
|
|
12
|
+
): Omit<TableOptions<TFeatures, TData>, 'columns' | '_features'> & {
|
|
13
|
+
_features: TFeatures
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function tableOptions<
|
|
17
|
+
TFeatures extends TableFeatures,
|
|
18
|
+
TData extends RowData = any,
|
|
19
|
+
>(
|
|
20
|
+
options: Omit<TableOptions<TFeatures, TData>, 'data'> & {
|
|
21
|
+
_features: TFeatures
|
|
22
|
+
},
|
|
23
|
+
): Omit<TableOptions<TFeatures, TData>, 'data' | '_features'> & {
|
|
24
|
+
_features: TFeatures
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function tableOptions<
|
|
28
|
+
TFeatures extends TableFeatures,
|
|
29
|
+
TData extends RowData = any,
|
|
30
|
+
>(
|
|
31
|
+
options: Omit<TableOptions<TFeatures, TData>, '_features'>,
|
|
32
|
+
): Omit<TableOptions<TFeatures, TData>, '_features'>
|
|
33
|
+
|
|
34
|
+
export function tableOptions<
|
|
35
|
+
TFeatures extends TableFeatures,
|
|
36
|
+
TData extends RowData = any,
|
|
37
|
+
>(
|
|
38
|
+
options: Omit<TableOptions<TFeatures, TData>, 'data' | 'columns'> & {
|
|
39
|
+
_features: TFeatures
|
|
40
|
+
},
|
|
41
|
+
): Omit<TableOptions<TFeatures, TData>, 'data' | 'columns' | '_features'> & {
|
|
42
|
+
_features: TFeatures
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function tableOptions<
|
|
46
|
+
TFeatures extends TableFeatures,
|
|
47
|
+
TData extends RowData = any,
|
|
48
|
+
>(
|
|
49
|
+
options: Omit<TableOptions<TFeatures, TData>, 'data' | '_features'>,
|
|
50
|
+
): Omit<TableOptions<TFeatures, TData>, 'data' | '_features'>
|
|
51
|
+
|
|
52
|
+
export function tableOptions<
|
|
53
|
+
TFeatures extends TableFeatures,
|
|
54
|
+
TData extends RowData = any,
|
|
55
|
+
>(
|
|
56
|
+
options: Omit<TableOptions<TFeatures, TData>, 'columns' | '_features'>,
|
|
57
|
+
): Omit<TableOptions<TFeatures, TData>, 'columns' | '_features'>
|
|
58
|
+
|
|
59
|
+
export function tableOptions<
|
|
60
|
+
TFeatures extends TableFeatures,
|
|
61
|
+
TData extends RowData = any,
|
|
62
|
+
>(
|
|
63
|
+
options: Omit<
|
|
64
|
+
TableOptions<TFeatures, TData>,
|
|
65
|
+
'data' | 'columns' | '_features'
|
|
66
|
+
>,
|
|
67
|
+
): Omit<TableOptions<TFeatures, TData>, 'data' | 'columns' | '_features'>
|
|
68
|
+
|
|
69
|
+
export function tableOptions<
|
|
70
|
+
TFeatures extends TableFeatures,
|
|
71
|
+
TData extends RowData = any,
|
|
72
|
+
>(options: TableOptions<TFeatures, TData>): TableOptions<TFeatures, TData>
|
|
73
|
+
|
|
74
|
+
export function tableOptions(options: unknown) {
|
|
75
|
+
return options
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// test
|
|
79
|
+
|
|
80
|
+
// const options = tableOptions({
|
|
81
|
+
// _features: {},
|
|
82
|
+
// })
|
package/src/index.ts
CHANGED
|
@@ -1,43 +1,157 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export * from './
|
|
14
|
-
export * from './
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export * from './
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './
|
|
27
|
-
|
|
28
|
-
//utils
|
|
1
|
+
/**
|
|
2
|
+
* Types
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from './types/Cell'
|
|
6
|
+
export * from './types/Column'
|
|
7
|
+
export * from './types/ColumnDef'
|
|
8
|
+
export * from './types/Header'
|
|
9
|
+
export * from './types/HeaderGroup'
|
|
10
|
+
export * from './types/Row'
|
|
11
|
+
export * from './types/RowModel'
|
|
12
|
+
export * from './types/RowModelFns'
|
|
13
|
+
export * from './types/Table'
|
|
14
|
+
export * from './types/TableFeatures'
|
|
15
|
+
export * from './types/TableOptions'
|
|
16
|
+
export * from './types/TableState'
|
|
17
|
+
export * from './types/type-utils'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Core
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export * from './core/coreFeatures'
|
|
24
|
+
export * from './helpers/columnHelper'
|
|
25
|
+
export * from './helpers/tableFeatures'
|
|
26
|
+
export * from './helpers/tableHelper'
|
|
27
|
+
export * from './helpers/tableOptions'
|
|
29
28
|
export * from './utils'
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export * from './
|
|
33
|
-
export * from './
|
|
34
|
-
export * from './
|
|
35
|
-
export * from './utils
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export * from './
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export * from './
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
|
|
30
|
+
// Cells
|
|
31
|
+
export * from './core/cells/constructCell'
|
|
32
|
+
export * from './core/cells/coreCellsFeature'
|
|
33
|
+
export * from './core/cells/coreCellsFeature.types'
|
|
34
|
+
export * from './core/cells/coreCellsFeature.utils'
|
|
35
|
+
|
|
36
|
+
// Columns
|
|
37
|
+
export * from './core/columns/constructColumn'
|
|
38
|
+
export * from './core/columns/coreColumnsFeature'
|
|
39
|
+
export * from './core/columns/coreColumnsFeature.types'
|
|
40
|
+
export * from './core/columns/coreColumnsFeature.utils'
|
|
41
|
+
|
|
42
|
+
// Headers
|
|
43
|
+
export * from './core/headers/buildHeaderGroups'
|
|
44
|
+
export * from './core/headers/constructHeader'
|
|
45
|
+
export * from './core/headers/coreHeadersFeature'
|
|
46
|
+
export * from './core/headers/coreHeadersFeature.types'
|
|
47
|
+
export * from './core/headers/coreHeadersFeature.utils'
|
|
48
|
+
|
|
49
|
+
// Rows
|
|
50
|
+
export * from './core/rows/constructRow'
|
|
51
|
+
export * from './core/rows/coreRowsFeature'
|
|
52
|
+
export * from './core/rows/coreRowsFeature.types'
|
|
53
|
+
export * from './core/rows/coreRowsFeature.utils'
|
|
54
|
+
|
|
55
|
+
// Row Models
|
|
56
|
+
export * from './core/row-models/coreRowModelsFeature'
|
|
57
|
+
export * from './core/row-models/coreRowModelsFeature.types'
|
|
58
|
+
export * from './core/row-models/coreRowModelsFeature.utils'
|
|
59
|
+
export * from './core/row-models/createCoreRowModel'
|
|
60
|
+
|
|
61
|
+
// Tables
|
|
62
|
+
export * from './core/table/constructTable'
|
|
63
|
+
export * from './core/table/coreTablesFeature'
|
|
64
|
+
export * from './core/table/coreTablesFeature.types'
|
|
65
|
+
export * from './core/table/coreTablesFeature.utils'
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* RowModelFns
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
export * from './fns/aggregationFns'
|
|
72
|
+
export * from './fns/filterFns'
|
|
73
|
+
export * from './fns/sortFns'
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Features
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
export * from './features/stockFeatures'
|
|
80
|
+
|
|
81
|
+
// columnFacetingFeature
|
|
82
|
+
export * from './features/column-faceting/columnFacetingFeature'
|
|
83
|
+
export * from './features/column-faceting/columnFacetingFeature.types'
|
|
84
|
+
export * from './features/column-faceting/columnFacetingFeature.utils'
|
|
85
|
+
export * from './features/column-faceting/createFacetedMinMaxValues'
|
|
86
|
+
export * from './features/column-faceting/createFacetedRowModel'
|
|
87
|
+
export * from './features/column-faceting/createFacetedUniqueValues'
|
|
88
|
+
|
|
89
|
+
// columnFilteringFeature
|
|
90
|
+
export * from './features/column-filtering/columnFilteringFeature'
|
|
91
|
+
export * from './features/column-filtering/columnFilteringFeature.types'
|
|
92
|
+
export * from './features/column-filtering/columnFilteringFeature.utils'
|
|
93
|
+
export * from './features/column-filtering/createFilteredRowModel'
|
|
94
|
+
|
|
95
|
+
// columnGroupingFeature
|
|
96
|
+
export * from './features/column-grouping/columnGroupingFeature'
|
|
97
|
+
export * from './features/column-grouping/columnGroupingFeature.types'
|
|
98
|
+
export * from './features/column-grouping/columnGroupingFeature.utils'
|
|
99
|
+
export * from './features/column-grouping/createGroupedRowModel'
|
|
100
|
+
|
|
101
|
+
// columnOrderingFeature
|
|
102
|
+
export * from './features/column-ordering/columnOrderingFeature'
|
|
103
|
+
export * from './features/column-ordering/columnOrderingFeature.types'
|
|
104
|
+
export * from './features/column-ordering/columnOrderingFeature.utils'
|
|
105
|
+
|
|
106
|
+
// columnPinningFeature
|
|
107
|
+
export * from './features/column-pinning/columnPinningFeature'
|
|
108
|
+
export * from './features/column-pinning/columnPinningFeature.types'
|
|
109
|
+
export * from './features/column-pinning/columnPinningFeature.utils'
|
|
110
|
+
|
|
111
|
+
// columnResizingFeature
|
|
112
|
+
export * from './features/column-resizing/columnResizingFeature'
|
|
113
|
+
export * from './features/column-resizing/columnResizingFeature.types'
|
|
114
|
+
export * from './features/column-resizing/columnResizingFeature.utils'
|
|
115
|
+
|
|
116
|
+
// columnSizingFeature
|
|
117
|
+
export * from './features/column-sizing/columnSizingFeature'
|
|
118
|
+
export * from './features/column-sizing/columnSizingFeature.types'
|
|
119
|
+
export * from './features/column-sizing/columnSizingFeature.utils'
|
|
120
|
+
|
|
121
|
+
// columnVisibilityFeature
|
|
122
|
+
export * from './features/column-visibility/columnVisibilityFeature'
|
|
123
|
+
export * from './features/column-visibility/columnVisibilityFeature.types'
|
|
124
|
+
export * from './features/column-visibility/columnVisibilityFeature.utils'
|
|
125
|
+
|
|
126
|
+
// globalFilteringFeature
|
|
127
|
+
export * from './features/global-filtering/globalFilteringFeature'
|
|
128
|
+
export * from './features/global-filtering/globalFilteringFeature.types'
|
|
129
|
+
export * from './features/global-filtering/globalFilteringFeature.utils'
|
|
130
|
+
|
|
131
|
+
// rowExpandingFeature
|
|
132
|
+
export * from './features/row-expanding/rowExpandingFeature'
|
|
133
|
+
export * from './features/row-expanding/rowExpandingFeature.types'
|
|
134
|
+
export * from './features/row-expanding/rowExpandingFeature.utils'
|
|
135
|
+
export * from './features/row-expanding/createExpandedRowModel'
|
|
136
|
+
|
|
137
|
+
// rowPaginationFeature
|
|
138
|
+
export * from './features/row-pagination/rowPaginationFeature'
|
|
139
|
+
export * from './features/row-pagination/rowPaginationFeature.types'
|
|
140
|
+
export * from './features/row-pagination/rowPaginationFeature.utils'
|
|
141
|
+
export * from './features/row-pagination/createPaginatedRowModel'
|
|
142
|
+
|
|
143
|
+
// rowPinningFeature
|
|
144
|
+
export * from './features/row-pinning/rowPinningFeature'
|
|
145
|
+
export * from './features/row-pinning/rowPinningFeature.types'
|
|
146
|
+
export * from './features/row-pinning/rowPinningFeature.utils'
|
|
147
|
+
|
|
148
|
+
// rowSelectionFeature
|
|
149
|
+
export * from './features/row-selection/rowSelectionFeature'
|
|
150
|
+
export * from './features/row-selection/rowSelectionFeature.types'
|
|
151
|
+
export * from './features/row-selection/rowSelectionFeature.utils'
|
|
152
|
+
|
|
153
|
+
// rowSortingFeature
|
|
154
|
+
export * from './features/row-sorting/rowSortingFeature'
|
|
155
|
+
export * from './features/row-sorting/rowSortingFeature.types'
|
|
156
|
+
export * from './features/row-sorting/rowSortingFeature.utils'
|
|
157
|
+
export * from './features/row-sorting/createSortedRowModel'
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Cell_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
2
|
+
import type { CellData, RowData, UnionToIntersection } from './type-utils'
|
|
3
|
+
import type { ExtractFeatureTypes, TableFeatures } from './TableFeatures'
|
|
4
|
+
import type { Cell_Cell } from '../core/cells/coreCellsFeature.types'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
8
|
+
* Note: This will affect the types of all tables in your project.
|
|
9
|
+
*/
|
|
10
|
+
export interface Cell_Plugins<
|
|
11
|
+
TFeatures extends TableFeatures,
|
|
12
|
+
TData extends RowData,
|
|
13
|
+
TValue extends CellData = CellData,
|
|
14
|
+
> {}
|
|
15
|
+
|
|
16
|
+
export interface Cell_Core<
|
|
17
|
+
TFeatures extends TableFeatures,
|
|
18
|
+
TData extends RowData,
|
|
19
|
+
TValue extends CellData = CellData,
|
|
20
|
+
> extends Cell_Cell<TFeatures, TData, TValue> {}
|
|
21
|
+
|
|
22
|
+
export type Cell<
|
|
23
|
+
TFeatures extends TableFeatures,
|
|
24
|
+
TData extends RowData,
|
|
25
|
+
TValue extends CellData = CellData,
|
|
26
|
+
> = Cell_Cell<TFeatures, TData, TValue> &
|
|
27
|
+
UnionToIntersection<
|
|
28
|
+
'columnGroupingFeature' extends keyof TFeatures
|
|
29
|
+
? Cell_ColumnGrouping
|
|
30
|
+
: never
|
|
31
|
+
> &
|
|
32
|
+
ExtractFeatureTypes<'Cell', TFeatures> &
|
|
33
|
+
Cell_Plugins<TFeatures, TData, TValue>
|
|
34
|
+
|
|
35
|
+
// export type Cell<
|
|
36
|
+
// TFeatures extends TableFeatures,
|
|
37
|
+
// TData extends RowData,
|
|
38
|
+
// TValue extends CellData = CellData,
|
|
39
|
+
// > = Cell_Core<TFeatures, TData, TValue> &
|
|
40
|
+
// ExtractFeatureTypes<TFeatures, 'Cell'> &
|
|
41
|
+
// Cell_Plugins<TFeatures, TData, TValue>
|