@1771technologies/lytenyte-pro 2.0.0-dev.0 → 2.0.0-dev.2
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/__play__/alpha.play.d.ts +3 -0
- package/dist/__play__/alpha.play.js +56 -0
- package/dist/__play__/basic-server-data/data.d.ts +10 -0
- package/dist/__play__/basic-server-data/data.js +17746 -0
- package/dist/__play__/basic-server-data/server.d.ts +36 -0
- package/dist/__play__/basic-server-data/server.js +105 -0
- package/dist/__play__/buttons.play.d.ts +4 -0
- package/dist/__play__/buttons.play.js +7 -0
- package/dist/__play__/inputs.play.d.ts +3 -0
- package/dist/__play__/inputs.play.js +13 -0
- package/dist/__play__/server.play.d.ts +3 -0
- package/dist/__play__/server.play.js +66 -0
- package/dist/__play__/tree.play.d.ts +3 -0
- package/dist/__play__/tree.play.js +47 -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 +3 -0
- package/dist/cell-selection/bound-selection-rect.js +16 -0
- package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
- package/dist/cell-selection/cell-selection-containers.js +86 -0
- package/dist/cell-selection/cell-selection-driver/cell-selection-driver.d.ts +1 -0
- package/dist/cell-selection/cell-selection-driver/cell-selection-driver.js +279 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.d.ts +6 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.js +34 -0
- package/dist/cell-selection/cell-style-row.d.ts +8 -0
- package/dist/cell-selection/cell-style-row.js +79 -0
- package/dist/cell-selection/data-rect-from-cell-position.d.ts +3 -0
- package/dist/cell-selection/data-rect-from-cell-position.js +17 -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-selection-down.d.ts +3 -0
- package/dist/cell-selection/expand-selection-down.js +78 -0
- package/dist/cell-selection/expand-selection-end.d.ts +3 -0
- package/dist/cell-selection/expand-selection-end.js +76 -0
- package/dist/cell-selection/expand-selection-start.d.ts +3 -0
- package/dist/cell-selection/expand-selection-start.js +73 -0
- package/dist/cell-selection/expand-selection-up.d.ts +3 -0
- package/dist/cell-selection/expand-selection-up.js +74 -0
- package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
- package/dist/cell-selection/full-width-start-end-index.js +4 -0
- package/dist/cell-selection/get-root-cell.d.ts +3 -0
- package/dist/cell-selection/get-root-cell.js +6 -0
- package/dist/cell-selection/index.d.ts +13 -0
- package/dist/cell-selection/index.js +13 -0
- package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
- package/dist/cell-selection/is-bottom-rect.js +4 -0
- package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
- package/dist/cell-selection/is-center-col-rect.js +3 -0
- package/dist/cell-selection/is-center-rect.d.ts +2 -0
- package/dist/cell-selection/is-center-rect.js +4 -0
- package/dist/cell-selection/is-end-rect.d.ts +5 -0
- package/dist/cell-selection/is-end-rect.js +3 -0
- package/dist/cell-selection/is-fully-within-rect.d.ts +2 -0
- package/dist/cell-selection/is-fully-within-rect.js +6 -0
- package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
- package/dist/cell-selection/is-overlapping-rect.js +5 -0
- package/dist/cell-selection/is-start-rect.d.ts +5 -0
- package/dist/cell-selection/is-start-rect.js +3 -0
- package/dist/cell-selection/is-top-rect.d.ts +2 -0
- package/dist/cell-selection/is-top-rect.js +3 -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 +47 -0
- package/dist/cell-selection/split-cell-selection-rect.js +88 -0
- package/dist/cell-selection/split-on-pivot.d.ts +3 -0
- package/dist/cell-selection/split-on-pivot.js +50 -0
- package/dist/cell-selection/update-additive-cell-selection.d.ts +4 -0
- package/dist/cell-selection/update-additive-cell-selection.js +21 -0
- package/dist/cell-selection/use-edge-scroll.d.ts +6 -0
- package/dist/cell-selection/use-edge-scroll.js +71 -0
- package/dist/components/checkbox/checkbox.d.ts +15 -0
- package/dist/components/checkbox/checkbox.js +42 -0
- package/dist/components/checkbox/checkbox.play.d.ts +2 -0
- package/dist/components/checkbox/checkbox.play.js +6 -0
- package/dist/components/column-manager/column-manager.d.ts +13 -0
- package/dist/components/column-manager/column-manager.js +47 -0
- package/dist/components/external/clsx.d.ts +2 -0
- package/dist/components/external/clsx.js +44 -0
- package/dist/components/external/floating-ui.d.ts +268 -0
- package/dist/components/external/floating-ui.js +1802 -0
- package/dist/components/headless/dialog/arrow.d.ts +6 -0
- package/dist/components/headless/dialog/arrow.js +16 -0
- package/dist/components/headless/dialog/close.d.ts +10 -0
- package/dist/components/headless/dialog/close.js +22 -0
- package/dist/components/headless/dialog/container.d.ts +5 -0
- package/dist/components/headless/dialog/container.js +221 -0
- package/dist/components/headless/dialog/context.d.ts +32 -0
- package/dist/components/headless/dialog/context.js +3 -0
- package/dist/components/headless/dialog/description.d.ts +9 -0
- package/dist/components/headless/dialog/description.js +20 -0
- package/dist/components/headless/dialog/index.parts.d.ts +30 -0
- package/dist/components/headless/dialog/index.parts.js +17 -0
- package/dist/components/headless/dialog/root.d.ts +32 -0
- package/dist/components/headless/dialog/root.js +75 -0
- package/dist/components/headless/dialog/title.d.ts +9 -0
- package/dist/components/headless/dialog/title.js +20 -0
- package/dist/components/headless/dialog/transform-origin.d.ts +5 -0
- package/dist/components/headless/dialog/transform-origin.js +38 -0
- package/dist/components/headless/dialog/trigger.d.ts +10 -0
- package/dist/components/headless/dialog/trigger.js +24 -0
- package/dist/components/headless/dialog/use-dialog.d.ts +4 -0
- package/dist/components/headless/dialog/use-dialog.js +12 -0
- package/dist/components/headless/menu/checkbox-item.d.ts +11 -0
- package/dist/components/headless/menu/checkbox-item.js +42 -0
- package/dist/components/headless/menu/combo/combo-checkbox.d.ts +11 -0
- package/dist/components/headless/menu/combo/combo-checkbox.js +38 -0
- package/dist/components/headless/menu/combo/combo-context.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-context.js +3 -0
- package/dist/components/headless/menu/combo/combo-input.d.ts +7 -0
- package/dist/components/headless/menu/combo/combo-input.js +58 -0
- package/dist/components/headless/menu/combo/combo-menu.d.ts +5 -0
- package/dist/components/headless/menu/combo/combo-menu.js +24 -0
- package/dist/components/headless/menu/combo/combo-option.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-option.js +37 -0
- package/dist/components/headless/menu/container.d.ts +5 -0
- package/dist/components/headless/menu/container.js +19 -0
- package/dist/components/headless/menu/dom.d.ts +4 -0
- package/dist/components/headless/menu/dom.js +20 -0
- package/dist/components/headless/menu/index.d.ts +54 -0
- package/dist/components/headless/menu/index.js +39 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.d.ts +2 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.js +28 -0
- package/dist/components/headless/menu/item/item.d.ts +9 -0
- package/dist/components/headless/menu/item/item.js +45 -0
- package/dist/components/headless/menu/item/use-menu-item-events.d.ts +1 -0
- package/dist/components/headless/menu/item/use-menu-item-events.js +25 -0
- package/dist/components/headless/menu/menu-divider.d.ts +5 -0
- package/dist/components/headless/menu/menu-divider.js +6 -0
- package/dist/components/headless/menu/menu-group.d.ts +5 -0
- package/dist/components/headless/menu/menu-group.js +6 -0
- package/dist/components/headless/menu/menu-header.d.ts +5 -0
- package/dist/components/headless/menu/menu-header.js +6 -0
- package/dist/components/headless/menu/popover.d.ts +5 -0
- package/dist/components/headless/menu/popover.js +7 -0
- package/dist/components/headless/menu/radio-group/context.d.ts +11 -0
- package/dist/components/headless/menu/radio-group/context.js +7 -0
- package/dist/components/headless/menu/radio-group/radio-item.d.ts +10 -0
- package/dist/components/headless/menu/radio-group/radio-item.js +44 -0
- package/dist/components/headless/menu/submenu/submenu-context.d.ts +9 -0
- package/dist/components/headless/menu/submenu/submenu-context.js +3 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.d.ts +7 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.js +70 -0
- package/dist/components/headless/menu/submenu/submenu.d.ts +21 -0
- package/dist/components/headless/menu/submenu/submenu.js +55 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.d.ts +5 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.js +31 -0
- package/dist/components/headless/menu/use-menu.d.ts +1 -0
- package/dist/components/headless/menu/use-menu.js +52 -0
- package/dist/components/headless/popover/container.d.ts +5 -0
- package/dist/components/headless/popover/container.js +7 -0
- package/dist/components/headless/popover/context.d.ts +6 -0
- package/dist/components/headless/popover/context.js +3 -0
- package/dist/components/headless/popover/index.d.ts +30 -0
- package/dist/components/headless/popover/index.js +17 -0
- package/dist/components/headless/popover/root.d.ts +6 -0
- package/dist/components/headless/popover/root.js +8 -0
- package/dist/components/headless/popover/trigger.d.ts +7 -0
- package/dist/components/headless/popover/trigger.js +11 -0
- package/dist/components/pill-manager/container.d.ts +5 -0
- package/dist/components/pill-manager/container.js +127 -0
- package/dist/components/pill-manager/expander.d.ts +9 -0
- package/dist/components/pill-manager/expander.js +21 -0
- package/dist/components/pill-manager/icons.d.ts +12 -0
- package/dist/components/pill-manager/icons.js +35 -0
- package/dist/components/pill-manager/index.d.ts +33 -0
- package/dist/components/pill-manager/index.js +13 -0
- package/dist/components/pill-manager/item.d.ts +10 -0
- package/dist/components/pill-manager/item.js +178 -0
- package/dist/components/pill-manager/label.d.ts +10 -0
- package/dist/components/pill-manager/label.js +31 -0
- package/dist/components/pill-manager/pill-manager.play.d.ts +3 -0
- package/dist/components/pill-manager/pill-manager.play.js +73 -0
- package/dist/components/pill-manager/pill-row.context.d.ts +8 -0
- package/dist/components/pill-manager/pill-row.context.js +4 -0
- package/dist/components/pill-manager/pill-row.d.ts +12 -0
- package/dist/components/pill-manager/pill-row.js +22 -0
- package/dist/components/pill-manager/root.context.d.ts +40 -0
- package/dist/components/pill-manager/root.context.js +4 -0
- package/dist/components/pill-manager/root.d.ts +25 -0
- package/dist/components/pill-manager/root.js +33 -0
- package/dist/components/pill-manager/row-default.d.ts +3 -0
- package/dist/components/pill-manager/row-default.js +14 -0
- package/dist/components/pill-manager/types.d.ts +21 -0
- package/dist/components/pill-manager/types.js +1 -0
- package/dist/components/row-group-cell.d.ts +13 -0
- package/dist/components/row-group-cell.js +40 -0
- package/dist/components/select-all.d.ts +12 -0
- package/dist/components/select-all.js +34 -0
- package/dist/components/smart-select/chip-context.d.ts +8 -0
- package/dist/components/smart-select/chip-context.js +4 -0
- package/dist/components/smart-select/chip-remove.d.ts +1 -0
- package/dist/components/smart-select/chip-remove.js +13 -0
- package/dist/components/smart-select/chip.d.ts +13 -0
- package/dist/components/smart-select/chip.js +79 -0
- package/dist/components/smart-select/container.d.ts +1 -0
- package/dist/components/smart-select/container.js +13 -0
- package/dist/components/smart-select/context.d.ts +31 -0
- package/dist/components/smart-select/context.js +4 -0
- package/dist/components/smart-select/index.d.ts +30 -0
- package/dist/components/smart-select/index.js +19 -0
- package/dist/components/smart-select/option.d.ts +8 -0
- package/dist/components/smart-select/option.js +36 -0
- package/dist/components/smart-select/root.d.ts +17 -0
- package/dist/components/smart-select/root.js +165 -0
- package/dist/components/smart-select/smart-select.play.d.ts +2 -0
- package/dist/components/smart-select/smart-select.play.js +36 -0
- package/dist/components/smart-select/triggers/basic-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/basic-trigger.js +18 -0
- package/dist/components/smart-select/triggers/combo-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/combo-trigger.js +17 -0
- package/dist/components/smart-select/triggers/is-selectable-option.d.ts +1 -0
- package/dist/components/smart-select/triggers/is-selectable-option.js +3 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.d.ts +11 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.js +38 -0
- package/dist/components/smart-select/triggers/multi-trigger.d.ts +6 -0
- package/dist/components/smart-select/triggers/multi-trigger.js +8 -0
- package/dist/components/smart-select/triggers/use-combo-controls.d.ts +9 -0
- package/dist/components/smart-select/triggers/use-combo-controls.js +145 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.d.ts +5 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.js +126 -0
- package/dist/components/smart-select/type.d.ts +44 -0
- package/dist/components/smart-select/type.js +1 -0
- package/dist/components/smart-select/use-async-options.d.ts +8 -0
- package/dist/components/smart-select/use-async-options.js +42 -0
- package/dist/components/tree-view/index.d.ts +4 -0
- package/dist/components/tree-view/index.js +2 -0
- package/dist/components/tree-view/root.d.ts +37 -0
- package/dist/components/tree-view/root.js +139 -0
- package/dist/components/tree-view/select-all.d.ts +7 -0
- package/dist/components/tree-view/select-all.js +22 -0
- package/dist/components/tree-view/tree-children.d.ts +2 -0
- package/dist/components/tree-view/tree-children.js +15 -0
- package/dist/components/tree-view/types.d.ts +31 -0
- package/dist/components/tree-view/types.js +1 -0
- package/dist/components/types.d.ts +4 -0
- package/dist/components/types.js +1 -0
- package/dist/components/virtual-from-coordinates.d.ts +2 -0
- package/dist/components/virtual-from-coordinates.js +15 -0
- package/dist/components.d.ts +16 -0
- package/dist/components.js +11 -0
- package/dist/data-source-client/hooks/get-valid-leafs.d.ts +3 -0
- package/dist/data-source-client/hooks/get-valid-leafs.js +11 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.d.ts +13 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.js +39 -0
- package/dist/data-source-client/hooks/use-flattened-data.d.ts +18 -0
- package/dist/data-source-client/hooks/use-flattened-data.js +40 -0
- package/dist/data-source-client/hooks/use-flattened-groups.d.ts +5 -0
- package/dist/data-source-client/hooks/use-flattened-groups.js +63 -0
- package/dist/data-source-client/hooks/use-flattened-piece.d.ts +14 -0
- package/dist/data-source-client/hooks/use-flattened-piece.js +55 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.js +11 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.js +14 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.js +17 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.d.ts +31 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.js +152 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.js +22 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.js +9 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.d.ts +18 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.js +140 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.js +31 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.js +45 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.js +18 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.d.ts +14 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.js +151 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.d.ts +32 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.js +83 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.js +23 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.d.ts +16 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.js +40 -0
- package/dist/data-source-client/use-client-data-source.d.ts +91 -0
- package/dist/data-source-client/use-client-data-source.js +169 -0
- package/dist/data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
- package/dist/data-source-server/async-tree/+constants.async-tree.js +1 -0
- package/dist/data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.js +26 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.js +20 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.js +18 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.js +24 -0
- package/dist/data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
- package/dist/data-source-server/async-tree/get-parent-node-by-path.js +18 -0
- package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
- package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
- package/dist/data-source-server/async-tree/make-async-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/make-async-tree.js +64 -0
- package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
- package/dist/data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-resize.js +17 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.js +54 -0
- package/dist/data-source-server/async-tree/types.d.ts +70 -0
- package/dist/data-source-server/async-tree/types.js +1 -0
- package/dist/data-source-server/range-tree/range-tree.d.ts +66 -0
- package/dist/data-source-server/range-tree/range-tree.js +102 -0
- package/dist/data-source-server/server-data.d.ts +73 -0
- package/dist/data-source-server/server-data.js +553 -0
- package/dist/data-source-server/source/use-on-rows-updated.d.ts +4 -0
- package/dist/data-source-server/source/use-on-rows-updated.js +29 -0
- package/dist/data-source-server/source/use-on-view-change.d.ts +3 -0
- package/dist/data-source-server/source/use-on-view-change.js +13 -0
- package/dist/data-source-server/source/use-row-add.d.ts +3 -0
- package/dist/data-source-server/source/use-row-add.js +36 -0
- package/dist/data-source-server/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-by-id.js +8 -0
- package/dist/data-source-server/source/use-row-by-index.d.ts +9 -0
- package/dist/data-source-server/source/use-row-by-index.js +89 -0
- package/dist/data-source-server/source/use-row-children.d.ts +2 -0
- package/dist/data-source-server/source/use-row-children.js +16 -0
- package/dist/data-source-server/source/use-row-delete.d.ts +3 -0
- package/dist/data-source-server/source/use-row-delete.js +39 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.d.ts +2 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.js +7 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.js +7 -0
- package/dist/data-source-server/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-server/source/use-row-leafs.js +20 -0
- package/dist/data-source-server/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-server/source/use-row-parents.js +16 -0
- package/dist/data-source-server/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-server/source/use-row-siblings.js +15 -0
- package/dist/data-source-server/source/use-rows-between.d.ts +2 -0
- package/dist/data-source-server/source/use-rows-between.js +20 -0
- package/dist/data-source-server/source/use-source-state.d.ts +28 -0
- package/dist/data-source-server/source/use-source-state.js +47 -0
- package/dist/data-source-server/source/use-source.d.ts +5 -0
- package/dist/data-source-server/source/use-source.js +66 -0
- package/dist/data-source-server/types.d.ts +42 -0
- package/dist/data-source-server/types.js +1 -0
- package/dist/data-source-server/use-server-data-source.d.ts +51 -0
- package/dist/data-source-server/use-server-data-source.js +192 -0
- package/dist/data-source-server/utils/get-node-depth.d.ts +2 -0
- package/dist/data-source-server/utils/get-node-depth.js +9 -0
- package/dist/data-source-server/utils/get-node-path.d.ts +2 -0
- package/dist/data-source-server/utils/get-node-path.js +9 -0
- package/dist/data-source-server/utils/get-request-id.d.ts +1 -0
- package/dist/data-source-server/utils/get-request-id.js +6 -0
- package/dist/data-source-tree/source/use-controlled-state.d.ts +8 -0
- package/dist/data-source-tree/source/use-controlled-state.js +21 -0
- package/dist/data-source-tree/source/use-flattened.d.ts +17 -0
- package/dist/data-source-tree/source/use-flattened.js +65 -0
- package/dist/data-source-tree/source/use-on-rows-updated.d.ts +3 -0
- package/dist/data-source-tree/source/use-on-rows-updated.js +49 -0
- package/dist/data-source-tree/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-by-id.js +7 -0
- package/dist/data-source-tree/source/use-row-children.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-children.js +11 -0
- package/dist/data-source-tree/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-leafs.js +20 -0
- package/dist/data-source-tree/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-parents.js +16 -0
- package/dist/data-source-tree/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-siblings.js +12 -0
- package/dist/data-source-tree/source/use-tree.d.ts +3 -0
- package/dist/data-source-tree/source/use-tree.js +59 -0
- package/dist/data-source-tree/types.d.ts +16 -0
- package/dist/data-source-tree/types.js +1 -0
- package/dist/data-source-tree/use-tree-data-source.d.ts +41 -0
- package/dist/data-source-tree/use-tree-data-source.js +101 -0
- package/dist/data-source-tree/utils/is-object.d.ts +1 -0
- package/dist/data-source-tree/utils/is-object.js +3 -0
- package/dist/hooks/use-slot/get-element-ref.d.ts +2 -0
- package/dist/hooks/use-slot/get-element-ref.js +20 -0
- package/dist/hooks/use-slot/index.d.ts +3 -0
- package/dist/hooks/use-slot/index.js +1 -0
- package/dist/hooks/use-slot/merge-props.d.ts +4 -0
- package/dist/hooks/use-slot/merge-props.js +27 -0
- package/dist/hooks/use-slot/react-version.d.ts +3 -0
- package/dist/hooks/use-slot/react-version.js +5 -0
- package/dist/hooks/use-slot/types.d.ts +4 -0
- package/dist/hooks/use-slot/types.js +1 -0
- package/dist/hooks/use-slot/use-slot.d.ts +12 -0
- package/dist/hooks/use-slot/use-slot.js +28 -0
- package/dist/hooks/use-transitioned-open.d.ts +2 -0
- package/dist/hooks/use-transitioned-open.js +50 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.js +23 -0
- package/dist/license/index.d.ts +1 -0
- package/dist/license/index.js +1 -0
- package/dist/license/license.d.ts +3 -0
- package/dist/license/license.js +215 -0
- package/dist/license/md5-hash.d.ts +9 -0
- package/dist/license/md5-hash.js +167 -0
- package/dist/license.d.ts +3 -0
- package/dist/license.js +214 -0
- package/dist/root/context.d.ts +16 -0
- package/dist/root/context.js +4 -0
- package/dist/root/hooks/use-pro-api.d.ts +2 -0
- package/dist/root/hooks/use-pro-api.js +8 -0
- package/dist/root/root.d.ts +15 -0
- package/dist/root/root.js +112 -0
- package/dist/types/api.d.ts +100 -0
- package/dist/types/api.js +1 -0
- package/dist/types/column.d.ts +73 -0
- package/dist/types/column.js +1 -0
- package/dist/types/events.d.ts +56 -0
- package/dist/types/events.js +1 -0
- package/dist/types/grid.d.ts +47 -0
- package/dist/types/grid.js +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +1 -0
- package/dist/types/props.d.ts +187 -0
- package/dist/types/props.js +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useEvent } from "@1771technologies/lytenyte-core/internal";
|
|
4
|
+
import { Checkbox } from "../checkbox/checkbox.js";
|
|
5
|
+
export function SelectAll({ api, render, }) {
|
|
6
|
+
const s = api.useSelectionState();
|
|
7
|
+
const selected = useMemo(() => {
|
|
8
|
+
const selected = s.selected && s.children.size === 0;
|
|
9
|
+
return selected;
|
|
10
|
+
}, [s]);
|
|
11
|
+
const indeterminate = useMemo(() => {
|
|
12
|
+
return Boolean(s.children.size);
|
|
13
|
+
}, [s]);
|
|
14
|
+
const toggle = useEvent((b) => {
|
|
15
|
+
if (b != null)
|
|
16
|
+
return api.rowSelect({ selected: "all", deselect: !b });
|
|
17
|
+
api.rowSelect({ selected: "all", deselect: selected });
|
|
18
|
+
});
|
|
19
|
+
if (render)
|
|
20
|
+
return render({ indeterminate, selected, toggle });
|
|
21
|
+
return (_jsxs("div", { "data-ln-tree-view-cell": "leaf", style: { "--ln-row-depth": 0 }, children: [_jsx(Checkbox, { checked: selected, indeterminate: indeterminate, onClick: () => toggle() }), "Select All"] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { TreeViewChildParams, TreeViewItem } from "./types";
|
|
2
|
+
export declare function TreeChildren<T extends TreeViewItem>({ row, toggle, selectEnabled: selection, indeterminate, selected, handleSelect, dragProps, isOver, isBefore, }: TreeViewChildParams<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox } from "../checkbox/checkbox.js";
|
|
3
|
+
export function TreeChildren({ row, toggle, selectEnabled: selection, indeterminate, selected, handleSelect, dragProps, isOver, isBefore, }) {
|
|
4
|
+
const depth = row.depth;
|
|
5
|
+
const draggable = !!dragProps.draggable;
|
|
6
|
+
if (row.kind === "branch")
|
|
7
|
+
return (_jsxs("div", { "data-ln-tree-view-cell": row.kind, "data-ln-tree-view-cell-expanded": row.kind === "branch" && row.expanded, "data-ln-tree-view-cell-expandable": row.kind === "branch" ? row.expandable : undefined, "data-ln-tree-over": isOver, "data-ln-tree-before": isBefore, style: { "--ln-row-depth": depth }, ...dragProps, children: [row.kind === "branch" && row.expandable && (_jsx("button", { "data-ln-tree-view-cell-expander": true, "aria-label": "toggle the row group expansion state", onClick: () => toggle(), children: !row.loadingGroup && _jsx(CaretRight, {}) })), draggable && (_jsx("div", { children: _jsx(DragDots, {}) })), selection && (_jsx(Checkbox, { checked: selected, indeterminate: indeterminate, onClick: (e) => handleSelect({ target: e.target, shiftKey: e.shiftKey }) })), _jsx("div", { children: row.key })] }));
|
|
8
|
+
return (_jsxs("div", { "data-ln-tree-view-cell": row.kind, "data-ln-tree-over": isOver, "data-ln-tree-before": isBefore, style: { "--ln-row-depth": depth }, ...dragProps, children: [draggable && (_jsx("div", { children: _jsx(DragDots, {}) })), selection && (_jsx(Checkbox, { checked: selected, indeterminate: indeterminate, onClick: (e) => handleSelect({ target: e.target, shiftKey: e.shiftKey }) })), row.data.name ?? row.data.id] }));
|
|
9
|
+
}
|
|
10
|
+
function CaretRight() {
|
|
11
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentcolor", viewBox: "0 0 256 256", children: _jsx("path", { d: "M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z" }) }));
|
|
12
|
+
}
|
|
13
|
+
function DragDots() {
|
|
14
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentcolor", viewBox: "0 0 256 256", children: _jsx("path", { d: "M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z" }) }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RowGroup, RowLeaf } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import type { DragEvent } from "react";
|
|
3
|
+
export interface TreeViewItem {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly path: string[];
|
|
6
|
+
readonly name?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TreeViewChildParams<T extends TreeViewItem> {
|
|
9
|
+
readonly row: RowGroup | RowLeaf<T>;
|
|
10
|
+
readonly leafs: () => T[];
|
|
11
|
+
readonly toggle: (b?: boolean) => void;
|
|
12
|
+
readonly selected: boolean;
|
|
13
|
+
readonly indeterminate: boolean;
|
|
14
|
+
readonly selectEnabled: boolean;
|
|
15
|
+
readonly select: (b?: boolean) => void;
|
|
16
|
+
readonly handleSelect: (params: {
|
|
17
|
+
readonly target: EventTarget;
|
|
18
|
+
readonly shiftKey: boolean;
|
|
19
|
+
}) => void;
|
|
20
|
+
readonly dragProps: {
|
|
21
|
+
draggable?: boolean;
|
|
22
|
+
onDragStart?: (ev: DragEvent) => void;
|
|
23
|
+
};
|
|
24
|
+
readonly isOver: boolean;
|
|
25
|
+
readonly isBefore: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface TreeViewSelectAllParams {
|
|
28
|
+
readonly selected: boolean;
|
|
29
|
+
readonly indeterminate: boolean;
|
|
30
|
+
readonly toggle: (b?: boolean) => void;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type { ViewportShadowsProps } from "@1771technologies/lytenyte-core/components";
|
|
2
|
+
export { ViewportShadows } from "@1771technologies/lytenyte-core/components";
|
|
3
|
+
export { RowGroupCell } from "./components/row-group-cell.js";
|
|
4
|
+
export type { SelectAllProps } from "./components/select-all.js";
|
|
5
|
+
export { SelectAll } from "./components/select-all.js";
|
|
6
|
+
export { PillManager } from "./components/pill-manager/index.js";
|
|
7
|
+
export { Dialog } from "./components/headless/dialog/index.parts.js";
|
|
8
|
+
export { Menu } from "./components/headless/menu/index.js";
|
|
9
|
+
export { Popover } from "./components/headless/popover/index.js";
|
|
10
|
+
export { SmartSelect } from "./components/smart-select/index.js";
|
|
11
|
+
export type { TreeViewItem, TreeViewProps, TreeViewChildParams, TreeViewSelectAllParams, } from "./components/tree-view/index.js";
|
|
12
|
+
export type { TreeViewApi } from "./components/tree-view/index.js";
|
|
13
|
+
export { TreeView, TreeChildren } from "./components/tree-view/index.js";
|
|
14
|
+
export type { ColumnManagerProps } from "./components/column-manager/column-manager.js";
|
|
15
|
+
export { ColumnManager } from "./components/column-manager/column-manager.js";
|
|
16
|
+
export { Checkbox } from "./components/checkbox/checkbox.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { ViewportShadows } from "@1771technologies/lytenyte-core/components";
|
|
2
|
+
export { RowGroupCell } from "./components/row-group-cell.js";
|
|
3
|
+
export { SelectAll } from "./components/select-all.js";
|
|
4
|
+
export { PillManager } from "./components/pill-manager/index.js";
|
|
5
|
+
export { Dialog } from "./components/headless/dialog/index.parts.js";
|
|
6
|
+
export { Menu } from "./components/headless/menu/index.js";
|
|
7
|
+
export { Popover } from "./components/headless/popover/index.js";
|
|
8
|
+
export { SmartSelect } from "./components/smart-select/index.js";
|
|
9
|
+
export { TreeView, TreeChildren } from "./components/tree-view/index.js";
|
|
10
|
+
export { ColumnManager } from "./components/column-manager/column-manager.js";
|
|
11
|
+
export { Checkbox } from "./components/checkbox/checkbox.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function getValidLeafs(node, leafs, workingSet) {
|
|
2
|
+
const rows = [];
|
|
3
|
+
for (let i = 0; i < node.leafs.length; i++) {
|
|
4
|
+
const x = node.leafs[i];
|
|
5
|
+
const workingIndex = workingSet[x];
|
|
6
|
+
const row = leafs[workingIndex];
|
|
7
|
+
if (node.leafIds.has(row.id))
|
|
8
|
+
rows.push(row);
|
|
9
|
+
}
|
|
10
|
+
return rows;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { UseClientDataSourceParams } from "../use-client-data-source.js";
|
|
2
|
+
import type { ControlledPivotState } from "./use-pivot/use-pivot-state.js";
|
|
3
|
+
export type SourceState = ReturnType<typeof useSourceState>;
|
|
4
|
+
export declare function useSourceState({ onRowGroupExpansionChange, rowGroupExpansions, rowGroupDefaultExpansion, }: UseClientDataSourceParams<any>, controlled: ControlledPivotState): {
|
|
5
|
+
expansions: {
|
|
6
|
+
[rowId: string]: boolean | undefined;
|
|
7
|
+
};
|
|
8
|
+
onExpansionsChange: (delta: Record<string, boolean | undefined>) => void;
|
|
9
|
+
expandedFn: (id: string, depth: number) => boolean;
|
|
10
|
+
pivotExpandedFn: (id: string, depth: number) => boolean;
|
|
11
|
+
pivotRowGroupExpansions: Record<string, boolean | undefined>;
|
|
12
|
+
onPivotExpansionsChange: (delta: Record<string, boolean | undefined>) => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useControlled, useEvent } from "@1771technologies/lytenyte-core/internal";
|
|
3
|
+
export function useSourceState({ onRowGroupExpansionChange, rowGroupExpansions, rowGroupDefaultExpansion = false, }, controlled) {
|
|
4
|
+
const [expansions, setExpansions] = useControlled({
|
|
5
|
+
controlled: rowGroupExpansions,
|
|
6
|
+
default: {},
|
|
7
|
+
});
|
|
8
|
+
const onExpansionsChange = useEvent((delta) => {
|
|
9
|
+
setExpansions({ ...expansions, ...delta });
|
|
10
|
+
onRowGroupExpansionChange?.({ ...expansions, ...delta });
|
|
11
|
+
});
|
|
12
|
+
const expandedFn = useCallback((id, depth) => {
|
|
13
|
+
const s = expansions[id];
|
|
14
|
+
if (s != null)
|
|
15
|
+
return s;
|
|
16
|
+
if (typeof rowGroupDefaultExpansion === "boolean")
|
|
17
|
+
return rowGroupDefaultExpansion;
|
|
18
|
+
return depth <= rowGroupDefaultExpansion;
|
|
19
|
+
}, [expansions, rowGroupDefaultExpansion]);
|
|
20
|
+
const onPivotExpansionsChange = useEvent((delta) => {
|
|
21
|
+
controlled.onPivotRowGroupChange({ ...controlled.pivotRowGroupExpansions, ...delta });
|
|
22
|
+
});
|
|
23
|
+
const pivotExpandedFn = useCallback((id, depth) => {
|
|
24
|
+
const s = controlled.pivotRowGroupExpansions[id];
|
|
25
|
+
if (s != null)
|
|
26
|
+
return s;
|
|
27
|
+
if (typeof rowGroupDefaultExpansion === "boolean")
|
|
28
|
+
return rowGroupDefaultExpansion;
|
|
29
|
+
return rowGroupDefaultExpansion >= depth;
|
|
30
|
+
}, [controlled.pivotRowGroupExpansions, rowGroupDefaultExpansion]);
|
|
31
|
+
return {
|
|
32
|
+
expansions,
|
|
33
|
+
onExpansionsChange,
|
|
34
|
+
expandedFn,
|
|
35
|
+
pivotExpandedFn,
|
|
36
|
+
pivotRowGroupExpansions: controlled.pivotRowGroupExpansions,
|
|
37
|
+
onPivotExpansionsChange,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GridSpec } from "../../types/grid.js";
|
|
2
|
+
import type { UseClientDataSourceParams } from "../use-client-data-source.js";
|
|
3
|
+
import type { SourceState } from "./use-controlled-ds-state.js";
|
|
4
|
+
import { type LeafNodeTuple } from "@1771technologies/lytenyte-core/internal";
|
|
5
|
+
export declare function useFlattenedData<Spec extends GridSpec>(props: UseClientDataSourceParams<Spec>, [leafsTop, leafs, leafsBot, pinMap]: LeafNodeTuple<Spec["data"]>, { expandedFn }: SourceState): {
|
|
6
|
+
tree: import("./use-group-tree/use-group-tree.js").RootNode<Spec["data"]> | null;
|
|
7
|
+
maxDepth: number;
|
|
8
|
+
flatten: import("@1771technologies/lytenyte-shared").RowNode<Spec["data"]>[];
|
|
9
|
+
rowByIdRef: import("react").RefObject<Map<string, import("@1771technologies/lytenyte-shared").RowNode<Spec["data"]>>>;
|
|
10
|
+
rowByIndexRef: import("react").RefObject<Map<number, import("@1771technologies/lytenyte-shared").RowNode<Spec["data"]>>>;
|
|
11
|
+
rowIdToRowIndexRef: import("react").RefObject<Map<string, number>>;
|
|
12
|
+
leafIdsRef: import("react").RefObject<Map<string, import("@1771technologies/lytenyte-shared").RowLeaf<Spec["data"]>>>;
|
|
13
|
+
leafsTop: import("@1771technologies/lytenyte-shared").RowLeaf<Spec["data"]>[];
|
|
14
|
+
leafs: import("@1771technologies/lytenyte-shared").RowLeaf<Spec["data"]>[];
|
|
15
|
+
leafsBot: import("@1771technologies/lytenyte-shared").RowLeaf<Spec["data"]>[];
|
|
16
|
+
sorted: number[];
|
|
17
|
+
groupFn: import("@1771technologies/lytenyte-shared").GroupFn<Spec["data"]> | null;
|
|
18
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useGroupTree } from "./use-group-tree/use-group-tree.js";
|
|
2
|
+
import { useFlattenedGroups } from "./use-flattened-groups.js";
|
|
3
|
+
import { useFlattenedPiece } from "./use-flattened-piece.js";
|
|
4
|
+
import { useAggregationFn, useFiltered, useFilterFn, useGroupFn, useSorted, useSortFn, } from "@1771technologies/lytenyte-core/internal";
|
|
5
|
+
import { useMemo, useRef } from "react";
|
|
6
|
+
const groupIdFallback = (p) => p.map((x) => (x == null ? "_null_" : x)).join("->");
|
|
7
|
+
export function useFlattenedData(props, [leafsTop, leafs, leafsBot, pinMap], { expandedFn }) {
|
|
8
|
+
const filterFn = useFilterFn(props.filter);
|
|
9
|
+
const sortFn = useSortFn(props.sort);
|
|
10
|
+
const groupFn = useGroupFn(props.group);
|
|
11
|
+
const aggFn = useAggregationFn(props.aggregate, props.aggregateFns);
|
|
12
|
+
const filtered = useFiltered(leafs, filterFn);
|
|
13
|
+
const [sorted, centerMap] = useSorted(leafs, sortFn, filtered);
|
|
14
|
+
const leafIds = useMemo(() => new Map([...centerMap, ...pinMap]), [centerMap, pinMap]);
|
|
15
|
+
const leafIdsRef = useRef(leafIds);
|
|
16
|
+
leafIdsRef.current = leafIds;
|
|
17
|
+
const tree = useGroupTree(leafs, sorted, groupFn, props.groupIdFn ?? groupIdFallback, props.rowGroupCollapseBehavior ?? "no-collapse", props.labelFilter, props.having, aggFn);
|
|
18
|
+
const [groupFlat, maxDepth] = useFlattenedGroups(tree, aggFn, leafs, sorted, sortFn, expandedFn, props.rowGroupSuppressLeafExpansion ?? false);
|
|
19
|
+
const { flatten, rowByIdRef, rowByIndexRef, rowIdToRowIndexRef } = useFlattenedPiece({
|
|
20
|
+
leafsTop,
|
|
21
|
+
leafsCenter: leafs,
|
|
22
|
+
leafsBot,
|
|
23
|
+
groupFlat,
|
|
24
|
+
centerIndices: sorted,
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
tree,
|
|
28
|
+
maxDepth,
|
|
29
|
+
flatten,
|
|
30
|
+
rowByIdRef,
|
|
31
|
+
rowByIndexRef,
|
|
32
|
+
rowIdToRowIndexRef,
|
|
33
|
+
leafIdsRef,
|
|
34
|
+
leafsTop,
|
|
35
|
+
leafs,
|
|
36
|
+
leafsBot,
|
|
37
|
+
sorted,
|
|
38
|
+
groupFn,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AggregationFn, RowLeaf, RowNode, SortFn } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import type { RootNode } from "./use-group-tree/use-group-tree";
|
|
3
|
+
type UseFlattenedGroupsReturn<T> = [rows: RowNode<T>[] | null, depth: number];
|
|
4
|
+
export declare function useFlattenedGroups<T>(root: RootNode<T> | null, agg: AggregationFn<T> | undefined | null, leafs: RowLeaf<T>[], workingSet: number[], sort: SortFn<T> | null | undefined, expandedFn: (id: string, depth: number) => boolean, suppressLeafExpansion: boolean, ignoreIsLast?: boolean): UseFlattenedGroupsReturn<T>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { getValidLeafs } from "./get-valid-leafs.js";
|
|
3
|
+
import { useSortFn } from "@1771technologies/lytenyte-core/internal";
|
|
4
|
+
export function useFlattenedGroups(root, agg, leafs, workingSet, sort, expandedFn, suppressLeafExpansion, ignoreIsLast = false) {
|
|
5
|
+
const sortFallbackDim = useMemo(() => [{ dim: { id: "__ln_group__" } }], []);
|
|
6
|
+
const sortFallback = useSortFn(sortFallbackDim);
|
|
7
|
+
const flat = useMemo(() => {
|
|
8
|
+
if (!root)
|
|
9
|
+
return [null, 0];
|
|
10
|
+
const flatList = [];
|
|
11
|
+
const ranges = [];
|
|
12
|
+
let maxDepth = 0;
|
|
13
|
+
function processRowsBetter(node, parent, start, isLast, depth = 0) {
|
|
14
|
+
maxDepth = Math.max(depth + 1, maxDepth);
|
|
15
|
+
const rows = nodeChildrenToRows(node, agg, leafs, workingSet, sort ?? sortFallback, isLast && !ignoreIsLast);
|
|
16
|
+
let offset = 0;
|
|
17
|
+
for (let i = 0; i < rows.length; i++) {
|
|
18
|
+
const row = rows[i];
|
|
19
|
+
const rowIndex = i + start + offset;
|
|
20
|
+
if (row.kind === "leaf") {
|
|
21
|
+
flatList.push(row);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
flatList.push(row);
|
|
25
|
+
const notExpandable = suppressLeafExpansion && row.last;
|
|
26
|
+
row.expandable = !notExpandable;
|
|
27
|
+
if (!expandedFn(row.id, depth) || notExpandable) {
|
|
28
|
+
row.expanded = false;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
row.expanded = true;
|
|
32
|
+
offset += processRowsBetter(row.__children, row, rowIndex + 1, row.last, depth + 1);
|
|
33
|
+
}
|
|
34
|
+
ranges.push({ parent, start, end: offset + start + node.size });
|
|
35
|
+
return offset + node.size;
|
|
36
|
+
}
|
|
37
|
+
processRowsBetter(root.children, null, 0, root.maxDepth <= 1);
|
|
38
|
+
return [flatList, maxDepth];
|
|
39
|
+
}, [agg, expandedFn, ignoreIsLast, leafs, root, sort, sortFallback, suppressLeafExpansion, workingSet]);
|
|
40
|
+
return flat;
|
|
41
|
+
}
|
|
42
|
+
const nodeChildrenToRows = (root, agg, leafs, workingSet, sort, isLast) => {
|
|
43
|
+
const values = root.values();
|
|
44
|
+
const rows = [];
|
|
45
|
+
for (const v of values) {
|
|
46
|
+
if (v.kind === "leaf") {
|
|
47
|
+
rows.push(v.row);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const row = v.row;
|
|
52
|
+
if (row.__invalidate) {
|
|
53
|
+
const data = agg ? agg(getValidLeafs(v, leafs, workingSet)) : {};
|
|
54
|
+
row.data = data;
|
|
55
|
+
row.__invalidate = false;
|
|
56
|
+
}
|
|
57
|
+
rows.push(row);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (!isLast && sort)
|
|
61
|
+
return rows.sort(sort);
|
|
62
|
+
return rows;
|
|
63
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RowNode } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
export interface UseFlattenedPieceParams<T> {
|
|
3
|
+
leafsTop: RowNode<T>[];
|
|
4
|
+
leafsCenter: RowNode<T>[];
|
|
5
|
+
leafsBot: RowNode<T>[];
|
|
6
|
+
groupFlat: RowNode<T>[] | null;
|
|
7
|
+
centerIndices: number[];
|
|
8
|
+
}
|
|
9
|
+
export declare function useFlattenedPiece<T>({ leafsTop, leafsCenter, leafsBot, groupFlat, centerIndices, }: UseFlattenedPieceParams<T>): {
|
|
10
|
+
flatten: RowNode<T>[];
|
|
11
|
+
rowByIdRef: import("react").RefObject<Map<string, RowNode<T>>>;
|
|
12
|
+
rowByIndexRef: import("react").RefObject<Map<number, RowNode<T>>>;
|
|
13
|
+
rowIdToRowIndexRef: import("react").RefObject<Map<string, number>>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useMemo, useRef } from "react";
|
|
2
|
+
export function useFlattenedPiece({ leafsTop, leafsCenter, leafsBot, groupFlat, centerIndices, }) {
|
|
3
|
+
const rowByIdRef = useRef(null);
|
|
4
|
+
const rowByIndexRef = useRef(null);
|
|
5
|
+
const rowIdToRowIndexRef = useRef(null);
|
|
6
|
+
const [flatten] = useMemo(() => {
|
|
7
|
+
const flat = [];
|
|
8
|
+
const byId = new Map();
|
|
9
|
+
const byIndex = new Map();
|
|
10
|
+
const byIdToIndex = new Map();
|
|
11
|
+
for (let i = 0; i < leafsTop.length; i++) {
|
|
12
|
+
const node = leafsTop[i];
|
|
13
|
+
flat.push(node);
|
|
14
|
+
byIndex.set(i, node);
|
|
15
|
+
byId.set(node.id, node);
|
|
16
|
+
byIdToIndex.set(node.id, i);
|
|
17
|
+
}
|
|
18
|
+
const offset = leafsTop.length;
|
|
19
|
+
if (groupFlat) {
|
|
20
|
+
for (let i = 0; i < groupFlat.length; i++) {
|
|
21
|
+
const rowIndex = i + offset;
|
|
22
|
+
const node = groupFlat[i];
|
|
23
|
+
flat.push(node);
|
|
24
|
+
byIndex.set(rowIndex, node);
|
|
25
|
+
byId.set(node.id, node);
|
|
26
|
+
byIdToIndex.set(node.id, rowIndex);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
for (let i = 0; i < centerIndices.length; i++) {
|
|
31
|
+
const rowIndex = i + offset;
|
|
32
|
+
const srcIndex = centerIndices[i];
|
|
33
|
+
const node = leafsCenter[srcIndex];
|
|
34
|
+
flat.push(node);
|
|
35
|
+
byIndex.set(rowIndex, node);
|
|
36
|
+
byId.set(node.id, node);
|
|
37
|
+
byIdToIndex.set(node.id, rowIndex);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const botOffset = offset + (groupFlat ? groupFlat.length : centerIndices.length);
|
|
41
|
+
for (let i = 0; i < leafsBot.length; i++) {
|
|
42
|
+
const rowIndex = i + botOffset;
|
|
43
|
+
const node = leafsBot[i];
|
|
44
|
+
flat.push(node);
|
|
45
|
+
byIndex.set(rowIndex, node);
|
|
46
|
+
byId.set(node.id, node);
|
|
47
|
+
byIdToIndex.set(node.id, rowIndex);
|
|
48
|
+
}
|
|
49
|
+
rowByIdRef.current = byId;
|
|
50
|
+
rowByIndexRef.current = byIndex;
|
|
51
|
+
rowIdToRowIndexRef.current = byIdToIndex;
|
|
52
|
+
return [flat];
|
|
53
|
+
}, [centerIndices, groupFlat, leafsBot, leafsCenter, leafsTop]);
|
|
54
|
+
return { flatten, rowByIdRef, rowByIndexRef, rowIdToRowIndexRef };
|
|
55
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const collapseChild = (node) => {
|
|
2
|
+
const onlyChild = node.children.values().next().value;
|
|
3
|
+
const parentKey = node.key;
|
|
4
|
+
const parent = node.parent;
|
|
5
|
+
parent.children.set(parentKey, onlyChild);
|
|
6
|
+
Object.assign(onlyChild, { parent, key: parentKey });
|
|
7
|
+
const n = onlyChild.row;
|
|
8
|
+
n.parentId = parent.kind === "root" ? null : parent.id;
|
|
9
|
+
n.depth--;
|
|
10
|
+
return onlyChild;
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { collapseChild } from "./collapse-child.js";
|
|
2
|
+
export const collapseLast = (node) => {
|
|
3
|
+
if (node.kind === "leaf")
|
|
4
|
+
return;
|
|
5
|
+
if (node.last) {
|
|
6
|
+
if (node.children.size === 1)
|
|
7
|
+
collapseChild(node);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const values = node.children.values();
|
|
11
|
+
for (const v of values) {
|
|
12
|
+
collapseLast(v);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { collapseChild } from "./collapse-child.js";
|
|
2
|
+
export const collapse = (node) => {
|
|
3
|
+
if (node.kind === "leaf")
|
|
4
|
+
return;
|
|
5
|
+
// This node has multiple children. For each child we should call collapse, but this node
|
|
6
|
+
// itself will not be collapsed.
|
|
7
|
+
if (node.children.size > 1) {
|
|
8
|
+
const values = node.children.values();
|
|
9
|
+
for (const v of values) {
|
|
10
|
+
collapse(v);
|
|
11
|
+
}
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
// If we've reached here it means that this node has a single child. This means we need to
|
|
15
|
+
// replace it in its parent.
|
|
16
|
+
collapse(collapseChild(node));
|
|
17
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AggregationFn, GroupFn, GroupIdFn, RowGroup, RowLeaf } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import type { HavingFilterFn, LabelFilter } from "../../use-client-data-source.js";
|
|
3
|
+
export interface RootNode<T> {
|
|
4
|
+
readonly kind: "root";
|
|
5
|
+
readonly children: RootMap<T>;
|
|
6
|
+
readonly groupLookup: Map<string, GroupNode<T>>;
|
|
7
|
+
readonly maxDepth: number;
|
|
8
|
+
}
|
|
9
|
+
export interface LeafNode<T> {
|
|
10
|
+
readonly parent: GroupNode<T> | RootNode<T>;
|
|
11
|
+
readonly kind: "leaf";
|
|
12
|
+
readonly key: string | null | number;
|
|
13
|
+
readonly row: RowLeaf<T>;
|
|
14
|
+
}
|
|
15
|
+
export interface GroupNode<T> {
|
|
16
|
+
readonly kind: "branch";
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly row: RowGroup & {
|
|
19
|
+
__children: Map<string | null | number, GroupNode<T> | LeafNode<T>>;
|
|
20
|
+
__invalidate: boolean;
|
|
21
|
+
};
|
|
22
|
+
readonly last: boolean;
|
|
23
|
+
readonly key: string | null | number;
|
|
24
|
+
readonly children: Map<string | null | number, GroupNode<T> | LeafNode<T>>;
|
|
25
|
+
readonly path: (string | null)[];
|
|
26
|
+
readonly leafs: number[];
|
|
27
|
+
leafIds: Set<string>;
|
|
28
|
+
readonly parent: GroupNode<T> | RootNode<T>;
|
|
29
|
+
}
|
|
30
|
+
export type RootMap<T> = Map<string | null | number, GroupNode<T> | LeafNode<T>>;
|
|
31
|
+
export declare function useGroupTree<T>(leafs: RowLeaf<T>[], workingSet: number[], group: GroupFn<T> | undefined | null, groupIdFn: GroupIdFn, rowGroupCollapseBehavior: "no-collapse" | "last-only" | "full-tree", labelFilter: (LabelFilter | null)[] | null | undefined, having: (HavingFilterFn | null)[] | null | undefined, agg: AggregationFn<T> | undefined | null): RootNode<T> | null;
|