@tanstack/table-core 9.0.0-beta.2 → 9.0.0-beta.20
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/core/cells/constructCell.d.cts +3 -3
- package/dist/core/cells/constructCell.d.ts +3 -3
- package/dist/core/cells/coreCellsFeature.cjs +11 -20
- package/dist/core/cells/coreCellsFeature.cjs.map +1 -1
- package/dist/core/cells/coreCellsFeature.d.cts +4 -12
- package/dist/core/cells/coreCellsFeature.d.ts +4 -12
- package/dist/core/cells/coreCellsFeature.js +12 -20
- package/dist/core/cells/coreCellsFeature.js.map +1 -1
- package/dist/core/cells/coreCellsFeature.types.d.cts +6 -6
- package/dist/core/cells/coreCellsFeature.types.d.ts +6 -6
- package/dist/core/cells/coreCellsFeature.utils.d.cts +3 -3
- package/dist/core/cells/coreCellsFeature.utils.d.ts +3 -3
- package/dist/core/columns/constructColumn.cjs +5 -0
- package/dist/core/columns/constructColumn.cjs.map +1 -1
- package/dist/core/columns/constructColumn.d.cts +3 -3
- package/dist/core/columns/constructColumn.d.ts +3 -3
- package/dist/core/columns/constructColumn.js +5 -0
- package/dist/core/columns/constructColumn.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.cjs +59 -68
- package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.d.cts +4 -12
- package/dist/core/columns/coreColumnsFeature.d.ts +4 -12
- package/dist/core/columns/coreColumnsFeature.js +60 -68
- package/dist/core/columns/coreColumnsFeature.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.types.d.cts +7 -7
- package/dist/core/columns/coreColumnsFeature.types.d.ts +7 -7
- package/dist/core/columns/coreColumnsFeature.utils.cjs +2 -2
- package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +9 -9
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +9 -9
- package/dist/core/columns/coreColumnsFeature.utils.js +3 -3
- package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
- package/dist/core/coreFeatures.cjs.map +1 -1
- package/dist/core/coreFeatures.d.cts +1 -1
- package/dist/core/coreFeatures.d.ts +1 -1
- package/dist/core/coreFeatures.js.map +1 -1
- package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
- package/dist/core/headers/buildHeaderGroups.d.cts +2 -2
- package/dist/core/headers/buildHeaderGroups.d.ts +2 -2
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/constructHeader.d.cts +2 -2
- package/dist/core/headers/constructHeader.d.ts +2 -2
- package/dist/core/headers/coreHeadersFeature.cjs +44 -53
- package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.d.cts +4 -12
- package/dist/core/headers/coreHeadersFeature.d.ts +4 -12
- package/dist/core/headers/coreHeadersFeature.js +45 -53
- package/dist/core/headers/coreHeadersFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.types.d.cts +6 -6
- package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -6
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +6 -6
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +6 -6
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.cjs +17 -26
- package/dist/core/row-models/coreRowModelsFeature.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.d.cts +4 -12
- package/dist/core/row-models/coreRowModelsFeature.d.ts +4 -12
- package/dist/core/row-models/coreRowModelsFeature.js +18 -26
- package/dist/core/row-models/coreRowModelsFeature.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.types.d.cts +6 -16
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +6 -16
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs +13 -13
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +14 -14
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +14 -14
- package/dist/core/row-models/coreRowModelsFeature.utils.js +13 -13
- package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
- package/dist/core/row-models/createCoreRowModel.cjs +2 -3
- package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
- package/dist/core/row-models/createCoreRowModel.d.cts +1 -1
- package/dist/core/row-models/createCoreRowModel.d.ts +1 -1
- package/dist/core/row-models/createCoreRowModel.js +3 -4
- package/dist/core/row-models/createCoreRowModel.js.map +1 -1
- package/dist/core/rows/constructRow.cjs +3 -2
- package/dist/core/rows/constructRow.cjs.map +1 -1
- package/dist/core/rows/constructRow.d.cts +2 -2
- package/dist/core/rows/constructRow.d.ts +2 -2
- package/dist/core/rows/constructRow.js +4 -2
- package/dist/core/rows/constructRow.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.cjs +27 -36
- package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.d.cts +4 -12
- package/dist/core/rows/coreRowsFeature.d.ts +4 -12
- package/dist/core/rows/coreRowsFeature.js +28 -36
- package/dist/core/rows/coreRowsFeature.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.types.d.cts +6 -6
- package/dist/core/rows/coreRowsFeature.types.d.ts +6 -6
- package/dist/core/rows/coreRowsFeature.utils.cjs +3 -3
- package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.utils.d.cts +3 -3
- package/dist/core/rows/coreRowsFeature.utils.d.ts +3 -3
- package/dist/core/rows/coreRowsFeature.utils.js +4 -4
- package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
- package/dist/core/table/constructTable.cjs +21 -6
- package/dist/core/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.d.cts +1 -1
- package/dist/core/table/constructTable.d.ts +1 -1
- package/dist/core/table/constructTable.js +21 -6
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/core/table/coreTablesFeature.cjs +7 -16
- package/dist/core/table/coreTablesFeature.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.d.cts +4 -12
- package/dist/core/table/coreTablesFeature.d.ts +4 -12
- package/dist/core/table/coreTablesFeature.js +8 -16
- package/dist/core/table/coreTablesFeature.js.map +1 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +28 -16
- package/dist/core/table/coreTablesFeature.types.d.ts +28 -16
- package/dist/core/table/coreTablesFeature.utils.cjs +33 -12
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +8 -6
- package/dist/core/table/coreTablesFeature.utils.d.ts +8 -6
- package/dist/core/table/coreTablesFeature.utils.js +33 -12
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.cjs +49 -61
- package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.d.cts +4 -15
- package/dist/features/column-faceting/columnFacetingFeature.d.ts +4 -15
- package/dist/features/column-faceting/columnFacetingFeature.js +50 -61
- package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +8 -29
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +8 -29
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +12 -12
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +8 -8
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +8 -8
- package/dist/features/column-faceting/columnFacetingFeature.utils.js +12 -12
- package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.d.cts +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.d.ts +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.cjs +40 -53
- package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.d.cts +4 -16
- package/dist/features/column-filtering/columnFilteringFeature.d.ts +4 -16
- package/dist/features/column-filtering/columnFilteringFeature.js +42 -54
- package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +40 -26
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +40 -26
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +12 -12
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +12 -12
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.cjs +12 -7
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.cts +5 -3
- package/dist/features/column-filtering/createFilteredRowModel.d.ts +5 -3
- package/dist/features/column-filtering/createFilteredRowModel.js +13 -8
- package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
- package/dist/features/column-filtering/filterRowsUtils.cjs +3 -2
- package/dist/features/column-filtering/filterRowsUtils.cjs.map +1 -1
- package/dist/features/column-filtering/filterRowsUtils.js +3 -2
- package/dist/features/column-filtering/filterRowsUtils.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.cjs +57 -69
- package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.cts +4 -15
- package/dist/features/column-grouping/columnGroupingFeature.d.ts +4 -15
- package/dist/features/column-grouping/columnGroupingFeature.js +59 -70
- package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +23 -19
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +23 -19
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +3 -3
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +11 -11
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +11 -11
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +4 -4
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.cjs +9 -7
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.d.cts +6 -3
- package/dist/features/column-grouping/createGroupedRowModel.d.ts +6 -3
- package/dist/features/column-grouping/createGroupedRowModel.js +10 -8
- package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.cjs +47 -59
- package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.d.cts +4 -15
- package/dist/features/column-ordering/columnOrderingFeature.d.ts +4 -15
- package/dist/features/column-ordering/columnOrderingFeature.js +48 -59
- package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +9 -9
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +9 -9
- package/dist/features/column-pinning/columnPinningFeature.cjs +209 -221
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.d.cts +4 -15
- package/dist/features/column-pinning/columnPinningFeature.d.ts +4 -15
- package/dist/features/column-pinning/columnPinningFeature.js +210 -221
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +2 -2
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +2 -2
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +31 -30
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +31 -30
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.cjs +31 -43
- package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.d.cts +4 -15
- package/dist/features/column-resizing/columnResizingFeature.d.ts +4 -15
- package/dist/features/column-resizing/columnResizingFeature.js +32 -43
- package/dist/features/column-resizing/columnResizingFeature.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +1 -4
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +1 -4
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +2 -5
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +6 -6
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +6 -6
- package/dist/features/column-resizing/columnResizingFeature.utils.js +3 -6
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +112 -125
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.d.cts +4 -16
- package/dist/features/column-sizing/columnSizingFeature.d.ts +4 -16
- package/dist/features/column-sizing/columnSizingFeature.js +113 -125
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +11 -4
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +12 -12
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +12 -12
- package/dist/features/column-sizing/columnSizingFeature.utils.js +12 -5
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +83 -95
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.d.cts +4 -15
- package/dist/features/column-visibility/columnVisibilityFeature.d.ts +4 -15
- package/dist/features/column-visibility/columnVisibilityFeature.js +84 -95
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +2 -2
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +2 -2
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +12 -9
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +14 -14
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +14 -14
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +13 -10
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.cjs +31 -43
- package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.d.cts +4 -15
- package/dist/features/global-filtering/globalFilteringFeature.d.ts +4 -15
- package/dist/features/global-filtering/globalFilteringFeature.js +32 -43
- package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +2 -2
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +2 -2
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +10 -8
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +10 -8
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.d.cts +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.d.ts +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.cjs +37 -49
- package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.d.cts +4 -15
- package/dist/features/row-expanding/rowExpandingFeature.d.ts +4 -15
- package/dist/features/row-expanding/rowExpandingFeature.js +38 -49
- package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +5 -14
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +5 -14
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +21 -12
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +10 -10
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +10 -10
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +22 -13
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.cjs +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.d.cts +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.d.ts +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.js +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.cjs +35 -47
- package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.d.cts +4 -15
- package/dist/features/row-pagination/rowPaginationFeature.d.ts +4 -15
- package/dist/features/row-pagination/rowPaginationFeature.js +36 -47
- package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +4 -13
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +4 -13
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +17 -17
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +17 -17
- package/dist/features/row-pinning/rowPinningFeature.cjs +55 -67
- package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.d.cts +4 -15
- package/dist/features/row-pinning/rowPinningFeature.d.ts +4 -15
- package/dist/features/row-pinning/rowPinningFeature.js +56 -67
- package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.types.d.cts +2 -2
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +2 -2
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +2 -2
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +7 -7
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +7 -7
- package/dist/features/row-pinning/rowPinningFeature.utils.js +2 -2
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs +108 -77
- package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.d.cts +4 -15
- package/dist/features/row-selection/rowSelectionFeature.d.ts +4 -15
- package/dist/features/row-selection/rowSelectionFeature.js +110 -78
- package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +13 -5
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +13 -5
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +76 -60
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +48 -23
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +48 -23
- package/dist/features/row-selection/rowSelectionFeature.utils.js +77 -62
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs +5 -3
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.d.cts +5 -3
- package/dist/features/row-sorting/createSortedRowModel.d.ts +5 -3
- package/dist/features/row-sorting/createSortedRowModel.js +6 -4
- package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.cjs +45 -57
- package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.d.cts +4 -15
- package/dist/features/row-sorting/rowSortingFeature.d.ts +4 -15
- package/dist/features/row-sorting/rowSortingFeature.js +46 -57
- package/dist/features/row-sorting/rowSortingFeature.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +24 -21
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +24 -21
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +8 -5
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +16 -16
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +16 -16
- package/dist/features/row-sorting/rowSortingFeature.utils.js +8 -5
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
- package/dist/fns/aggregationFns.cjs +18 -18
- package/dist/fns/aggregationFns.cjs.map +1 -1
- package/dist/fns/aggregationFns.d.cts +21 -19
- package/dist/fns/aggregationFns.d.ts +21 -19
- package/dist/fns/aggregationFns.js +18 -18
- package/dist/fns/aggregationFns.js.map +1 -1
- package/dist/fns/filterFns.cjs +51 -65
- package/dist/fns/filterFns.cjs.map +1 -1
- package/dist/fns/filterFns.d.cts +82 -28
- package/dist/fns/filterFns.d.ts +82 -28
- package/dist/fns/filterFns.js +51 -65
- package/dist/fns/filterFns.js.map +1 -1
- package/dist/fns/sortFns.cjs +18 -6
- package/dist/fns/sortFns.cjs.map +1 -1
- package/dist/fns/sortFns.d.cts +15 -13
- package/dist/fns/sortFns.d.ts +15 -13
- package/dist/fns/sortFns.js +18 -6
- package/dist/fns/sortFns.js.map +1 -1
- package/dist/helpers/columnHelper.cjs.map +1 -1
- package/dist/helpers/columnHelper.d.cts +2 -2
- package/dist/helpers/columnHelper.d.ts +2 -2
- package/dist/helpers/columnHelper.js.map +1 -1
- package/dist/helpers/metaHelper.cjs +30 -0
- package/dist/helpers/metaHelper.cjs.map +1 -0
- package/dist/helpers/metaHelper.d.cts +26 -0
- package/dist/helpers/metaHelper.d.ts +26 -0
- package/dist/helpers/metaHelper.js +29 -0
- package/dist/helpers/metaHelper.js.map +1 -0
- package/dist/helpers/tableFeatures.cjs +31 -3
- package/dist/helpers/tableFeatures.cjs.map +1 -1
- package/dist/helpers/tableFeatures.d.cts +33 -5
- package/dist/helpers/tableFeatures.d.ts +33 -5
- package/dist/helpers/tableFeatures.js +31 -3
- package/dist/helpers/tableFeatures.js.map +1 -1
- package/dist/index.cjs +4 -20
- package/dist/index.d.cts +50 -49
- package/dist/index.d.ts +50 -49
- package/dist/index.js +23 -22
- package/dist/static-functions.cjs +1 -0
- package/dist/static-functions.d.cts +2 -2
- package/dist/static-functions.d.ts +2 -2
- package/dist/static-functions.js +2 -2
- package/dist/store-reactivity-bindings.cjs +1 -1
- package/dist/store-reactivity-bindings.cjs.map +1 -1
- package/dist/store-reactivity-bindings.d.cts +1 -1
- package/dist/store-reactivity-bindings.d.ts +1 -1
- package/dist/store-reactivity-bindings.js +1 -1
- package/dist/store-reactivity-bindings.js.map +1 -1
- package/dist/types/Cell.d.cts +4 -9
- package/dist/types/Cell.d.ts +4 -9
- package/dist/types/Column.d.cts +11 -18
- package/dist/types/Column.d.ts +11 -18
- package/dist/types/ColumnDef.d.cts +23 -14
- package/dist/types/ColumnDef.d.ts +23 -14
- package/dist/types/Header.d.cts +5 -10
- package/dist/types/Header.d.ts +5 -10
- package/dist/types/HeaderGroup.d.cts +4 -9
- package/dist/types/HeaderGroup.d.ts +4 -9
- package/dist/types/Row.d.cts +7 -12
- package/dist/types/Row.d.ts +7 -12
- package/dist/types/RowModel.d.cts +12 -28
- package/dist/types/RowModel.d.ts +12 -28
- package/dist/types/RowModelFns.d.cts +6 -11
- package/dist/types/RowModelFns.d.ts +6 -11
- package/dist/types/Table.d.cts +26 -36
- package/dist/types/Table.d.ts +26 -36
- package/dist/types/TableFeatures.d.cts +328 -54
- package/dist/types/TableFeatures.d.ts +328 -54
- package/dist/types/TableOptions.d.cts +22 -17
- package/dist/types/TableOptions.d.ts +22 -17
- package/dist/types/TableState.d.cts +11 -16
- package/dist/types/TableState.d.ts +11 -16
- package/dist/utils.cjs +24 -2
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +23 -7
- package/dist/utils.d.ts +23 -7
- package/dist/utils.js +23 -3
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
- package/skills/column-definitions/SKILL.md +3 -6
- package/skills/column-layout/SKILL.md +0 -2
- package/skills/customizing-feature-behavior/SKILL.md +63 -56
- package/skills/filtering/SKILL.md +60 -42
- package/skills/filtering/references/faceting-and-fuzzy.md +59 -32
- package/skills/grouping/SKILL.md +49 -54
- package/skills/migrate-v8-to-v9/SKILL.md +30 -33
- package/skills/pagination/SKILL.md +22 -20
- package/skills/row-expanding/SKILL.md +33 -25
- package/skills/row-pinning/SKILL.md +11 -7
- package/skills/row-selection/SKILL.md +0 -3
- package/skills/setup/SKILL.md +55 -65
- package/skills/sorting/SKILL.md +21 -21
- package/skills/state-management/SKILL.md +40 -25
- package/src/core/cells/coreCellsFeature.ts +17 -39
- package/src/core/cells/coreCellsFeature.types.ts +6 -6
- package/src/core/columns/constructColumn.ts +6 -0
- package/src/core/columns/coreColumnsFeature.ts +56 -83
- package/src/core/columns/coreColumnsFeature.types.ts +8 -8
- package/src/core/columns/coreColumnsFeature.utils.ts +4 -4
- package/src/core/coreFeatures.ts +1 -1
- package/src/core/headers/buildHeaderGroups.ts +4 -2
- package/src/core/headers/coreHeadersFeature.ts +42 -64
- package/src/core/headers/coreHeadersFeature.types.ts +12 -12
- package/src/core/headers/coreHeadersFeature.utils.ts +1 -1
- package/src/core/row-models/coreRowModelsFeature.ts +43 -64
- package/src/core/row-models/coreRowModelsFeature.types.ts +7 -24
- package/src/core/row-models/coreRowModelsFeature.utils.ts +7 -7
- package/src/core/row-models/createCoreRowModel.ts +7 -6
- package/src/core/rows/constructRow.ts +3 -2
- package/src/core/rows/coreRowsFeature.ts +45 -72
- package/src/core/rows/coreRowsFeature.types.ts +8 -8
- package/src/core/rows/coreRowsFeature.utils.ts +4 -4
- package/src/core/table/constructTable.ts +50 -13
- package/src/core/table/coreTablesFeature.ts +13 -35
- package/src/core/table/coreTablesFeature.types.ts +40 -17
- package/src/core/table/coreTablesFeature.utils.ts +52 -18
- package/src/features/column-faceting/columnFacetingFeature.ts +71 -102
- package/src/features/column-faceting/columnFacetingFeature.types.ts +11 -44
- package/src/features/column-faceting/columnFacetingFeature.utils.ts +6 -6
- package/src/features/column-faceting/createFacetedMinMaxValues.ts +1 -1
- package/src/features/column-faceting/createFacetedRowModel.ts +1 -1
- package/src/features/column-faceting/createFacetedUniqueValues.ts +1 -1
- package/src/features/column-filtering/columnFilteringFeature.ts +61 -103
- package/src/features/column-filtering/columnFilteringFeature.types.ts +55 -39
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +2 -2
- package/src/features/column-filtering/createFilteredRowModel.ts +18 -17
- package/src/features/column-filtering/filterRowsUtils.ts +3 -2
- package/src/features/column-grouping/columnGroupingFeature.ts +83 -126
- package/src/features/column-grouping/columnGroupingFeature.types.ts +32 -31
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +2 -2
- package/src/features/column-grouping/createGroupedRowModel.ts +17 -16
- package/src/features/column-ordering/columnOrderingFeature.ts +52 -84
- package/src/features/column-ordering/columnOrderingFeature.types.ts +2 -2
- package/src/features/column-pinning/columnPinningFeature.ts +268 -304
- package/src/features/column-pinning/columnPinningFeature.types.ts +4 -4
- package/src/features/column-pinning/columnPinningFeature.utils.ts +11 -19
- package/src/features/column-resizing/columnResizingFeature.ts +44 -78
- package/src/features/column-resizing/columnResizingFeature.types.ts +1 -4
- package/src/features/column-resizing/columnResizingFeature.utils.ts +5 -6
- package/src/features/column-sizing/columnSizingFeature.ts +115 -152
- package/src/features/column-sizing/columnSizingFeature.utils.ts +27 -5
- package/src/features/column-visibility/columnVisibilityFeature.ts +92 -129
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +4 -4
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +31 -15
- package/src/features/global-filtering/globalFilteringFeature.ts +45 -79
- package/src/features/global-filtering/globalFilteringFeature.types.ts +4 -4
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +5 -3
- package/src/features/row-expanding/createExpandedRowModel.ts +1 -1
- package/src/features/row-expanding/rowExpandingFeature.ts +65 -101
- package/src/features/row-expanding/rowExpandingFeature.types.ts +8 -22
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +38 -13
- package/src/features/row-pagination/createPaginatedRowModel.ts +2 -2
- package/src/features/row-pagination/rowPaginationFeature.ts +69 -103
- package/src/features/row-pagination/rowPaginationFeature.types.ts +6 -20
- package/src/features/row-pinning/rowPinningFeature.ts +72 -104
- package/src/features/row-pinning/rowPinningFeature.types.ts +4 -4
- package/src/features/row-selection/rowSelectionFeature.ts +125 -135
- package/src/features/row-selection/rowSelectionFeature.types.ts +17 -7
- package/src/features/row-selection/rowSelectionFeature.utils.ts +144 -66
- package/src/features/row-sorting/createSortedRowModel.ts +12 -15
- package/src/features/row-sorting/rowSortingFeature.ts +73 -114
- package/src/features/row-sorting/rowSortingFeature.types.ts +33 -32
- package/src/features/row-sorting/rowSortingFeature.utils.ts +8 -6
- package/src/fns/aggregationFns.ts +26 -42
- package/src/fns/filterFns.ts +237 -264
- package/src/fns/sortFns.ts +51 -29
- package/src/helpers/columnHelper.ts +4 -4
- package/src/helpers/metaHelper.ts +24 -0
- package/src/helpers/tableFeatures.ts +36 -5
- package/src/index.ts +1 -0
- package/src/store-reactivity-bindings.ts +1 -1
- package/src/types/Cell.ts +5 -21
- package/src/types/Column.ts +12 -26
- package/src/types/ColumnDef.ts +28 -18
- package/src/types/Header.ts +4 -20
- package/src/types/HeaderGroup.ts +7 -18
- package/src/types/Row.ts +6 -21
- package/src/types/RowModel.ts +15 -88
- package/src/types/RowModelFns.ts +9 -24
- package/src/types/Table.ts +54 -44
- package/src/types/TableFeatures.ts +402 -123
- package/src/types/TableOptions.ts +59 -21
- package/src/types/TableState.ts +5 -17
- package/src/utils.ts +40 -8
package/src/fns/sortFns.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { RowData } from '../types/type-utils'
|
|
2
2
|
import type { TableFeatures } from '../types/TableFeatures'
|
|
3
3
|
import type { Row } from '../types/Row'
|
|
4
|
-
import type { SortFn } from '../features/row-sorting/rowSortingFeature.types'
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Regular expression used to split mixed text and numeric chunks.
|
|
@@ -16,12 +15,12 @@ export const reSplitAlphaNumeric = /([0-9]+)/gm
|
|
|
16
15
|
*
|
|
17
16
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
18
17
|
*/
|
|
19
|
-
export const sortFn_alphanumeric
|
|
18
|
+
export const sortFn_alphanumeric = <
|
|
20
19
|
TFeatures extends TableFeatures,
|
|
21
20
|
TData extends RowData,
|
|
22
21
|
>(
|
|
23
|
-
rowA: Row<
|
|
24
|
-
rowB: Row<
|
|
22
|
+
rowA: Row<TFeatures, TData>,
|
|
23
|
+
rowB: Row<TFeatures, TData>,
|
|
25
24
|
columnId: string,
|
|
26
25
|
) => {
|
|
27
26
|
return compareAlphanumeric(
|
|
@@ -35,12 +34,12 @@ export const sortFn_alphanumeric: SortFn<any, any> = <
|
|
|
35
34
|
*
|
|
36
35
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
37
36
|
*/
|
|
38
|
-
export const sortFn_alphanumericCaseSensitive
|
|
37
|
+
export const sortFn_alphanumericCaseSensitive = <
|
|
39
38
|
TFeatures extends TableFeatures,
|
|
40
39
|
TData extends RowData,
|
|
41
40
|
>(
|
|
42
|
-
rowA: Row<
|
|
43
|
-
rowB: Row<
|
|
41
|
+
rowA: Row<TFeatures, TData>,
|
|
42
|
+
rowB: Row<TFeatures, TData>,
|
|
44
43
|
columnId: string,
|
|
45
44
|
) => {
|
|
46
45
|
return compareAlphanumeric(
|
|
@@ -56,12 +55,12 @@ export const sortFn_alphanumericCaseSensitive: SortFn<any, any> = <
|
|
|
56
55
|
*
|
|
57
56
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
58
57
|
*/
|
|
59
|
-
export const sortFn_text
|
|
58
|
+
export const sortFn_text = <
|
|
60
59
|
TFeatures extends TableFeatures,
|
|
61
60
|
TData extends RowData,
|
|
62
61
|
>(
|
|
63
|
-
rowA: Row<
|
|
64
|
-
rowB: Row<
|
|
62
|
+
rowA: Row<TFeatures, TData>,
|
|
63
|
+
rowB: Row<TFeatures, TData>,
|
|
65
64
|
columnId: string,
|
|
66
65
|
) => {
|
|
67
66
|
return compareBasic(
|
|
@@ -77,12 +76,12 @@ export const sortFn_text: SortFn<any, any> = <
|
|
|
77
76
|
*
|
|
78
77
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
79
78
|
*/
|
|
80
|
-
export const sortFn_textCaseSensitive
|
|
79
|
+
export const sortFn_textCaseSensitive = <
|
|
81
80
|
TFeatures extends TableFeatures,
|
|
82
81
|
TData extends RowData,
|
|
83
82
|
>(
|
|
84
|
-
rowA: Row<
|
|
85
|
-
rowB: Row<
|
|
83
|
+
rowA: Row<TFeatures, TData>,
|
|
84
|
+
rowB: Row<TFeatures, TData>,
|
|
86
85
|
columnId: string,
|
|
87
86
|
) => {
|
|
88
87
|
return compareBasic(
|
|
@@ -96,12 +95,12 @@ export const sortFn_textCaseSensitive: SortFn<any, any> = <
|
|
|
96
95
|
*
|
|
97
96
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
98
97
|
*/
|
|
99
|
-
export const sortFn_datetime
|
|
98
|
+
export const sortFn_datetime = <
|
|
100
99
|
TFeatures extends TableFeatures,
|
|
101
100
|
TData extends RowData,
|
|
102
101
|
>(
|
|
103
|
-
rowA: Row<
|
|
104
|
-
rowB: Row<
|
|
102
|
+
rowA: Row<TFeatures, TData>,
|
|
103
|
+
rowB: Row<TFeatures, TData>,
|
|
105
104
|
columnId: string,
|
|
106
105
|
) => {
|
|
107
106
|
const a: number | string = rowA.getValue(columnId)
|
|
@@ -118,12 +117,12 @@ export const sortFn_datetime: SortFn<any, any> = <
|
|
|
118
117
|
*
|
|
119
118
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
120
119
|
*/
|
|
121
|
-
export const sortFn_basic
|
|
120
|
+
export const sortFn_basic = <
|
|
122
121
|
TFeatures extends TableFeatures,
|
|
123
122
|
TData extends RowData,
|
|
124
123
|
>(
|
|
125
|
-
rowA: Row<
|
|
126
|
-
rowB: Row<
|
|
124
|
+
rowA: Row<TFeatures, TData>,
|
|
125
|
+
rowB: Row<TFeatures, TData>,
|
|
127
126
|
columnId: string,
|
|
128
127
|
) => {
|
|
129
128
|
return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId))
|
|
@@ -152,10 +151,8 @@ function toString(a: any) {
|
|
|
152
151
|
// It handles numbers, mixed alphanumeric combinations, and even
|
|
153
152
|
// null, undefined, and Infinity
|
|
154
153
|
function compareAlphanumeric(aStr: string, bStr: string) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const a = aStr.split(reSplitAlphaNumeric).filter(Boolean)
|
|
158
|
-
const b = bStr.split(reSplitAlphaNumeric).filter(Boolean)
|
|
154
|
+
const a = aStr.split(reSplitAlphaNumeric)
|
|
155
|
+
const b = bStr.split(reSplitAlphaNumeric)
|
|
159
156
|
|
|
160
157
|
let ai = 0
|
|
161
158
|
let bi = 0
|
|
@@ -163,16 +160,29 @@ function compareAlphanumeric(aStr: string, bStr: string) {
|
|
|
163
160
|
const bLen = b.length
|
|
164
161
|
|
|
165
162
|
while (ai < aLen && bi < bLen) {
|
|
163
|
+
// Skip the empty boundary chunks that .filter(Boolean) used to remove
|
|
164
|
+
if (!a[ai]) {
|
|
165
|
+
ai++
|
|
166
|
+
continue
|
|
167
|
+
}
|
|
168
|
+
if (!b[bi]) {
|
|
169
|
+
bi++
|
|
170
|
+
continue
|
|
171
|
+
}
|
|
172
|
+
|
|
166
173
|
const aa = a[ai++]!
|
|
167
174
|
const bb = b[bi++]!
|
|
168
175
|
|
|
176
|
+
// Chunks are either all-digit (parseInt always succeeds) or digit-free
|
|
177
|
+
// (parseInt is always NaN), so NaN-ness fully classifies each chunk
|
|
169
178
|
const an = parseInt(aa, 10)
|
|
170
179
|
const bn = parseInt(bb, 10)
|
|
171
180
|
|
|
172
|
-
const
|
|
181
|
+
const aIsNaN = isNaN(an)
|
|
182
|
+
const bIsNaN = isNaN(bn)
|
|
173
183
|
|
|
174
184
|
// Both are string
|
|
175
|
-
if (
|
|
185
|
+
if (aIsNaN && bIsNaN) {
|
|
176
186
|
if (aa > bb) {
|
|
177
187
|
return 1
|
|
178
188
|
}
|
|
@@ -182,9 +192,9 @@ function compareAlphanumeric(aStr: string, bStr: string) {
|
|
|
182
192
|
continue
|
|
183
193
|
}
|
|
184
194
|
|
|
185
|
-
// One is a string, one is a number
|
|
186
|
-
if (
|
|
187
|
-
return
|
|
195
|
+
// One is a string, one is a number — the string chunk sorts first
|
|
196
|
+
if (aIsNaN || bIsNaN) {
|
|
197
|
+
return aIsNaN ? -1 : 1
|
|
188
198
|
}
|
|
189
199
|
|
|
190
200
|
// Both are numbers
|
|
@@ -196,7 +206,19 @@ function compareAlphanumeric(aStr: string, bStr: string) {
|
|
|
196
206
|
}
|
|
197
207
|
}
|
|
198
208
|
|
|
199
|
-
|
|
209
|
+
// One side is exhausted — compare the counts of remaining non-empty chunks
|
|
210
|
+
let remaining = 0
|
|
211
|
+
for (; ai < aLen; ai++) {
|
|
212
|
+
if (a[ai]) {
|
|
213
|
+
remaining++
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
for (; bi < bLen; bi++) {
|
|
217
|
+
if (b[bi]) {
|
|
218
|
+
remaining--
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return remaining
|
|
200
222
|
}
|
|
201
223
|
|
|
202
224
|
// Exports
|
|
@@ -10,10 +10,10 @@ import type {
|
|
|
10
10
|
IdentifiedColumnDef,
|
|
11
11
|
} from '../types/ColumnDef'
|
|
12
12
|
|
|
13
|
-
export
|
|
14
|
-
TFeatures extends TableFeatures,
|
|
15
|
-
TData extends RowData,
|
|
16
|
-
>
|
|
13
|
+
export interface ColumnHelper<
|
|
14
|
+
in out TFeatures extends TableFeatures,
|
|
15
|
+
in out TData extends RowData,
|
|
16
|
+
> {
|
|
17
17
|
/**
|
|
18
18
|
* Creates a data column definition with an accessor key or function to extract the cell value.
|
|
19
19
|
* @example
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A helper for declaring the `tableMeta`/`columnMeta` type-only slots in the
|
|
3
|
+
* `features` option without a type assertion.
|
|
4
|
+
*
|
|
5
|
+
* Equivalent to `{} as TMeta`, but reads as type-only at the call site and
|
|
6
|
+
* avoids `@typescript-eslint/no-unnecessary-type-assertion` false positives
|
|
7
|
+
* when the meta type has only optional properties (where an auto-fix removing
|
|
8
|
+
* the assertion would silently degrade the inferred meta type to `{}`).
|
|
9
|
+
*
|
|
10
|
+
* The returned value is a phantom — it is ignored and stripped from the
|
|
11
|
+
* table's registered features at runtime; only its type is used.
|
|
12
|
+
* @example
|
|
13
|
+
* ```
|
|
14
|
+
* import { metaHelper, tableFeatures, rowSortingFeature } from '@tanstack/react-table'
|
|
15
|
+
* const features = tableFeatures({
|
|
16
|
+
* rowSortingFeature,
|
|
17
|
+
* tableMeta: metaHelper<MyTableMeta>(),
|
|
18
|
+
* columnMeta: metaHelper<MyColumnMeta>(),
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function metaHelper<TMeta extends object>(): TMeta {
|
|
23
|
+
return {} as TMeta
|
|
24
|
+
}
|
|
@@ -1,18 +1,49 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
TableFeatures,
|
|
3
|
+
ValidateFeatureSlots,
|
|
4
|
+
} from '../types/TableFeatures'
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* A helper function to help define the features that are to be imported and applied to a table instance.
|
|
5
8
|
* Use this utility to make it easier to have the correct type inference for the features that are being imported.
|
|
6
9
|
* **Note:** It is recommended to use this utility statically outside of a component.
|
|
10
|
+
*
|
|
11
|
+
* Alongside feature modules, this object carries everything else that is
|
|
12
|
+
* statically stitched into the table:
|
|
13
|
+
*
|
|
14
|
+
* - Row model factories (`sortedRowModel`, `filteredRowModel`, etc.)
|
|
15
|
+
* - Row model function registries (`sortFns`, `filterFns`, `aggregationFns`),
|
|
16
|
+
* whose keys become the valid string values for `sortFn`, `filterFn`,
|
|
17
|
+
* `globalFilterFn`, and `aggregationFn` with full inference
|
|
18
|
+
* - Type-only `tableMeta`/`columnMeta` slots for declaring per-table meta types
|
|
19
|
+
* instead of using global declaration merging. The values are phantom
|
|
20
|
+
* (ignored and stripped at runtime); only their types are used.
|
|
7
21
|
* @example
|
|
8
22
|
* ```
|
|
9
|
-
* import {
|
|
10
|
-
*
|
|
11
|
-
*
|
|
23
|
+
* import {
|
|
24
|
+
* columnFilteringFeature,
|
|
25
|
+
* createFilteredRowModel,
|
|
26
|
+
* createSortedRowModel,
|
|
27
|
+
* filterFns,
|
|
28
|
+
* rowSortingFeature,
|
|
29
|
+
* sortFns,
|
|
30
|
+
* tableFeatures,
|
|
31
|
+
* } from '@tanstack/react-table'
|
|
32
|
+
* const features = tableFeatures({
|
|
33
|
+
* columnFilteringFeature,
|
|
34
|
+
* rowSortingFeature,
|
|
35
|
+
* filteredRowModel: createFilteredRowModel(),
|
|
36
|
+
* sortedRowModel: createSortedRowModel(),
|
|
37
|
+
* filterFns: { ...filterFns, myCustomFilterFn },
|
|
38
|
+
* sortFns,
|
|
39
|
+
* tableMeta: {} as { updateData: (rowIndex: number, columnId: string, value: unknown) => void },
|
|
40
|
+
* columnMeta: {} as { align?: 'left' | 'right' },
|
|
41
|
+
* });
|
|
42
|
+
* const table = useTable({ features, columns, data });
|
|
12
43
|
* ```
|
|
13
44
|
*/
|
|
14
45
|
export function tableFeatures<TFeatures extends TableFeatures>(
|
|
15
|
-
features: TFeatures
|
|
46
|
+
features: TFeatures & ValidateFeatureSlots<TFeatures>,
|
|
16
47
|
): TFeatures {
|
|
17
48
|
return features
|
|
18
49
|
}
|
package/src/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './types/type-utils'
|
|
|
22
22
|
|
|
23
23
|
export * from './core/coreFeatures'
|
|
24
24
|
export * from './helpers/columnHelper'
|
|
25
|
+
export * from './helpers/metaHelper'
|
|
25
26
|
export * from './helpers/tableFeatures'
|
|
26
27
|
export * from './helpers/tableOptions'
|
|
27
28
|
export * from './utils'
|
|
@@ -11,7 +11,7 @@ import type { TableReactivityBindings } from './core/reactivity/coreReactivityFe
|
|
|
11
11
|
* import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
|
|
12
12
|
*
|
|
13
13
|
* const table = constructTable({
|
|
14
|
-
* features: tableFeatures({
|
|
14
|
+
* features: tableFeatures({ coreReactivityFeature: storeReactivityBindings() }),
|
|
15
15
|
* // ...
|
|
16
16
|
* })
|
|
17
17
|
* ```
|
package/src/types/Cell.ts
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import type { Cell_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
2
2
|
import type { CellData, RowData } from './type-utils'
|
|
3
|
-
import type {
|
|
4
|
-
ExtractFeatureMapTypes,
|
|
5
|
-
ExtractFeatureTypes,
|
|
6
|
-
TableFeatures,
|
|
7
|
-
} from './TableFeatures'
|
|
3
|
+
import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
8
4
|
import type { Cell_Cell } from '../core/cells/coreCellsFeature.types'
|
|
9
5
|
|
|
10
|
-
/**
|
|
11
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
12
|
-
* Note: This will affect the types of all tables in your project.
|
|
13
|
-
*/
|
|
14
|
-
export interface Cell_Plugins<
|
|
15
|
-
TFeatures extends TableFeatures,
|
|
16
|
-
TData extends RowData,
|
|
17
|
-
TValue extends CellData = CellData,
|
|
18
|
-
> {}
|
|
19
|
-
|
|
20
6
|
export interface Cell_Core<
|
|
21
|
-
TFeatures extends TableFeatures,
|
|
22
|
-
TData extends RowData,
|
|
7
|
+
in out TFeatures extends TableFeatures,
|
|
8
|
+
in out TData extends RowData,
|
|
23
9
|
TValue extends CellData = CellData,
|
|
24
10
|
> extends Cell_Cell<TFeatures, TData, TValue> {}
|
|
25
11
|
|
|
@@ -31,7 +17,5 @@ export type Cell<
|
|
|
31
17
|
TFeatures extends TableFeatures,
|
|
32
18
|
TData extends RowData,
|
|
33
19
|
TValue extends CellData = CellData,
|
|
34
|
-
> =
|
|
35
|
-
ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap>
|
|
36
|
-
ExtractFeatureTypes<'Cell', TFeatures> &
|
|
37
|
-
Cell_Plugins<TFeatures, TData, TValue>
|
|
20
|
+
> = Cell_Core<TFeatures, TData, TValue> &
|
|
21
|
+
ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap>
|
package/src/types/Column.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Table_Internal } from './Table'
|
|
1
2
|
import type { Column_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
|
|
2
3
|
import type { Column_ColumnFaceting } from '../features/column-faceting/columnFacetingFeature.types'
|
|
3
4
|
import type { Column_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
@@ -10,32 +11,18 @@ import type { Column_ColumnSizing } from '../features/column-sizing/columnSizing
|
|
|
10
11
|
import type { Column_ColumnVisibility } from '../features/column-visibility/columnVisibilityFeature.types'
|
|
11
12
|
import type { ColumnDefBase_All } from './ColumnDef'
|
|
12
13
|
import type { RowData } from './type-utils'
|
|
13
|
-
import type {
|
|
14
|
-
ExtractFeatureMapTypes,
|
|
15
|
-
ExtractFeatureTypes,
|
|
16
|
-
TableFeatures,
|
|
17
|
-
} from './TableFeatures'
|
|
14
|
+
import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
18
15
|
import type { Column_Column } from '../core/columns/coreColumnsFeature.types'
|
|
19
16
|
|
|
20
|
-
/**
|
|
21
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
22
|
-
* Note: This will affect the types of all tables in your project.
|
|
23
|
-
*/
|
|
24
|
-
export interface Column_Plugins<
|
|
25
|
-
TFeatures extends TableFeatures,
|
|
26
|
-
TData extends RowData,
|
|
27
|
-
TValue = unknown,
|
|
28
|
-
> {}
|
|
29
|
-
|
|
30
17
|
export interface Column_Core<
|
|
31
|
-
TFeatures extends TableFeatures,
|
|
32
|
-
TData extends RowData,
|
|
18
|
+
in out TFeatures extends TableFeatures,
|
|
19
|
+
in out TData extends RowData,
|
|
33
20
|
TValue = unknown,
|
|
34
21
|
> extends Column_Column<TFeatures, TData, TValue> {}
|
|
35
22
|
|
|
36
23
|
export interface Column_FeatureMap<
|
|
37
|
-
TFeatures extends TableFeatures,
|
|
38
|
-
TData extends RowData,
|
|
24
|
+
in out TFeatures extends TableFeatures,
|
|
25
|
+
in out TData extends RowData,
|
|
39
26
|
> {
|
|
40
27
|
columnFacetingFeature: Column_ColumnFaceting<TFeatures, TData>
|
|
41
28
|
columnFilteringFeature: Column_ColumnFiltering<TFeatures, TData>
|
|
@@ -54,14 +41,13 @@ export type Column<
|
|
|
54
41
|
TData extends RowData,
|
|
55
42
|
TValue = unknown,
|
|
56
43
|
> = Column_Core<TFeatures, TData, TValue> &
|
|
57
|
-
ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>>
|
|
58
|
-
ExtractFeatureTypes<'Column', TFeatures> &
|
|
59
|
-
Column_Plugins<TFeatures, TData, TValue>
|
|
44
|
+
ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>>
|
|
60
45
|
|
|
61
|
-
export
|
|
62
|
-
TFeatures extends TableFeatures,
|
|
63
|
-
TData extends RowData,
|
|
46
|
+
export interface Column_Internal<
|
|
47
|
+
in out TFeatures extends TableFeatures,
|
|
48
|
+
in out TData extends RowData,
|
|
64
49
|
TValue = unknown,
|
|
65
|
-
>
|
|
50
|
+
> extends Omit<Column_Core<TFeatures, TData, TValue>, 'columnDef' | 'table'> {
|
|
66
51
|
columnDef: ColumnDefBase_All<TFeatures, TData, TValue>
|
|
52
|
+
table: Table_Internal<TFeatures, TData>
|
|
67
53
|
}
|
package/src/types/ColumnDef.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CellData, RowData, UnionToIntersection } from './type-utils'
|
|
2
2
|
import type {
|
|
3
3
|
ExtractFeatureMapTypes,
|
|
4
|
-
|
|
4
|
+
IsAny,
|
|
5
5
|
TableFeatures,
|
|
6
6
|
} from './TableFeatures'
|
|
7
7
|
import type { CellContext } from '../core/cells/coreCellsFeature.types'
|
|
@@ -15,21 +15,30 @@ import type { ColumnDef_ColumnVisibility } from '../features/column-visibility/c
|
|
|
15
15
|
import type { ColumnDef_GlobalFiltering } from '../features/global-filtering/globalFilteringFeature.types'
|
|
16
16
|
import type { ColumnDef_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
export interface ColumnDef_Plugins<
|
|
23
|
-
TFeatures extends TableFeatures,
|
|
24
|
-
TData extends RowData,
|
|
18
|
+
export interface ColumnMeta<
|
|
19
|
+
in out TFeatures extends TableFeatures,
|
|
20
|
+
in out TData extends RowData,
|
|
25
21
|
TValue extends CellData = CellData,
|
|
26
22
|
> {}
|
|
27
23
|
|
|
28
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Resolves the type of `columnDef.meta` for a feature set.
|
|
26
|
+
*
|
|
27
|
+
* When the features object declares a `columnMeta` type-only slot
|
|
28
|
+
* (`tableFeatures({ ..., columnMeta: {} as MyColumnMeta })`), that type wins.
|
|
29
|
+
* Otherwise this falls back to the global declaration-merged `ColumnMeta`
|
|
30
|
+
* interface.
|
|
31
|
+
*/
|
|
32
|
+
export type ExtractColumnMeta<
|
|
29
33
|
TFeatures extends TableFeatures,
|
|
30
34
|
TData extends RowData,
|
|
31
35
|
TValue extends CellData = CellData,
|
|
32
|
-
>
|
|
36
|
+
> =
|
|
37
|
+
IsAny<TFeatures> extends true
|
|
38
|
+
? ColumnMeta<TFeatures, TData, TValue>
|
|
39
|
+
: TFeatures extends { columnMeta: infer TMeta extends object }
|
|
40
|
+
? TMeta
|
|
41
|
+
: ColumnMeta<TFeatures, TData, TValue>
|
|
33
42
|
|
|
34
43
|
/**
|
|
35
44
|
* Reads a cell value from an original row object.
|
|
@@ -70,8 +79,8 @@ export interface StringHeaderIdentifier {
|
|
|
70
79
|
}
|
|
71
80
|
|
|
72
81
|
export interface IdIdentifier<
|
|
73
|
-
TFeatures extends TableFeatures,
|
|
74
|
-
TData extends RowData,
|
|
82
|
+
in out TFeatures extends TableFeatures,
|
|
83
|
+
in out TData extends RowData,
|
|
75
84
|
TValue extends CellData = CellData,
|
|
76
85
|
> {
|
|
77
86
|
/**
|
|
@@ -110,13 +119,16 @@ interface ColumnDefBase_Core<
|
|
|
110
119
|
cell?: ColumnDefTemplate<CellContext<TFeatures, TData, TValue>>
|
|
111
120
|
/**
|
|
112
121
|
* User-defined metadata available on the resolved column definition.
|
|
122
|
+
*
|
|
123
|
+
* Declare its type per-table via the `columnMeta` type-only slot on the
|
|
124
|
+
* `features` option, or globally via declaration merging on `ColumnMeta`.
|
|
113
125
|
*/
|
|
114
|
-
meta?:
|
|
126
|
+
meta?: ExtractColumnMeta<TFeatures, TData, TValue>
|
|
115
127
|
}
|
|
116
128
|
|
|
117
129
|
export interface ColumnDef_FeatureMap<
|
|
118
|
-
TFeatures extends TableFeatures,
|
|
119
|
-
TData extends RowData,
|
|
130
|
+
in out TFeatures extends TableFeatures,
|
|
131
|
+
in out TData extends RowData,
|
|
120
132
|
TValue extends CellData,
|
|
121
133
|
> {
|
|
122
134
|
columnVisibilityFeature: ColumnDef_ColumnVisibility
|
|
@@ -137,9 +149,7 @@ export type ColumnDefBase<
|
|
|
137
149
|
ExtractFeatureMapTypes<
|
|
138
150
|
TFeatures,
|
|
139
151
|
ColumnDef_FeatureMap<TFeatures, TData, TValue>
|
|
140
|
-
>
|
|
141
|
-
ExtractFeatureTypes<'ColumnDef', TFeatures> &
|
|
142
|
-
ColumnDef_Plugins<TFeatures, TData, TValue>
|
|
152
|
+
>
|
|
143
153
|
|
|
144
154
|
export type ColumnDefBase_All<
|
|
145
155
|
TFeatures extends TableFeatures,
|
package/src/types/Header.ts
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
import type { Header_ColumnSizing } from '../features/column-sizing/columnSizingFeature.types'
|
|
2
2
|
import type { CellData, RowData } from './type-utils'
|
|
3
|
-
import type {
|
|
4
|
-
ExtractFeatureMapTypes,
|
|
5
|
-
ExtractFeatureTypes,
|
|
6
|
-
TableFeatures,
|
|
7
|
-
} from './TableFeatures'
|
|
3
|
+
import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
8
4
|
import type { Header_Header } from '../core/headers/coreHeadersFeature.types'
|
|
9
5
|
import type { Header_ColumnResizing } from '../features/column-resizing/columnResizingFeature.types'
|
|
10
6
|
|
|
11
|
-
/**
|
|
12
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
13
|
-
* Note: This will affect the types of all tables in your project.
|
|
14
|
-
*/
|
|
15
|
-
export interface Header_Plugins<
|
|
16
|
-
TFeatures extends TableFeatures,
|
|
17
|
-
TData extends RowData,
|
|
18
|
-
TValue extends CellData = CellData,
|
|
19
|
-
> {}
|
|
20
|
-
|
|
21
7
|
export interface Header_Core<
|
|
22
|
-
TFeatures extends TableFeatures,
|
|
23
|
-
TData extends RowData,
|
|
8
|
+
in out TFeatures extends TableFeatures,
|
|
9
|
+
in out TData extends RowData,
|
|
24
10
|
TValue extends CellData = CellData,
|
|
25
11
|
> extends Header_Header<TFeatures, TData, TValue> {}
|
|
26
12
|
|
|
@@ -34,6 +20,4 @@ export type Header<
|
|
|
34
20
|
TData extends RowData,
|
|
35
21
|
TValue extends CellData = CellData,
|
|
36
22
|
> = Header_Core<TFeatures, TData, TValue> &
|
|
37
|
-
ExtractFeatureMapTypes<TFeatures, Header_FeatureMap>
|
|
38
|
-
ExtractFeatureTypes<'Header', TFeatures> &
|
|
39
|
-
Header_Plugins<TFeatures, TData, TValue>
|
|
23
|
+
ExtractFeatureMapTypes<TFeatures, Header_FeatureMap>
|
package/src/types/HeaderGroup.ts
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import type { HeaderGroup_Header } from '../core/headers/coreHeadersFeature.types'
|
|
2
|
-
import type {
|
|
2
|
+
import type { TableFeatures } from './TableFeatures'
|
|
3
3
|
import type { RowData } from './type-utils'
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
7
|
-
* Note: This will affect the types of all tables in your project.
|
|
8
|
-
*/
|
|
9
|
-
export interface HeaderGroup_Plugins<
|
|
10
|
-
TFeatures extends TableFeatures,
|
|
11
|
-
TData extends RowData,
|
|
12
|
-
> {}
|
|
13
|
-
|
|
14
5
|
export interface HeaderGroup_Core<
|
|
15
|
-
TFeatures extends TableFeatures,
|
|
16
|
-
TData extends RowData,
|
|
6
|
+
in out TFeatures extends TableFeatures,
|
|
7
|
+
in out TData extends RowData,
|
|
17
8
|
> extends HeaderGroup_Header<TFeatures, TData> {}
|
|
18
9
|
|
|
19
|
-
export
|
|
20
|
-
TFeatures extends TableFeatures,
|
|
21
|
-
TData extends RowData,
|
|
22
|
-
>
|
|
23
|
-
ExtractFeatureTypes<'HeaderGroup', TFeatures> &
|
|
24
|
-
HeaderGroup_Plugins<TFeatures, TData>
|
|
10
|
+
export interface HeaderGroup<
|
|
11
|
+
in out TFeatures extends TableFeatures,
|
|
12
|
+
in out TData extends RowData,
|
|
13
|
+
> extends HeaderGroup_Core<TFeatures, TData> {}
|
package/src/types/Row.ts
CHANGED
|
@@ -6,30 +6,17 @@ import type { RowData } from './type-utils'
|
|
|
6
6
|
import type { Row_RowExpanding } from '../features/row-expanding/rowExpandingFeature.types'
|
|
7
7
|
import type { Row_RowPinning } from '../features/row-pinning/rowPinningFeature.types'
|
|
8
8
|
import type { Row_RowSelection } from '../features/row-selection/rowSelectionFeature.types'
|
|
9
|
-
import type {
|
|
10
|
-
ExtractFeatureMapTypes,
|
|
11
|
-
ExtractFeatureTypes,
|
|
12
|
-
TableFeatures,
|
|
13
|
-
} from './TableFeatures'
|
|
9
|
+
import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
14
10
|
import type { Row_Row } from '../core/rows/coreRowsFeature.types'
|
|
15
11
|
|
|
16
|
-
/**
|
|
17
|
-
* Use this interface as a target for declaration merging to add your own plugin properties.
|
|
18
|
-
* Note: This will affect the types of all tables in your project.
|
|
19
|
-
*/
|
|
20
|
-
export interface Row_Plugins<
|
|
21
|
-
TFeatures extends TableFeatures,
|
|
22
|
-
TData extends RowData,
|
|
23
|
-
> {}
|
|
24
|
-
|
|
25
12
|
export interface Row_Core<
|
|
26
|
-
TFeatures extends TableFeatures,
|
|
27
|
-
TData extends RowData,
|
|
13
|
+
in out TFeatures extends TableFeatures,
|
|
14
|
+
in out TData extends RowData,
|
|
28
15
|
> extends Row_Row<TFeatures, TData> {}
|
|
29
16
|
|
|
30
17
|
export interface Row_FeatureMap<
|
|
31
|
-
TFeatures extends TableFeatures,
|
|
32
|
-
TData extends RowData,
|
|
18
|
+
in out TFeatures extends TableFeatures,
|
|
19
|
+
in out TData extends RowData,
|
|
33
20
|
> {
|
|
34
21
|
columnFilteringFeature: Row_ColumnFiltering<TFeatures, TData>
|
|
35
22
|
columnGroupingFeature: Row_ColumnGrouping
|
|
@@ -44,6 +31,4 @@ export type Row<
|
|
|
44
31
|
TFeatures extends TableFeatures,
|
|
45
32
|
TData extends RowData,
|
|
46
33
|
> = Row_Core<TFeatures, TData> &
|
|
47
|
-
ExtractFeatureMapTypes<TFeatures, Row_FeatureMap<TFeatures, TData>>
|
|
48
|
-
ExtractFeatureTypes<'Row', TFeatures> &
|
|
49
|
-
Row_Plugins<TFeatures, TData>
|
|
34
|
+
ExtractFeatureMapTypes<TFeatures, Row_FeatureMap<TFeatures, TData>>
|