@1771technologies/lytenyte-pro 0.9.4 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/+types.d.ts +5299 -0
- package/dist/+types.js +1 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +2 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +43 -0
- package/dist/cell-selection/are-rects-equal.d.ts +2 -0
- package/dist/cell-selection/are-rects-equal.js +6 -0
- package/dist/cell-selection/bound-selection-rect.d.ts +2 -0
- package/dist/cell-selection/bound-selection-rect.js +17 -0
- package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
- package/dist/cell-selection/cell-selection-containers.js +91 -0
- package/dist/cell-selection/cell-selection-driver.js +272 -0
- package/dist/{types/cell-selection → cell-selection}/cell-style-row.d.ts +2 -2
- package/dist/cell-selection/cell-style-row.js +84 -0
- package/dist/cell-selection/deselect-rect-range.d.ts +2 -0
- package/dist/cell-selection/deselect-rect-range.js +43 -0
- package/dist/cell-selection/expand-cell-selection-down.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-down.js +39 -0
- package/dist/cell-selection/expand-cell-selection-end.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-end.js +40 -0
- package/dist/cell-selection/expand-cell-selection-start.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-start.js +39 -0
- package/dist/cell-selection/expand-cell-selection-up.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-up.js +39 -0
- package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
- package/dist/cell-selection/full-width-start-end-index.js +5 -0
- package/dist/cell-selection/get-root-cell.d.ts +2 -0
- package/dist/cell-selection/get-root-cell.js +86 -0
- package/dist/cell-selection/index.d.ts +19 -0
- package/dist/cell-selection/index.js +19 -0
- package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
- package/dist/cell-selection/is-bottom-rect.js +7 -0
- package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
- package/dist/cell-selection/is-center-col-rect.js +5 -0
- package/dist/cell-selection/is-center-rect.d.ts +2 -0
- package/dist/cell-selection/is-center-rect.js +5 -0
- package/dist/cell-selection/is-end-rect.d.ts +5 -0
- package/dist/cell-selection/is-end-rect.js +4 -0
- package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
- package/dist/cell-selection/is-overlapping-rect.js +6 -0
- package/dist/cell-selection/is-start-rect.d.ts +5 -0
- package/dist/cell-selection/is-start-rect.js +4 -0
- package/dist/cell-selection/is-top-rect.d.ts +2 -0
- package/dist/cell-selection/is-top-rect.js +4 -0
- package/dist/cell-selection/is-within-selection-rect.d.ts +2 -0
- package/dist/cell-selection/is-within-selection-rect.js +3 -0
- package/dist/cell-selection/split-cell-selection-rect.d.ts +39 -0
- package/dist/cell-selection/split-cell-selection-rect.js +79 -0
- package/dist/cell-selection/update-additive-cell-selection.d.ts +5 -0
- package/dist/cell-selection/update-additive-cell-selection.js +25 -0
- package/dist/cell-selection/use-edge-scroll.d.ts +10 -0
- package/dist/cell-selection/use-edge-scroll.js +66 -0
- package/dist/cells/cell-default.d.ts +2 -0
- package/dist/cells/cell-default.js +8 -0
- package/dist/cells/cell-editor.d.ts +6 -0
- package/dist/cells/cell-editor.js +96 -0
- package/dist/cells/cell.d.ts +7 -0
- package/dist/cells/cell.js +37 -0
- package/dist/column-manager/branch-lookup-context.d.ts +4 -0
- package/dist/column-manager/branch-lookup-context.js +3 -0
- package/dist/column-manager/branch.d.ts +9 -0
- package/dist/column-manager/branch.js +38 -0
- package/dist/column-manager/column-manager.d.ts +15 -0
- package/dist/column-manager/column-manager.js +20 -0
- package/dist/column-manager/context.d.ts +7 -0
- package/dist/column-manager/context.js +3 -0
- package/dist/column-manager/label.d.ts +5 -0
- package/dist/column-manager/label.js +18 -0
- package/dist/column-manager/leaf.d.ts +6 -0
- package/dist/column-manager/leaf.js +40 -0
- package/dist/column-manager/move-handle.d.ts +12 -0
- package/dist/column-manager/move-handle.js +58 -0
- package/dist/column-manager/passive-scroll.d.ts +2 -0
- package/dist/column-manager/passive-scroll.js +2 -0
- package/dist/column-manager/root.d.ts +9 -0
- package/dist/column-manager/root.js +20 -0
- package/dist/column-manager/use-column-manager.d.ts +19 -0
- package/dist/column-manager/use-column-manager.js +24 -0
- package/dist/column-manager/use-columns-from-context.d.ts +3 -0
- package/dist/column-manager/use-columns-from-context.js +23 -0
- package/dist/column-manager/visibility-checkbox.d.ts +9 -0
- package/dist/column-manager/visibility-checkbox.js +30 -0
- package/dist/context.d.ts +10 -0
- package/dist/context.js +4 -0
- package/dist/filter-tree/branch.d.ts +10 -0
- package/dist/filter-tree/branch.js +21 -0
- package/dist/filter-tree/context.d.ts +27 -0
- package/dist/filter-tree/context.js +5 -0
- package/dist/filter-tree/filter-tree.d.ts +14 -0
- package/dist/filter-tree/filter-tree.js +18 -0
- package/dist/filter-tree/hooks/use-filter-tree.d.ts +37 -0
- package/dist/filter-tree/hooks/use-filter-tree.js +96 -0
- package/dist/filter-tree/hooks/use-tree-item.d.ts +8 -0
- package/dist/filter-tree/hooks/use-tree-item.js +116 -0
- package/dist/filter-tree/inclusion-checkbox.d.ts +9 -0
- package/dist/filter-tree/inclusion-checkbox.js +14 -0
- package/dist/filter-tree/label.d.ts +5 -0
- package/dist/filter-tree/label.js +18 -0
- package/dist/filter-tree/leaf.d.ts +6 -0
- package/dist/filter-tree/leaf.js +12 -0
- package/dist/filter-tree/root.d.ts +13 -0
- package/dist/filter-tree/root.js +30 -0
- package/dist/grid-box/+types.d.ts +13 -0
- package/dist/grid-box/+types.js +1 -0
- package/dist/grid-box/context.d.ts +9 -0
- package/dist/grid-box/context.js +3 -0
- package/dist/grid-box/grid-box.d.ts +12 -0
- package/dist/grid-box/grid-box.js +14 -0
- package/dist/grid-box/item.d.ts +7 -0
- package/dist/grid-box/item.js +33 -0
- package/dist/grid-box/panel.d.ts +1 -0
- package/dist/grid-box/panel.js +9 -0
- package/dist/grid-box/root.d.ts +9 -0
- package/dist/grid-box/root.js +8 -0
- package/dist/grid-box/use-aggregation-box-items.d.ts +18 -0
- package/dist/grid-box/use-aggregation-box-items.js +60 -0
- package/dist/grid-box/use-column-box-items.d.ts +31 -0
- package/dist/grid-box/use-column-box-items.js +81 -0
- package/dist/grid-box/use-row-group-box-items.d.ts +18 -0
- package/dist/grid-box/use-row-group-box-items.js +134 -0
- package/dist/grid-provider/context.d.ts +5 -0
- package/dist/grid-provider/context.js +2 -0
- package/dist/grid-provider/provider.d.ts +3 -0
- package/dist/grid-provider/provider.js +2 -0
- package/dist/grid-provider/use-grid.d.ts +3 -0
- package/dist/grid-provider/use-grid.js +3 -0
- package/dist/grid.d.ts +29 -0
- package/dist/grid.js +38 -0
- package/dist/header/header-cell.d.ts +10 -0
- package/dist/header/header-cell.js +24 -0
- package/dist/header/header-group-cell.d.ts +5 -0
- package/dist/header/header-group-cell.js +14 -0
- package/dist/header/header-row.d.ts +4 -0
- package/dist/header/header-row.js +10 -0
- package/dist/header/header.d.ts +1 -0
- package/dist/header/header.js +10 -0
- package/dist/header/resize-handler.d.ts +12 -0
- package/dist/header/resize-handler.js +128 -0
- package/dist/header/use-drag-move.d.ts +14 -0
- package/dist/header/use-drag-move.js +90 -0
- package/dist/header/use-header-cell-renderer.d.ts +4 -0
- package/dist/header/use-header-cell-renderer.js +36 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -3860
- package/dist/license.d.ts +2 -0
- package/dist/license.js +217 -0
- package/dist/listbox/context.d.ts +6 -0
- package/dist/listbox/context.js +3 -0
- package/dist/listbox/item.d.ts +1 -0
- package/dist/listbox/item.js +25 -0
- package/dist/listbox/panel.d.ts +1 -0
- package/dist/listbox/panel.js +50 -0
- package/dist/listbox/root.d.ts +6 -0
- package/dist/listbox/root.js +12 -0
- package/dist/root/dialog-driver.js +21 -0
- package/dist/root/popover-driver.js +21 -0
- package/dist/root/root.d.ts +8 -0
- package/dist/root/root.js +120 -0
- package/dist/row-data-source-client/+constants.d.ts +2 -0
- package/dist/row-data-source-client/+constants.js +2 -0
- package/dist/row-data-source-client/+types.d.ts +27 -0
- package/dist/row-data-source-client/+types.js +1 -0
- package/dist/row-data-source-client/built-ins/avg.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/avg.js +16 -0
- package/dist/row-data-source-client/built-ins/built-ins.d.ts +44 -0
- package/dist/row-data-source-client/built-ins/built-ins.js +44 -0
- package/dist/row-data-source-client/built-ins/count.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/count.js +16 -0
- package/dist/row-data-source-client/built-ins/first.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/first.js +12 -0
- package/dist/row-data-source-client/built-ins/group.d.ts +1 -0
- package/dist/row-data-source-client/built-ins/group.js +3 -0
- package/dist/row-data-source-client/built-ins/last.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/last.js +12 -0
- package/dist/row-data-source-client/built-ins/max.d.ts +11 -0
- package/dist/row-data-source-client/built-ins/max.js +25 -0
- package/dist/row-data-source-client/built-ins/min.d.ts +11 -0
- package/dist/row-data-source-client/built-ins/min.js +25 -0
- package/dist/row-data-source-client/built-ins/sum.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/sum.js +21 -0
- package/dist/row-data-source-client/filter/+types.d.ts +23 -0
- package/dist/row-data-source-client/filter/+types.js +1 -0
- package/dist/row-data-source-client/filter/compute-filtered-rows.d.ts +2 -0
- package/dist/row-data-source-client/filter/compute-filtered-rows.js +109 -0
- package/dist/row-data-source-client/pivots/create-agg-model.d.ts +6 -0
- package/dist/row-data-source-client/pivots/create-agg-model.js +13 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.d.ts +2 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +50 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns.d.ts +2 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns.js +22 -0
- package/dist/row-data-source-client/pivots/create-pivot-tree.d.ts +2 -0
- package/dist/row-data-source-client/pivots/create-pivot-tree.js +23 -0
- package/dist/row-data-source-client/tree/client-tree.d.ts +18 -0
- package/dist/row-data-source-client/tree/client-tree.js +76 -0
- package/dist/row-data-source-client/tree/evaluator-aggregation.d.ts +2 -0
- package/dist/row-data-source-client/tree/evaluator-aggregation.js +8 -0
- package/dist/row-data-source-client/tree/evaluator-group.d.ts +2 -0
- package/dist/row-data-source-client/tree/evaluator-group.js +9 -0
- package/dist/row-data-source-client/tree/traverse.d.ts +2 -0
- package/dist/row-data-source-client/tree/traverse.js +22 -0
- package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +10 -0
- package/dist/row-data-source-client/use-client-data-source-paginated.js +538 -0
- package/dist/row-data-source-client/use-client-data-source.d.ts +10 -0
- package/dist/row-data-source-client/use-client-data-source.js +667 -0
- package/dist/row-data-source-client/use-client-tree-data-source.d.ts +9 -0
- package/dist/row-data-source-client/use-client-tree-data-source.js +513 -0
- package/dist/row-data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
- package/dist/row-data-source-server/async-tree/+constants.async-tree.js +1 -0
- package/dist/row-data-source-server/async-tree/+types.async-tree.d.ts +59 -0
- package/dist/row-data-source-server/async-tree/+types.async-tree.js +1 -0
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.js +36 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.js +24 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.js +14 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.js +18 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.js +14 -0
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.js +18 -0
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
- package/dist/row-data-source-server/async-tree/make-async-tree.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/make-async-tree.js +19 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.js +17 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.js +51 -0
- package/dist/row-data-source-server/range-tree/range-tree.d.ts +66 -0
- package/dist/row-data-source-server/range-tree/range-tree.js +102 -0
- package/dist/row-data-source-server/use-server-data-source.d.ts +3 -0
- package/dist/row-data-source-server/use-server-data-source.js +679 -0
- package/dist/row-data-source-server/utils/get-node-depth.d.ts +2 -0
- package/dist/row-data-source-server/utils/get-node-depth.js +9 -0
- package/dist/row-data-source-server/utils/get-node-path.d.ts +2 -0
- package/dist/row-data-source-server/utils/get-node-path.js +9 -0
- package/dist/row-data-source-server/utils/get-request-id.d.ts +1 -0
- package/dist/row-data-source-server/utils/get-request-id.js +6 -0
- package/dist/rows/row/context.d.ts +6 -0
- package/dist/rows/row/context.js +3 -0
- package/dist/rows/row/row.d.ts +7 -0
- package/dist/rows/row/row.js +16 -0
- package/dist/rows/row/use-row-context-value.d.ts +6 -0
- package/dist/rows/row/use-row-context-value.js +29 -0
- package/dist/rows/row-detail-row.d.ts +4 -0
- package/dist/rows/row-detail-row.js +131 -0
- package/dist/rows/row-full-width.d.ts +8 -0
- package/dist/rows/row-full-width.js +17 -0
- package/dist/rows/rows-container.d.ts +1 -0
- package/dist/rows/rows-container.js +9 -0
- package/dist/rows/rows-sections.d.ts +3 -0
- package/dist/rows/rows-sections.js +27 -0
- package/dist/rows/scrollers/native-scroller.d.ts +2 -0
- package/dist/rows/scrollers/native-scroller.js +18 -0
- package/dist/{types/sort-manager/use-sort-state.d.ts → sort-manager/+types.d.ts} +5 -2
- package/dist/sort-manager/+types.js +1 -0
- package/dist/sort-manager/context.d.ts +14 -0
- package/dist/sort-manager/context.js +5 -0
- package/dist/sort-manager/hooks/use-sort-manager.d.ts +15 -0
- package/dist/sort-manager/hooks/use-sort-manager.js +56 -0
- package/dist/{types/sort-manager/sort-manager-container.d.ts → sort-manager/hooks/use-sort-row-item.d.ts} +5 -7
- package/dist/sort-manager/hooks/use-sort-row-item.js +145 -0
- package/dist/sort-manager/hooks/use-sortable-column-items.d.ts +5 -0
- package/dist/sort-manager/hooks/use-sortable-column-items.js +13 -0
- package/dist/sort-manager/root.d.ts +3 -0
- package/dist/sort-manager/root.js +14 -0
- package/dist/sort-manager/sort-add.d.ts +8 -0
- package/dist/sort-manager/sort-add.js +14 -0
- package/dist/sort-manager/sort-apply.d.ts +7 -0
- package/dist/sort-manager/sort-apply.js +24 -0
- package/dist/sort-manager/sort-cancel.d.ts +7 -0
- package/dist/sort-manager/sort-cancel.js +27 -0
- package/dist/sort-manager/sort-clear.d.ts +7 -0
- package/dist/sort-manager/sort-clear.js +22 -0
- package/dist/sort-manager/sort-column-select.d.ts +10 -0
- package/dist/sort-manager/sort-column-select.js +20 -0
- package/dist/sort-manager/sort-direction-select.d.ts +10 -0
- package/dist/sort-manager/sort-direction-select.js +24 -0
- package/dist/sort-manager/sort-manager.d.ts +16 -0
- package/dist/sort-manager/sort-manager.js +26 -0
- package/dist/sort-manager/sort-remove.d.ts +7 -0
- package/dist/sort-manager/sort-remove.js +14 -0
- package/dist/sort-manager/sort-row.d.ts +5 -0
- package/dist/sort-manager/sort-row.js +7 -0
- package/dist/sort-manager/sort-rows.d.ts +1 -0
- package/dist/sort-manager/sort-rows.js +6 -0
- package/dist/sort-manager/sort-value-select.d.ts +11 -0
- package/dist/sort-manager/sort-value-select.js +25 -0
- package/dist/sort-manager/utils/sort-item-to-sort-model.d.ts +3 -0
- package/dist/sort-manager/utils/sort-item-to-sort-model.js +57 -0
- package/dist/sort-manager/utils/sort-model-to-sort-items.d.ts +3 -0
- package/dist/sort-manager/utils/sort-model-to-sort-items.js +49 -0
- package/dist/state/+types.d.ts +34 -0
- package/dist/state/+types.js +1 -0
- package/dist/state/api/column-autosize.d.ts +5 -0
- package/dist/state/api/column-autosize.js +72 -0
- package/dist/state/api/column-by-id.d.ts +2 -0
- package/dist/state/api/column-by-id.js +6 -0
- package/dist/state/api/column-field.d.ts +2 -0
- package/dist/state/api/column-field.js +23 -0
- package/dist/state/api/column-from-index.d.ts +2 -0
- package/dist/state/api/column-from-index.js +6 -0
- package/dist/state/api/column-group-toggle.d.ts +2 -0
- package/dist/state/api/column-group-toggle.js +10 -0
- package/dist/state/api/column-index.d.ts +2 -0
- package/dist/state/api/column-index.js +7 -0
- package/dist/state/api/column-move.d.ts +2 -0
- package/dist/state/api/column-move.js +49 -0
- package/dist/state/api/column-resize.d.ts +2 -0
- package/dist/state/api/column-resize.js +9 -0
- package/dist/state/api/column-update.d.ts +2 -0
- package/dist/state/api/column-update.js +13 -0
- package/dist/state/api/dialog-frame.d.ts +8 -0
- package/dist/state/api/dialog-frame.js +16 -0
- package/dist/state/api/edit-begin.d.ts +5 -0
- package/dist/state/api/edit-begin.js +91 -0
- package/dist/state/api/edit-end.d.ts +5 -0
- package/dist/state/api/edit-end.js +43 -0
- package/dist/state/api/edit-is-cell-active.d.ts +5 -0
- package/dist/state/api/edit-is-cell-active.js +27 -0
- package/dist/state/api/edit-update.d.ts +5 -0
- package/dist/state/api/edit-update.js +88 -0
- package/dist/state/api/event-listeners.d.ts +5 -0
- package/dist/state/api/event-listeners.js +19 -0
- package/dist/state/api/export-csv.d.ts +3 -0
- package/dist/state/api/export-csv.js +40 -0
- package/dist/state/api/export-data-rect.d.ts +2 -0
- package/dist/state/api/export-data-rect.js +24 -0
- package/dist/state/api/focus-cell.d.ts +5 -0
- package/dist/state/api/focus-cell.js +117 -0
- package/dist/state/api/popover-frame.d.ts +8 -0
- package/dist/state/api/popover-frame.js +16 -0
- package/dist/state/api/position-from-element.d.ts +2 -0
- package/dist/state/api/position-from-element.js +9 -0
- package/dist/state/api/row-by-id.d.ts +2 -0
- package/dist/state/api/row-by-id.js +5 -0
- package/dist/state/api/row-by-index.d.ts +2 -0
- package/dist/state/api/row-by-index.js +9 -0
- package/dist/state/api/row-detail-is-expanded.d.ts +2 -0
- package/dist/state/api/row-detail-is-expanded.js +6 -0
- package/dist/state/api/row-detail-rendered-height.d.ts +5 -0
- package/dist/state/api/row-detail-rendered-height.js +14 -0
- package/dist/state/api/row-detail-toggle.d.ts +2 -0
- package/dist/state/api/row-detail-toggle.js +32 -0
- package/dist/state/api/row-group-apply-expansions.d.ts +2 -0
- package/dist/state/api/row-group-apply-expansions.js +20 -0
- package/dist/state/api/row-group-column-index.d.ts +2 -0
- package/dist/state/api/row-group-column-index.js +14 -0
- package/dist/state/api/row-group-is-expanded.d.ts +2 -0
- package/dist/state/api/row-group-is-expanded.js +15 -0
- package/dist/state/api/row-group-toggle.d.ts +2 -0
- package/dist/state/api/row-group-toggle.js +7 -0
- package/dist/state/api/row-handle-select.d.ts +5 -0
- package/dist/state/api/row-handle-select.js +43 -0
- package/dist/state/api/row-select-all.d.ts +2 -0
- package/dist/state/api/row-select-all.js +17 -0
- package/dist/state/api/row-select.d.ts +5 -0
- package/dist/state/api/row-select.js +35 -0
- package/dist/state/api/row-selected.d.ts +2 -0
- package/dist/state/api/row-selected.js +13 -0
- package/dist/state/api/scroll-into-view.d.ts +5 -0
- package/dist/state/api/scroll-into-view.js +50 -0
- package/dist/state/api/sort-for-column.d.ts +2 -0
- package/dist/state/api/sort-for-column.js +9 -0
- package/dist/state/api/use-row-drag.d.ts +2 -0
- package/dist/state/api/use-row-drag.js +27 -0
- package/dist/state/helpers/cell-row-group.d.ts +2 -0
- package/dist/state/helpers/cell-row-group.js +19 -0
- package/dist/state/helpers/column-add-row-group.d.ts +9 -0
- package/dist/state/helpers/column-add-row-group.js +66 -0
- package/dist/state/helpers/column-layout.d.ts +3 -0
- package/dist/state/helpers/column-layout.js +65 -0
- package/dist/state/helpers/column-marker.d.ts +8 -0
- package/dist/state/helpers/column-marker.js +43 -0
- package/dist/state/helpers/column-view.d.ts +21 -0
- package/dist/state/helpers/column-view.js +33 -0
- package/dist/state/helpers/edit-on-change.d.ts +15 -0
- package/dist/state/helpers/edit-on-change.js +26 -0
- package/dist/state/helpers/empty-row-data-source.d.ts +2 -0
- package/dist/state/helpers/empty-row-data-source.js +17 -0
- package/dist/state/helpers/get-data-rect.d.ts +13 -0
- package/dist/state/helpers/get-data-rect.js +65 -0
- package/dist/state/helpers/get-full-width-callback.d.ts +2 -0
- package/dist/state/helpers/get-full-width-callback.js +8 -0
- package/dist/state/helpers/get-span-callback.d.ts +2 -0
- package/dist/state/helpers/get-span-callback.js +20 -0
- package/dist/state/helpers/resolve-column.d.ts +4 -0
- package/dist/state/helpers/resolve-column.js +22 -0
- package/dist/state/helpers/row-layout/get-focus-criteria.d.ts +17 -0
- package/dist/state/helpers/row-layout/get-focus-criteria.js +62 -0
- package/dist/state/helpers/row-layout/row-layout.d.ts +18 -0
- package/dist/state/helpers/row-layout/row-layout.js +414 -0
- package/dist/state/use-lytenyte.d.ts +3 -0
- package/dist/state/use-lytenyte.js +579 -0
- package/dist/tree-view/branch/branch.d.ts +11 -0
- package/dist/tree-view/branch/branch.js +61 -0
- package/dist/tree-view/branch/use-branch-keys.d.ts +2 -0
- package/dist/tree-view/branch/use-branch-keys.js +87 -0
- package/dist/tree-view/context.d.ts +22 -0
- package/dist/tree-view/context.js +3 -0
- package/dist/tree-view/depth-provider.d.ts +2 -0
- package/dist/tree-view/depth-provider.js +3 -0
- package/dist/tree-view/hooks/use-tree-view-paths.d.ts +2 -0
- package/dist/tree-view/hooks/use-tree-view-paths.js +9 -0
- package/dist/tree-view/index.d.ts +16 -0
- package/dist/tree-view/index.js +16 -0
- package/dist/tree-view/leaf.d.ts +4 -0
- package/dist/tree-view/leaf.js +27 -0
- package/dist/tree-view/navigation/get-all-ids.d.ts +1 -0
- package/dist/tree-view/navigation/get-all-ids.js +7 -0
- package/dist/tree-view/navigation/get-first-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-first-node.js +7 -0
- package/dist/tree-view/navigation/get-last-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-last-node.js +7 -0
- package/dist/tree-view/navigation/get-next-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-next-node.js +13 -0
- package/dist/tree-view/navigation/get-prev-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-prev-node.js +13 -0
- package/dist/tree-view/panel/make-handle-navigation.d.ts +2 -0
- package/dist/tree-view/panel/make-handle-navigation.js +39 -0
- package/dist/tree-view/panel/make-handle-selection.d.ts +2 -0
- package/dist/tree-view/panel/make-handle-selection.js +92 -0
- package/dist/tree-view/panel/make-handle-typeahead.d.ts +1 -0
- package/dist/tree-view/panel/make-handle-typeahead.js +45 -0
- package/dist/tree-view/panel/panel.d.ts +1 -0
- package/dist/tree-view/panel/panel.js +30 -0
- package/dist/tree-view/panel/use-tree-navigation.d.ts +1 -0
- package/dist/tree-view/panel/use-tree-navigation.js +63 -0
- package/dist/tree-view/root.d.ts +17 -0
- package/dist/tree-view/root.js +63 -0
- package/dist/tree-view/utils/get-focusable-nodes.d.ts +1 -0
- package/dist/tree-view/utils/get-focusable-nodes.js +5 -0
- package/dist/tree-view/utils/get-focused-node.d.ts +1 -0
- package/dist/tree-view/utils/get-focused-node.js +14 -0
- package/dist/tree-view/utils/get-ids-between-nodes.d.ts +1 -0
- package/dist/tree-view/utils/get-ids-between-nodes.js +15 -0
- package/dist/tree-view/utils/get-panel.d.ts +1 -0
- package/dist/tree-view/utils/get-panel.js +7 -0
- package/dist/tree-view/utils/get-parent-node.d.ts +1 -0
- package/dist/tree-view/utils/get-parent-node.js +10 -0
- package/dist/tree-view/utils/get-sibling-branches.d.ts +1 -0
- package/dist/tree-view/utils/get-sibling-branches.js +14 -0
- package/dist/tree-view/utils/get-tree-node-id.d.ts +1 -0
- package/dist/tree-view/utils/get-tree-node-id.js +3 -0
- package/dist/tree-view/utils/is-branch-node.d.ts +1 -0
- package/dist/tree-view/utils/is-branch-node.js +3 -0
- package/dist/tree-view/utils/is-leaf-node.d.ts +1 -0
- package/dist/tree-view/utils/is-leaf-node.js +3 -0
- package/dist/tree-view/utils/is-tree-node-disabled.d.ts +1 -0
- package/dist/tree-view/utils/is-tree-node-disabled.js +3 -0
- package/dist/tree-view/utils/select-node.d.ts +2 -0
- package/dist/tree-view/utils/select-node.js +15 -0
- package/dist/tree-view/utils/toggle-all-selections.d.ts +2 -0
- package/dist/tree-view/utils/toggle-all-selections.js +9 -0
- package/dist/tree-view/utils/toggle-selection.d.ts +2 -0
- package/dist/tree-view/utils/toggle-selection.js +21 -0
- package/dist/tree-view/virtualized/force-sync-scrolling.d.ts +2 -0
- package/dist/tree-view/virtualized/force-sync-scrolling.js +23 -0
- package/dist/tree-view/virtualized/get-virtual-tree-paths.d.ts +2 -0
- package/dist/tree-view/virtualized/get-virtual-tree-paths.js +14 -0
- package/dist/tree-view/virtualized/make-virtual-tree.d.ts +31 -0
- package/dist/tree-view/virtualized/make-virtual-tree.js +90 -0
- package/dist/tree-view/virtualized/use-flattened-tree.d.ts +9 -0
- package/dist/tree-view/virtualized/use-flattened-tree.js +36 -0
- package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +2 -0
- package/dist/tree-view/virtualized/use-row-start-and-end.js +27 -0
- package/dist/tree-view/virtualized/use-virtualized-tree.d.ts +22 -0
- package/dist/tree-view/virtualized/use-virtualized-tree.js +100 -0
- package/dist/types/types.d.ts +8 -13
- package/dist/types/types.js +1 -0
- package/dist/utils/cycle-sorts.d.ts +2 -0
- package/dist/utils/cycle-sorts.js +16 -0
- package/dist/viewport/begin-editing.d.ts +5 -0
- package/dist/viewport/begin-editing.js +15 -0
- package/dist/viewport/viewport.d.ts +1 -0
- package/dist/viewport/viewport.js +77 -0
- package/main.css +315 -0
- package/package.json +29 -77
- package/dist/CompositeList-CGRaS6LQ.js +0 -149
- package/dist/DialogPortalContext-C2WZTqJ3.js +0 -47
- package/dist/DirectionContext-DIPP5cAe.js +0 -15
- package/dist/InternalBackdrop-C4RACVzs.js +0 -324
- package/dist/PopoverPortalContext-BdsDjihw.js +0 -26
- package/dist/anchor-context-Cqr_oiJt.js +0 -11
- package/dist/arrow-down-icon-B-3ldODD.js +0 -27
- package/dist/column-manager.js +0 -1228
- package/dist/column-menu-driver-cG-EZgLa.js +0 -491
- package/dist/cross-icon-CEMLAlFX.js +0 -20
- package/dist/dialog.js +0 -506
- package/dist/drag-store-BMsDBUy_.js +0 -1039
- package/dist/filter-manager.js +0 -1057
- package/dist/getPseudoElementBounds-BSHt6WYm.js +0 -26
- package/dist/grid-container.js +0 -18
- package/dist/icons.js +0 -516
- package/dist/lytenyte-pro.css +0 -2167
- package/dist/manage-columns-icon-D4CElo5H.js +0 -146
- package/dist/menu-lIx6h6Vn.js +0 -1885
- package/dist/menu.js +0 -4
- package/dist/more-dots-icon-CzAH3xHG.js +0 -26
- package/dist/pill-BHBLeJ6k.js +0 -1012
- package/dist/pill-manager.js +0 -737
- package/dist/plus-icon-ToqW5CC-.js +0 -15
- package/dist/popover.js +0 -795
- package/dist/proptypes-BjYr2nFr.js +0 -6472
- package/dist/row-group-icon-DFUMye0v.js +0 -186
- package/dist/search-icon-CcG1lqsn.js +0 -86
- package/dist/select-Db5ksjoS.js +0 -2256
- package/dist/separator-BnPPeAk8.js +0 -21
- package/dist/sort-descending-BMtfaa2L.js +0 -34
- package/dist/sort-manager.js +0 -308
- package/dist/tickmark-icon-CoogRMoO.js +0 -51
- package/dist/types/anchor-context/anchor-context.d.ts +0 -6
- package/dist/types/cell-selection/cell-selection-containers.d.ts +0 -3
- package/dist/types/column-manager/column-manager-context.d.ts +0 -12
- package/dist/types/column-manager/column-manager-drag-box-controls.d.ts +0 -1
- package/dist/types/column-manager/column-manager-drag-box-expander.d.ts +0 -1
- package/dist/types/column-manager/column-manager-drag-box-label.d.ts +0 -5
- package/dist/types/column-manager/column-manager-drag-box.d.ts +0 -13
- package/dist/types/column-manager/column-manager-drag-placeholder.d.ts +0 -5
- package/dist/types/column-manager/column-manager-drop-zone.d.ts +0 -10
- package/dist/types/column-manager/column-manager-impl.d.ts +0 -36
- package/dist/types/column-manager/column-manager-pill.d.ts +0 -4
- package/dist/types/column-manager/column-manager-pivot-mode-toggle.d.ts +0 -1
- package/dist/types/column-manager/column-manager-search.d.ts +0 -1
- package/dist/types/column-manager/column-manager-state.d.ts +0 -8
- package/dist/types/column-manager/column-manager-tree-item.d.ts +0 -6
- package/dist/types/column-manager/column-manager-tree.d.ts +0 -11
- package/dist/types/column-manager/column-manager-types.d.ts +0 -1
- package/dist/types/column-manager/column-manager.d.ts +0 -1
- package/dist/types/column-manager/utils/all-leafs.d.ts +0 -3
- package/dist/types/column-manager/utils/can-hide-item.d.ts +0 -3
- package/dist/types/column-manager/utils/handle-item-hide.d.ts +0 -3
- package/dist/types/components-internal/button/button.d.ts +0 -9
- package/dist/types/components-internal/grid-frame/grid-frame.d.ts +0 -11
- package/dist/types/components-internal/radio/radio.d.ts +0 -5
- package/dist/types/components-internal/separator/separator.d.ts +0 -8
- package/dist/types/components-internal/toggle/toggle.d.ts +0 -7
- package/dist/types/dialog/dialog-impl.d.ts +0 -6
- package/dist/types/dialog/dialog.d.ts +0 -8
- package/dist/types/dialog/use-dialog-class.d.ts +0 -1
- package/dist/types/external.d.ts +0 -2
- package/dist/types/filter-manager/combined-to-flat.d.ts +0 -3
- package/dist/types/filter-manager/components/apply-filter-button.d.ts +0 -1
- package/dist/types/filter-manager/components/clear-filter-button.d.ts +0 -1
- package/dist/types/filter-manager/components/flatten-tree-items.d.ts +0 -4
- package/dist/types/filter-manager/components/get-child-values.d.ts +0 -2
- package/dist/types/filter-manager/components/in-filter-container.d.ts +0 -1
- package/dist/types/filter-manager/components/in-filter-error.d.ts +0 -5
- package/dist/types/filter-manager/components/in-filter-loading.d.ts +0 -1
- package/dist/types/filter-manager/components/in-filter-root.d.ts +0 -11
- package/dist/types/filter-manager/components/in-filter-tree.d.ts +0 -15
- package/dist/types/filter-manager/components/simple-filter-additional-switch.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-operator/date-operator.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-operator/number-operator.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-operator/simple-filter-operator.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-operator/text-operator.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-root.d.ts +0 -9
- package/dist/types/filter-manager/components/simple-filter-value/date-value.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-value/number-value.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-value/simple-filter-value.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-value/text-value.d.ts +0 -1
- package/dist/types/filter-manager/components/use-date-filter-callbacks.d.ts +0 -9
- package/dist/types/filter-manager/components/use-in-filter-item-loader.d.ts +0 -7
- package/dist/types/filter-manager/components/use-number-filter-callbacks.d.ts +0 -8
- package/dist/types/filter-manager/components/use-text-filter-callbacks.d.ts +0 -8
- package/dist/types/filter-manager/filter-manager-impl.d.ts +0 -27
- package/dist/types/filter-manager/filter-manager.d.ts +0 -1
- package/dist/types/filter-manager/filter-state-context.d.ts +0 -16
- package/dist/types/filter-manager/flat-to-combined.d.ts +0 -3
- package/dist/types/filter-manager/flatten-combined-filter.d.ts +0 -3
- package/dist/types/filter-manager/is-filter-complete.d.ts +0 -2
- package/dist/types/filter-manager/types.d.ts +0 -15
- package/dist/types/filter-manager/use-in-filter.d.ts +0 -5
- package/dist/types/filter-manager/use-simple-filters.d.ts +0 -8
- package/dist/types/grid-container/grid-container-impl.d.ts +0 -6
- package/dist/types/grid-container/grid-container.d.ts +0 -2
- package/dist/types/header-cell/header-cell-default.d.ts +0 -2
- package/dist/types/icons.d.ts +0 -1
- package/dist/types/index.d.ts +0 -8
- package/dist/types/license.d.ts +0 -12
- package/dist/types/list-view/list-view-context.d.ts +0 -21
- package/dist/types/list-view/list-view.d.ts +0 -26
- package/dist/types/lytenyte-pro.d.ts +0 -7
- package/dist/types/menu/arrow-svg.d.ts +0 -1
- package/dist/types/menu/column-menu/column-menu-driver.d.ts +0 -4
- package/dist/types/menu/context-menu/context-menu-driver.d.ts +0 -1
- package/dist/types/menu/context-menu/use-context-menu-listener.d.ts +0 -6
- package/dist/types/menu/menu-impl.d.ts +0 -18
- package/dist/types/menu/menu.d.ts +0 -19
- package/dist/types/menu/use-menu-class-name.d.ts +0 -1
- package/dist/types/menu-frame/menu-frame-driver.d.ts +0 -1
- package/dist/types/overlay/load-error-overlay.d.ts +0 -1
- package/dist/types/overlay/loading-overlay.d.ts +0 -1
- package/dist/types/overlay/no-data-overlay.d.ts +0 -1
- package/dist/types/overlay/overlay-driver.d.ts +0 -1
- package/dist/types/pill/pill.d.ts +0 -5
- package/dist/types/pill-manager/pill-manager-agg-menu.d.ts +0 -7
- package/dist/types/pill-manager/pill-manager-controls.d.ts +0 -9
- package/dist/types/pill-manager/pill-manager-drag-placeholder.d.ts +0 -5
- package/dist/types/pill-manager/pill-manager-expander.d.ts +0 -1
- package/dist/types/pill-manager/pill-manager-impl.d.ts +0 -50
- package/dist/types/pill-manager/pill-manager-pill.d.ts +0 -5
- package/dist/types/pill-manager/pill-manager-pills/pill-manager-pills.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-aggregation-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-column-pivot-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-column-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-measures-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-row-groups-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/utils.d.ts +0 -3
- package/dist/types/pill-manager/pill-manager-row-label.d.ts +0 -22
- package/dist/types/pill-manager/pill-manager-row.d.ts +0 -12
- package/dist/types/pill-manager/pill-manager-rows.d.ts +0 -1
- package/dist/types/pill-manager/pill-manager-separator.d.ts +0 -1
- package/dist/types/pill-manager/pill-manager-types.d.ts +0 -36
- package/dist/types/pill-manager/pill-manager.d.ts +0 -1
- package/dist/types/popover/popover-impl.d.ts +0 -8
- package/dist/types/popover/popover.d.ts +0 -10
- package/dist/types/popover/use-popover-class.d.ts +0 -1
- package/dist/types/select/select.d.ts +0 -26
- package/dist/types/sort-manager/sort-adder.d.ts +0 -4
- package/dist/types/sort-manager/sort-apply.d.ts +0 -1
- package/dist/types/sort-manager/sort-cancel.d.ts +0 -1
- package/dist/types/sort-manager/sort-clear.d.ts +0 -1
- package/dist/types/sort-manager/sort-column-select.d.ts +0 -6
- package/dist/types/sort-manager/sort-direction-select.d.ts +0 -6
- package/dist/types/sort-manager/sort-items-to-sort-model.d.ts +0 -3
- package/dist/types/sort-manager/sort-manager-context.d.ts +0 -4
- package/dist/types/sort-manager/sort-manager-impl.d.ts +0 -32
- package/dist/types/sort-manager/sort-manager.d.ts +0 -1
- package/dist/types/sort-manager/sort-model-to-sort-items.d.ts +0 -4
- package/dist/types/sort-manager/sort-remove.d.ts +0 -4
- package/dist/types/sort-manager/sort-sort-select.d.ts +0 -6
- package/dist/types/sort-manager/use-sortable-column-items.d.ts +0 -9
- package/dist/types/use-client-data-source.d.ts +0 -6
- package/dist/types/use-edge-scroll.d.ts +0 -7
- package/dist/types/use-grid.d.ts +0 -6
- package/dist/types/use-lytenyte.d.ts +0 -11
- package/dist/types/use-server-data-source.d.ts +0 -3
- package/dist/types/use-tree-data-source.d.ts +0 -3
- package/dist/types/watermark.d.ts +0 -3
- package/dist/types.js +0 -1
- package/dist/useAnchorPositioning-52zK7jlD.js +0 -241
- package/dist/useButton-DWXzFgcr.js +0 -184
- package/dist/useScrollLock-D4UY33Sb.js +0 -425
- /package/dist/{types/cell-selection → cell-selection}/cell-selection-driver.d.ts +0 -0
- /package/dist/{types/dialog → root}/dialog-driver.d.ts +0 -0
- /package/dist/{types/popover → root}/popover-driver.d.ts +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { avg } from "./avg.js";
|
|
2
|
+
import { count } from "./count.js";
|
|
3
|
+
import { first } from "./first.js";
|
|
4
|
+
import { group } from "./group.js";
|
|
5
|
+
import { last } from "./last.js";
|
|
6
|
+
import { max } from "./max.js";
|
|
7
|
+
import { min } from "./min.js";
|
|
8
|
+
import { sum } from "./sum.js";
|
|
9
|
+
/**
|
|
10
|
+
* Collection of built-in array utility functions for numerical and statistical operations.
|
|
11
|
+
* Each function handles null and undefined values gracefully.
|
|
12
|
+
* @example
|
|
13
|
+
* import { builtIns } from './builtIns';
|
|
14
|
+
*
|
|
15
|
+
* const data = [1, null, 3, 2];
|
|
16
|
+
* builtIns.sum(data); // Returns 6
|
|
17
|
+
* builtIns.avg(data); // Returns 2
|
|
18
|
+
*/
|
|
19
|
+
export const builtIns = {
|
|
20
|
+
/** Calculate sum of non-null numbers in array */
|
|
21
|
+
sum: sum,
|
|
22
|
+
/** Count non-null/undefined elements in array */
|
|
23
|
+
count: count,
|
|
24
|
+
/** Calculate average of non-null numbers in array */
|
|
25
|
+
avg: avg,
|
|
26
|
+
/** Get first non-null/undefined element in array */
|
|
27
|
+
first: first,
|
|
28
|
+
/** Get last non-null/undefined element in array */
|
|
29
|
+
last: last,
|
|
30
|
+
/** Find minimum value among non-null/undefined numbers in array */
|
|
31
|
+
min: min,
|
|
32
|
+
/** Find maximum value among non-null/undefined numbers in array */
|
|
33
|
+
max: max,
|
|
34
|
+
/** Return the aggregation group */
|
|
35
|
+
group: group,
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Set containing valid built-in function names.
|
|
39
|
+
* Used for validating function names and checking available operations.
|
|
40
|
+
* @example
|
|
41
|
+
* const isValidFunction = validBuiltIns.has('sum'); // Returns true
|
|
42
|
+
* const isInvalidFunction = validBuiltIns.has('median'); // Returns false
|
|
43
|
+
*/
|
|
44
|
+
export const validBuiltIns = new Set(Object.keys(builtIns));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Counts the number of non-null elements in an array.
|
|
3
|
+
* @param data - An array of any type
|
|
4
|
+
* @returns The count of elements that are neither null nor undefined
|
|
5
|
+
* @example
|
|
6
|
+
* count([1, null, 'a', undefined]) // Returns 2
|
|
7
|
+
* count([]) // Returns 0
|
|
8
|
+
* count([null, undefined]) // Returns 0
|
|
9
|
+
*/
|
|
10
|
+
export declare function count(d: unknown[]): number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Counts the number of non-null elements in an array.
|
|
3
|
+
* @param data - An array of any type
|
|
4
|
+
* @returns The count of elements that are neither null nor undefined
|
|
5
|
+
* @example
|
|
6
|
+
* count([1, null, 'a', undefined]) // Returns 2
|
|
7
|
+
* count([]) // Returns 0
|
|
8
|
+
* count([null, undefined]) // Returns 0
|
|
9
|
+
*/
|
|
10
|
+
export function count(d) {
|
|
11
|
+
let c = 0;
|
|
12
|
+
for (let i = d.length - 1; i >= 0; i--)
|
|
13
|
+
if (d[i] != null)
|
|
14
|
+
c++;
|
|
15
|
+
return c;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the first non-null element in an array.
|
|
3
|
+
* @param data - An array of any type
|
|
4
|
+
* @returns The first element that is neither null nor undefined, or undefined if no such element exists
|
|
5
|
+
* @example
|
|
6
|
+
* first([null, 1, 2]) // Returns 1
|
|
7
|
+
* first([]) // Returns undefined
|
|
8
|
+
* first([null, undefined]) // Returns undefined
|
|
9
|
+
*/
|
|
10
|
+
export declare function first(d: unknown[]): {} | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the first non-null element in an array.
|
|
3
|
+
* @param data - An array of any type
|
|
4
|
+
* @returns The first element that is neither null nor undefined, or undefined if no such element exists
|
|
5
|
+
* @example
|
|
6
|
+
* first([null, 1, 2]) // Returns 1
|
|
7
|
+
* first([]) // Returns undefined
|
|
8
|
+
* first([null, undefined]) // Returns undefined
|
|
9
|
+
*/
|
|
10
|
+
export function first(d) {
|
|
11
|
+
return d.find((c) => c != null);
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function group(data: unknown[]): unknown[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the last non-null element in an array.
|
|
3
|
+
* @param data - An array of any type
|
|
4
|
+
* @returns The last element that is neither null nor undefined, or undefined if no such element exists
|
|
5
|
+
* @example
|
|
6
|
+
* last([1, 2, null]) // Returns 2
|
|
7
|
+
* last([]) // Returns undefined
|
|
8
|
+
* last([null, undefined]) // Returns undefined
|
|
9
|
+
*/
|
|
10
|
+
export declare function last(d: unknown[]): {} | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the last non-null element in an array.
|
|
3
|
+
* @param data - An array of any type
|
|
4
|
+
* @returns The last element that is neither null nor undefined, or undefined if no such element exists
|
|
5
|
+
* @example
|
|
6
|
+
* last([1, 2, null]) // Returns 2
|
|
7
|
+
* last([]) // Returns undefined
|
|
8
|
+
* last([null, undefined]) // Returns undefined
|
|
9
|
+
*/
|
|
10
|
+
export function last(d) {
|
|
11
|
+
return d.findLast((c) => c != null);
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds the maximum value in an array of numbers that may include null or undefined values.
|
|
3
|
+
* Iterates through the array from right to left.
|
|
4
|
+
* @param data - An array of numbers that may include null or undefined values
|
|
5
|
+
* @returns The maximum number found in the array. Returns 0 for empty arrays or if no valid numbers are found.
|
|
6
|
+
* @example
|
|
7
|
+
* max([1, null, 3, undefined, 2]) // Returns 3
|
|
8
|
+
* max([]) // Returns 0
|
|
9
|
+
* max([null, undefined]) // Returns 0
|
|
10
|
+
*/
|
|
11
|
+
export declare function max(data: (number | null | undefined)[]): number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds the maximum value in an array of numbers that may include null or undefined values.
|
|
3
|
+
* Iterates through the array from right to left.
|
|
4
|
+
* @param data - An array of numbers that may include null or undefined values
|
|
5
|
+
* @returns The maximum number found in the array. Returns 0 for empty arrays or if no valid numbers are found.
|
|
6
|
+
* @example
|
|
7
|
+
* max([1, null, 3, undefined, 2]) // Returns 3
|
|
8
|
+
* max([]) // Returns 0
|
|
9
|
+
* max([null, undefined]) // Returns 0
|
|
10
|
+
*/
|
|
11
|
+
export function max(data) {
|
|
12
|
+
if (!data.length)
|
|
13
|
+
return 0;
|
|
14
|
+
let max = data[0];
|
|
15
|
+
for (let i = data.length - 1; i > 0; i--) {
|
|
16
|
+
const d = data[i];
|
|
17
|
+
if (d != null && max == null)
|
|
18
|
+
max = d;
|
|
19
|
+
else if (d == null)
|
|
20
|
+
continue;
|
|
21
|
+
else if (d > max)
|
|
22
|
+
max = data[i];
|
|
23
|
+
}
|
|
24
|
+
return max ?? 0;
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds the minimum value in an array of numbers that may include null or undefined values.
|
|
3
|
+
* Iterates through the array from right to left.
|
|
4
|
+
* @param data - An array of numbers that may include null or undefined values
|
|
5
|
+
* @returns The minimum number found in the array. Returns 0 for empty arrays or if no valid numbers are found.
|
|
6
|
+
* @example
|
|
7
|
+
* min([1, null, 3, undefined, 2]) // Returns 1
|
|
8
|
+
* min([]) // Returns 0
|
|
9
|
+
* min([null, undefined]) // Returns 0
|
|
10
|
+
*/
|
|
11
|
+
export declare function min(data: (number | null | undefined)[]): number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds the minimum value in an array of numbers that may include null or undefined values.
|
|
3
|
+
* Iterates through the array from right to left.
|
|
4
|
+
* @param data - An array of numbers that may include null or undefined values
|
|
5
|
+
* @returns The minimum number found in the array. Returns 0 for empty arrays or if no valid numbers are found.
|
|
6
|
+
* @example
|
|
7
|
+
* min([1, null, 3, undefined, 2]) // Returns 1
|
|
8
|
+
* min([]) // Returns 0
|
|
9
|
+
* min([null, undefined]) // Returns 0
|
|
10
|
+
*/
|
|
11
|
+
export function min(data) {
|
|
12
|
+
if (!data.length)
|
|
13
|
+
return 0;
|
|
14
|
+
let min = data[0];
|
|
15
|
+
for (let i = data.length - 1; i > 0; i--) {
|
|
16
|
+
const d = data[i];
|
|
17
|
+
if (d != null && min == null)
|
|
18
|
+
min = d;
|
|
19
|
+
else if (d == null)
|
|
20
|
+
continue;
|
|
21
|
+
else if (d < min)
|
|
22
|
+
min = data[i];
|
|
23
|
+
}
|
|
24
|
+
return min ?? 0;
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the sum of all non-null numbers in an array.
|
|
3
|
+
* @param data - An array of numbers that may include null values
|
|
4
|
+
* @returns The sum of all non-null numbers in the array. Returns 0 for empty arrays or arrays containing only null values.
|
|
5
|
+
* @example
|
|
6
|
+
* sum([1, 2, null, 3]) // Returns 6
|
|
7
|
+
* sum([]) // Returns 0
|
|
8
|
+
* sum([null, null]) // Returns 0
|
|
9
|
+
*/
|
|
10
|
+
export declare function sum(data: (number | null)[]): number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the sum of all non-null numbers in an array.
|
|
3
|
+
* @param data - An array of numbers that may include null values
|
|
4
|
+
* @returns The sum of all non-null numbers in the array. Returns 0 for empty arrays or arrays containing only null values.
|
|
5
|
+
* @example
|
|
6
|
+
* sum([1, 2, null, 3]) // Returns 6
|
|
7
|
+
* sum([]) // Returns 0
|
|
8
|
+
* sum([null, null]) // Returns 0
|
|
9
|
+
*/
|
|
10
|
+
export function sum(data) {
|
|
11
|
+
if (!data.length)
|
|
12
|
+
return 0;
|
|
13
|
+
let total = 0;
|
|
14
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
15
|
+
const d = data[i];
|
|
16
|
+
if (d == null)
|
|
17
|
+
continue;
|
|
18
|
+
total += d;
|
|
19
|
+
}
|
|
20
|
+
return total;
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FilterDateSetting, FilterNumberSettings, FilterStringSettings } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import type { FilterCombinationOperator, FilterDate, FilterFunc, FilterIn, FilterNumber, FilterString } from "../../+types";
|
|
3
|
+
export interface FilterDateWithSettings extends FilterDate {
|
|
4
|
+
readonly field: string;
|
|
5
|
+
readonly settings: FilterDateSetting;
|
|
6
|
+
}
|
|
7
|
+
export interface FilterStringWithSettings extends FilterString {
|
|
8
|
+
readonly field: string;
|
|
9
|
+
readonly settings: FilterStringSettings;
|
|
10
|
+
}
|
|
11
|
+
export interface FilterNumberWithSettings extends FilterNumber {
|
|
12
|
+
readonly field: string;
|
|
13
|
+
readonly settings: FilterNumberSettings;
|
|
14
|
+
}
|
|
15
|
+
export interface FilterInWithField extends FilterIn {
|
|
16
|
+
readonly field: string;
|
|
17
|
+
}
|
|
18
|
+
export interface FilterCombinationWithSettings {
|
|
19
|
+
readonly kind: "combination";
|
|
20
|
+
readonly operator: FilterCombinationOperator;
|
|
21
|
+
readonly filters: Array<FilterStringWithSettings | FilterNumberWithSettings | FilterDateWithSettings | FilterCombinationWithSettings>;
|
|
22
|
+
}
|
|
23
|
+
export type FilterWithSettings<T> = FilterDateWithSettings | FilterStringWithSettings | FilterNumberWithSettings | FilterCombinationWithSettings | FilterInWithField | FilterFunc<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { FilterIn, FilterModelItem, FilterQuickSearchSensitivity, Grid, RowLeaf } from "../../+types";
|
|
2
|
+
export declare function computeFilteredRows<T>(rows: RowLeaf<T>[], grid: Grid<T> | null, filterModel: Record<string, FilterModelItem<T>>, filterInModel: Record<string, FilterIn>, quickSearch: string | null, sensitivity: FilterQuickSearchSensitivity, isPivot: boolean): RowLeaf<T>[];
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { evaluateDateFilter, evaluateNumberFilter, evaluateStringFilter, getDateFilterSettings, getNumberFilterSettings, getStringFilterSettings, } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import { itemsWithIdToMap } from "@1771technologies/lytenyte-js-utils";
|
|
3
|
+
export function computeFilteredRows(rows, grid, filterModel, filterInModel, quickSearch, sensitivity, isPivot) {
|
|
4
|
+
if (!grid)
|
|
5
|
+
return rows;
|
|
6
|
+
const columns = isPivot ? grid.state.columnPivotColumns.get() : grid.state.columns.get();
|
|
7
|
+
const lookup = itemsWithIdToMap(columns);
|
|
8
|
+
const filterEntries = [...Object.entries(filterModel), ...Object.entries(filterInModel)].filter(([key]) => {
|
|
9
|
+
return lookup.has(key);
|
|
10
|
+
});
|
|
11
|
+
if (!(filterEntries.length || quickSearch) || !grid)
|
|
12
|
+
return rows;
|
|
13
|
+
const filters = filterEntries.map(([key, f]) => createFilter(key, f));
|
|
14
|
+
const filtered = [];
|
|
15
|
+
const base = grid.state.columnBase.get();
|
|
16
|
+
const nonIgnored = columns.filter((c) => !(c.quickSearchIgnore ?? base.quickSearchIgnore));
|
|
17
|
+
for (let r = 0; r < rows.length; r++) {
|
|
18
|
+
const row = rows[r];
|
|
19
|
+
if (!filters.every((filter) => evaluateFilter(row.data, grid, filter)))
|
|
20
|
+
continue;
|
|
21
|
+
if (quickSearch) {
|
|
22
|
+
const pass = nonIgnored.some((c) => {
|
|
23
|
+
const field = `${grid.api.columnField(c, { data: row.data, kind: "leaf" })}`;
|
|
24
|
+
if (sensitivity === "case-insensitive")
|
|
25
|
+
field.toLowerCase().includes(quickSearch.toLowerCase());
|
|
26
|
+
return field.includes(quickSearch);
|
|
27
|
+
});
|
|
28
|
+
if (!pass)
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
filtered.push(row);
|
|
32
|
+
}
|
|
33
|
+
return filtered;
|
|
34
|
+
}
|
|
35
|
+
function createFilter(id, filter) {
|
|
36
|
+
if (filter.kind === "date") {
|
|
37
|
+
const settings = getDateFilterSettings(filter);
|
|
38
|
+
return {
|
|
39
|
+
...filter,
|
|
40
|
+
field: id,
|
|
41
|
+
kind: "date",
|
|
42
|
+
settings,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
else if (filter.kind === "number") {
|
|
46
|
+
const settings = getNumberFilterSettings(filter);
|
|
47
|
+
return {
|
|
48
|
+
...filter,
|
|
49
|
+
field: id,
|
|
50
|
+
kind: "number",
|
|
51
|
+
settings,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
else if (filter.kind === "string") {
|
|
55
|
+
const settings = getStringFilterSettings(filter);
|
|
56
|
+
return {
|
|
57
|
+
...filter,
|
|
58
|
+
field: id,
|
|
59
|
+
kind: "string",
|
|
60
|
+
settings,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
else if (filter.kind === "in") {
|
|
64
|
+
return {
|
|
65
|
+
...filter,
|
|
66
|
+
field: id,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
else if (filter.kind === "combination") {
|
|
70
|
+
return {
|
|
71
|
+
...filter,
|
|
72
|
+
kind: "combination",
|
|
73
|
+
filters: filter.filters.map((f) => createFilter(id, f)),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
else if (filter.kind === "func") {
|
|
77
|
+
return filter;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw new Error(`Invalid filter provided: ${JSON.stringify(filter)}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function evaluateFilter(row, grid, filter) {
|
|
84
|
+
if (filter.kind === "date") {
|
|
85
|
+
const fieldValue = grid.api.columnField(filter.field, { data: row, kind: "leaf" });
|
|
86
|
+
return evaluateDateFilter(filter, fieldValue, filter.settings);
|
|
87
|
+
}
|
|
88
|
+
else if (filter.kind === "string") {
|
|
89
|
+
const fieldValue = grid.api.columnField(filter.field, { data: row, kind: "leaf" });
|
|
90
|
+
return evaluateStringFilter(filter, fieldValue, filter.settings);
|
|
91
|
+
}
|
|
92
|
+
else if (filter.kind === "number") {
|
|
93
|
+
const fieldValue = grid.api.columnField(filter.field, { data: row, kind: "leaf" });
|
|
94
|
+
return evaluateNumberFilter(filter, fieldValue, filter.settings);
|
|
95
|
+
}
|
|
96
|
+
else if (filter.kind === "func") {
|
|
97
|
+
return filter.func({ data: row, grid });
|
|
98
|
+
}
|
|
99
|
+
else if (filter.kind === "in") {
|
|
100
|
+
const fieldValue = grid.api.columnField(filter.field, { data: row, kind: "leaf" });
|
|
101
|
+
return filter.operator === "in" ? filter.value.has(fieldValue) : !filter.value.has(fieldValue);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
if (filter.operator === "AND")
|
|
105
|
+
return filter.filters.every((f) => evaluateFilter(row, grid, f));
|
|
106
|
+
else
|
|
107
|
+
return filter.filters.some((f) => evaluateFilter(row, grid, f));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {} from "../../+types";
|
|
2
|
+
export function createAggModel(model, columns, separator) {
|
|
3
|
+
const aggFunToId = new Map(model.values.map((c) => [c.field, c.aggFn]));
|
|
4
|
+
const aggModel = columns
|
|
5
|
+
.map((c) => {
|
|
6
|
+
const aggId = c.id.split(separator).at(-1);
|
|
7
|
+
if (!aggFunToId.has(aggId))
|
|
8
|
+
return null;
|
|
9
|
+
return [c.id, { fn: aggFunToId.get(aggId) }];
|
|
10
|
+
})
|
|
11
|
+
.filter((c) => !!c);
|
|
12
|
+
return Object.fromEntries(aggModel);
|
|
13
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { upperCaseFirstLetter } from "@1771technologies/lytenyte-js-utils";
|
|
2
|
+
export function createColumnPivotsFromPaths(grid, columns, lookup, paths) {
|
|
3
|
+
const separator = grid.state.columnGroupJoinDelimiter.get();
|
|
4
|
+
const cols = paths.map((path) => {
|
|
5
|
+
const parts = path.split(separator);
|
|
6
|
+
const measureId = parts.at(-1);
|
|
7
|
+
const measureCol = lookup.get(measureId);
|
|
8
|
+
// Pop the last part as this is the aggregation value
|
|
9
|
+
parts.pop();
|
|
10
|
+
const pivots = parts.map((_, index) => {
|
|
11
|
+
const id = columns[index].field;
|
|
12
|
+
return lookup.get(id);
|
|
13
|
+
});
|
|
14
|
+
const entries = [...pivots.entries()];
|
|
15
|
+
const isTotals = parts.length < columns.length;
|
|
16
|
+
const label = isTotals ? "Total" : parts.at(-1);
|
|
17
|
+
const groupPath = isTotals ? [] : parts.map(upperCaseFirstLetter);
|
|
18
|
+
const { pin: _, ...measureProps } = measureCol ?? {};
|
|
19
|
+
const newDefinitions = {
|
|
20
|
+
...measureProps,
|
|
21
|
+
id: path,
|
|
22
|
+
name: label,
|
|
23
|
+
groupPath,
|
|
24
|
+
groupVisibility: "always",
|
|
25
|
+
field: ({ grid, data }) => {
|
|
26
|
+
if (!measureCol)
|
|
27
|
+
return null;
|
|
28
|
+
if (data.kind === "branch") {
|
|
29
|
+
return data.data[path];
|
|
30
|
+
}
|
|
31
|
+
if (!path.startsWith("total")) {
|
|
32
|
+
for (const [index, pivot] of entries) {
|
|
33
|
+
const key = parts[index];
|
|
34
|
+
if (key == null)
|
|
35
|
+
break;
|
|
36
|
+
const actual = grid.api.columnField(pivot, data);
|
|
37
|
+
if (key !== actual)
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return grid.api.columnField(measureCol, data);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return grid.api.columnField(measureCol, data);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
return newDefinitions;
|
|
48
|
+
});
|
|
49
|
+
return cols;
|
|
50
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createColumnPivotsFromPaths } from "./create-pivot-columns-from-paths";
|
|
2
|
+
import { createPivotTree } from "./create-pivot-tree";
|
|
3
|
+
export function createPivotColumns(model, lookup, grid, leafRows) {
|
|
4
|
+
const activeColumns = model.columns.filter((c) => lookup.has(c.field) && (c.active ?? true));
|
|
5
|
+
const activeValues = model.values.filter((c) => lookup.has(c.field) && (c.active ?? true));
|
|
6
|
+
if (activeColumns.length === 0 && activeValues.length === 0)
|
|
7
|
+
return [];
|
|
8
|
+
// This means we only have a values column defined. Hence we should just return this.
|
|
9
|
+
if (activeColumns.length === 0) {
|
|
10
|
+
const columns = activeValues.map((c) => {
|
|
11
|
+
const col = lookup.get(c.field);
|
|
12
|
+
return {
|
|
13
|
+
...col,
|
|
14
|
+
field: c.field,
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
return columns;
|
|
18
|
+
}
|
|
19
|
+
const tree = createPivotTree(grid, activeValues, activeColumns, lookup, leafRows);
|
|
20
|
+
const columns = createColumnPivotsFromPaths(grid, activeColumns, lookup, tree);
|
|
21
|
+
return columns;
|
|
22
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { Column, ColumnPivotModel, Grid, RowLeaf } from "../../+types";
|
|
2
|
+
export declare function createPivotTree<T>(grid: Grid<T>, values: ColumnPivotModel<T>["values"], columns: ColumnPivotModel<T>["columns"], lookup: Map<string, Column<T>>, leafRows: RowLeaf<T>[]): string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function createPivotTree(grid, values, columns, lookup, leafRows) {
|
|
2
|
+
const sx = grid;
|
|
3
|
+
const measureEntries = values.length ? values.map((c) => c.field) : ["__EMPTY_LNG__"];
|
|
4
|
+
if (!measureEntries.length || !columns.length) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const pivotedColumns = columns.map((p) => lookup.get(p.field));
|
|
8
|
+
const separator = sx.state.columnGroupJoinDelimiter.get();
|
|
9
|
+
const paths = new Set();
|
|
10
|
+
for (let i = 0; i < leafRows.length; i++) {
|
|
11
|
+
const current = [];
|
|
12
|
+
const row = leafRows[i];
|
|
13
|
+
for (const column of pivotedColumns) {
|
|
14
|
+
const pivotKey = String(grid.api.columnField(column, row));
|
|
15
|
+
current.push(pivotKey);
|
|
16
|
+
}
|
|
17
|
+
for (const measure of measureEntries) {
|
|
18
|
+
paths.add([...current, measure].join(separator));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
measureEntries.forEach((id) => paths.add(`total${separator}${id}`));
|
|
22
|
+
return [...paths];
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AggregationItem, GroupItem, Root, TreeNode } from "../+types.js";
|
|
2
|
+
export interface ClientData<Data> {
|
|
3
|
+
readonly root: Root<Data>;
|
|
4
|
+
readonly rowData: Data[];
|
|
5
|
+
readonly idsLeaf: Set<string>;
|
|
6
|
+
readonly idsBranch: Set<string>;
|
|
7
|
+
readonly idsAll: Set<string>;
|
|
8
|
+
readonly idToNode: Map<string, TreeNode<Data>>;
|
|
9
|
+
readonly idToSourceIndex: Map<string, number>;
|
|
10
|
+
}
|
|
11
|
+
export interface MakeClientDataArgs<Data> {
|
|
12
|
+
readonly rowData: Data[];
|
|
13
|
+
readonly rowBranchModel: GroupItem<Data>[] | ((d: Data) => (string | null | undefined)[]);
|
|
14
|
+
readonly rowAggModel: AggregationItem<Data>[];
|
|
15
|
+
readonly rowIdLeaf?: (d: Data, i: number) => string;
|
|
16
|
+
readonly rowIdGroup?: (path: string[]) => string;
|
|
17
|
+
}
|
|
18
|
+
export declare function makeClientTree<Data>({ rowData, rowBranchModel, rowAggModel, rowIdLeaf, rowIdGroup, }: MakeClientDataArgs<Data>): ClientData<Data>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { BRANCH, LEAF } from "../+constants.js";
|
|
2
|
+
import { traverse } from "./traverse.js";
|
|
3
|
+
import { aggregationEvaluator } from "./evaluator-aggregation.js";
|
|
4
|
+
import { groupEvaluator } from "./evaluator-group.js";
|
|
5
|
+
export function makeClientTree({ rowData, rowBranchModel, rowAggModel, rowIdLeaf, rowIdGroup, }) {
|
|
6
|
+
const root = new Map();
|
|
7
|
+
const idsLeaf = new Set();
|
|
8
|
+
const idsBranch = new Set();
|
|
9
|
+
const idsAll = new Set();
|
|
10
|
+
const idToNode = new Map();
|
|
11
|
+
const idToSourceIndex = new Map();
|
|
12
|
+
for (let i = 0; i < rowData.length; i++) {
|
|
13
|
+
const d = rowData[i];
|
|
14
|
+
const id = rowIdLeaf?.(d, i) ?? `${i}`;
|
|
15
|
+
const path = groupEvaluator(rowBranchModel, d);
|
|
16
|
+
idsLeaf.add(id);
|
|
17
|
+
idsAll.add(id);
|
|
18
|
+
let current = root;
|
|
19
|
+
const runningPath = [];
|
|
20
|
+
for (let i = 0; i < path.length; i++) {
|
|
21
|
+
const pathKey = path[i] ?? `<__null__>`;
|
|
22
|
+
runningPath.push(pathKey);
|
|
23
|
+
const lookup = i === 0 ? root : current.children;
|
|
24
|
+
// We need to create a branch node.
|
|
25
|
+
if (!lookup.has(pathKey)) {
|
|
26
|
+
const id = rowIdGroup?.(runningPath) ?? "+.+" + runningPath.join("/");
|
|
27
|
+
idsBranch.add(id);
|
|
28
|
+
idsAll.add(id);
|
|
29
|
+
const branch = {
|
|
30
|
+
id,
|
|
31
|
+
kind: BRANCH,
|
|
32
|
+
depth: i,
|
|
33
|
+
children: new Map(),
|
|
34
|
+
data: {},
|
|
35
|
+
parent: current === root ? null : current,
|
|
36
|
+
key: pathKey,
|
|
37
|
+
leafIds: new Set(),
|
|
38
|
+
leafData: [],
|
|
39
|
+
};
|
|
40
|
+
lookup.set(pathKey, branch);
|
|
41
|
+
idToNode.set(id, branch);
|
|
42
|
+
}
|
|
43
|
+
const branch = lookup.get(pathKey);
|
|
44
|
+
branch.leafData.push(d);
|
|
45
|
+
branch.leafIds.add(id);
|
|
46
|
+
current = branch;
|
|
47
|
+
}
|
|
48
|
+
const leaf = {
|
|
49
|
+
kind: LEAF,
|
|
50
|
+
id,
|
|
51
|
+
depth: path.length,
|
|
52
|
+
data: d,
|
|
53
|
+
parent: current === root ? null : current,
|
|
54
|
+
};
|
|
55
|
+
idToNode.set(id, leaf);
|
|
56
|
+
idToSourceIndex.set(id, i);
|
|
57
|
+
if (rowBranchModel.length === 0)
|
|
58
|
+
current.set(id, leaf);
|
|
59
|
+
else
|
|
60
|
+
current.children.set(id, leaf);
|
|
61
|
+
}
|
|
62
|
+
traverse(root, (node) => {
|
|
63
|
+
if (node.kind === LEAF)
|
|
64
|
+
return;
|
|
65
|
+
node.data = aggregationEvaluator(rowAggModel, node.leafData);
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
root,
|
|
69
|
+
rowData,
|
|
70
|
+
idsLeaf: idsLeaf,
|
|
71
|
+
idsBranch: idsBranch,
|
|
72
|
+
idsAll: idsAll,
|
|
73
|
+
idToNode,
|
|
74
|
+
idToSourceIndex,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { BranchNode, Root, TreeNode } from "../+types";
|
|
2
|
+
export declare function traverse<Data>(root: Root<Data> | BranchNode<Data>, fn: (node: TreeNode<Data>, lookupKey: string | null) => boolean | void, comparator?: (l: TreeNode<Data>, r: TreeNode<Data>) => number): void;
|