@tanstack/table-core 9.0.0-beta.5 → 9.0.0-beta.50
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/README.md +2 -0
- package/dist/core/cells/constructCell.cjs +1 -4
- package/dist/core/cells/constructCell.cjs.map +1 -1
- package/dist/core/cells/constructCell.d.cts +4 -4
- package/dist/core/cells/constructCell.d.ts +4 -4
- package/dist/core/cells/constructCell.js +1 -4
- package/dist/core/cells/constructCell.js.map +1 -1
- package/dist/core/cells/coreCellsFeature.types.d.cts +7 -7
- package/dist/core/cells/coreCellsFeature.types.d.ts +7 -7
- package/dist/core/cells/coreCellsFeature.utils.d.cts +4 -4
- package/dist/core/cells/coreCellsFeature.utils.d.ts +4 -4
- package/dist/core/columns/constructColumn.cjs +4 -5
- package/dist/core/columns/constructColumn.cjs.map +1 -1
- package/dist/core/columns/constructColumn.d.cts +3 -3
- package/dist/core/columns/constructColumn.d.ts +3 -3
- package/dist/core/columns/constructColumn.js +4 -5
- package/dist/core/columns/constructColumn.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.cjs +12 -18
- package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.js +12 -18
- package/dist/core/columns/coreColumnsFeature.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.types.d.cts +7 -7
- package/dist/core/columns/coreColumnsFeature.types.d.ts +7 -7
- package/dist/core/columns/coreColumnsFeature.utils.cjs +4 -8
- package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +9 -9
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +9 -9
- package/dist/core/columns/coreColumnsFeature.utils.js +5 -9
- package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
- package/dist/core/coreFeatures.cjs.map +1 -1
- package/dist/core/coreFeatures.d.cts +1 -1
- package/dist/core/coreFeatures.d.ts +1 -1
- package/dist/core/coreFeatures.js.map +1 -1
- package/dist/core/headers/buildHeaderGroups.cjs +1 -2
- package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
- package/dist/core/headers/buildHeaderGroups.d.cts +2 -2
- package/dist/core/headers/buildHeaderGroups.d.ts +2 -2
- package/dist/core/headers/buildHeaderGroups.js +1 -2
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/constructHeader.cjs +1 -4
- package/dist/core/headers/constructHeader.cjs.map +1 -1
- package/dist/core/headers/constructHeader.d.cts +2 -2
- package/dist/core/headers/constructHeader.d.ts +2 -2
- package/dist/core/headers/constructHeader.js +1 -4
- package/dist/core/headers/constructHeader.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.cjs +8 -11
- package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.js +8 -11
- package/dist/core/headers/coreHeadersFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.types.d.cts +6 -6
- package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -6
- package/dist/core/headers/coreHeadersFeature.utils.cjs +8 -10
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +6 -6
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +6 -6
- package/dist/core/headers/coreHeadersFeature.utils.js +8 -10
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.types.d.cts +7 -15
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +7 -15
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs +8 -26
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +16 -16
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +16 -16
- package/dist/core/row-models/coreRowModelsFeature.utils.js +8 -26
- package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
- package/dist/core/row-models/createCoreRowModel.cjs +4 -6
- package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
- package/dist/core/row-models/createCoreRowModel.d.cts +2 -2
- package/dist/core/row-models/createCoreRowModel.d.ts +2 -2
- package/dist/core/row-models/createCoreRowModel.js +5 -7
- package/dist/core/row-models/createCoreRowModel.js.map +1 -1
- package/dist/core/rows/constructRow.cjs +6 -10
- package/dist/core/rows/constructRow.cjs.map +1 -1
- package/dist/core/rows/constructRow.d.cts +2 -2
- package/dist/core/rows/constructRow.d.ts +2 -2
- package/dist/core/rows/constructRow.js +7 -10
- package/dist/core/rows/constructRow.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.cjs +18 -2
- package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.js +19 -3
- package/dist/core/rows/coreRowsFeature.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.types.d.cts +41 -7
- package/dist/core/rows/coreRowsFeature.types.d.ts +41 -7
- package/dist/core/rows/coreRowsFeature.utils.cjs +62 -8
- package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.utils.d.cts +24 -5
- package/dist/core/rows/coreRowsFeature.utils.d.ts +24 -5
- package/dist/core/rows/coreRowsFeature.utils.js +61 -10
- package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
- package/dist/core/table/constructTable.cjs +24 -14
- package/dist/core/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.d.cts +1 -1
- package/dist/core/table/constructTable.d.ts +1 -1
- package/dist/core/table/constructTable.js +24 -14
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +32 -19
- package/dist/core/table/coreTablesFeature.types.d.ts +32 -19
- package/dist/core/table/coreTablesFeature.utils.cjs +38 -14
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +10 -7
- package/dist/core/table/coreTablesFeature.utils.d.ts +10 -7
- package/dist/core/table/coreTablesFeature.utils.js +38 -14
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/experimental-worker-plugin.cjs +14 -0
- package/dist/experimental-worker-plugin.d.cts +5 -0
- package/dist/experimental-worker-plugin.d.ts +5 -0
- package/dist/experimental-worker-plugin.js +6 -0
- package/dist/features/aggregation/aggregationFeature.cjs +39 -0
- package/dist/features/aggregation/aggregationFeature.cjs.map +1 -0
- package/dist/features/aggregation/aggregationFeature.d.cts +10 -0
- package/dist/features/aggregation/aggregationFeature.d.ts +10 -0
- package/dist/features/aggregation/aggregationFeature.js +39 -0
- package/dist/features/aggregation/aggregationFeature.js.map +1 -0
- package/dist/features/aggregation/aggregationFeature.types.cjs +13 -0
- package/dist/features/aggregation/aggregationFeature.types.cjs.map +1 -0
- package/dist/features/aggregation/aggregationFeature.types.d.cts +195 -0
- package/dist/features/aggregation/aggregationFeature.types.d.ts +195 -0
- package/dist/features/aggregation/aggregationFeature.types.js +12 -0
- package/dist/features/aggregation/aggregationFeature.types.js.map +1 -0
- package/dist/features/aggregation/aggregationFeature.utils.cjs +212 -0
- package/dist/features/aggregation/aggregationFeature.utils.cjs.map +1 -0
- package/dist/features/aggregation/aggregationFeature.utils.d.cts +34 -0
- package/dist/features/aggregation/aggregationFeature.utils.d.ts +34 -0
- package/dist/features/aggregation/aggregationFeature.utils.js +206 -0
- package/dist/features/aggregation/aggregationFeature.utils.js.map +1 -0
- package/dist/features/aggregation/aggregationFns.cjs +246 -0
- package/dist/features/aggregation/aggregationFns.cjs.map +1 -0
- package/dist/features/aggregation/aggregationFns.d.cts +68 -0
- package/dist/features/aggregation/aggregationFns.d.ts +68 -0
- package/dist/features/aggregation/aggregationFns.js +235 -0
- package/dist/features/aggregation/aggregationFns.js.map +1 -0
- package/dist/features/column-faceting/columnFacetingFeature.cjs +12 -18
- package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.js +12 -18
- package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +15 -33
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +15 -33
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +23 -12
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +9 -9
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +9 -9
- package/dist/features/column-faceting/columnFacetingFeature.utils.js +24 -12
- package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs +7 -4
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.js +8 -5
- package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.cjs +10 -15
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.d.cts +2 -2
- package/dist/features/column-faceting/createFacetedRowModel.d.ts +2 -2
- package/dist/features/column-faceting/createFacetedRowModel.js +10 -15
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs +10 -6
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.js +11 -7
- package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.cjs +2 -2
- package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.js +3 -3
- package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +83 -29
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +83 -29
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +23 -17
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +18 -14
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +18 -14
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +23 -17
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.cjs +29 -25
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.cts +10 -4
- package/dist/features/column-filtering/createFilteredRowModel.d.ts +10 -4
- package/dist/features/column-filtering/createFilteredRowModel.js +30 -26
- package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
- package/dist/features/column-filtering/filterFns.cjs +399 -0
- package/dist/features/column-filtering/filterFns.cjs.map +1 -0
- package/dist/features/column-filtering/filterFns.d.cts +210 -0
- package/dist/features/column-filtering/filterFns.d.ts +210 -0
- package/dist/features/column-filtering/filterFns.js +375 -0
- package/dist/features/column-filtering/filterFns.js.map +1 -0
- package/dist/features/column-filtering/filterRowsUtils.cjs +3 -2
- package/dist/features/column-filtering/filterRowsUtils.cjs.map +1 -1
- package/dist/features/column-filtering/filterRowsUtils.js +3 -2
- package/dist/features/column-filtering/filterRowsUtils.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.cjs +4 -16
- package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.cts +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.ts +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.js +6 -18
- package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +14 -50
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +14 -50
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +6 -61
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +12 -49
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +12 -49
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +8 -60
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.cjs +37 -24
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.d.cts +6 -4
- package/dist/features/column-grouping/createGroupedRowModel.d.ts +6 -4
- package/dist/features/column-grouping/createGroupedRowModel.js +39 -26
- package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.cjs +17 -21
- package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.js +18 -22
- package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +28 -3
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +28 -3
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +35 -15
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +26 -14
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +26 -14
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +36 -17
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.cjs +124 -143
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.d.cts +6 -1
- package/dist/features/column-pinning/columnPinningFeature.d.ts +6 -1
- package/dist/features/column-pinning/columnPinningFeature.js +125 -144
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +52 -41
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +52 -41
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +161 -162
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +101 -92
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +101 -92
- package/dist/features/column-pinning/columnPinningFeature.utils.js +148 -149
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +1 -4
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +1 -4
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +84 -44
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +6 -6
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +6 -6
- package/dist/features/column-resizing/columnResizingFeature.utils.js +85 -45
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +33 -67
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.js +34 -68
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +52 -9
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +52 -9
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +88 -45
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +43 -25
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +43 -25
- package/dist/features/column-sizing/columnSizingFeature.utils.js +88 -46
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +25 -36
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.js +25 -36
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +30 -29
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +18 -18
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +18 -18
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +31 -30
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.cjs +1 -2
- package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.js +1 -2
- package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +2 -2
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +2 -2
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +6 -6
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +8 -11
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +8 -11
- package/dist/features/global-filtering/globalFilteringFeature.utils.js +6 -6
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.cjs +6 -10
- package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.d.cts +2 -2
- package/dist/features/row-expanding/createExpandedRowModel.d.ts +2 -2
- package/dist/features/row-expanding/createExpandedRowModel.js +6 -10
- package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +6 -15
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +6 -15
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +28 -26
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +10 -10
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +10 -10
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +29 -27
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.cjs +6 -10
- package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.d.cts +2 -2
- package/dist/features/row-pagination/createPaginatedRowModel.d.ts +2 -2
- package/dist/features/row-pagination/createPaginatedRowModel.js +6 -10
- package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +5 -14
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +5 -14
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +9 -15
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +17 -17
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +17 -17
- package/dist/features/row-pagination/rowPaginationFeature.utils.js +9 -15
- package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.cjs +4 -16
- package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.js +4 -16
- package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.types.d.cts +2 -2
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +2 -2
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +9 -14
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +7 -7
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +7 -7
- package/dist/features/row-pinning/rowPinningFeature.utils.js +9 -14
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs +66 -22
- package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.js +67 -23
- package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +49 -11
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +49 -11
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +128 -72
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +57 -30
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +57 -30
- package/dist/features/row-selection/rowSelectionFeature.utils.js +129 -74
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs +69 -50
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.d.cts +10 -4
- package/dist/features/row-sorting/createSortedRowModel.d.ts +10 -4
- package/dist/features/row-sorting/createSortedRowModel.js +70 -51
- package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +54 -22
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +54 -22
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +31 -17
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +16 -16
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +16 -16
- package/dist/features/row-sorting/rowSortingFeature.utils.js +31 -17
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/sortFns.cjs +226 -0
- package/dist/features/row-sorting/sortFns.cjs.map +1 -0
- package/dist/features/row-sorting/sortFns.d.cts +98 -0
- package/dist/features/row-sorting/sortFns.d.ts +98 -0
- package/dist/features/row-sorting/sortFns.js +217 -0
- package/dist/features/row-sorting/sortFns.js.map +1 -0
- package/dist/features/stockFeatures.cjs +2 -0
- package/dist/features/stockFeatures.cjs.map +1 -1
- package/dist/features/stockFeatures.d.cts +2 -0
- package/dist/features/stockFeatures.d.ts +2 -0
- package/dist/features/stockFeatures.js +2 -0
- package/dist/features/stockFeatures.js.map +1 -1
- package/dist/flex-render.d.cts +1 -1
- package/dist/flex-render.d.ts +1 -1
- package/dist/helpers/columnHelper.cjs.map +1 -1
- package/dist/helpers/columnHelper.d.cts +2 -2
- package/dist/helpers/columnHelper.d.ts +2 -2
- package/dist/helpers/columnHelper.js.map +1 -1
- package/dist/helpers/metaHelper.cjs +30 -0
- package/dist/helpers/metaHelper.cjs.map +1 -0
- package/dist/helpers/metaHelper.d.cts +26 -0
- package/dist/helpers/metaHelper.d.ts +26 -0
- package/dist/helpers/metaHelper.js +29 -0
- package/dist/helpers/metaHelper.js.map +1 -0
- package/dist/helpers/tableFeatures.cjs +32 -3
- package/dist/helpers/tableFeatures.cjs.map +1 -1
- package/dist/helpers/tableFeatures.d.cts +34 -5
- package/dist/helpers/tableFeatures.d.ts +34 -5
- package/dist/helpers/tableFeatures.js +32 -3
- package/dist/helpers/tableFeatures.js.map +1 -1
- package/dist/index.cjs +23 -3
- package/dist/index.d.cts +31 -28
- package/dist/index.d.ts +31 -28
- package/dist/index.js +8 -5
- package/dist/static-functions.cjs +30 -19
- package/dist/static-functions.d.cts +8 -7
- package/dist/static-functions.d.ts +8 -7
- package/dist/static-functions.js +8 -7
- package/dist/store-reactivity-bindings.cjs +3 -3
- package/dist/store-reactivity-bindings.cjs.map +1 -1
- package/dist/store-reactivity-bindings.d.cts +1 -1
- package/dist/store-reactivity-bindings.d.ts +1 -1
- package/dist/store-reactivity-bindings.js +3 -3
- package/dist/store-reactivity-bindings.js.map +1 -1
- package/dist/types/Cell.d.cts +4 -2
- package/dist/types/Cell.d.ts +4 -2
- package/dist/types/Column.d.cts +15 -15
- package/dist/types/Column.d.ts +15 -15
- package/dist/types/ColumnDef.d.cts +30 -14
- package/dist/types/ColumnDef.d.ts +30 -14
- package/dist/types/Header.d.cts +2 -2
- package/dist/types/Header.d.ts +2 -2
- package/dist/types/HeaderGroup.d.cts +2 -2
- package/dist/types/HeaderGroup.d.ts +2 -2
- package/dist/types/Row.d.cts +6 -4
- package/dist/types/Row.d.ts +6 -4
- package/dist/types/RowModel.d.cts +11 -23
- package/dist/types/RowModel.d.ts +11 -23
- package/dist/types/RowModelFns.d.cts +4 -4
- package/dist/types/RowModelFns.d.ts +4 -4
- package/dist/types/Table.d.cts +26 -31
- package/dist/types/Table.d.ts +26 -31
- package/dist/types/TableFeatures.d.cts +350 -22
- package/dist/types/TableFeatures.d.ts +350 -22
- package/dist/types/TableOptions.d.cts +22 -14
- package/dist/types/TableOptions.d.ts +22 -14
- package/dist/types/TableState.d.cts +6 -6
- package/dist/types/TableState.d.ts +6 -6
- package/dist/types/type-utils.d.cts +8 -1
- package/dist/types/type-utils.d.ts +8 -1
- package/dist/utils.cjs +51 -29
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +30 -8
- package/dist/utils.d.ts +30 -8
- package/dist/utils.js +49 -30
- package/dist/utils.js.map +1 -1
- package/dist/worker/createTableWorker.cjs +189 -0
- package/dist/worker/createTableWorker.cjs.map +1 -0
- package/dist/worker/createTableWorker.d.cts +102 -0
- package/dist/worker/createTableWorker.d.ts +102 -0
- package/dist/worker/createTableWorker.js +186 -0
- package/dist/worker/createTableWorker.js.map +1 -0
- package/dist/worker/createWorkerRowModel.cjs +78 -0
- package/dist/worker/createWorkerRowModel.cjs.map +1 -0
- package/dist/worker/createWorkerRowModel.d.cts +42 -0
- package/dist/worker/createWorkerRowModel.d.ts +42 -0
- package/dist/worker/createWorkerRowModel.js +78 -0
- package/dist/worker/createWorkerRowModel.js.map +1 -0
- package/dist/worker/initTableWorker.cjs +100 -0
- package/dist/worker/initTableWorker.cjs.map +1 -0
- package/dist/worker/initTableWorker.d.cts +33 -0
- package/dist/worker/initTableWorker.d.ts +33 -0
- package/dist/worker/initTableWorker.js +100 -0
- package/dist/worker/initTableWorker.js.map +1 -0
- package/dist/worker/rebuildRowModel.cjs +72 -0
- package/dist/worker/rebuildRowModel.cjs.map +1 -0
- package/dist/worker/rebuildRowModel.d.cts +9 -0
- package/dist/worker/rebuildRowModel.d.ts +9 -0
- package/dist/worker/rebuildRowModel.js +72 -0
- package/dist/worker/rebuildRowModel.js.map +1 -0
- package/dist/worker/serializeRowModel.cjs +53 -0
- package/dist/worker/serializeRowModel.cjs.map +1 -0
- package/dist/worker/serializeRowModel.js +52 -0
- package/dist/worker/serializeRowModel.js.map +1 -0
- package/dist/worker/tableWorkerProtocol.cjs +29 -0
- package/dist/worker/tableWorkerProtocol.cjs.map +1 -0
- package/dist/worker/tableWorkerProtocol.d.cts +88 -0
- package/dist/worker/tableWorkerProtocol.d.ts +88 -0
- package/dist/worker/tableWorkerProtocol.js +27 -0
- package/dist/worker/tableWorkerProtocol.js.map +1 -0
- package/package.json +8 -3
- package/skills/aggregation/SKILL.md +141 -0
- package/skills/api-not-found/SKILL.md +113 -0
- package/skills/client-vs-server/SKILL.md +164 -0
- package/skills/column-faceting/SKILL.md +97 -0
- package/skills/column-filtering/SKILL.md +87 -0
- package/skills/column-ordering/SKILL.md +75 -0
- package/skills/column-pinning/SKILL.md +89 -0
- package/skills/column-resizing/SKILL.md +91 -0
- package/skills/column-sizing/SKILL.md +72 -0
- package/skills/column-visibility/SKILL.md +75 -0
- package/skills/core/SKILL.md +175 -0
- package/skills/custom-features/SKILL.md +235 -0
- package/skills/expanding/SKILL.md +80 -0
- package/skills/global-filtering/SKILL.md +84 -0
- package/skills/grouping/SKILL.md +51 -401
- package/skills/migrate-v8-to-v9/SKILL.md +274 -416
- package/skills/pagination/SKILL.md +37 -344
- package/skills/row-pinning/SKILL.md +47 -234
- package/skills/row-selection/SKILL.md +75 -302
- package/skills/sorting/SKILL.md +45 -303
- package/skills/table-features/SKILL.md +159 -0
- package/skills/typescript/SKILL.md +126 -0
- package/src/core/cells/coreCellsFeature.types.ts +6 -6
- package/src/core/columns/constructColumn.ts +6 -0
- package/src/core/columns/coreColumnsFeature.types.ts +8 -8
- package/src/core/columns/coreColumnsFeature.utils.ts +4 -4
- package/src/core/coreFeatures.ts +1 -1
- package/src/core/headers/buildHeaderGroups.ts +4 -2
- package/src/core/headers/coreHeadersFeature.types.ts +12 -12
- package/src/core/headers/coreHeadersFeature.utils.ts +7 -8
- package/src/core/row-models/coreRowModelsFeature.types.ts +6 -20
- package/src/core/row-models/coreRowModelsFeature.utils.ts +8 -8
- package/src/core/row-models/createCoreRowModel.ts +7 -6
- package/src/core/rows/constructRow.ts +4 -2
- package/src/core/rows/coreRowsFeature.ts +21 -0
- package/src/core/rows/coreRowsFeature.types.ts +45 -8
- package/src/core/rows/coreRowsFeature.utils.ts +93 -5
- package/src/core/table/constructTable.ts +44 -6
- package/src/core/table/coreTablesFeature.types.ts +45 -20
- package/src/core/table/coreTablesFeature.utils.ts +59 -19
- package/src/experimental-worker-plugin.ts +22 -0
- package/src/features/aggregation/aggregationFeature.ts +60 -0
- package/src/features/aggregation/aggregationFeature.types.ts +339 -0
- package/src/features/aggregation/aggregationFeature.utils.ts +430 -0
- package/src/features/aggregation/aggregationFns.ts +345 -0
- package/src/features/column-faceting/columnFacetingFeature.types.ts +17 -48
- package/src/features/column-faceting/columnFacetingFeature.utils.ts +53 -18
- package/src/features/column-faceting/createFacetedMinMaxValues.ts +33 -7
- package/src/features/column-faceting/createFacetedRowModel.ts +8 -1
- package/src/features/column-faceting/createFacetedUniqueValues.ts +41 -10
- package/src/features/column-filtering/columnFilteringFeature.ts +3 -2
- package/src/features/column-filtering/columnFilteringFeature.types.ts +117 -41
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +37 -23
- package/src/features/column-filtering/createFilteredRowModel.ts +28 -17
- package/src/features/column-filtering/filterFns.ts +533 -0
- package/src/features/column-filtering/filterRowsUtils.ts +3 -2
- package/src/features/column-grouping/columnGroupingFeature.ts +3 -21
- package/src/features/column-grouping/columnGroupingFeature.types.ts +21 -95
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +4 -87
- package/src/features/column-grouping/createGroupedRowModel.ts +46 -45
- package/src/features/column-ordering/columnOrderingFeature.ts +12 -7
- package/src/features/column-ordering/columnOrderingFeature.types.ts +29 -3
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +59 -8
- package/src/features/column-pinning/columnPinningFeature.ts +76 -59
- package/src/features/column-pinning/columnPinningFeature.types.ts +53 -42
- package/src/features/column-pinning/columnPinningFeature.utils.ts +184 -170
- package/src/features/column-resizing/columnResizingFeature.types.ts +1 -4
- package/src/features/column-resizing/columnResizingFeature.utils.ts +120 -52
- package/src/features/column-sizing/columnSizingFeature.ts +24 -24
- package/src/features/column-sizing/columnSizingFeature.types.ts +53 -8
- package/src/features/column-sizing/columnSizingFeature.utils.ts +143 -62
- package/src/features/column-visibility/columnVisibilityFeature.ts +4 -0
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +4 -4
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +48 -30
- package/src/features/global-filtering/globalFilteringFeature.types.ts +4 -4
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +13 -5
- package/src/features/row-expanding/rowExpandingFeature.types.ts +8 -23
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +38 -13
- package/src/features/row-pagination/createPaginatedRowModel.ts +1 -1
- package/src/features/row-pagination/rowPaginationFeature.types.ts +6 -21
- package/src/features/row-pagination/rowPaginationFeature.utils.ts +1 -1
- package/src/features/row-pinning/rowPinningFeature.types.ts +4 -4
- package/src/features/row-selection/rowSelectionFeature.ts +53 -3
- package/src/features/row-selection/rowSelectionFeature.types.ts +54 -10
- package/src/features/row-selection/rowSelectionFeature.utils.ts +273 -91
- package/src/features/row-sorting/createSortedRowModel.ts +107 -75
- package/src/features/row-sorting/rowSortingFeature.types.ts +87 -34
- package/src/features/row-sorting/rowSortingFeature.utils.ts +49 -23
- package/src/features/row-sorting/sortFns.ts +366 -0
- package/src/features/stockFeatures.ts +3 -0
- package/src/helpers/columnHelper.ts +4 -4
- package/src/helpers/metaHelper.ts +24 -0
- package/src/helpers/tableFeatures.ts +37 -5
- package/src/index.ts +8 -8
- package/src/static-functions.ts +1 -0
- package/src/store-reactivity-bindings.ts +1 -1
- package/src/types/Cell.ts +4 -2
- package/src/types/Column.ts +13 -9
- package/src/types/ColumnDef.ts +40 -10
- package/src/types/Header.ts +2 -2
- package/src/types/HeaderGroup.ts +6 -6
- package/src/types/Row.ts +6 -4
- package/src/types/RowModel.ts +19 -74
- package/src/types/RowModelFns.ts +10 -10
- package/src/types/Table.ts +52 -27
- package/src/types/TableFeatures.ts +392 -14
- package/src/types/TableOptions.ts +67 -14
- package/src/types/TableState.ts +15 -1
- package/src/types/type-utils.ts +8 -0
- package/src/utils.ts +60 -8
- package/src/worker/createTableWorker.ts +357 -0
- package/src/worker/createWorkerRowModel.ts +121 -0
- package/src/worker/initTableWorker.ts +164 -0
- package/src/worker/rebuildRowModel.ts +120 -0
- package/src/worker/serializeRowModel.ts +80 -0
- package/src/worker/tableWorkerProtocol.ts +105 -0
- package/dist/fns/aggregationFns.cjs +0 -161
- package/dist/fns/aggregationFns.cjs.map +0 -1
- package/dist/fns/aggregationFns.d.cts +0 -85
- package/dist/fns/aggregationFns.d.ts +0 -85
- package/dist/fns/aggregationFns.js +0 -151
- package/dist/fns/aggregationFns.js.map +0 -1
- package/dist/fns/filterFns.cjs +0 -201
- package/dist/fns/filterFns.cjs.map +0 -1
- package/dist/fns/filterFns.d.cts +0 -167
- package/dist/fns/filterFns.d.ts +0 -167
- package/dist/fns/filterFns.js +0 -185
- package/dist/fns/filterFns.js.map +0 -1
- package/dist/fns/sortFns.cjs +0 -118
- package/dist/fns/sortFns.cjs.map +0 -1
- package/dist/fns/sortFns.d.cts +0 -65
- package/dist/fns/sortFns.d.ts +0 -65
- package/dist/fns/sortFns.js +0 -110
- package/dist/fns/sortFns.js.map +0 -1
- package/skills/column-definitions/SKILL.md +0 -333
- package/skills/column-layout/SKILL.md +0 -328
- package/skills/column-layout/references/subsystems.md +0 -220
- package/skills/customizing-feature-behavior/SKILL.md +0 -416
- package/skills/filtering/SKILL.md +0 -357
- package/skills/filtering/references/faceting-and-fuzzy.md +0 -191
- package/skills/row-expanding/SKILL.md +0 -348
- package/skills/setup/SKILL.md +0 -400
- package/skills/state-management/SKILL.md +0 -388
- package/src/fns/aggregationFns.ts +0 -245
- package/src/fns/filterFns.ts +0 -382
- package/src/fns/sortFns.ts +0 -217
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterRowsUtils.cjs","names":["constructRow"],"sources":["../../../src/features/column-filtering/filterRowsUtils.ts"],"sourcesContent":["import { constructRow } from '../../core/rows/constructRow'\nimport type { Row_ColumnFiltering } from './columnFilteringFeature.types'\nimport type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'\nimport type { Row } from '../../types/Row'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Filters a row model with the supplied row predicate.\n *\n * The helper supports both filtering from leaf rows upward and filtering parents before descendants, depending on table options.\n */\nexport function filterRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rows: Array<Row<TFeatures, TData>>,\n filterRowImpl: (row: Row<TFeatures, TData>) => any,\n table: Table_Internal<TFeatures, TData>,\n) {\n if (table.options.filterFromLeafRows) {\n return filterRowModelFromLeafs(rows, filterRowImpl, table)\n }\n\n return filterRowModelFromRoot(rows, filterRowImpl, table)\n}\n\nfunction filterRowModelFromLeafs<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowsToFilter: Array<Row<TFeatures, TData>>,\n filterRow: (\n row: Row<TFeatures, TData>,\n ) => Array<Row<TFeatures, TData>> | undefined,\n table: Table_Internal<TFeatures, TData>,\n): RowModel<TFeatures, TData> {\n const newFilteredFlatRows: Array<Row<TFeatures, TData>> = []\n const newFilteredRowsById
|
|
1
|
+
{"version":3,"file":"filterRowsUtils.cjs","names":["makeObjectMap","constructRow"],"sources":["../../../src/features/column-filtering/filterRowsUtils.ts"],"sourcesContent":["import { constructRow } from '../../core/rows/constructRow'\nimport { makeObjectMap } from '../../utils'\nimport type { Row_ColumnFiltering } from './columnFilteringFeature.types'\nimport type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'\nimport type { Row } from '../../types/Row'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Filters a row model with the supplied row predicate.\n *\n * The helper supports both filtering from leaf rows upward and filtering parents before descendants, depending on table options.\n */\nexport function filterRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rows: Array<Row<TFeatures, TData>>,\n filterRowImpl: (row: Row<TFeatures, TData>) => any,\n table: Table_Internal<TFeatures, TData>,\n) {\n if (table.options.filterFromLeafRows) {\n return filterRowModelFromLeafs(rows, filterRowImpl, table)\n }\n\n return filterRowModelFromRoot(rows, filterRowImpl, table)\n}\n\nfunction filterRowModelFromLeafs<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowsToFilter: Array<Row<TFeatures, TData>>,\n filterRow: (\n row: Row<TFeatures, TData>,\n ) => Array<Row<TFeatures, TData>> | undefined,\n table: Table_Internal<TFeatures, TData>,\n): RowModel<TFeatures, TData> {\n const newFilteredFlatRows: Array<Row<TFeatures, TData>> = []\n const newFilteredRowsById = makeObjectMap<Row<TFeatures, TData>>()\n const maxDepth = table.options.maxLeafRowFilterDepth ?? 100\n\n const recurseFilterRows = (\n rowsToFilter: Array<\n Row<TFeatures, TData> & Partial<Row_ColumnFiltering<TFeatures, TData>>\n >,\n depth = 0,\n ) => {\n const filteredRows: Array<Row<TFeatures, TData>> &\n Partial<Row_ColumnFiltering<TFeatures, TData>> = []\n\n // Filter from children up first\n for (let row of rowsToFilter) {\n const newRow = constructRow(\n table,\n row.id,\n row.original,\n row.index,\n row.depth,\n undefined,\n row.parentId,\n ) as Row<TFeatures, TData> &\n Partial<Row_ColumnFiltering<TFeatures, TData>>\n newRow.columnFilters = row.columnFilters\n\n if (row.subRows.length && depth < maxDepth) {\n newRow.subRows = recurseFilterRows(row.subRows, depth + 1)\n row = newRow\n\n if (filterRow(row) && !newRow.subRows.length) {\n filteredRows.push(row)\n newFilteredRowsById[row.id] = row\n newFilteredFlatRows.push(row)\n continue\n }\n\n if (filterRow(row) || newRow.subRows.length) {\n filteredRows.push(row)\n newFilteredRowsById[row.id] = row\n newFilteredFlatRows.push(row)\n continue\n }\n } else {\n row = newRow\n if (filterRow(row)) {\n filteredRows.push(row)\n newFilteredRowsById[row.id] = row\n newFilteredFlatRows.push(row)\n }\n }\n }\n\n return filteredRows\n }\n\n return {\n rows: recurseFilterRows(rowsToFilter),\n flatRows: newFilteredFlatRows,\n rowsById: newFilteredRowsById,\n }\n}\n\nfunction filterRowModelFromRoot<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowsToFilter: Array<Row<TFeatures, TData>>,\n filterRow: (row: Row<TFeatures, TData>) => any,\n table: Table_Internal<TFeatures, TData>,\n): RowModel<TFeatures, TData> {\n const newFilteredFlatRows: Array<Row<TFeatures, TData>> = []\n const newFilteredRowsById = makeObjectMap<Row<TFeatures, TData>>()\n const maxDepth = table.options.maxLeafRowFilterDepth ?? 100\n\n // Filters top level and nested rows\n const recurseFilterRows = (\n rowsToFilter: Array<Row<TFeatures, TData>>,\n depth = 0,\n ) => {\n // Filter from parents downward first\n\n const filteredRows: Array<Row<TFeatures, TData>> = []\n\n // Apply the filter to any subRows\n for (let row of rowsToFilter) {\n const pass = filterRow(row)\n\n if (pass) {\n if (row.subRows.length && depth < maxDepth) {\n const newRow = constructRow(\n table,\n row.id,\n row.original,\n row.index,\n row.depth,\n undefined,\n row.parentId,\n )\n newRow.subRows = recurseFilterRows(row.subRows, depth + 1)\n row = newRow\n }\n\n filteredRows.push(row)\n newFilteredFlatRows.push(row)\n newFilteredRowsById[row.id] = row\n }\n }\n\n return filteredRows\n }\n\n return {\n rows: recurseFilterRows(rowsToFilter),\n flatRows: newFilteredFlatRows,\n rowsById: newFilteredRowsById,\n }\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgB,WAId,MACA,eACA,OACA;CACA,IAAI,MAAM,QAAQ,oBAChB,OAAO,wBAAwB,MAAM,eAAe,KAAK;CAG3D,OAAO,uBAAuB,MAAM,eAAe,KAAK;AAC1D;AAEA,SAAS,wBAIP,cACA,WAGA,OAC4B;CAC5B,MAAM,sBAAoD,CAAC;CAC3D,MAAM,sBAAsBA,4BAAqC;CACjE,MAAM,WAAW,MAAM,QAAQ,yBAAyB;CAExD,MAAM,qBACJ,cAGA,QAAQ,MACL;EACH,MAAM,eAC6C,CAAC;EAGpD,KAAK,IAAI,OAAO,cAAc;GAC5B,MAAM,SAASC,kCACb,OACA,IAAI,IACJ,IAAI,UACJ,IAAI,OACJ,IAAI,OACJ,QACA,IAAI,QACN;GAEA,OAAO,gBAAgB,IAAI;GAE3B,IAAI,IAAI,QAAQ,UAAU,QAAQ,UAAU;IAC1C,OAAO,UAAU,kBAAkB,IAAI,SAAS,QAAQ,CAAC;IACzD,MAAM;IAEN,IAAI,UAAU,GAAG,KAAK,CAAC,OAAO,QAAQ,QAAQ;KAC5C,aAAa,KAAK,GAAG;KACrB,oBAAoB,IAAI,MAAM;KAC9B,oBAAoB,KAAK,GAAG;KAC5B;IACF;IAEA,IAAI,UAAU,GAAG,KAAK,OAAO,QAAQ,QAAQ;KAC3C,aAAa,KAAK,GAAG;KACrB,oBAAoB,IAAI,MAAM;KAC9B,oBAAoB,KAAK,GAAG;KAC5B;IACF;GACF,OAAO;IACL,MAAM;IACN,IAAI,UAAU,GAAG,GAAG;KAClB,aAAa,KAAK,GAAG;KACrB,oBAAoB,IAAI,MAAM;KAC9B,oBAAoB,KAAK,GAAG;IAC9B;GACF;EACF;EAEA,OAAO;CACT;CAEA,OAAO;EACL,MAAM,kBAAkB,YAAY;EACpC,UAAU;EACV,UAAU;CACZ;AACF;AAEA,SAAS,uBAIP,cACA,WACA,OAC4B;CAC5B,MAAM,sBAAoD,CAAC;CAC3D,MAAM,sBAAsBD,4BAAqC;CACjE,MAAM,WAAW,MAAM,QAAQ,yBAAyB;CAGxD,MAAM,qBACJ,cACA,QAAQ,MACL;EAGH,MAAM,eAA6C,CAAC;EAGpD,KAAK,IAAI,OAAO,cAGd,IAFa,UAAU,GAEhB,GAAG;GACR,IAAI,IAAI,QAAQ,UAAU,QAAQ,UAAU;IAC1C,MAAM,SAASC,kCACb,OACA,IAAI,IACJ,IAAI,UACJ,IAAI,OACJ,IAAI,OACJ,QACA,IAAI,QACN;IACA,OAAO,UAAU,kBAAkB,IAAI,SAAS,QAAQ,CAAC;IACzD,MAAM;GACR;GAEA,aAAa,KAAK,GAAG;GACrB,oBAAoB,KAAK,GAAG;GAC5B,oBAAoB,IAAI,MAAM;EAChC;EAGF,OAAO;CACT;CAEA,OAAO;EACL,MAAM,kBAAkB,YAAY;EACpC,UAAU;EACV,UAAU;CACZ;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { makeObjectMap } from "../../utils.js";
|
|
1
2
|
import { constructRow } from "../../core/rows/constructRow.js";
|
|
2
3
|
|
|
3
4
|
//#region src/features/column-filtering/filterRowsUtils.ts
|
|
@@ -12,7 +13,7 @@ function filterRows(rows, filterRowImpl, table) {
|
|
|
12
13
|
}
|
|
13
14
|
function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
|
|
14
15
|
const newFilteredFlatRows = [];
|
|
15
|
-
const newFilteredRowsById =
|
|
16
|
+
const newFilteredRowsById = makeObjectMap();
|
|
16
17
|
const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
|
|
17
18
|
const recurseFilterRows = (rowsToFilter, depth = 0) => {
|
|
18
19
|
const filteredRows = [];
|
|
@@ -53,7 +54,7 @@ function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
|
|
|
53
54
|
}
|
|
54
55
|
function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
|
|
55
56
|
const newFilteredFlatRows = [];
|
|
56
|
-
const newFilteredRowsById =
|
|
57
|
+
const newFilteredRowsById = makeObjectMap();
|
|
57
58
|
const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
|
|
58
59
|
const recurseFilterRows = (rowsToFilter, depth = 0) => {
|
|
59
60
|
const filteredRows = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterRowsUtils.js","names":[],"sources":["../../../src/features/column-filtering/filterRowsUtils.ts"],"sourcesContent":["import { constructRow } from '../../core/rows/constructRow'\nimport type { Row_ColumnFiltering } from './columnFilteringFeature.types'\nimport type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'\nimport type { Row } from '../../types/Row'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Filters a row model with the supplied row predicate.\n *\n * The helper supports both filtering from leaf rows upward and filtering parents before descendants, depending on table options.\n */\nexport function filterRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rows: Array<Row<TFeatures, TData>>,\n filterRowImpl: (row: Row<TFeatures, TData>) => any,\n table: Table_Internal<TFeatures, TData>,\n) {\n if (table.options.filterFromLeafRows) {\n return filterRowModelFromLeafs(rows, filterRowImpl, table)\n }\n\n return filterRowModelFromRoot(rows, filterRowImpl, table)\n}\n\nfunction filterRowModelFromLeafs<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowsToFilter: Array<Row<TFeatures, TData>>,\n filterRow: (\n row: Row<TFeatures, TData>,\n ) => Array<Row<TFeatures, TData>> | undefined,\n table: Table_Internal<TFeatures, TData>,\n): RowModel<TFeatures, TData> {\n const newFilteredFlatRows: Array<Row<TFeatures, TData>> = []\n const newFilteredRowsById
|
|
1
|
+
{"version":3,"file":"filterRowsUtils.js","names":[],"sources":["../../../src/features/column-filtering/filterRowsUtils.ts"],"sourcesContent":["import { constructRow } from '../../core/rows/constructRow'\nimport { makeObjectMap } from '../../utils'\nimport type { Row_ColumnFiltering } from './columnFilteringFeature.types'\nimport type { RowModel } from '../../core/row-models/coreRowModelsFeature.types'\nimport type { Row } from '../../types/Row'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Filters a row model with the supplied row predicate.\n *\n * The helper supports both filtering from leaf rows upward and filtering parents before descendants, depending on table options.\n */\nexport function filterRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rows: Array<Row<TFeatures, TData>>,\n filterRowImpl: (row: Row<TFeatures, TData>) => any,\n table: Table_Internal<TFeatures, TData>,\n) {\n if (table.options.filterFromLeafRows) {\n return filterRowModelFromLeafs(rows, filterRowImpl, table)\n }\n\n return filterRowModelFromRoot(rows, filterRowImpl, table)\n}\n\nfunction filterRowModelFromLeafs<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowsToFilter: Array<Row<TFeatures, TData>>,\n filterRow: (\n row: Row<TFeatures, TData>,\n ) => Array<Row<TFeatures, TData>> | undefined,\n table: Table_Internal<TFeatures, TData>,\n): RowModel<TFeatures, TData> {\n const newFilteredFlatRows: Array<Row<TFeatures, TData>> = []\n const newFilteredRowsById = makeObjectMap<Row<TFeatures, TData>>()\n const maxDepth = table.options.maxLeafRowFilterDepth ?? 100\n\n const recurseFilterRows = (\n rowsToFilter: Array<\n Row<TFeatures, TData> & Partial<Row_ColumnFiltering<TFeatures, TData>>\n >,\n depth = 0,\n ) => {\n const filteredRows: Array<Row<TFeatures, TData>> &\n Partial<Row_ColumnFiltering<TFeatures, TData>> = []\n\n // Filter from children up first\n for (let row of rowsToFilter) {\n const newRow = constructRow(\n table,\n row.id,\n row.original,\n row.index,\n row.depth,\n undefined,\n row.parentId,\n ) as Row<TFeatures, TData> &\n Partial<Row_ColumnFiltering<TFeatures, TData>>\n newRow.columnFilters = row.columnFilters\n\n if (row.subRows.length && depth < maxDepth) {\n newRow.subRows = recurseFilterRows(row.subRows, depth + 1)\n row = newRow\n\n if (filterRow(row) && !newRow.subRows.length) {\n filteredRows.push(row)\n newFilteredRowsById[row.id] = row\n newFilteredFlatRows.push(row)\n continue\n }\n\n if (filterRow(row) || newRow.subRows.length) {\n filteredRows.push(row)\n newFilteredRowsById[row.id] = row\n newFilteredFlatRows.push(row)\n continue\n }\n } else {\n row = newRow\n if (filterRow(row)) {\n filteredRows.push(row)\n newFilteredRowsById[row.id] = row\n newFilteredFlatRows.push(row)\n }\n }\n }\n\n return filteredRows\n }\n\n return {\n rows: recurseFilterRows(rowsToFilter),\n flatRows: newFilteredFlatRows,\n rowsById: newFilteredRowsById,\n }\n}\n\nfunction filterRowModelFromRoot<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n rowsToFilter: Array<Row<TFeatures, TData>>,\n filterRow: (row: Row<TFeatures, TData>) => any,\n table: Table_Internal<TFeatures, TData>,\n): RowModel<TFeatures, TData> {\n const newFilteredFlatRows: Array<Row<TFeatures, TData>> = []\n const newFilteredRowsById = makeObjectMap<Row<TFeatures, TData>>()\n const maxDepth = table.options.maxLeafRowFilterDepth ?? 100\n\n // Filters top level and nested rows\n const recurseFilterRows = (\n rowsToFilter: Array<Row<TFeatures, TData>>,\n depth = 0,\n ) => {\n // Filter from parents downward first\n\n const filteredRows: Array<Row<TFeatures, TData>> = []\n\n // Apply the filter to any subRows\n for (let row of rowsToFilter) {\n const pass = filterRow(row)\n\n if (pass) {\n if (row.subRows.length && depth < maxDepth) {\n const newRow = constructRow(\n table,\n row.id,\n row.original,\n row.index,\n row.depth,\n undefined,\n row.parentId,\n )\n newRow.subRows = recurseFilterRows(row.subRows, depth + 1)\n row = newRow\n }\n\n filteredRows.push(row)\n newFilteredFlatRows.push(row)\n newFilteredRowsById[row.id] = row\n }\n }\n\n return filteredRows\n }\n\n return {\n rows: recurseFilterRows(rowsToFilter),\n flatRows: newFilteredFlatRows,\n rowsById: newFilteredRowsById,\n }\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgB,WAId,MACA,eACA,OACA;CACA,IAAI,MAAM,QAAQ,oBAChB,OAAO,wBAAwB,MAAM,eAAe,KAAK;CAG3D,OAAO,uBAAuB,MAAM,eAAe,KAAK;AAC1D;AAEA,SAAS,wBAIP,cACA,WAGA,OAC4B;CAC5B,MAAM,sBAAoD,CAAC;CAC3D,MAAM,sBAAsB,cAAqC;CACjE,MAAM,WAAW,MAAM,QAAQ,yBAAyB;CAExD,MAAM,qBACJ,cAGA,QAAQ,MACL;EACH,MAAM,eAC6C,CAAC;EAGpD,KAAK,IAAI,OAAO,cAAc;GAC5B,MAAM,SAAS,aACb,OACA,IAAI,IACJ,IAAI,UACJ,IAAI,OACJ,IAAI,OACJ,QACA,IAAI,QACN;GAEA,OAAO,gBAAgB,IAAI;GAE3B,IAAI,IAAI,QAAQ,UAAU,QAAQ,UAAU;IAC1C,OAAO,UAAU,kBAAkB,IAAI,SAAS,QAAQ,CAAC;IACzD,MAAM;IAEN,IAAI,UAAU,GAAG,KAAK,CAAC,OAAO,QAAQ,QAAQ;KAC5C,aAAa,KAAK,GAAG;KACrB,oBAAoB,IAAI,MAAM;KAC9B,oBAAoB,KAAK,GAAG;KAC5B;IACF;IAEA,IAAI,UAAU,GAAG,KAAK,OAAO,QAAQ,QAAQ;KAC3C,aAAa,KAAK,GAAG;KACrB,oBAAoB,IAAI,MAAM;KAC9B,oBAAoB,KAAK,GAAG;KAC5B;IACF;GACF,OAAO;IACL,MAAM;IACN,IAAI,UAAU,GAAG,GAAG;KAClB,aAAa,KAAK,GAAG;KACrB,oBAAoB,IAAI,MAAM;KAC9B,oBAAoB,KAAK,GAAG;IAC9B;GACF;EACF;EAEA,OAAO;CACT;CAEA,OAAO;EACL,MAAM,kBAAkB,YAAY;EACpC,UAAU;EACV,UAAU;CACZ;AACF;AAEA,SAAS,uBAIP,cACA,WACA,OAC4B;CAC5B,MAAM,sBAAoD,CAAC;CAC3D,MAAM,sBAAsB,cAAqC;CACjE,MAAM,WAAW,MAAM,QAAQ,yBAAyB;CAGxD,MAAM,qBACJ,cACA,QAAQ,MACL;EAGH,MAAM,eAA6C,CAAC;EAGpD,KAAK,IAAI,OAAO,cAGd,IAFa,UAAU,GAEhB,GAAG;GACR,IAAI,IAAI,QAAQ,UAAU,QAAQ,UAAU;IAC1C,MAAM,SAAS,aACb,OACA,IAAI,IACJ,IAAI,UACJ,IAAI,OACJ,IAAI,OACJ,QACA,IAAI,QACN;IACA,OAAO,UAAU,kBAAkB,IAAI,SAAS,QAAQ,CAAC;IACzD,MAAM;GACR;GAEA,aAAa,KAAK,GAAG;GACrB,oBAAoB,KAAK,GAAG;GAC5B,oBAAoB,IAAI,MAAM;EAChC;EAGF,OAAO;CACT;CAEA,OAAO;EACL,MAAM,kBAAkB,YAAY;EACpC,UAAU;EACV,UAAU;CACZ;AACF"}
|
|
@@ -3,7 +3,7 @@ const require_columnGroupingFeature_utils = require('./columnGroupingFeature.uti
|
|
|
3
3
|
|
|
4
4
|
//#region src/features/column-grouping/columnGroupingFeature.ts
|
|
5
5
|
/**
|
|
6
|
-
* Feature that adds column grouping state
|
|
6
|
+
* Feature that adds column grouping state and grouped row APIs.
|
|
7
7
|
*/
|
|
8
8
|
const columnGroupingFeature = {
|
|
9
9
|
getInitialState: (initialState) => {
|
|
@@ -12,15 +12,6 @@ const columnGroupingFeature = {
|
|
|
12
12
|
...initialState
|
|
13
13
|
};
|
|
14
14
|
},
|
|
15
|
-
getDefaultColumnDef: () => {
|
|
16
|
-
return {
|
|
17
|
-
aggregatedCell: ({ getValue }) => {
|
|
18
|
-
var _getValue, _getValue$toString;
|
|
19
|
-
return ((_getValue = getValue()) === null || _getValue === void 0 || (_getValue$toString = _getValue.toString) === null || _getValue$toString === void 0 ? void 0 : _getValue$toString.call(_getValue)) ?? null;
|
|
20
|
-
},
|
|
21
|
-
aggregationFn: "auto"
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
15
|
getDefaultTableOptions: (table) => {
|
|
25
16
|
return {
|
|
26
17
|
onGroupingChange: require_utils.makeStateUpdater("grouping", table),
|
|
@@ -30,8 +21,7 @@ const columnGroupingFeature = {
|
|
|
30
21
|
assignCellPrototype: (prototype, table) => {
|
|
31
22
|
require_utils.assignPrototypeAPIs("columnGroupingFeature", prototype, table, {
|
|
32
23
|
cell_getIsGrouped: { fn: (cell) => require_columnGroupingFeature_utils.cell_getIsGrouped(cell) },
|
|
33
|
-
cell_getIsPlaceholder: { fn: (cell) => require_columnGroupingFeature_utils.cell_getIsPlaceholder(cell) }
|
|
34
|
-
cell_getIsAggregated: { fn: (cell) => require_columnGroupingFeature_utils.cell_getIsAggregated(cell) }
|
|
24
|
+
cell_getIsPlaceholder: { fn: (cell) => require_columnGroupingFeature_utils.cell_getIsPlaceholder(cell) }
|
|
35
25
|
});
|
|
36
26
|
},
|
|
37
27
|
assignColumnPrototype: (prototype, table) => {
|
|
@@ -40,9 +30,7 @@ const columnGroupingFeature = {
|
|
|
40
30
|
column_getCanGroup: { fn: (column) => require_columnGroupingFeature_utils.column_getCanGroup(column) },
|
|
41
31
|
column_getIsGrouped: { fn: (column) => require_columnGroupingFeature_utils.column_getIsGrouped(column) },
|
|
42
32
|
column_getGroupedIndex: { fn: (column) => require_columnGroupingFeature_utils.column_getGroupedIndex(column) },
|
|
43
|
-
column_getToggleGroupingHandler: { fn: (column) => require_columnGroupingFeature_utils.column_getToggleGroupingHandler(column) }
|
|
44
|
-
column_getAutoAggregationFn: { fn: (column) => require_columnGroupingFeature_utils.column_getAutoAggregationFn(column) },
|
|
45
|
-
column_getAggregationFn: { fn: (column) => require_columnGroupingFeature_utils.column_getAggregationFn(column) }
|
|
33
|
+
column_getToggleGroupingHandler: { fn: (column) => require_columnGroupingFeature_utils.column_getToggleGroupingHandler(column) }
|
|
46
34
|
});
|
|
47
35
|
},
|
|
48
36
|
assignRowPrototype: (prototype, table) => {
|
|
@@ -52,7 +40,7 @@ const columnGroupingFeature = {
|
|
|
52
40
|
});
|
|
53
41
|
},
|
|
54
42
|
initRowInstanceData: (row) => {
|
|
55
|
-
row._groupingValuesCache =
|
|
43
|
+
row._groupingValuesCache = require_utils.makeObjectMap();
|
|
56
44
|
},
|
|
57
45
|
constructTableAPIs: (table) => {
|
|
58
46
|
require_utils.assignTableAPIs("columnGroupingFeature", table, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnGroupingFeature.cjs","names":["getDefaultGroupingState","makeStateUpdater","cell_getIsGrouped","cell_getIsPlaceholder","
|
|
1
|
+
{"version":3,"file":"columnGroupingFeature.cjs","names":["getDefaultGroupingState","makeStateUpdater","cell_getIsGrouped","cell_getIsPlaceholder","column_toggleGrouping","column_getCanGroup","column_getIsGrouped","column_getGroupedIndex","column_getToggleGroupingHandler","row_getIsGrouped","row_getGroupingValue","makeObjectMap","table_setGrouping","table_resetGrouping"],"sources":["../../../src/features/column-grouping/columnGroupingFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeObjectMap,\n makeStateUpdater,\n} from '../../utils'\nimport {\n cell_getIsGrouped,\n cell_getIsPlaceholder,\n column_getCanGroup,\n column_getGroupedIndex,\n column_getIsGrouped,\n column_getToggleGroupingHandler,\n column_toggleGrouping,\n getDefaultGroupingState,\n row_getGroupingValue,\n row_getIsGrouped,\n table_resetGrouping,\n table_setGrouping,\n} from './columnGroupingFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Feature that adds column grouping state and grouped row APIs.\n */\nexport const columnGroupingFeature: TableFeature = {\n getInitialState: (initialState) => {\n return {\n grouping: getDefaultGroupingState(),\n ...initialState,\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onGroupingChange: makeStateUpdater('grouping', table),\n groupedColumnMode: 'reorder',\n }\n },\n\n assignCellPrototype: (prototype, table) => {\n assignPrototypeAPIs('columnGroupingFeature', prototype, table, {\n cell_getIsGrouped: {\n fn: (cell) => cell_getIsGrouped(cell),\n },\n cell_getIsPlaceholder: {\n fn: (cell) => cell_getIsPlaceholder(cell),\n },\n })\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('columnGroupingFeature', prototype, table, {\n column_toggleGrouping: {\n fn: (column) => column_toggleGrouping(column),\n },\n column_getCanGroup: {\n fn: (column) => column_getCanGroup(column),\n },\n column_getIsGrouped: {\n fn: (column) => column_getIsGrouped(column),\n },\n column_getGroupedIndex: {\n fn: (column) => column_getGroupedIndex(column),\n },\n column_getToggleGroupingHandler: {\n fn: (column) => column_getToggleGroupingHandler(column),\n },\n })\n },\n\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('columnGroupingFeature', prototype, table, {\n row_getIsGrouped: {\n fn: (row) => row_getIsGrouped(row),\n },\n row_getGroupingValue: {\n fn: (row, columnId) => row_getGroupingValue(row, columnId),\n },\n })\n },\n\n initRowInstanceData: (row) => {\n ;(row as any)._groupingValuesCache = makeObjectMap()\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('columnGroupingFeature', table, {\n table_setGrouping: {\n fn: (updater) => table_setGrouping(table, updater),\n },\n table_resetGrouping: {\n fn: (defaultState) => table_resetGrouping(table, defaultState),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAyBA,MAAa,wBAAsC;CACjD,kBAAkB,iBAAiB;EACjC,OAAO;GACL,UAAUA,4DAAwB;GAClC,GAAG;EACL;CACF;CAEA,yBAAyB,UAAU;EACjC,OAAO;GACL,kBAAkBC,+BAAiB,YAAY,KAAK;GACpD,mBAAmB;EACrB;CACF;CAEA,sBAAsB,WAAW,UAAU;EACzC,kCAAoB,yBAAyB,WAAW,OAAO;GAC7D,mBAAmB,EACjB,KAAK,SAASC,sDAAkB,IAAI,EACtC;GACA,uBAAuB,EACrB,KAAK,SAASC,0DAAsB,IAAI,EAC1C;EACF,CAAC;CACH;CAEA,wBAAwB,WAAW,UAAU;EAC3C,kCAAoB,yBAAyB,WAAW,OAAO;GAC7D,uBAAuB,EACrB,KAAK,WAAWC,0DAAsB,MAAM,EAC9C;GACA,oBAAoB,EAClB,KAAK,WAAWC,uDAAmB,MAAM,EAC3C;GACA,qBAAqB,EACnB,KAAK,WAAWC,wDAAoB,MAAM,EAC5C;GACA,wBAAwB,EACtB,KAAK,WAAWC,2DAAuB,MAAM,EAC/C;GACA,iCAAiC,EAC/B,KAAK,WAAWC,oEAAgC,MAAM,EACxD;EACF,CAAC;CACH;CAEA,qBAAqB,WAAW,UAAU;EACxC,kCAAoB,yBAAyB,WAAW,OAAO;GAC7D,kBAAkB,EAChB,KAAK,QAAQC,qDAAiB,GAAG,EACnC;GACA,sBAAsB,EACpB,KAAK,KAAK,aAAaC,yDAAqB,KAAK,QAAQ,EAC3D;EACF,CAAC;CACH;CAEA,sBAAsB,QAAQ;EAC3B,AAAC,IAAY,uBAAuBC,4BAAc;CACrD;CAEA,qBAAqB,UAAU;EAC7B,8BAAgB,yBAAyB,OAAO;GAC9C,mBAAmB,EACjB,KAAK,YAAYC,sDAAkB,OAAO,OAAO,EACnD;GACA,qBAAqB,EACnB,KAAK,iBAAiBC,wDAAoB,OAAO,YAAY,EAC/D;EACF,CAAC;CACH;AACF"}
|
|
@@ -2,7 +2,7 @@ import { TableFeature } from "../../types/TableFeatures.cjs";
|
|
|
2
2
|
|
|
3
3
|
//#region src/features/column-grouping/columnGroupingFeature.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Feature that adds column grouping state
|
|
5
|
+
* Feature that adds column grouping state and grouped row APIs.
|
|
6
6
|
*/
|
|
7
7
|
declare const columnGroupingFeature: TableFeature;
|
|
8
8
|
//#endregion
|
|
@@ -2,7 +2,7 @@ import { TableFeature } from "../../types/TableFeatures.js";
|
|
|
2
2
|
|
|
3
3
|
//#region src/features/column-grouping/columnGroupingFeature.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* Feature that adds column grouping state
|
|
5
|
+
* Feature that adds column grouping state and grouped row APIs.
|
|
6
6
|
*/
|
|
7
7
|
declare const columnGroupingFeature: TableFeature;
|
|
8
8
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { assignPrototypeAPIs, assignTableAPIs, makeStateUpdater } from "../../utils.js";
|
|
2
|
-
import {
|
|
1
|
+
import { assignPrototypeAPIs, assignTableAPIs, makeObjectMap, makeStateUpdater } from "../../utils.js";
|
|
2
|
+
import { cell_getIsGrouped, cell_getIsPlaceholder, column_getCanGroup, column_getGroupedIndex, column_getIsGrouped, column_getToggleGroupingHandler, column_toggleGrouping, getDefaultGroupingState, row_getGroupingValue, row_getIsGrouped, table_resetGrouping, table_setGrouping } from "./columnGroupingFeature.utils.js";
|
|
3
3
|
|
|
4
4
|
//#region src/features/column-grouping/columnGroupingFeature.ts
|
|
5
5
|
/**
|
|
6
|
-
* Feature that adds column grouping state
|
|
6
|
+
* Feature that adds column grouping state and grouped row APIs.
|
|
7
7
|
*/
|
|
8
8
|
const columnGroupingFeature = {
|
|
9
9
|
getInitialState: (initialState) => {
|
|
@@ -12,15 +12,6 @@ const columnGroupingFeature = {
|
|
|
12
12
|
...initialState
|
|
13
13
|
};
|
|
14
14
|
},
|
|
15
|
-
getDefaultColumnDef: () => {
|
|
16
|
-
return {
|
|
17
|
-
aggregatedCell: ({ getValue }) => {
|
|
18
|
-
var _getValue, _getValue$toString;
|
|
19
|
-
return ((_getValue = getValue()) === null || _getValue === void 0 || (_getValue$toString = _getValue.toString) === null || _getValue$toString === void 0 ? void 0 : _getValue$toString.call(_getValue)) ?? null;
|
|
20
|
-
},
|
|
21
|
-
aggregationFn: "auto"
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
15
|
getDefaultTableOptions: (table) => {
|
|
25
16
|
return {
|
|
26
17
|
onGroupingChange: makeStateUpdater("grouping", table),
|
|
@@ -30,8 +21,7 @@ const columnGroupingFeature = {
|
|
|
30
21
|
assignCellPrototype: (prototype, table) => {
|
|
31
22
|
assignPrototypeAPIs("columnGroupingFeature", prototype, table, {
|
|
32
23
|
cell_getIsGrouped: { fn: (cell) => cell_getIsGrouped(cell) },
|
|
33
|
-
cell_getIsPlaceholder: { fn: (cell) => cell_getIsPlaceholder(cell) }
|
|
34
|
-
cell_getIsAggregated: { fn: (cell) => cell_getIsAggregated(cell) }
|
|
24
|
+
cell_getIsPlaceholder: { fn: (cell) => cell_getIsPlaceholder(cell) }
|
|
35
25
|
});
|
|
36
26
|
},
|
|
37
27
|
assignColumnPrototype: (prototype, table) => {
|
|
@@ -40,9 +30,7 @@ const columnGroupingFeature = {
|
|
|
40
30
|
column_getCanGroup: { fn: (column) => column_getCanGroup(column) },
|
|
41
31
|
column_getIsGrouped: { fn: (column) => column_getIsGrouped(column) },
|
|
42
32
|
column_getGroupedIndex: { fn: (column) => column_getGroupedIndex(column) },
|
|
43
|
-
column_getToggleGroupingHandler: { fn: (column) => column_getToggleGroupingHandler(column) }
|
|
44
|
-
column_getAutoAggregationFn: { fn: (column) => column_getAutoAggregationFn(column) },
|
|
45
|
-
column_getAggregationFn: { fn: (column) => column_getAggregationFn(column) }
|
|
33
|
+
column_getToggleGroupingHandler: { fn: (column) => column_getToggleGroupingHandler(column) }
|
|
46
34
|
});
|
|
47
35
|
},
|
|
48
36
|
assignRowPrototype: (prototype, table) => {
|
|
@@ -52,7 +40,7 @@ const columnGroupingFeature = {
|
|
|
52
40
|
});
|
|
53
41
|
},
|
|
54
42
|
initRowInstanceData: (row) => {
|
|
55
|
-
row._groupingValuesCache =
|
|
43
|
+
row._groupingValuesCache = makeObjectMap();
|
|
56
44
|
},
|
|
57
45
|
constructTableAPIs: (table) => {
|
|
58
46
|
assignTableAPIs("columnGroupingFeature", table, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnGroupingFeature.js","names":[],"sources":["../../../src/features/column-grouping/columnGroupingFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n
|
|
1
|
+
{"version":3,"file":"columnGroupingFeature.js","names":[],"sources":["../../../src/features/column-grouping/columnGroupingFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeObjectMap,\n makeStateUpdater,\n} from '../../utils'\nimport {\n cell_getIsGrouped,\n cell_getIsPlaceholder,\n column_getCanGroup,\n column_getGroupedIndex,\n column_getIsGrouped,\n column_getToggleGroupingHandler,\n column_toggleGrouping,\n getDefaultGroupingState,\n row_getGroupingValue,\n row_getIsGrouped,\n table_resetGrouping,\n table_setGrouping,\n} from './columnGroupingFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Feature that adds column grouping state and grouped row APIs.\n */\nexport const columnGroupingFeature: TableFeature = {\n getInitialState: (initialState) => {\n return {\n grouping: getDefaultGroupingState(),\n ...initialState,\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onGroupingChange: makeStateUpdater('grouping', table),\n groupedColumnMode: 'reorder',\n }\n },\n\n assignCellPrototype: (prototype, table) => {\n assignPrototypeAPIs('columnGroupingFeature', prototype, table, {\n cell_getIsGrouped: {\n fn: (cell) => cell_getIsGrouped(cell),\n },\n cell_getIsPlaceholder: {\n fn: (cell) => cell_getIsPlaceholder(cell),\n },\n })\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('columnGroupingFeature', prototype, table, {\n column_toggleGrouping: {\n fn: (column) => column_toggleGrouping(column),\n },\n column_getCanGroup: {\n fn: (column) => column_getCanGroup(column),\n },\n column_getIsGrouped: {\n fn: (column) => column_getIsGrouped(column),\n },\n column_getGroupedIndex: {\n fn: (column) => column_getGroupedIndex(column),\n },\n column_getToggleGroupingHandler: {\n fn: (column) => column_getToggleGroupingHandler(column),\n },\n })\n },\n\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('columnGroupingFeature', prototype, table, {\n row_getIsGrouped: {\n fn: (row) => row_getIsGrouped(row),\n },\n row_getGroupingValue: {\n fn: (row, columnId) => row_getGroupingValue(row, columnId),\n },\n })\n },\n\n initRowInstanceData: (row) => {\n ;(row as any)._groupingValuesCache = makeObjectMap()\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('columnGroupingFeature', table, {\n table_setGrouping: {\n fn: (updater) => table_setGrouping(table, updater),\n },\n table_resetGrouping: {\n fn: (defaultState) => table_resetGrouping(table, defaultState),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAyBA,MAAa,wBAAsC;CACjD,kBAAkB,iBAAiB;EACjC,OAAO;GACL,UAAU,wBAAwB;GAClC,GAAG;EACL;CACF;CAEA,yBAAyB,UAAU;EACjC,OAAO;GACL,kBAAkB,iBAAiB,YAAY,KAAK;GACpD,mBAAmB;EACrB;CACF;CAEA,sBAAsB,WAAW,UAAU;EACzC,oBAAoB,yBAAyB,WAAW,OAAO;GAC7D,mBAAmB,EACjB,KAAK,SAAS,kBAAkB,IAAI,EACtC;GACA,uBAAuB,EACrB,KAAK,SAAS,sBAAsB,IAAI,EAC1C;EACF,CAAC;CACH;CAEA,wBAAwB,WAAW,UAAU;EAC3C,oBAAoB,yBAAyB,WAAW,OAAO;GAC7D,uBAAuB,EACrB,KAAK,WAAW,sBAAsB,MAAM,EAC9C;GACA,oBAAoB,EAClB,KAAK,WAAW,mBAAmB,MAAM,EAC3C;GACA,qBAAqB,EACnB,KAAK,WAAW,oBAAoB,MAAM,EAC5C;GACA,wBAAwB,EACtB,KAAK,WAAW,uBAAuB,MAAM,EAC/C;GACA,iCAAiC,EAC/B,KAAK,WAAW,gCAAgC,MAAM,EACxD;EACF,CAAC;CACH;CAEA,qBAAqB,WAAW,UAAU;EACxC,oBAAoB,yBAAyB,WAAW,OAAO;GAC7D,kBAAkB,EAChB,KAAK,QAAQ,iBAAiB,GAAG,EACnC;GACA,sBAAsB,EACpB,KAAK,KAAK,aAAa,qBAAqB,KAAK,QAAQ,EAC3D;EACF,CAAC;CACH;CAEA,sBAAsB,QAAQ;EAC3B,AAAC,IAAY,uBAAuB,cAAc;CACrD;CAEA,qBAAqB,UAAU;EAC7B,gBAAgB,yBAAyB,OAAO;GAC9C,mBAAmB,EACjB,KAAK,YAAY,kBAAkB,OAAO,OAAO,EACnD;GACA,qBAAqB,EACnB,KAAK,iBAAiB,oBAAoB,OAAO,YAAY,EAC/D;EACF,CAAC;CACH;AACF"}
|
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnChangeFn, RowData, Updater } from "../../types/type-utils.cjs";
|
|
2
2
|
import { Row } from "../../types/Row.cjs";
|
|
3
|
-
import { ColumnDefTemplate } from "../../types/ColumnDef.cjs";
|
|
4
|
-
import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
5
|
-
import { Table } from "../../types/Table.cjs";
|
|
6
3
|
import { RowModel } from "../../core/row-models/coreRowModelsFeature.types.cjs";
|
|
7
|
-
import {
|
|
8
|
-
import { Cell } from "../../types/Cell.cjs";
|
|
4
|
+
import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
9
5
|
|
|
10
6
|
//#region src/features/column-grouping/columnGroupingFeature.types.d.ts
|
|
11
7
|
type GroupingState = Array<string>;
|
|
12
8
|
interface TableState_ColumnGrouping {
|
|
13
9
|
grouping: GroupingState;
|
|
14
10
|
}
|
|
15
|
-
interface
|
|
16
|
-
aggregationFns: Record<keyof AggregationFns, AggregationFn<TFeatures, TData>>;
|
|
17
|
-
}
|
|
18
|
-
interface AggregationFns {}
|
|
19
|
-
type AggregationFn<TFeatures extends TableFeatures, TData extends RowData> = (columnId: string, leafRows: Array<Row<TFeatures, TData>>, childRows: Array<Row<TFeatures, TData>>) => any;
|
|
20
|
-
type CustomAggregationFns<TFeatures extends TableFeatures, TData extends RowData> = Record<string, AggregationFn<TFeatures, TData>>;
|
|
21
|
-
type AggregationFnOption<TFeatures extends TableFeatures, TData extends RowData> = 'auto' | keyof AggregationFns | BuiltInAggregationFn | AggregationFn<TFeatures, TData>;
|
|
22
|
-
interface ColumnDef_ColumnGrouping<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
|
|
23
|
-
/**
|
|
24
|
-
* The cell to display each row for the column if the cell is an aggregate. If a function is passed, it will be passed a props object with the context of the cell and should return the property type for your adapter (the exact type depends on the adapter being used).
|
|
25
|
-
*/
|
|
26
|
-
aggregatedCell?: ColumnDefTemplate<ReturnType<Cell<TFeatures, TData, TValue>['getContext']>>;
|
|
27
|
-
/**
|
|
28
|
-
* The resolved aggregation function for the column.
|
|
29
|
-
*/
|
|
30
|
-
aggregationFn?: AggregationFnOption<TFeatures, TData>;
|
|
11
|
+
interface ColumnDef_ColumnGrouping<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
31
12
|
/**
|
|
32
13
|
* Allows this column to be added to grouping state.
|
|
33
14
|
*
|
|
@@ -35,19 +16,14 @@ interface ColumnDef_ColumnGrouping<TFeatures extends TableFeatures, TData extend
|
|
|
35
16
|
*/
|
|
36
17
|
enableGrouping?: boolean;
|
|
37
18
|
/**
|
|
38
|
-
*
|
|
19
|
+
* Returns the value used to group rows for this column.
|
|
20
|
+
*
|
|
21
|
+
* When omitted, grouping uses the value derived from this column's
|
|
22
|
+
* `accessorKey` or `accessorFn`.
|
|
39
23
|
*/
|
|
40
|
-
getGroupingValue?: (row: TData) => any;
|
|
24
|
+
getGroupingValue?: (originalRow: TData, index: number, row: Row<TFeatures, TData>) => any;
|
|
41
25
|
}
|
|
42
|
-
interface Column_ColumnGrouping
|
|
43
|
-
/**
|
|
44
|
-
* Returns the aggregation function for the column.
|
|
45
|
-
*/
|
|
46
|
-
getAggregationFn: () => AggregationFn<TFeatures, TData> | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* Returns the automatically inferred aggregation function for the column.
|
|
49
|
-
*/
|
|
50
|
-
getAutoAggregationFn: () => AggregationFn<TFeatures, TData> | undefined;
|
|
26
|
+
interface Column_ColumnGrouping {
|
|
51
27
|
/**
|
|
52
28
|
* Checks whether this column can currently be grouped.
|
|
53
29
|
*/
|
|
@@ -89,10 +65,6 @@ interface Row_ColumnGrouping {
|
|
|
89
65
|
groupingValue?: unknown;
|
|
90
66
|
}
|
|
91
67
|
interface Cell_ColumnGrouping {
|
|
92
|
-
/**
|
|
93
|
-
* Checks whether this cell should render an aggregated value.
|
|
94
|
-
*/
|
|
95
|
-
getIsAggregated: () => boolean;
|
|
96
68
|
/**
|
|
97
69
|
* Checks whether this cell represents the active grouping column.
|
|
98
70
|
*/
|
|
@@ -127,7 +99,7 @@ interface TableOptions_ColumnGrouping {
|
|
|
127
99
|
onGroupingChange?: OnChangeFn<GroupingState>;
|
|
128
100
|
}
|
|
129
101
|
type GroupingColumnMode = false | 'reorder' | 'remove';
|
|
130
|
-
interface Table_ColumnGrouping<
|
|
102
|
+
interface Table_ColumnGrouping<in out _TFeatures extends TableFeatures, in out _TData extends RowData> {
|
|
131
103
|
/**
|
|
132
104
|
* Resets `grouping` to `initialState.grouping`.
|
|
133
105
|
*
|
|
@@ -139,9 +111,9 @@ interface Table_ColumnGrouping<TFeatures extends TableFeatures, TData extends Ro
|
|
|
139
111
|
*/
|
|
140
112
|
setGrouping: (updater: Updater<GroupingState>) => void;
|
|
141
113
|
}
|
|
142
|
-
interface Table_RowModels_Grouped<TFeatures extends TableFeatures, TData extends RowData> {
|
|
114
|
+
interface Table_RowModels_Grouped<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
143
115
|
/**
|
|
144
|
-
* Resolves the row model after grouping
|
|
116
|
+
* Resolves the row model after grouping has been applied.
|
|
145
117
|
*/
|
|
146
118
|
getGroupedRowModel: () => RowModel<TFeatures, TData>;
|
|
147
119
|
/**
|
|
@@ -149,17 +121,9 @@ interface Table_RowModels_Grouped<TFeatures extends TableFeatures, TData extends
|
|
|
149
121
|
*/
|
|
150
122
|
getPreGroupedRowModel: () => RowModel<TFeatures, TData>;
|
|
151
123
|
}
|
|
152
|
-
interface
|
|
153
|
-
/**
|
|
154
|
-
* Factory used to retrieve the grouped row model. If using server-side
|
|
155
|
-
* grouping, this is not required. To use client-side grouping, pass
|
|
156
|
-
* `createGroupedRowModel()` or implement your own factory.
|
|
157
|
-
*/
|
|
158
|
-
groupedRowModel?: (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData>;
|
|
159
|
-
}
|
|
160
|
-
interface CachedRowModel_Grouped<TFeatures extends TableFeatures, TData extends RowData> {
|
|
124
|
+
interface CachedRowModel_Grouped<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
161
125
|
groupedRowModel: () => RowModel<TFeatures, TData>;
|
|
162
126
|
}
|
|
163
127
|
//#endregion
|
|
164
|
-
export {
|
|
128
|
+
export { CachedRowModel_Grouped, Cell_ColumnGrouping, ColumnDef_ColumnGrouping, ColumnDefaultOptions, Column_ColumnGrouping, GroupingColumnMode, GroupingState, Row_ColumnGrouping, TableOptions_ColumnGrouping, TableState_ColumnGrouping, Table_ColumnGrouping, Table_RowModels_Grouped };
|
|
165
129
|
//# sourceMappingURL=columnGroupingFeature.types.d.cts.map
|
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnChangeFn, RowData, Updater } from "../../types/type-utils.js";
|
|
2
2
|
import { Row } from "../../types/Row.js";
|
|
3
|
-
import { ColumnDefTemplate } from "../../types/ColumnDef.js";
|
|
4
|
-
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
5
|
-
import { Table } from "../../types/Table.js";
|
|
6
3
|
import { RowModel } from "../../core/row-models/coreRowModelsFeature.types.js";
|
|
7
|
-
import {
|
|
8
|
-
import { Cell } from "../../types/Cell.js";
|
|
4
|
+
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
9
5
|
|
|
10
6
|
//#region src/features/column-grouping/columnGroupingFeature.types.d.ts
|
|
11
7
|
type GroupingState = Array<string>;
|
|
12
8
|
interface TableState_ColumnGrouping {
|
|
13
9
|
grouping: GroupingState;
|
|
14
10
|
}
|
|
15
|
-
interface
|
|
16
|
-
aggregationFns: Record<keyof AggregationFns, AggregationFn<TFeatures, TData>>;
|
|
17
|
-
}
|
|
18
|
-
interface AggregationFns {}
|
|
19
|
-
type AggregationFn<TFeatures extends TableFeatures, TData extends RowData> = (columnId: string, leafRows: Array<Row<TFeatures, TData>>, childRows: Array<Row<TFeatures, TData>>) => any;
|
|
20
|
-
type CustomAggregationFns<TFeatures extends TableFeatures, TData extends RowData> = Record<string, AggregationFn<TFeatures, TData>>;
|
|
21
|
-
type AggregationFnOption<TFeatures extends TableFeatures, TData extends RowData> = 'auto' | keyof AggregationFns | BuiltInAggregationFn | AggregationFn<TFeatures, TData>;
|
|
22
|
-
interface ColumnDef_ColumnGrouping<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
|
|
23
|
-
/**
|
|
24
|
-
* The cell to display each row for the column if the cell is an aggregate. If a function is passed, it will be passed a props object with the context of the cell and should return the property type for your adapter (the exact type depends on the adapter being used).
|
|
25
|
-
*/
|
|
26
|
-
aggregatedCell?: ColumnDefTemplate<ReturnType<Cell<TFeatures, TData, TValue>['getContext']>>;
|
|
27
|
-
/**
|
|
28
|
-
* The resolved aggregation function for the column.
|
|
29
|
-
*/
|
|
30
|
-
aggregationFn?: AggregationFnOption<TFeatures, TData>;
|
|
11
|
+
interface ColumnDef_ColumnGrouping<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
31
12
|
/**
|
|
32
13
|
* Allows this column to be added to grouping state.
|
|
33
14
|
*
|
|
@@ -35,19 +16,14 @@ interface ColumnDef_ColumnGrouping<TFeatures extends TableFeatures, TData extend
|
|
|
35
16
|
*/
|
|
36
17
|
enableGrouping?: boolean;
|
|
37
18
|
/**
|
|
38
|
-
*
|
|
19
|
+
* Returns the value used to group rows for this column.
|
|
20
|
+
*
|
|
21
|
+
* When omitted, grouping uses the value derived from this column's
|
|
22
|
+
* `accessorKey` or `accessorFn`.
|
|
39
23
|
*/
|
|
40
|
-
getGroupingValue?: (row: TData) => any;
|
|
24
|
+
getGroupingValue?: (originalRow: TData, index: number, row: Row<TFeatures, TData>) => any;
|
|
41
25
|
}
|
|
42
|
-
interface Column_ColumnGrouping
|
|
43
|
-
/**
|
|
44
|
-
* Returns the aggregation function for the column.
|
|
45
|
-
*/
|
|
46
|
-
getAggregationFn: () => AggregationFn<TFeatures, TData> | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* Returns the automatically inferred aggregation function for the column.
|
|
49
|
-
*/
|
|
50
|
-
getAutoAggregationFn: () => AggregationFn<TFeatures, TData> | undefined;
|
|
26
|
+
interface Column_ColumnGrouping {
|
|
51
27
|
/**
|
|
52
28
|
* Checks whether this column can currently be grouped.
|
|
53
29
|
*/
|
|
@@ -89,10 +65,6 @@ interface Row_ColumnGrouping {
|
|
|
89
65
|
groupingValue?: unknown;
|
|
90
66
|
}
|
|
91
67
|
interface Cell_ColumnGrouping {
|
|
92
|
-
/**
|
|
93
|
-
* Checks whether this cell should render an aggregated value.
|
|
94
|
-
*/
|
|
95
|
-
getIsAggregated: () => boolean;
|
|
96
68
|
/**
|
|
97
69
|
* Checks whether this cell represents the active grouping column.
|
|
98
70
|
*/
|
|
@@ -127,7 +99,7 @@ interface TableOptions_ColumnGrouping {
|
|
|
127
99
|
onGroupingChange?: OnChangeFn<GroupingState>;
|
|
128
100
|
}
|
|
129
101
|
type GroupingColumnMode = false | 'reorder' | 'remove';
|
|
130
|
-
interface Table_ColumnGrouping<
|
|
102
|
+
interface Table_ColumnGrouping<in out _TFeatures extends TableFeatures, in out _TData extends RowData> {
|
|
131
103
|
/**
|
|
132
104
|
* Resets `grouping` to `initialState.grouping`.
|
|
133
105
|
*
|
|
@@ -139,9 +111,9 @@ interface Table_ColumnGrouping<TFeatures extends TableFeatures, TData extends Ro
|
|
|
139
111
|
*/
|
|
140
112
|
setGrouping: (updater: Updater<GroupingState>) => void;
|
|
141
113
|
}
|
|
142
|
-
interface Table_RowModels_Grouped<TFeatures extends TableFeatures, TData extends RowData> {
|
|
114
|
+
interface Table_RowModels_Grouped<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
143
115
|
/**
|
|
144
|
-
* Resolves the row model after grouping
|
|
116
|
+
* Resolves the row model after grouping has been applied.
|
|
145
117
|
*/
|
|
146
118
|
getGroupedRowModel: () => RowModel<TFeatures, TData>;
|
|
147
119
|
/**
|
|
@@ -149,17 +121,9 @@ interface Table_RowModels_Grouped<TFeatures extends TableFeatures, TData extends
|
|
|
149
121
|
*/
|
|
150
122
|
getPreGroupedRowModel: () => RowModel<TFeatures, TData>;
|
|
151
123
|
}
|
|
152
|
-
interface
|
|
153
|
-
/**
|
|
154
|
-
* Factory used to retrieve the grouped row model. If using server-side
|
|
155
|
-
* grouping, this is not required. To use client-side grouping, pass
|
|
156
|
-
* `createGroupedRowModel()` or implement your own factory.
|
|
157
|
-
*/
|
|
158
|
-
groupedRowModel?: (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData>;
|
|
159
|
-
}
|
|
160
|
-
interface CachedRowModel_Grouped<TFeatures extends TableFeatures, TData extends RowData> {
|
|
124
|
+
interface CachedRowModel_Grouped<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
161
125
|
groupedRowModel: () => RowModel<TFeatures, TData>;
|
|
162
126
|
}
|
|
163
127
|
//#endregion
|
|
164
|
-
export {
|
|
128
|
+
export { CachedRowModel_Grouped, Cell_ColumnGrouping, ColumnDef_ColumnGrouping, ColumnDefaultOptions, Column_ColumnGrouping, GroupingColumnMode, GroupingState, Row_ColumnGrouping, TableOptions_ColumnGrouping, TableState_ColumnGrouping, Table_ColumnGrouping, Table_RowModels_Grouped };
|
|
165
129
|
//# sourceMappingURL=columnGroupingFeature.types.d.ts.map
|
|
@@ -58,8 +58,7 @@ function column_getCanGroup(column) {
|
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
60
|
function column_getIsGrouped(column) {
|
|
61
|
-
|
|
62
|
-
return !!((_column$table$atoms$g = column.table.atoms.grouping) === null || _column$table$atoms$g === void 0 || (_column$table$atoms$g = _column$table$atoms$g.get()) === null || _column$table$atoms$g === void 0 ? void 0 : _column$table$atoms$g.includes(column.id));
|
|
61
|
+
return !!column.table.atoms.grouping?.get()?.includes(column.id);
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
64
|
* Finds this column's position in the ordered grouping state.
|
|
@@ -72,8 +71,7 @@ function column_getIsGrouped(column) {
|
|
|
72
71
|
* ```
|
|
73
72
|
*/
|
|
74
73
|
function column_getGroupedIndex(column) {
|
|
75
|
-
|
|
76
|
-
return ((_column$table$atoms$g2 = column.table.atoms.grouping) === null || _column$table$atoms$g2 === void 0 || (_column$table$atoms$g2 = _column$table$atoms$g2.get()) === null || _column$table$atoms$g2 === void 0 ? void 0 : _column$table$atoms$g2.indexOf(column.id)) ?? -1;
|
|
74
|
+
return column.table.atoms.grouping?.get()?.indexOf(column.id) ?? -1;
|
|
77
75
|
}
|
|
78
76
|
/**
|
|
79
77
|
* Creates a header/control handler that toggles grouping for this column.
|
|
@@ -93,40 +91,6 @@ function column_getToggleGroupingHandler(column) {
|
|
|
93
91
|
};
|
|
94
92
|
}
|
|
95
93
|
/**
|
|
96
|
-
* Chooses a built-in aggregation function from the first core row value.
|
|
97
|
-
*
|
|
98
|
-
* Numeric columns default to `sum`, date-like values default to `extent`, and
|
|
99
|
-
* other value types leave aggregation unspecified.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```ts
|
|
103
|
-
* const aggregationFn = column_getAutoAggregationFn(column)
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
function column_getAutoAggregationFn(column) {
|
|
107
|
-
const aggregationFns = column.table._rowModelFns.aggregationFns;
|
|
108
|
-
const firstRow = column.table.getCoreRowModel().flatRows[0];
|
|
109
|
-
const value = firstRow === null || firstRow === void 0 ? void 0 : firstRow.getValue(column.id);
|
|
110
|
-
if (typeof value === "number") return aggregationFns === null || aggregationFns === void 0 ? void 0 : aggregationFns.sum;
|
|
111
|
-
if (Object.prototype.toString.call(value) === "[object Date]") return aggregationFns === null || aggregationFns === void 0 ? void 0 : aggregationFns.extent;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Resolves the aggregation function configured for a column.
|
|
115
|
-
*
|
|
116
|
-
* Function-valued `columnDef.aggregationFn` is returned directly, `'auto'`
|
|
117
|
-
* delegates to `column_getAutoAggregationFn`, and string values are looked up in
|
|
118
|
-
* the table's aggregation function registry.
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* ```ts
|
|
122
|
-
* const aggregationFn = column_getAggregationFn(column)
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
|
-
function column_getAggregationFn(column) {
|
|
126
|
-
const aggregationFns = column.table._rowModelFns.aggregationFns;
|
|
127
|
-
return require_utils.isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === "auto" ? column_getAutoAggregationFn(column) : aggregationFns === null || aggregationFns === void 0 ? void 0 : aggregationFns[column.columnDef.aggregationFn];
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
94
|
* Routes a grouping updater through the table's grouping change handler.
|
|
131
95
|
*
|
|
132
96
|
* The updater may be a next `GroupingState` array or a function of the previous
|
|
@@ -138,8 +102,7 @@ function column_getAggregationFn(column) {
|
|
|
138
102
|
* ```
|
|
139
103
|
*/
|
|
140
104
|
function table_setGrouping(table, updater) {
|
|
141
|
-
|
|
142
|
-
(_table$options$onGrou = (_table$options = table.options).onGroupingChange) === null || _table$options$onGrou === void 0 || _table$options$onGrou.call(_table$options, updater);
|
|
105
|
+
table.options.onGroupingChange?.(updater);
|
|
143
106
|
}
|
|
144
107
|
/**
|
|
145
108
|
* Resets `grouping` to the configured initial state or feature default.
|
|
@@ -181,12 +144,11 @@ function row_getIsGrouped(row) {
|
|
|
181
144
|
* ```
|
|
182
145
|
*/
|
|
183
146
|
function row_getGroupingValue(row, columnId) {
|
|
184
|
-
|
|
185
|
-
if ((_row$_groupingValuesC = row._groupingValuesCache) === null || _row$_groupingValuesC === void 0 ? void 0 : _row$_groupingValuesC.hasOwnProperty(columnId)) return row._groupingValuesCache[columnId];
|
|
147
|
+
if (row._groupingValuesCache && require_utils.hasOwn(row._groupingValuesCache, columnId)) return row._groupingValuesCache[columnId];
|
|
186
148
|
const column = row.table.getColumn(columnId);
|
|
187
149
|
if (!column.columnDef.getGroupingValue) return row.getValue(columnId);
|
|
188
|
-
if (row._groupingValuesCache) row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(row.original);
|
|
189
|
-
return
|
|
150
|
+
if (row._groupingValuesCache) row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(row.original, row.index, row);
|
|
151
|
+
return row._groupingValuesCache?.[columnId];
|
|
190
152
|
}
|
|
191
153
|
/**
|
|
192
154
|
* Checks whether this cell represents the grouped column for a grouped row.
|
|
@@ -216,27 +178,10 @@ function cell_getIsGrouped(cell) {
|
|
|
216
178
|
function cell_getIsPlaceholder(cell) {
|
|
217
179
|
return !cell_getIsGrouped(cell) && column_getIsGrouped(cell.column);
|
|
218
180
|
}
|
|
219
|
-
/**
|
|
220
|
-
* Checks whether this cell should render an aggregated value.
|
|
221
|
-
*
|
|
222
|
-
* Aggregated cells are non-placeholder, non-grouped cells on rows that have
|
|
223
|
-
* subRows.
|
|
224
|
-
*
|
|
225
|
-
* @example
|
|
226
|
-
* ```ts
|
|
227
|
-
* const isAggregated = cell_getIsAggregated(cell)
|
|
228
|
-
* ```
|
|
229
|
-
*/
|
|
230
|
-
function cell_getIsAggregated(cell) {
|
|
231
|
-
return !cell_getIsGrouped(cell) && !cell_getIsPlaceholder(cell) && !!cell.row.subRows.length;
|
|
232
|
-
}
|
|
233
181
|
|
|
234
182
|
//#endregion
|
|
235
|
-
exports.cell_getIsAggregated = cell_getIsAggregated;
|
|
236
183
|
exports.cell_getIsGrouped = cell_getIsGrouped;
|
|
237
184
|
exports.cell_getIsPlaceholder = cell_getIsPlaceholder;
|
|
238
|
-
exports.column_getAggregationFn = column_getAggregationFn;
|
|
239
|
-
exports.column_getAutoAggregationFn = column_getAutoAggregationFn;
|
|
240
185
|
exports.column_getCanGroup = column_getCanGroup;
|
|
241
186
|
exports.column_getGroupedIndex = column_getGroupedIndex;
|
|
242
187
|
exports.column_getIsGrouped = column_getIsGrouped;
|