@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
|
@@ -21,7 +21,9 @@ interface TableOptions_RowPinning<TFeatures extends TableFeatures, TData extends
|
|
|
21
21
|
*/
|
|
22
22
|
keepPinnedRows?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Called with an updater when row pinning state changes. Pair this with
|
|
25
|
+
* `state.rowPinning` when using external state; external atoms can own the
|
|
26
|
+
* slice without this callback.
|
|
25
27
|
*/
|
|
26
28
|
onRowPinningChange?: OnChangeFn<RowPinningState>;
|
|
27
29
|
}
|
|
@@ -68,7 +70,7 @@ interface Table_RowPinning<TFeatures extends TableFeatures, TData extends RowDat
|
|
|
68
70
|
*/
|
|
69
71
|
resetRowPinning: (defaultState?: boolean) => void;
|
|
70
72
|
/**
|
|
71
|
-
* Sets
|
|
73
|
+
* Sets row pinning state using a value or updater.
|
|
72
74
|
*/
|
|
73
75
|
setRowPinning: (updater: Updater<RowPinningState>) => void;
|
|
74
76
|
}
|
|
@@ -21,7 +21,9 @@ interface TableOptions_RowPinning<TFeatures extends TableFeatures, TData extends
|
|
|
21
21
|
*/
|
|
22
22
|
keepPinnedRows?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Called with an updater when row pinning state changes. Pair this with
|
|
25
|
+
* `state.rowPinning` when using external state; external atoms can own the
|
|
26
|
+
* slice without this callback.
|
|
25
27
|
*/
|
|
26
28
|
onRowPinningChange?: OnChangeFn<RowPinningState>;
|
|
27
29
|
}
|
|
@@ -68,7 +70,7 @@ interface Table_RowPinning<TFeatures extends TableFeatures, TData extends RowDat
|
|
|
68
70
|
*/
|
|
69
71
|
resetRowPinning: (defaultState?: boolean) => void;
|
|
70
72
|
/**
|
|
71
|
-
* Sets
|
|
73
|
+
* Sets row pinning state using a value or updater.
|
|
72
74
|
*/
|
|
73
75
|
setRowPinning: (updater: Updater<RowPinningState>) => void;
|
|
74
76
|
}
|
|
@@ -2,19 +2,60 @@ const require_utils = require('../../utils.cjs');
|
|
|
2
2
|
const require_rowExpandingFeature_utils = require('../row-expanding/rowExpandingFeature.utils.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/features/row-pinning/rowPinningFeature.utils.ts
|
|
5
|
+
/**
|
|
6
|
+
* Returns the default row pinning state.
|
|
7
|
+
*
|
|
8
|
+
* Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const initialValue = getDefaultRowPinningState()
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
5
15
|
function getDefaultRowPinningState() {
|
|
6
16
|
return {
|
|
7
17
|
top: [],
|
|
8
18
|
bottom: []
|
|
9
19
|
};
|
|
10
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Updates the table's row pinning state slice.
|
|
23
|
+
*
|
|
24
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* table_setRowPinning(table, (old) => old)
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
11
31
|
function table_setRowPinning(table, updater) {
|
|
12
32
|
var _table$options$onRowP, _table$options;
|
|
13
33
|
(_table$options$onRowP = (_table$options = table.options).onRowPinningChange) === null || _table$options$onRowP === void 0 || _table$options$onRowP.call(_table$options, updater);
|
|
14
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Resets the table's row pinning state slice.
|
|
37
|
+
*
|
|
38
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* table_resetRowPinning(table)
|
|
43
|
+
* table_resetRowPinning(table, true)
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
15
46
|
function table_resetRowPinning(table, defaultState) {
|
|
16
47
|
table_setRowPinning(table, defaultState ? getDefaultRowPinningState() : require_utils.cloneState(table.initialState.rowPinning ?? getDefaultRowPinningState()));
|
|
17
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns is some rows pinned for the table.
|
|
51
|
+
*
|
|
52
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const value = table_getIsSomeRowsPinned(table)
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
18
59
|
function table_getIsSomeRowsPinned(table, position) {
|
|
19
60
|
var _table$atoms$rowPinni;
|
|
20
61
|
const rowPinning = (_table$atoms$rowPinni = table.atoms.rowPinning) === null || _table$atoms$rowPinni === void 0 ? void 0 : _table$atoms$rowPinni.get();
|
|
@@ -34,12 +75,42 @@ function table_getPinnedRows(table, position) {
|
|
|
34
75
|
});
|
|
35
76
|
return filteredRows;
|
|
36
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Returns top rows for the table.
|
|
80
|
+
*
|
|
81
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const value = table_getTopRows(table)
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
37
88
|
function table_getTopRows(table) {
|
|
38
89
|
return table_getPinnedRows(table, "top");
|
|
39
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Returns bottom rows for the table.
|
|
93
|
+
*
|
|
94
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const value = table_getBottomRows(table)
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
40
101
|
function table_getBottomRows(table) {
|
|
41
102
|
return table_getPinnedRows(table, "bottom");
|
|
42
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns center rows for the table.
|
|
106
|
+
*
|
|
107
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const value = table_getCenterRows(table)
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
43
114
|
function table_getCenterRows(table) {
|
|
44
115
|
var _table$atoms$rowPinni3;
|
|
45
116
|
const { top, bottom } = ((_table$atoms$rowPinni3 = table.atoms.rowPinning) === null || _table$atoms$rowPinni3 === void 0 ? void 0 : _table$atoms$rowPinni3.get()) ?? getDefaultRowPinningState();
|
|
@@ -47,21 +118,62 @@ function table_getCenterRows(table) {
|
|
|
47
118
|
const topAndBottom = new Set([...top, ...bottom]);
|
|
48
119
|
return allRows.filter((d) => !topAndBottom.has(d.id));
|
|
49
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Returns whether a row can use pin.
|
|
123
|
+
*
|
|
124
|
+
* This evaluates row data, table options, and feature-specific enablement rules.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* const value = row_getCanPin(row)
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
50
131
|
function row_getCanPin(row) {
|
|
51
132
|
const { enableRowPinning } = row.table.options;
|
|
52
133
|
if (typeof enableRowPinning === "function") return enableRowPinning(row);
|
|
53
134
|
return enableRowPinning ?? true;
|
|
54
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns is pinned for a row.
|
|
138
|
+
*
|
|
139
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* const value = row_getIsPinned(row)
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
55
146
|
function row_getIsPinned(row) {
|
|
56
147
|
var _row$table$atoms$rowP;
|
|
57
148
|
const { top, bottom } = ((_row$table$atoms$rowP = row.table.atoms.rowPinning) === null || _row$table$atoms$rowP === void 0 ? void 0 : _row$table$atoms$rowP.get()) ?? getDefaultRowPinningState();
|
|
58
149
|
return top.includes(row.id) ? "top" : bottom.includes(row.id) ? "bottom" : false;
|
|
59
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Returns pinned index for a row.
|
|
153
|
+
*
|
|
154
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const value = row_getPinnedIndex(row)
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
60
161
|
function row_getPinnedIndex(row) {
|
|
61
162
|
const position = row_getIsPinned(row);
|
|
62
163
|
if (!position) return -1;
|
|
63
164
|
return (position === "top" ? require_utils.callMemoOrStaticFn(row.table, "getTopRows", table_getTopRows) : require_utils.callMemoOrStaticFn(row.table, "getBottomRows", table_getBottomRows)).map(({ id }) => id).indexOf(row.id);
|
|
64
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Pins or unpins a row.
|
|
168
|
+
*
|
|
169
|
+
* Optional flags let callers include parent rows or leaf rows when updating
|
|
170
|
+
* the row pinning state.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* row_pin(row, 'top')
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
65
177
|
function row_pin(row, position, includeLeafRows, includeParentRows) {
|
|
66
178
|
const leafRowIds = includeLeafRows ? row.getLeafRows().map(({ id }) => id) : [];
|
|
67
179
|
const parentRowIds = includeParentRows ? row.getParentRows().map(({ id }) => id) : [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rowPinningFeature.utils.cjs","names":["cloneState","row_getIsAllParentsExpanded","callMemoOrStaticFn"],"sources":["../../../src/features/row-pinning/rowPinningFeature.utils.ts"],"sourcesContent":["import { row_getIsAllParentsExpanded } from '../row-expanding/rowExpandingFeature.utils'\nimport { callMemoOrStaticFn, cloneState } 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 { Row } from '../../types/Row'\nimport type {\n RowPinningPosition,\n RowPinningState,\n} from './rowPinningFeature.types'\n\n// State Utils\n\nexport function getDefaultRowPinningState(): RowPinningState {\n return {\n top: [],\n bottom: [],\n }\n}\n\nexport function table_setRowPinning<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<RowPinningState>,\n): void {\n table.options.onRowPinningChange?.(updater)\n}\n\nexport function table_resetRowPinning<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void {\n table_setRowPinning(\n table,\n defaultState\n ? getDefaultRowPinningState()\n : cloneState(\n table.initialState.rowPinning ?? getDefaultRowPinningState(),\n ),\n )\n}\n\n// Table Utils\n\nexport function table_getIsSomeRowsPinned<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n position?: RowPinningPosition,\n): boolean {\n const rowPinning = table.atoms.rowPinning?.get()\n\n if (!position) {\n return Boolean(rowPinning?.top.length || rowPinning?.bottom.length)\n }\n return Boolean(rowPinning?.[position].length)\n}\n\nfunction table_getPinnedRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n position: 'top' | 'bottom',\n): Array<Row<TFeatures, TData>> {\n const visibleRows = table.getRowModel().rows\n const pinnedRowIds = table.atoms.rowPinning?.get()?.[position] ?? []\n\n const rows =\n (table.options.keepPinnedRows ?? true)\n ? // get all rows that are pinned even if they would not be otherwise visible\n // account for expanded parent rows, but not pagination or filtering\n pinnedRowIds.map((rowId) => {\n const row = table.getRow(rowId, true)\n return row_getIsAllParentsExpanded(row) ? row : null\n })\n : // else get only visible rows that are pinned\n pinnedRowIds.map(\n (rowId) => visibleRows.find((row) => row.id === rowId)!,\n )\n\n const filteredRows = rows.filter((r) => !!r)\n // Assign position property directly to preserve prototype chain\n filteredRows.forEach((row) => {\n ;(row as any).position = position\n })\n return filteredRows\n}\n\nexport function table_getTopRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return table_getPinnedRows(table, 'top')\n}\n\nexport function table_getBottomRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return table_getPinnedRows(table, 'bottom')\n}\n\nexport function table_getCenterRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n const { top, bottom } =\n table.atoms.rowPinning?.get() ?? getDefaultRowPinningState()\n const allRows = table.getRowModel().rows\n\n const topAndBottom = new Set([...top, ...bottom])\n return allRows.filter((d) => !topAndBottom.has(d.id))\n}\n\n// Row Utils\n\nexport function row_getCanPin<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): boolean {\n const { enableRowPinning } = row.table.options\n if (typeof enableRowPinning === 'function') {\n return enableRowPinning(row)\n }\n return enableRowPinning ?? true\n}\n\nexport function row_getIsPinned<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): RowPinningPosition {\n const { top, bottom } =\n row.table.atoms.rowPinning?.get() ?? getDefaultRowPinningState()\n\n return top.includes(row.id)\n ? 'top'\n : bottom.includes(row.id)\n ? 'bottom'\n : false\n}\n\nexport function row_getPinnedIndex<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): number {\n const position = row_getIsPinned(row)\n if (!position) return -1\n\n const visiblePinnedRowIds = (\n position === 'top'\n ? callMemoOrStaticFn(row.table, 'getTopRows', table_getTopRows)\n : callMemoOrStaticFn(row.table, 'getBottomRows', table_getBottomRows)\n ).map(({ id }) => id)\n\n return visiblePinnedRowIds.indexOf(row.id)\n}\n\nexport function row_pin<TFeatures extends TableFeatures, TData extends RowData>(\n row: Row<TFeatures, TData>,\n position: RowPinningPosition,\n includeLeafRows?: boolean,\n includeParentRows?: boolean,\n): void {\n const leafRowIds = includeLeafRows\n ? row.getLeafRows().map(({ id }) => id)\n : []\n const parentRowIds = includeParentRows\n ? row.getParentRows().map(({ id }) => id)\n : []\n const rowIds: Set<string> = new Set([...parentRowIds, row.id, ...leafRowIds])\n\n table_setRowPinning(row.table, (old) => {\n if (position === 'bottom') {\n return {\n top: old.top.filter((d) => !rowIds.has(d)),\n bottom: [\n ...old.bottom.filter((d) => !rowIds.has(d)),\n ...Array.from(rowIds),\n ],\n }\n }\n\n if (position === 'top') {\n return {\n top: [...old.top.filter((d) => !rowIds.has(d)), ...Array.from(rowIds)],\n bottom: old.bottom.filter((d) => !rowIds.has(d)),\n }\n }\n\n return {\n top: old.top.filter((d) => !rowIds.has(d)),\n bottom: old.bottom.filter((d) => !rowIds.has(d)),\n }\n })\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"rowPinningFeature.utils.cjs","names":["cloneState","row_getIsAllParentsExpanded","callMemoOrStaticFn"],"sources":["../../../src/features/row-pinning/rowPinningFeature.utils.ts"],"sourcesContent":["import { row_getIsAllParentsExpanded } from '../row-expanding/rowExpandingFeature.utils'\nimport { callMemoOrStaticFn, cloneState } 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 { Row } from '../../types/Row'\nimport type {\n RowPinningPosition,\n RowPinningState,\n} from './rowPinningFeature.types'\n\n// State Utils\n\n/**\n * Returns the default row pinning 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 = getDefaultRowPinningState()\n * ```\n */\nexport function getDefaultRowPinningState(): RowPinningState {\n return {\n top: [],\n bottom: [],\n }\n}\n\n/**\n * Updates the table's row pinning 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_setRowPinning(table, (old) => old)\n * ```\n */\nexport function table_setRowPinning<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<RowPinningState>,\n): void {\n table.options.onRowPinningChange?.(updater)\n}\n\n/**\n * Resets the table's row pinning 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_resetRowPinning(table)\n * table_resetRowPinning(table, true)\n * ```\n */\nexport function table_resetRowPinning<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void {\n table_setRowPinning(\n table,\n defaultState\n ? getDefaultRowPinningState()\n : cloneState(\n table.initialState.rowPinning ?? getDefaultRowPinningState(),\n ),\n )\n}\n\n// Table Utils\n\n/**\n * Returns is some rows pinned 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_getIsSomeRowsPinned(table)\n * ```\n */\nexport function table_getIsSomeRowsPinned<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n position?: RowPinningPosition,\n): boolean {\n const rowPinning = table.atoms.rowPinning?.get()\n\n if (!position) {\n return Boolean(rowPinning?.top.length || rowPinning?.bottom.length)\n }\n return Boolean(rowPinning?.[position].length)\n}\n\nfunction table_getPinnedRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n position: 'top' | 'bottom',\n): Array<Row<TFeatures, TData>> {\n const visibleRows = table.getRowModel().rows\n const pinnedRowIds = table.atoms.rowPinning?.get()?.[position] ?? []\n\n const rows =\n (table.options.keepPinnedRows ?? true)\n ? // get all rows that are pinned even if they would not be otherwise visible\n // account for expanded parent rows, but not pagination or filtering\n pinnedRowIds.map((rowId) => {\n const row = table.getRow(rowId, true)\n return row_getIsAllParentsExpanded(row) ? row : null\n })\n : // else get only visible rows that are pinned\n pinnedRowIds.map(\n (rowId) => visibleRows.find((row) => row.id === rowId)!,\n )\n\n const filteredRows = rows.filter((r) => !!r)\n // Assign position property directly to preserve prototype chain\n filteredRows.forEach((row) => {\n ;(row as any).position = position\n })\n return filteredRows\n}\n\n/**\n * Returns top rows 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_getTopRows(table)\n * ```\n */\nexport function table_getTopRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return table_getPinnedRows(table, 'top')\n}\n\n/**\n * Returns bottom rows 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_getBottomRows(table)\n * ```\n */\nexport function table_getBottomRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return table_getPinnedRows(table, 'bottom')\n}\n\n/**\n * Returns center rows 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_getCenterRows(table)\n * ```\n */\nexport function table_getCenterRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n const { top, bottom } =\n table.atoms.rowPinning?.get() ?? getDefaultRowPinningState()\n const allRows = table.getRowModel().rows\n\n const topAndBottom = new Set([...top, ...bottom])\n return allRows.filter((d) => !topAndBottom.has(d.id))\n}\n\n// Row Utils\n\n/**\n * Returns whether a row can use pin.\n *\n * This evaluates row data, table options, and feature-specific enablement rules.\n *\n * @example\n * ```ts\n * const value = row_getCanPin(row)\n * ```\n */\nexport function row_getCanPin<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): boolean {\n const { enableRowPinning } = row.table.options\n if (typeof enableRowPinning === 'function') {\n return enableRowPinning(row)\n }\n return enableRowPinning ?? true\n}\n\n/**\n * Returns is pinned for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getIsPinned(row)\n * ```\n */\nexport function row_getIsPinned<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): RowPinningPosition {\n const { top, bottom } =\n row.table.atoms.rowPinning?.get() ?? getDefaultRowPinningState()\n\n return top.includes(row.id)\n ? 'top'\n : bottom.includes(row.id)\n ? 'bottom'\n : false\n}\n\n/**\n * Returns pinned index for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getPinnedIndex(row)\n * ```\n */\nexport function row_getPinnedIndex<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): number {\n const position = row_getIsPinned(row)\n if (!position) return -1\n\n const visiblePinnedRowIds = (\n position === 'top'\n ? callMemoOrStaticFn(row.table, 'getTopRows', table_getTopRows)\n : callMemoOrStaticFn(row.table, 'getBottomRows', table_getBottomRows)\n ).map(({ id }) => id)\n\n return visiblePinnedRowIds.indexOf(row.id)\n}\n\n/**\n * Pins or unpins a row.\n *\n * Optional flags let callers include parent rows or leaf rows when updating\n * the row pinning state.\n *\n * @example\n * ```ts\n * row_pin(row, 'top')\n * ```\n */\nexport function row_pin<TFeatures extends TableFeatures, TData extends RowData>(\n row: Row<TFeatures, TData>,\n position: RowPinningPosition,\n includeLeafRows?: boolean,\n includeParentRows?: boolean,\n): void {\n const leafRowIds = includeLeafRows\n ? row.getLeafRows().map(({ id }) => id)\n : []\n const parentRowIds = includeParentRows\n ? row.getParentRows().map(({ id }) => id)\n : []\n const rowIds: Set<string> = new Set([...parentRowIds, row.id, ...leafRowIds])\n\n table_setRowPinning(row.table, (old) => {\n if (position === 'bottom') {\n return {\n top: old.top.filter((d) => !rowIds.has(d)),\n bottom: [\n ...old.bottom.filter((d) => !rowIds.has(d)),\n ...Array.from(rowIds),\n ],\n }\n }\n\n if (position === 'top') {\n return {\n top: [...old.top.filter((d) => !rowIds.has(d)), ...Array.from(rowIds)],\n bottom: old.bottom.filter((d) => !rowIds.has(d)),\n }\n }\n\n return {\n top: old.top.filter((d) => !rowIds.has(d)),\n bottom: old.bottom.filter((d) => !rowIds.has(d)),\n }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;AAuBA,SAAgB,4BAA6C;CAC3D,OAAO;EACL,KAAK,EAAE;EACP,QAAQ,EAAE;EACX;;;;;;;;;;;;AAaH,SAAgB,oBAId,OACA,SACM;;CACN,iDAAM,SAAQ,+GAAqB,QAAQ;;;;;;;;;;;;;AAc7C,SAAgB,sBAGd,OAAyC,cAA8B;CACvE,oBACE,OACA,eACI,2BAA2B,GAC3BA,yBACE,MAAM,aAAa,cAAc,2BAA2B,CAC7D,CACN;;;;;;;;;;;;AAeH,SAAgB,0BAId,OACA,UACS;;CACT,MAAM,sCAAa,MAAM,MAAM,0FAAY,KAAK;CAEhD,IAAI,CAAC,UACH,OAAO,iEAAQ,WAAY,IAAI,oEAAU,WAAY,OAAO,QAAO;CAErE,OAAO,gEAAQ,WAAa,UAAU,OAAO;;AAG/C,SAAS,oBAIP,OACA,UAC8B;;CAC9B,MAAM,cAAc,MAAM,aAAa,CAAC;CACxC,MAAM,0CAAe,MAAM,MAAM,8GAAY,KAAK,kFAAG,cAAa,EAAE;CAepE,MAAM,gBAZH,MAAM,QAAQ,kBAAkB,OAG7B,aAAa,KAAK,UAAU;EAC1B,MAAM,MAAM,MAAM,OAAO,OAAO,KAAK;EACrC,OAAOC,8DAA4B,IAAI,GAAG,MAAM;GAChD,GAEF,aAAa,KACV,UAAU,YAAY,MAAM,QAAQ,IAAI,OAAO,MAAM,CACvD,EAEmB,QAAQ,MAAM,CAAC,CAAC,EAAE;CAE5C,aAAa,SAAS,QAAQ;EAC3B,AAAC,IAAY,WAAW;GACzB;CACF,OAAO;;;;;;;;;;;;AAaT,SAAgB,iBAGd,OAAuE;CACvE,OAAO,oBAAoB,OAAO,MAAM;;;;;;;;;;;;AAa1C,SAAgB,oBAGd,OAAuE;CACvE,OAAO,oBAAoB,OAAO,SAAS;;;;;;;;;;;;AAa7C,SAAgB,oBAGd,OAAuE;;CACvE,MAAM,EAAE,KAAK,sCACX,MAAM,MAAM,4FAAY,KAAK,KAAI,2BAA2B;CAC9D,MAAM,UAAU,MAAM,aAAa,CAAC;CAEpC,MAAM,eAAe,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,OAAO,CAAC;CACjD,OAAO,QAAQ,QAAQ,MAAM,CAAC,aAAa,IAAI,EAAE,GAAG,CAAC;;;;;;;;;;;;AAevD,SAAgB,cAGd,KAAqC;CACrC,MAAM,EAAE,qBAAqB,IAAI,MAAM;CACvC,IAAI,OAAO,qBAAqB,YAC9B,OAAO,iBAAiB,IAAI;CAE9B,OAAO,oBAAoB;;;;;;;;;;;;AAa7B,SAAgB,gBAGd,KAAgD;;CAChD,MAAM,EAAE,KAAK,qCACX,IAAI,MAAM,MAAM,0FAAY,KAAK,KAAI,2BAA2B;CAElE,OAAO,IAAI,SAAS,IAAI,GAAG,GACvB,QACA,OAAO,SAAS,IAAI,GAAG,GACrB,WACA;;;;;;;;;;;;AAaR,SAAgB,mBAGd,KAAoC;CACpC,MAAM,WAAW,gBAAgB,IAAI;CACrC,IAAI,CAAC,UAAU,OAAO;CAQtB,QALE,aAAa,QACTC,iCAAmB,IAAI,OAAO,cAAc,iBAAiB,GAC7DA,iCAAmB,IAAI,OAAO,iBAAiB,oBAAoB,EACvE,KAAK,EAAE,SAAS,GAEQ,CAAC,QAAQ,IAAI,GAAG;;;;;;;;;;;;;AAc5C,SAAgB,QACd,KACA,UACA,iBACA,mBACM;CACN,MAAM,aAAa,kBACf,IAAI,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,GACrC,EAAE;CACN,MAAM,eAAe,oBACjB,IAAI,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,GACvC,EAAE;CACN,MAAM,SAAsB,IAAI,IAAI;EAAC,GAAG;EAAc,IAAI;EAAI,GAAG;EAAW,CAAC;CAE7E,oBAAoB,IAAI,QAAQ,QAAQ;EACtC,IAAI,aAAa,UACf,OAAO;GACL,KAAK,IAAI,IAAI,QAAQ,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;GAC1C,QAAQ,CACN,GAAG,IAAI,OAAO,QAAQ,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,EAC3C,GAAG,MAAM,KAAK,OAAO,CACtB;GACF;EAGH,IAAI,aAAa,OACf,OAAO;GACL,KAAK,CAAC,GAAG,IAAI,IAAI,QAAQ,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,GAAG,MAAM,KAAK,OAAO,CAAC;GACtE,QAAQ,IAAI,OAAO,QAAQ,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;GACjD;EAGH,OAAO;GACL,KAAK,IAAI,IAAI,QAAQ,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;GAC1C,QAAQ,IAAI,OAAO,QAAQ,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;GACjD;GACD"}
|
|
@@ -5,16 +5,128 @@ import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
|
5
5
|
import { Table_Internal } from "../../types/Table.cjs";
|
|
6
6
|
|
|
7
7
|
//#region src/features/row-pinning/rowPinningFeature.utils.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Returns the default row pinning state.
|
|
10
|
+
*
|
|
11
|
+
* Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const initialValue = getDefaultRowPinningState()
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
8
18
|
declare function getDefaultRowPinningState(): RowPinningState;
|
|
19
|
+
/**
|
|
20
|
+
* Updates the table's row pinning state slice.
|
|
21
|
+
*
|
|
22
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* table_setRowPinning(table, (old) => old)
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
9
29
|
declare function table_setRowPinning<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: Updater<RowPinningState>): void;
|
|
30
|
+
/**
|
|
31
|
+
* Resets the table's row pinning state slice.
|
|
32
|
+
*
|
|
33
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* table_resetRowPinning(table)
|
|
38
|
+
* table_resetRowPinning(table, true)
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
10
41
|
declare function table_resetRowPinning<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void;
|
|
42
|
+
/**
|
|
43
|
+
* Returns is some rows pinned for the table.
|
|
44
|
+
*
|
|
45
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const value = table_getIsSomeRowsPinned(table)
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
11
52
|
declare function table_getIsSomeRowsPinned<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, position?: RowPinningPosition): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Returns top rows for the table.
|
|
55
|
+
*
|
|
56
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const value = table_getTopRows(table)
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
12
63
|
declare function table_getTopRows<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns bottom rows for the table.
|
|
66
|
+
*
|
|
67
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const value = table_getBottomRows(table)
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
13
74
|
declare function table_getBottomRows<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>>;
|
|
75
|
+
/**
|
|
76
|
+
* Returns center rows for the table.
|
|
77
|
+
*
|
|
78
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const value = table_getCenterRows(table)
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
14
85
|
declare function table_getCenterRows<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns whether a row can use pin.
|
|
88
|
+
*
|
|
89
|
+
* This evaluates row data, table options, and feature-specific enablement rules.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const value = row_getCanPin(row)
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
15
96
|
declare function row_getCanPin<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Returns is pinned for a row.
|
|
99
|
+
*
|
|
100
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const value = row_getIsPinned(row)
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
16
107
|
declare function row_getIsPinned<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): RowPinningPosition;
|
|
108
|
+
/**
|
|
109
|
+
* Returns pinned index for a row.
|
|
110
|
+
*
|
|
111
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* const value = row_getPinnedIndex(row)
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
17
118
|
declare function row_getPinnedIndex<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): number;
|
|
119
|
+
/**
|
|
120
|
+
* Pins or unpins a row.
|
|
121
|
+
*
|
|
122
|
+
* Optional flags let callers include parent rows or leaf rows when updating
|
|
123
|
+
* the row pinning state.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* row_pin(row, 'top')
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
18
130
|
declare function row_pin<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, position: RowPinningPosition, includeLeafRows?: boolean, includeParentRows?: boolean): void;
|
|
19
131
|
//#endregion
|
|
20
132
|
export { getDefaultRowPinningState, row_getCanPin, row_getIsPinned, row_getPinnedIndex, row_pin, table_getBottomRows, table_getCenterRows, table_getIsSomeRowsPinned, table_getTopRows, table_resetRowPinning, table_setRowPinning };
|
|
@@ -5,16 +5,128 @@ import { TableFeatures } from "../../types/TableFeatures.js";
|
|
|
5
5
|
import { Table_Internal } from "../../types/Table.js";
|
|
6
6
|
|
|
7
7
|
//#region src/features/row-pinning/rowPinningFeature.utils.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Returns the default row pinning state.
|
|
10
|
+
*
|
|
11
|
+
* Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const initialValue = getDefaultRowPinningState()
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
8
18
|
declare function getDefaultRowPinningState(): RowPinningState;
|
|
19
|
+
/**
|
|
20
|
+
* Updates the table's row pinning state slice.
|
|
21
|
+
*
|
|
22
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* table_setRowPinning(table, (old) => old)
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
9
29
|
declare function table_setRowPinning<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: Updater<RowPinningState>): void;
|
|
30
|
+
/**
|
|
31
|
+
* Resets the table's row pinning state slice.
|
|
32
|
+
*
|
|
33
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* table_resetRowPinning(table)
|
|
38
|
+
* table_resetRowPinning(table, true)
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
10
41
|
declare function table_resetRowPinning<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void;
|
|
42
|
+
/**
|
|
43
|
+
* Returns is some rows pinned for the table.
|
|
44
|
+
*
|
|
45
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const value = table_getIsSomeRowsPinned(table)
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
11
52
|
declare function table_getIsSomeRowsPinned<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, position?: RowPinningPosition): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Returns top rows for the table.
|
|
55
|
+
*
|
|
56
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const value = table_getTopRows(table)
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
12
63
|
declare function table_getTopRows<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns bottom rows for the table.
|
|
66
|
+
*
|
|
67
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const value = table_getBottomRows(table)
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
13
74
|
declare function table_getBottomRows<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>>;
|
|
75
|
+
/**
|
|
76
|
+
* Returns center rows for the table.
|
|
77
|
+
*
|
|
78
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const value = table_getCenterRows(table)
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
14
85
|
declare function table_getCenterRows<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Array<Row<TFeatures, TData>>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns whether a row can use pin.
|
|
88
|
+
*
|
|
89
|
+
* This evaluates row data, table options, and feature-specific enablement rules.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const value = row_getCanPin(row)
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
15
96
|
declare function row_getCanPin<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Returns is pinned for a row.
|
|
99
|
+
*
|
|
100
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const value = row_getIsPinned(row)
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
16
107
|
declare function row_getIsPinned<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): RowPinningPosition;
|
|
108
|
+
/**
|
|
109
|
+
* Returns pinned index for a row.
|
|
110
|
+
*
|
|
111
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* const value = row_getPinnedIndex(row)
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
17
118
|
declare function row_getPinnedIndex<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): number;
|
|
119
|
+
/**
|
|
120
|
+
* Pins or unpins a row.
|
|
121
|
+
*
|
|
122
|
+
* Optional flags let callers include parent rows or leaf rows when updating
|
|
123
|
+
* the row pinning state.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* row_pin(row, 'top')
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
18
130
|
declare function row_pin<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, position: RowPinningPosition, includeLeafRows?: boolean, includeParentRows?: boolean): void;
|
|
19
131
|
//#endregion
|
|
20
132
|
export { getDefaultRowPinningState, row_getCanPin, row_getIsPinned, row_getPinnedIndex, row_pin, table_getBottomRows, table_getCenterRows, table_getIsSomeRowsPinned, table_getTopRows, table_resetRowPinning, table_setRowPinning };
|
|
@@ -2,19 +2,60 @@ import { callMemoOrStaticFn, cloneState } from "../../utils.js";
|
|
|
2
2
|
import { row_getIsAllParentsExpanded } from "../row-expanding/rowExpandingFeature.utils.js";
|
|
3
3
|
|
|
4
4
|
//#region src/features/row-pinning/rowPinningFeature.utils.ts
|
|
5
|
+
/**
|
|
6
|
+
* Returns the default row pinning state.
|
|
7
|
+
*
|
|
8
|
+
* Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const initialValue = getDefaultRowPinningState()
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
5
15
|
function getDefaultRowPinningState() {
|
|
6
16
|
return {
|
|
7
17
|
top: [],
|
|
8
18
|
bottom: []
|
|
9
19
|
};
|
|
10
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Updates the table's row pinning state slice.
|
|
23
|
+
*
|
|
24
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* table_setRowPinning(table, (old) => old)
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
11
31
|
function table_setRowPinning(table, updater) {
|
|
12
32
|
var _table$options$onRowP, _table$options;
|
|
13
33
|
(_table$options$onRowP = (_table$options = table.options).onRowPinningChange) === null || _table$options$onRowP === void 0 || _table$options$onRowP.call(_table$options, updater);
|
|
14
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Resets the table's row pinning state slice.
|
|
37
|
+
*
|
|
38
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* table_resetRowPinning(table)
|
|
43
|
+
* table_resetRowPinning(table, true)
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
15
46
|
function table_resetRowPinning(table, defaultState) {
|
|
16
47
|
table_setRowPinning(table, defaultState ? getDefaultRowPinningState() : cloneState(table.initialState.rowPinning ?? getDefaultRowPinningState()));
|
|
17
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns is some rows pinned for the table.
|
|
51
|
+
*
|
|
52
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const value = table_getIsSomeRowsPinned(table)
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
18
59
|
function table_getIsSomeRowsPinned(table, position) {
|
|
19
60
|
var _table$atoms$rowPinni;
|
|
20
61
|
const rowPinning = (_table$atoms$rowPinni = table.atoms.rowPinning) === null || _table$atoms$rowPinni === void 0 ? void 0 : _table$atoms$rowPinni.get();
|
|
@@ -34,12 +75,42 @@ function table_getPinnedRows(table, position) {
|
|
|
34
75
|
});
|
|
35
76
|
return filteredRows;
|
|
36
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Returns top rows for the table.
|
|
80
|
+
*
|
|
81
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const value = table_getTopRows(table)
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
37
88
|
function table_getTopRows(table) {
|
|
38
89
|
return table_getPinnedRows(table, "top");
|
|
39
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Returns bottom rows for the table.
|
|
93
|
+
*
|
|
94
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const value = table_getBottomRows(table)
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
40
101
|
function table_getBottomRows(table) {
|
|
41
102
|
return table_getPinnedRows(table, "bottom");
|
|
42
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns center rows for the table.
|
|
106
|
+
*
|
|
107
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const value = table_getCenterRows(table)
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
43
114
|
function table_getCenterRows(table) {
|
|
44
115
|
var _table$atoms$rowPinni3;
|
|
45
116
|
const { top, bottom } = ((_table$atoms$rowPinni3 = table.atoms.rowPinning) === null || _table$atoms$rowPinni3 === void 0 ? void 0 : _table$atoms$rowPinni3.get()) ?? getDefaultRowPinningState();
|
|
@@ -47,21 +118,62 @@ function table_getCenterRows(table) {
|
|
|
47
118
|
const topAndBottom = new Set([...top, ...bottom]);
|
|
48
119
|
return allRows.filter((d) => !topAndBottom.has(d.id));
|
|
49
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Returns whether a row can use pin.
|
|
123
|
+
*
|
|
124
|
+
* This evaluates row data, table options, and feature-specific enablement rules.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* const value = row_getCanPin(row)
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
50
131
|
function row_getCanPin(row) {
|
|
51
132
|
const { enableRowPinning } = row.table.options;
|
|
52
133
|
if (typeof enableRowPinning === "function") return enableRowPinning(row);
|
|
53
134
|
return enableRowPinning ?? true;
|
|
54
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns is pinned for a row.
|
|
138
|
+
*
|
|
139
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* const value = row_getIsPinned(row)
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
55
146
|
function row_getIsPinned(row) {
|
|
56
147
|
var _row$table$atoms$rowP;
|
|
57
148
|
const { top, bottom } = ((_row$table$atoms$rowP = row.table.atoms.rowPinning) === null || _row$table$atoms$rowP === void 0 ? void 0 : _row$table$atoms$rowP.get()) ?? getDefaultRowPinningState();
|
|
58
149
|
return top.includes(row.id) ? "top" : bottom.includes(row.id) ? "bottom" : false;
|
|
59
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Returns pinned index for a row.
|
|
153
|
+
*
|
|
154
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const value = row_getPinnedIndex(row)
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
60
161
|
function row_getPinnedIndex(row) {
|
|
61
162
|
const position = row_getIsPinned(row);
|
|
62
163
|
if (!position) return -1;
|
|
63
164
|
return (position === "top" ? callMemoOrStaticFn(row.table, "getTopRows", table_getTopRows) : callMemoOrStaticFn(row.table, "getBottomRows", table_getBottomRows)).map(({ id }) => id).indexOf(row.id);
|
|
64
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Pins or unpins a row.
|
|
168
|
+
*
|
|
169
|
+
* Optional flags let callers include parent rows or leaf rows when updating
|
|
170
|
+
* the row pinning state.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* row_pin(row, 'top')
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
65
177
|
function row_pin(row, position, includeLeafRows, includeParentRows) {
|
|
66
178
|
const leafRowIds = includeLeafRows ? row.getLeafRows().map(({ id }) => id) : [];
|
|
67
179
|
const parentRowIds = includeParentRows ? row.getParentRows().map(({ id }) => id) : [];
|