@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
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CellData, RowData, UnionToIntersection } from "./type-utils.js";
|
|
2
|
+
import { CoreFeatures } from "../core/coreFeatures.js";
|
|
3
|
+
import { Row } from "./Row.js";
|
|
4
|
+
import { ColumnDefBase_All } from "./ColumnDef.js";
|
|
5
|
+
import { TableState_All } from "./TableState.js";
|
|
6
|
+
import { TableOptions_All } from "./TableOptions.js";
|
|
7
|
+
import { StockFeatures } from "../features/stockFeatures.js";
|
|
8
|
+
import { Table_Internal } from "./Table.js";
|
|
9
|
+
|
|
10
|
+
//#region src/types/TableFeatures.d.ts
|
|
11
|
+
type ExtractFeatureTypes<TKey extends keyof FeatureConstructors, TFeatures extends TableFeatures> = UnionToIntersection<{ [K in keyof TFeatures]: TFeatures[K] extends TableFeature<infer FeatureConstructorOptions> ? TKey extends keyof FeatureConstructorOptions ? FeatureConstructorOptions[TKey] : never : any }[keyof TFeatures]>;
|
|
12
|
+
interface FeatureConstructors {
|
|
13
|
+
CachedRowModel?: any;
|
|
14
|
+
Cell?: any;
|
|
15
|
+
Column?: any;
|
|
16
|
+
ColumnDef?: any;
|
|
17
|
+
CreateRowModels?: any;
|
|
18
|
+
Header?: any;
|
|
19
|
+
HeaderGroup?: any;
|
|
20
|
+
Row?: any;
|
|
21
|
+
RowModelFns?: any;
|
|
22
|
+
Table?: any;
|
|
23
|
+
TableOptions?: any;
|
|
24
|
+
TableState?: any;
|
|
25
|
+
}
|
|
26
|
+
interface Plugins {}
|
|
27
|
+
interface TableFeatures extends Partial<CoreFeatures>, Partial<StockFeatures>, Partial<Plugins> {}
|
|
28
|
+
type ConstructTableAPIs<TConstructors extends FeatureConstructors> = <TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData> & Partial<TConstructors['Table']> & {
|
|
29
|
+
options: Partial<TConstructors['TableOptions']>;
|
|
30
|
+
}) => void;
|
|
31
|
+
type GetDefaultColumnDef<TConstructors extends FeatureConstructors> = <TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>() => ColumnDefBase_All<TFeatures, TData, TValue> & Partial<TConstructors['ColumnDef']>;
|
|
32
|
+
type GetDefaultTableOptions<TConstructors extends FeatureConstructors> = <TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData> & Partial<TConstructors['Table']>) => Partial<TableOptions_All<TFeatures, TData>> & Partial<TConstructors['TableOptions']>;
|
|
33
|
+
type GetInitialState<TConstructors extends FeatureConstructors> = (initialState: Partial<TableState_All> & Partial<TConstructors['TableState']>) => TableState_All & Partial<TConstructors['TableState']>;
|
|
34
|
+
type GetDefaultStateSelector<TConstructors extends FeatureConstructors> = (state: TableState_All) => Partial<TableState_All> & Partial<TConstructors['TableState']>;
|
|
35
|
+
type AssignCellPrototype<TConstructors extends FeatureConstructors> = <TFeatures extends TableFeatures, TData extends RowData>(prototype: Record<string, any>, table: Table_Internal<TFeatures, TData>) => void;
|
|
36
|
+
type AssignColumnPrototype<TConstructors extends FeatureConstructors> = <TFeatures extends TableFeatures, TData extends RowData>(prototype: Record<string, any>, table: Table_Internal<TFeatures, TData>) => void;
|
|
37
|
+
type AssignHeaderPrototype<TConstructors extends FeatureConstructors> = <TFeatures extends TableFeatures, TData extends RowData>(prototype: Record<string, any>, table: Table_Internal<TFeatures, TData>) => void;
|
|
38
|
+
type AssignRowPrototype<TConstructors extends FeatureConstructors> = <TFeatures extends TableFeatures, TData extends RowData>(prototype: Record<string, any>, table: Table_Internal<TFeatures, TData>) => void;
|
|
39
|
+
type InitRowInstanceData<TConstructors extends FeatureConstructors> = <TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData> & Partial<TConstructors['Row']>) => void;
|
|
40
|
+
interface TableFeature<TConstructors extends FeatureConstructors> {
|
|
41
|
+
/**
|
|
42
|
+
* Assigns Cell APIs to the cell prototype for memory-efficient method sharing.
|
|
43
|
+
* This is called once per table to build a shared prototype for all cells.
|
|
44
|
+
*/
|
|
45
|
+
assignCellPrototype?: AssignCellPrototype<TConstructors>;
|
|
46
|
+
/**
|
|
47
|
+
* Assigns Column APIs to the column prototype for memory-efficient method sharing.
|
|
48
|
+
* This is called once per table to build a shared prototype for all columns.
|
|
49
|
+
*/
|
|
50
|
+
assignColumnPrototype?: AssignColumnPrototype<TConstructors>;
|
|
51
|
+
/**
|
|
52
|
+
* Assigns Header APIs to the header prototype for memory-efficient method sharing.
|
|
53
|
+
* This is called once per table to build a shared prototype for all headers.
|
|
54
|
+
*/
|
|
55
|
+
assignHeaderPrototype?: AssignHeaderPrototype<TConstructors>;
|
|
56
|
+
/**
|
|
57
|
+
* Assigns Row APIs to the row prototype for memory-efficient method sharing.
|
|
58
|
+
* This is called once per table to build a shared prototype for all rows.
|
|
59
|
+
*/
|
|
60
|
+
assignRowPrototype?: AssignRowPrototype<TConstructors>;
|
|
61
|
+
/**
|
|
62
|
+
* Assigns Table APIs to the table instance.
|
|
63
|
+
* Unlike row/cell/column/header, the table is a singleton so methods are assigned directly.
|
|
64
|
+
*/
|
|
65
|
+
constructTableAPIs?: ConstructTableAPIs<TConstructors>;
|
|
66
|
+
getDefaultColumnDef?: GetDefaultColumnDef<TConstructors>;
|
|
67
|
+
getDefaultTableOptions?: GetDefaultTableOptions<TConstructors>;
|
|
68
|
+
getInitialState?: GetInitialState<TConstructors>;
|
|
69
|
+
/**
|
|
70
|
+
* Initializes instance-specific data on each row (e.g., caches).
|
|
71
|
+
* Methods should be assigned via assignRowPrototype instead.
|
|
72
|
+
*/
|
|
73
|
+
initRowInstanceData?: InitRowInstanceData<TConstructors>;
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { AssignCellPrototype, AssignColumnPrototype, AssignHeaderPrototype, AssignRowPrototype, ConstructTableAPIs, ExtractFeatureTypes, GetDefaultColumnDef, GetDefaultStateSelector, GetDefaultTableOptions, GetInitialState, InitRowInstanceData, Plugins, TableFeature, TableFeatures };
|
|
77
|
+
//# sourceMappingURL=TableFeatures.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RowData, UnionToIntersection } from "./type-utils.cjs";
|
|
2
|
+
import { CoreFeatures } from "../core/coreFeatures.cjs";
|
|
3
|
+
import { TableOptions_RowSorting } from "../features/row-sorting/rowSortingFeature.types.cjs";
|
|
4
|
+
import { TableOptions_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.cjs";
|
|
5
|
+
import { TableOptions_ColumnSizing } from "../features/column-sizing/columnSizingFeature.types.cjs";
|
|
6
|
+
import { TableOptions_ColumnResizing } from "../features/column-resizing/columnResizingFeature.types.cjs";
|
|
7
|
+
import { TableOptions_ColumnPinning } from "../features/column-pinning/columnPinningFeature.types.cjs";
|
|
8
|
+
import { TableOptions_ColumnOrdering } from "../features/column-ordering/columnOrderingFeature.types.cjs";
|
|
9
|
+
import { TableOptions_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.cjs";
|
|
10
|
+
import { TableOptions_Columns } from "../core/columns/coreColumnsFeature.types.cjs";
|
|
11
|
+
import { TableOptions_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.cjs";
|
|
12
|
+
import { TableOptions_RowExpanding } from "../features/row-expanding/rowExpandingFeature.types.cjs";
|
|
13
|
+
import { TableOptions_RowPinning } from "../features/row-pinning/rowPinningFeature.types.cjs";
|
|
14
|
+
import { TableOptions_RowSelection } from "../features/row-selection/rowSelectionFeature.types.cjs";
|
|
15
|
+
import { TableOptions_Rows } from "../core/rows/coreRowsFeature.types.cjs";
|
|
16
|
+
import { TableOptions_Cell } from "../core/cells/coreCellsFeature.types.cjs";
|
|
17
|
+
import { TableOptions_RowPagination } from "../features/row-pagination/rowPaginationFeature.types.cjs";
|
|
18
|
+
import { TableOptions_Table } from "../core/table/coreTablesFeature.types.cjs";
|
|
19
|
+
import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
|
|
20
|
+
import { TableOptions_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.cjs";
|
|
21
|
+
|
|
22
|
+
//#region src/types/TableOptions.d.ts
|
|
23
|
+
interface TableOptions_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
24
|
+
interface TableOptions_Core<TFeatures extends TableFeatures, TData extends RowData> extends TableOptions_Table<TFeatures, TData>, TableOptions_Cell, TableOptions_Columns<TFeatures, TData>, TableOptions_Rows<TFeatures, TData> {}
|
|
25
|
+
type DebugKeysFor<TFeatures extends TableFeatures> = { [K in keyof TFeatures & string as `debug${Capitalize<K>}`]?: boolean };
|
|
26
|
+
type DebugOptions<TFeatures extends TableFeatures> = {
|
|
27
|
+
debugAll?: boolean;
|
|
28
|
+
debugCache?: boolean;
|
|
29
|
+
debugCells?: boolean;
|
|
30
|
+
debugColumns?: boolean;
|
|
31
|
+
debugHeaders?: boolean;
|
|
32
|
+
debugRows?: boolean;
|
|
33
|
+
debugTable?: boolean;
|
|
34
|
+
} & DebugKeysFor<CoreFeatures & TFeatures>;
|
|
35
|
+
type TableOptions<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? TableOptions_ColumnFiltering<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? TableOptions_ColumnGrouping : never) | ('columnOrderingFeature' extends keyof TFeatures ? TableOptions_ColumnOrdering : never) | ('columnPinningFeature' extends keyof TFeatures ? TableOptions_ColumnPinning : never) | ('columnResizingFeature' extends keyof TFeatures ? TableOptions_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? TableOptions_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? TableOptions_ColumnVisibility : never) | ('globalFilteringFeature' extends keyof TFeatures ? TableOptions_GlobalFiltering<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? TableOptions_RowExpanding<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? TableOptions_RowPagination : never) | ('rowPinningFeature' extends keyof TFeatures ? TableOptions_RowPinning<TFeatures, TData> : never) | ('rowSelectionFeature' extends keyof TFeatures ? TableOptions_RowSelection<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? TableOptions_RowSorting : never)> & ExtractFeatureTypes<'TableOptions', TFeatures> & TableOptions_Plugins<TFeatures, TData> & DebugOptions<TFeatures>;
|
|
36
|
+
type TableOptions_All<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & Partial<TableOptions_ColumnFiltering<TFeatures, TData> & TableOptions_ColumnGrouping & TableOptions_ColumnOrdering & TableOptions_ColumnPinning & TableOptions_ColumnResizing & TableOptions_ColumnSizing & TableOptions_ColumnVisibility & TableOptions_GlobalFiltering<TFeatures, TData> & TableOptions_RowExpanding<TFeatures, TData> & TableOptions_RowPagination & TableOptions_RowPinning<TFeatures, TData> & TableOptions_RowSelection<TFeatures, TData> & TableOptions_RowSorting>;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { DebugOptions, TableOptions, TableOptions_All, TableOptions_Core, TableOptions_Plugins };
|
|
39
|
+
//# sourceMappingURL=TableOptions.d.cts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RowData, UnionToIntersection } from "./type-utils.js";
|
|
2
|
+
import { CoreFeatures } from "../core/coreFeatures.js";
|
|
3
|
+
import { TableOptions_RowSorting } from "../features/row-sorting/rowSortingFeature.types.js";
|
|
4
|
+
import { TableOptions_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.js";
|
|
5
|
+
import { TableOptions_ColumnSizing } from "../features/column-sizing/columnSizingFeature.types.js";
|
|
6
|
+
import { TableOptions_ColumnResizing } from "../features/column-resizing/columnResizingFeature.types.js";
|
|
7
|
+
import { TableOptions_ColumnPinning } from "../features/column-pinning/columnPinningFeature.types.js";
|
|
8
|
+
import { TableOptions_ColumnOrdering } from "../features/column-ordering/columnOrderingFeature.types.js";
|
|
9
|
+
import { TableOptions_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.js";
|
|
10
|
+
import { TableOptions_Columns } from "../core/columns/coreColumnsFeature.types.js";
|
|
11
|
+
import { TableOptions_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.js";
|
|
12
|
+
import { TableOptions_RowExpanding } from "../features/row-expanding/rowExpandingFeature.types.js";
|
|
13
|
+
import { TableOptions_RowPinning } from "../features/row-pinning/rowPinningFeature.types.js";
|
|
14
|
+
import { TableOptions_RowSelection } from "../features/row-selection/rowSelectionFeature.types.js";
|
|
15
|
+
import { TableOptions_Rows } from "../core/rows/coreRowsFeature.types.js";
|
|
16
|
+
import { TableOptions_Cell } from "../core/cells/coreCellsFeature.types.js";
|
|
17
|
+
import { TableOptions_RowPagination } from "../features/row-pagination/rowPaginationFeature.types.js";
|
|
18
|
+
import { TableOptions_Table } from "../core/table/coreTablesFeature.types.js";
|
|
19
|
+
import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
|
|
20
|
+
import { TableOptions_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.js";
|
|
21
|
+
|
|
22
|
+
//#region src/types/TableOptions.d.ts
|
|
23
|
+
interface TableOptions_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
24
|
+
interface TableOptions_Core<TFeatures extends TableFeatures, TData extends RowData> extends TableOptions_Table<TFeatures, TData>, TableOptions_Cell, TableOptions_Columns<TFeatures, TData>, TableOptions_Rows<TFeatures, TData> {}
|
|
25
|
+
type DebugKeysFor<TFeatures extends TableFeatures> = { [K in keyof TFeatures & string as `debug${Capitalize<K>}`]?: boolean };
|
|
26
|
+
type DebugOptions<TFeatures extends TableFeatures> = {
|
|
27
|
+
debugAll?: boolean;
|
|
28
|
+
debugCache?: boolean;
|
|
29
|
+
debugCells?: boolean;
|
|
30
|
+
debugColumns?: boolean;
|
|
31
|
+
debugHeaders?: boolean;
|
|
32
|
+
debugRows?: boolean;
|
|
33
|
+
debugTable?: boolean;
|
|
34
|
+
} & DebugKeysFor<CoreFeatures & TFeatures>;
|
|
35
|
+
type TableOptions<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? TableOptions_ColumnFiltering<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? TableOptions_ColumnGrouping : never) | ('columnOrderingFeature' extends keyof TFeatures ? TableOptions_ColumnOrdering : never) | ('columnPinningFeature' extends keyof TFeatures ? TableOptions_ColumnPinning : never) | ('columnResizingFeature' extends keyof TFeatures ? TableOptions_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? TableOptions_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? TableOptions_ColumnVisibility : never) | ('globalFilteringFeature' extends keyof TFeatures ? TableOptions_GlobalFiltering<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? TableOptions_RowExpanding<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? TableOptions_RowPagination : never) | ('rowPinningFeature' extends keyof TFeatures ? TableOptions_RowPinning<TFeatures, TData> : never) | ('rowSelectionFeature' extends keyof TFeatures ? TableOptions_RowSelection<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? TableOptions_RowSorting : never)> & ExtractFeatureTypes<'TableOptions', TFeatures> & TableOptions_Plugins<TFeatures, TData> & DebugOptions<TFeatures>;
|
|
36
|
+
type TableOptions_All<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & Partial<TableOptions_ColumnFiltering<TFeatures, TData> & TableOptions_ColumnGrouping & TableOptions_ColumnOrdering & TableOptions_ColumnPinning & TableOptions_ColumnResizing & TableOptions_ColumnSizing & TableOptions_ColumnVisibility & TableOptions_GlobalFiltering<TFeatures, TData> & TableOptions_RowExpanding<TFeatures, TData> & TableOptions_RowPagination & TableOptions_RowPinning<TFeatures, TData> & TableOptions_RowSelection<TFeatures, TData> & TableOptions_RowSorting>;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { DebugOptions, TableOptions, TableOptions_All, TableOptions_Core, TableOptions_Plugins };
|
|
39
|
+
//# sourceMappingURL=TableOptions.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UnionToIntersection } from "./type-utils.cjs";
|
|
2
|
+
import { TableState_RowSorting } from "../features/row-sorting/rowSortingFeature.types.cjs";
|
|
3
|
+
import { TableState_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.cjs";
|
|
4
|
+
import { TableState_ColumnSizing } from "../features/column-sizing/columnSizingFeature.types.cjs";
|
|
5
|
+
import { TableState_ColumnResizing } from "../features/column-resizing/columnResizingFeature.types.cjs";
|
|
6
|
+
import { TableState_ColumnPinning } from "../features/column-pinning/columnPinningFeature.types.cjs";
|
|
7
|
+
import { TableState_ColumnOrdering } from "../features/column-ordering/columnOrderingFeature.types.cjs";
|
|
8
|
+
import { TableState_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.cjs";
|
|
9
|
+
import { TableState_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.cjs";
|
|
10
|
+
import { TableState_RowExpanding } from "../features/row-expanding/rowExpandingFeature.types.cjs";
|
|
11
|
+
import { TableState_RowPinning } from "../features/row-pinning/rowPinningFeature.types.cjs";
|
|
12
|
+
import { TableState_RowSelection } from "../features/row-selection/rowSelectionFeature.types.cjs";
|
|
13
|
+
import { TableState_RowPagination } from "../features/row-pagination/rowPaginationFeature.types.cjs";
|
|
14
|
+
import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
|
|
15
|
+
import { TableState_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.cjs";
|
|
16
|
+
|
|
17
|
+
//#region src/types/TableState.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Use this interface as a target for declaration merging to add your own state properties.
|
|
20
|
+
* Note: This will affect the types of all tables in your project.
|
|
21
|
+
*/
|
|
22
|
+
interface TableState_Plugins<TFeatures extends TableFeatures> {}
|
|
23
|
+
type TableState<TFeatures extends TableFeatures> = UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? TableState_ColumnFiltering : never) | ('columnGroupingFeature' extends keyof TFeatures ? TableState_ColumnGrouping : never) | ('columnOrderingFeature' extends keyof TFeatures ? TableState_ColumnOrdering : never) | ('columnPinningFeature' extends keyof TFeatures ? TableState_ColumnPinning : never) | ('columnResizingFeature' extends keyof TFeatures ? TableState_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? TableState_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? TableState_ColumnVisibility : never) | ('globalFilteringFeature' extends keyof TFeatures ? TableState_GlobalFiltering : never) | ('rowExpandingFeature' extends keyof TFeatures ? TableState_RowExpanding : never) | ('rowPaginationFeature' extends keyof TFeatures ? TableState_RowPagination : never) | ('rowPinningFeature' extends keyof TFeatures ? TableState_RowPinning : never) | ('rowSelectionFeature' extends keyof TFeatures ? TableState_RowSelection : never) | ('rowSortingFeature' extends keyof TFeatures ? TableState_RowSorting : never)> & ExtractFeatureTypes<'TableState', TFeatures> & TableState_Plugins<TFeatures>;
|
|
24
|
+
type TableState_All = Partial<TableState_ColumnFiltering & TableState_ColumnGrouping & TableState_ColumnOrdering & TableState_ColumnPinning & TableState_ColumnResizing & TableState_ColumnSizing & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowPinning & TableState_RowSelection & TableState_RowSorting>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { TableState, TableState_All, TableState_Plugins };
|
|
27
|
+
//# sourceMappingURL=TableState.d.cts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UnionToIntersection } from "./type-utils.js";
|
|
2
|
+
import { TableState_RowSorting } from "../features/row-sorting/rowSortingFeature.types.js";
|
|
3
|
+
import { TableState_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.js";
|
|
4
|
+
import { TableState_ColumnSizing } from "../features/column-sizing/columnSizingFeature.types.js";
|
|
5
|
+
import { TableState_ColumnResizing } from "../features/column-resizing/columnResizingFeature.types.js";
|
|
6
|
+
import { TableState_ColumnPinning } from "../features/column-pinning/columnPinningFeature.types.js";
|
|
7
|
+
import { TableState_ColumnOrdering } from "../features/column-ordering/columnOrderingFeature.types.js";
|
|
8
|
+
import { TableState_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.js";
|
|
9
|
+
import { TableState_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.js";
|
|
10
|
+
import { TableState_RowExpanding } from "../features/row-expanding/rowExpandingFeature.types.js";
|
|
11
|
+
import { TableState_RowPinning } from "../features/row-pinning/rowPinningFeature.types.js";
|
|
12
|
+
import { TableState_RowSelection } from "../features/row-selection/rowSelectionFeature.types.js";
|
|
13
|
+
import { TableState_RowPagination } from "../features/row-pagination/rowPaginationFeature.types.js";
|
|
14
|
+
import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
|
|
15
|
+
import { TableState_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.js";
|
|
16
|
+
|
|
17
|
+
//#region src/types/TableState.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Use this interface as a target for declaration merging to add your own state properties.
|
|
20
|
+
* Note: This will affect the types of all tables in your project.
|
|
21
|
+
*/
|
|
22
|
+
interface TableState_Plugins<TFeatures extends TableFeatures> {}
|
|
23
|
+
type TableState<TFeatures extends TableFeatures> = UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? TableState_ColumnFiltering : never) | ('columnGroupingFeature' extends keyof TFeatures ? TableState_ColumnGrouping : never) | ('columnOrderingFeature' extends keyof TFeatures ? TableState_ColumnOrdering : never) | ('columnPinningFeature' extends keyof TFeatures ? TableState_ColumnPinning : never) | ('columnResizingFeature' extends keyof TFeatures ? TableState_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? TableState_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? TableState_ColumnVisibility : never) | ('globalFilteringFeature' extends keyof TFeatures ? TableState_GlobalFiltering : never) | ('rowExpandingFeature' extends keyof TFeatures ? TableState_RowExpanding : never) | ('rowPaginationFeature' extends keyof TFeatures ? TableState_RowPagination : never) | ('rowPinningFeature' extends keyof TFeatures ? TableState_RowPinning : never) | ('rowSelectionFeature' extends keyof TFeatures ? TableState_RowSelection : never) | ('rowSortingFeature' extends keyof TFeatures ? TableState_RowSorting : never)> & ExtractFeatureTypes<'TableState', TFeatures> & TableState_Plugins<TFeatures>;
|
|
24
|
+
type TableState_All = Partial<TableState_ColumnFiltering & TableState_ColumnGrouping & TableState_ColumnOrdering & TableState_ColumnPinning & TableState_ColumnResizing & TableState_ColumnSizing & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowPinning & TableState_RowSelection & TableState_RowSorting>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { TableState, TableState_All, TableState_Plugins };
|
|
27
|
+
//# sourceMappingURL=TableState.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/types/type-utils.d.ts
|
|
2
|
+
type Updater<T> = T | ((old: T) => T);
|
|
3
|
+
type OnChangeFn<T> = (updaterOrValue: Updater<T>) => void;
|
|
4
|
+
type RowData = Record<string, any> | Array<any>;
|
|
5
|
+
type CellData = unknown;
|
|
6
|
+
type PartialKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
7
|
+
type RequiredKeys<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
8
|
+
type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends ((x: infer R) => any) ? R : never;
|
|
9
|
+
type ComputeRange<N extends number, Result extends Array<unknown> = []> = Result['length'] extends N ? Result : ComputeRange<N, [...Result, Result['length']]>;
|
|
10
|
+
type Index40 = ComputeRange<40>[number];
|
|
11
|
+
type IsTuple<T> = T extends ReadonlyArray<any> & {
|
|
12
|
+
length: infer Length;
|
|
13
|
+
} ? Length extends Index40 ? T : never : never;
|
|
14
|
+
type AllowedIndexes<Tuple extends ReadonlyArray<any>, Keys extends number = never> = Tuple extends readonly [] ? Keys : Tuple extends readonly [infer _, ...infer Tail] ? AllowedIndexes<Tail, Keys | Tail['length']> : Keys;
|
|
15
|
+
type DeepKeys<T, TDepth extends Array<any> = []> = TDepth['length'] extends 5 ? never : unknown extends T ? string : T extends ReadonlyArray<any> & IsTuple<T> ? AllowedIndexes<T> | DeepKeysPrefix<T, AllowedIndexes<T>, TDepth> : T extends Array<any> ? DeepKeys<T[number], [...TDepth, any]> : T extends Date ? never : T extends object ? (keyof T & string) | DeepKeysPrefix<T, keyof T, TDepth> : never;
|
|
16
|
+
type DeepKeysPrefix<T, TPrefix, TDepth extends Array<any>> = TPrefix extends keyof T & (number | string) ? `${TPrefix}.${DeepKeys<T[TPrefix], [...TDepth, any]> & string}` : never;
|
|
17
|
+
type DeepValue<T, TProp> = T extends Record<string | number, any> ? TProp extends `${infer TBranch}.${infer TDeepProp}` ? DeepValue<T[TBranch], TDeepProp> : T[TProp & string] : never;
|
|
18
|
+
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
19
|
+
type Getter<TValue> = <TTValue = TValue>() => NoInfer<TTValue>;
|
|
20
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & unknown;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { CellData, DeepKeys, DeepValue, Getter, NoInfer, OnChangeFn, PartialKeys, Prettify, RequiredKeys, RowData, UnionToIntersection, Updater };
|
|
23
|
+
//# sourceMappingURL=type-utils.d.cts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/types/type-utils.d.ts
|
|
2
|
+
type Updater<T> = T | ((old: T) => T);
|
|
3
|
+
type OnChangeFn<T> = (updaterOrValue: Updater<T>) => void;
|
|
4
|
+
type RowData = Record<string, any> | Array<any>;
|
|
5
|
+
type CellData = unknown;
|
|
6
|
+
type PartialKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
7
|
+
type RequiredKeys<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
8
|
+
type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends ((x: infer R) => any) ? R : never;
|
|
9
|
+
type ComputeRange<N extends number, Result extends Array<unknown> = []> = Result['length'] extends N ? Result : ComputeRange<N, [...Result, Result['length']]>;
|
|
10
|
+
type Index40 = ComputeRange<40>[number];
|
|
11
|
+
type IsTuple<T> = T extends ReadonlyArray<any> & {
|
|
12
|
+
length: infer Length;
|
|
13
|
+
} ? Length extends Index40 ? T : never : never;
|
|
14
|
+
type AllowedIndexes<Tuple extends ReadonlyArray<any>, Keys extends number = never> = Tuple extends readonly [] ? Keys : Tuple extends readonly [infer _, ...infer Tail] ? AllowedIndexes<Tail, Keys | Tail['length']> : Keys;
|
|
15
|
+
type DeepKeys<T, TDepth extends Array<any> = []> = TDepth['length'] extends 5 ? never : unknown extends T ? string : T extends ReadonlyArray<any> & IsTuple<T> ? AllowedIndexes<T> | DeepKeysPrefix<T, AllowedIndexes<T>, TDepth> : T extends Array<any> ? DeepKeys<T[number], [...TDepth, any]> : T extends Date ? never : T extends object ? (keyof T & string) | DeepKeysPrefix<T, keyof T, TDepth> : never;
|
|
16
|
+
type DeepKeysPrefix<T, TPrefix, TDepth extends Array<any>> = TPrefix extends keyof T & (number | string) ? `${TPrefix}.${DeepKeys<T[TPrefix], [...TDepth, any]> & string}` : never;
|
|
17
|
+
type DeepValue<T, TProp> = T extends Record<string | number, any> ? TProp extends `${infer TBranch}.${infer TDeepProp}` ? DeepValue<T[TBranch], TDeepProp> : T[TProp & string] : never;
|
|
18
|
+
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
19
|
+
type Getter<TValue> = <TTValue = TValue>() => NoInfer<TTValue>;
|
|
20
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & unknown;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { CellData, DeepKeys, DeepValue, Getter, NoInfer, OnChangeFn, PartialKeys, Prettify, RequiredKeys, RowData, UnionToIntersection, Updater };
|
|
23
|
+
//# sourceMappingURL=type-utils.d.ts.map
|
package/dist/utils.cjs
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils.ts
|
|
3
|
+
function functionalUpdate(updater, input) {
|
|
4
|
+
return typeof updater === "function" ? updater(input) : updater;
|
|
5
|
+
}
|
|
6
|
+
function noop() {}
|
|
7
|
+
function makeStateUpdater(key, instance) {
|
|
8
|
+
return (updater) => {
|
|
9
|
+
instance.baseStore.setState((old) => {
|
|
10
|
+
return {
|
|
11
|
+
...old,
|
|
12
|
+
[key]: functionalUpdate(updater, old[key])
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function isFunction(d) {
|
|
18
|
+
return d instanceof Function;
|
|
19
|
+
}
|
|
20
|
+
function isNumberArray(d) {
|
|
21
|
+
return Array.isArray(d) && d.every((val) => typeof val === "number");
|
|
22
|
+
}
|
|
23
|
+
function flattenBy(arr, getChildren) {
|
|
24
|
+
const flat = [];
|
|
25
|
+
const recurse = (subArr) => {
|
|
26
|
+
subArr.forEach((item) => {
|
|
27
|
+
flat.push(item);
|
|
28
|
+
const children = getChildren(item);
|
|
29
|
+
if (children.length) recurse(children);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
recurse(arr);
|
|
33
|
+
return flat;
|
|
34
|
+
}
|
|
35
|
+
const $internalMemoFnMeta = Symbol("memoFnMeta");
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
function setMemoFnMeta(fn, meta) {
|
|
40
|
+
Object.defineProperty(fn, $internalMemoFnMeta, { value: meta });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
function getMemoFnMeta(fn) {
|
|
46
|
+
return (typeof fn === "function" && fn[$internalMemoFnMeta]) ?? null;
|
|
47
|
+
}
|
|
48
|
+
const memo = ({ fn, memoDeps, onAfterCompare, onAfterUpdate, onBeforeCompare, onBeforeUpdate }) => {
|
|
49
|
+
let deps = [];
|
|
50
|
+
let result;
|
|
51
|
+
const memoizedFn = (depArgs) => {
|
|
52
|
+
onBeforeCompare === null || onBeforeCompare === void 0 || onBeforeCompare();
|
|
53
|
+
const newDeps = memoDeps === null || memoDeps === void 0 ? void 0 : memoDeps(depArgs);
|
|
54
|
+
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);
|
|
55
|
+
onAfterCompare === null || onAfterCompare === void 0 || onAfterCompare(depsChanged);
|
|
56
|
+
if (!depsChanged) return result;
|
|
57
|
+
deps = newDeps;
|
|
58
|
+
onBeforeUpdate === null || onBeforeUpdate === void 0 || onBeforeUpdate();
|
|
59
|
+
result = fn(...newDeps ?? []);
|
|
60
|
+
onAfterUpdate === null || onAfterUpdate === void 0 || onAfterUpdate(result);
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
setMemoFnMeta(memoizedFn, { originalArgsLength: fn.length });
|
|
64
|
+
return memoizedFn;
|
|
65
|
+
};
|
|
66
|
+
const pad = (str, num) => {
|
|
67
|
+
str = String(str);
|
|
68
|
+
while (str.length < num) str = " " + str;
|
|
69
|
+
return str;
|
|
70
|
+
};
|
|
71
|
+
function tableMemo({ feature, fnName, objectId, onAfterUpdate, table, ...memoOptions }) {
|
|
72
|
+
let beforeCompareTime;
|
|
73
|
+
let afterCompareTime;
|
|
74
|
+
let startCalcTime;
|
|
75
|
+
let endCalcTime;
|
|
76
|
+
let runCount = 0;
|
|
77
|
+
let debug;
|
|
78
|
+
let debugCache;
|
|
79
|
+
if (process.env.NODE_ENV === "development") {
|
|
80
|
+
const { debugCache: _debugCache, debugAll } = table.options;
|
|
81
|
+
debugCache = _debugCache;
|
|
82
|
+
const { parentName } = getFunctionNameInfo(fnName, ".");
|
|
83
|
+
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);
|
|
84
|
+
}
|
|
85
|
+
function logTime(time, depsChanged) {
|
|
86
|
+
var _memoOptions$memoDeps;
|
|
87
|
+
const runType = runCount === 0 ? "(1st run)" : depsChanged ? "(rerun #" + runCount + ")" : "(cache)";
|
|
88
|
+
runCount++;
|
|
89
|
+
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(
|
|
90
|
+
${Math.max(0, Math.min(120 - Math.log10(time) * 60, 120))}deg 100% 31%);` : ""} `, `color: ${runCount < 2 ? "#FF00FF" : "#FF1493"}`, "color: #666", "color: #87CEEB");
|
|
91
|
+
console.info({
|
|
92
|
+
feature,
|
|
93
|
+
state: table.store.state,
|
|
94
|
+
deps: (_memoOptions$memoDeps = memoOptions.memoDeps) === null || _memoOptions$memoDeps === void 0 ? void 0 : _memoOptions$memoDeps.toString()
|
|
95
|
+
});
|
|
96
|
+
console.trace();
|
|
97
|
+
console.groupEnd();
|
|
98
|
+
}
|
|
99
|
+
const debugOptions = process.env.NODE_ENV === "development" ? {
|
|
100
|
+
onBeforeCompare: () => {
|
|
101
|
+
if (debugCache) beforeCompareTime = performance.now();
|
|
102
|
+
},
|
|
103
|
+
onAfterCompare: (depsChanged) => {
|
|
104
|
+
if (debugCache) {
|
|
105
|
+
afterCompareTime = performance.now();
|
|
106
|
+
const compareTime = Math.round((afterCompareTime - beforeCompareTime) * 100) / 100;
|
|
107
|
+
if (!depsChanged) logTime(compareTime, depsChanged);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
onBeforeUpdate: () => {
|
|
111
|
+
if (debug) startCalcTime = performance.now();
|
|
112
|
+
},
|
|
113
|
+
onAfterUpdate: () => {
|
|
114
|
+
if (debug) {
|
|
115
|
+
endCalcTime = performance.now();
|
|
116
|
+
logTime(Math.round((endCalcTime - startCalcTime) * 100) / 100, true);
|
|
117
|
+
}
|
|
118
|
+
queueMicrotask(() => onAfterUpdate === null || onAfterUpdate === void 0 ? void 0 : onAfterUpdate());
|
|
119
|
+
}
|
|
120
|
+
} : { onAfterUpdate: () => {
|
|
121
|
+
queueMicrotask(() => onAfterUpdate === null || onAfterUpdate === void 0 ? void 0 : onAfterUpdate());
|
|
122
|
+
} };
|
|
123
|
+
return memo({
|
|
124
|
+
...memoOptions,
|
|
125
|
+
...debugOptions
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Assumes that a function name is in the format of `parentName_fnKey` and returns the `fnKey` and `fnName` in the format of `parentName.fnKey`.
|
|
130
|
+
*/
|
|
131
|
+
function getFunctionNameInfo(staticFnName, splitBy = "_") {
|
|
132
|
+
const [parentName, fnKey] = staticFnName.split(splitBy);
|
|
133
|
+
return {
|
|
134
|
+
fnKey,
|
|
135
|
+
fnName: `${parentName}.${fnKey}`,
|
|
136
|
+
parentName
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Assigns Table API methods directly to the table instance.
|
|
141
|
+
* Unlike row/cell/column/header, the table is a singleton so methods are assigned directly.
|
|
142
|
+
*/
|
|
143
|
+
function assignTableAPIs(feature, table, apis) {
|
|
144
|
+
for (const [staticFnName, { fn, memoDeps }] of Object.entries(apis)) {
|
|
145
|
+
const { fnKey, fnName } = getFunctionNameInfo(staticFnName);
|
|
146
|
+
table[fnKey] = memoDeps ? tableMemo({
|
|
147
|
+
memoDeps,
|
|
148
|
+
fn,
|
|
149
|
+
fnName,
|
|
150
|
+
table,
|
|
151
|
+
feature
|
|
152
|
+
}) : fn;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Assigns API methods to a prototype object for memory-efficient method sharing.
|
|
157
|
+
* All instances created with this prototype will share the same method references.
|
|
158
|
+
*
|
|
159
|
+
* For memoized methods, the memo state is lazily created and stored on each instance.
|
|
160
|
+
* This provides the best of both worlds: shared method code + per-instance caching.
|
|
161
|
+
*/
|
|
162
|
+
function assignPrototypeAPIs(feature, prototype, table, apis) {
|
|
163
|
+
for (const [staticFnName, { fn, memoDeps }] of Object.entries(apis)) {
|
|
164
|
+
const { fnKey, fnName } = getFunctionNameInfo(staticFnName);
|
|
165
|
+
if (memoDeps) {
|
|
166
|
+
const memoKey = `_memo_${fnKey}`;
|
|
167
|
+
prototype[fnKey] = function(...args) {
|
|
168
|
+
if (!this[memoKey]) {
|
|
169
|
+
const self = this;
|
|
170
|
+
this[memoKey] = tableMemo({
|
|
171
|
+
memoDeps: () => memoDeps(self),
|
|
172
|
+
fn: (...deps) => fn(self, ...deps),
|
|
173
|
+
fnName,
|
|
174
|
+
objectId: self.id,
|
|
175
|
+
table,
|
|
176
|
+
feature
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return this[memoKey](...args);
|
|
180
|
+
};
|
|
181
|
+
} else prototype[fnKey] = function(...args) {
|
|
182
|
+
return fn(this, ...args);
|
|
183
|
+
};
|
|
184
|
+
setMemoFnMeta(prototype[fnKey], { originalArgsLength: fn.length });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Looks to run the memoized function with the builder pattern on the object if it exists, otherwise fallback to the static method passed in.
|
|
189
|
+
*/
|
|
190
|
+
function callMemoOrStaticFn(obj, fnKey, staticFn, ...args) {
|
|
191
|
+
var _obj$fnKey;
|
|
192
|
+
return ((_obj$fnKey = obj[fnKey]) === null || _obj$fnKey === void 0 ? void 0 : _obj$fnKey.call(obj, ...args)) ?? staticFn(obj, ...args);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
exports.$internalMemoFnMeta = $internalMemoFnMeta;
|
|
197
|
+
exports.assignPrototypeAPIs = assignPrototypeAPIs;
|
|
198
|
+
exports.assignTableAPIs = assignTableAPIs;
|
|
199
|
+
exports.callMemoOrStaticFn = callMemoOrStaticFn;
|
|
200
|
+
exports.flattenBy = flattenBy;
|
|
201
|
+
exports.functionalUpdate = functionalUpdate;
|
|
202
|
+
exports.getFunctionNameInfo = getFunctionNameInfo;
|
|
203
|
+
exports.getMemoFnMeta = getMemoFnMeta;
|
|
204
|
+
exports.isFunction = isFunction;
|
|
205
|
+
exports.isNumberArray = isNumberArray;
|
|
206
|
+
exports.makeStateUpdater = makeStateUpdater;
|
|
207
|
+
exports.memo = memo;
|
|
208
|
+
exports.noop = noop;
|
|
209
|
+
exports.tableMemo = tableMemo;
|
|
210
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.cjs","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/dist/utils.d.cts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { NoInfer, RowData, Updater } from "./types/type-utils.cjs";
|
|
2
|
+
import { TableState, TableState_All } from "./types/TableState.cjs";
|
|
3
|
+
import { TableFeatures } from "./types/TableFeatures.cjs";
|
|
4
|
+
import { Table, Table_Internal } from "./types/Table.cjs";
|
|
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.cts.map
|