@tanstack/table-core 9.0.0-alpha.42 → 9.0.0-alpha.46
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.cjs +5 -0
- package/dist/core/cells/constructCell.cjs.map +1 -1
- package/dist/core/cells/constructCell.d.cts +5 -0
- package/dist/core/cells/constructCell.d.ts +5 -0
- package/dist/core/cells/constructCell.js +5 -0
- package/dist/core/cells/constructCell.js.map +1 -1
- package/dist/core/cells/coreCellsFeature.cjs +5 -0
- package/dist/core/cells/coreCellsFeature.cjs.map +1 -1
- package/dist/core/cells/coreCellsFeature.d.cts +5 -0
- package/dist/core/cells/coreCellsFeature.d.ts +5 -0
- package/dist/core/cells/coreCellsFeature.js +5 -0
- package/dist/core/cells/coreCellsFeature.js.map +1 -1
- package/dist/core/cells/coreCellsFeature.utils.cjs +30 -0
- package/dist/core/cells/coreCellsFeature.utils.cjs.map +1 -1
- package/dist/core/cells/coreCellsFeature.utils.d.cts +30 -0
- package/dist/core/cells/coreCellsFeature.utils.d.ts +30 -0
- package/dist/core/cells/coreCellsFeature.utils.js +30 -0
- package/dist/core/cells/coreCellsFeature.utils.js.map +1 -1
- package/dist/core/columns/constructColumn.cjs +16 -9
- package/dist/core/columns/constructColumn.cjs.map +1 -1
- package/dist/core/columns/constructColumn.d.cts +5 -0
- package/dist/core/columns/constructColumn.d.ts +5 -0
- package/dist/core/columns/constructColumn.js +16 -9
- package/dist/core/columns/constructColumn.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.cjs +9 -0
- package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.d.cts +5 -0
- package/dist/core/columns/coreColumnsFeature.d.ts +5 -0
- package/dist/core/columns/coreColumnsFeature.js +10 -1
- package/dist/core/columns/coreColumnsFeature.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.types.d.cts +4 -0
- package/dist/core/columns/coreColumnsFeature.types.d.ts +4 -0
- package/dist/core/columns/coreColumnsFeature.utils.cjs +99 -4
- package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +92 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +92 -1
- package/dist/core/columns/coreColumnsFeature.utils.js +99 -5
- package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
- package/dist/core/coreFeatures.cjs +5 -0
- package/dist/core/coreFeatures.cjs.map +1 -1
- package/dist/core/coreFeatures.d.cts +5 -0
- package/dist/core/coreFeatures.d.ts +5 -0
- package/dist/core/coreFeatures.js +5 -0
- package/dist/core/coreFeatures.js.map +1 -1
- package/dist/core/headers/buildHeaderGroups.cjs +6 -1
- package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
- package/dist/core/headers/buildHeaderGroups.d.cts +5 -0
- package/dist/core/headers/buildHeaderGroups.d.ts +5 -0
- package/dist/core/headers/buildHeaderGroups.js +6 -1
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/constructHeader.cjs +5 -0
- package/dist/core/headers/constructHeader.cjs.map +1 -1
- package/dist/core/headers/constructHeader.d.cts +5 -0
- package/dist/core/headers/constructHeader.d.ts +5 -0
- package/dist/core/headers/constructHeader.js +5 -0
- package/dist/core/headers/constructHeader.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.cjs +5 -0
- package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.d.cts +5 -0
- package/dist/core/headers/coreHeadersFeature.d.ts +5 -0
- package/dist/core/headers/coreHeadersFeature.js +5 -0
- package/dist/core/headers/coreHeadersFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.cjs +71 -2
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +60 -0
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +60 -0
- package/dist/core/headers/coreHeadersFeature.utils.js +72 -3
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/reactivity/coreReactivityFeature.types.d.cts +1 -0
- package/dist/core/reactivity/coreReactivityFeature.types.d.ts +1 -0
- package/dist/core/reactivity/coreReactivityFeature.utils.cjs +5 -0
- package/dist/core/reactivity/coreReactivityFeature.utils.cjs.map +1 -1
- package/dist/core/reactivity/coreReactivityFeature.utils.d.cts +10 -0
- package/dist/core/reactivity/coreReactivityFeature.utils.d.ts +10 -0
- package/dist/core/reactivity/coreReactivityFeature.utils.js +5 -0
- package/dist/core/reactivity/coreReactivityFeature.utils.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.cjs +5 -0
- package/dist/core/row-models/coreRowModelsFeature.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.d.cts +5 -0
- package/dist/core/row-models/coreRowModelsFeature.d.ts +5 -0
- package/dist/core/row-models/coreRowModelsFeature.js +5 -0
- package/dist/core/row-models/coreRowModelsFeature.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.types.d.cts +2 -1
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +2 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs +120 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +120 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +120 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.js +120 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
- package/dist/core/row-models/createCoreRowModel.cjs +5 -0
- package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
- package/dist/core/row-models/createCoreRowModel.d.cts +5 -0
- package/dist/core/row-models/createCoreRowModel.d.ts +5 -0
- package/dist/core/row-models/createCoreRowModel.js +5 -0
- package/dist/core/row-models/createCoreRowModel.js.map +1 -1
- package/dist/core/rows/constructRow.cjs +5 -0
- package/dist/core/rows/constructRow.cjs.map +1 -1
- package/dist/core/rows/constructRow.d.cts +5 -0
- package/dist/core/rows/constructRow.d.ts +5 -0
- package/dist/core/rows/constructRow.js +5 -0
- package/dist/core/rows/constructRow.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.cjs +5 -0
- package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.d.cts +5 -0
- package/dist/core/rows/coreRowsFeature.d.ts +5 -0
- package/dist/core/rows/coreRowsFeature.js +5 -0
- package/dist/core/rows/coreRowsFeature.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.types.d.cts +3 -0
- package/dist/core/rows/coreRowsFeature.types.d.ts +3 -0
- package/dist/core/rows/coreRowsFeature.utils.cjs +104 -4
- package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.utils.d.cts +101 -0
- package/dist/core/rows/coreRowsFeature.utils.d.ts +101 -0
- package/dist/core/rows/coreRowsFeature.utils.js +104 -4
- package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
- package/dist/core/table/constructTable.cjs +34 -19
- package/dist/core/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.d.cts +10 -0
- package/dist/core/table/constructTable.d.ts +10 -0
- package/dist/core/table/constructTable.js +34 -19
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/core/table/coreTablesFeature.cjs +5 -0
- package/dist/core/table/coreTablesFeature.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.d.cts +5 -0
- package/dist/core/table/coreTablesFeature.d.ts +5 -0
- package/dist/core/table/coreTablesFeature.js +5 -0
- package/dist/core/table/coreTablesFeature.js.map +1 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +23 -10
- package/dist/core/table/coreTablesFeature.types.d.ts +23 -10
- package/dist/core/table/coreTablesFeature.utils.cjs +60 -1
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +46 -1
- package/dist/core/table/coreTablesFeature.utils.d.ts +46 -1
- package/dist/core/table/coreTablesFeature.utils.js +60 -2
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.cjs +9 -1
- package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.d.cts +9 -1
- package/dist/features/column-faceting/columnFacetingFeature.d.ts +9 -1
- package/dist/features/column-faceting/columnFacetingFeature.js +9 -1
- package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +12 -6
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +12 -6
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +60 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +60 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +60 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.js +60 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs +5 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +5 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +5 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.js +5 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.cjs +5 -0
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.d.cts +5 -0
- package/dist/features/column-faceting/createFacetedRowModel.d.ts +5 -0
- package/dist/features/column-faceting/createFacetedRowModel.js +5 -0
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs +5 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +5 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +5 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.js +5 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.cjs +10 -2
- package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.d.cts +10 -2
- package/dist/features/column-filtering/columnFilteringFeature.d.ts +10 -2
- package/dist/features/column-filtering/columnFilteringFeature.js +10 -2
- package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +7 -4
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +7 -4
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +113 -2
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +111 -0
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +111 -0
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +113 -2
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.cjs +5 -0
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.cts +5 -0
- package/dist/features/column-filtering/createFilteredRowModel.d.ts +5 -0
- package/dist/features/column-filtering/createFilteredRowModel.js +5 -0
- package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
- package/dist/features/column-filtering/filterRowsUtils.cjs +5 -0
- package/dist/features/column-filtering/filterRowsUtils.cjs.map +1 -1
- package/dist/features/column-filtering/filterRowsUtils.js +5 -0
- package/dist/features/column-filtering/filterRowsUtils.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.cjs +9 -1
- package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.cts +9 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.ts +9 -1
- package/dist/features/column-grouping/columnGroupingFeature.js +9 -1
- package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +7 -3
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +7 -3
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +151 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +151 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +151 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +151 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.cjs +5 -0
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.d.cts +5 -0
- package/dist/features/column-grouping/createGroupedRowModel.d.ts +5 -0
- package/dist/features/column-grouping/createGroupedRowModel.js +5 -0
- package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.cjs +12 -3
- package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.d.cts +9 -1
- package/dist/features/column-ordering/columnOrderingFeature.d.ts +9 -1
- package/dist/features/column-ordering/columnOrderingFeature.js +12 -3
- package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +4 -2
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +4 -2
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +98 -8
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +81 -0
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +81 -0
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +98 -8
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.cjs +17 -30
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.d.cts +9 -1
- package/dist/features/column-pinning/columnPinningFeature.d.ts +9 -1
- package/dist/features/column-pinning/columnPinningFeature.js +17 -30
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +6 -2
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +6 -2
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +360 -17
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +314 -3
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +314 -3
- package/dist/features/column-pinning/columnPinningFeature.utils.js +361 -18
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.cjs +9 -2
- package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.d.cts +9 -2
- package/dist/features/column-resizing/columnResizingFeature.d.ts +9 -2
- package/dist/features/column-resizing/columnResizingFeature.js +9 -2
- package/dist/features/column-resizing/columnResizingFeature.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +14 -6
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +14 -6
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +81 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +81 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +81 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.js +81 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +50 -12
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.d.cts +10 -2
- package/dist/features/column-sizing/columnSizingFeature.d.ts +10 -2
- package/dist/features/column-sizing/columnSizingFeature.js +51 -13
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +6 -3
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +6 -3
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +151 -3
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +141 -0
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +141 -0
- package/dist/features/column-sizing/columnSizingFeature.utils.js +151 -3
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +26 -25
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.d.cts +9 -1
- package/dist/features/column-visibility/columnVisibilityFeature.d.ts +9 -1
- package/dist/features/column-visibility/columnVisibilityFeature.js +27 -26
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +4 -3
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +4 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +172 -12
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +143 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +143 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +173 -12
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.cjs +9 -2
- package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.d.cts +9 -2
- package/dist/features/global-filtering/globalFilteringFeature.d.ts +9 -2
- package/dist/features/global-filtering/globalFilteringFeature.js +9 -2
- package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +4 -2
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +4 -2
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +51 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +51 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +51 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.js +51 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.cjs +10 -0
- package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.d.cts +10 -0
- package/dist/features/row-expanding/createExpandedRowModel.d.ts +10 -0
- package/dist/features/row-expanding/createExpandedRowModel.js +10 -0
- package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.cjs +9 -1
- package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.d.cts +9 -1
- package/dist/features/row-expanding/rowExpandingFeature.d.ts +9 -1
- package/dist/features/row-expanding/rowExpandingFeature.js +9 -1
- package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +10 -5
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +10 -5
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +151 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +151 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +151 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +151 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.cjs +5 -0
- package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.d.cts +5 -0
- package/dist/features/row-pagination/createPaginatedRowModel.d.ts +5 -0
- package/dist/features/row-pagination/createPaginatedRowModel.js +5 -0
- package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.cjs +9 -1
- package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.d.cts +9 -1
- package/dist/features/row-pagination/rowPaginationFeature.d.ts +9 -1
- package/dist/features/row-pagination/rowPaginationFeature.js +9 -1
- package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +11 -7
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +11 -7
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +175 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +175 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +175 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.js +175 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.cjs +9 -1
- package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.d.cts +9 -1
- package/dist/features/row-pinning/rowPinningFeature.d.ts +9 -1
- package/dist/features/row-pinning/rowPinningFeature.js +9 -1
- package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.types.d.cts +4 -2
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +4 -2
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +112 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +112 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +112 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.js +112 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs +9 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.d.cts +9 -1
- package/dist/features/row-selection/rowSelectionFeature.d.ts +9 -1
- package/dist/features/row-selection/rowSelectionFeature.js +9 -1
- package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +4 -2
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +4 -2
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +259 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +259 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +259 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.js +259 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs +5 -0
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.d.cts +5 -0
- package/dist/features/row-sorting/createSortedRowModel.d.ts +5 -0
- package/dist/features/row-sorting/createSortedRowModel.js +5 -0
- package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.cjs +11 -3
- package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.d.cts +9 -1
- package/dist/features/row-sorting/rowSortingFeature.d.ts +9 -1
- package/dist/features/row-sorting/rowSortingFeature.js +11 -3
- package/dist/features/row-sorting/rowSortingFeature.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +7 -3
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +7 -3
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +151 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +151 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +151 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.js +151 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
- package/dist/features/stockFeatures.cjs +5 -0
- package/dist/features/stockFeatures.cjs.map +1 -1
- package/dist/features/stockFeatures.d.cts +5 -0
- package/dist/features/stockFeatures.d.ts +5 -0
- package/dist/features/stockFeatures.js +5 -0
- package/dist/features/stockFeatures.js.map +1 -1
- package/dist/flex-render.cjs +10 -0
- package/dist/flex-render.cjs.map +1 -1
- package/dist/flex-render.d.cts +10 -0
- package/dist/flex-render.d.ts +10 -0
- package/dist/flex-render.js +10 -0
- package/dist/flex-render.js.map +1 -1
- package/dist/fns/aggregationFns.cjs +5 -0
- package/dist/fns/aggregationFns.cjs.map +1 -1
- package/dist/fns/aggregationFns.d.cts +5 -0
- package/dist/fns/aggregationFns.d.ts +5 -0
- package/dist/fns/aggregationFns.js +5 -0
- package/dist/fns/aggregationFns.js.map +1 -1
- package/dist/fns/filterFns.cjs +5 -0
- package/dist/fns/filterFns.cjs.map +1 -1
- package/dist/fns/filterFns.d.cts +5 -0
- package/dist/fns/filterFns.d.ts +5 -0
- package/dist/fns/filterFns.js +5 -0
- package/dist/fns/filterFns.js.map +1 -1
- package/dist/fns/sortFns.cjs +49 -4
- package/dist/fns/sortFns.cjs.map +1 -1
- package/dist/fns/sortFns.d.cts +41 -0
- package/dist/fns/sortFns.d.ts +41 -0
- package/dist/fns/sortFns.js +49 -4
- package/dist/fns/sortFns.js.map +1 -1
- package/dist/helpers/columnHelper.cjs.map +1 -1
- package/dist/helpers/columnHelper.js.map +1 -1
- package/dist/helpers/tableFeatures.cjs.map +1 -1
- package/dist/helpers/tableFeatures.js.map +1 -1
- package/dist/helpers/tableOptions.cjs +6 -0
- package/dist/helpers/tableOptions.cjs.map +1 -1
- package/dist/helpers/tableOptions.d.cts +26 -0
- package/dist/helpers/tableOptions.d.ts +26 -0
- package/dist/helpers/tableOptions.js +6 -0
- package/dist/helpers/tableOptions.js.map +1 -1
- package/dist/reactivity.cjs +1 -3
- package/dist/reactivity.d.cts +1 -2
- package/dist/reactivity.d.ts +1 -2
- package/dist/reactivity.js +1 -2
- package/dist/static-functions.cjs +2 -1
- package/dist/static-functions.d.cts +4 -4
- package/dist/static-functions.d.ts +4 -4
- package/dist/static-functions.js +4 -4
- package/dist/store-reactivity-bindings.cjs +36 -0
- package/dist/store-reactivity-bindings.cjs.map +1 -0
- package/dist/store-reactivity-bindings.d.cts +22 -0
- package/dist/store-reactivity-bindings.d.ts +22 -0
- package/dist/store-reactivity-bindings.js +35 -0
- package/dist/store-reactivity-bindings.js.map +1 -0
- package/dist/utils.cjs +45 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +45 -0
- package/dist/utils.d.ts +45 -0
- package/dist/utils.js +45 -0
- package/dist/utils.js.map +1 -1
- package/package.json +5 -1
- package/src/core/cells/constructCell.ts +5 -0
- package/src/core/cells/coreCellsFeature.ts +5 -0
- package/src/core/cells/coreCellsFeature.utils.ts +30 -0
- package/src/core/columns/constructColumn.ts +7 -1
- package/src/core/columns/coreColumnsFeature.ts +10 -0
- package/src/core/columns/coreColumnsFeature.types.ts +4 -0
- package/src/core/columns/coreColumnsFeature.utils.ts +109 -8
- package/src/core/coreFeatures.ts +5 -0
- package/src/core/headers/buildHeaderGroups.ts +7 -1
- package/src/core/headers/constructHeader.ts +5 -0
- package/src/core/headers/coreHeadersFeature.ts +5 -0
- package/src/core/headers/coreHeadersFeature.utils.ts +86 -8
- package/src/core/reactivity/coreReactivityFeature.types.ts +1 -0
- package/src/core/reactivity/coreReactivityFeature.utils.ts +15 -0
- package/src/core/row-models/coreRowModelsFeature.ts +5 -0
- package/src/core/row-models/coreRowModelsFeature.types.ts +2 -1
- package/src/core/row-models/coreRowModelsFeature.utils.ts +120 -0
- package/src/core/row-models/createCoreRowModel.ts +5 -0
- package/src/core/rows/constructRow.ts +5 -0
- package/src/core/rows/coreRowsFeature.ts +5 -0
- package/src/core/rows/coreRowsFeature.types.ts +3 -0
- package/src/core/rows/coreRowsFeature.utils.ts +106 -7
- package/src/core/table/constructTable.ts +37 -19
- package/src/core/table/coreTablesFeature.ts +5 -0
- package/src/core/table/coreTablesFeature.types.ts +23 -10
- package/src/core/table/coreTablesFeature.utils.ts +74 -1
- package/src/features/column-faceting/columnFacetingFeature.ts +9 -1
- package/src/features/column-faceting/columnFacetingFeature.types.ts +12 -6
- package/src/features/column-faceting/columnFacetingFeature.utils.ts +60 -0
- package/src/features/column-faceting/createFacetedMinMaxValues.ts +5 -0
- package/src/features/column-faceting/createFacetedRowModel.ts +5 -0
- package/src/features/column-faceting/createFacetedUniqueValues.ts +5 -0
- package/src/features/column-filtering/columnFilteringFeature.ts +10 -2
- package/src/features/column-filtering/columnFilteringFeature.types.ts +7 -4
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +113 -2
- package/src/features/column-filtering/createFilteredRowModel.ts +5 -0
- package/src/features/column-filtering/filterRowsUtils.ts +5 -0
- package/src/features/column-grouping/columnGroupingFeature.ts +9 -1
- package/src/features/column-grouping/columnGroupingFeature.types.ts +7 -3
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +151 -0
- package/src/features/column-grouping/createGroupedRowModel.ts +5 -0
- package/src/features/column-ordering/columnOrderingFeature.ts +10 -1
- package/src/features/column-ordering/columnOrderingFeature.types.ts +4 -2
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +110 -18
- package/src/features/column-pinning/columnPinningFeature.ts +11 -12
- package/src/features/column-pinning/columnPinningFeature.types.ts +6 -2
- package/src/features/column-pinning/columnPinningFeature.utils.ts +390 -57
- package/src/features/column-resizing/columnResizingFeature.ts +9 -2
- package/src/features/column-resizing/columnResizingFeature.types.ts +14 -6
- package/src/features/column-resizing/columnResizingFeature.utils.ts +81 -0
- package/src/features/column-sizing/columnSizingFeature.ts +38 -18
- package/src/features/column-sizing/columnSizingFeature.types.ts +6 -3
- package/src/features/column-sizing/columnSizingFeature.utils.ts +168 -9
- package/src/features/column-visibility/columnVisibilityFeature.ts +15 -21
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +4 -3
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +179 -23
- package/src/features/global-filtering/globalFilteringFeature.ts +9 -2
- package/src/features/global-filtering/globalFilteringFeature.types.ts +4 -2
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +51 -0
- package/src/features/row-expanding/createExpandedRowModel.ts +10 -0
- package/src/features/row-expanding/rowExpandingFeature.ts +9 -1
- package/src/features/row-expanding/rowExpandingFeature.types.ts +10 -5
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +151 -0
- package/src/features/row-pagination/createPaginatedRowModel.ts +5 -0
- package/src/features/row-pagination/rowPaginationFeature.ts +9 -1
- package/src/features/row-pagination/rowPaginationFeature.types.ts +11 -7
- package/src/features/row-pagination/rowPaginationFeature.utils.ts +175 -0
- package/src/features/row-pinning/rowPinningFeature.ts +9 -1
- package/src/features/row-pinning/rowPinningFeature.types.ts +4 -2
- package/src/features/row-pinning/rowPinningFeature.utils.ts +112 -0
- package/src/features/row-selection/rowSelectionFeature.ts +9 -1
- package/src/features/row-selection/rowSelectionFeature.types.ts +4 -2
- package/src/features/row-selection/rowSelectionFeature.utils.ts +259 -0
- package/src/features/row-sorting/createSortedRowModel.ts +5 -0
- package/src/features/row-sorting/rowSortingFeature.ts +11 -3
- package/src/features/row-sorting/rowSortingFeature.types.ts +7 -3
- package/src/features/row-sorting/rowSortingFeature.utils.ts +151 -0
- package/src/features/stockFeatures.ts +5 -0
- package/src/flex-render.ts +10 -0
- package/src/fns/aggregationFns.ts +5 -0
- package/src/fns/filterFns.ts +5 -0
- package/src/fns/sortFns.ts +50 -5
- package/src/helpers/tableOptions.ts +32 -0
- package/src/reactivity.ts +0 -1
- package/src/store-reactivity-bindings.ts +35 -0
- package/src/types/Table.ts +1 -1
- package/src/utils.ts +45 -0
- package/dist/core/reactivity/constructReactivityBindings.cjs +0 -19
- package/dist/core/reactivity/constructReactivityBindings.cjs.map +0 -1
- package/dist/core/reactivity/constructReactivityBindings.d.cts +0 -7
- package/dist/core/reactivity/constructReactivityBindings.d.ts +0 -7
- package/dist/core/reactivity/constructReactivityBindings.js +0 -19
- package/dist/core/reactivity/constructReactivityBindings.js.map +0 -1
- package/src/core/reactivity/constructReactivityBindings.ts +0 -19
|
@@ -172,7 +172,9 @@ export interface TableOptions_RowSorting {
|
|
|
172
172
|
*/
|
|
173
173
|
maxMultiSortColCount?: number
|
|
174
174
|
/**
|
|
175
|
-
*
|
|
175
|
+
* Called with an updater when sorting state changes. Pair this with
|
|
176
|
+
* `state.sorting` when using external state; external atoms can own the slice
|
|
177
|
+
* without this callback.
|
|
176
178
|
*/
|
|
177
179
|
onSortingChange?: OnChangeFn<SortingState>
|
|
178
180
|
/**
|
|
@@ -190,7 +192,7 @@ export interface Table_RowSorting<
|
|
|
190
192
|
*/
|
|
191
193
|
resetSorting: (defaultState?: boolean) => void
|
|
192
194
|
/**
|
|
193
|
-
* Sets
|
|
195
|
+
* Sets sorting state using a value or updater.
|
|
194
196
|
*/
|
|
195
197
|
setSorting: (updater: Updater<SortingState>) => void
|
|
196
198
|
}
|
|
@@ -214,7 +216,9 @@ export interface CreateRowModel_Sorted<
|
|
|
214
216
|
TData extends RowData,
|
|
215
217
|
> {
|
|
216
218
|
/**
|
|
217
|
-
*
|
|
219
|
+
* Factory used to retrieve the sorted row model. If using server-side
|
|
220
|
+
* sorting, this is not required. To use client-side sorting, pass the
|
|
221
|
+
* exported `createSortedRowModel()` or implement your own factory.
|
|
218
222
|
*/
|
|
219
223
|
sortedRowModel?: (
|
|
220
224
|
table: Table<TFeatures, TData>,
|
|
@@ -12,10 +12,30 @@ import type {
|
|
|
12
12
|
|
|
13
13
|
// State Utils
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Returns the default sorting state.
|
|
17
|
+
*
|
|
18
|
+
* Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const initialValue = getDefaultSortingState()
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
15
25
|
export function getDefaultSortingState(): SortingState {
|
|
16
26
|
return []
|
|
17
27
|
}
|
|
18
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Updates the table's sorting state slice.
|
|
31
|
+
*
|
|
32
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* table_setSorting(table, (old) => old)
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
19
39
|
export function table_setSorting<
|
|
20
40
|
TFeatures extends TableFeatures,
|
|
21
41
|
TData extends RowData,
|
|
@@ -23,6 +43,17 @@ export function table_setSorting<
|
|
|
23
43
|
table.options.onSortingChange?.(updater)
|
|
24
44
|
}
|
|
25
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Resets the table's sorting state slice.
|
|
48
|
+
*
|
|
49
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* table_resetSorting(table)
|
|
54
|
+
* table_resetSorting(table, true)
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
26
57
|
export function table_resetSorting<
|
|
27
58
|
TFeatures extends TableFeatures,
|
|
28
59
|
TData extends RowData,
|
|
@@ -35,6 +66,16 @@ export function table_resetSorting<
|
|
|
35
66
|
|
|
36
67
|
// Column Utils
|
|
37
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Infers sort fn for a column.
|
|
71
|
+
*
|
|
72
|
+
* The inference uses the column definition, table options, and sampled row values when needed.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const value = column_getAutoSortFn(column)
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
38
79
|
export function column_getAutoSortFn<
|
|
39
80
|
TFeatures extends TableFeatures,
|
|
40
81
|
TData extends RowData,
|
|
@@ -72,6 +113,16 @@ export function column_getAutoSortFn<
|
|
|
72
113
|
return sortFn ?? sortFn_basic
|
|
73
114
|
}
|
|
74
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Infers sort dir for a column.
|
|
118
|
+
*
|
|
119
|
+
* The inference uses the column definition, table options, and sampled row values when needed.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const value = column_getAutoSortDir(column)
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
75
126
|
export function column_getAutoSortDir<
|
|
76
127
|
TFeatures extends TableFeatures,
|
|
77
128
|
TData extends RowData,
|
|
@@ -88,6 +139,16 @@ export function column_getAutoSortDir<
|
|
|
88
139
|
return 'desc'
|
|
89
140
|
}
|
|
90
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Returns sort fn for a column.
|
|
144
|
+
*
|
|
145
|
+
* This derives the value from the column definition, table options, and the feature state atoms registered on the table.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* const value = column_getSortFn(column)
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
91
152
|
export function column_getSortFn<
|
|
92
153
|
TFeatures extends TableFeatures,
|
|
93
154
|
TData extends RowData,
|
|
@@ -103,6 +164,16 @@ export function column_getSortFn<
|
|
|
103
164
|
: (sortFns?.[column.columnDef.sortFn as string] ?? sortFn_basic)
|
|
104
165
|
}
|
|
105
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Toggles sorting for a column.
|
|
169
|
+
*
|
|
170
|
+
* The update is applied through the owning table state slice and respects the feature options for that column.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* column_toggleSorting(column)
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
106
177
|
export function column_toggleSorting<
|
|
107
178
|
TFeatures extends TableFeatures,
|
|
108
179
|
TData extends RowData,
|
|
@@ -206,6 +277,16 @@ export function column_toggleSorting<
|
|
|
206
277
|
})
|
|
207
278
|
}
|
|
208
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Returns first sort dir for a column.
|
|
282
|
+
*
|
|
283
|
+
* This derives the value from the column definition, table options, and the feature state atoms registered on the table.
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* const value = column_getFirstSortDir(column)
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
209
290
|
export function column_getFirstSortDir<
|
|
210
291
|
TFeatures extends TableFeatures,
|
|
211
292
|
TData extends RowData,
|
|
@@ -218,6 +299,16 @@ export function column_getFirstSortDir<
|
|
|
218
299
|
return sortDescFirst ? 'desc' : 'asc'
|
|
219
300
|
}
|
|
220
301
|
|
|
302
|
+
/**
|
|
303
|
+
* Returns next sorting order for a column.
|
|
304
|
+
*
|
|
305
|
+
* This derives the value from the column definition, table options, and the feature state atoms registered on the table.
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* ```ts
|
|
309
|
+
* const value = column_getNextSortingOrder(column)
|
|
310
|
+
* ```
|
|
311
|
+
*/
|
|
221
312
|
export function column_getNextSortingOrder<
|
|
222
313
|
TFeatures extends TableFeatures,
|
|
223
314
|
TData extends RowData,
|
|
@@ -240,6 +331,16 @@ export function column_getNextSortingOrder<
|
|
|
240
331
|
return isSorted === 'desc' ? 'asc' : 'desc'
|
|
241
332
|
}
|
|
242
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Returns whether a column can use sort.
|
|
336
|
+
*
|
|
337
|
+
* This combines column options, table options, and any required accessor or feature state for the capability.
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* ```ts
|
|
341
|
+
* const value = column_getCanSort(column)
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
243
344
|
export function column_getCanSort<
|
|
244
345
|
TFeatures extends TableFeatures,
|
|
245
346
|
TData extends RowData,
|
|
@@ -252,6 +353,16 @@ export function column_getCanSort<
|
|
|
252
353
|
)
|
|
253
354
|
}
|
|
254
355
|
|
|
356
|
+
/**
|
|
357
|
+
* Returns whether a column can use multi sort.
|
|
358
|
+
*
|
|
359
|
+
* This combines column options, table options, and any required accessor or feature state for the capability.
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* ```ts
|
|
363
|
+
* const value = column_getCanMultiSort(column)
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
255
366
|
export function column_getCanMultiSort<
|
|
256
367
|
TFeatures extends TableFeatures,
|
|
257
368
|
TData extends RowData,
|
|
@@ -264,6 +375,16 @@ export function column_getCanMultiSort<
|
|
|
264
375
|
)
|
|
265
376
|
}
|
|
266
377
|
|
|
378
|
+
/**
|
|
379
|
+
* Returns is sorted for a column.
|
|
380
|
+
*
|
|
381
|
+
* This derives the value from the column definition, table options, and the feature state atoms registered on the table.
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```ts
|
|
385
|
+
* const value = column_getIsSorted(column)
|
|
386
|
+
* ```
|
|
387
|
+
*/
|
|
267
388
|
export function column_getIsSorted<
|
|
268
389
|
TFeatures extends TableFeatures,
|
|
269
390
|
TData extends RowData,
|
|
@@ -275,6 +396,16 @@ export function column_getIsSorted<
|
|
|
275
396
|
return !columnSort ? false : columnSort.desc ? 'desc' : 'asc'
|
|
276
397
|
}
|
|
277
398
|
|
|
399
|
+
/**
|
|
400
|
+
* Returns sort index for a column.
|
|
401
|
+
*
|
|
402
|
+
* This derives the value from the column definition, table options, and the feature state atoms registered on the table.
|
|
403
|
+
*
|
|
404
|
+
* @example
|
|
405
|
+
* ```ts
|
|
406
|
+
* const value = column_getSortIndex(column)
|
|
407
|
+
* ```
|
|
408
|
+
*/
|
|
278
409
|
export function column_getSortIndex<
|
|
279
410
|
TFeatures extends TableFeatures,
|
|
280
411
|
TData extends RowData,
|
|
@@ -286,6 +417,16 @@ export function column_getSortIndex<
|
|
|
286
417
|
)
|
|
287
418
|
}
|
|
288
419
|
|
|
420
|
+
/**
|
|
421
|
+
* Clear Sorting. for a column.
|
|
422
|
+
*
|
|
423
|
+
* This is the static implementation behind the matching column instance API.
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* ```ts
|
|
427
|
+
* const value = column_clearSorting(column)
|
|
428
|
+
* ```
|
|
429
|
+
*/
|
|
289
430
|
export function column_clearSorting<
|
|
290
431
|
TFeatures extends TableFeatures,
|
|
291
432
|
TData extends RowData,
|
|
@@ -297,6 +438,16 @@ export function column_clearSorting<
|
|
|
297
438
|
)
|
|
298
439
|
}
|
|
299
440
|
|
|
441
|
+
/**
|
|
442
|
+
* Returns an event handler for toggling sorting handler.
|
|
443
|
+
*
|
|
444
|
+
* The handler is intended for direct use in column header controls such as buttons or checkboxes.
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
* ```ts
|
|
448
|
+
* const value = column_getToggleSortingHandler(column)
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
300
451
|
export function column_getToggleSortingHandler<
|
|
301
452
|
TFeatures extends TableFeatures,
|
|
302
453
|
TData extends RowData,
|
|
@@ -30,6 +30,11 @@ export interface StockFeatures {
|
|
|
30
30
|
rowSortingFeature: typeof rowSortingFeature
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* The complete set of stock optional table features.
|
|
35
|
+
*
|
|
36
|
+
* Use individual feature exports for tree-shaking, or this aggregate when a table should include every built-in feature.
|
|
37
|
+
*/
|
|
33
38
|
export const stockFeatures: StockFeatures = {
|
|
34
39
|
columnFacetingFeature,
|
|
35
40
|
columnFilteringFeature,
|
package/src/flex-render.ts
CHANGED
|
@@ -3,6 +3,11 @@ import type { Header } from './types/Header'
|
|
|
3
3
|
import type { TableFeatures } from './types/TableFeatures'
|
|
4
4
|
import type { CellData, RowData } from './types/type-utils'
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Renders a static value or render function with the provided props.
|
|
8
|
+
*
|
|
9
|
+
* Framework adapters use this helper to support column definitions that contain either plain values or template functions.
|
|
10
|
+
*/
|
|
6
11
|
export function flexRender<TProps extends object>(
|
|
7
12
|
comp: unknown,
|
|
8
13
|
props: TProps,
|
|
@@ -33,6 +38,11 @@ export type FlexRenderProps<
|
|
|
33
38
|
header?: never
|
|
34
39
|
}
|
|
35
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Renders a static value or render function with the provided props.
|
|
43
|
+
*
|
|
44
|
+
* Framework adapters use this helper to support column definitions that contain either plain values or template functions.
|
|
45
|
+
*/
|
|
36
46
|
export function FlexRender<
|
|
37
47
|
TFeatures extends TableFeatures,
|
|
38
48
|
TData extends RowData,
|
|
@@ -205,6 +205,11 @@ export const aggregationFn_count: AggregationFn<any, any> = <
|
|
|
205
205
|
return leafRows.length
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
+
/**
|
|
209
|
+
* The built-in aggregation function registry.
|
|
210
|
+
*
|
|
211
|
+
* Pass this object to grouped row model creation or extend it with custom aggregation functions for grouped columns.
|
|
212
|
+
*/
|
|
208
213
|
export const aggregationFns = {
|
|
209
214
|
sum: aggregationFn_sum,
|
|
210
215
|
min: aggregationFn_min,
|
package/src/fns/filterFns.ts
CHANGED
|
@@ -355,6 +355,11 @@ filterFn_arrIncludesSome.autoRemove = (val: any) =>
|
|
|
355
355
|
|
|
356
356
|
// Export
|
|
357
357
|
|
|
358
|
+
/**
|
|
359
|
+
* The built-in filter function registry.
|
|
360
|
+
*
|
|
361
|
+
* Pass this object to filtered row model creation or extend it with custom filter functions.
|
|
362
|
+
*/
|
|
358
363
|
export const filterFns = {
|
|
359
364
|
arrIncludes: filterFn_arrIncludes,
|
|
360
365
|
arrIncludesAll: filterFn_arrIncludesAll,
|
package/src/fns/sortFns.ts
CHANGED
|
@@ -3,8 +3,19 @@ import type { TableFeatures } from '../types/TableFeatures'
|
|
|
3
3
|
import type { Row } from '../types/Row'
|
|
4
4
|
import type { SortFn } from '../features/row-sorting/rowSortingFeature.types'
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Regular expression used to split mixed text and numeric chunks.
|
|
8
|
+
*
|
|
9
|
+
* The alphanumeric sort functions use these chunks for natural sorting of
|
|
10
|
+
* strings like `item2` before `item10`.
|
|
11
|
+
*/
|
|
6
12
|
export const reSplitAlphaNumeric = /([0-9]+)/gm
|
|
7
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Sorts rows with the built-in alphanumeric strategy.
|
|
16
|
+
*
|
|
17
|
+
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
18
|
+
*/
|
|
8
19
|
export const sortFn_alphanumeric: SortFn<any, any> = <
|
|
9
20
|
TFeatures extends TableFeatures,
|
|
10
21
|
TData extends RowData,
|
|
@@ -19,6 +30,11 @@ export const sortFn_alphanumeric: SortFn<any, any> = <
|
|
|
19
30
|
)
|
|
20
31
|
}
|
|
21
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Sorts rows with the built-in alphanumeric case sensitive strategy.
|
|
35
|
+
*
|
|
36
|
+
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
37
|
+
*/
|
|
22
38
|
export const sortFn_alphanumericCaseSensitive: SortFn<any, any> = <
|
|
23
39
|
TFeatures extends TableFeatures,
|
|
24
40
|
TData extends RowData,
|
|
@@ -35,6 +51,11 @@ export const sortFn_alphanumericCaseSensitive: SortFn<any, any> = <
|
|
|
35
51
|
|
|
36
52
|
// The text filter is more basic (less numeric support)
|
|
37
53
|
// but is much faster
|
|
54
|
+
/**
|
|
55
|
+
* Sorts rows with the built-in text strategy.
|
|
56
|
+
*
|
|
57
|
+
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
58
|
+
*/
|
|
38
59
|
export const sortFn_text: SortFn<any, any> = <
|
|
39
60
|
TFeatures extends TableFeatures,
|
|
40
61
|
TData extends RowData,
|
|
@@ -51,6 +72,11 @@ export const sortFn_text: SortFn<any, any> = <
|
|
|
51
72
|
|
|
52
73
|
// The text filter is more basic (less numeric support)
|
|
53
74
|
// but is much faster
|
|
75
|
+
/**
|
|
76
|
+
* Sorts rows with the built-in text case sensitive strategy.
|
|
77
|
+
*
|
|
78
|
+
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
79
|
+
*/
|
|
54
80
|
export const sortFn_textCaseSensitive: SortFn<any, any> = <
|
|
55
81
|
TFeatures extends TableFeatures,
|
|
56
82
|
TData extends RowData,
|
|
@@ -65,6 +91,11 @@ export const sortFn_textCaseSensitive: SortFn<any, any> = <
|
|
|
65
91
|
)
|
|
66
92
|
}
|
|
67
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Sorts rows with the built-in datetime strategy.
|
|
96
|
+
*
|
|
97
|
+
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
98
|
+
*/
|
|
68
99
|
export const sortFn_datetime: SortFn<any, any> = <
|
|
69
100
|
TFeatures extends TableFeatures,
|
|
70
101
|
TData extends RowData,
|
|
@@ -82,6 +113,11 @@ export const sortFn_datetime: SortFn<any, any> = <
|
|
|
82
113
|
return a > b ? 1 : a < b ? -1 : 0
|
|
83
114
|
}
|
|
84
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Sorts rows with the built-in basic strategy.
|
|
118
|
+
*
|
|
119
|
+
* This comparator returns ascending-order results; descending order is applied by the sorting row model.
|
|
120
|
+
*/
|
|
85
121
|
export const sortFn_basic: SortFn<any, any> = <
|
|
86
122
|
TFeatures extends TableFeatures,
|
|
87
123
|
TData extends RowData,
|
|
@@ -121,10 +157,14 @@ function compareAlphanumeric(aStr: string, bStr: string) {
|
|
|
121
157
|
const a = aStr.split(reSplitAlphaNumeric).filter(Boolean)
|
|
122
158
|
const b = bStr.split(reSplitAlphaNumeric).filter(Boolean)
|
|
123
159
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
160
|
+
let ai = 0
|
|
161
|
+
let bi = 0
|
|
162
|
+
const aLen = a.length
|
|
163
|
+
const bLen = b.length
|
|
164
|
+
|
|
165
|
+
while (ai < aLen && bi < bLen) {
|
|
166
|
+
const aa = a[ai++]!
|
|
167
|
+
const bb = b[bi++]!
|
|
128
168
|
|
|
129
169
|
const an = parseInt(aa, 10)
|
|
130
170
|
const bn = parseInt(bb, 10)
|
|
@@ -156,11 +196,16 @@ function compareAlphanumeric(aStr: string, bStr: string) {
|
|
|
156
196
|
}
|
|
157
197
|
}
|
|
158
198
|
|
|
159
|
-
return
|
|
199
|
+
return aLen - ai - (bLen - bi)
|
|
160
200
|
}
|
|
161
201
|
|
|
162
202
|
// Exports
|
|
163
203
|
|
|
204
|
+
/**
|
|
205
|
+
* The built-in sorting function registry.
|
|
206
|
+
*
|
|
207
|
+
* Pass this object to sorted row model creation or extend it with custom sorting functions.
|
|
208
|
+
*/
|
|
164
209
|
export const sortFns = {
|
|
165
210
|
alphanumeric: sortFn_alphanumeric,
|
|
166
211
|
alphanumericCaseSensitive: sortFn_alphanumericCaseSensitive,
|
|
@@ -2,6 +2,11 @@ import type { RowData } from '../types/type-utils'
|
|
|
2
2
|
import type { TableFeatures } from '../types/TableFeatures'
|
|
3
3
|
import type { TableOptions } from '../types/TableOptions'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Returns table options while preserving generic inference.
|
|
7
|
+
*
|
|
8
|
+
* This helper is useful when composing reusable table options outside of a framework adapter call.
|
|
9
|
+
*/
|
|
5
10
|
export function tableOptions<
|
|
6
11
|
TFeatures extends TableFeatures,
|
|
7
12
|
TData extends RowData = any,
|
|
@@ -13,6 +18,9 @@ export function tableOptions<
|
|
|
13
18
|
_features: TFeatures
|
|
14
19
|
}
|
|
15
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Returns table options while preserving generic inference when `data` is supplied later.
|
|
23
|
+
*/
|
|
16
24
|
export function tableOptions<
|
|
17
25
|
TFeatures extends TableFeatures,
|
|
18
26
|
TData extends RowData = any,
|
|
@@ -24,6 +32,9 @@ export function tableOptions<
|
|
|
24
32
|
_features: TFeatures
|
|
25
33
|
}
|
|
26
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Returns table options while preserving generic inference when both `data` and `columns` are supplied later.
|
|
37
|
+
*/
|
|
27
38
|
export function tableOptions<
|
|
28
39
|
TFeatures extends TableFeatures,
|
|
29
40
|
TData extends RowData = any,
|
|
@@ -35,11 +46,17 @@ export function tableOptions<
|
|
|
35
46
|
_features: TFeatures
|
|
36
47
|
}
|
|
37
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Returns a fully specified table options object without changing its runtime value.
|
|
51
|
+
*/
|
|
38
52
|
export function tableOptions<
|
|
39
53
|
TFeatures extends TableFeatures,
|
|
40
54
|
TData extends RowData = any,
|
|
41
55
|
>(options: TableOptions<TFeatures, TData>): TableOptions<TFeatures, TData>
|
|
42
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Returns table options while preserving generic inference when `_features` is supplied by a wrapper.
|
|
59
|
+
*/
|
|
43
60
|
export function tableOptions<
|
|
44
61
|
TFeatures extends TableFeatures,
|
|
45
62
|
TData extends RowData = any,
|
|
@@ -47,6 +64,9 @@ export function tableOptions<
|
|
|
47
64
|
options: Omit<TableOptions<TFeatures, TData>, '_features'>,
|
|
48
65
|
): Omit<TableOptions<TFeatures, TData>, '_features'>
|
|
49
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Returns table options while preserving generic inference when `data` and `_features` are supplied by a wrapper.
|
|
69
|
+
*/
|
|
50
70
|
export function tableOptions<
|
|
51
71
|
TFeatures extends TableFeatures,
|
|
52
72
|
TData extends RowData = any,
|
|
@@ -54,6 +74,9 @@ export function tableOptions<
|
|
|
54
74
|
options: Omit<TableOptions<TFeatures, TData>, 'data' | '_features'>,
|
|
55
75
|
): Omit<TableOptions<TFeatures, TData>, 'data' | '_features'>
|
|
56
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Returns table options while preserving generic inference when `columns` and `_features` are supplied by a wrapper.
|
|
79
|
+
*/
|
|
57
80
|
export function tableOptions<
|
|
58
81
|
TFeatures extends TableFeatures,
|
|
59
82
|
TData extends RowData = any,
|
|
@@ -61,6 +84,9 @@ export function tableOptions<
|
|
|
61
84
|
options: Omit<TableOptions<TFeatures, TData>, 'columns' | '_features'>,
|
|
62
85
|
): Omit<TableOptions<TFeatures, TData>, 'columns' | '_features'>
|
|
63
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Returns table options while preserving generic inference when `data`, `columns`, and `_features` are supplied by a wrapper.
|
|
89
|
+
*/
|
|
64
90
|
export function tableOptions<
|
|
65
91
|
TFeatures extends TableFeatures,
|
|
66
92
|
TData extends RowData = any,
|
|
@@ -71,6 +97,12 @@ export function tableOptions<
|
|
|
71
97
|
>,
|
|
72
98
|
): Omit<TableOptions<TFeatures, TData>, 'data' | 'columns' | '_features'>
|
|
73
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Runtime implementation for `tableOptions`.
|
|
102
|
+
*
|
|
103
|
+
* The helper returns the same object it receives; all value comes from the
|
|
104
|
+
* overloads preserving table option inference at compile time.
|
|
105
|
+
*/
|
|
74
106
|
export function tableOptions(options: unknown) {
|
|
75
107
|
return options
|
|
76
108
|
}
|
package/src/reactivity.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { batch, createAtom } from '@tanstack/store'
|
|
2
|
+
import type { TableReactivityBindings } from './core/reactivity/coreReactivityFeature.types'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* TanStack Store–based reactivity for vanilla / non-framework use of `constructTable`,
|
|
6
|
+
* with `createOptionsStore: true` so `table.optionsStore` is available for subscriptions.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { constructTable, tableFeatures } from '@tanstack/table-core'
|
|
11
|
+
* import { storeReactivityBindings } from '@tanstack/table-core/store-reactivity-bindings'
|
|
12
|
+
*
|
|
13
|
+
* const table = constructTable({
|
|
14
|
+
* _features: tableFeatures({ coreReativityFeature: storeReactivityBindings() }),
|
|
15
|
+
* // ...
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export function storeReactivityBindings(): TableReactivityBindings {
|
|
20
|
+
return {
|
|
21
|
+
createOptionsStore: true,
|
|
22
|
+
batch,
|
|
23
|
+
untrack: (fn) => fn(),
|
|
24
|
+
createReadonlyAtom: (fn, options) => {
|
|
25
|
+
return createAtom(() => fn(), {
|
|
26
|
+
compare: options?.compare,
|
|
27
|
+
})
|
|
28
|
+
},
|
|
29
|
+
createWritableAtom: (value, options) => {
|
|
30
|
+
return createAtom(value, {
|
|
31
|
+
compare: options?.compare,
|
|
32
|
+
})
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/types/Table.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReadonlyStore } from '@tanstack/store'
|
|
2
2
|
import type { Table_ColumnFaceting } from '../features/column-faceting/columnFacetingFeature.types'
|
|
3
3
|
import type { Table_ColumnResizing } from '../features/column-resizing/columnResizingFeature.types'
|
|
4
4
|
import type { Table_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
package/src/utils.ts
CHANGED
|
@@ -3,12 +3,22 @@ import type { NoInfer, RowData, Updater } from './types/type-utils'
|
|
|
3
3
|
import type { TableFeatures } from './types/TableFeatures'
|
|
4
4
|
import type { TableState, TableState_All } from './types/TableState'
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Applies a TanStack updater to a value.
|
|
8
|
+
*
|
|
9
|
+
* If the updater is a function it is called with the previous value; otherwise the updater value is returned directly.
|
|
10
|
+
*/
|
|
6
11
|
export function functionalUpdate<T>(updater: Updater<T>, input: T): T {
|
|
7
12
|
return typeof updater === 'function'
|
|
8
13
|
? (updater as (i: T) => T)(input)
|
|
9
14
|
: updater
|
|
10
15
|
}
|
|
11
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Clones table state values while preserving non-plain objects.
|
|
19
|
+
*
|
|
20
|
+
* Plain objects and arrays are copied recursively so state updates can avoid mutating existing references.
|
|
21
|
+
*/
|
|
12
22
|
export function cloneState<T>(value: T): T {
|
|
13
23
|
if (Array.isArray(value)) {
|
|
14
24
|
return value.map(cloneState) as T
|
|
@@ -33,8 +43,16 @@ export function cloneState<T>(value: T): T {
|
|
|
33
43
|
return value
|
|
34
44
|
}
|
|
35
45
|
|
|
46
|
+
/**
|
|
47
|
+
* A no-operation function used as a safe default callback.
|
|
48
|
+
*/
|
|
36
49
|
export function noop() {}
|
|
37
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Creates a table state updater for a single state slice.
|
|
53
|
+
*
|
|
54
|
+
* The updater writes through the table base atom for the slice and supports both value and functional updater forms.
|
|
55
|
+
*/
|
|
38
56
|
export function makeStateUpdater<
|
|
39
57
|
TFeatures extends TableFeatures,
|
|
40
58
|
K extends (string & {}) | keyof TableState_All | keyof TableState<TFeatures>,
|
|
@@ -48,14 +66,25 @@ export function makeStateUpdater<
|
|
|
48
66
|
|
|
49
67
|
type AnyFunction = (...args: any) => any
|
|
50
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Returns whether a value is a function.
|
|
71
|
+
*/
|
|
51
72
|
export function isFunction<T extends AnyFunction>(d: any): d is T {
|
|
52
73
|
return d instanceof Function
|
|
53
74
|
}
|
|
54
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Returns whether a value is an array containing only numbers.
|
|
78
|
+
*/
|
|
55
79
|
export function isNumberArray(d: any): d is Array<number> {
|
|
56
80
|
return Array.isArray(d) && d.every((val) => typeof val === 'number')
|
|
57
81
|
}
|
|
58
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Flattens a tree of nodes by recursively reading child nodes.
|
|
85
|
+
*
|
|
86
|
+
* The original nodes are preserved in depth-first order.
|
|
87
|
+
*/
|
|
59
88
|
export function flattenBy<TNode>(
|
|
60
89
|
arr: Array<TNode>,
|
|
61
90
|
getChildren: (item: TNode) => Array<TNode>,
|
|
@@ -77,6 +106,12 @@ export function flattenBy<TNode>(
|
|
|
77
106
|
return flat
|
|
78
107
|
}
|
|
79
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Symbol used to attach internal memo metadata to wrapped functions.
|
|
111
|
+
*
|
|
112
|
+
* This is exported so diagnostics can recognize memoized functions without
|
|
113
|
+
* depending on a string property name.
|
|
114
|
+
*/
|
|
80
115
|
export const $internalMemoFnMeta = Symbol('memoFnMeta')
|
|
81
116
|
export type MemoFnMeta = { originalArgsLength?: number }
|
|
82
117
|
|
|
@@ -103,6 +138,11 @@ interface MemoOptions<TDeps extends ReadonlyArray<any>, TDepArgs, TResult> {
|
|
|
103
138
|
onBeforeUpdate?: () => void
|
|
104
139
|
}
|
|
105
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Creates a dependency-tracked memoized function for table internals.
|
|
143
|
+
*
|
|
144
|
+
* The memo recomputes only when its dependency tuple changes and can emit debug timing information.
|
|
145
|
+
*/
|
|
106
146
|
export const memo = <TDeps extends ReadonlyArray<any>, TDepArgs, TResult>({
|
|
107
147
|
fn,
|
|
108
148
|
memoDeps,
|
|
@@ -164,6 +204,11 @@ const pad = (str: number | string, num: number) => {
|
|
|
164
204
|
return str
|
|
165
205
|
}
|
|
166
206
|
|
|
207
|
+
/**
|
|
208
|
+
* Creates a table-aware memoized function.
|
|
209
|
+
*
|
|
210
|
+
* This wraps `memo` with table debug options and feature metadata so row models and derived APIs can share consistent diagnostics.
|
|
211
|
+
*/
|
|
167
212
|
export function tableMemo<
|
|
168
213
|
TFeatures extends TableFeatures,
|
|
169
214
|
TDeps extends ReadonlyArray<any>,
|