@tanstack/table-core 9.0.0-alpha.16 → 9.0.0-alpha.23
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 +28 -0
- package/dist/core/cells/constructCell.cjs.map +1 -0
- package/dist/core/cells/constructCell.d.cts +12 -0
- package/dist/core/cells/constructCell.d.ts +12 -0
- package/dist/core/cells/constructCell.js +27 -0
- package/dist/core/cells/constructCell.js.map +1 -0
- package/dist/core/cells/coreCellsFeature.cjs +25 -0
- package/dist/core/cells/coreCellsFeature.cjs.map +1 -0
- package/dist/core/cells/coreCellsFeature.d.cts +13 -0
- package/dist/core/cells/coreCellsFeature.d.ts +13 -0
- package/dist/core/cells/coreCellsFeature.js +24 -0
- package/dist/core/cells/coreCellsFeature.js.map +1 -0
- package/dist/core/cells/coreCellsFeature.types.d.cts +57 -0
- package/dist/core/cells/coreCellsFeature.types.d.ts +57 -0
- package/dist/core/cells/coreCellsFeature.utils.cjs +24 -0
- package/dist/core/cells/coreCellsFeature.utils.cjs.map +1 -0
- package/dist/core/cells/coreCellsFeature.utils.d.cts +20 -0
- package/dist/core/cells/coreCellsFeature.utils.d.ts +20 -0
- package/dist/core/cells/coreCellsFeature.utils.js +21 -0
- package/dist/core/cells/coreCellsFeature.utils.js.map +1 -0
- package/dist/core/columns/constructColumn.cjs +52 -0
- package/dist/core/columns/constructColumn.cjs.map +1 -0
- package/dist/core/columns/constructColumn.d.cts +11 -0
- package/dist/core/columns/constructColumn.d.ts +11 -0
- package/dist/core/columns/constructColumn.js +51 -0
- package/dist/core/columns/constructColumn.js.map +1 -0
- package/dist/core/columns/coreColumnsFeature.cjs +64 -0
- package/dist/core/columns/coreColumnsFeature.cjs.map +1 -0
- package/dist/core/columns/coreColumnsFeature.d.cts +13 -0
- package/dist/core/columns/coreColumnsFeature.d.ts +13 -0
- package/dist/core/columns/coreColumnsFeature.js +63 -0
- package/dist/core/columns/coreColumnsFeature.js.map +1 -0
- package/dist/core/columns/coreColumnsFeature.types.d.cts +89 -0
- package/dist/core/columns/coreColumnsFeature.types.d.ts +89 -0
- package/dist/core/columns/coreColumnsFeature.utils.cjs +74 -0
- package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -0
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +18 -0
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +18 -0
- package/dist/core/columns/coreColumnsFeature.utils.js +67 -0
- package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -0
- package/dist/core/coreFeatures.cjs +20 -0
- package/dist/core/coreFeatures.cjs.map +1 -0
- package/dist/core/coreFeatures.d.cts +20 -0
- package/dist/core/coreFeatures.d.ts +20 -0
- package/dist/{esm/core → core}/coreFeatures.js +12 -10
- package/dist/core/coreFeatures.js.map +1 -0
- package/dist/core/headers/buildHeaderGroups.cjs +90 -0
- package/dist/core/headers/buildHeaderGroups.cjs.map +1 -0
- package/dist/core/headers/buildHeaderGroups.d.cts +11 -0
- package/dist/core/headers/buildHeaderGroups.d.ts +11 -0
- package/dist/core/headers/buildHeaderGroups.js +90 -0
- package/dist/core/headers/buildHeaderGroups.js.map +1 -0
- package/dist/core/headers/constructHeader.cjs +35 -0
- package/dist/core/headers/constructHeader.cjs.map +1 -0
- package/dist/core/headers/constructHeader.d.cts +17 -0
- package/dist/core/headers/constructHeader.d.ts +17 -0
- package/dist/core/headers/constructHeader.js +34 -0
- package/dist/core/headers/constructHeader.js.map +1 -0
- package/dist/core/headers/coreHeadersFeature.cjs +61 -0
- package/dist/core/headers/coreHeadersFeature.cjs.map +1 -0
- package/dist/core/headers/coreHeadersFeature.d.cts +13 -0
- package/dist/core/headers/coreHeadersFeature.d.ts +13 -0
- package/dist/core/headers/coreHeadersFeature.js +60 -0
- package/dist/core/headers/coreHeadersFeature.js.map +1 -0
- package/dist/core/headers/coreHeadersFeature.types.d.cts +104 -0
- package/dist/core/headers/coreHeadersFeature.types.d.ts +104 -0
- package/dist/core/headers/coreHeadersFeature.utils.cjs +65 -0
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -0
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +20 -0
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +20 -0
- package/dist/core/headers/coreHeadersFeature.utils.js +60 -0
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -0
- package/dist/core/row-models/coreRowModelsFeature.cjs +31 -0
- package/dist/core/row-models/coreRowModelsFeature.cjs.map +1 -0
- package/dist/core/row-models/coreRowModelsFeature.d.cts +13 -0
- package/dist/core/row-models/coreRowModelsFeature.d.ts +13 -0
- package/dist/core/row-models/coreRowModelsFeature.js +30 -0
- package/dist/core/row-models/coreRowModelsFeature.js.map +1 -0
- package/dist/core/row-models/coreRowModelsFeature.types.d.cts +42 -0
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +42 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs +83 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +21 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +21 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.js +72 -0
- package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -0
- package/dist/core/row-models/createCoreRowModel.cjs +47 -0
- package/dist/core/row-models/createCoreRowModel.cjs.map +1 -0
- package/dist/core/row-models/createCoreRowModel.d.cts +10 -0
- package/dist/core/row-models/createCoreRowModel.d.ts +10 -0
- package/dist/core/row-models/createCoreRowModel.js +47 -0
- package/dist/core/row-models/createCoreRowModel.js.map +1 -0
- package/dist/core/rows/constructRow.cjs +37 -0
- package/dist/core/rows/constructRow.cjs.map +1 -0
- package/dist/core/rows/constructRow.d.cts +10 -0
- package/dist/core/rows/constructRow.d.ts +10 -0
- package/dist/core/rows/constructRow.js +36 -0
- package/dist/core/rows/constructRow.js.map +1 -0
- package/dist/core/rows/coreRowsFeature.cjs +41 -0
- package/dist/core/rows/coreRowsFeature.cjs.map +1 -0
- package/dist/core/rows/coreRowsFeature.d.cts +13 -0
- package/dist/core/rows/coreRowsFeature.d.ts +13 -0
- package/dist/core/rows/coreRowsFeature.js +40 -0
- package/dist/core/rows/coreRowsFeature.js.map +1 -0
- package/dist/core/rows/coreRowsFeature.types.d.cts +96 -0
- package/dist/core/rows/coreRowsFeature.types.d.ts +96 -0
- package/dist/core/rows/coreRowsFeature.utils.cjs +81 -0
- package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -0
- package/dist/core/rows/coreRowsFeature.utils.d.cts +20 -0
- package/dist/core/rows/coreRowsFeature.utils.d.ts +20 -0
- package/dist/core/rows/coreRowsFeature.utils.js +72 -0
- package/dist/core/rows/coreRowsFeature.utils.js.map +1 -0
- package/dist/core/table/constructTable.cjs +69 -0
- package/dist/core/table/constructTable.cjs.map +1 -0
- package/dist/core/table/constructTable.d.cts +14 -0
- package/dist/core/table/constructTable.d.ts +14 -0
- package/dist/core/table/constructTable.js +67 -0
- package/dist/core/table/constructTable.js.map +1 -0
- package/dist/core/table/coreTablesFeature.cjs +21 -0
- package/dist/core/table/coreTablesFeature.cjs.map +1 -0
- package/dist/core/table/coreTablesFeature.d.cts +13 -0
- package/dist/core/table/coreTablesFeature.d.ts +13 -0
- package/dist/core/table/coreTablesFeature.js +20 -0
- package/dist/core/table/coreTablesFeature.js.map +1 -0
- package/dist/core/table/coreTablesFeature.types.d.cts +113 -0
- package/dist/core/table/coreTablesFeature.types.d.ts +113 -0
- package/dist/core/table/coreTablesFeature.utils.cjs +23 -0
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -0
- package/dist/core/table/coreTablesFeature.utils.d.cts +12 -0
- package/dist/core/table/coreTablesFeature.utils.d.ts +12 -0
- package/dist/core/table/coreTablesFeature.utils.js +21 -0
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -0
- package/dist/features/column-faceting/columnFacetingFeature.cjs +59 -0
- package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -0
- package/dist/features/column-faceting/columnFacetingFeature.d.cts +13 -0
- package/dist/features/column-faceting/columnFacetingFeature.d.ts +13 -0
- package/dist/features/column-faceting/columnFacetingFeature.js +58 -0
- package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -0
- package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +73 -0
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +73 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +35 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +16 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +16 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.js +29 -0
- package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs +36 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +9 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +9 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.js +36 -0
- package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -0
- package/dist/features/column-faceting/createFacetedRowModel.cjs +37 -0
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -0
- package/dist/features/column-faceting/createFacetedRowModel.d.cts +10 -0
- package/dist/features/column-faceting/createFacetedRowModel.d.ts +10 -0
- package/dist/features/column-faceting/createFacetedRowModel.js +37 -0
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs +33 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +9 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +9 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.js +33 -0
- package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -0
- package/dist/features/column-filtering/columnFilteringFeature.cjs +55 -0
- package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -0
- package/dist/features/column-filtering/columnFilteringFeature.d.cts +14 -0
- package/dist/features/column-filtering/columnFilteringFeature.d.ts +14 -0
- package/dist/features/column-filtering/columnFilteringFeature.js +54 -0
- package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -0
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +147 -0
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +147 -0
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +90 -0
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -0
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +21 -0
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +21 -0
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +80 -0
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -0
- package/dist/features/column-filtering/createFilteredRowModel.cjs +94 -0
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -0
- package/dist/features/column-filtering/createFilteredRowModel.d.cts +11 -0
- package/dist/features/column-filtering/createFilteredRowModel.d.ts +11 -0
- package/dist/features/column-filtering/createFilteredRowModel.js +94 -0
- package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -0
- package/dist/features/column-filtering/filterRowsUtils.cjs +76 -0
- package/dist/features/column-filtering/filterRowsUtils.cjs.map +1 -0
- package/dist/features/column-filtering/filterRowsUtils.js +76 -0
- package/dist/features/column-filtering/filterRowsUtils.js.map +1 -0
- package/dist/features/column-grouping/columnGroupingFeature.cjs +71 -0
- package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -0
- package/dist/features/column-grouping/columnGroupingFeature.d.cts +13 -0
- package/dist/features/column-grouping/columnGroupingFeature.d.ts +13 -0
- package/dist/features/column-grouping/columnGroupingFeature.js +70 -0
- package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -0
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +157 -0
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +157 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +88 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +27 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +27 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +74 -0
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -0
- package/dist/features/column-grouping/createGroupedRowModel.cjs +110 -0
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -0
- package/dist/features/column-grouping/createGroupedRowModel.d.cts +11 -0
- package/dist/features/column-grouping/createGroupedRowModel.d.ts +11 -0
- package/dist/features/column-grouping/createGroupedRowModel.js +110 -0
- package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -0
- package/dist/features/column-ordering/columnOrderingFeature.cjs +55 -0
- package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -0
- package/dist/features/column-ordering/columnOrderingFeature.d.cts +13 -0
- package/dist/features/column-ordering/columnOrderingFeature.d.ts +13 -0
- package/dist/features/column-ordering/columnOrderingFeature.js +54 -0
- package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -0
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +45 -0
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +45 -0
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +62 -0
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -0
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +19 -0
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +19 -0
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +55 -0
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -0
- package/dist/features/column-pinning/columnPinningFeature.cjs +178 -0
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -0
- package/dist/features/column-pinning/columnPinningFeature.d.cts +13 -0
- package/dist/features/column-pinning/columnPinningFeature.d.ts +13 -0
- package/dist/features/column-pinning/columnPinningFeature.js +177 -0
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -0
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +162 -0
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +162 -0
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +194 -0
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -0
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +43 -0
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +43 -0
- package/dist/features/column-pinning/columnPinningFeature.utils.js +164 -0
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -0
- package/dist/features/column-resizing/columnResizingFeature.cjs +46 -0
- package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -0
- package/dist/features/column-resizing/columnResizingFeature.d.cts +14 -0
- package/dist/features/column-resizing/columnResizingFeature.d.ts +14 -0
- package/dist/features/column-resizing/columnResizingFeature.js +45 -0
- package/dist/features/column-resizing/columnResizingFeature.js.map +1 -0
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +73 -0
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +73 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +156 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +19 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +19 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.js +149 -0
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -0
- package/dist/features/column-sizing/columnSizingFeature.cjs +69 -0
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -0
- package/dist/features/column-sizing/columnSizingFeature.d.cts +14 -0
- package/dist/features/column-sizing/columnSizingFeature.d.ts +14 -0
- package/dist/features/column-sizing/columnSizingFeature.js +68 -0
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -0
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +86 -0
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +86 -0
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +97 -0
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -0
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +30 -0
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +30 -0
- package/dist/features/column-sizing/columnSizingFeature.utils.js +84 -0
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -0
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +76 -0
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -0
- package/dist/features/column-visibility/columnVisibilityFeature.d.cts +13 -0
- package/dist/features/column-visibility/columnVisibilityFeature.d.ts +13 -0
- package/dist/features/column-visibility/columnVisibilityFeature.js +75 -0
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -0
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +89 -0
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +89 -0
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +84 -0
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -0
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +26 -0
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +26 -0
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +70 -0
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -0
- package/dist/features/global-filtering/globalFilteringFeature.cjs +46 -0
- package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -0
- package/dist/features/global-filtering/globalFilteringFeature.d.cts +14 -0
- package/dist/features/global-filtering/globalFilteringFeature.d.ts +14 -0
- package/dist/features/global-filtering/globalFilteringFeature.js +45 -0
- package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -0
- package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +64 -0
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +64 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +31 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +15 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +15 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.js +27 -0
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -0
- package/dist/features/row-expanding/createExpandedRowModel.cjs +45 -0
- package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -0
- package/dist/features/row-expanding/createExpandedRowModel.d.cts +11 -0
- package/dist/features/row-expanding/createExpandedRowModel.d.ts +11 -0
- package/dist/features/row-expanding/createExpandedRowModel.js +44 -0
- package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -0
- package/dist/features/row-expanding/rowExpandingFeature.cjs +51 -0
- package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -0
- package/dist/features/row-expanding/rowExpandingFeature.d.cts +13 -0
- package/dist/features/row-expanding/rowExpandingFeature.d.ts +13 -0
- package/dist/features/row-expanding/rowExpandingFeature.js +50 -0
- package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -0
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +121 -0
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +121 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +111 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +25 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +25 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +96 -0
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -0
- package/dist/features/row-pagination/createPaginatedRowModel.cjs +53 -0
- package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -0
- package/dist/features/row-pagination/createPaginatedRowModel.d.cts +10 -0
- package/dist/features/row-pagination/createPaginatedRowModel.d.ts +10 -0
- package/dist/features/row-pagination/createPaginatedRowModel.js +53 -0
- package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -0
- package/dist/features/row-pagination/rowPaginationFeature.cjs +49 -0
- package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -0
- package/dist/features/row-pagination/rowPaginationFeature.d.cts +13 -0
- package/dist/features/row-pagination/rowPaginationFeature.d.ts +13 -0
- package/dist/features/row-pagination/rowPaginationFeature.js +48 -0
- package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -0
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +124 -0
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +124 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +114 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +26 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +26 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.js +98 -0
- package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -0
- package/dist/features/row-pinning/rowPinningFeature.cjs +65 -0
- package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -0
- package/dist/features/row-pinning/rowPinningFeature.d.cts +13 -0
- package/dist/features/row-pinning/rowPinningFeature.d.ts +13 -0
- package/dist/features/row-pinning/rowPinningFeature.js +64 -0
- package/dist/features/row-pinning/rowPinningFeature.js.map +1 -0
- package/dist/features/row-pinning/rowPinningFeature.types.d.cts +77 -0
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +77 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +98 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +21 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +21 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.js +88 -0
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -0
- package/dist/features/row-selection/rowSelectionFeature.cjs +70 -0
- package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -0
- package/dist/features/row-selection/rowSelectionFeature.d.cts +13 -0
- package/dist/features/row-selection/rowSelectionFeature.d.ts +13 -0
- package/dist/features/row-selection/rowSelectionFeature.js +69 -0
- package/dist/features/row-selection/rowSelectionFeature.js.map +1 -0
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +128 -0
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +128 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +224 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +39 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +39 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.js +198 -0
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -0
- package/dist/features/row-sorting/createSortedRowModel.cjs +81 -0
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -0
- package/dist/features/row-sorting/createSortedRowModel.d.cts +11 -0
- package/dist/features/row-sorting/createSortedRowModel.d.ts +11 -0
- package/dist/features/row-sorting/createSortedRowModel.js +81 -0
- package/dist/features/row-sorting/createSortedRowModel.js.map +1 -0
- package/dist/features/row-sorting/rowSortingFeature.cjs +59 -0
- package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -0
- package/dist/features/row-sorting/rowSortingFeature.d.cts +13 -0
- package/dist/features/row-sorting/rowSortingFeature.d.ts +13 -0
- package/dist/features/row-sorting/rowSortingFeature.js +58 -0
- package/dist/features/row-sorting/rowSortingFeature.js.map +1 -0
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +182 -0
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +182 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +134 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +25 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +25 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.js +120 -0
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -0
- package/dist/features/stockFeatures.cjs +36 -0
- package/dist/features/stockFeatures.cjs.map +1 -0
- package/dist/features/stockFeatures.d.cts +36 -0
- package/dist/features/stockFeatures.d.ts +36 -0
- package/dist/{esm/features → features}/stockFeatures.js +20 -18
- package/dist/features/stockFeatures.js.map +1 -0
- package/dist/features/table-reactivity/tableReactivityFeature.cjs +24 -0
- package/dist/features/table-reactivity/tableReactivityFeature.cjs.map +1 -0
- package/dist/features/table-reactivity/tableReactivityFeature.d.cts +12 -0
- package/dist/features/table-reactivity/tableReactivityFeature.d.ts +12 -0
- package/dist/features/table-reactivity/tableReactivityFeature.js +23 -0
- package/dist/features/table-reactivity/tableReactivityFeature.js.map +1 -0
- package/dist/fns/aggregationFns.cjs +125 -0
- package/dist/fns/aggregationFns.cjs.map +1 -0
- package/dist/fns/aggregationFns.d.cts +54 -0
- package/dist/fns/aggregationFns.d.ts +54 -0
- package/dist/fns/aggregationFns.js +116 -0
- package/dist/fns/aggregationFns.js.map +1 -0
- package/dist/fns/filterFns.cjs +179 -0
- package/dist/fns/filterFns.cjs.map +1 -0
- package/dist/fns/filterFns.d.cts +81 -0
- package/dist/fns/filterFns.d.ts +81 -0
- package/dist/fns/filterFns.js +163 -0
- package/dist/fns/filterFns.js.map +1 -0
- package/dist/fns/sortFns.cjs +73 -0
- package/dist/fns/sortFns.cjs.map +1 -0
- package/dist/fns/sortFns.d.cts +22 -0
- package/dist/fns/sortFns.d.ts +22 -0
- package/dist/fns/sortFns.js +65 -0
- package/dist/fns/sortFns.js.map +1 -0
- package/dist/helpers/columnHelper.cjs +36 -0
- package/dist/helpers/columnHelper.cjs.map +1 -0
- package/dist/helpers/columnHelper.d.cts +66 -0
- package/dist/helpers/columnHelper.d.ts +66 -0
- package/dist/helpers/columnHelper.js +35 -0
- package/dist/helpers/columnHelper.js.map +1 -0
- package/dist/helpers/tableFeatures.cjs +20 -0
- package/dist/helpers/tableFeatures.cjs.map +1 -0
- package/dist/helpers/tableFeatures.d.cts +18 -0
- package/dist/{esm/helpers → helpers}/tableFeatures.d.ts +7 -2
- package/dist/helpers/tableFeatures.js +19 -0
- package/dist/helpers/tableFeatures.js.map +1 -0
- package/dist/helpers/tableHelper.cjs +21 -0
- package/dist/helpers/tableHelper.cjs.map +1 -0
- package/dist/helpers/tableHelper.d.cts +30 -0
- package/dist/helpers/tableHelper.d.ts +30 -0
- package/dist/helpers/tableHelper.js +21 -0
- package/dist/helpers/tableHelper.js.map +1 -0
- package/dist/helpers/tableOptions.cjs +9 -0
- package/dist/helpers/tableOptions.cjs.map +1 -0
- package/dist/helpers/tableOptions.d.cts +28 -0
- package/dist/helpers/tableOptions.d.ts +28 -0
- package/dist/helpers/tableOptions.js +8 -0
- package/dist/helpers/tableOptions.js.map +1 -0
- package/dist/index.cjs +420 -0
- package/dist/index.d.cts +100 -0
- package/dist/index.d.ts +100 -0
- package/dist/{esm/index.js → index.js} +42 -395
- package/dist/types/Cell.d.cts +16 -0
- package/dist/types/Cell.d.ts +16 -0
- package/dist/types/Column.d.cts +29 -0
- package/dist/types/Column.d.ts +29 -0
- package/dist/types/ColumnDef.d.cts +66 -0
- package/dist/types/ColumnDef.d.ts +66 -0
- package/dist/types/Header.d.cts +17 -0
- package/dist/types/Header.d.ts +17 -0
- package/dist/types/HeaderGroup.d.cts +15 -0
- package/dist/types/HeaderGroup.d.ts +15 -0
- package/dist/types/Row.d.cts +22 -0
- package/dist/types/Row.d.ts +22 -0
- package/dist/types/RowModel.d.cts +26 -0
- package/dist/types/RowModel.d.ts +26 -0
- package/dist/types/RowModelFns.d.cts +18 -0
- package/dist/types/RowModelFns.d.ts +18 -0
- package/dist/types/Table.d.cts +57 -0
- package/dist/types/Table.d.ts +57 -0
- package/dist/types/TableFeatures.d.cts +77 -0
- package/dist/types/TableFeatures.d.ts +77 -0
- package/dist/types/TableOptions.d.cts +39 -0
- package/dist/types/TableOptions.d.ts +39 -0
- package/dist/types/TableState.d.cts +27 -0
- package/dist/types/TableState.d.ts +27 -0
- package/dist/types/type-utils.d.cts +23 -0
- package/dist/types/type-utils.d.ts +23 -0
- package/dist/utils.cjs +210 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +90 -0
- package/dist/utils.d.ts +90 -0
- package/dist/utils.js +196 -0
- package/dist/utils.js.map +1 -0
- package/package.json +8 -8
- package/src/features/column-resizing/columnResizingFeature.utils.ts +8 -2
- package/src/process-env.d.ts +6 -0
- package/dist/esm/core/cells/constructCell.d.ts +0 -7
- package/dist/esm/core/cells/constructCell.js +0 -21
- package/dist/esm/core/cells/constructCell.js.map +0 -1
- package/dist/esm/core/cells/coreCellsFeature.d.ts +0 -10
- package/dist/esm/core/cells/coreCellsFeature.js +0 -26
- package/dist/esm/core/cells/coreCellsFeature.js.map +0 -1
- package/dist/esm/core/cells/coreCellsFeature.types.d.ts +0 -52
- package/dist/esm/core/cells/coreCellsFeature.utils.d.ts +0 -13
- package/dist/esm/core/cells/coreCellsFeature.utils.js +0 -23
- package/dist/esm/core/cells/coreCellsFeature.utils.js.map +0 -1
- package/dist/esm/core/columns/constructColumn.d.ts +0 -6
- package/dist/esm/core/columns/constructColumn.js +0 -60
- package/dist/esm/core/columns/constructColumn.js.map +0 -1
- package/dist/esm/core/columns/coreColumnsFeature.d.ts +0 -10
- package/dist/esm/core/columns/coreColumnsFeature.js +0 -61
- package/dist/esm/core/columns/coreColumnsFeature.js.map +0 -1
- package/dist/esm/core/columns/coreColumnsFeature.types.d.ts +0 -84
- package/dist/esm/core/columns/coreColumnsFeature.utils.d.ts +0 -13
- package/dist/esm/core/columns/coreColumnsFeature.utils.js +0 -91
- package/dist/esm/core/columns/coreColumnsFeature.utils.js.map +0 -1
- package/dist/esm/core/coreFeatures.d.ts +0 -15
- package/dist/esm/core/coreFeatures.js.map +0 -1
- package/dist/esm/core/headers/buildHeaderGroups.d.ts +0 -6
- package/dist/esm/core/headers/buildHeaderGroups.js +0 -99
- package/dist/esm/core/headers/buildHeaderGroups.js.map +0 -1
- package/dist/esm/core/headers/constructHeader.d.ts +0 -12
- package/dist/esm/core/headers/constructHeader.js +0 -28
- package/dist/esm/core/headers/constructHeader.js.map +0 -1
- package/dist/esm/core/headers/coreHeadersFeature.d.ts +0 -10
- package/dist/esm/core/headers/coreHeadersFeature.js +0 -68
- package/dist/esm/core/headers/coreHeadersFeature.js.map +0 -1
- package/dist/esm/core/headers/coreHeadersFeature.types.d.ts +0 -99
- package/dist/esm/core/headers/coreHeadersFeature.utils.d.ts +0 -15
- package/dist/esm/core/headers/coreHeadersFeature.utils.js +0 -85
- package/dist/esm/core/headers/coreHeadersFeature.utils.js.map +0 -1
- package/dist/esm/core/row-models/coreRowModelsFeature.d.ts +0 -10
- package/dist/esm/core/row-models/coreRowModelsFeature.js +0 -52
- package/dist/esm/core/row-models/coreRowModelsFeature.js.map +0 -1
- package/dist/esm/core/row-models/coreRowModelsFeature.types.d.ts +0 -39
- package/dist/esm/core/row-models/coreRowModelsFeature.utils.d.ts +0 -16
- package/dist/esm/core/row-models/coreRowModelsFeature.utils.js +0 -85
- package/dist/esm/core/row-models/coreRowModelsFeature.utils.js.map +0 -1
- package/dist/esm/core/row-models/createCoreRowModel.d.ts +0 -5
- package/dist/esm/core/row-models/createCoreRowModel.js +0 -54
- package/dist/esm/core/row-models/createCoreRowModel.js.map +0 -1
- package/dist/esm/core/rows/constructRow.d.ts +0 -5
- package/dist/esm/core/rows/constructRow.js +0 -29
- package/dist/esm/core/rows/constructRow.js.map +0 -1
- package/dist/esm/core/rows/coreRowsFeature.d.ts +0 -10
- package/dist/esm/core/rows/coreRowsFeature.js +0 -52
- package/dist/esm/core/rows/coreRowsFeature.js.map +0 -1
- package/dist/esm/core/rows/coreRowsFeature.types.d.ts +0 -91
- package/dist/esm/core/rows/coreRowsFeature.utils.d.ts +0 -15
- package/dist/esm/core/rows/coreRowsFeature.utils.js +0 -94
- package/dist/esm/core/rows/coreRowsFeature.utils.js.map +0 -1
- package/dist/esm/core/table/constructTable.d.ts +0 -9
- package/dist/esm/core/table/constructTable.js +0 -68
- package/dist/esm/core/table/constructTable.js.map +0 -1
- package/dist/esm/core/table/coreTablesFeature.d.ts +0 -10
- package/dist/esm/core/table/coreTablesFeature.js +0 -22
- package/dist/esm/core/table/coreTablesFeature.js.map +0 -1
- package/dist/esm/core/table/coreTablesFeature.types.d.ts +0 -109
- package/dist/esm/core/table/coreTablesFeature.utils.d.ts +0 -7
- package/dist/esm/core/table/coreTablesFeature.utils.js +0 -24
- package/dist/esm/core/table/coreTablesFeature.utils.js.map +0 -1
- package/dist/esm/features/column-faceting/columnFacetingFeature.d.ts +0 -10
- package/dist/esm/features/column-faceting/columnFacetingFeature.js +0 -80
- package/dist/esm/features/column-faceting/columnFacetingFeature.js.map +0 -1
- package/dist/esm/features/column-faceting/columnFacetingFeature.types.d.ts +0 -68
- package/dist/esm/features/column-faceting/columnFacetingFeature.utils.d.ts +0 -11
- package/dist/esm/features/column-faceting/columnFacetingFeature.utils.js +0 -33
- package/dist/esm/features/column-faceting/columnFacetingFeature.utils.js.map +0 -1
- package/dist/esm/features/column-faceting/createFacetedMinMaxValues.d.ts +0 -4
- package/dist/esm/features/column-faceting/createFacetedMinMaxValues.js +0 -41
- package/dist/esm/features/column-faceting/createFacetedMinMaxValues.js.map +0 -1
- package/dist/esm/features/column-faceting/createFacetedRowModel.d.ts +0 -5
- package/dist/esm/features/column-faceting/createFacetedRowModel.js +0 -47
- package/dist/esm/features/column-faceting/createFacetedRowModel.js.map +0 -1
- package/dist/esm/features/column-faceting/createFacetedUniqueValues.d.ts +0 -4
- package/dist/esm/features/column-faceting/createFacetedUniqueValues.js +0 -46
- package/dist/esm/features/column-faceting/createFacetedUniqueValues.js.map +0 -1
- package/dist/esm/features/column-filtering/columnFilteringFeature.d.ts +0 -11
- package/dist/esm/features/column-filtering/columnFilteringFeature.js +0 -69
- package/dist/esm/features/column-filtering/columnFilteringFeature.js.map +0 -1
- package/dist/esm/features/column-filtering/columnFilteringFeature.types.d.ts +0 -145
- package/dist/esm/features/column-filtering/columnFilteringFeature.utils.d.ts +0 -16
- package/dist/esm/features/column-filtering/columnFilteringFeature.utils.js +0 -118
- package/dist/esm/features/column-filtering/columnFilteringFeature.utils.js.map +0 -1
- package/dist/esm/features/column-filtering/createFilteredRowModel.d.ts +0 -6
- package/dist/esm/features/column-filtering/createFilteredRowModel.js +0 -110
- package/dist/esm/features/column-filtering/createFilteredRowModel.js.map +0 -1
- package/dist/esm/features/column-filtering/filterRowsUtils.d.ts +0 -6
- package/dist/esm/features/column-filtering/filterRowsUtils.js +0 -95
- package/dist/esm/features/column-filtering/filterRowsUtils.js.map +0 -1
- package/dist/esm/features/column-grouping/columnGroupingFeature.d.ts +0 -10
- package/dist/esm/features/column-grouping/columnGroupingFeature.js +0 -91
- package/dist/esm/features/column-grouping/columnGroupingFeature.js.map +0 -1
- package/dist/esm/features/column-grouping/columnGroupingFeature.types.d.ts +0 -153
- package/dist/esm/features/column-grouping/columnGroupingFeature.utils.d.ts +0 -22
- package/dist/esm/features/column-grouping/columnGroupingFeature.utils.js +0 -99
- package/dist/esm/features/column-grouping/columnGroupingFeature.utils.js.map +0 -1
- package/dist/esm/features/column-grouping/createGroupedRowModel.d.ts +0 -6
- package/dist/esm/features/column-grouping/createGroupedRowModel.js +0 -144
- package/dist/esm/features/column-grouping/createGroupedRowModel.js.map +0 -1
- package/dist/esm/features/column-ordering/columnOrderingFeature.d.ts +0 -10
- package/dist/esm/features/column-ordering/columnOrderingFeature.js +0 -60
- package/dist/esm/features/column-ordering/columnOrderingFeature.js.map +0 -1
- package/dist/esm/features/column-ordering/columnOrderingFeature.types.d.ts +0 -40
- package/dist/esm/features/column-ordering/columnOrderingFeature.utils.d.ts +0 -14
- package/dist/esm/features/column-ordering/columnOrderingFeature.utils.js +0 -72
- package/dist/esm/features/column-ordering/columnOrderingFeature.utils.js.map +0 -1
- package/dist/esm/features/column-pinning/columnPinningFeature.d.ts +0 -10
- package/dist/esm/features/column-pinning/columnPinningFeature.js +0 -260
- package/dist/esm/features/column-pinning/columnPinningFeature.js.map +0 -1
- package/dist/esm/features/column-pinning/columnPinningFeature.types.d.ts +0 -157
- package/dist/esm/features/column-pinning/columnPinningFeature.utils.d.ts +0 -39
- package/dist/esm/features/column-pinning/columnPinningFeature.utils.js +0 -325
- package/dist/esm/features/column-pinning/columnPinningFeature.utils.js.map +0 -1
- package/dist/esm/features/column-resizing/columnResizingFeature.d.ts +0 -11
- package/dist/esm/features/column-resizing/columnResizingFeature.js +0 -52
- package/dist/esm/features/column-resizing/columnResizingFeature.js.map +0 -1
- package/dist/esm/features/column-resizing/columnResizingFeature.types.d.ts +0 -68
- package/dist/esm/features/column-resizing/columnResizingFeature.utils.d.ts +0 -14
- package/dist/esm/features/column-resizing/columnResizingFeature.utils.js +0 -193
- package/dist/esm/features/column-resizing/columnResizingFeature.utils.js.map +0 -1
- package/dist/esm/features/column-sizing/columnSizingFeature.d.ts +0 -11
- package/dist/esm/features/column-sizing/columnSizingFeature.js +0 -95
- package/dist/esm/features/column-sizing/columnSizingFeature.js.map +0 -1
- package/dist/esm/features/column-sizing/columnSizingFeature.types.d.ts +0 -81
- package/dist/esm/features/column-sizing/columnSizingFeature.utils.d.ts +0 -25
- package/dist/esm/features/column-sizing/columnSizingFeature.utils.js +0 -128
- package/dist/esm/features/column-sizing/columnSizingFeature.utils.js.map +0 -1
- package/dist/esm/features/column-visibility/columnVisibilityFeature.d.ts +0 -10
- package/dist/esm/features/column-visibility/columnVisibilityFeature.js +0 -100
- package/dist/esm/features/column-visibility/columnVisibilityFeature.js.map +0 -1
- package/dist/esm/features/column-visibility/columnVisibilityFeature.types.d.ts +0 -84
- package/dist/esm/features/column-visibility/columnVisibilityFeature.utils.d.ts +0 -22
- package/dist/esm/features/column-visibility/columnVisibilityFeature.utils.js +0 -105
- package/dist/esm/features/column-visibility/columnVisibilityFeature.utils.js.map +0 -1
- package/dist/esm/features/global-filtering/globalFilteringFeature.d.ts +0 -11
- package/dist/esm/features/global-filtering/globalFilteringFeature.js +0 -51
- package/dist/esm/features/global-filtering/globalFilteringFeature.js.map +0 -1
- package/dist/esm/features/global-filtering/globalFilteringFeature.types.d.ts +0 -59
- package/dist/esm/features/global-filtering/globalFilteringFeature.utils.d.ts +0 -10
- package/dist/esm/features/global-filtering/globalFilteringFeature.utils.js +0 -30
- package/dist/esm/features/global-filtering/globalFilteringFeature.utils.js.map +0 -1
- package/dist/esm/features/row-expanding/createExpandedRowModel.d.ts +0 -6
- package/dist/esm/features/row-expanding/createExpandedRowModel.js +0 -49
- package/dist/esm/features/row-expanding/createExpandedRowModel.js.map +0 -1
- package/dist/esm/features/row-expanding/rowExpandingFeature.d.ts +0 -10
- package/dist/esm/features/row-expanding/rowExpandingFeature.js +0 -74
- package/dist/esm/features/row-expanding/rowExpandingFeature.js.map +0 -1
- package/dist/esm/features/row-expanding/rowExpandingFeature.types.d.ts +0 -116
- package/dist/esm/features/row-expanding/rowExpandingFeature.utils.d.ts +0 -20
- package/dist/esm/features/row-expanding/rowExpandingFeature.utils.js +0 -125
- package/dist/esm/features/row-expanding/rowExpandingFeature.utils.js.map +0 -1
- package/dist/esm/features/row-pagination/createPaginatedRowModel.d.ts +0 -5
- package/dist/esm/features/row-pagination/createPaginatedRowModel.js +0 -58
- package/dist/esm/features/row-pagination/createPaginatedRowModel.js.map +0 -1
- package/dist/esm/features/row-pagination/rowPaginationFeature.d.ts +0 -10
- package/dist/esm/features/row-pagination/rowPaginationFeature.js +0 -78
- package/dist/esm/features/row-pagination/rowPaginationFeature.js.map +0 -1
- package/dist/esm/features/row-pagination/rowPaginationFeature.types.d.ts +0 -119
- package/dist/esm/features/row-pagination/rowPaginationFeature.utils.d.ts +0 -21
- package/dist/esm/features/row-pagination/rowPaginationFeature.utils.js +0 -126
- package/dist/esm/features/row-pagination/rowPaginationFeature.utils.js.map +0 -1
- package/dist/esm/features/row-pinning/rowPinningFeature.d.ts +0 -10
- package/dist/esm/features/row-pinning/rowPinningFeature.js +0 -80
- package/dist/esm/features/row-pinning/rowPinningFeature.js.map +0 -1
- package/dist/esm/features/row-pinning/rowPinningFeature.types.d.ts +0 -72
- package/dist/esm/features/row-pinning/rowPinningFeature.utils.d.ts +0 -16
- package/dist/esm/features/row-pinning/rowPinningFeature.utils.js +0 -115
- package/dist/esm/features/row-pinning/rowPinningFeature.utils.js.map +0 -1
- package/dist/esm/features/row-selection/rowSelectionFeature.d.ts +0 -10
- package/dist/esm/features/row-selection/rowSelectionFeature.js +0 -112
- package/dist/esm/features/row-selection/rowSelectionFeature.js.map +0 -1
- package/dist/esm/features/row-selection/rowSelectionFeature.types.d.ts +0 -123
- package/dist/esm/features/row-selection/rowSelectionFeature.utils.d.ts +0 -34
- package/dist/esm/features/row-selection/rowSelectionFeature.utils.js +0 -290
- package/dist/esm/features/row-selection/rowSelectionFeature.utils.js.map +0 -1
- package/dist/esm/features/row-sorting/createSortedRowModel.d.ts +0 -6
- package/dist/esm/features/row-sorting/createSortedRowModel.js +0 -94
- package/dist/esm/features/row-sorting/createSortedRowModel.js.map +0 -1
- package/dist/esm/features/row-sorting/rowSortingFeature.d.ts +0 -10
- package/dist/esm/features/row-sorting/rowSortingFeature.js +0 -82
- package/dist/esm/features/row-sorting/rowSortingFeature.js.map +0 -1
- package/dist/esm/features/row-sorting/rowSortingFeature.types.d.ts +0 -178
- package/dist/esm/features/row-sorting/rowSortingFeature.utils.d.ts +0 -20
- package/dist/esm/features/row-sorting/rowSortingFeature.utils.js +0 -181
- package/dist/esm/features/row-sorting/rowSortingFeature.utils.js.map +0 -1
- package/dist/esm/features/stockFeatures.d.ts +0 -31
- package/dist/esm/features/stockFeatures.js.map +0 -1
- package/dist/esm/features/table-reactivity/tableReactivityFeature.d.ts +0 -9
- package/dist/esm/features/table-reactivity/tableReactivityFeature.js +0 -30
- package/dist/esm/features/table-reactivity/tableReactivityFeature.js.map +0 -1
- package/dist/esm/fns/aggregationFns.d.ts +0 -49
- package/dist/esm/fns/aggregationFns.js +0 -110
- package/dist/esm/fns/aggregationFns.js.map +0 -1
- package/dist/esm/fns/filterFns.d.ts +0 -76
- package/dist/esm/fns/filterFns.js +0 -134
- package/dist/esm/fns/filterFns.js.map +0 -1
- package/dist/esm/fns/sortFns.d.ts +0 -17
- package/dist/esm/fns/sortFns.js +0 -97
- package/dist/esm/fns/sortFns.js.map +0 -1
- package/dist/esm/helpers/columnHelper.d.ts +0 -61
- package/dist/esm/helpers/columnHelper.js +0 -20
- package/dist/esm/helpers/columnHelper.js.map +0 -1
- package/dist/esm/helpers/tableFeatures.js +0 -7
- package/dist/esm/helpers/tableFeatures.js.map +0 -1
- package/dist/esm/helpers/tableHelper.d.ts +0 -25
- package/dist/esm/helpers/tableHelper.js +0 -13
- package/dist/esm/helpers/tableHelper.js.map +0 -1
- package/dist/esm/helpers/tableOptions.d.ts +0 -23
- package/dist/esm/helpers/tableOptions.js +0 -7
- package/dist/esm/helpers/tableOptions.js.map +0 -1
- package/dist/esm/index.d.ts +0 -111
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/Cell.d.ts +0 -13
- package/dist/esm/types/Column.d.ts +0 -26
- package/dist/esm/types/ColumnDef.d.ts +0 -64
- package/dist/esm/types/Header.d.ts +0 -14
- package/dist/esm/types/HeaderGroup.d.ts +0 -12
- package/dist/esm/types/Row.d.ts +0 -19
- package/dist/esm/types/RowModel.d.ts +0 -23
- package/dist/esm/types/RowModelFns.d.ts +0 -15
- package/dist/esm/types/Table.d.ts +0 -53
- package/dist/esm/types/TableFeatures.d.ts +0 -77
- package/dist/esm/types/TableOptions.d.ts +0 -39
- package/dist/esm/types/TableState.d.ts +0 -23
- package/dist/esm/types/type-utils.d.ts +0 -22
- package/dist/esm/utils.d.ts +0 -72
- package/dist/esm/utils.js +0 -231
- package/dist/esm/utils.js.map +0 -1
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { NoInfer, RowData, Updater } from "./types/type-utils.js";
|
|
2
|
+
import { TableState, TableState_All } from "./types/TableState.js";
|
|
3
|
+
import { TableFeatures } from "./types/TableFeatures.js";
|
|
4
|
+
import { Table, Table_Internal } from "./types/Table.js";
|
|
5
|
+
|
|
6
|
+
//#region src/utils.d.ts
|
|
7
|
+
declare function functionalUpdate<T>(updater: Updater<T>, input: T): T;
|
|
8
|
+
declare function noop(): void;
|
|
9
|
+
declare function makeStateUpdater<TFeatures extends TableFeatures, K extends (string & {}) | keyof TableState_All | keyof TableState<TFeatures>>(key: K, instance: Table<TFeatures, any>): (updater: Updater<TableState<any>[K & keyof TableState<any>]>) => void;
|
|
10
|
+
type AnyFunction = (...args: any) => any;
|
|
11
|
+
declare function isFunction<T extends AnyFunction>(d: any): d is T;
|
|
12
|
+
declare function isNumberArray(d: any): d is Array<number>;
|
|
13
|
+
declare function flattenBy<TNode>(arr: Array<TNode>, getChildren: (item: TNode) => Array<TNode>): TNode[];
|
|
14
|
+
declare const $internalMemoFnMeta: unique symbol;
|
|
15
|
+
type MemoFnMeta = {
|
|
16
|
+
originalArgsLength?: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
declare function getMemoFnMeta(fn: any): MemoFnMeta | null;
|
|
22
|
+
interface MemoOptions<TDeps extends ReadonlyArray<any>, TDepArgs, TResult> {
|
|
23
|
+
fn: (...args: NoInfer<TDeps>) => TResult;
|
|
24
|
+
memoDeps?: (depArgs?: TDepArgs) => [...TDeps] | undefined;
|
|
25
|
+
onAfterCompare?: (depsChanged: boolean) => void;
|
|
26
|
+
onAfterUpdate?: (result: TResult) => void;
|
|
27
|
+
onBeforeCompare?: () => void;
|
|
28
|
+
onBeforeUpdate?: () => void;
|
|
29
|
+
}
|
|
30
|
+
declare const memo: <TDeps extends ReadonlyArray<any>, TDepArgs, TResult>({
|
|
31
|
+
fn,
|
|
32
|
+
memoDeps,
|
|
33
|
+
onAfterCompare,
|
|
34
|
+
onAfterUpdate,
|
|
35
|
+
onBeforeCompare,
|
|
36
|
+
onBeforeUpdate
|
|
37
|
+
}: MemoOptions<TDeps, TDepArgs, TResult>) => ((depArgs?: TDepArgs) => TResult);
|
|
38
|
+
interface TableMemoOptions<TFeatures extends TableFeatures, TDeps extends ReadonlyArray<any>, TDepArgs, TResult> extends MemoOptions<TDeps, TDepArgs, TResult> {
|
|
39
|
+
feature?: keyof TFeatures & string;
|
|
40
|
+
fnName: string;
|
|
41
|
+
objectId?: string;
|
|
42
|
+
onAfterUpdate?: () => void;
|
|
43
|
+
table: Table_Internal<TFeatures, any>;
|
|
44
|
+
}
|
|
45
|
+
declare function tableMemo<TFeatures extends TableFeatures, TDeps extends ReadonlyArray<any>, TDepArgs, TResult>({
|
|
46
|
+
feature,
|
|
47
|
+
fnName,
|
|
48
|
+
objectId,
|
|
49
|
+
onAfterUpdate,
|
|
50
|
+
table,
|
|
51
|
+
...memoOptions
|
|
52
|
+
}: TableMemoOptions<TFeatures, TDeps, TDepArgs, TResult>): (depArgs?: TDepArgs | undefined) => TResult;
|
|
53
|
+
interface API<TDeps extends ReadonlyArray<any>, TDepArgs> {
|
|
54
|
+
fn: (...args: any) => any;
|
|
55
|
+
memoDeps?: (depArgs?: any) => [...any] | undefined;
|
|
56
|
+
}
|
|
57
|
+
type APIObject<TDeps extends ReadonlyArray<any>, TDepArgs> = Record<string, API<TDeps, TDepArgs>>;
|
|
58
|
+
/**
|
|
59
|
+
* Assumes that a function name is in the format of `parentName_fnKey` and returns the `fnKey` and `fnName` in the format of `parentName.fnKey`.
|
|
60
|
+
*/
|
|
61
|
+
declare function getFunctionNameInfo(staticFnName: string, splitBy?: '_' | '.'): {
|
|
62
|
+
fnKey: string;
|
|
63
|
+
fnName: string;
|
|
64
|
+
parentName: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Assigns Table API methods directly to the table instance.
|
|
68
|
+
* Unlike row/cell/column/header, the table is a singleton so methods are assigned directly.
|
|
69
|
+
*/
|
|
70
|
+
declare function assignTableAPIs<TFeatures extends TableFeatures, TData extends RowData, TDeps extends ReadonlyArray<any>, TDepArgs>(feature: keyof TFeatures & string, table: Table_Internal<TFeatures, TData>, apis: APIObject<TDeps, NoInfer<TDepArgs>>): void;
|
|
71
|
+
interface PrototypeAPI<TDeps extends ReadonlyArray<any>, TDepArgs> {
|
|
72
|
+
fn: (self: any, ...args: any) => any;
|
|
73
|
+
memoDeps?: (self: any, depArgs?: any) => [...any] | undefined;
|
|
74
|
+
}
|
|
75
|
+
type PrototypeAPIObject<TDeps extends ReadonlyArray<any>, TDepArgs> = Record<string, PrototypeAPI<TDeps, TDepArgs>>;
|
|
76
|
+
/**
|
|
77
|
+
* Assigns API methods to a prototype object for memory-efficient method sharing.
|
|
78
|
+
* All instances created with this prototype will share the same method references.
|
|
79
|
+
*
|
|
80
|
+
* For memoized methods, the memo state is lazily created and stored on each instance.
|
|
81
|
+
* This provides the best of both worlds: shared method code + per-instance caching.
|
|
82
|
+
*/
|
|
83
|
+
declare function assignPrototypeAPIs<TFeatures extends TableFeatures, TData extends RowData, TDeps extends ReadonlyArray<any>, TDepArgs>(feature: keyof TFeatures & string, prototype: Record<string, any>, table: Table_Internal<TFeatures, TData>, apis: PrototypeAPIObject<TDeps, NoInfer<TDepArgs>>): void;
|
|
84
|
+
/**
|
|
85
|
+
* Looks to run the memoized function with the builder pattern on the object if it exists, otherwise fallback to the static method passed in.
|
|
86
|
+
*/
|
|
87
|
+
declare function callMemoOrStaticFn<TObject extends Record<string, any>, TStaticFn extends AnyFunction>(obj: TObject, fnKey: string, staticFn: TStaticFn, ...args: Parameters<TStaticFn> extends [any, ...infer Rest] ? Rest : never): ReturnType<TStaticFn>;
|
|
88
|
+
//#endregion
|
|
89
|
+
export { $internalMemoFnMeta, API, APIObject, MemoFnMeta, PrototypeAPI, PrototypeAPIObject, assignPrototypeAPIs, assignTableAPIs, callMemoOrStaticFn, flattenBy, functionalUpdate, getFunctionNameInfo, getMemoFnMeta, isFunction, isNumberArray, makeStateUpdater, memo, noop, tableMemo };
|
|
90
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
//#region src/utils.ts
|
|
2
|
+
function functionalUpdate(updater, input) {
|
|
3
|
+
return typeof updater === "function" ? updater(input) : updater;
|
|
4
|
+
}
|
|
5
|
+
function noop() {}
|
|
6
|
+
function makeStateUpdater(key, instance) {
|
|
7
|
+
return (updater) => {
|
|
8
|
+
instance.baseStore.setState((old) => {
|
|
9
|
+
return {
|
|
10
|
+
...old,
|
|
11
|
+
[key]: functionalUpdate(updater, old[key])
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function isFunction(d) {
|
|
17
|
+
return d instanceof Function;
|
|
18
|
+
}
|
|
19
|
+
function isNumberArray(d) {
|
|
20
|
+
return Array.isArray(d) && d.every((val) => typeof val === "number");
|
|
21
|
+
}
|
|
22
|
+
function flattenBy(arr, getChildren) {
|
|
23
|
+
const flat = [];
|
|
24
|
+
const recurse = (subArr) => {
|
|
25
|
+
subArr.forEach((item) => {
|
|
26
|
+
flat.push(item);
|
|
27
|
+
const children = getChildren(item);
|
|
28
|
+
if (children.length) recurse(children);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
recurse(arr);
|
|
32
|
+
return flat;
|
|
33
|
+
}
|
|
34
|
+
const $internalMemoFnMeta = Symbol("memoFnMeta");
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
function setMemoFnMeta(fn, meta) {
|
|
39
|
+
Object.defineProperty(fn, $internalMemoFnMeta, { value: meta });
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
function getMemoFnMeta(fn) {
|
|
45
|
+
return (typeof fn === "function" && fn[$internalMemoFnMeta]) ?? null;
|
|
46
|
+
}
|
|
47
|
+
const memo = ({ fn, memoDeps, onAfterCompare, onAfterUpdate, onBeforeCompare, onBeforeUpdate }) => {
|
|
48
|
+
let deps = [];
|
|
49
|
+
let result;
|
|
50
|
+
const memoizedFn = (depArgs) => {
|
|
51
|
+
onBeforeCompare === null || onBeforeCompare === void 0 || onBeforeCompare();
|
|
52
|
+
const newDeps = memoDeps === null || memoDeps === void 0 ? void 0 : memoDeps(depArgs);
|
|
53
|
+
const depsChanged = !newDeps || newDeps.length !== (deps === null || deps === void 0 ? void 0 : deps.length) || newDeps.some((dep, index) => (deps === null || deps === void 0 ? void 0 : deps[index]) !== dep);
|
|
54
|
+
onAfterCompare === null || onAfterCompare === void 0 || onAfterCompare(depsChanged);
|
|
55
|
+
if (!depsChanged) return result;
|
|
56
|
+
deps = newDeps;
|
|
57
|
+
onBeforeUpdate === null || onBeforeUpdate === void 0 || onBeforeUpdate();
|
|
58
|
+
result = fn(...newDeps ?? []);
|
|
59
|
+
onAfterUpdate === null || onAfterUpdate === void 0 || onAfterUpdate(result);
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
setMemoFnMeta(memoizedFn, { originalArgsLength: fn.length });
|
|
63
|
+
return memoizedFn;
|
|
64
|
+
};
|
|
65
|
+
const pad = (str, num) => {
|
|
66
|
+
str = String(str);
|
|
67
|
+
while (str.length < num) str = " " + str;
|
|
68
|
+
return str;
|
|
69
|
+
};
|
|
70
|
+
function tableMemo({ feature, fnName, objectId, onAfterUpdate, table, ...memoOptions }) {
|
|
71
|
+
let beforeCompareTime;
|
|
72
|
+
let afterCompareTime;
|
|
73
|
+
let startCalcTime;
|
|
74
|
+
let endCalcTime;
|
|
75
|
+
let runCount = 0;
|
|
76
|
+
let debug;
|
|
77
|
+
let debugCache;
|
|
78
|
+
if (process.env.NODE_ENV === "development") {
|
|
79
|
+
const { debugCache: _debugCache, debugAll } = table.options;
|
|
80
|
+
debugCache = _debugCache;
|
|
81
|
+
const { parentName } = getFunctionNameInfo(fnName, ".");
|
|
82
|
+
debug = debugAll || table.options[`debug${(parentName != "table" ? parentName + "s" : parentName).replace(parentName, parentName.charAt(0).toUpperCase() + parentName.slice(1))}`] || (feature ? table.options[`debug${feature.charAt(0).toUpperCase() + feature.slice(1)}`] : false);
|
|
83
|
+
}
|
|
84
|
+
function logTime(time, depsChanged) {
|
|
85
|
+
var _memoOptions$memoDeps;
|
|
86
|
+
const runType = runCount === 0 ? "(1st run)" : depsChanged ? "(rerun #" + runCount + ")" : "(cache)";
|
|
87
|
+
runCount++;
|
|
88
|
+
console.groupCollapsed(`%c⏱ ${pad(`${time.toFixed(1)} ms`, 12)} %c${runType}%c ${fnName}%c ${objectId ? `(${fnName.split(".")[0]}Id: ${objectId})` : ""}`, `font-size: .6rem; font-weight: bold; ${depsChanged ? `color: hsl(
|
|
89
|
+
${Math.max(0, Math.min(120 - Math.log10(time) * 60, 120))}deg 100% 31%);` : ""} `, `color: ${runCount < 2 ? "#FF00FF" : "#FF1493"}`, "color: #666", "color: #87CEEB");
|
|
90
|
+
console.info({
|
|
91
|
+
feature,
|
|
92
|
+
state: table.store.state,
|
|
93
|
+
deps: (_memoOptions$memoDeps = memoOptions.memoDeps) === null || _memoOptions$memoDeps === void 0 ? void 0 : _memoOptions$memoDeps.toString()
|
|
94
|
+
});
|
|
95
|
+
console.trace();
|
|
96
|
+
console.groupEnd();
|
|
97
|
+
}
|
|
98
|
+
const debugOptions = process.env.NODE_ENV === "development" ? {
|
|
99
|
+
onBeforeCompare: () => {
|
|
100
|
+
if (debugCache) beforeCompareTime = performance.now();
|
|
101
|
+
},
|
|
102
|
+
onAfterCompare: (depsChanged) => {
|
|
103
|
+
if (debugCache) {
|
|
104
|
+
afterCompareTime = performance.now();
|
|
105
|
+
const compareTime = Math.round((afterCompareTime - beforeCompareTime) * 100) / 100;
|
|
106
|
+
if (!depsChanged) logTime(compareTime, depsChanged);
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
onBeforeUpdate: () => {
|
|
110
|
+
if (debug) startCalcTime = performance.now();
|
|
111
|
+
},
|
|
112
|
+
onAfterUpdate: () => {
|
|
113
|
+
if (debug) {
|
|
114
|
+
endCalcTime = performance.now();
|
|
115
|
+
logTime(Math.round((endCalcTime - startCalcTime) * 100) / 100, true);
|
|
116
|
+
}
|
|
117
|
+
queueMicrotask(() => onAfterUpdate === null || onAfterUpdate === void 0 ? void 0 : onAfterUpdate());
|
|
118
|
+
}
|
|
119
|
+
} : { onAfterUpdate: () => {
|
|
120
|
+
queueMicrotask(() => onAfterUpdate === null || onAfterUpdate === void 0 ? void 0 : onAfterUpdate());
|
|
121
|
+
} };
|
|
122
|
+
return memo({
|
|
123
|
+
...memoOptions,
|
|
124
|
+
...debugOptions
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Assumes that a function name is in the format of `parentName_fnKey` and returns the `fnKey` and `fnName` in the format of `parentName.fnKey`.
|
|
129
|
+
*/
|
|
130
|
+
function getFunctionNameInfo(staticFnName, splitBy = "_") {
|
|
131
|
+
const [parentName, fnKey] = staticFnName.split(splitBy);
|
|
132
|
+
return {
|
|
133
|
+
fnKey,
|
|
134
|
+
fnName: `${parentName}.${fnKey}`,
|
|
135
|
+
parentName
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Assigns Table API methods directly to the table instance.
|
|
140
|
+
* Unlike row/cell/column/header, the table is a singleton so methods are assigned directly.
|
|
141
|
+
*/
|
|
142
|
+
function assignTableAPIs(feature, table, apis) {
|
|
143
|
+
for (const [staticFnName, { fn, memoDeps }] of Object.entries(apis)) {
|
|
144
|
+
const { fnKey, fnName } = getFunctionNameInfo(staticFnName);
|
|
145
|
+
table[fnKey] = memoDeps ? tableMemo({
|
|
146
|
+
memoDeps,
|
|
147
|
+
fn,
|
|
148
|
+
fnName,
|
|
149
|
+
table,
|
|
150
|
+
feature
|
|
151
|
+
}) : fn;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Assigns API methods to a prototype object for memory-efficient method sharing.
|
|
156
|
+
* All instances created with this prototype will share the same method references.
|
|
157
|
+
*
|
|
158
|
+
* For memoized methods, the memo state is lazily created and stored on each instance.
|
|
159
|
+
* This provides the best of both worlds: shared method code + per-instance caching.
|
|
160
|
+
*/
|
|
161
|
+
function assignPrototypeAPIs(feature, prototype, table, apis) {
|
|
162
|
+
for (const [staticFnName, { fn, memoDeps }] of Object.entries(apis)) {
|
|
163
|
+
const { fnKey, fnName } = getFunctionNameInfo(staticFnName);
|
|
164
|
+
if (memoDeps) {
|
|
165
|
+
const memoKey = `_memo_${fnKey}`;
|
|
166
|
+
prototype[fnKey] = function(...args) {
|
|
167
|
+
if (!this[memoKey]) {
|
|
168
|
+
const self = this;
|
|
169
|
+
this[memoKey] = tableMemo({
|
|
170
|
+
memoDeps: () => memoDeps(self),
|
|
171
|
+
fn: (...deps) => fn(self, ...deps),
|
|
172
|
+
fnName,
|
|
173
|
+
objectId: self.id,
|
|
174
|
+
table,
|
|
175
|
+
feature
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return this[memoKey](...args);
|
|
179
|
+
};
|
|
180
|
+
} else prototype[fnKey] = function(...args) {
|
|
181
|
+
return fn(this, ...args);
|
|
182
|
+
};
|
|
183
|
+
setMemoFnMeta(prototype[fnKey], { originalArgsLength: fn.length });
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Looks to run the memoized function with the builder pattern on the object if it exists, otherwise fallback to the static method passed in.
|
|
188
|
+
*/
|
|
189
|
+
function callMemoOrStaticFn(obj, fnKey, staticFn, ...args) {
|
|
190
|
+
var _obj$fnKey;
|
|
191
|
+
return ((_obj$fnKey = obj[fnKey]) === null || _obj$fnKey === void 0 ? void 0 : _obj$fnKey.call(obj, ...args)) ?? staticFn(obj, ...args);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
//#endregion
|
|
195
|
+
export { $internalMemoFnMeta, assignPrototypeAPIs, assignTableAPIs, callMemoOrStaticFn, flattenBy, functionalUpdate, getFunctionNameInfo, getMemoFnMeta, isFunction, isNumberArray, makeStateUpdater, memo, noop, tableMemo };
|
|
196
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import type { Table, Table_Internal } from './types/Table'\nimport type { NoInfer, RowData, Updater } from './types/type-utils'\nimport type { TableFeatures } from './types/TableFeatures'\nimport type { TableState, TableState_All } from './types/TableState'\n\nexport function functionalUpdate<T>(updater: Updater<T>, input: T): T {\n return typeof updater === 'function'\n ? (updater as (i: T) => T)(input)\n : updater\n}\n\nexport function noop() {}\n\nexport function makeStateUpdater<\n TFeatures extends TableFeatures,\n K extends (string & {}) | keyof TableState_All | keyof TableState<TFeatures>,\n>(key: K, instance: Table<TFeatures, any>) {\n return (updater: Updater<TableState<any>[K & keyof TableState<any>]>) => {\n instance.baseStore.setState(\n <TTableState extends TableState_All>(old: TTableState) => {\n return {\n ...old,\n [key]: functionalUpdate(updater, (old as any)[key]),\n }\n },\n )\n }\n}\n\ntype AnyFunction = (...args: any) => any\n\nexport function isFunction<T extends AnyFunction>(d: any): d is T {\n return d instanceof Function\n}\n\nexport function isNumberArray(d: any): d is Array<number> {\n return Array.isArray(d) && d.every((val) => typeof val === 'number')\n}\n\nexport function flattenBy<TNode>(\n arr: Array<TNode>,\n getChildren: (item: TNode) => Array<TNode>,\n) {\n const flat: Array<TNode> = []\n\n const recurse = (subArr: Array<TNode>) => {\n subArr.forEach((item) => {\n flat.push(item)\n const children = getChildren(item)\n if (children.length) {\n recurse(children)\n }\n })\n }\n\n recurse(arr)\n\n return flat\n}\n\nexport const $internalMemoFnMeta = Symbol('memoFnMeta')\nexport type MemoFnMeta = { originalArgsLength?: number }\n\n/**\n * @internal\n */\nfunction setMemoFnMeta(fn: Function, meta: MemoFnMeta) {\n Object.defineProperty(fn, $internalMemoFnMeta, { value: meta })\n}\n\n/**\n * @internal\n */\nexport function getMemoFnMeta(fn: any): MemoFnMeta | null {\n return (typeof fn === 'function' && fn[$internalMemoFnMeta]) ?? null\n}\n\ninterface MemoOptions<TDeps extends ReadonlyArray<any>, TDepArgs, TResult> {\n fn: (...args: NoInfer<TDeps>) => TResult\n memoDeps?: (depArgs?: TDepArgs) => [...TDeps] | undefined\n onAfterCompare?: (depsChanged: boolean) => void\n onAfterUpdate?: (result: TResult) => void\n onBeforeCompare?: () => void\n onBeforeUpdate?: () => void\n}\n\nexport const memo = <TDeps extends ReadonlyArray<any>, TDepArgs, TResult>({\n fn,\n memoDeps,\n onAfterCompare,\n onAfterUpdate,\n onBeforeCompare,\n onBeforeUpdate,\n}: MemoOptions<TDeps, TDepArgs, TResult>): ((\n depArgs?: TDepArgs,\n) => TResult) => {\n let deps: Array<any> | undefined = []\n let result: TResult | undefined\n\n const memoizedFn = (depArgs?: TDepArgs): TResult => {\n onBeforeCompare?.()\n const newDeps = memoDeps?.(depArgs)\n const depsChanged =\n !newDeps ||\n newDeps.length !== deps?.length ||\n newDeps.some((dep: any, index: number) => deps?.[index] !== dep)\n onAfterCompare?.(depsChanged)\n\n if (!depsChanged) {\n return result!\n }\n\n deps = newDeps\n\n onBeforeUpdate?.()\n result = fn(...(newDeps ?? ([] as any)))\n onAfterUpdate?.(result)\n\n return result\n }\n\n setMemoFnMeta(memoizedFn, { originalArgsLength: fn.length })\n\n return memoizedFn\n}\n\ninterface TableMemoOptions<\n TFeatures extends TableFeatures,\n TDeps extends ReadonlyArray<any>,\n TDepArgs,\n TResult,\n> extends MemoOptions<TDeps, TDepArgs, TResult> {\n feature?: keyof TFeatures & string\n fnName: string\n objectId?: string\n onAfterUpdate?: () => void\n table: Table_Internal<TFeatures, any>\n}\n\nconst pad = (str: number | string, num: number) => {\n str = String(str)\n while (str.length < num) {\n str = ' ' + str\n }\n return str\n}\n\nexport function tableMemo<\n TFeatures extends TableFeatures,\n TDeps extends ReadonlyArray<any>,\n TDepArgs,\n TResult,\n>({\n feature,\n fnName,\n objectId,\n onAfterUpdate,\n table,\n ...memoOptions\n}: TableMemoOptions<TFeatures, TDeps, TDepArgs, TResult>) {\n let beforeCompareTime: number\n let afterCompareTime: number\n let startCalcTime: number\n let endCalcTime: number\n let runCount = 0\n let debug: boolean | undefined\n let debugCache: boolean | undefined\n\n if (process.env.NODE_ENV === 'development') {\n const { debugCache: _debugCache, debugAll } = table.options\n debugCache = _debugCache\n const { parentName } = getFunctionNameInfo(fnName, '.')\n\n const debugByParent =\n // @ts-expect-error\n table.options[\n `debug${(parentName != 'table' ? parentName + 's' : parentName).replace(\n parentName,\n parentName.charAt(0).toUpperCase() + parentName.slice(1),\n )}`\n ]\n const debugByFeature = feature\n ? // @ts-expect-error\n table.options[\n `debug${feature.charAt(0).toUpperCase() + feature.slice(1)}`\n ]\n : false\n\n debug = debugAll || debugByParent || debugByFeature\n }\n\n function logTime(time: number, depsChanged: boolean) {\n const runType =\n runCount === 0\n ? '(1st run)'\n : depsChanged\n ? '(rerun #' + runCount + ')'\n : '(cache)'\n runCount++\n\n console.groupCollapsed(\n `%c⏱ ${pad(`${time.toFixed(1)} ms`, 12)} %c${runType}%c ${fnName}%c ${objectId ? `(${fnName.split('.')[0]}Id: ${objectId})` : ''}`,\n `font-size: .6rem; font-weight: bold; ${\n depsChanged\n ? `color: hsl(\n ${Math.max(0, Math.min(120 - Math.log10(time) * 60, 120))}deg 100% 31%);`\n : ''\n } `,\n `color: ${runCount < 2 ? '#FF00FF' : '#FF1493'}`,\n 'color: #666',\n 'color: #87CEEB',\n )\n console.info({\n feature,\n state: table.store.state,\n deps: memoOptions.memoDeps?.toString(),\n })\n console.trace()\n console.groupEnd()\n }\n\n const debugOptions =\n process.env.NODE_ENV === 'development'\n ? {\n onBeforeCompare: () => {\n if (debugCache) {\n beforeCompareTime = performance.now()\n }\n },\n onAfterCompare: (depsChanged: boolean) => {\n if (debugCache) {\n afterCompareTime = performance.now()\n const compareTime =\n Math.round((afterCompareTime - beforeCompareTime) * 100) / 100\n if (!depsChanged) {\n logTime(compareTime, depsChanged)\n }\n }\n },\n onBeforeUpdate: () => {\n if (debug) {\n startCalcTime = performance.now()\n }\n },\n onAfterUpdate: () => {\n if (debug) {\n endCalcTime = performance.now()\n const executionTime =\n Math.round((endCalcTime - startCalcTime) * 100) / 100\n logTime(executionTime, true)\n }\n queueMicrotask(() => onAfterUpdate?.())\n },\n }\n : {\n onAfterUpdate: () => {\n queueMicrotask(() => onAfterUpdate?.())\n },\n }\n\n return memo({\n ...memoOptions,\n ...debugOptions,\n })\n}\n\nexport interface API<TDeps extends ReadonlyArray<any>, TDepArgs> {\n fn: (...args: any) => any\n memoDeps?: (depArgs?: any) => [...any] | undefined\n}\n\nexport type APIObject<TDeps extends ReadonlyArray<any>, TDepArgs> = Record<\n string,\n API<TDeps, TDepArgs>\n>\n\n/**\n * Assumes that a function name is in the format of `parentName_fnKey` and returns the `fnKey` and `fnName` in the format of `parentName.fnKey`.\n */\nexport function getFunctionNameInfo(\n staticFnName: string,\n splitBy: '_' | '.' = '_',\n) {\n const [parentName, fnKey] = staticFnName.split(splitBy)\n const fnName = `${parentName}.${fnKey}`\n return { fnKey, fnName, parentName } as {\n fnKey: string\n fnName: string\n parentName: string\n }\n}\n\n/**\n * Assigns Table API methods directly to the table instance.\n * Unlike row/cell/column/header, the table is a singleton so methods are assigned directly.\n */\nexport function assignTableAPIs<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TDeps extends ReadonlyArray<any>,\n TDepArgs,\n>(\n feature: keyof TFeatures & string,\n table: Table_Internal<TFeatures, TData>,\n apis: APIObject<TDeps, NoInfer<TDepArgs>>,\n): void {\n for (const [staticFnName, { fn, memoDeps }] of Object.entries(apis)) {\n const { fnKey, fnName } = getFunctionNameInfo(staticFnName)\n\n ;(table as Record<string, any>)[fnKey] = memoDeps\n ? tableMemo({\n memoDeps,\n fn,\n fnName,\n table,\n feature,\n })\n : fn\n }\n}\n\nexport interface PrototypeAPI<TDeps extends ReadonlyArray<any>, TDepArgs> {\n fn: (self: any, ...args: any) => any\n memoDeps?: (self: any, depArgs?: any) => [...any] | undefined\n}\n\nexport type PrototypeAPIObject<\n TDeps extends ReadonlyArray<any>,\n TDepArgs,\n> = Record<string, PrototypeAPI<TDeps, TDepArgs>>\n\n/**\n * Assigns API methods to a prototype object for memory-efficient method sharing.\n * All instances created with this prototype will share the same method references.\n *\n * For memoized methods, the memo state is lazily created and stored on each instance.\n * This provides the best of both worlds: shared method code + per-instance caching.\n */\nexport function assignPrototypeAPIs<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TDeps extends ReadonlyArray<any>,\n TDepArgs,\n>(\n feature: keyof TFeatures & string,\n prototype: Record<string, any>,\n table: Table_Internal<TFeatures, TData>,\n apis: PrototypeAPIObject<TDeps, NoInfer<TDepArgs>>,\n): void {\n for (const [staticFnName, { fn, memoDeps }] of Object.entries(apis)) {\n const { fnKey, fnName } = getFunctionNameInfo(staticFnName)\n\n if (memoDeps) {\n // For memoized methods, create a function that lazily initializes\n // the memo on first access and stores it on the instance\n const memoKey = `_memo_${fnKey}`\n\n prototype[fnKey] = function (this: any, ...args: Array<any>) {\n // Lazily create memo on first access for this instance\n if (!this[memoKey]) {\n const self = this\n this[memoKey] = tableMemo({\n memoDeps: () => memoDeps(self),\n fn: (...deps) => fn(self, ...deps),\n fnName,\n objectId: self.id,\n table,\n feature,\n })\n }\n return this[memoKey](...args)\n }\n } else {\n // Non-memoized methods just call the static function with `this`\n prototype[fnKey] = function (this: any, ...args: Array<any>) {\n return fn(this, ...args)\n }\n }\n\n setMemoFnMeta(prototype[fnKey], { originalArgsLength: fn.length })\n }\n}\n\n/**\n * Looks to run the memoized function with the builder pattern on the object if it exists, otherwise fallback to the static method passed in.\n */\nexport function callMemoOrStaticFn<\n TObject extends Record<string, any>,\n TStaticFn extends AnyFunction,\n>(\n obj: TObject,\n fnKey: string,\n staticFn: TStaticFn,\n ...args: Parameters<TStaticFn> extends [any, ...infer Rest] ? Rest : never\n): ReturnType<TStaticFn> {\n return (\n (obj[fnKey] as Function | undefined)?.(...args) ?? staticFn(obj, ...args)\n )\n}\n"],"mappings":";AAKA,SAAgB,iBAAoB,SAAqB,OAAa;AACpE,QAAO,OAAO,YAAY,aACrB,QAAwB,MAAM,GAC/B;;AAGN,SAAgB,OAAO;AAEvB,SAAgB,iBAGd,KAAQ,UAAiC;AACzC,SAAQ,YAAiE;AACvE,WAAS,UAAU,UACoB,QAAqB;AACxD,UAAO;IACL,GAAG;KACF,MAAM,iBAAiB,SAAU,IAAY,KAAK;IACpD;IAEJ;;;AAML,SAAgB,WAAkC,GAAgB;AAChE,QAAO,aAAa;;AAGtB,SAAgB,cAAc,GAA4B;AACxD,QAAO,MAAM,QAAQ,EAAE,IAAI,EAAE,OAAO,QAAQ,OAAO,QAAQ,SAAS;;AAGtE,SAAgB,UACd,KACA,aACA;CACA,MAAM,OAAqB,EAAE;CAE7B,MAAM,WAAW,WAAyB;AACxC,SAAO,SAAS,SAAS;AACvB,QAAK,KAAK,KAAK;GACf,MAAM,WAAW,YAAY,KAAK;AAClC,OAAI,SAAS,OACX,SAAQ,SAAS;IAEnB;;AAGJ,SAAQ,IAAI;AAEZ,QAAO;;AAGT,MAAa,sBAAsB,OAAO,aAAa;;;;AAMvD,SAAS,cAAc,IAAc,MAAkB;AACrD,QAAO,eAAe,IAAI,qBAAqB,EAAE,OAAO,MAAM,CAAC;;;;;AAMjE,SAAgB,cAAc,IAA4B;AACxD,SAAQ,OAAO,OAAO,cAAc,GAAG,yBAAyB;;AAYlE,MAAa,QAA6D,EACxE,IACA,UACA,gBACA,eACA,iBACA,qBAGe;CACf,IAAI,OAA+B,EAAE;CACrC,IAAI;CAEJ,MAAM,cAAc,YAAgC;AAClD,6EAAmB;EACnB,MAAM,8DAAU,SAAW,QAAQ;EACnC,MAAM,cACJ,CAAC,WACD,QAAQ,wDAAW,KAAM,WACzB,QAAQ,MAAM,KAAU,uDAAkB,KAAO,YAAW,IAAI;AAClE,yEAAiB,YAAY;AAE7B,MAAI,CAAC,YACH,QAAO;AAGT,SAAO;AAEP,0EAAkB;AAClB,WAAS,GAAG,GAAI,WAAY,EAAE,CAAU;AACxC,sEAAgB,OAAO;AAEvB,SAAO;;AAGT,eAAc,YAAY,EAAE,oBAAoB,GAAG,QAAQ,CAAC;AAE5D,QAAO;;AAgBT,MAAM,OAAO,KAAsB,QAAgB;AACjD,OAAM,OAAO,IAAI;AACjB,QAAO,IAAI,SAAS,IAClB,OAAM,MAAM;AAEd,QAAO;;AAGT,SAAgB,UAKd,EACA,SACA,QACA,UACA,eACA,OACA,GAAG,eACqD;CACxD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI,WAAW;CACf,IAAI;CACJ,IAAI;AAEJ,KAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,MAAM,EAAE,YAAY,aAAa,aAAa,MAAM;AACpD,eAAa;EACb,MAAM,EAAE,eAAe,oBAAoB,QAAQ,IAAI;AAiBvD,UAAQ,YAbN,MAAM,QACJ,SAAS,cAAc,UAAU,aAAa,MAAM,YAAY,QAC9D,YACA,WAAW,OAAO,EAAE,CAAC,aAAa,GAAG,WAAW,MAAM,EAAE,CACzD,QAEkB,UAEnB,MAAM,QACJ,QAAQ,QAAQ,OAAO,EAAE,CAAC,aAAa,GAAG,QAAQ,MAAM,EAAE,MAE5D;;CAKN,SAAS,QAAQ,MAAc,aAAsB;;EACnD,MAAM,UACJ,aAAa,IACT,cACA,cACE,aAAa,WAAW,MACxB;AACR;AAEA,UAAQ,eACN,OAAO,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC,MAAM,GAAG,CAAC,KAAK,QAAQ,KAAK,OAAO,KAAK,WAAW,IAAI,OAAO,MAAM,IAAI,CAAC,GAAG,MAAM,SAAS,KAAK,MAC9H,wCACE,cACI;UACF,KAAK,IAAI,GAAG,KAAK,IAAI,MAAM,KAAK,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,CAAC,kBACtD,GACL,IACD,UAAU,WAAW,IAAI,YAAY,aACrC,eACA,iBACD;AACD,UAAQ,KAAK;GACX;GACA,OAAO,MAAM,MAAM;GACnB,+BAAM,YAAY,wFAAU,UAAU;GACvC,CAAC;AACF,UAAQ,OAAO;AACf,UAAQ,UAAU;;CAGpB,MAAM,eACJ,QAAQ,IAAI,aAAa,gBACrB;EACE,uBAAuB;AACrB,OAAI,WACF,qBAAoB,YAAY,KAAK;;EAGzC,iBAAiB,gBAAyB;AACxC,OAAI,YAAY;AACd,uBAAmB,YAAY,KAAK;IACpC,MAAM,cACJ,KAAK,OAAO,mBAAmB,qBAAqB,IAAI,GAAG;AAC7D,QAAI,CAAC,YACH,SAAQ,aAAa,YAAY;;;EAIvC,sBAAsB;AACpB,OAAI,MACF,iBAAgB,YAAY,KAAK;;EAGrC,qBAAqB;AACnB,OAAI,OAAO;AACT,kBAAc,YAAY,KAAK;AAG/B,YADE,KAAK,OAAO,cAAc,iBAAiB,IAAI,GAAG,KAC7B,KAAK;;AAE9B,sFAAqB,eAAiB,CAAC;;EAE1C,GACD,EACE,qBAAqB;AACnB,qFAAqB,eAAiB,CAAC;IAE1C;AAEP,QAAO,KAAK;EACV,GAAG;EACH,GAAG;EACJ,CAAC;;;;;AAgBJ,SAAgB,oBACd,cACA,UAAqB,KACrB;CACA,MAAM,CAAC,YAAY,SAAS,aAAa,MAAM,QAAQ;AAEvD,QAAO;EAAE;EAAO,QADD,GAAG,WAAW,GAAG;EACR;EAAY;;;;;;AAWtC,SAAgB,gBAMd,SACA,OACA,MACM;AACN,MAAK,MAAM,CAAC,cAAc,EAAE,IAAI,eAAe,OAAO,QAAQ,KAAK,EAAE;EACnE,MAAM,EAAE,OAAO,WAAW,oBAAoB,aAAa;AAE1D,EAAC,MAA8B,SAAS,WACrC,UAAU;GACR;GACA;GACA;GACA;GACA;GACD,CAAC,GACF;;;;;;;;;;AAqBR,SAAgB,oBAMd,SACA,WACA,OACA,MACM;AACN,MAAK,MAAM,CAAC,cAAc,EAAE,IAAI,eAAe,OAAO,QAAQ,KAAK,EAAE;EACnE,MAAM,EAAE,OAAO,WAAW,oBAAoB,aAAa;AAE3D,MAAI,UAAU;GAGZ,MAAM,UAAU,SAAS;AAEzB,aAAU,SAAS,SAAqB,GAAG,MAAkB;AAE3D,QAAI,CAAC,KAAK,UAAU;KAClB,MAAM,OAAO;AACb,UAAK,WAAW,UAAU;MACxB,gBAAgB,SAAS,KAAK;MAC9B,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK;MAClC;MACA,UAAU,KAAK;MACf;MACA;MACD,CAAC;;AAEJ,WAAO,KAAK,SAAS,GAAG,KAAK;;QAI/B,WAAU,SAAS,SAAqB,GAAG,MAAkB;AAC3D,UAAO,GAAG,MAAM,GAAG,KAAK;;AAI5B,gBAAc,UAAU,QAAQ,EAAE,oBAAoB,GAAG,QAAQ,CAAC;;;;;;AAOtE,SAAgB,mBAId,KACA,OACA,UACA,GAAG,MACoB;;AACvB,uBACG,IAAI,0EAAkC,GAAG,KAAK,KAAI,SAAS,KAAK,GAAG,KAAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.23",
|
|
4
4
|
"description": "Headless UI for building powerful tables & datagrids for TS/JS.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"datagrid"
|
|
27
27
|
],
|
|
28
28
|
"type": "module",
|
|
29
|
-
"types": "dist/
|
|
30
|
-
"main": "dist/
|
|
31
|
-
"module": "dist/
|
|
29
|
+
"types": "./dist/index.d.cts",
|
|
30
|
+
"main": "./dist/index.cjs",
|
|
31
|
+
"module": "./dist/index.js",
|
|
32
32
|
"exports": {
|
|
33
33
|
".": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"import": "./dist/index.js",
|
|
35
|
+
"require": "./dist/index.cjs"
|
|
36
36
|
},
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"src"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@tanstack/store": "^0.9.
|
|
48
|
+
"@tanstack/store": "^0.9.3"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"clean": "rimraf ./build && rimraf ./dist",
|
|
@@ -55,6 +55,6 @@
|
|
|
55
55
|
"test:lib:dev": "pnpm test:lib --watch",
|
|
56
56
|
"test:types": "tsc",
|
|
57
57
|
"test:build": "publint --strict",
|
|
58
|
-
"build": "
|
|
58
|
+
"build": "tsdown"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -89,15 +89,21 @@ export function header_getResizeHandler<
|
|
|
89
89
|
column.table.options.columnResizeDirection === 'rtl' ? -1 : 1
|
|
90
90
|
const deltaOffset =
|
|
91
91
|
(clientXPos - (old.startOffset ?? 0)) * deltaDirection
|
|
92
|
+
const startSize = old.startSize ?? 0
|
|
92
93
|
const deltaPercentage = Math.max(
|
|
93
|
-
deltaOffset /
|
|
94
|
+
startSize > 0 ? deltaOffset / startSize : 0,
|
|
94
95
|
-0.999999,
|
|
95
96
|
)
|
|
96
97
|
|
|
97
98
|
old.columnSizingStart.forEach(([columnId, headerSize]) => {
|
|
98
99
|
newColumnSizing[columnId] =
|
|
99
100
|
Math.round(
|
|
100
|
-
Math.max(
|
|
101
|
+
Math.max(
|
|
102
|
+
headerSize > 0
|
|
103
|
+
? headerSize + headerSize * deltaPercentage
|
|
104
|
+
: deltaOffset / old.columnSizingStart.length,
|
|
105
|
+
0,
|
|
106
|
+
) * 100,
|
|
101
107
|
) / 100
|
|
102
108
|
})
|
|
103
109
|
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Table_Internal } from '../../types/Table.js';
|
|
2
|
-
import { CellData, RowData } from '../../types/type-utils.js';
|
|
3
|
-
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
4
|
-
import { Row } from '../../types/Row.js';
|
|
5
|
-
import { Cell } from '../../types/Cell.js';
|
|
6
|
-
import { Column } from '../../types/Column.js';
|
|
7
|
-
export declare function constructCell<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column<TFeatures, TData, TValue>, row: Row<TFeatures, TData>, table: Table_Internal<TFeatures, TData>): Cell<TFeatures, TData, TValue>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
function getCellPrototype(table) {
|
|
2
|
-
if (!table._cellPrototype) {
|
|
3
|
-
table._cellPrototype = { table };
|
|
4
|
-
for (const feature of Object.values(table._features)) {
|
|
5
|
-
feature.assignCellPrototype?.(table._cellPrototype, table);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return table._cellPrototype;
|
|
9
|
-
}
|
|
10
|
-
function constructCell(column, row, table) {
|
|
11
|
-
const cellPrototype = getCellPrototype(table);
|
|
12
|
-
const cell = Object.create(cellPrototype);
|
|
13
|
-
cell.column = column;
|
|
14
|
-
cell.id = `${row.id}_${column.id}`;
|
|
15
|
-
cell.row = row;
|
|
16
|
-
return cell;
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
constructCell
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=constructCell.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constructCell.js","sources":["../../../../src/core/cells/constructCell.ts"],"sourcesContent":["import type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\nimport type { Column } from '../../types/Column'\nimport type { Cell_CoreProperties } from './coreCellsFeature.types'\n\n/**\n * Creates or retrieves the cell prototype for a table.\n * The prototype is cached on the table and shared by all cell instances.\n */\nfunction getCellPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._cellPrototype) {\n table._cellPrototype = { table }\n for (const feature of Object.values(table._features)) {\n feature.assignCellPrototype?.(table._cellPrototype, table)\n }\n }\n return table._cellPrototype\n}\n\nexport function constructCell<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n column: Column<TFeatures, TData, TValue>,\n row: Row<TFeatures, TData>,\n table: Table_Internal<TFeatures, TData>,\n): Cell<TFeatures, TData, TValue> {\n // Create cell with shared prototype for memory efficiency\n const cellPrototype = getCellPrototype(table)\n const cell = Object.create(cellPrototype) as Cell_CoreProperties<\n TFeatures,\n TData,\n TValue\n >\n\n // Only assign instance-specific properties\n cell.column = column\n cell.id = `${row.id}_${column.id}`\n cell.row = row\n\n return cell as Cell<TFeatures, TData, TValue>\n}\n"],"names":[],"mappings":"AAYA,SAAS,iBAGP,OAAiD;AACjD,MAAI,CAAC,MAAM,gBAAgB;AACzB,UAAM,iBAAiB,EAAE,MAAA;AACzB,eAAW,WAAW,OAAO,OAAO,MAAM,SAAS,GAAG;AACpD,cAAQ,sBAAsB,MAAM,gBAAgB,KAAK;AAAA,IAC3D;AAAA,EACF;AACA,SAAO,MAAM;AACf;AAEO,SAAS,cAKd,QACA,KACA,OACgC;AAEhC,QAAM,gBAAgB,iBAAiB,KAAK;AAC5C,QAAM,OAAO,OAAO,OAAO,aAAa;AAOxC,OAAK,SAAS;AACd,OAAK,KAAK,GAAG,IAAI,EAAE,IAAI,OAAO,EAAE;AAChC,OAAK,MAAM;AAEX,SAAO;AACT;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RowData } from '../../types/type-utils.js';
|
|
2
|
-
import { TableFeature, TableFeatures } from '../../types/TableFeatures.js';
|
|
3
|
-
interface CoreCellsFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {
|
|
4
|
-
}
|
|
5
|
-
export declare function constructCoreCellsFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<CoreCellsFeatureConstructors<TFeatures, TData>>;
|
|
6
|
-
/**
|
|
7
|
-
* The Core Cells feature provides the core cell functionality.
|
|
8
|
-
*/
|
|
9
|
-
export declare const coreCellsFeature: TableFeature<CoreCellsFeatureConstructors<TableFeatures, RowData>>;
|
|
10
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { assignPrototypeAPIs } from "../../utils.js";
|
|
2
|
-
import { cell_getContext, cell_renderValue, cell_getValue } from "./coreCellsFeature.utils.js";
|
|
3
|
-
function constructCoreCellsFeature() {
|
|
4
|
-
return {
|
|
5
|
-
assignCellPrototype: (prototype, table) => {
|
|
6
|
-
assignPrototypeAPIs("coreCellsFeature", prototype, table, {
|
|
7
|
-
cell_getValue: {
|
|
8
|
-
fn: (cell) => cell_getValue(cell)
|
|
9
|
-
},
|
|
10
|
-
cell_renderValue: {
|
|
11
|
-
fn: (cell) => cell_renderValue(cell)
|
|
12
|
-
},
|
|
13
|
-
cell_getContext: {
|
|
14
|
-
fn: (cell) => cell_getContext(cell),
|
|
15
|
-
memoDeps: (cell) => [cell]
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const coreCellsFeature = constructCoreCellsFeature();
|
|
22
|
-
export {
|
|
23
|
-
constructCoreCellsFeature,
|
|
24
|
-
coreCellsFeature
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=coreCellsFeature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreCellsFeature.js","sources":["../../../../src/core/cells/coreCellsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs } from '../../utils'\nimport {\n cell_getContext,\n cell_getValue,\n cell_renderValue,\n} from './coreCellsFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type { Cell_Cell, TableOptions_Cell } from './coreCellsFeature.types'\n\ninterface CoreCellsFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Cell: Cell_Cell<TableFeatures, RowData>\n // TableOptions: TableOptions_Cell\n}\n\nexport function constructCoreCellsFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<CoreCellsFeatureConstructors<TFeatures, TData>> {\n return {\n assignCellPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreCellsFeature', prototype, table, {\n cell_getValue: {\n fn: (cell) => cell_getValue(cell),\n },\n cell_renderValue: {\n fn: (cell) => cell_renderValue(cell),\n },\n cell_getContext: {\n fn: (cell) => cell_getContext(cell),\n memoDeps: (cell) => [cell],\n },\n })\n },\n }\n}\n\n/**\n * The Core Cells feature provides the core cell functionality.\n */\nexport const coreCellsFeature = constructCoreCellsFeature()\n"],"names":[],"mappings":";;AAkBO,SAAS,4BAGkD;AAChE,SAAO;AAAA,IACL,qBAAqB,CAAC,WAAW,UAAU;AACzC,0BAAoB,oBAAoB,WAAW,OAAO;AAAA,QACxD,eAAe;AAAA,UACb,IAAI,CAAC,SAAS,cAAc,IAAI;AAAA,QAAA;AAAA,QAElC,kBAAkB;AAAA,UAChB,IAAI,CAAC,SAAS,iBAAiB,IAAI;AAAA,QAAA;AAAA,QAErC,iBAAiB;AAAA,UACf,IAAI,CAAC,SAAS,gBAAgB,IAAI;AAAA,UAClC,UAAU,CAAC,SAAS,CAAC,IAAI;AAAA,QAAA;AAAA,MAC3B,CACD;AAAA,IACH;AAAA,EAAA;AAEJ;AAKO,MAAM,mBAAmB,0BAAA;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { CellData, Getter, RowData } from '../../types/type-utils.js';
|
|
2
|
-
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
3
|
-
import { Table, Table_Internal } from '../../types/Table.js';
|
|
4
|
-
import { Row } from '../../types/Row.js';
|
|
5
|
-
import { Cell } from '../../types/Cell.js';
|
|
6
|
-
import { Column } from '../../types/Column.js';
|
|
7
|
-
export interface CellContext<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
|
|
8
|
-
cell: Cell<TFeatures, TData, TValue>;
|
|
9
|
-
column: Column<TFeatures, TData, TValue>;
|
|
10
|
-
getValue: Getter<TValue>;
|
|
11
|
-
renderValue: Getter<TValue | null>;
|
|
12
|
-
row: Row<TFeatures, TData>;
|
|
13
|
-
table: Table<TFeatures, TData>;
|
|
14
|
-
}
|
|
15
|
-
export interface Cell_CoreProperties<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
|
|
16
|
-
/**
|
|
17
|
-
* The associated Column object for the cell.
|
|
18
|
-
*/
|
|
19
|
-
column: Column<TFeatures, TData, TValue>;
|
|
20
|
-
/**
|
|
21
|
-
* The unique ID for the cell across the entire table.
|
|
22
|
-
*/
|
|
23
|
-
id: string;
|
|
24
|
-
/**
|
|
25
|
-
* The associated Row object for the cell.
|
|
26
|
-
*/
|
|
27
|
-
row: Row<TFeatures, TData>;
|
|
28
|
-
/**
|
|
29
|
-
* Reference to the parent table instance.
|
|
30
|
-
*/
|
|
31
|
-
table: Table_Internal<TFeatures, TData>;
|
|
32
|
-
}
|
|
33
|
-
export interface Cell_Cell<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> extends Cell_CoreProperties<TFeatures, TData, TValue> {
|
|
34
|
-
/**
|
|
35
|
-
* Returns the rendering context (or props) for cell-based components like cells and aggregated cells. Use these props with your framework's `flexRender` utility to render these using the template of your choice:
|
|
36
|
-
*/
|
|
37
|
-
getContext: () => CellContext<TFeatures, TData, TValue>;
|
|
38
|
-
/**
|
|
39
|
-
* Returns the value for the cell, accessed via the associated column's accessor key or accessor function.
|
|
40
|
-
*/
|
|
41
|
-
getValue: CellContext<TFeatures, TData, TValue>['getValue'];
|
|
42
|
-
/**
|
|
43
|
-
* Renders the value for a cell the same as `getValue`, but will return the `renderFallbackValue` if no value is found.
|
|
44
|
-
*/
|
|
45
|
-
renderValue: CellContext<TFeatures, TData, TValue>['renderValue'];
|
|
46
|
-
}
|
|
47
|
-
export interface TableOptions_Cell {
|
|
48
|
-
/**
|
|
49
|
-
* Value used when the desired value is not found in the data.
|
|
50
|
-
*/
|
|
51
|
-
renderFallbackValue?: any;
|
|
52
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CellData, RowData } from '../../types/type-utils.js';
|
|
2
|
-
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
3
|
-
import { Cell } from '../../types/Cell.js';
|
|
4
|
-
export declare function cell_getValue<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(cell: Cell<TFeatures, TData, TValue>): TValue;
|
|
5
|
-
export declare function cell_renderValue<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(cell: Cell<TFeatures, TData, TValue>): any;
|
|
6
|
-
export declare function cell_getContext<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(cell: Cell<TFeatures, TData, TValue>): {
|
|
7
|
-
table: import('../..').Table_Internal<TFeatures, TData>;
|
|
8
|
-
column: import('../..').Column<TFeatures, TData, TValue>;
|
|
9
|
-
row: import('../..').Row<TFeatures, TData>;
|
|
10
|
-
cell: Cell<TFeatures, TData, TValue>;
|
|
11
|
-
getValue: () => import('../..').NoInfer<TValue>;
|
|
12
|
-
renderValue: () => import('../..').NoInfer<TValue | null>;
|
|
13
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
function cell_getValue(cell) {
|
|
2
|
-
return cell.row.getValue(cell.column.id);
|
|
3
|
-
}
|
|
4
|
-
function cell_renderValue(cell) {
|
|
5
|
-
return cell.getValue() ?? cell.table.options.renderFallbackValue;
|
|
6
|
-
}
|
|
7
|
-
function cell_getContext(cell) {
|
|
8
|
-
return {
|
|
9
|
-
table: cell.table,
|
|
10
|
-
column: cell.column,
|
|
11
|
-
row: cell.row,
|
|
12
|
-
cell,
|
|
13
|
-
// Wrap in arrow functions to preserve `this` binding (methods are on prototype)
|
|
14
|
-
getValue: () => cell.getValue(),
|
|
15
|
-
renderValue: () => cell.renderValue()
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
cell_getContext,
|
|
20
|
-
cell_getValue,
|
|
21
|
-
cell_renderValue
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=coreCellsFeature.utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreCellsFeature.utils.js","sources":["../../../../src/core/cells/coreCellsFeature.utils.ts"],"sourcesContent":["import type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Cell } from '../../types/Cell'\n\nexport function cell_getValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(cell: Cell<TFeatures, TData, TValue>): TValue {\n return cell.row.getValue(cell.column.id)\n}\n\nexport function cell_renderValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(cell: Cell<TFeatures, TData, TValue>) {\n return cell.getValue() ?? cell.table.options.renderFallbackValue\n}\n\nexport function cell_getContext<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(cell: Cell<TFeatures, TData, TValue>) {\n return {\n table: cell.table,\n column: cell.column,\n row: cell.row,\n cell: cell,\n // Wrap in arrow functions to preserve `this` binding (methods are on prototype)\n getValue: () => cell.getValue(),\n renderValue: () => cell.renderValue(),\n }\n}\n"],"names":[],"mappings":"AAIO,SAAS,cAId,MAA8C;AAC9C,SAAO,KAAK,IAAI,SAAS,KAAK,OAAO,EAAE;AACzC;AAEO,SAAS,iBAId,MAAsC;AACtC,SAAO,KAAK,SAAA,KAAc,KAAK,MAAM,QAAQ;AAC/C;AAEO,SAAS,gBAId,MAAsC;AACtC,SAAO;AAAA,IACL,OAAO,KAAK;AAAA,IACZ,QAAQ,KAAK;AAAA,IACb,KAAK,KAAK;AAAA,IACV;AAAA;AAAA,IAEA,UAAU,MAAM,KAAK,SAAA;AAAA,IACrB,aAAa,MAAM,KAAK,YAAA;AAAA,EAAY;AAExC;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Table_Internal } from '../../types/Table.js';
|
|
2
|
-
import { CellData, RowData } from '../../types/type-utils.js';
|
|
3
|
-
import { TableFeatures } from '../../types/TableFeatures.js';
|
|
4
|
-
import { ColumnDef } from '../../types/ColumnDef.js';
|
|
5
|
-
import { Column } from '../../types/Column.js';
|
|
6
|
-
export declare function constructColumn<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(table: Table_Internal<TFeatures, TData>, columnDef: ColumnDef<TFeatures, TData, TValue>, depth: number, parent?: Column<TFeatures, TData, TValue>): Column<TFeatures, TData, TValue>;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
function getColumnPrototype(table) {
|
|
2
|
-
if (!table._columnPrototype) {
|
|
3
|
-
table._columnPrototype = { table };
|
|
4
|
-
for (const feature of Object.values(table._features)) {
|
|
5
|
-
feature.assignColumnPrototype?.(table._columnPrototype, table);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return table._columnPrototype;
|
|
9
|
-
}
|
|
10
|
-
function constructColumn(table, columnDef, depth, parent) {
|
|
11
|
-
const defaultColumn = table.getDefaultColumnDef();
|
|
12
|
-
const resolvedColumnDef = {
|
|
13
|
-
...defaultColumn,
|
|
14
|
-
...columnDef
|
|
15
|
-
};
|
|
16
|
-
const accessorKey = resolvedColumnDef.accessorKey;
|
|
17
|
-
const id = resolvedColumnDef.id ?? (accessorKey ? accessorKey.replaceAll(".", "_") : void 0) ?? (typeof resolvedColumnDef.header === "string" ? resolvedColumnDef.header : void 0);
|
|
18
|
-
let accessorFn;
|
|
19
|
-
if (resolvedColumnDef.accessorFn) {
|
|
20
|
-
accessorFn = resolvedColumnDef.accessorFn;
|
|
21
|
-
} else if (accessorKey) {
|
|
22
|
-
if (accessorKey.includes(".")) {
|
|
23
|
-
accessorFn = (originalRow) => {
|
|
24
|
-
let result = originalRow;
|
|
25
|
-
for (const key of accessorKey.split(".")) {
|
|
26
|
-
result = result?.[key];
|
|
27
|
-
if (process.env.NODE_ENV === "development" && result === void 0) {
|
|
28
|
-
console.warn(
|
|
29
|
-
`"${key}" in deeply nested key "${accessorKey}" returned undefined.`
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
} else {
|
|
36
|
-
accessorFn = (originalRow) => originalRow[resolvedColumnDef.accessorKey];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (!id) {
|
|
40
|
-
if (process.env.NODE_ENV === "development") {
|
|
41
|
-
throw new Error(
|
|
42
|
-
resolvedColumnDef.accessorFn ? `coreColumnsFeature require an id when using an accessorFn` : `coreColumnsFeature require an id when using a non-string header`
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
throw new Error();
|
|
46
|
-
}
|
|
47
|
-
const columnPrototype = getColumnPrototype(table);
|
|
48
|
-
const column = Object.create(columnPrototype);
|
|
49
|
-
column.accessorFn = accessorFn;
|
|
50
|
-
column.columnDef = resolvedColumnDef;
|
|
51
|
-
column.columns = [];
|
|
52
|
-
column.depth = depth;
|
|
53
|
-
column.id = `${String(id)}`;
|
|
54
|
-
column.parent = parent;
|
|
55
|
-
return column;
|
|
56
|
-
}
|
|
57
|
-
export {
|
|
58
|
-
constructColumn
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=constructColumn.js.map
|