@tanstack/table-core 9.0.0-alpha.43 → 9.0.0-alpha.47
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 +9 -3
- 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 +9 -3
- 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 +21 -12
- 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 +21 -12
- 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 +107 -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 +107 -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 +33 -20
- 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 +33 -20
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/constructHeader.cjs +9 -3
- 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 +9 -3
- package/dist/core/headers/constructHeader.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.cjs +6 -6
- 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 +7 -7
- package/dist/core/headers/coreHeadersFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.cjs +87 -16
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +61 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +61 -1
- package/dist/core/headers/coreHeadersFeature.utils.js +89 -18
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/reactivity/coreReactivityFeature.types.d.cts +4 -0
- package/dist/core/reactivity/coreReactivityFeature.types.d.ts +4 -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 +13 -6
- 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 +13 -6
- 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 +112 -7
- 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 +112 -7
- package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
- package/dist/core/table/constructTable.cjs +19 -5
- 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 +19 -5
- 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 +49 -1
- 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 +49 -1
- 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 +13 -5
- 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 +13 -5
- package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.cjs +13 -3
- 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 +13 -3
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs +12 -4
- 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 +12 -4
- 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 +16 -5
- 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 +16 -5
- 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 +108 -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 +108 -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 +387 -27
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +318 -6
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +318 -6
- package/dist/features/column-pinning/columnPinningFeature.utils.js +388 -28
- 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 +78 -16
- 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 +79 -17
- 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 +30 -20
- 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 +31 -21
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +8 -3
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +8 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +199 -12
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +154 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +154 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +199 -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 +153 -2
- 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 +153 -2
- 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 +125 -7
- 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 +125 -7
- 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 +265 -3
- 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 +265 -3
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs +18 -8
- 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 +18 -8
- 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 +153 -2
- 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 +153 -2
- 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 +19 -7
- 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 +19 -8
- 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/index.cjs +0 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/static-functions.cjs +2 -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 +1 -0
- package/dist/store-reactivity-bindings.cjs.map +1 -1
- package/dist/store-reactivity-bindings.js +1 -0
- package/dist/store-reactivity-bindings.js.map +1 -1
- package/dist/utils.cjs +49 -25
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +33 -10
- package/dist/utils.d.ts +33 -10
- package/dist/utils.js +50 -22
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/core/cells/constructCell.ts +8 -2
- package/src/core/cells/coreCellsFeature.ts +5 -0
- package/src/core/cells/coreCellsFeature.utils.ts +30 -0
- package/src/core/columns/constructColumn.ts +11 -3
- package/src/core/columns/coreColumnsFeature.ts +10 -0
- package/src/core/columns/coreColumnsFeature.types.ts +4 -0
- package/src/core/columns/coreColumnsFeature.utils.ts +113 -8
- package/src/core/coreFeatures.ts +5 -0
- package/src/core/headers/buildHeaderGroups.ts +36 -31
- package/src/core/headers/constructHeader.ts +8 -2
- package/src/core/headers/coreHeadersFeature.ts +7 -27
- package/src/core/headers/coreHeadersFeature.utils.ts +110 -46
- package/src/core/reactivity/coreReactivityFeature.types.ts +4 -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 +11 -4
- package/src/core/rows/coreRowsFeature.ts +5 -0
- package/src/core/rows/coreRowsFeature.types.ts +3 -0
- package/src/core/rows/coreRowsFeature.utils.ts +116 -10
- package/src/core/table/constructTable.ts +16 -4
- package/src/core/table/coreTablesFeature.ts +5 -0
- package/src/core/table/coreTablesFeature.types.ts +22 -12
- package/src/core/table/coreTablesFeature.utils.ts +47 -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 +13 -10
- package/src/features/column-faceting/createFacetedRowModel.ts +15 -6
- package/src/features/column-faceting/createFacetedUniqueValues.ts +9 -3
- 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 +19 -8
- 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 +117 -17
- 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 +425 -76
- 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 +54 -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 +20 -18
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +11 -3
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +213 -24
- 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 +153 -2
- 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 +132 -18
- 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 +279 -19
- package/src/features/row-sorting/createSortedRowModel.ts +21 -13
- 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 +153 -2
- package/src/features/stockFeatures.ts +5 -0
- package/src/flex-render.ts +10 -0
- package/src/fns/aggregationFns.ts +25 -8
- package/src/fns/filterFns.ts +5 -0
- package/src/fns/sortFns.ts +50 -5
- package/src/helpers/tableOptions.ts +32 -0
- package/src/store-reactivity-bindings.ts +1 -0
- package/src/utils.ts +52 -34
|
@@ -1,64 +1,251 @@
|
|
|
1
1
|
const require_utils = require('../../utils.cjs');
|
|
2
|
+
const require_columnPinningFeature_utils = require('../column-pinning/columnPinningFeature.utils.cjs');
|
|
2
3
|
|
|
3
4
|
//#region src/features/column-visibility/columnVisibilityFeature.utils.ts
|
|
5
|
+
/**
|
|
6
|
+
* Returns the default column visibility 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 = getDefaultColumnVisibilityState()
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
4
15
|
function getDefaultColumnVisibilityState() {
|
|
5
16
|
return {};
|
|
6
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Toggles visibility for a column.
|
|
20
|
+
*
|
|
21
|
+
* The update is applied through the owning table state slice and respects the feature options for that column.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* column_toggleVisibility(column)
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
7
28
|
function column_toggleVisibility(column, visible) {
|
|
8
29
|
if (column_getCanHide(column)) table_setColumnVisibility(column.table, (old) => ({
|
|
9
30
|
...old,
|
|
10
31
|
[column.id]: visible ?? !require_utils.callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible)
|
|
11
32
|
}));
|
|
12
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns is visible for a column.
|
|
36
|
+
*
|
|
37
|
+
* This derives the value from the column definition, table options, and the feature state atoms registered on the table.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const value = column_getIsVisible(column)
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
13
44
|
function column_getIsVisible(column) {
|
|
14
45
|
var _column$table$atoms$c;
|
|
15
46
|
const childColumns = column.columns;
|
|
16
47
|
return (childColumns.length ? childColumns.some((childColumn) => require_utils.callMemoOrStaticFn(childColumn, "getIsVisible", column_getIsVisible)) : (_column$table$atoms$c = column.table.atoms.columnVisibility) === null || _column$table$atoms$c === void 0 || (_column$table$atoms$c = _column$table$atoms$c.get()) === null || _column$table$atoms$c === void 0 ? void 0 : _column$table$atoms$c[column.id]) ?? true;
|
|
17
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns whether a column can use hide.
|
|
51
|
+
*
|
|
52
|
+
* This combines column options, table options, and any required accessor or feature state for the capability.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const value = column_getCanHide(column)
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
18
59
|
function column_getCanHide(column) {
|
|
19
60
|
return (column.columnDef.enableHiding ?? true) && (column.table.options.enableHiding ?? true);
|
|
20
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns an event handler for toggling visibility handler.
|
|
64
|
+
*
|
|
65
|
+
* The handler is intended for direct use in column header controls such as buttons or checkboxes.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const value = column_getToggleVisibilityHandler(column)
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
21
72
|
function column_getToggleVisibilityHandler(column) {
|
|
22
73
|
return (e) => {
|
|
23
74
|
column_toggleVisibility(column, e.target.checked);
|
|
24
75
|
};
|
|
25
76
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Returns visible cells for a row.
|
|
79
|
+
*
|
|
80
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const value = row_getVisibleCells(row)
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
function row_getVisibleCells(row) {
|
|
88
|
+
var _row$table$atoms$colu;
|
|
89
|
+
const allCells = row.getAllCells();
|
|
90
|
+
const visibleCells = [];
|
|
91
|
+
for (let i = 0; i < allCells.length; i++) {
|
|
92
|
+
const cell = allCells[i];
|
|
93
|
+
if (require_utils.callMemoOrStaticFn(cell.column, "getIsVisible", column_getIsVisible)) visibleCells.push(cell);
|
|
94
|
+
}
|
|
95
|
+
const { left, right } = ((_row$table$atoms$colu = row.table.atoms.columnPinning) === null || _row$table$atoms$colu === void 0 ? void 0 : _row$table$atoms$colu.get()) ?? require_columnPinningFeature_utils.getDefaultColumnPinningState();
|
|
96
|
+
if (!left.length && !right.length) return visibleCells;
|
|
97
|
+
const visibleCellsByColumnId = require_utils.callMemoOrStaticFn(row, "getVisibleCellsByColumnId", row_getVisibleCellsByColumnId);
|
|
98
|
+
const leftCells = [];
|
|
99
|
+
for (let i = 0; i < left.length; i++) {
|
|
100
|
+
const cell = visibleCellsByColumnId[left[i]];
|
|
101
|
+
if (cell) leftCells.push(cell);
|
|
102
|
+
}
|
|
103
|
+
const rightCells = [];
|
|
104
|
+
for (let i = 0; i < right.length; i++) {
|
|
105
|
+
const cell = visibleCellsByColumnId[right[i]];
|
|
106
|
+
if (cell) rightCells.push(cell);
|
|
107
|
+
}
|
|
108
|
+
const centerCells = [];
|
|
109
|
+
for (let i = 0; i < visibleCells.length; i++) {
|
|
110
|
+
const cell = visibleCells[i];
|
|
111
|
+
const id = cell.column.id;
|
|
112
|
+
if (!left.includes(id) && !right.includes(id)) centerCells.push(cell);
|
|
113
|
+
}
|
|
30
114
|
return [
|
|
31
|
-
...
|
|
32
|
-
...
|
|
33
|
-
...
|
|
115
|
+
...leftCells,
|
|
116
|
+
...centerCells,
|
|
117
|
+
...rightCells
|
|
34
118
|
];
|
|
35
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Returns visible cells by column id for a row.
|
|
122
|
+
*
|
|
123
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* const value = row_getVisibleCellsByColumnId(row)
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
function row_getVisibleCellsByColumnId(row) {
|
|
131
|
+
const result = {};
|
|
132
|
+
const allCells = row.getAllCells();
|
|
133
|
+
for (let i = 0; i < allCells.length; i++) {
|
|
134
|
+
const cell = allCells[i];
|
|
135
|
+
if (require_utils.callMemoOrStaticFn(cell.column, "getIsVisible", column_getIsVisible)) result[cell.column.id] = cell;
|
|
136
|
+
}
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Returns visible flat columns for the table.
|
|
141
|
+
*
|
|
142
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* const value = table_getVisibleFlatColumns(table)
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
36
149
|
function table_getVisibleFlatColumns(table) {
|
|
37
150
|
return table.getAllFlatColumns().filter((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible));
|
|
38
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Returns visible leaf columns for the table.
|
|
154
|
+
*
|
|
155
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* const value = table_getVisibleLeafColumns(table)
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
39
162
|
function table_getVisibleLeafColumns(table) {
|
|
40
163
|
return table.getAllLeafColumns().filter((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible));
|
|
41
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Updates the table's column visibility state slice.
|
|
167
|
+
*
|
|
168
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```ts
|
|
172
|
+
* table_setColumnVisibility(table, (old) => old)
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
42
175
|
function table_setColumnVisibility(table, updater) {
|
|
43
176
|
var _table$options$onColu, _table$options;
|
|
44
177
|
(_table$options$onColu = (_table$options = table.options).onColumnVisibilityChange) === null || _table$options$onColu === void 0 || _table$options$onColu.call(_table$options, updater);
|
|
45
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Resets the table's column visibility state slice.
|
|
181
|
+
*
|
|
182
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts
|
|
186
|
+
* table_resetColumnVisibility(table)
|
|
187
|
+
* table_resetColumnVisibility(table, true)
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
46
190
|
function table_resetColumnVisibility(table, defaultState) {
|
|
47
191
|
table_setColumnVisibility(table, defaultState ? {} : require_utils.cloneState(table.initialState.columnVisibility ?? {}));
|
|
48
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Toggles all columns visible for the table.
|
|
195
|
+
*
|
|
196
|
+
* This is the table-level convenience API used by UI controls that affect many columns or rows at once.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```ts
|
|
200
|
+
* table_toggleAllColumnsVisible(table)
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
49
203
|
function table_toggleAllColumnsVisible(table, value) {
|
|
50
204
|
value = value ?? !table_getIsAllColumnsVisible(table);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
205
|
+
const visibility = {};
|
|
206
|
+
const leafColumns = table.getAllLeafColumns();
|
|
207
|
+
for (let i = 0; i < leafColumns.length; i++) {
|
|
208
|
+
const column = leafColumns[i];
|
|
209
|
+
visibility[column.id] = !value ? !column_getCanHide(column) : value;
|
|
210
|
+
}
|
|
211
|
+
table_setColumnVisibility(table, visibility);
|
|
55
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Returns is all columns visible for the table.
|
|
215
|
+
*
|
|
216
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```ts
|
|
220
|
+
* const value = table_getIsAllColumnsVisible(table)
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
56
223
|
function table_getIsAllColumnsVisible(table) {
|
|
57
224
|
return !table.getAllLeafColumns().some((column) => !require_utils.callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible));
|
|
58
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Returns is some columns visible for the table.
|
|
228
|
+
*
|
|
229
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```ts
|
|
233
|
+
* const value = table_getIsSomeColumnsVisible(table)
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
59
236
|
function table_getIsSomeColumnsVisible(table) {
|
|
60
237
|
return table.getAllLeafColumns().some((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible));
|
|
61
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* Returns an event handler for all columns visibility handler.
|
|
241
|
+
*
|
|
242
|
+
* The handler calls the matching table toggle API and can be attached directly to checkbox or button UI.
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* ```ts
|
|
246
|
+
* const value = table_getToggleAllColumnsVisibilityHandler(table)
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
62
249
|
function table_getToggleAllColumnsVisibilityHandler(table) {
|
|
63
250
|
return (e) => {
|
|
64
251
|
table_toggleAllColumnsVisible(table, e.target.checked);
|
|
@@ -71,8 +258,8 @@ exports.column_getIsVisible = column_getIsVisible;
|
|
|
71
258
|
exports.column_getToggleVisibilityHandler = column_getToggleVisibilityHandler;
|
|
72
259
|
exports.column_toggleVisibility = column_toggleVisibility;
|
|
73
260
|
exports.getDefaultColumnVisibilityState = getDefaultColumnVisibilityState;
|
|
74
|
-
exports.row_getAllVisibleCells = row_getAllVisibleCells;
|
|
75
261
|
exports.row_getVisibleCells = row_getVisibleCells;
|
|
262
|
+
exports.row_getVisibleCellsByColumnId = row_getVisibleCellsByColumnId;
|
|
76
263
|
exports.table_getIsAllColumnsVisible = table_getIsAllColumnsVisible;
|
|
77
264
|
exports.table_getIsSomeColumnsVisible = table_getIsSomeColumnsVisible;
|
|
78
265
|
exports.table_getToggleAllColumnsVisibilityHandler = table_getToggleAllColumnsVisibilityHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnVisibilityFeature.utils.cjs","names":["callMemoOrStaticFn","cloneState"],"sources":["../../../src/features/column-visibility/columnVisibilityFeature.utils.ts"],"sourcesContent":["import { callMemoOrStaticFn, cloneState } from '../../utils'\nimport type { CellData, RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { Cell } from '../../types/Cell'\nimport type { Column_Internal } from '../../types/Column'\nimport type { ColumnVisibilityState } from './columnVisibilityFeature.types'\nimport type { Row } from '../../types/Row'\n\nexport function getDefaultColumnVisibilityState(): ColumnVisibilityState {\n return {}\n}\n\nexport function column_toggleVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>, visible?: boolean): void {\n if (column_getCanHide(column)) {\n table_setColumnVisibility(column.table, (old) => ({\n ...old,\n [column.id]:\n visible ??\n !callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n }))\n }\n}\n\nexport function column_getIsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>): boolean {\n const childColumns = column.columns\n return (\n (childColumns.length\n ? childColumns.some((childColumn) =>\n callMemoOrStaticFn(childColumn, 'getIsVisible', column_getIsVisible),\n )\n : column.table.atoms.columnVisibility?.get()?.[column.id]) ?? true\n )\n}\n\nexport function column_getCanHide<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>) {\n return (\n (column.columnDef.enableHiding ?? true) &&\n (column.table.options.enableHiding ?? true)\n )\n}\n\nexport function column_getToggleVisibilityHandler<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>) {\n return (e: unknown) => {\n column_toggleVisibility(\n column,\n ((e as MouseEvent).target as HTMLInputElement).checked,\n )\n }\n}\n\nexport function row_getAllVisibleCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n return row\n .getAllCells()\n .filter((cell) =>\n callMemoOrStaticFn(cell.column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function row_getVisibleCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n left: Array<Cell<TFeatures, TData, unknown>>,\n center: Array<Cell<TFeatures, TData, unknown>>,\n right: Array<Cell<TFeatures, TData, unknown>>,\n) {\n return [...left, ...center, ...right]\n}\n\nexport function table_getVisibleFlatColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllFlatColumns()\n .filter((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function table_getVisibleLeafColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllLeafColumns()\n .filter((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function table_setColumnVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<ColumnVisibilityState>,\n) {\n table.options.onColumnVisibilityChange?.(updater)\n}\n\nexport function table_resetColumnVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setColumnVisibility(\n table,\n defaultState ? {} : cloneState(table.initialState.columnVisibility ?? {}),\n )\n}\n\nexport function table_toggleAllColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, value?: boolean) {\n value = value ?? !table_getIsAllColumnsVisible(table)\n\n table_setColumnVisibility(\n table,\n table.getAllLeafColumns().reduce(\n (obj, column) => ({\n ...obj,\n [column.id]: !value ? !column_getCanHide(column) : value,\n }),\n {},\n ),\n )\n}\n\nexport function table_getIsAllColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return !table\n .getAllLeafColumns()\n .some(\n (column) =>\n !callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function table_getIsSomeColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllLeafColumns()\n .some((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function table_getToggleAllColumnsVisibilityHandler<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return (e: unknown) => {\n table_toggleAllColumnsVisible(\n table,\n ((e as MouseEvent).target as HTMLInputElement).checked,\n )\n }\n}\n"],"mappings":";;;AASA,SAAgB,kCAAyD;AACvE,QAAO,EAAE;;AAGX,SAAgB,wBAId,QAAmD,SAAyB;AAC5E,KAAI,kBAAkB,OAAO,CAC3B,2BAA0B,OAAO,QAAQ,SAAS;EAChD,GAAG;GACF,OAAO,KACN,WACA,CAACA,iCAAmB,QAAQ,gBAAgB,oBAAoB;EACnE,EAAE;;AAIP,SAAgB,oBAId,QAA4D;;CAC5D,MAAM,eAAe,OAAO;AAC5B,SACG,aAAa,SACV,aAAa,MAAM,gBACjBA,iCAAmB,aAAa,gBAAgB,oBAAoB,CACrE,4BACD,OAAO,MAAM,MAAM,iHAAkB,KAAK,gFAAG,OAAO,QAAQ;;AAIpE,SAAgB,kBAId,QAAmD;AACnD,SACG,OAAO,UAAU,gBAAgB,UACjC,OAAO,MAAM,QAAQ,gBAAgB;;AAI1C,SAAgB,kCAId,QAAmD;AACnD,SAAQ,MAAe;AACrB,0BACE,QACE,EAAiB,OAA4B,QAChD;;;AAIL,SAAgB,uBAGd,KAA4B;AAC5B,QAAO,IACJ,aAAa,CACb,QAAQ,SACPA,iCAAmB,KAAK,QAAQ,gBAAgB,oBAAoB,CACrE;;AAGL,SAAgB,oBAId,MACA,QACA,OACA;AACA,QAAO;EAAC,GAAG;EAAM,GAAG;EAAQ,GAAG;EAAM;;AAGvC,SAAgB,4BAGd,OAAyC;AACzC,QAAO,MACJ,mBAAmB,CACnB,QAAQ,WACPA,iCAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;AAGL,SAAgB,4BAGd,OAAyC;AACzC,QAAO,MACJ,mBAAmB,CACnB,QAAQ,WACPA,iCAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;AAGL,SAAgB,0BAId,OACA,SACA;;AACA,kDAAM,SAAQ,qHAA2B,QAAQ;;AAGnD,SAAgB,4BAGd,OAAyC,cAAwB;AACjE,2BACE,OACA,eAAe,EAAE,GAAGC,yBAAW,MAAM,aAAa,oBAAoB,EAAE,CAAC,CAC1E;;AAGH,SAAgB,8BAGd,OAAyC,OAAiB;AAC1D,SAAQ,SAAS,CAAC,6BAA6B,MAAM;AAErD,2BACE,OACA,MAAM,mBAAmB,CAAC,QACvB,KAAK,YAAY;EAChB,GAAG;GACF,OAAO,KAAK,CAAC,QAAQ,CAAC,kBAAkB,OAAO,GAAG;EACpD,GACD,EAAE,CACH,CACF;;AAGH,SAAgB,6BAGd,OAAyC;AACzC,QAAO,CAAC,MACL,mBAAmB,CACnB,MACE,WACC,CAACD,iCAAmB,QAAQ,gBAAgB,oBAAoB,CACnE;;AAGL,SAAgB,8BAGd,OAAyC;AACzC,QAAO,MACJ,mBAAmB,CACnB,MAAM,WACLA,iCAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;AAGL,SAAgB,2CAGd,OAAyC;AACzC,SAAQ,MAAe;AACrB,gCACE,OACE,EAAiB,OAA4B,QAChD"}
|
|
1
|
+
{"version":3,"file":"columnVisibilityFeature.utils.cjs","names":["callMemoOrStaticFn","getDefaultColumnPinningState","cloneState"],"sources":["../../../src/features/column-visibility/columnVisibilityFeature.utils.ts"],"sourcesContent":["import { callMemoOrStaticFn, cloneState } from '../../utils'\nimport { getDefaultColumnPinningState } from '../column-pinning/columnPinningFeature.utils'\nimport type { CellData, RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { Cell } from '../../types/Cell'\nimport type { Column_Internal } from '../../types/Column'\nimport type { ColumnVisibilityState } from './columnVisibilityFeature.types'\nimport type { Row } from '../../types/Row'\n\n/**\n * Returns the default column visibility 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 = getDefaultColumnVisibilityState()\n * ```\n */\nexport function getDefaultColumnVisibilityState(): ColumnVisibilityState {\n return {}\n}\n\n/**\n * Toggles visibility for a column.\n *\n * The update is applied through the owning table state slice and respects the feature options for that column.\n *\n * @example\n * ```ts\n * column_toggleVisibility(column)\n * ```\n */\nexport function column_toggleVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>, visible?: boolean): void {\n if (column_getCanHide(column)) {\n table_setColumnVisibility(column.table, (old) => ({\n ...old,\n [column.id]:\n visible ??\n !callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n }))\n }\n}\n\n/**\n * Returns is visible for a column.\n *\n * This derives the value from the column definition, table options, and the feature state atoms registered on the table.\n *\n * @example\n * ```ts\n * const value = column_getIsVisible(column)\n * ```\n */\nexport function column_getIsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>): boolean {\n const childColumns = column.columns\n return (\n (childColumns.length\n ? childColumns.some((childColumn) =>\n callMemoOrStaticFn(childColumn, 'getIsVisible', column_getIsVisible),\n )\n : column.table.atoms.columnVisibility?.get()?.[column.id]) ?? true\n )\n}\n\n/**\n * Returns whether a column can use hide.\n *\n * This combines column options, table options, and any required accessor or feature state for the capability.\n *\n * @example\n * ```ts\n * const value = column_getCanHide(column)\n * ```\n */\nexport function column_getCanHide<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>) {\n return (\n (column.columnDef.enableHiding ?? true) &&\n (column.table.options.enableHiding ?? true)\n )\n}\n\n/**\n * Returns an event handler for toggling visibility handler.\n *\n * The handler is intended for direct use in column header controls such as buttons or checkboxes.\n *\n * @example\n * ```ts\n * const value = column_getToggleVisibilityHandler(column)\n * ```\n */\nexport function column_getToggleVisibilityHandler<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>) {\n return (e: unknown) => {\n column_toggleVisibility(\n column,\n ((e as MouseEvent).target as HTMLInputElement).checked,\n )\n }\n}\n\n/**\n * Returns visible cells 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_getVisibleCells(row)\n * ```\n */\nexport function row_getVisibleCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {\n const allCells = row.getAllCells()\n const visibleCells: Array<Cell<TFeatures, TData, unknown>> = []\n for (let i = 0; i < allCells.length; i++) {\n const cell = allCells[i]!\n if (callMemoOrStaticFn(cell.column, 'getIsVisible', column_getIsVisible)) {\n visibleCells.push(cell)\n }\n }\n\n const { left, right } =\n row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()\n if (!left.length && !right.length) return visibleCells // no pinning, return early\n\n const visibleCellsByColumnId = callMemoOrStaticFn(\n row,\n 'getVisibleCellsByColumnId',\n row_getVisibleCellsByColumnId,\n )\n\n const leftCells: Array<Cell<TFeatures, TData, unknown>> = []\n for (let i = 0; i < left.length; i++) {\n const cell = visibleCellsByColumnId[left[i]!]\n if (cell) leftCells.push(cell)\n }\n\n const rightCells: Array<Cell<TFeatures, TData, unknown>> = []\n for (let i = 0; i < right.length; i++) {\n const cell = visibleCellsByColumnId[right[i]!]\n if (cell) rightCells.push(cell)\n }\n\n // Center cells: visible cells in natural column order, minus pinned ones.\n const centerCells: Array<Cell<TFeatures, TData, unknown>> = []\n for (let i = 0; i < visibleCells.length; i++) {\n const cell = visibleCells[i]!\n const id = cell.column.id\n if (!left.includes(id) && !right.includes(id)) centerCells.push(cell)\n }\n\n return [...leftCells, ...centerCells, ...rightCells]\n}\n\n/**\n * Returns visible cells by column id 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_getVisibleCellsByColumnId(row)\n * ```\n */\nexport function row_getVisibleCellsByColumnId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Record<string, Cell<TFeatures, TData, unknown>> {\n const result: Record<string, Cell<TFeatures, TData, unknown>> = {}\n const allCells = row.getAllCells()\n for (let i = 0; i < allCells.length; i++) {\n const cell = allCells[i]!\n if (callMemoOrStaticFn(cell.column, 'getIsVisible', column_getIsVisible)) {\n result[cell.column.id] = cell\n }\n }\n return result\n}\n\n/**\n * Returns visible flat columns 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_getVisibleFlatColumns(table)\n * ```\n */\nexport function table_getVisibleFlatColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllFlatColumns()\n .filter((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\n/**\n * Returns visible leaf columns 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_getVisibleLeafColumns(table)\n * ```\n */\nexport function table_getVisibleLeafColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllLeafColumns()\n .filter((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\n/**\n * Updates the table's column visibility 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_setColumnVisibility(table, (old) => old)\n * ```\n */\nexport function table_setColumnVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<ColumnVisibilityState>,\n) {\n table.options.onColumnVisibilityChange?.(updater)\n}\n\n/**\n * Resets the table's column visibility 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_resetColumnVisibility(table)\n * table_resetColumnVisibility(table, true)\n * ```\n */\nexport function table_resetColumnVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setColumnVisibility(\n table,\n defaultState ? {} : cloneState(table.initialState.columnVisibility ?? {}),\n )\n}\n\n/**\n * Toggles all columns visible for the table.\n *\n * This is the table-level convenience API used by UI controls that affect many columns or rows at once.\n *\n * @example\n * ```ts\n * table_toggleAllColumnsVisible(table)\n * ```\n */\nexport function table_toggleAllColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, value?: boolean) {\n value = value ?? !table_getIsAllColumnsVisible(table)\n\n const visibility: Record<string, boolean> = {}\n const leafColumns = table.getAllLeafColumns()\n for (let i = 0; i < leafColumns.length; i++) {\n const column = leafColumns[i]!\n visibility[column.id] = !value ? !column_getCanHide(column) : value\n }\n\n table_setColumnVisibility(table, visibility)\n}\n\n/**\n * Returns is all columns visible 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_getIsAllColumnsVisible(table)\n * ```\n */\nexport function table_getIsAllColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return !table\n .getAllLeafColumns()\n .some(\n (column) =>\n !callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\n/**\n * Returns is some columns visible 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_getIsSomeColumnsVisible(table)\n * ```\n */\nexport function table_getIsSomeColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllLeafColumns()\n .some((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\n/**\n * Returns an event handler for all columns visibility handler.\n *\n * The handler calls the matching table toggle API and can be attached directly to checkbox or button UI.\n *\n * @example\n * ```ts\n * const value = table_getToggleAllColumnsVisibilityHandler(table)\n * ```\n */\nexport function table_getToggleAllColumnsVisibilityHandler<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return (e: unknown) => {\n table_toggleAllColumnsVisible(\n table,\n ((e as MouseEvent).target as HTMLInputElement).checked,\n )\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAgB,kCAAyD;CACvE,OAAO,EAAE;;;;;;;;;;;;AAaX,SAAgB,wBAId,QAAmD,SAAyB;CAC5E,IAAI,kBAAkB,OAAO,EAC3B,0BAA0B,OAAO,QAAQ,SAAS;EAChD,GAAG;GACF,OAAO,KACN,WACA,CAACA,iCAAmB,QAAQ,gBAAgB,oBAAoB;EACnE,EAAE;;;;;;;;;;;;AAcP,SAAgB,oBAId,QAA4D;;CAC5D,MAAM,eAAe,OAAO;CAC5B,QACG,aAAa,SACV,aAAa,MAAM,gBACjBA,iCAAmB,aAAa,gBAAgB,oBAAoB,CACrE,4BACD,OAAO,MAAM,MAAM,iHAAkB,KAAK,gFAAG,OAAO,QAAQ;;;;;;;;;;;;AAcpE,SAAgB,kBAId,QAAmD;CACnD,QACG,OAAO,UAAU,gBAAgB,UACjC,OAAO,MAAM,QAAQ,gBAAgB;;;;;;;;;;;;AAc1C,SAAgB,kCAId,QAAmD;CACnD,QAAQ,MAAe;EACrB,wBACE,QACE,EAAiB,OAA4B,QAChD;;;;;;;;;;;;;AAcL,SAAgB,oBAGd,KAAoE;;CACpE,MAAM,WAAW,IAAI,aAAa;CAClC,MAAM,eAAuD,EAAE;CAC/D,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,MAAM,OAAO,SAAS;EACtB,IAAIA,iCAAmB,KAAK,QAAQ,gBAAgB,oBAAoB,EACtE,aAAa,KAAK,KAAK;;CAI3B,MAAM,EAAE,MAAM,oCACZ,IAAI,MAAM,MAAM,6FAAe,KAAK,KAAIC,iEAA8B;CACxE,IAAI,CAAC,KAAK,UAAU,CAAC,MAAM,QAAQ,OAAO;CAE1C,MAAM,yBAAyBD,iCAC7B,KACA,6BACA,8BACD;CAED,MAAM,YAAoD,EAAE;CAC5D,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,OAAO,uBAAuB,KAAK;EACzC,IAAI,MAAM,UAAU,KAAK,KAAK;;CAGhC,MAAM,aAAqD,EAAE;CAC7D,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,OAAO,uBAAuB,MAAM;EAC1C,IAAI,MAAM,WAAW,KAAK,KAAK;;CAIjC,MAAM,cAAsD,EAAE;CAC9D,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;EAC5C,MAAM,OAAO,aAAa;EAC1B,MAAM,KAAK,KAAK,OAAO;EACvB,IAAI,CAAC,KAAK,SAAS,GAAG,IAAI,CAAC,MAAM,SAAS,GAAG,EAAE,YAAY,KAAK,KAAK;;CAGvE,OAAO;EAAC,GAAG;EAAW,GAAG;EAAa,GAAG;EAAW;;;;;;;;;;;;AAatD,SAAgB,8BAGd,KAA6E;CAC7E,MAAM,SAA0D,EAAE;CAClE,MAAM,WAAW,IAAI,aAAa;CAClC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,MAAM,OAAO,SAAS;EACtB,IAAIA,iCAAmB,KAAK,QAAQ,gBAAgB,oBAAoB,EACtE,OAAO,KAAK,OAAO,MAAM;;CAG7B,OAAO;;;;;;;;;;;;AAaT,SAAgB,4BAGd,OAAyC;CACzC,OAAO,MACJ,mBAAmB,CACnB,QAAQ,WACPA,iCAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;;;;;;;;;;;AAaL,SAAgB,4BAGd,OAAyC;CACzC,OAAO,MACJ,mBAAmB,CACnB,QAAQ,WACPA,iCAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;;;;;;;;;;;AAaL,SAAgB,0BAId,OACA,SACA;;CACA,iDAAM,SAAQ,qHAA2B,QAAQ;;;;;;;;;;;;;AAcnD,SAAgB,4BAGd,OAAyC,cAAwB;CACjE,0BACE,OACA,eAAe,EAAE,GAAGE,yBAAW,MAAM,aAAa,oBAAoB,EAAE,CAAC,CAC1E;;;;;;;;;;;;AAaH,SAAgB,8BAGd,OAAyC,OAAiB;CAC1D,QAAQ,SAAS,CAAC,6BAA6B,MAAM;CAErD,MAAM,aAAsC,EAAE;CAC9C,MAAM,cAAc,MAAM,mBAAmB;CAC7C,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,QAAQ,KAAK;EAC3C,MAAM,SAAS,YAAY;EAC3B,WAAW,OAAO,MAAM,CAAC,QAAQ,CAAC,kBAAkB,OAAO,GAAG;;CAGhE,0BAA0B,OAAO,WAAW;;;;;;;;;;;;AAa9C,SAAgB,6BAGd,OAAyC;CACzC,OAAO,CAAC,MACL,mBAAmB,CACnB,MACE,WACC,CAACF,iCAAmB,QAAQ,gBAAgB,oBAAoB,CACnE;;;;;;;;;;;;AAaL,SAAgB,8BAGd,OAAyC;CACzC,OAAO,MACJ,mBAAmB,CACnB,MAAM,WACLA,iCAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;;;;;;;;;;;AAaL,SAAgB,2CAGd,OAAyC;CACzC,QAAQ,MAAe;EACrB,8BACE,OACE,EAAiB,OAA4B,QAChD"}
|
|
@@ -6,21 +6,172 @@ import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
|
6
6
|
import { Table_Internal } from "../../types/Table.cjs";
|
|
7
7
|
import { Cell } from "../../types/Cell.cjs";
|
|
8
8
|
//#region src/features/column-visibility/columnVisibilityFeature.utils.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Returns the default column visibility state.
|
|
11
|
+
*
|
|
12
|
+
* Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const initialValue = getDefaultColumnVisibilityState()
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
9
19
|
declare function getDefaultColumnVisibilityState(): ColumnVisibilityState;
|
|
20
|
+
/**
|
|
21
|
+
* Toggles visibility for a column.
|
|
22
|
+
*
|
|
23
|
+
* The update is applied through the owning table state slice and respects the feature options for that column.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* column_toggleVisibility(column)
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
10
30
|
declare function column_toggleVisibility<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>, visible?: boolean): void;
|
|
31
|
+
/**
|
|
32
|
+
* Returns is visible for a column.
|
|
33
|
+
*
|
|
34
|
+
* This derives the value from the column definition, table options, and the feature state atoms registered on the table.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const value = column_getIsVisible(column)
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
11
41
|
declare function column_getIsVisible<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Returns whether a column can use hide.
|
|
44
|
+
*
|
|
45
|
+
* This combines column options, table options, and any required accessor or feature state for the capability.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const value = column_getCanHide(column)
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
12
52
|
declare function column_getCanHide<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Returns an event handler for toggling visibility handler.
|
|
55
|
+
*
|
|
56
|
+
* The handler is intended for direct use in column header controls such as buttons or checkboxes.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const value = column_getToggleVisibilityHandler(column)
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
13
63
|
declare function column_getToggleVisibilityHandler<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>): (e: unknown) => void;
|
|
14
|
-
|
|
15
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Returns visible cells for a row.
|
|
66
|
+
*
|
|
67
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const value = row_getVisibleCells(row)
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare function row_getVisibleCells<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>>;
|
|
75
|
+
/**
|
|
76
|
+
* Returns visible cells by column id for a row.
|
|
77
|
+
*
|
|
78
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const value = row_getVisibleCellsByColumnId(row)
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
declare function row_getVisibleCellsByColumnId<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Record<string, Cell<TFeatures, TData, unknown>>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns visible flat columns for the table.
|
|
88
|
+
*
|
|
89
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const value = table_getVisibleFlatColumns(table)
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
16
96
|
declare function table_getVisibleFlatColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Column<TFeatures, TData, unknown>[];
|
|
97
|
+
/**
|
|
98
|
+
* Returns visible leaf columns for the table.
|
|
99
|
+
*
|
|
100
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const value = table_getVisibleLeafColumns(table)
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
17
107
|
declare function table_getVisibleLeafColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Column<TFeatures, TData, unknown>[];
|
|
108
|
+
/**
|
|
109
|
+
* Updates the table's column visibility state slice.
|
|
110
|
+
*
|
|
111
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* table_setColumnVisibility(table, (old) => old)
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
18
118
|
declare function table_setColumnVisibility<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: Updater<ColumnVisibilityState>): void;
|
|
119
|
+
/**
|
|
120
|
+
* Resets the table's column visibility state slice.
|
|
121
|
+
*
|
|
122
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* table_resetColumnVisibility(table)
|
|
127
|
+
* table_resetColumnVisibility(table, true)
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
19
130
|
declare function table_resetColumnVisibility<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void;
|
|
131
|
+
/**
|
|
132
|
+
* Toggles all columns visible for the table.
|
|
133
|
+
*
|
|
134
|
+
* This is the table-level convenience API used by UI controls that affect many columns or rows at once.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* table_toggleAllColumnsVisible(table)
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
20
141
|
declare function table_toggleAllColumnsVisible<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, value?: boolean): void;
|
|
142
|
+
/**
|
|
143
|
+
* Returns is all columns visible for the table.
|
|
144
|
+
*
|
|
145
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* const value = table_getIsAllColumnsVisible(table)
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
21
152
|
declare function table_getIsAllColumnsVisible<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Returns is some columns visible for the table.
|
|
155
|
+
*
|
|
156
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* const value = table_getIsSomeColumnsVisible(table)
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
22
163
|
declare function table_getIsSomeColumnsVisible<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Returns an event handler for all columns visibility handler.
|
|
166
|
+
*
|
|
167
|
+
* The handler calls the matching table toggle API and can be attached directly to checkbox or button UI.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* const value = table_getToggleAllColumnsVisibilityHandler(table)
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
23
174
|
declare function table_getToggleAllColumnsVisibilityHandler<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): (e: unknown) => void;
|
|
24
175
|
//#endregion
|
|
25
|
-
export { column_getCanHide, column_getIsVisible, column_getToggleVisibilityHandler, column_toggleVisibility, getDefaultColumnVisibilityState,
|
|
176
|
+
export { column_getCanHide, column_getIsVisible, column_getToggleVisibilityHandler, column_toggleVisibility, getDefaultColumnVisibilityState, row_getVisibleCells, row_getVisibleCellsByColumnId, table_getIsAllColumnsVisible, table_getIsSomeColumnsVisible, table_getToggleAllColumnsVisibilityHandler, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_resetColumnVisibility, table_setColumnVisibility, table_toggleAllColumnsVisible };
|
|
26
177
|
//# sourceMappingURL=columnVisibilityFeature.utils.d.cts.map
|
|
@@ -6,21 +6,172 @@ import { TableFeatures } from "../../types/TableFeatures.js";
|
|
|
6
6
|
import { Table_Internal } from "../../types/Table.js";
|
|
7
7
|
import { Cell } from "../../types/Cell.js";
|
|
8
8
|
//#region src/features/column-visibility/columnVisibilityFeature.utils.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Returns the default column visibility state.
|
|
11
|
+
*
|
|
12
|
+
* Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const initialValue = getDefaultColumnVisibilityState()
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
9
19
|
declare function getDefaultColumnVisibilityState(): ColumnVisibilityState;
|
|
20
|
+
/**
|
|
21
|
+
* Toggles visibility for a column.
|
|
22
|
+
*
|
|
23
|
+
* The update is applied through the owning table state slice and respects the feature options for that column.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* column_toggleVisibility(column)
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
10
30
|
declare function column_toggleVisibility<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>, visible?: boolean): void;
|
|
31
|
+
/**
|
|
32
|
+
* Returns is visible for a column.
|
|
33
|
+
*
|
|
34
|
+
* This derives the value from the column definition, table options, and the feature state atoms registered on the table.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const value = column_getIsVisible(column)
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
11
41
|
declare function column_getIsVisible<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Returns whether a column can use hide.
|
|
44
|
+
*
|
|
45
|
+
* This combines column options, table options, and any required accessor or feature state for the capability.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const value = column_getCanHide(column)
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
12
52
|
declare function column_getCanHide<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Returns an event handler for toggling visibility handler.
|
|
55
|
+
*
|
|
56
|
+
* The handler is intended for direct use in column header controls such as buttons or checkboxes.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const value = column_getToggleVisibilityHandler(column)
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
13
63
|
declare function column_getToggleVisibilityHandler<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>): (e: unknown) => void;
|
|
14
|
-
|
|
15
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Returns visible cells for a row.
|
|
66
|
+
*
|
|
67
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const value = row_getVisibleCells(row)
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare function row_getVisibleCells<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>>;
|
|
75
|
+
/**
|
|
76
|
+
* Returns visible cells by column id for a row.
|
|
77
|
+
*
|
|
78
|
+
* This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const value = row_getVisibleCellsByColumnId(row)
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
declare function row_getVisibleCellsByColumnId<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>): Record<string, Cell<TFeatures, TData, unknown>>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns visible flat columns for the table.
|
|
88
|
+
*
|
|
89
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const value = table_getVisibleFlatColumns(table)
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
16
96
|
declare function table_getVisibleFlatColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Column<TFeatures, TData, unknown>[];
|
|
97
|
+
/**
|
|
98
|
+
* Returns visible leaf columns for the table.
|
|
99
|
+
*
|
|
100
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const value = table_getVisibleLeafColumns(table)
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
17
107
|
declare function table_getVisibleLeafColumns<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): Column<TFeatures, TData, unknown>[];
|
|
108
|
+
/**
|
|
109
|
+
* Updates the table's column visibility state slice.
|
|
110
|
+
*
|
|
111
|
+
* The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* table_setColumnVisibility(table, (old) => old)
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
18
118
|
declare function table_setColumnVisibility<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: Updater<ColumnVisibilityState>): void;
|
|
119
|
+
/**
|
|
120
|
+
* Resets the table's column visibility state slice.
|
|
121
|
+
*
|
|
122
|
+
* By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* table_resetColumnVisibility(table)
|
|
127
|
+
* table_resetColumnVisibility(table, true)
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
19
130
|
declare function table_resetColumnVisibility<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void;
|
|
131
|
+
/**
|
|
132
|
+
* Toggles all columns visible for the table.
|
|
133
|
+
*
|
|
134
|
+
* This is the table-level convenience API used by UI controls that affect many columns or rows at once.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* table_toggleAllColumnsVisible(table)
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
20
141
|
declare function table_toggleAllColumnsVisible<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, value?: boolean): void;
|
|
142
|
+
/**
|
|
143
|
+
* Returns is all columns visible for the table.
|
|
144
|
+
*
|
|
145
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* const value = table_getIsAllColumnsVisible(table)
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
21
152
|
declare function table_getIsAllColumnsVisible<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Returns is some columns visible for the table.
|
|
155
|
+
*
|
|
156
|
+
* This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* const value = table_getIsSomeColumnsVisible(table)
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
22
163
|
declare function table_getIsSomeColumnsVisible<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Returns an event handler for all columns visibility handler.
|
|
166
|
+
*
|
|
167
|
+
* The handler calls the matching table toggle API and can be attached directly to checkbox or button UI.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* const value = table_getToggleAllColumnsVisibilityHandler(table)
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
23
174
|
declare function table_getToggleAllColumnsVisibilityHandler<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): (e: unknown) => void;
|
|
24
175
|
//#endregion
|
|
25
|
-
export { column_getCanHide, column_getIsVisible, column_getToggleVisibilityHandler, column_toggleVisibility, getDefaultColumnVisibilityState,
|
|
176
|
+
export { column_getCanHide, column_getIsVisible, column_getToggleVisibilityHandler, column_toggleVisibility, getDefaultColumnVisibilityState, row_getVisibleCells, row_getVisibleCellsByColumnId, table_getIsAllColumnsVisible, table_getIsSomeColumnsVisible, table_getToggleAllColumnsVisibilityHandler, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_resetColumnVisibility, table_setColumnVisibility, table_toggleAllColumnsVisible };
|
|
26
177
|
//# sourceMappingURL=columnVisibilityFeature.utils.d.ts.map
|