@tanstack/table-core 9.0.0-beta.1 → 9.0.0-beta.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/core/cells/constructCell.d.cts +1 -1
- package/dist/core/cells/constructCell.d.ts +1 -1
- 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 +4 -4
- package/dist/core/cells/coreCellsFeature.types.d.ts +4 -4
- package/dist/core/cells/coreCellsFeature.utils.d.cts +1 -1
- package/dist/core/cells/coreCellsFeature.utils.d.ts +1 -1
- package/dist/core/columns/constructColumn.d.cts +1 -1
- package/dist/core/columns/constructColumn.d.ts +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 +5 -5
- package/dist/core/columns/coreColumnsFeature.types.d.ts +5 -5
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +1 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +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 +1 -1
- package/dist/core/headers/buildHeaderGroups.d.ts +1 -1
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/constructHeader.d.cts +1 -1
- package/dist/core/headers/constructHeader.d.ts +1 -1
- 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 +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +1 -1
- 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 +5 -15
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +5 -15
- 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 +2 -2
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +2 -2
- 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 +1 -2
- package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
- package/dist/core/row-models/createCoreRowModel.d.cts +2 -2
- package/dist/core/row-models/createCoreRowModel.d.ts +2 -2
- package/dist/core/row-models/createCoreRowModel.js +1 -2
- package/dist/core/row-models/createCoreRowModel.js.map +1 -1
- package/dist/core/rows/constructRow.d.cts +1 -1
- package/dist/core/rows/constructRow.d.ts +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 +5 -5
- package/dist/core/rows/coreRowsFeature.types.d.ts +5 -5
- package/dist/core/rows/coreRowsFeature.utils.d.cts +1 -1
- package/dist/core/rows/coreRowsFeature.utils.d.ts +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 +27 -15
- package/dist/core/table/coreTablesFeature.types.d.ts +27 -15
- package/dist/core/table/coreTablesFeature.utils.cjs +1 -2
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.ts +1 -1
- package/dist/core/table/coreTablesFeature.utils.js +1 -2
- 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 +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +1 -1
- 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 +41 -53
- 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 +2 -2
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +2 -2
- 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 +4 -2
- 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 +4 -2
- package/dist/features/column-filtering/createFilteredRowModel.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 +58 -69
- 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.d.cts +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.cjs +5 -2
- 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 +5 -2
- 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 +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +1 -1
- 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 +13 -13
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +13 -13
- 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.utils.d.cts +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +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.d.cts +4 -4
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +4 -4
- 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.d.cts +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +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 +3 -3
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +3 -3
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +7 -5
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +7 -5
- 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.d.cts +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +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.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 +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +1 -1
- 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.d.cts +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +1 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs +65 -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 +66 -77
- package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +2 -2
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +2 -2
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +10 -6
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.js +10 -6
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs +4 -2
- 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 +4 -2
- 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 +23 -20
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +23 -20
- 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 +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +1 -1
- 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/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 +2 -20
- package/dist/index.d.cts +44 -43
- package/dist/index.d.ts +44 -43
- package/dist/index.js +22 -21
- 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 +8 -10
- package/dist/types/Cell.d.ts +8 -10
- package/dist/types/Column.d.cts +19 -12
- package/dist/types/Column.d.ts +19 -12
- package/dist/types/ColumnDef.d.cts +30 -11
- package/dist/types/ColumnDef.d.ts +30 -11
- package/dist/types/Header.d.cts +10 -11
- package/dist/types/Header.d.ts +10 -11
- package/dist/types/HeaderGroup.d.cts +4 -9
- package/dist/types/HeaderGroup.d.ts +4 -9
- package/dist/types/Row.d.cts +15 -11
- package/dist/types/Row.d.ts +15 -11
- package/dist/types/RowModel.d.cts +19 -19
- package/dist/types/RowModel.d.ts +19 -19
- package/dist/types/RowModelFns.d.cts +9 -9
- package/dist/types/RowModelFns.d.ts +9 -9
- package/dist/types/Table.d.cts +52 -24
- package/dist/types/Table.d.ts +52 -24
- package/dist/types/TableFeatures.d.cts +178 -41
- package/dist/types/TableFeatures.d.ts +178 -41
- package/dist/types/TableOptions.d.cts +31 -10
- package/dist/types/TableOptions.d.ts +31 -10
- package/dist/types/TableState.d.cts +22 -13
- package/dist/types/TableState.d.ts +22 -13
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +8 -3
- package/dist/utils.d.ts +8 -3
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- 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/coreColumnsFeature.ts +56 -83
- package/src/core/columns/coreColumnsFeature.types.ts +8 -8
- package/src/core/coreFeatures.ts +1 -1
- package/src/core/headers/buildHeaderGroups.ts +1 -1
- package/src/core/headers/coreHeadersFeature.ts +42 -64
- package/src/core/headers/coreHeadersFeature.types.ts +10 -10
- 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 +5 -4
- package/src/core/rows/coreRowsFeature.ts +45 -72
- package/src/core/rows/coreRowsFeature.types.ts +8 -8
- 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 +10 -5
- 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 +60 -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 +5 -7
- package/src/features/column-grouping/columnGroupingFeature.ts +82 -126
- package/src/features/column-grouping/columnGroupingFeature.types.ts +32 -31
- package/src/features/column-grouping/createGroupedRowModel.ts +7 -11
- 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 +5 -5
- package/src/features/column-resizing/columnResizingFeature.ts +44 -78
- package/src/features/column-sizing/columnSizingFeature.ts +115 -152
- package/src/features/column-visibility/columnVisibilityFeature.ts +92 -129
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +4 -4
- 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 +4 -2
- 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-pagination/createPaginatedRowModel.ts +1 -1
- 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 +103 -135
- package/src/features/row-selection/rowSelectionFeature.types.ts +4 -4
- package/src/features/row-selection/rowSelectionFeature.utils.ts +12 -7
- package/src/features/row-sorting/createSortedRowModel.ts +6 -6
- 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 +231 -264
- package/src/fns/sortFns.ts +51 -29
- 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 +10 -30
- package/src/types/Column.ts +21 -56
- package/src/types/ColumnDef.ts +48 -49
- package/src/types/Header.ts +10 -32
- package/src/types/HeaderGroup.ts +4 -15
- package/src/types/Row.ts +18 -39
- package/src/types/RowModel.ts +24 -114
- package/src/types/RowModelFns.ts +12 -31
- package/src/types/Table.ts +85 -80
- package/src/types/TableFeatures.ts +253 -108
- package/src/types/TableOptions.ts +70 -60
- package/src/types/TableState.ts +20 -73
- package/src/utils.ts +16 -6
package/dist/fns/sortFns.d.cts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RowData } from "../types/type-utils.cjs";
|
|
2
|
+
import { Row } from "../types/Row.cjs";
|
|
3
|
+
import { TableFeatures } from "../types/TableFeatures.cjs";
|
|
2
4
|
|
|
3
5
|
//#region src/fns/sortFns.d.ts
|
|
4
6
|
/**
|
|
@@ -13,49 +15,49 @@ declare const reSplitAlphaNumeric: RegExp;
|
|
|
13
15
|
*
|
|
14
16
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
15
17
|
*/
|
|
16
|
-
declare const sortFn_alphanumeric:
|
|
18
|
+
declare const sortFn_alphanumeric: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
|
|
17
19
|
/**
|
|
18
20
|
* Sorts rows with the built-in alphanumeric case sensitive strategy.
|
|
19
21
|
*
|
|
20
22
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
21
23
|
*/
|
|
22
|
-
declare const sortFn_alphanumericCaseSensitive:
|
|
24
|
+
declare const sortFn_alphanumericCaseSensitive: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
|
|
23
25
|
/**
|
|
24
26
|
* Sorts rows with the built-in text strategy.
|
|
25
27
|
*
|
|
26
28
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
27
29
|
*/
|
|
28
|
-
declare const sortFn_text:
|
|
30
|
+
declare const sortFn_text: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
29
31
|
/**
|
|
30
32
|
* Sorts rows with the built-in text case sensitive strategy.
|
|
31
33
|
*
|
|
32
34
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
33
35
|
*/
|
|
34
|
-
declare const sortFn_textCaseSensitive:
|
|
36
|
+
declare const sortFn_textCaseSensitive: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
35
37
|
/**
|
|
36
38
|
* Sorts rows with the built-in datetime strategy.
|
|
37
39
|
*
|
|
38
40
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
39
41
|
*/
|
|
40
|
-
declare const sortFn_datetime:
|
|
42
|
+
declare const sortFn_datetime: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
41
43
|
/**
|
|
42
44
|
* Sorts rows with the built-in basic strategy.
|
|
43
45
|
*
|
|
44
46
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
45
47
|
*/
|
|
46
|
-
declare const sortFn_basic:
|
|
48
|
+
declare const sortFn_basic: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
47
49
|
/**
|
|
48
50
|
* The built-in sorting function registry.
|
|
49
51
|
*
|
|
50
52
|
* Pass this object to sorted row model creation or extend it with custom sorting functions.
|
|
51
53
|
*/
|
|
52
54
|
declare const sortFns: {
|
|
53
|
-
alphanumeric:
|
|
54
|
-
alphanumericCaseSensitive:
|
|
55
|
-
basic:
|
|
56
|
-
datetime:
|
|
57
|
-
text:
|
|
58
|
-
textCaseSensitive:
|
|
55
|
+
alphanumeric: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
|
|
56
|
+
alphanumericCaseSensitive: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
|
|
57
|
+
basic: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
58
|
+
datetime: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
59
|
+
text: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
60
|
+
textCaseSensitive: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
59
61
|
};
|
|
60
62
|
type BuiltInSortFn = keyof typeof sortFns;
|
|
61
63
|
//#endregion
|
package/dist/fns/sortFns.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RowData } from "../types/type-utils.js";
|
|
2
|
+
import { Row } from "../types/Row.js";
|
|
3
|
+
import { TableFeatures } from "../types/TableFeatures.js";
|
|
2
4
|
|
|
3
5
|
//#region src/fns/sortFns.d.ts
|
|
4
6
|
/**
|
|
@@ -13,49 +15,49 @@ declare const reSplitAlphaNumeric: RegExp;
|
|
|
13
15
|
*
|
|
14
16
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
15
17
|
*/
|
|
16
|
-
declare const sortFn_alphanumeric:
|
|
18
|
+
declare const sortFn_alphanumeric: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
|
|
17
19
|
/**
|
|
18
20
|
* Sorts rows with the built-in alphanumeric case sensitive strategy.
|
|
19
21
|
*
|
|
20
22
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
21
23
|
*/
|
|
22
|
-
declare const sortFn_alphanumericCaseSensitive:
|
|
24
|
+
declare const sortFn_alphanumericCaseSensitive: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
|
|
23
25
|
/**
|
|
24
26
|
* Sorts rows with the built-in text strategy.
|
|
25
27
|
*
|
|
26
28
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
27
29
|
*/
|
|
28
|
-
declare const sortFn_text:
|
|
30
|
+
declare const sortFn_text: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
29
31
|
/**
|
|
30
32
|
* Sorts rows with the built-in text case sensitive strategy.
|
|
31
33
|
*
|
|
32
34
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
33
35
|
*/
|
|
34
|
-
declare const sortFn_textCaseSensitive:
|
|
36
|
+
declare const sortFn_textCaseSensitive: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
35
37
|
/**
|
|
36
38
|
* Sorts rows with the built-in datetime strategy.
|
|
37
39
|
*
|
|
38
40
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
39
41
|
*/
|
|
40
|
-
declare const sortFn_datetime:
|
|
42
|
+
declare const sortFn_datetime: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
41
43
|
/**
|
|
42
44
|
* Sorts rows with the built-in basic strategy.
|
|
43
45
|
*
|
|
44
46
|
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
45
47
|
*/
|
|
46
|
-
declare const sortFn_basic:
|
|
48
|
+
declare const sortFn_basic: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
47
49
|
/**
|
|
48
50
|
* The built-in sorting function registry.
|
|
49
51
|
*
|
|
50
52
|
* Pass this object to sorted row model creation or extend it with custom sorting functions.
|
|
51
53
|
*/
|
|
52
54
|
declare const sortFns: {
|
|
53
|
-
alphanumeric:
|
|
54
|
-
alphanumericCaseSensitive:
|
|
55
|
-
basic:
|
|
56
|
-
datetime:
|
|
57
|
-
text:
|
|
58
|
-
textCaseSensitive:
|
|
55
|
+
alphanumeric: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
|
|
56
|
+
alphanumericCaseSensitive: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
|
|
57
|
+
basic: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
58
|
+
datetime: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
59
|
+
text: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
60
|
+
textCaseSensitive: <TFeatures extends TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
|
|
59
61
|
};
|
|
60
62
|
type BuiltInSortFn = keyof typeof sortFns;
|
|
61
63
|
//#endregion
|
package/dist/fns/sortFns.js
CHANGED
|
@@ -68,28 +68,40 @@ function toString(a) {
|
|
|
68
68
|
return "";
|
|
69
69
|
}
|
|
70
70
|
function compareAlphanumeric(aStr, bStr) {
|
|
71
|
-
const a = aStr.split(reSplitAlphaNumeric)
|
|
72
|
-
const b = bStr.split(reSplitAlphaNumeric)
|
|
71
|
+
const a = aStr.split(reSplitAlphaNumeric);
|
|
72
|
+
const b = bStr.split(reSplitAlphaNumeric);
|
|
73
73
|
let ai = 0;
|
|
74
74
|
let bi = 0;
|
|
75
75
|
const aLen = a.length;
|
|
76
76
|
const bLen = b.length;
|
|
77
77
|
while (ai < aLen && bi < bLen) {
|
|
78
|
+
if (!a[ai]) {
|
|
79
|
+
ai++;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (!b[bi]) {
|
|
83
|
+
bi++;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
78
86
|
const aa = a[ai++];
|
|
79
87
|
const bb = b[bi++];
|
|
80
88
|
const an = parseInt(aa, 10);
|
|
81
89
|
const bn = parseInt(bb, 10);
|
|
82
|
-
const
|
|
83
|
-
|
|
90
|
+
const aIsNaN = isNaN(an);
|
|
91
|
+
const bIsNaN = isNaN(bn);
|
|
92
|
+
if (aIsNaN && bIsNaN) {
|
|
84
93
|
if (aa > bb) return 1;
|
|
85
94
|
if (bb > aa) return -1;
|
|
86
95
|
continue;
|
|
87
96
|
}
|
|
88
|
-
if (
|
|
97
|
+
if (aIsNaN || bIsNaN) return aIsNaN ? -1 : 1;
|
|
89
98
|
if (an > bn) return 1;
|
|
90
99
|
if (bn > an) return -1;
|
|
91
100
|
}
|
|
92
|
-
|
|
101
|
+
let remaining = 0;
|
|
102
|
+
for (; ai < aLen; ai++) if (a[ai]) remaining++;
|
|
103
|
+
for (; bi < bLen; bi++) if (b[bi]) remaining--;
|
|
104
|
+
return remaining;
|
|
93
105
|
}
|
|
94
106
|
/**
|
|
95
107
|
* The built-in sorting function registry.
|
package/dist/fns/sortFns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortFns.js","names":[],"sources":["../../src/fns/sortFns.ts"],"sourcesContent":["import type { RowData } from '../types/type-utils'\nimport type { TableFeatures } from '../types/TableFeatures'\nimport type { Row } from '../types/Row'\
|
|
1
|
+
{"version":3,"file":"sortFns.js","names":[],"sources":["../../src/fns/sortFns.ts"],"sourcesContent":["import type { RowData } from '../types/type-utils'\nimport type { TableFeatures } from '../types/TableFeatures'\nimport type { Row } from '../types/Row'\n\n/**\n * Regular expression used to split mixed text and numeric chunks.\n *\n * The alphanumeric sort functions use these chunks for natural sorting of\n * strings like `item2` before `item10`.\n */\nexport const reSplitAlphaNumeric = /([0-9]+)/gm\n\n/**\n * Sorts rows with the built-in alphanumeric strategy.\n *\n * This comparator returns ascending-order results; descending order is applied by the sorting row model.\n */\nexport const sortFn_alphanumeric = <\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowA: Row<TFeatures, TData>,\n rowB: Row<TFeatures, TData>,\n columnId: string,\n) => {\n return compareAlphanumeric(\n toString(rowA.getValue(columnId)).toLowerCase(),\n toString(rowB.getValue(columnId)).toLowerCase(),\n )\n}\n\n/**\n * Sorts rows with the built-in alphanumeric case sensitive strategy.\n *\n * This comparator returns ascending-order results; descending order is applied by the sorting row model.\n */\nexport const sortFn_alphanumericCaseSensitive = <\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowA: Row<TFeatures, TData>,\n rowB: Row<TFeatures, TData>,\n columnId: string,\n) => {\n return compareAlphanumeric(\n toString(rowA.getValue(columnId)),\n toString(rowB.getValue(columnId)),\n )\n}\n\n// The text filter is more basic (less numeric support)\n// but is much faster\n/**\n * Sorts rows with the built-in text strategy.\n *\n * This comparator returns ascending-order results; descending order is applied by the sorting row model.\n */\nexport const sortFn_text = <\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowA: Row<TFeatures, TData>,\n rowB: Row<TFeatures, TData>,\n columnId: string,\n) => {\n return compareBasic(\n toString(rowA.getValue(columnId)).toLowerCase(),\n toString(rowB.getValue(columnId)).toLowerCase(),\n )\n}\n\n// The text filter is more basic (less numeric support)\n// but is much faster\n/**\n * Sorts rows with the built-in text case sensitive strategy.\n *\n * This comparator returns ascending-order results; descending order is applied by the sorting row model.\n */\nexport const sortFn_textCaseSensitive = <\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowA: Row<TFeatures, TData>,\n rowB: Row<TFeatures, TData>,\n columnId: string,\n) => {\n return compareBasic(\n toString(rowA.getValue(columnId)),\n toString(rowB.getValue(columnId)),\n )\n}\n\n/**\n * Sorts rows with the built-in datetime strategy.\n *\n * This comparator returns ascending-order results; descending order is applied by the sorting row model.\n */\nexport const sortFn_datetime = <\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowA: Row<TFeatures, TData>,\n rowB: Row<TFeatures, TData>,\n columnId: string,\n) => {\n const a: number | string = rowA.getValue(columnId)\n const b: number | string = rowB.getValue(columnId)\n\n // Can handle nullish values\n // Use > and < because == (and ===) doesn't work with\n // Date objects (would require calling getTime()).\n return a > b ? 1 : a < b ? -1 : 0\n}\n\n/**\n * Sorts rows with the built-in basic strategy.\n *\n * This comparator returns ascending-order results; descending order is applied by the sorting row model.\n */\nexport const sortFn_basic = <\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowA: Row<TFeatures, TData>,\n rowB: Row<TFeatures, TData>,\n columnId: string,\n) => {\n return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId))\n}\n\n// Utils\n\nfunction compareBasic(a: any, b: any) {\n return a === b ? 0 : a > b ? 1 : -1\n}\n\nfunction toString(a: any) {\n if (typeof a === 'number') {\n if (isNaN(a) || a === Infinity || a === -Infinity) {\n return ''\n }\n return String(a)\n }\n if (typeof a === 'string') {\n return a\n }\n return ''\n}\n\n// Mixed sorting is slow, but very inclusive of many edge cases.\n// It handles numbers, mixed alphanumeric combinations, and even\n// null, undefined, and Infinity\nfunction compareAlphanumeric(aStr: string, bStr: string) {\n const a = aStr.split(reSplitAlphaNumeric)\n const b = bStr.split(reSplitAlphaNumeric)\n\n let ai = 0\n let bi = 0\n const aLen = a.length\n const bLen = b.length\n\n while (ai < aLen && bi < bLen) {\n // Skip the empty boundary chunks that .filter(Boolean) used to remove\n if (!a[ai]) {\n ai++\n continue\n }\n if (!b[bi]) {\n bi++\n continue\n }\n\n const aa = a[ai++]!\n const bb = b[bi++]!\n\n // Chunks are either all-digit (parseInt always succeeds) or digit-free\n // (parseInt is always NaN), so NaN-ness fully classifies each chunk\n const an = parseInt(aa, 10)\n const bn = parseInt(bb, 10)\n\n const aIsNaN = isNaN(an)\n const bIsNaN = isNaN(bn)\n\n // Both are string\n if (aIsNaN && bIsNaN) {\n if (aa > bb) {\n return 1\n }\n if (bb > aa) {\n return -1\n }\n continue\n }\n\n // One is a string, one is a number — the string chunk sorts first\n if (aIsNaN || bIsNaN) {\n return aIsNaN ? -1 : 1\n }\n\n // Both are numbers\n if (an > bn) {\n return 1\n }\n if (bn > an) {\n return -1\n }\n }\n\n // One side is exhausted — compare the counts of remaining non-empty chunks\n let remaining = 0\n for (; ai < aLen; ai++) {\n if (a[ai]) {\n remaining++\n }\n }\n for (; bi < bLen; bi++) {\n if (b[bi]) {\n remaining--\n }\n }\n return remaining\n}\n\n// Exports\n\n/**\n * The built-in sorting function registry.\n *\n * Pass this object to sorted row model creation or extend it with custom sorting functions.\n */\nexport const sortFns = {\n alphanumeric: sortFn_alphanumeric,\n alphanumericCaseSensitive: sortFn_alphanumericCaseSensitive,\n basic: sortFn_basic,\n datetime: sortFn_datetime,\n text: sortFn_text,\n textCaseSensitive: sortFn_textCaseSensitive,\n}\n\nexport type BuiltInSortFn = keyof typeof sortFns\n"],"mappings":";;;;;;;AAUA,MAAa,sBAAsB;;;;;;AAOnC,MAAa,uBAIX,MACA,MACA,aACG;CACH,OAAO,oBACL,SAAS,KAAK,SAAS,QAAQ,CAAC,CAAC,CAAC,YAAY,GAC9C,SAAS,KAAK,SAAS,QAAQ,CAAC,CAAC,CAAC,YAAY,CAChD;AACF;;;;;;AAOA,MAAa,oCAIX,MACA,MACA,aACG;CACH,OAAO,oBACL,SAAS,KAAK,SAAS,QAAQ,CAAC,GAChC,SAAS,KAAK,SAAS,QAAQ,CAAC,CAClC;AACF;;;;;;AASA,MAAa,eAIX,MACA,MACA,aACG;CACH,OAAO,aACL,SAAS,KAAK,SAAS,QAAQ,CAAC,CAAC,CAAC,YAAY,GAC9C,SAAS,KAAK,SAAS,QAAQ,CAAC,CAAC,CAAC,YAAY,CAChD;AACF;;;;;;AASA,MAAa,4BAIX,MACA,MACA,aACG;CACH,OAAO,aACL,SAAS,KAAK,SAAS,QAAQ,CAAC,GAChC,SAAS,KAAK,SAAS,QAAQ,CAAC,CAClC;AACF;;;;;;AAOA,MAAa,mBAIX,MACA,MACA,aACG;CACH,MAAM,IAAqB,KAAK,SAAS,QAAQ;CACjD,MAAM,IAAqB,KAAK,SAAS,QAAQ;CAKjD,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK;AAClC;;;;;;AAOA,MAAa,gBAIX,MACA,MACA,aACG;CACH,OAAO,aAAa,KAAK,SAAS,QAAQ,GAAG,KAAK,SAAS,QAAQ,CAAC;AACtE;AAIA,SAAS,aAAa,GAAQ,GAAQ;CACpC,OAAO,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI;AACnC;AAEA,SAAS,SAAS,GAAQ;CACxB,IAAI,OAAO,MAAM,UAAU;EACzB,IAAI,MAAM,CAAC,KAAK,MAAM,YAAY,MAAM,WACtC,OAAO;EAET,OAAO,OAAO,CAAC;CACjB;CACA,IAAI,OAAO,MAAM,UACf,OAAO;CAET,OAAO;AACT;AAKA,SAAS,oBAAoB,MAAc,MAAc;CACvD,MAAM,IAAI,KAAK,MAAM,mBAAmB;CACxC,MAAM,IAAI,KAAK,MAAM,mBAAmB;CAExC,IAAI,KAAK;CACT,IAAI,KAAK;CACT,MAAM,OAAO,EAAE;CACf,MAAM,OAAO,EAAE;CAEf,OAAO,KAAK,QAAQ,KAAK,MAAM;EAE7B,IAAI,CAAC,EAAE,KAAK;GACV;GACA;EACF;EACA,IAAI,CAAC,EAAE,KAAK;GACV;GACA;EACF;EAEA,MAAM,KAAK,EAAE;EACb,MAAM,KAAK,EAAE;EAIb,MAAM,KAAK,SAAS,IAAI,EAAE;EAC1B,MAAM,KAAK,SAAS,IAAI,EAAE;EAE1B,MAAM,SAAS,MAAM,EAAE;EACvB,MAAM,SAAS,MAAM,EAAE;EAGvB,IAAI,UAAU,QAAQ;GACpB,IAAI,KAAK,IACP,OAAO;GAET,IAAI,KAAK,IACP,OAAO;GAET;EACF;EAGA,IAAI,UAAU,QACZ,OAAO,SAAS,KAAK;EAIvB,IAAI,KAAK,IACP,OAAO;EAET,IAAI,KAAK,IACP,OAAO;CAEX;CAGA,IAAI,YAAY;CAChB,OAAO,KAAK,MAAM,MAChB,IAAI,EAAE,KACJ;CAGJ,OAAO,KAAK,MAAM,MAChB,IAAI,EAAE,KACJ;CAGJ,OAAO;AACT;;;;;;AASA,MAAa,UAAU;CACrB,cAAc;CACd,2BAA2B;CAC3B,OAAO;CACP,UAAU;CACV,MAAM;CACN,mBAAmB;AACrB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/helpers/metaHelper.ts
|
|
3
|
+
/**
|
|
4
|
+
* A helper for declaring the `tableMeta`/`columnMeta` type-only slots in the
|
|
5
|
+
* `features` option without a type assertion.
|
|
6
|
+
*
|
|
7
|
+
* Equivalent to `{} as TMeta`, but reads as type-only at the call site and
|
|
8
|
+
* avoids `@typescript-eslint/no-unnecessary-type-assertion` false positives
|
|
9
|
+
* when the meta type has only optional properties (where an auto-fix removing
|
|
10
|
+
* the assertion would silently degrade the inferred meta type to `{}`).
|
|
11
|
+
*
|
|
12
|
+
* The returned value is a phantom — it is ignored and stripped from the
|
|
13
|
+
* table's registered features at runtime; only its type is used.
|
|
14
|
+
* @example
|
|
15
|
+
* ```
|
|
16
|
+
* import { metaHelper, tableFeatures, rowSortingFeature } from '@tanstack/react-table'
|
|
17
|
+
* const features = tableFeatures({
|
|
18
|
+
* rowSortingFeature,
|
|
19
|
+
* tableMeta: metaHelper<MyTableMeta>(),
|
|
20
|
+
* columnMeta: metaHelper<MyColumnMeta>(),
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
function metaHelper() {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.metaHelper = metaHelper;
|
|
30
|
+
//# sourceMappingURL=metaHelper.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metaHelper.cjs","names":[],"sources":["../../src/helpers/metaHelper.ts"],"sourcesContent":["/**\n * A helper for declaring the `tableMeta`/`columnMeta` type-only slots in the\n * `features` option without a type assertion.\n *\n * Equivalent to `{} as TMeta`, but reads as type-only at the call site and\n * avoids `@typescript-eslint/no-unnecessary-type-assertion` false positives\n * when the meta type has only optional properties (where an auto-fix removing\n * the assertion would silently degrade the inferred meta type to `{}`).\n *\n * The returned value is a phantom — it is ignored and stripped from the\n * table's registered features at runtime; only its type is used.\n * @example\n * ```\n * import { metaHelper, tableFeatures, rowSortingFeature } from '@tanstack/react-table'\n * const features = tableFeatures({\n * rowSortingFeature,\n * tableMeta: metaHelper<MyTableMeta>(),\n * columnMeta: metaHelper<MyColumnMeta>(),\n * });\n * ```\n */\nexport function metaHelper<TMeta extends object>(): TMeta {\n return {} as TMeta\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,aAA0C;CACxD,OAAO,CAAC;AACV"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/helpers/metaHelper.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A helper for declaring the `tableMeta`/`columnMeta` type-only slots in the
|
|
4
|
+
* `features` option without a type assertion.
|
|
5
|
+
*
|
|
6
|
+
* Equivalent to `{} as TMeta`, but reads as type-only at the call site and
|
|
7
|
+
* avoids `@typescript-eslint/no-unnecessary-type-assertion` false positives
|
|
8
|
+
* when the meta type has only optional properties (where an auto-fix removing
|
|
9
|
+
* the assertion would silently degrade the inferred meta type to `{}`).
|
|
10
|
+
*
|
|
11
|
+
* The returned value is a phantom — it is ignored and stripped from the
|
|
12
|
+
* table's registered features at runtime; only its type is used.
|
|
13
|
+
* @example
|
|
14
|
+
* ```
|
|
15
|
+
* import { metaHelper, tableFeatures, rowSortingFeature } from '@tanstack/react-table'
|
|
16
|
+
* const features = tableFeatures({
|
|
17
|
+
* rowSortingFeature,
|
|
18
|
+
* tableMeta: metaHelper<MyTableMeta>(),
|
|
19
|
+
* columnMeta: metaHelper<MyColumnMeta>(),
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare function metaHelper<TMeta extends object>(): TMeta;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { metaHelper };
|
|
26
|
+
//# sourceMappingURL=metaHelper.d.cts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/helpers/metaHelper.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A helper for declaring the `tableMeta`/`columnMeta` type-only slots in the
|
|
4
|
+
* `features` option without a type assertion.
|
|
5
|
+
*
|
|
6
|
+
* Equivalent to `{} as TMeta`, but reads as type-only at the call site and
|
|
7
|
+
* avoids `@typescript-eslint/no-unnecessary-type-assertion` false positives
|
|
8
|
+
* when the meta type has only optional properties (where an auto-fix removing
|
|
9
|
+
* the assertion would silently degrade the inferred meta type to `{}`).
|
|
10
|
+
*
|
|
11
|
+
* The returned value is a phantom — it is ignored and stripped from the
|
|
12
|
+
* table's registered features at runtime; only its type is used.
|
|
13
|
+
* @example
|
|
14
|
+
* ```
|
|
15
|
+
* import { metaHelper, tableFeatures, rowSortingFeature } from '@tanstack/react-table'
|
|
16
|
+
* const features = tableFeatures({
|
|
17
|
+
* rowSortingFeature,
|
|
18
|
+
* tableMeta: metaHelper<MyTableMeta>(),
|
|
19
|
+
* columnMeta: metaHelper<MyColumnMeta>(),
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare function metaHelper<TMeta extends object>(): TMeta;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { metaHelper };
|
|
26
|
+
//# sourceMappingURL=metaHelper.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/helpers/metaHelper.ts
|
|
2
|
+
/**
|
|
3
|
+
* A helper for declaring the `tableMeta`/`columnMeta` type-only slots in the
|
|
4
|
+
* `features` option without a type assertion.
|
|
5
|
+
*
|
|
6
|
+
* Equivalent to `{} as TMeta`, but reads as type-only at the call site and
|
|
7
|
+
* avoids `@typescript-eslint/no-unnecessary-type-assertion` false positives
|
|
8
|
+
* when the meta type has only optional properties (where an auto-fix removing
|
|
9
|
+
* the assertion would silently degrade the inferred meta type to `{}`).
|
|
10
|
+
*
|
|
11
|
+
* The returned value is a phantom — it is ignored and stripped from the
|
|
12
|
+
* table's registered features at runtime; only its type is used.
|
|
13
|
+
* @example
|
|
14
|
+
* ```
|
|
15
|
+
* import { metaHelper, tableFeatures, rowSortingFeature } from '@tanstack/react-table'
|
|
16
|
+
* const features = tableFeatures({
|
|
17
|
+
* rowSortingFeature,
|
|
18
|
+
* tableMeta: metaHelper<MyTableMeta>(),
|
|
19
|
+
* columnMeta: metaHelper<MyColumnMeta>(),
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
function metaHelper() {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { metaHelper };
|
|
29
|
+
//# sourceMappingURL=metaHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metaHelper.js","names":[],"sources":["../../src/helpers/metaHelper.ts"],"sourcesContent":["/**\n * A helper for declaring the `tableMeta`/`columnMeta` type-only slots in the\n * `features` option without a type assertion.\n *\n * Equivalent to `{} as TMeta`, but reads as type-only at the call site and\n * avoids `@typescript-eslint/no-unnecessary-type-assertion` false positives\n * when the meta type has only optional properties (where an auto-fix removing\n * the assertion would silently degrade the inferred meta type to `{}`).\n *\n * The returned value is a phantom — it is ignored and stripped from the\n * table's registered features at runtime; only its type is used.\n * @example\n * ```\n * import { metaHelper, tableFeatures, rowSortingFeature } from '@tanstack/react-table'\n * const features = tableFeatures({\n * rowSortingFeature,\n * tableMeta: metaHelper<MyTableMeta>(),\n * columnMeta: metaHelper<MyColumnMeta>(),\n * });\n * ```\n */\nexport function metaHelper<TMeta extends object>(): TMeta {\n return {} as TMeta\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,aAA0C;CACxD,OAAO,CAAC;AACV"}
|
|
@@ -4,11 +4,39 @@
|
|
|
4
4
|
* A helper function to help define the features that are to be imported and applied to a table instance.
|
|
5
5
|
* Use this utility to make it easier to have the correct type inference for the features that are being imported.
|
|
6
6
|
* **Note:** It is recommended to use this utility statically outside of a component.
|
|
7
|
+
*
|
|
8
|
+
* Alongside feature modules, this object carries everything else that is
|
|
9
|
+
* statically stitched into the table:
|
|
10
|
+
*
|
|
11
|
+
* - Row model factories (`sortedRowModel`, `filteredRowModel`, etc.)
|
|
12
|
+
* - Row model function registries (`sortFns`, `filterFns`, `aggregationFns`),
|
|
13
|
+
* whose keys become the valid string values for `sortFn`, `filterFn`,
|
|
14
|
+
* `globalFilterFn`, and `aggregationFn` with full inference
|
|
15
|
+
* - Type-only `tableMeta`/`columnMeta` slots for declaring per-table meta types
|
|
16
|
+
* instead of using global declaration merging. The values are phantom
|
|
17
|
+
* (ignored and stripped at runtime); only their types are used.
|
|
7
18
|
* @example
|
|
8
19
|
* ```
|
|
9
|
-
* import {
|
|
10
|
-
*
|
|
11
|
-
*
|
|
20
|
+
* import {
|
|
21
|
+
* columnFilteringFeature,
|
|
22
|
+
* createFilteredRowModel,
|
|
23
|
+
* createSortedRowModel,
|
|
24
|
+
* filterFns,
|
|
25
|
+
* rowSortingFeature,
|
|
26
|
+
* sortFns,
|
|
27
|
+
* tableFeatures,
|
|
28
|
+
* } from '@tanstack/react-table'
|
|
29
|
+
* const features = tableFeatures({
|
|
30
|
+
* columnFilteringFeature,
|
|
31
|
+
* rowSortingFeature,
|
|
32
|
+
* filteredRowModel: createFilteredRowModel(),
|
|
33
|
+
* sortedRowModel: createSortedRowModel(),
|
|
34
|
+
* filterFns: { ...filterFns, myCustomFilterFn },
|
|
35
|
+
* sortFns,
|
|
36
|
+
* tableMeta: {} as { updateData: (rowIndex: number, columnId: string, value: unknown) => void },
|
|
37
|
+
* columnMeta: {} as { align?: 'left' | 'right' },
|
|
38
|
+
* });
|
|
39
|
+
* const table = useTable({ features, columns, data });
|
|
12
40
|
* ```
|
|
13
41
|
*/
|
|
14
42
|
function tableFeatures(features) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableFeatures.cjs","names":[],"sources":["../../src/helpers/tableFeatures.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"tableFeatures.cjs","names":[],"sources":["../../src/helpers/tableFeatures.ts"],"sourcesContent":["import type {\n TableFeatures,\n ValidateFeatureSlots,\n} from '../types/TableFeatures'\n\n/**\n * A helper function to help define the features that are to be imported and applied to a table instance.\n * Use this utility to make it easier to have the correct type inference for the features that are being imported.\n * **Note:** It is recommended to use this utility statically outside of a component.\n *\n * Alongside feature modules, this object carries everything else that is\n * statically stitched into the table:\n *\n * - Row model factories (`sortedRowModel`, `filteredRowModel`, etc.)\n * - Row model function registries (`sortFns`, `filterFns`, `aggregationFns`),\n * whose keys become the valid string values for `sortFn`, `filterFn`,\n * `globalFilterFn`, and `aggregationFn` with full inference\n * - Type-only `tableMeta`/`columnMeta` slots for declaring per-table meta types\n * instead of using global declaration merging. The values are phantom\n * (ignored and stripped at runtime); only their types are used.\n * @example\n * ```\n * import {\n * columnFilteringFeature,\n * createFilteredRowModel,\n * createSortedRowModel,\n * filterFns,\n * rowSortingFeature,\n * sortFns,\n * tableFeatures,\n * } from '@tanstack/react-table'\n * const features = tableFeatures({\n * columnFilteringFeature,\n * rowSortingFeature,\n * filteredRowModel: createFilteredRowModel(),\n * sortedRowModel: createSortedRowModel(),\n * filterFns: { ...filterFns, myCustomFilterFn },\n * sortFns,\n * tableMeta: {} as { updateData: (rowIndex: number, columnId: string, value: unknown) => void },\n * columnMeta: {} as { align?: 'left' | 'right' },\n * });\n * const table = useTable({ features, columns, data });\n * ```\n */\nexport function tableFeatures<TFeatures extends TableFeatures>(\n features: TFeatures & ValidateFeatureSlots<TFeatures>,\n): TFeatures {\n return features\n}\n\n// test\n\n// const features = tableFeatures({\n// rowPinningFeature: {},\n// });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,SAAgB,cACd,UACW;CACX,OAAO;AACT"}
|
|
@@ -1,18 +1,46 @@
|
|
|
1
|
-
import { TableFeatures } from "../types/TableFeatures.cjs";
|
|
1
|
+
import { TableFeatures, ValidateFeatureSlots } from "../types/TableFeatures.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/helpers/tableFeatures.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A helper function to help define the features that are to be imported and applied to a table instance.
|
|
6
6
|
* Use this utility to make it easier to have the correct type inference for the features that are being imported.
|
|
7
7
|
* **Note:** It is recommended to use this utility statically outside of a component.
|
|
8
|
+
*
|
|
9
|
+
* Alongside feature modules, this object carries everything else that is
|
|
10
|
+
* statically stitched into the table:
|
|
11
|
+
*
|
|
12
|
+
* - Row model factories (`sortedRowModel`, `filteredRowModel`, etc.)
|
|
13
|
+
* - Row model function registries (`sortFns`, `filterFns`, `aggregationFns`),
|
|
14
|
+
* whose keys become the valid string values for `sortFn`, `filterFn`,
|
|
15
|
+
* `globalFilterFn`, and `aggregationFn` with full inference
|
|
16
|
+
* - Type-only `tableMeta`/`columnMeta` slots for declaring per-table meta types
|
|
17
|
+
* instead of using global declaration merging. The values are phantom
|
|
18
|
+
* (ignored and stripped at runtime); only their types are used.
|
|
8
19
|
* @example
|
|
9
20
|
* ```
|
|
10
|
-
* import {
|
|
11
|
-
*
|
|
12
|
-
*
|
|
21
|
+
* import {
|
|
22
|
+
* columnFilteringFeature,
|
|
23
|
+
* createFilteredRowModel,
|
|
24
|
+
* createSortedRowModel,
|
|
25
|
+
* filterFns,
|
|
26
|
+
* rowSortingFeature,
|
|
27
|
+
* sortFns,
|
|
28
|
+
* tableFeatures,
|
|
29
|
+
* } from '@tanstack/react-table'
|
|
30
|
+
* const features = tableFeatures({
|
|
31
|
+
* columnFilteringFeature,
|
|
32
|
+
* rowSortingFeature,
|
|
33
|
+
* filteredRowModel: createFilteredRowModel(),
|
|
34
|
+
* sortedRowModel: createSortedRowModel(),
|
|
35
|
+
* filterFns: { ...filterFns, myCustomFilterFn },
|
|
36
|
+
* sortFns,
|
|
37
|
+
* tableMeta: {} as { updateData: (rowIndex: number, columnId: string, value: unknown) => void },
|
|
38
|
+
* columnMeta: {} as { align?: 'left' | 'right' },
|
|
39
|
+
* });
|
|
40
|
+
* const table = useTable({ features, columns, data });
|
|
13
41
|
* ```
|
|
14
42
|
*/
|
|
15
|
-
declare function tableFeatures<TFeatures extends TableFeatures>(features: TFeatures): TFeatures;
|
|
43
|
+
declare function tableFeatures<TFeatures extends TableFeatures>(features: TFeatures & ValidateFeatureSlots<TFeatures>): TFeatures;
|
|
16
44
|
//#endregion
|
|
17
45
|
export { tableFeatures };
|
|
18
46
|
//# sourceMappingURL=tableFeatures.d.cts.map
|
|
@@ -1,18 +1,46 @@
|
|
|
1
|
-
import { TableFeatures } from "../types/TableFeatures.js";
|
|
1
|
+
import { TableFeatures, ValidateFeatureSlots } from "../types/TableFeatures.js";
|
|
2
2
|
|
|
3
3
|
//#region src/helpers/tableFeatures.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A helper function to help define the features that are to be imported and applied to a table instance.
|
|
6
6
|
* Use this utility to make it easier to have the correct type inference for the features that are being imported.
|
|
7
7
|
* **Note:** It is recommended to use this utility statically outside of a component.
|
|
8
|
+
*
|
|
9
|
+
* Alongside feature modules, this object carries everything else that is
|
|
10
|
+
* statically stitched into the table:
|
|
11
|
+
*
|
|
12
|
+
* - Row model factories (`sortedRowModel`, `filteredRowModel`, etc.)
|
|
13
|
+
* - Row model function registries (`sortFns`, `filterFns`, `aggregationFns`),
|
|
14
|
+
* whose keys become the valid string values for `sortFn`, `filterFn`,
|
|
15
|
+
* `globalFilterFn`, and `aggregationFn` with full inference
|
|
16
|
+
* - Type-only `tableMeta`/`columnMeta` slots for declaring per-table meta types
|
|
17
|
+
* instead of using global declaration merging. The values are phantom
|
|
18
|
+
* (ignored and stripped at runtime); only their types are used.
|
|
8
19
|
* @example
|
|
9
20
|
* ```
|
|
10
|
-
* import {
|
|
11
|
-
*
|
|
12
|
-
*
|
|
21
|
+
* import {
|
|
22
|
+
* columnFilteringFeature,
|
|
23
|
+
* createFilteredRowModel,
|
|
24
|
+
* createSortedRowModel,
|
|
25
|
+
* filterFns,
|
|
26
|
+
* rowSortingFeature,
|
|
27
|
+
* sortFns,
|
|
28
|
+
* tableFeatures,
|
|
29
|
+
* } from '@tanstack/react-table'
|
|
30
|
+
* const features = tableFeatures({
|
|
31
|
+
* columnFilteringFeature,
|
|
32
|
+
* rowSortingFeature,
|
|
33
|
+
* filteredRowModel: createFilteredRowModel(),
|
|
34
|
+
* sortedRowModel: createSortedRowModel(),
|
|
35
|
+
* filterFns: { ...filterFns, myCustomFilterFn },
|
|
36
|
+
* sortFns,
|
|
37
|
+
* tableMeta: {} as { updateData: (rowIndex: number, columnId: string, value: unknown) => void },
|
|
38
|
+
* columnMeta: {} as { align?: 'left' | 'right' },
|
|
39
|
+
* });
|
|
40
|
+
* const table = useTable({ features, columns, data });
|
|
13
41
|
* ```
|
|
14
42
|
*/
|
|
15
|
-
declare function tableFeatures<TFeatures extends TableFeatures>(features: TFeatures): TFeatures;
|
|
43
|
+
declare function tableFeatures<TFeatures extends TableFeatures>(features: TFeatures & ValidateFeatureSlots<TFeatures>): TFeatures;
|
|
16
44
|
//#endregion
|
|
17
45
|
export { tableFeatures };
|
|
18
46
|
//# sourceMappingURL=tableFeatures.d.ts.map
|
|
@@ -3,11 +3,39 @@
|
|
|
3
3
|
* A helper function to help define the features that are to be imported and applied to a table instance.
|
|
4
4
|
* Use this utility to make it easier to have the correct type inference for the features that are being imported.
|
|
5
5
|
* **Note:** It is recommended to use this utility statically outside of a component.
|
|
6
|
+
*
|
|
7
|
+
* Alongside feature modules, this object carries everything else that is
|
|
8
|
+
* statically stitched into the table:
|
|
9
|
+
*
|
|
10
|
+
* - Row model factories (`sortedRowModel`, `filteredRowModel`, etc.)
|
|
11
|
+
* - Row model function registries (`sortFns`, `filterFns`, `aggregationFns`),
|
|
12
|
+
* whose keys become the valid string values for `sortFn`, `filterFn`,
|
|
13
|
+
* `globalFilterFn`, and `aggregationFn` with full inference
|
|
14
|
+
* - Type-only `tableMeta`/`columnMeta` slots for declaring per-table meta types
|
|
15
|
+
* instead of using global declaration merging. The values are phantom
|
|
16
|
+
* (ignored and stripped at runtime); only their types are used.
|
|
6
17
|
* @example
|
|
7
18
|
* ```
|
|
8
|
-
* import {
|
|
9
|
-
*
|
|
10
|
-
*
|
|
19
|
+
* import {
|
|
20
|
+
* columnFilteringFeature,
|
|
21
|
+
* createFilteredRowModel,
|
|
22
|
+
* createSortedRowModel,
|
|
23
|
+
* filterFns,
|
|
24
|
+
* rowSortingFeature,
|
|
25
|
+
* sortFns,
|
|
26
|
+
* tableFeatures,
|
|
27
|
+
* } from '@tanstack/react-table'
|
|
28
|
+
* const features = tableFeatures({
|
|
29
|
+
* columnFilteringFeature,
|
|
30
|
+
* rowSortingFeature,
|
|
31
|
+
* filteredRowModel: createFilteredRowModel(),
|
|
32
|
+
* sortedRowModel: createSortedRowModel(),
|
|
33
|
+
* filterFns: { ...filterFns, myCustomFilterFn },
|
|
34
|
+
* sortFns,
|
|
35
|
+
* tableMeta: {} as { updateData: (rowIndex: number, columnId: string, value: unknown) => void },
|
|
36
|
+
* columnMeta: {} as { align?: 'left' | 'right' },
|
|
37
|
+
* });
|
|
38
|
+
* const table = useTable({ features, columns, data });
|
|
11
39
|
* ```
|
|
12
40
|
*/
|
|
13
41
|
function tableFeatures(features) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableFeatures.js","names":[],"sources":["../../src/helpers/tableFeatures.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"tableFeatures.js","names":[],"sources":["../../src/helpers/tableFeatures.ts"],"sourcesContent":["import type {\n TableFeatures,\n ValidateFeatureSlots,\n} from '../types/TableFeatures'\n\n/**\n * A helper function to help define the features that are to be imported and applied to a table instance.\n * Use this utility to make it easier to have the correct type inference for the features that are being imported.\n * **Note:** It is recommended to use this utility statically outside of a component.\n *\n * Alongside feature modules, this object carries everything else that is\n * statically stitched into the table:\n *\n * - Row model factories (`sortedRowModel`, `filteredRowModel`, etc.)\n * - Row model function registries (`sortFns`, `filterFns`, `aggregationFns`),\n * whose keys become the valid string values for `sortFn`, `filterFn`,\n * `globalFilterFn`, and `aggregationFn` with full inference\n * - Type-only `tableMeta`/`columnMeta` slots for declaring per-table meta types\n * instead of using global declaration merging. The values are phantom\n * (ignored and stripped at runtime); only their types are used.\n * @example\n * ```\n * import {\n * columnFilteringFeature,\n * createFilteredRowModel,\n * createSortedRowModel,\n * filterFns,\n * rowSortingFeature,\n * sortFns,\n * tableFeatures,\n * } from '@tanstack/react-table'\n * const features = tableFeatures({\n * columnFilteringFeature,\n * rowSortingFeature,\n * filteredRowModel: createFilteredRowModel(),\n * sortedRowModel: createSortedRowModel(),\n * filterFns: { ...filterFns, myCustomFilterFn },\n * sortFns,\n * tableMeta: {} as { updateData: (rowIndex: number, columnId: string, value: unknown) => void },\n * columnMeta: {} as { align?: 'left' | 'right' },\n * });\n * const table = useTable({ features, columns, data });\n * ```\n */\nexport function tableFeatures<TFeatures extends TableFeatures>(\n features: TFeatures & ValidateFeatureSlots<TFeatures>,\n): TFeatures {\n return features\n}\n\n// test\n\n// const features = tableFeatures({\n// rowPinningFeature: {},\n// });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,SAAgB,cACd,UACW;CACX,OAAO;AACT"}
|
package/dist/index.cjs
CHANGED
|
@@ -14,6 +14,7 @@ const require_coreRowsFeature = require('./core/rows/coreRowsFeature.cjs');
|
|
|
14
14
|
const require_coreTablesFeature = require('./core/table/coreTablesFeature.cjs');
|
|
15
15
|
const require_coreFeatures = require('./core/coreFeatures.cjs');
|
|
16
16
|
const require_columnHelper = require('./helpers/columnHelper.cjs');
|
|
17
|
+
const require_metaHelper = require('./helpers/metaHelper.cjs');
|
|
17
18
|
const require_tableFeatures = require('./helpers/tableFeatures.cjs');
|
|
18
19
|
const require_tableOptions = require('./helpers/tableOptions.cjs');
|
|
19
20
|
const require_constructTable = require('./core/table/constructTable.cjs');
|
|
@@ -69,28 +70,8 @@ exports.columnSizingFeature = require_columnSizingFeature.columnSizingFeature;
|
|
|
69
70
|
exports.columnVisibilityFeature = require_columnVisibilityFeature.columnVisibilityFeature;
|
|
70
71
|
exports.constructCell = require_constructCell.constructCell;
|
|
71
72
|
exports.constructColumn = require_constructColumn.constructColumn;
|
|
72
|
-
exports.constructColumnFacetingFeature = require_columnFacetingFeature.constructColumnFacetingFeature;
|
|
73
|
-
exports.constructColumnFilteringFeature = require_columnFilteringFeature.constructColumnFilteringFeature;
|
|
74
|
-
exports.constructColumnGroupingFeature = require_columnGroupingFeature.constructColumnGroupingFeature;
|
|
75
|
-
exports.constructColumnOrderingFeature = require_columnOrderingFeature.constructColumnOrderingFeature;
|
|
76
|
-
exports.constructColumnPinningFeature = require_columnPinningFeature.constructColumnPinningFeature;
|
|
77
|
-
exports.constructColumnResizingFeature = require_columnResizingFeature.constructColumnResizingFeature;
|
|
78
|
-
exports.constructColumnSizingFeature = require_columnSizingFeature.constructColumnSizingFeature;
|
|
79
|
-
exports.constructColumnVisibilityFeature = require_columnVisibilityFeature.constructColumnVisibilityFeature;
|
|
80
|
-
exports.constructCoreCellsFeature = require_coreCellsFeature.constructCoreCellsFeature;
|
|
81
|
-
exports.constructCoreColumnsFeature = require_coreColumnsFeature.constructCoreColumnsFeature;
|
|
82
|
-
exports.constructCoreHeadersFeature = require_coreHeadersFeature.constructCoreHeadersFeature;
|
|
83
|
-
exports.constructCoreRowModelsFeature = require_coreRowModelsFeature.constructCoreRowModelsFeature;
|
|
84
|
-
exports.constructCoreRowsFeature = require_coreRowsFeature.constructCoreRowsFeature;
|
|
85
|
-
exports.constructCoreTablesFeature = require_coreTablesFeature.constructCoreTablesFeature;
|
|
86
|
-
exports.constructGlobalFilteringFeature = require_globalFilteringFeature.constructGlobalFilteringFeature;
|
|
87
73
|
exports.constructHeader = require_constructHeader.constructHeader;
|
|
88
74
|
exports.constructRow = require_constructRow.constructRow;
|
|
89
|
-
exports.constructRowExpandingFeature = require_rowExpandingFeature.constructRowExpandingFeature;
|
|
90
|
-
exports.constructRowPaginationFeature = require_rowPaginationFeature.constructRowPaginationFeature;
|
|
91
|
-
exports.constructRowPinningFeature = require_rowPinningFeature.constructRowPinningFeature;
|
|
92
|
-
exports.constructRowSelectionFeature = require_rowSelectionFeature.constructRowSelectionFeature;
|
|
93
|
-
exports.constructRowSortingFeature = require_rowSortingFeature.constructRowSortingFeature;
|
|
94
75
|
exports.constructTable = require_constructTable.constructTable;
|
|
95
76
|
exports.coreCellsFeature = require_coreCellsFeature.coreCellsFeature;
|
|
96
77
|
exports.coreColumnsFeature = require_coreColumnsFeature.coreColumnsFeature;
|
|
@@ -134,6 +115,7 @@ exports.globalFilteringFeature = require_globalFilteringFeature.globalFilteringF
|
|
|
134
115
|
exports.isFunction = require_utils.isFunction;
|
|
135
116
|
exports.makeStateUpdater = require_utils.makeStateUpdater;
|
|
136
117
|
exports.memo = require_utils.memo;
|
|
118
|
+
exports.metaHelper = require_metaHelper.metaHelper;
|
|
137
119
|
exports.reSplitAlphaNumeric = require_sortFns.reSplitAlphaNumeric;
|
|
138
120
|
exports.rowExpandingFeature = require_rowExpandingFeature.rowExpandingFeature;
|
|
139
121
|
exports.rowPaginationFeature = require_rowPaginationFeature.rowPaginationFeature;
|