@tanstack/table-core 9.0.0-alpha.43 → 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.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 +10 -0
- 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 +10 -0
- 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 +22 -12
- package/dist/core/table/coreTablesFeature.types.d.ts +22 -12
- package/dist/core/table/coreTablesFeature.utils.cjs +44 -0
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +44 -0
- package/dist/core/table/coreTablesFeature.utils.d.ts +44 -0
- package/dist/core/table/coreTablesFeature.utils.js +44 -0
- 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/static-functions.cjs +1 -1
- package/dist/static-functions.d.cts +3 -3
- package/dist/static-functions.d.ts +3 -3
- package/dist/static-functions.js +3 -3
- package/dist/store-reactivity-bindings.cjs.map +1 -1
- package/dist/store-reactivity-bindings.js.map +1 -1
- 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 +1 -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.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 +10 -0
- package/src/core/table/coreTablesFeature.ts +5 -0
- package/src/core/table/coreTablesFeature.types.ts +22 -12
- package/src/core/table/coreTablesFeature.utils.ts +44 -0
- 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/utils.ts +45 -0
|
@@ -4,22 +4,197 @@ import { TableFeatures } from "../../types/TableFeatures.js";
|
|
|
4
4
|
import { Table_Internal } from "../../types/Table.js";
|
|
5
5
|
|
|
6
6
|
//#region src/features/row-pagination/rowPaginationFeature.utils.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Returns the default pagination state.
|
|
9
|
+
*
|
|
10
|
+
* Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const initialValue = getDefaultPaginationState()
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
7
17
|
declare function getDefaultPaginationState(): PaginationState;
|
|
18
|
+
/**
|
|
19
|
+
* Schedules an automatic reset for page index.
|
|
20
|
+
*
|
|
21
|
+
* The reset only runs when the related feature options allow automatic resets for the current table state change.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* table_autoResetPageIndex(table)
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
8
28
|
declare function table_autoResetPageIndex<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
|
|
29
|
+
/**
|
|
30
|
+
* Updates the table's pagination 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_setPagination(table, (old) => old)
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
9
39
|
declare function table_setPagination<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: Updater<PaginationState>): void | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Resets the table's pagination state slice.
|
|
42
|
+
*
|
|
43
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* table_resetPagination(table)
|
|
48
|
+
* table_resetPagination(table, true)
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
10
51
|
declare function table_resetPagination<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void;
|
|
52
|
+
/**
|
|
53
|
+
* Updates the table's page index state slice.
|
|
54
|
+
*
|
|
55
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* table_setPageIndex(table, (old) => old)
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
11
62
|
declare function table_setPageIndex<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: Updater<number>): void;
|
|
63
|
+
/**
|
|
64
|
+
* Resets the table's page index state slice.
|
|
65
|
+
*
|
|
66
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* table_resetPageIndex(table)
|
|
71
|
+
* table_resetPageIndex(table, true)
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
12
74
|
declare function table_resetPageIndex<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void;
|
|
75
|
+
/**
|
|
76
|
+
* Resets the table's page size state slice.
|
|
77
|
+
*
|
|
78
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* table_resetPageSize(table)
|
|
83
|
+
* table_resetPageSize(table, true)
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
13
86
|
declare function table_resetPageSize<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void;
|
|
87
|
+
/**
|
|
88
|
+
* Updates the table's page size state slice.
|
|
89
|
+
*
|
|
90
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* table_setPageSize(table, (old) => old)
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
14
97
|
declare function table_setPageSize<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: Updater<number>): void;
|
|
98
|
+
/**
|
|
99
|
+
* Returns page options for the table.
|
|
100
|
+
*
|
|
101
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const value = table_getPageOptions(table)
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
15
108
|
declare function table_getPageOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): number[];
|
|
109
|
+
/**
|
|
110
|
+
* Returns can previous page for the table.
|
|
111
|
+
*
|
|
112
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* const value = table_getCanPreviousPage(table)
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
16
119
|
declare function table_getCanPreviousPage<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Returns can next page for the table.
|
|
122
|
+
*
|
|
123
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* const value = table_getCanNextPage(table)
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
17
130
|
declare function table_getCanNextPage<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Moves the table to the previous page.
|
|
133
|
+
*
|
|
134
|
+
* This delegates to `table_setPageIndex` so pagination state ownership and
|
|
135
|
+
* updater semantics remain consistent.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* table_previousPage(table)
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
18
142
|
declare function table_previousPage<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
|
|
143
|
+
/**
|
|
144
|
+
* Moves the table to the next page.
|
|
145
|
+
*
|
|
146
|
+
* This delegates to `table_setPageIndex` so pagination state ownership and
|
|
147
|
+
* updater semantics remain consistent.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* table_nextPage(table)
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
19
154
|
declare function table_nextPage<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
|
|
155
|
+
/**
|
|
156
|
+
* Moves the table to the first page.
|
|
157
|
+
*
|
|
158
|
+
* This is a convenience wrapper around `table_setPageIndex(table, 0)`.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* table_firstPage(table)
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
20
165
|
declare function table_firstPage<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
|
|
166
|
+
/**
|
|
167
|
+
* Moves the table to the last known page.
|
|
168
|
+
*
|
|
169
|
+
* The target page is derived from `table_getPageCount(table) - 1`.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* table_lastPage(table)
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
21
176
|
declare function table_lastPage<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
|
|
177
|
+
/**
|
|
178
|
+
* Returns page count for the table.
|
|
179
|
+
*
|
|
180
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```ts
|
|
184
|
+
* const value = table_getPageCount(table)
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
22
187
|
declare function table_getPageCount<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): number;
|
|
188
|
+
/**
|
|
189
|
+
* Returns row count for the table.
|
|
190
|
+
*
|
|
191
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts
|
|
195
|
+
* const value = table_getRowCount(table)
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
23
198
|
declare function table_getRowCount<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): number;
|
|
24
199
|
//#endregion
|
|
25
200
|
export { getDefaultPaginationState, table_autoResetPageIndex, table_firstPage, table_getCanNextPage, table_getCanPreviousPage, table_getPageCount, table_getPageOptions, table_getRowCount, table_lastPage, table_nextPage, table_previousPage, table_resetPageIndex, table_resetPageSize, table_resetPagination, table_setPageIndex, table_setPageSize, table_setPagination };
|
|
@@ -3,15 +3,45 @@ import { cloneState, functionalUpdate } from "../../utils.js";
|
|
|
3
3
|
//#region src/features/row-pagination/rowPaginationFeature.utils.ts
|
|
4
4
|
const defaultPageIndex = 0;
|
|
5
5
|
const defaultPageSize = 10;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the default pagination state.
|
|
8
|
+
*
|
|
9
|
+
* Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const initialValue = getDefaultPaginationState()
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
6
16
|
function getDefaultPaginationState() {
|
|
7
17
|
return {
|
|
8
18
|
pageIndex: defaultPageIndex,
|
|
9
19
|
pageSize: defaultPageSize
|
|
10
20
|
};
|
|
11
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Schedules an automatic reset for page index.
|
|
24
|
+
*
|
|
25
|
+
* The reset only runs when the related feature options allow automatic resets for the current table state change.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* table_autoResetPageIndex(table)
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
12
32
|
function table_autoResetPageIndex(table) {
|
|
13
33
|
if (table.options.autoResetAll ?? table.options.autoResetPageIndex ?? !table.options.manualPagination) table_resetPageIndex(table);
|
|
14
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Updates the table's pagination state slice.
|
|
37
|
+
*
|
|
38
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* table_setPagination(table, (old) => old)
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
15
45
|
function table_setPagination(table, updater) {
|
|
16
46
|
var _table$options$onPagi, _table$options;
|
|
17
47
|
const safeUpdater = (old) => {
|
|
@@ -19,9 +49,30 @@ function table_setPagination(table, updater) {
|
|
|
19
49
|
};
|
|
20
50
|
return (_table$options$onPagi = (_table$options = table.options).onPaginationChange) === null || _table$options$onPagi === void 0 ? void 0 : _table$options$onPagi.call(_table$options, safeUpdater);
|
|
21
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Resets the table's pagination state slice.
|
|
54
|
+
*
|
|
55
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* table_resetPagination(table)
|
|
60
|
+
* table_resetPagination(table, true)
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
22
63
|
function table_resetPagination(table, defaultState) {
|
|
23
64
|
table_setPagination(table, defaultState ? getDefaultPaginationState() : cloneState(table.initialState.pagination ?? getDefaultPaginationState()));
|
|
24
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Updates the table's page index state slice.
|
|
68
|
+
*
|
|
69
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* table_setPageIndex(table, (old) => old)
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
25
76
|
function table_setPageIndex(table, updater) {
|
|
26
77
|
table_setPagination(table, (old) => {
|
|
27
78
|
let pageIndex = functionalUpdate(updater, old.pageIndex);
|
|
@@ -33,6 +84,17 @@ function table_setPageIndex(table, updater) {
|
|
|
33
84
|
};
|
|
34
85
|
});
|
|
35
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Resets the table's page index state slice.
|
|
89
|
+
*
|
|
90
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* table_resetPageIndex(table)
|
|
95
|
+
* table_resetPageIndex(table, true)
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
36
98
|
function table_resetPageIndex(table, defaultState) {
|
|
37
99
|
var _table$atoms$paginati, _table$initialState$p;
|
|
38
100
|
const currentPageIndex = ((_table$atoms$paginati = table.atoms.pagination) === null || _table$atoms$paginati === void 0 || (_table$atoms$paginati = _table$atoms$paginati.get()) === null || _table$atoms$paginati === void 0 ? void 0 : _table$atoms$paginati.pageIndex) ?? defaultPageIndex;
|
|
@@ -40,6 +102,17 @@ function table_resetPageIndex(table, defaultState) {
|
|
|
40
102
|
if (newPageIndex === currentPageIndex) return;
|
|
41
103
|
table_setPageIndex(table, newPageIndex);
|
|
42
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Resets the table's page size state slice.
|
|
107
|
+
*
|
|
108
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* table_resetPageSize(table)
|
|
113
|
+
* table_resetPageSize(table, true)
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
43
116
|
function table_resetPageSize(table, defaultState) {
|
|
44
117
|
var _table$atoms$paginati2, _table$initialState$p2;
|
|
45
118
|
const currentPageSize = ((_table$atoms$paginati2 = table.atoms.pagination) === null || _table$atoms$paginati2 === void 0 || (_table$atoms$paginati2 = _table$atoms$paginati2.get()) === null || _table$atoms$paginati2 === void 0 ? void 0 : _table$atoms$paginati2.pageSize) ?? defaultPageSize;
|
|
@@ -47,6 +120,16 @@ function table_resetPageSize(table, defaultState) {
|
|
|
47
120
|
if (newPageSize === currentPageSize) return;
|
|
48
121
|
table_setPageSize(table, newPageSize);
|
|
49
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Updates the table's page size state slice.
|
|
125
|
+
*
|
|
126
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* table_setPageSize(table, (old) => old)
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
50
133
|
function table_setPageSize(table, updater) {
|
|
51
134
|
table_setPagination(table, (old) => {
|
|
52
135
|
const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize));
|
|
@@ -59,16 +142,46 @@ function table_setPageSize(table, updater) {
|
|
|
59
142
|
};
|
|
60
143
|
});
|
|
61
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Returns page options for the table.
|
|
147
|
+
*
|
|
148
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* const value = table_getPageOptions(table)
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
62
155
|
function table_getPageOptions(table) {
|
|
63
156
|
const pageCount = table_getPageCount(table);
|
|
64
157
|
let pageOptions = [];
|
|
65
158
|
if (pageCount && pageCount > 0) pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i);
|
|
66
159
|
return pageOptions;
|
|
67
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Returns can previous page for the table.
|
|
163
|
+
*
|
|
164
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```ts
|
|
168
|
+
* const value = table_getCanPreviousPage(table)
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
68
171
|
function table_getCanPreviousPage(table) {
|
|
69
172
|
var _table$atoms$paginati3;
|
|
70
173
|
return (((_table$atoms$paginati3 = table.atoms.pagination) === null || _table$atoms$paginati3 === void 0 || (_table$atoms$paginati3 = _table$atoms$paginati3.get()) === null || _table$atoms$paginati3 === void 0 ? void 0 : _table$atoms$paginati3.pageIndex) ?? 0) > 0;
|
|
71
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Returns can next page for the table.
|
|
177
|
+
*
|
|
178
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```ts
|
|
182
|
+
* const value = table_getCanNextPage(table)
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
72
185
|
function table_getCanNextPage(table) {
|
|
73
186
|
var _table$atoms$paginati4;
|
|
74
187
|
const pageIndex = ((_table$atoms$paginati4 = table.atoms.pagination) === null || _table$atoms$paginati4 === void 0 || (_table$atoms$paginati4 = _table$atoms$paginati4.get()) === null || _table$atoms$paginati4 === void 0 ? void 0 : _table$atoms$paginati4.pageIndex) ?? defaultPageIndex;
|
|
@@ -77,24 +190,86 @@ function table_getCanNextPage(table) {
|
|
|
77
190
|
if (pageCount === 0) return false;
|
|
78
191
|
return pageIndex < pageCount - 1;
|
|
79
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Moves the table to the previous page.
|
|
195
|
+
*
|
|
196
|
+
* This delegates to `table_setPageIndex` so pagination state ownership and
|
|
197
|
+
* updater semantics remain consistent.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* table_previousPage(table)
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
80
204
|
function table_previousPage(table) {
|
|
81
205
|
return table_setPageIndex(table, (old) => old - 1);
|
|
82
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Moves the table to the next page.
|
|
209
|
+
*
|
|
210
|
+
* This delegates to `table_setPageIndex` so pagination state ownership and
|
|
211
|
+
* updater semantics remain consistent.
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```ts
|
|
215
|
+
* table_nextPage(table)
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
83
218
|
function table_nextPage(table) {
|
|
84
219
|
return table_setPageIndex(table, (old) => {
|
|
85
220
|
return old + 1;
|
|
86
221
|
});
|
|
87
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Moves the table to the first page.
|
|
225
|
+
*
|
|
226
|
+
* This is a convenience wrapper around `table_setPageIndex(table, 0)`.
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```ts
|
|
230
|
+
* table_firstPage(table)
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
88
233
|
function table_firstPage(table) {
|
|
89
234
|
return table_setPageIndex(table, 0);
|
|
90
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Moves the table to the last known page.
|
|
238
|
+
*
|
|
239
|
+
* The target page is derived from `table_getPageCount(table) - 1`.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```ts
|
|
243
|
+
* table_lastPage(table)
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
91
246
|
function table_lastPage(table) {
|
|
92
247
|
return table_setPageIndex(table, table_getPageCount(table) - 1);
|
|
93
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Returns page count for the table.
|
|
251
|
+
*
|
|
252
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* ```ts
|
|
256
|
+
* const value = table_getPageCount(table)
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
94
259
|
function table_getPageCount(table) {
|
|
95
260
|
var _table$atoms$paginati5;
|
|
96
261
|
return table.options.pageCount ?? Math.ceil(table_getRowCount(table) / (((_table$atoms$paginati5 = table.atoms.pagination) === null || _table$atoms$paginati5 === void 0 || (_table$atoms$paginati5 = _table$atoms$paginati5.get()) === null || _table$atoms$paginati5 === void 0 ? void 0 : _table$atoms$paginati5.pageSize) ?? defaultPageSize));
|
|
97
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Returns row count for the table.
|
|
265
|
+
*
|
|
266
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* ```ts
|
|
270
|
+
* const value = table_getRowCount(table)
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
98
273
|
function table_getRowCount(table) {
|
|
99
274
|
return table.options.rowCount ?? table.getPrePaginatedRowModel().rows.length;
|
|
100
275
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rowPaginationFeature.utils.js","names":[],"sources":["../../../src/features/row-pagination/rowPaginationFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { PaginationState } from './rowPaginationFeature.types'\n\nconst defaultPageIndex = 0\nconst defaultPageSize = 10\n\nexport function getDefaultPaginationState(): PaginationState {\n return {\n pageIndex: defaultPageIndex,\n pageSize: defaultPageSize,\n }\n}\n\nexport function table_autoResetPageIndex<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n if (\n table.options.autoResetAll ??\n table.options.autoResetPageIndex ??\n !table.options.manualPagination\n ) {\n table_resetPageIndex(table)\n }\n}\n\nexport function table_setPagination<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: Updater<PaginationState>) {\n const safeUpdater: Updater<PaginationState> = (old) => {\n const newState = functionalUpdate(updater, old)\n\n return newState\n }\n\n return table.options.onPaginationChange?.(safeUpdater)\n}\n\nexport function table_resetPagination<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setPagination(\n table,\n defaultState\n ? getDefaultPaginationState()\n : cloneState(\n table.initialState.pagination ?? getDefaultPaginationState(),\n ),\n )\n}\n\nexport function table_setPageIndex<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: Updater<number>) {\n table_setPagination(table, (old) => {\n let pageIndex = functionalUpdate(updater, old.pageIndex)\n\n const maxPageIndex =\n typeof table.options.pageCount === 'undefined' ||\n table.options.pageCount === -1\n ? Number.MAX_SAFE_INTEGER\n : table.options.pageCount - 1\n\n pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex))\n\n return {\n ...old,\n pageIndex,\n }\n })\n}\n\nexport function table_resetPageIndex<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n const currentPageIndex =\n table.atoms.pagination?.get()?.pageIndex ?? defaultPageIndex\n const newPageIndex = defaultState\n ? defaultPageIndex\n : (table.initialState.pagination?.pageIndex ?? defaultPageIndex)\n if (newPageIndex === currentPageIndex) return\n table_setPageIndex(table, newPageIndex)\n}\n\nexport function table_resetPageSize<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n const currentPageSize =\n table.atoms.pagination?.get()?.pageSize ?? defaultPageSize\n const newPageSize = defaultState\n ? defaultPageSize\n : (table.initialState.pagination?.pageSize ?? defaultPageSize)\n if (newPageSize === currentPageSize) return\n table_setPageSize(table, newPageSize)\n}\n\nexport function table_setPageSize<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: Updater<number>) {\n table_setPagination(table, (old) => {\n const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize))\n const topRowIndex = old.pageSize * old.pageIndex\n const pageIndex = Math.floor(topRowIndex / pageSize)\n\n return {\n ...old,\n pageIndex,\n pageSize,\n }\n })\n}\n\nexport function table_getPageOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const pageCount = table_getPageCount(table)\n let pageOptions: Array<number> = []\n if (pageCount && pageCount > 0) {\n pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i)\n }\n return pageOptions\n}\n\nexport function table_getCanPreviousPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return (table.atoms.pagination?.get()?.pageIndex ?? 0) > 0\n}\n\nexport function table_getCanNextPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const pageIndex = table.atoms.pagination?.get()?.pageIndex ?? defaultPageIndex\n\n const pageCount = table_getPageCount(table)\n\n if (pageCount === -1) {\n return true\n }\n\n if (pageCount === 0) {\n return false\n }\n\n return pageIndex < pageCount - 1\n}\n\nexport function table_previousPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table_setPageIndex(table, (old) => old - 1)\n}\n\nexport function table_nextPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table_setPageIndex(table, (old) => {\n return old + 1\n })\n}\n\nexport function table_firstPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table_setPageIndex(table, 0)\n}\n\nexport function table_lastPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table_setPageIndex(table, table_getPageCount(table) - 1)\n}\n\nexport function table_getPageCount<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return (\n table.options.pageCount ??\n Math.ceil(\n table_getRowCount(table) /\n (table.atoms.pagination?.get()?.pageSize ?? defaultPageSize),\n )\n )\n}\n\nexport function table_getRowCount<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table.options.rowCount ?? table.getPrePaginatedRowModel().rows.length\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"rowPaginationFeature.utils.js","names":[],"sources":["../../../src/features/row-pagination/rowPaginationFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { PaginationState } from './rowPaginationFeature.types'\n\nconst defaultPageIndex = 0\nconst defaultPageSize = 10\n\n/**\n * Returns the default pagination state.\n *\n * Feature constructors use this value to initialize the table state or option defaults when no user value is provided.\n *\n * @example\n * ```ts\n * const initialValue = getDefaultPaginationState()\n * ```\n */\nexport function getDefaultPaginationState(): PaginationState {\n return {\n pageIndex: defaultPageIndex,\n pageSize: defaultPageSize,\n }\n}\n\n/**\n * Schedules an automatic reset for page index.\n *\n * The reset only runs when the related feature options allow automatic resets for the current table state change.\n *\n * @example\n * ```ts\n * table_autoResetPageIndex(table)\n * ```\n */\nexport function table_autoResetPageIndex<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n if (\n table.options.autoResetAll ??\n table.options.autoResetPageIndex ??\n !table.options.manualPagination\n ) {\n table_resetPageIndex(table)\n }\n}\n\n/**\n * Updates the table's pagination state slice.\n *\n * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.\n *\n * @example\n * ```ts\n * table_setPagination(table, (old) => old)\n * ```\n */\nexport function table_setPagination<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: Updater<PaginationState>) {\n const safeUpdater: Updater<PaginationState> = (old) => {\n const newState = functionalUpdate(updater, old)\n\n return newState\n }\n\n return table.options.onPaginationChange?.(safeUpdater)\n}\n\n/**\n * Resets the table's pagination state slice.\n *\n * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.\n *\n * @example\n * ```ts\n * table_resetPagination(table)\n * table_resetPagination(table, true)\n * ```\n */\nexport function table_resetPagination<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setPagination(\n table,\n defaultState\n ? getDefaultPaginationState()\n : cloneState(\n table.initialState.pagination ?? getDefaultPaginationState(),\n ),\n )\n}\n\n/**\n * Updates the table's page index state slice.\n *\n * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.\n *\n * @example\n * ```ts\n * table_setPageIndex(table, (old) => old)\n * ```\n */\nexport function table_setPageIndex<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: Updater<number>) {\n table_setPagination(table, (old) => {\n let pageIndex = functionalUpdate(updater, old.pageIndex)\n\n const maxPageIndex =\n typeof table.options.pageCount === 'undefined' ||\n table.options.pageCount === -1\n ? Number.MAX_SAFE_INTEGER\n : table.options.pageCount - 1\n\n pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex))\n\n return {\n ...old,\n pageIndex,\n }\n })\n}\n\n/**\n * Resets the table's page index state slice.\n *\n * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.\n *\n * @example\n * ```ts\n * table_resetPageIndex(table)\n * table_resetPageIndex(table, true)\n * ```\n */\nexport function table_resetPageIndex<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n const currentPageIndex =\n table.atoms.pagination?.get()?.pageIndex ?? defaultPageIndex\n const newPageIndex = defaultState\n ? defaultPageIndex\n : (table.initialState.pagination?.pageIndex ?? defaultPageIndex)\n if (newPageIndex === currentPageIndex) return\n table_setPageIndex(table, newPageIndex)\n}\n\n/**\n * Resets the table's page size state slice.\n *\n * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.\n *\n * @example\n * ```ts\n * table_resetPageSize(table)\n * table_resetPageSize(table, true)\n * ```\n */\nexport function table_resetPageSize<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n const currentPageSize =\n table.atoms.pagination?.get()?.pageSize ?? defaultPageSize\n const newPageSize = defaultState\n ? defaultPageSize\n : (table.initialState.pagination?.pageSize ?? defaultPageSize)\n if (newPageSize === currentPageSize) return\n table_setPageSize(table, newPageSize)\n}\n\n/**\n * Updates the table's page size state slice.\n *\n * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.\n *\n * @example\n * ```ts\n * table_setPageSize(table, (old) => old)\n * ```\n */\nexport function table_setPageSize<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: Updater<number>) {\n table_setPagination(table, (old) => {\n const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize))\n const topRowIndex = old.pageSize * old.pageIndex\n const pageIndex = Math.floor(topRowIndex / pageSize)\n\n return {\n ...old,\n pageIndex,\n pageSize,\n }\n })\n}\n\n/**\n * Returns page options for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getPageOptions(table)\n * ```\n */\nexport function table_getPageOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const pageCount = table_getPageCount(table)\n let pageOptions: Array<number> = []\n if (pageCount && pageCount > 0) {\n pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i)\n }\n return pageOptions\n}\n\n/**\n * Returns can previous page for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getCanPreviousPage(table)\n * ```\n */\nexport function table_getCanPreviousPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return (table.atoms.pagination?.get()?.pageIndex ?? 0) > 0\n}\n\n/**\n * Returns can next page for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getCanNextPage(table)\n * ```\n */\nexport function table_getCanNextPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const pageIndex = table.atoms.pagination?.get()?.pageIndex ?? defaultPageIndex\n\n const pageCount = table_getPageCount(table)\n\n if (pageCount === -1) {\n return true\n }\n\n if (pageCount === 0) {\n return false\n }\n\n return pageIndex < pageCount - 1\n}\n\n/**\n * Moves the table to the previous page.\n *\n * This delegates to `table_setPageIndex` so pagination state ownership and\n * updater semantics remain consistent.\n *\n * @example\n * ```ts\n * table_previousPage(table)\n * ```\n */\nexport function table_previousPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table_setPageIndex(table, (old) => old - 1)\n}\n\n/**\n * Moves the table to the next page.\n *\n * This delegates to `table_setPageIndex` so pagination state ownership and\n * updater semantics remain consistent.\n *\n * @example\n * ```ts\n * table_nextPage(table)\n * ```\n */\nexport function table_nextPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table_setPageIndex(table, (old) => {\n return old + 1\n })\n}\n\n/**\n * Moves the table to the first page.\n *\n * This is a convenience wrapper around `table_setPageIndex(table, 0)`.\n *\n * @example\n * ```ts\n * table_firstPage(table)\n * ```\n */\nexport function table_firstPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table_setPageIndex(table, 0)\n}\n\n/**\n * Moves the table to the last known page.\n *\n * The target page is derived from `table_getPageCount(table) - 1`.\n *\n * @example\n * ```ts\n * table_lastPage(table)\n * ```\n */\nexport function table_lastPage<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table_setPageIndex(table, table_getPageCount(table) - 1)\n}\n\n/**\n * Returns page count for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getPageCount(table)\n * ```\n */\nexport function table_getPageCount<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return (\n table.options.pageCount ??\n Math.ceil(\n table_getRowCount(table) /\n (table.atoms.pagination?.get()?.pageSize ?? defaultPageSize),\n )\n )\n}\n\n/**\n * Returns row count for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getRowCount(table)\n * ```\n */\nexport function table_getRowCount<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table.options.rowCount ?? table.getPrePaginatedRowModel().rows.length\n}\n"],"mappings":"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"}
|
|
@@ -2,6 +2,11 @@ const require_utils = require('../../utils.cjs');
|
|
|
2
2
|
const require_rowPinningFeature_utils = require('./rowPinningFeature.utils.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/features/row-pinning/rowPinningFeature.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates the stock row pinning feature.
|
|
7
|
+
*
|
|
8
|
+
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
9
|
+
*/
|
|
5
10
|
function constructRowPinningFeature() {
|
|
6
11
|
return {
|
|
7
12
|
getInitialState: (initialState) => {
|
|
@@ -61,7 +66,10 @@ function constructRowPinningFeature() {
|
|
|
61
66
|
};
|
|
62
67
|
}
|
|
63
68
|
/**
|
|
64
|
-
* The
|
|
69
|
+
* The stock row pinning feature.
|
|
70
|
+
*
|
|
71
|
+
* Register this feature to add row pinning state and APIs for deriving top,
|
|
72
|
+
* center, and bottom row regions.
|
|
65
73
|
*/
|
|
66
74
|
const rowPinningFeature = constructRowPinningFeature();
|
|
67
75
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rowPinningFeature.cjs","names":["getDefaultRowPinningState","makeStateUpdater","row_getCanPin","row_getIsPinned","row_getPinnedIndex","row_pin","table_setRowPinning","table_resetRowPinning","table_getIsSomeRowsPinned","table_getTopRows","table_getBottomRows","table_getCenterRows"],"sources":["../../../src/features/row-pinning/rowPinningFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n getDefaultRowPinningState,\n row_getCanPin,\n row_getIsPinned,\n row_getPinnedIndex,\n row_pin,\n table_getBottomRows,\n table_getCenterRows,\n table_getIsSomeRowsPinned,\n table_getTopRows,\n table_resetRowPinning,\n table_setRowPinning,\n} from './rowPinningFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// Row_RowPinning,\n// TableOptions_RowPinning,\n// TableState_RowPinning,\n// Table_RowPinning,\n// } from './rowPinningFeature.types'\n\nexport interface RowPinningFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Row: Row_RowPinning\n // Table: Table_RowPinning<TFeatures, RowData>\n // TableOptions: TableOptions_RowPinning<TFeatures, RowData>\n // TableState: TableState_RowPinning\n}\n\nexport function constructRowPinningFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<RowPinningFeatureConstructors<TFeatures, TData>> {\n return {\n getInitialState: (initialState) => {\n return {\n ...initialState,\n rowPinning: {\n ...getDefaultRowPinningState(),\n ...initialState.rowPinning,\n },\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onRowPinningChange: makeStateUpdater('rowPinning', table),\n }\n },\n\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('rowPinningFeature', prototype, table, {\n row_getCanPin: {\n fn: (row) => row_getCanPin(row),\n },\n row_getIsPinned: {\n fn: (row) => row_getIsPinned(row),\n },\n row_getPinnedIndex: {\n fn: (row) => row_getPinnedIndex(row),\n memoDeps: (row) => [\n row.table.getRowModel().rows,\n row.table.atoms.rowPinning?.get(),\n ],\n },\n row_pin: {\n fn: (row, position, includeLeafRows, includeParentRows) =>\n row_pin(row, position, includeLeafRows, includeParentRows),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('rowPinningFeature', table, {\n table_setRowPinning: {\n fn: (updater) => table_setRowPinning(table, updater),\n },\n table_resetRowPinning: {\n fn: (defaultState) => table_resetRowPinning(table, defaultState),\n },\n table_getIsSomeRowsPinned: {\n fn: (position) => table_getIsSomeRowsPinned(table, position),\n },\n table_getTopRows: {\n fn: () => table_getTopRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get()?.top,\n ],\n },\n table_getBottomRows: {\n fn: () => table_getBottomRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get()?.bottom,\n ],\n },\n table_getCenterRows: {\n fn: () => table_getCenterRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get(),\n ],\n },\n })\n },\n }\n}\n\n/**\n * The
|
|
1
|
+
{"version":3,"file":"rowPinningFeature.cjs","names":["getDefaultRowPinningState","makeStateUpdater","row_getCanPin","row_getIsPinned","row_getPinnedIndex","row_pin","table_setRowPinning","table_resetRowPinning","table_getIsSomeRowsPinned","table_getTopRows","table_getBottomRows","table_getCenterRows"],"sources":["../../../src/features/row-pinning/rowPinningFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n getDefaultRowPinningState,\n row_getCanPin,\n row_getIsPinned,\n row_getPinnedIndex,\n row_pin,\n table_getBottomRows,\n table_getCenterRows,\n table_getIsSomeRowsPinned,\n table_getTopRows,\n table_resetRowPinning,\n table_setRowPinning,\n} from './rowPinningFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// Row_RowPinning,\n// TableOptions_RowPinning,\n// TableState_RowPinning,\n// Table_RowPinning,\n// } from './rowPinningFeature.types'\n\nexport interface RowPinningFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Row: Row_RowPinning\n // Table: Table_RowPinning<TFeatures, RowData>\n // TableOptions: TableOptions_RowPinning<TFeatures, RowData>\n // TableState: TableState_RowPinning\n}\n\n/**\n * Creates the stock row pinning feature.\n *\n * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.\n */\nexport function constructRowPinningFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<RowPinningFeatureConstructors<TFeatures, TData>> {\n return {\n getInitialState: (initialState) => {\n return {\n ...initialState,\n rowPinning: {\n ...getDefaultRowPinningState(),\n ...initialState.rowPinning,\n },\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onRowPinningChange: makeStateUpdater('rowPinning', table),\n }\n },\n\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('rowPinningFeature', prototype, table, {\n row_getCanPin: {\n fn: (row) => row_getCanPin(row),\n },\n row_getIsPinned: {\n fn: (row) => row_getIsPinned(row),\n },\n row_getPinnedIndex: {\n fn: (row) => row_getPinnedIndex(row),\n memoDeps: (row) => [\n row.table.getRowModel().rows,\n row.table.atoms.rowPinning?.get(),\n ],\n },\n row_pin: {\n fn: (row, position, includeLeafRows, includeParentRows) =>\n row_pin(row, position, includeLeafRows, includeParentRows),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('rowPinningFeature', table, {\n table_setRowPinning: {\n fn: (updater) => table_setRowPinning(table, updater),\n },\n table_resetRowPinning: {\n fn: (defaultState) => table_resetRowPinning(table, defaultState),\n },\n table_getIsSomeRowsPinned: {\n fn: (position) => table_getIsSomeRowsPinned(table, position),\n },\n table_getTopRows: {\n fn: () => table_getTopRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get()?.top,\n ],\n },\n table_getBottomRows: {\n fn: () => table_getBottomRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get()?.bottom,\n ],\n },\n table_getCenterRows: {\n fn: () => table_getCenterRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get(),\n ],\n },\n })\n },\n }\n}\n\n/**\n * The stock row pinning feature.\n *\n * Register this feature to add row pinning state and APIs for deriving top,\n * center, and bottom row regions.\n */\nexport const rowPinningFeature = constructRowPinningFeature()\n"],"mappings":";;;;;;;;;AA0CA,SAAgB,6BAGmD;CACjE,OAAO;EACL,kBAAkB,iBAAiB;GACjC,OAAO;IACL,GAAG;IACH,YAAY;KACV,GAAGA,2DAA2B;KAC9B,GAAG,aAAa;KACjB;IACF;;EAGH,yBAAyB,UAAU;GACjC,OAAO,EACL,oBAAoBC,+BAAiB,cAAc,MAAM,EAC1D;;EAGH,qBAAqB,WAAW,UAAU;GACxC,kCAAoB,qBAAqB,WAAW,OAAO;IACzD,eAAe,EACb,KAAK,QAAQC,8CAAc,IAAI,EAChC;IACD,iBAAiB,EACf,KAAK,QAAQC,gDAAgB,IAAI,EAClC;IACD,oBAAoB;KAClB,KAAK,QAAQC,mDAAmB,IAAI;KACpC,WAAW,QAAQ;;cACjB,IAAI,MAAM,aAAa,CAAC,+BACxB,IAAI,MAAM,MAAM,0FAAY,KAAK,CAClC;;KACF;IACD,SAAS,EACP,KAAK,KAAK,UAAU,iBAAiB,sBACnCC,wCAAQ,KAAK,UAAU,iBAAiB,kBAAkB,EAC7D;IACF,CAAC;;EAGJ,qBAAqB,UAAU;GAC7B,8BAAgB,qBAAqB,OAAO;IAC1C,qBAAqB,EACnB,KAAK,YAAYC,oDAAoB,OAAO,QAAQ,EACrD;IACD,uBAAuB,EACrB,KAAK,iBAAiBC,sDAAsB,OAAO,aAAa,EACjE;IACD,2BAA2B,EACzB,KAAK,aAAaC,0DAA0B,OAAO,SAAS,EAC7D;IACD,kBAAkB;KAChB,UAAUC,iDAAiB,MAAM;KACjC,gBAAgB;;cACd,MAAM,aAAa,CAAC,+BACpB,MAAM,MAAM,2GAAY,KAAK,gFAAE,IAChC;;KACF;IACD,qBAAqB;KACnB,UAAUC,oDAAoB,MAAM;KACpC,gBAAgB;;cACd,MAAM,aAAa,CAAC,gCACpB,MAAM,MAAM,8GAAY,KAAK,kFAAE,OAChC;;KACF;IACD,qBAAqB;KACnB,UAAUC,oDAAoB,MAAM;KACpC,gBAAgB;;cACd,MAAM,aAAa,CAAC,gCACpB,MAAM,MAAM,4FAAY,KAAK,CAC9B;;KACF;IACF,CAAC;;EAEL;;;;;;;;AASH,MAAa,oBAAoB,4BAA4B"}
|
|
@@ -3,9 +3,17 @@ import { TableFeature, TableFeatures } from "../../types/TableFeatures.cjs";
|
|
|
3
3
|
|
|
4
4
|
//#region src/features/row-pinning/rowPinningFeature.d.ts
|
|
5
5
|
interface RowPinningFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
6
|
+
/**
|
|
7
|
+
* Creates the stock row pinning feature.
|
|
8
|
+
*
|
|
9
|
+
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
10
|
+
*/
|
|
6
11
|
declare function constructRowPinningFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<RowPinningFeatureConstructors<TFeatures, TData>>;
|
|
7
12
|
/**
|
|
8
|
-
* The
|
|
13
|
+
* The stock row pinning feature.
|
|
14
|
+
*
|
|
15
|
+
* Register this feature to add row pinning state and APIs for deriving top,
|
|
16
|
+
* center, and bottom row regions.
|
|
9
17
|
*/
|
|
10
18
|
declare const rowPinningFeature: TableFeature<RowPinningFeatureConstructors<TableFeatures, RowData>>;
|
|
11
19
|
//#endregion
|
|
@@ -3,9 +3,17 @@ import { TableFeature, TableFeatures } from "../../types/TableFeatures.js";
|
|
|
3
3
|
|
|
4
4
|
//#region src/features/row-pinning/rowPinningFeature.d.ts
|
|
5
5
|
interface RowPinningFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
6
|
+
/**
|
|
7
|
+
* Creates the stock row pinning feature.
|
|
8
|
+
*
|
|
9
|
+
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
10
|
+
*/
|
|
6
11
|
declare function constructRowPinningFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<RowPinningFeatureConstructors<TFeatures, TData>>;
|
|
7
12
|
/**
|
|
8
|
-
* The
|
|
13
|
+
* The stock row pinning feature.
|
|
14
|
+
*
|
|
15
|
+
* Register this feature to add row pinning state and APIs for deriving top,
|
|
16
|
+
* center, and bottom row regions.
|
|
9
17
|
*/
|
|
10
18
|
declare const rowPinningFeature: TableFeature<RowPinningFeatureConstructors<TableFeatures, RowData>>;
|
|
11
19
|
//#endregion
|
|
@@ -2,6 +2,11 @@ import { assignPrototypeAPIs, assignTableAPIs, makeStateUpdater } from "../../ut
|
|
|
2
2
|
import { getDefaultRowPinningState, row_getCanPin, row_getIsPinned, row_getPinnedIndex, row_pin, table_getBottomRows, table_getCenterRows, table_getIsSomeRowsPinned, table_getTopRows, table_resetRowPinning, table_setRowPinning } from "./rowPinningFeature.utils.js";
|
|
3
3
|
|
|
4
4
|
//#region src/features/row-pinning/rowPinningFeature.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates the stock row pinning feature.
|
|
7
|
+
*
|
|
8
|
+
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
9
|
+
*/
|
|
5
10
|
function constructRowPinningFeature() {
|
|
6
11
|
return {
|
|
7
12
|
getInitialState: (initialState) => {
|
|
@@ -61,7 +66,10 @@ function constructRowPinningFeature() {
|
|
|
61
66
|
};
|
|
62
67
|
}
|
|
63
68
|
/**
|
|
64
|
-
* The
|
|
69
|
+
* The stock row pinning feature.
|
|
70
|
+
*
|
|
71
|
+
* Register this feature to add row pinning state and APIs for deriving top,
|
|
72
|
+
* center, and bottom row regions.
|
|
65
73
|
*/
|
|
66
74
|
const rowPinningFeature = constructRowPinningFeature();
|
|
67
75
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rowPinningFeature.js","names":[],"sources":["../../../src/features/row-pinning/rowPinningFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n getDefaultRowPinningState,\n row_getCanPin,\n row_getIsPinned,\n row_getPinnedIndex,\n row_pin,\n table_getBottomRows,\n table_getCenterRows,\n table_getIsSomeRowsPinned,\n table_getTopRows,\n table_resetRowPinning,\n table_setRowPinning,\n} from './rowPinningFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// Row_RowPinning,\n// TableOptions_RowPinning,\n// TableState_RowPinning,\n// Table_RowPinning,\n// } from './rowPinningFeature.types'\n\nexport interface RowPinningFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Row: Row_RowPinning\n // Table: Table_RowPinning<TFeatures, RowData>\n // TableOptions: TableOptions_RowPinning<TFeatures, RowData>\n // TableState: TableState_RowPinning\n}\n\nexport function constructRowPinningFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<RowPinningFeatureConstructors<TFeatures, TData>> {\n return {\n getInitialState: (initialState) => {\n return {\n ...initialState,\n rowPinning: {\n ...getDefaultRowPinningState(),\n ...initialState.rowPinning,\n },\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onRowPinningChange: makeStateUpdater('rowPinning', table),\n }\n },\n\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('rowPinningFeature', prototype, table, {\n row_getCanPin: {\n fn: (row) => row_getCanPin(row),\n },\n row_getIsPinned: {\n fn: (row) => row_getIsPinned(row),\n },\n row_getPinnedIndex: {\n fn: (row) => row_getPinnedIndex(row),\n memoDeps: (row) => [\n row.table.getRowModel().rows,\n row.table.atoms.rowPinning?.get(),\n ],\n },\n row_pin: {\n fn: (row, position, includeLeafRows, includeParentRows) =>\n row_pin(row, position, includeLeafRows, includeParentRows),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('rowPinningFeature', table, {\n table_setRowPinning: {\n fn: (updater) => table_setRowPinning(table, updater),\n },\n table_resetRowPinning: {\n fn: (defaultState) => table_resetRowPinning(table, defaultState),\n },\n table_getIsSomeRowsPinned: {\n fn: (position) => table_getIsSomeRowsPinned(table, position),\n },\n table_getTopRows: {\n fn: () => table_getTopRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get()?.top,\n ],\n },\n table_getBottomRows: {\n fn: () => table_getBottomRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get()?.bottom,\n ],\n },\n table_getCenterRows: {\n fn: () => table_getCenterRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get(),\n ],\n },\n })\n },\n }\n}\n\n/**\n * The
|
|
1
|
+
{"version":3,"file":"rowPinningFeature.js","names":[],"sources":["../../../src/features/row-pinning/rowPinningFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n getDefaultRowPinningState,\n row_getCanPin,\n row_getIsPinned,\n row_getPinnedIndex,\n row_pin,\n table_getBottomRows,\n table_getCenterRows,\n table_getIsSomeRowsPinned,\n table_getTopRows,\n table_resetRowPinning,\n table_setRowPinning,\n} from './rowPinningFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// Row_RowPinning,\n// TableOptions_RowPinning,\n// TableState_RowPinning,\n// Table_RowPinning,\n// } from './rowPinningFeature.types'\n\nexport interface RowPinningFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Row: Row_RowPinning\n // Table: Table_RowPinning<TFeatures, RowData>\n // TableOptions: TableOptions_RowPinning<TFeatures, RowData>\n // TableState: TableState_RowPinning\n}\n\n/**\n * Creates the stock row pinning feature.\n *\n * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.\n */\nexport function constructRowPinningFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<RowPinningFeatureConstructors<TFeatures, TData>> {\n return {\n getInitialState: (initialState) => {\n return {\n ...initialState,\n rowPinning: {\n ...getDefaultRowPinningState(),\n ...initialState.rowPinning,\n },\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onRowPinningChange: makeStateUpdater('rowPinning', table),\n }\n },\n\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('rowPinningFeature', prototype, table, {\n row_getCanPin: {\n fn: (row) => row_getCanPin(row),\n },\n row_getIsPinned: {\n fn: (row) => row_getIsPinned(row),\n },\n row_getPinnedIndex: {\n fn: (row) => row_getPinnedIndex(row),\n memoDeps: (row) => [\n row.table.getRowModel().rows,\n row.table.atoms.rowPinning?.get(),\n ],\n },\n row_pin: {\n fn: (row, position, includeLeafRows, includeParentRows) =>\n row_pin(row, position, includeLeafRows, includeParentRows),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('rowPinningFeature', table, {\n table_setRowPinning: {\n fn: (updater) => table_setRowPinning(table, updater),\n },\n table_resetRowPinning: {\n fn: (defaultState) => table_resetRowPinning(table, defaultState),\n },\n table_getIsSomeRowsPinned: {\n fn: (position) => table_getIsSomeRowsPinned(table, position),\n },\n table_getTopRows: {\n fn: () => table_getTopRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get()?.top,\n ],\n },\n table_getBottomRows: {\n fn: () => table_getBottomRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get()?.bottom,\n ],\n },\n table_getCenterRows: {\n fn: () => table_getCenterRows(table),\n memoDeps: () => [\n table.getRowModel().rows,\n table.atoms.rowPinning?.get(),\n ],\n },\n })\n },\n }\n}\n\n/**\n * The stock row pinning feature.\n *\n * Register this feature to add row pinning state and APIs for deriving top,\n * center, and bottom row regions.\n */\nexport const rowPinningFeature = constructRowPinningFeature()\n"],"mappings":";;;;;;;;;AA0CA,SAAgB,6BAGmD;CACjE,OAAO;EACL,kBAAkB,iBAAiB;GACjC,OAAO;IACL,GAAG;IACH,YAAY;KACV,GAAG,2BAA2B;KAC9B,GAAG,aAAa;KACjB;IACF;;EAGH,yBAAyB,UAAU;GACjC,OAAO,EACL,oBAAoB,iBAAiB,cAAc,MAAM,EAC1D;;EAGH,qBAAqB,WAAW,UAAU;GACxC,oBAAoB,qBAAqB,WAAW,OAAO;IACzD,eAAe,EACb,KAAK,QAAQ,cAAc,IAAI,EAChC;IACD,iBAAiB,EACf,KAAK,QAAQ,gBAAgB,IAAI,EAClC;IACD,oBAAoB;KAClB,KAAK,QAAQ,mBAAmB,IAAI;KACpC,WAAW,QAAQ;;cACjB,IAAI,MAAM,aAAa,CAAC,+BACxB,IAAI,MAAM,MAAM,0FAAY,KAAK,CAClC;;KACF;IACD,SAAS,EACP,KAAK,KAAK,UAAU,iBAAiB,sBACnC,QAAQ,KAAK,UAAU,iBAAiB,kBAAkB,EAC7D;IACF,CAAC;;EAGJ,qBAAqB,UAAU;GAC7B,gBAAgB,qBAAqB,OAAO;IAC1C,qBAAqB,EACnB,KAAK,YAAY,oBAAoB,OAAO,QAAQ,EACrD;IACD,uBAAuB,EACrB,KAAK,iBAAiB,sBAAsB,OAAO,aAAa,EACjE;IACD,2BAA2B,EACzB,KAAK,aAAa,0BAA0B,OAAO,SAAS,EAC7D;IACD,kBAAkB;KAChB,UAAU,iBAAiB,MAAM;KACjC,gBAAgB;;cACd,MAAM,aAAa,CAAC,+BACpB,MAAM,MAAM,2GAAY,KAAK,gFAAE,IAChC;;KACF;IACD,qBAAqB;KACnB,UAAU,oBAAoB,MAAM;KACpC,gBAAgB;;cACd,MAAM,aAAa,CAAC,gCACpB,MAAM,MAAM,8GAAY,KAAK,kFAAE,OAChC;;KACF;IACD,qBAAqB;KACnB,UAAU,oBAAoB,MAAM;KACpC,gBAAgB;;cACd,MAAM,aAAa,CAAC,gCACpB,MAAM,MAAM,4FAAY,KAAK,CAC9B;;KACF;IACF,CAAC;;EAEL;;;;;;;;AASH,MAAa,oBAAoB,4BAA4B"}
|