@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,279 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useEdgeScroll } from "../use-edge-scroll.js";
|
|
4
|
+
import { getClientX, getClientY, getRelativeXPosition, getRelativeYPosition, } from "@1771technologies/lytenyte-shared";
|
|
5
|
+
import { getNearestFocusable, getPositionFromFocusable } from "@1771technologies/lytenyte-shared";
|
|
6
|
+
import { isHTMLElement } from "@1771technologies/lytenyte-shared";
|
|
7
|
+
import { updateAdditiveCellSelection } from "../update-additive-cell-selection.js";
|
|
8
|
+
import { deselectRectRange } from "../deselect-rect-range.js";
|
|
9
|
+
import { isWithinSelectionRect } from "../is-within-selection-rect.js";
|
|
10
|
+
import { useProRoot } from "../../root/context.js";
|
|
11
|
+
import { useRoot } from "@1771technologies/lytenyte-core/internal";
|
|
12
|
+
import { useCellFocusChange } from "./use-cell-focus-change.js";
|
|
13
|
+
import { adjustRectForRowAndCellSpan } from "../adjust-rect-for-row-and-cell-span.js";
|
|
14
|
+
import { expandSelectionUp } from "../expand-selection-up.js";
|
|
15
|
+
import { expandSelectionDown } from "../expand-selection-down.js";
|
|
16
|
+
import { expandSelectionStart } from "../expand-selection-start.js";
|
|
17
|
+
import { expandSelectionEnd } from "../expand-selection-end.js";
|
|
18
|
+
function isNormalClick(event) {
|
|
19
|
+
return event.button === 0 && !event.altKey;
|
|
20
|
+
}
|
|
21
|
+
export function CellSelectionDriver() {
|
|
22
|
+
const { rtl, view, source, viewport, focusActive, id } = useRoot();
|
|
23
|
+
const { cellSelectionMode: mode, onCellSelectionChange, api, cellSelectionAdditiveRects, setCellSelectionAdditiveRects, cellSelections, cellSelectionIsDeselect, } = useProRoot();
|
|
24
|
+
const { excludeMarker, keepSelection } = useProRoot();
|
|
25
|
+
const { cancelX, cancelY, edgeScrollX, edgeScrollY } = useEdgeScroll();
|
|
26
|
+
const topCount = source.useTopCount();
|
|
27
|
+
const rowCount = source.useRowCount();
|
|
28
|
+
const botCount = source.useBottomCount();
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!viewport || mode === "none")
|
|
31
|
+
return;
|
|
32
|
+
const isMultiRange = mode === "multi-range";
|
|
33
|
+
let isAdditive = false;
|
|
34
|
+
let start = null;
|
|
35
|
+
let lastRect = null;
|
|
36
|
+
let animFrame = null;
|
|
37
|
+
let startY = null;
|
|
38
|
+
const gridId = id;
|
|
39
|
+
const pointerMove = (event) => {
|
|
40
|
+
if (animFrame)
|
|
41
|
+
cancelAnimationFrame(animFrame);
|
|
42
|
+
animFrame = requestAnimationFrame(() => {
|
|
43
|
+
animFrame = null;
|
|
44
|
+
if (!start)
|
|
45
|
+
return;
|
|
46
|
+
const clientX = getClientX(event);
|
|
47
|
+
const clientY = getClientY(event);
|
|
48
|
+
// Check the target we moved over and ensure it is an HTML element.
|
|
49
|
+
if (!isHTMLElement(event.target))
|
|
50
|
+
return;
|
|
51
|
+
// Get the focusable position for the currently hovered cell.
|
|
52
|
+
const focusable = getNearestFocusable(gridId, event.target);
|
|
53
|
+
if (!focusable)
|
|
54
|
+
return;
|
|
55
|
+
const position = getPositionFromFocusable(gridId, focusable);
|
|
56
|
+
if (position.kind !== "cell" && position.kind !== "full-width")
|
|
57
|
+
return;
|
|
58
|
+
const startCount = view.startCount;
|
|
59
|
+
const firstEnd = view.centerCount + startCount;
|
|
60
|
+
const centerCount = rowCount - topCount - botCount;
|
|
61
|
+
const firstEndRow = centerCount + topCount;
|
|
62
|
+
const relativeX = getRelativeXPosition(viewport, clientX);
|
|
63
|
+
const isRtl = rtl;
|
|
64
|
+
const visualX = isRtl ? relativeX.right : relativeX.left;
|
|
65
|
+
const rowIndex = position.rowIndex;
|
|
66
|
+
const columnIndex = position.colIndex;
|
|
67
|
+
const startColSection = start.columnStart < startCount ? "start" : start.columnStart >= firstEnd ? "end" : "center";
|
|
68
|
+
const colSection = columnIndex < startCount ? "start" : columnIndex >= firstEnd ? "end" : "center";
|
|
69
|
+
const rowSection = rowIndex < topCount ? "top" : rowIndex >= firstEnd ? "bottom" : "center";
|
|
70
|
+
const startRowSection = start.rowStart < topCount ? "top" : start.rowStart >= firstEndRow ? "bottom" : "center";
|
|
71
|
+
const isSameColPin = startColSection === colSection;
|
|
72
|
+
const isSameRowPin = startRowSection === rowSection;
|
|
73
|
+
edgeScrollX(visualX, isRtl);
|
|
74
|
+
const relativeY = getRelativeYPosition(viewport, clientY);
|
|
75
|
+
edgeScrollY(relativeY.top, startY);
|
|
76
|
+
const scrollY = viewport.scrollTop;
|
|
77
|
+
if (!isSameRowPin && rowIndex < topCount && scrollY > 0)
|
|
78
|
+
return;
|
|
79
|
+
const maxScroll = viewport.scrollHeight - viewport.clientHeight - 4;
|
|
80
|
+
if (!isSameRowPin && rowIndex > topCount + centerCount - 1 && scrollY < maxScroll)
|
|
81
|
+
return;
|
|
82
|
+
const scrollX = Math.abs(viewport.scrollLeft);
|
|
83
|
+
if (!isSameColPin && columnIndex < startCount && scrollX > 0)
|
|
84
|
+
return;
|
|
85
|
+
const maxScrollX = viewport.scrollWidth - viewport.clientWidth - 4;
|
|
86
|
+
if (!isSameColPin && columnIndex >= firstEnd && scrollX < maxScrollX)
|
|
87
|
+
return;
|
|
88
|
+
const rowSpan = position.kind === "full-width" || !position.root ? 1 : position.root.rowSpan;
|
|
89
|
+
const colSpan = position.kind === "full-width" || !position.root ? 1 : position.root.colSpan;
|
|
90
|
+
const rs = Math.min(rowIndex, start.rowStart);
|
|
91
|
+
const re = Math.max(rowIndex + rowSpan, start.rowEnd);
|
|
92
|
+
const ce = Math.max(columnIndex + colSpan, start.columnEnd);
|
|
93
|
+
let cs = Math.min(columnIndex, start.columnStart);
|
|
94
|
+
if (excludeMarker)
|
|
95
|
+
cs = Math.max(cs, 1);
|
|
96
|
+
const active = { rowStart: rs, rowEnd: re, columnStart: cs, columnEnd: ce };
|
|
97
|
+
if (isAdditive) {
|
|
98
|
+
updateAdditiveCellSelection(api, view, topCount, rowCount, botCount, active, cellSelectionAdditiveRects, setCellSelectionAdditiveRects);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
onCellSelectionChange([adjustRectForRowAndCellSpan(api.cellRoot, active)]);
|
|
102
|
+
}
|
|
103
|
+
lastRect = active;
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
const pointerDown = (event) => {
|
|
107
|
+
if (!isNormalClick(event)) {
|
|
108
|
+
document.removeEventListener("pointermove", pointerMove);
|
|
109
|
+
// Prevent the default for the context menu, otherwise the cell
|
|
110
|
+
// right clicked will be focused,
|
|
111
|
+
// resulting in the cell selection changing.
|
|
112
|
+
if (event.button == 2)
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
isAdditive = isMultiRange && (event.ctrlKey || event.metaKey);
|
|
117
|
+
const target = event.target;
|
|
118
|
+
if (!isHTMLElement(target))
|
|
119
|
+
return;
|
|
120
|
+
const focusable = getNearestFocusable(gridId, target);
|
|
121
|
+
if (!focusable)
|
|
122
|
+
return;
|
|
123
|
+
const position = getPositionFromFocusable(gridId, focusable);
|
|
124
|
+
if (position.kind !== "cell" && position.kind !== "full-width")
|
|
125
|
+
return;
|
|
126
|
+
const rowIndex = position.rowIndex;
|
|
127
|
+
const columnIndex = position.colIndex;
|
|
128
|
+
if (excludeMarker && columnIndex === 0)
|
|
129
|
+
return;
|
|
130
|
+
// If the columnIndex or rowIndex is null then we haven't clicked a valid cell position.
|
|
131
|
+
// This ends the row selection.
|
|
132
|
+
if (columnIndex == null || rowIndex == null) {
|
|
133
|
+
onCellSelectionChange([]);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const isSelected = cellSelections.some((c) => isWithinSelectionRect(c, rowIndex, columnIndex));
|
|
137
|
+
const isDeselect = isAdditive && isSelected;
|
|
138
|
+
const rowSpan = position.kind === "full-width" || !position.root ? 1 : position.root.rowSpan;
|
|
139
|
+
const colSpan = position.kind === "full-width" || !position.root ? 1 : position.root.colSpan;
|
|
140
|
+
startY = getRelativeYPosition(viewport, event.clientY).top;
|
|
141
|
+
start = {
|
|
142
|
+
columnStart: columnIndex,
|
|
143
|
+
columnEnd: columnIndex + colSpan,
|
|
144
|
+
rowStart: rowIndex,
|
|
145
|
+
rowEnd: rowIndex + rowSpan,
|
|
146
|
+
};
|
|
147
|
+
// If shift key down we select an area. We can only select an area if a pivot has been established.
|
|
148
|
+
// The pivot will always expand the last cell selection rect if there are multiple ones.
|
|
149
|
+
if (event.shiftKey) {
|
|
150
|
+
const position = focusActive.get();
|
|
151
|
+
if (position?.kind !== "cell")
|
|
152
|
+
return;
|
|
153
|
+
const pivot = {
|
|
154
|
+
rowStart: position.root ? position.root.rowIndex : position.rowIndex,
|
|
155
|
+
rowEnd: position.root ? position.root.rowIndex + position.root.rowSpan : position.rowIndex + 1,
|
|
156
|
+
columnStart: position.root ? position.root.colIndex : position.colIndex,
|
|
157
|
+
columnEnd: position.root ? position.root.colIndex + position.root.colSpan : position.colIndex,
|
|
158
|
+
};
|
|
159
|
+
const active = { ...pivot };
|
|
160
|
+
active.columnStart = Math.min(columnIndex, active.columnStart);
|
|
161
|
+
active.columnEnd = Math.max(columnIndex + 1, active.columnEnd);
|
|
162
|
+
active.rowStart = Math.min(rowIndex, active.rowStart);
|
|
163
|
+
active.rowEnd = Math.max(rowIndex + 1, active.rowEnd);
|
|
164
|
+
onCellSelectionChange([active]);
|
|
165
|
+
// We need to prevent the default otherwise the cell to go to will be
|
|
166
|
+
// focused. This leads to awkward behavior around the cell selection pivot
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
// We need to prevent the default for multi
|
|
171
|
+
if (mode === "multi-range" && (event.metaKey || event.ctrlKey)) {
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
}
|
|
174
|
+
cellSelectionIsDeselect.current = isDeselect;
|
|
175
|
+
if (isAdditive) {
|
|
176
|
+
updateAdditiveCellSelection(api, view, topCount, rowCount, botCount, start, cellSelectionAdditiveRects, setCellSelectionAdditiveRects);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
onCellSelectionChange([adjustRectForRowAndCellSpan(api.cellRoot, start)]);
|
|
180
|
+
}
|
|
181
|
+
lastRect = start;
|
|
182
|
+
document.addEventListener("pointermove", pointerMove);
|
|
183
|
+
document.addEventListener("contextmenu", pointerUp);
|
|
184
|
+
document.addEventListener("pointerup", pointerUp);
|
|
185
|
+
};
|
|
186
|
+
const pointerUp = () => {
|
|
187
|
+
start = null;
|
|
188
|
+
if (isAdditive) {
|
|
189
|
+
const isDeselect = cellSelectionIsDeselect.current;
|
|
190
|
+
const rects = isDeselect
|
|
191
|
+
? cellSelections.flatMap((r) => deselectRectRange(r, lastRect))
|
|
192
|
+
: [...cellSelections, lastRect];
|
|
193
|
+
onCellSelectionChange(rects);
|
|
194
|
+
setCellSelectionAdditiveRects(null);
|
|
195
|
+
cellSelectionIsDeselect.current = false;
|
|
196
|
+
isAdditive = false;
|
|
197
|
+
}
|
|
198
|
+
cancelX();
|
|
199
|
+
cancelY();
|
|
200
|
+
document.removeEventListener("pointerup", pointerUp);
|
|
201
|
+
document.removeEventListener("contextmenu", pointerUp);
|
|
202
|
+
document.removeEventListener("pointermove", pointerMove);
|
|
203
|
+
};
|
|
204
|
+
viewport.addEventListener("pointerdown", pointerDown);
|
|
205
|
+
const handleKey = (ev) => {
|
|
206
|
+
const start = rtl ? "ArrowRight" : "ArrowLeft";
|
|
207
|
+
const end = rtl ? "ArrowLeft" : "ArrowRight";
|
|
208
|
+
const position = focusActive.get();
|
|
209
|
+
// Select all
|
|
210
|
+
if (ev.key === "a" && (ev.ctrlKey || ev.metaKey)) {
|
|
211
|
+
if (!cellSelections.at(-1))
|
|
212
|
+
return;
|
|
213
|
+
const next = {
|
|
214
|
+
columnStart: excludeMarker ? 1 : 0,
|
|
215
|
+
columnEnd: view.visibleColumns.length,
|
|
216
|
+
rowStart: 0,
|
|
217
|
+
rowEnd: rowCount,
|
|
218
|
+
};
|
|
219
|
+
const nextSelections = [...cellSelections];
|
|
220
|
+
nextSelections[nextSelections.length - 1] = next;
|
|
221
|
+
onCellSelectionChange(nextSelections);
|
|
222
|
+
ev.preventDefault();
|
|
223
|
+
ev.stopPropagation();
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (!ev.shiftKey || position?.kind !== "cell")
|
|
227
|
+
return;
|
|
228
|
+
let handled = false;
|
|
229
|
+
if (ev.key === "ArrowUp") {
|
|
230
|
+
expandSelectionUp(api, cellSelections, onCellSelectionChange, ev.ctrlKey || ev.metaKey, position, rowCount);
|
|
231
|
+
handled = true;
|
|
232
|
+
}
|
|
233
|
+
else if (ev.key === "ArrowDown") {
|
|
234
|
+
expandSelectionDown(api, cellSelections, onCellSelectionChange, ev.ctrlKey || ev.metaKey, position, rowCount);
|
|
235
|
+
handled = true;
|
|
236
|
+
}
|
|
237
|
+
else if (ev.key === start) {
|
|
238
|
+
expandSelectionStart(api, cellSelections, onCellSelectionChange, ev.ctrlKey || ev.metaKey, position, excludeMarker, view);
|
|
239
|
+
handled = true;
|
|
240
|
+
}
|
|
241
|
+
else if (ev.key === end) {
|
|
242
|
+
expandSelectionEnd(api, cellSelections, onCellSelectionChange, ev.ctrlKey || ev.metaKey, position, view);
|
|
243
|
+
handled = true;
|
|
244
|
+
}
|
|
245
|
+
if (handled) {
|
|
246
|
+
ev.preventDefault();
|
|
247
|
+
ev.stopPropagation();
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
viewport.addEventListener("keydown", handleKey);
|
|
251
|
+
return () => {
|
|
252
|
+
viewport.removeEventListener("pointerdown", pointerDown);
|
|
253
|
+
viewport.removeEventListener("keydown", handleKey);
|
|
254
|
+
};
|
|
255
|
+
}, [
|
|
256
|
+
api,
|
|
257
|
+
botCount,
|
|
258
|
+
cancelX,
|
|
259
|
+
cancelY,
|
|
260
|
+
cellSelectionAdditiveRects,
|
|
261
|
+
cellSelectionIsDeselect,
|
|
262
|
+
cellSelections,
|
|
263
|
+
edgeScrollX,
|
|
264
|
+
edgeScrollY,
|
|
265
|
+
excludeMarker,
|
|
266
|
+
focusActive,
|
|
267
|
+
id,
|
|
268
|
+
mode,
|
|
269
|
+
onCellSelectionChange,
|
|
270
|
+
rowCount,
|
|
271
|
+
rtl,
|
|
272
|
+
setCellSelectionAdditiveRects,
|
|
273
|
+
topCount,
|
|
274
|
+
view,
|
|
275
|
+
viewport,
|
|
276
|
+
]);
|
|
277
|
+
useCellFocusChange(focusActive, excludeMarker, keepSelection, onCellSelectionChange, setCellSelectionAdditiveRects, api);
|
|
278
|
+
return _jsx(_Fragment, {});
|
|
279
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PieceWritable } from "@1771technologies/lytenyte-core";
|
|
2
|
+
import { type PositionUnion } from "@1771technologies/lytenyte-shared";
|
|
3
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
4
|
+
import type { DataRectSplit } from "../split-cell-selection-rect";
|
|
5
|
+
import type { API, DataRect } from "../../types";
|
|
6
|
+
export declare function useCellFocusChange(focusActive: PieceWritable<PositionUnion | null>, excludeMarker: boolean, keepSelection: boolean, onCellSelectionChange: (c: DataRect[]) => void, setCellSelectionAdditiveRects: Dispatch<SetStateAction<DataRectSplit[] | null>>, api: API): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { equal } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { dataRectFromCellPosition } from "../data-rect-from-cell-position.js";
|
|
4
|
+
import { adjustRectForRowAndCellSpan } from "../adjust-rect-for-row-and-cell-span.js";
|
|
5
|
+
export function useCellFocusChange(focusActive, excludeMarker, keepSelection, onCellSelectionChange, setCellSelectionAdditiveRects, api) {
|
|
6
|
+
const focus = focusActive.useValue();
|
|
7
|
+
const prevRef = useRef(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!focus)
|
|
10
|
+
return;
|
|
11
|
+
const prev = prevRef.current;
|
|
12
|
+
if (equal(prev, focus))
|
|
13
|
+
return;
|
|
14
|
+
prevRef.current = focus;
|
|
15
|
+
if (focus.colIndex === 0 && excludeMarker) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (!keepSelection && focus?.kind !== "cell" && focus?.kind !== "full-width") {
|
|
19
|
+
onCellSelectionChange([]);
|
|
20
|
+
setCellSelectionAdditiveRects([]);
|
|
21
|
+
}
|
|
22
|
+
else if (focus.kind === "cell" || focus.kind === "full-width") {
|
|
23
|
+
const rect = focus.kind === "full-width"
|
|
24
|
+
? {
|
|
25
|
+
rowStart: focus.rowIndex,
|
|
26
|
+
rowEnd: focus.rowIndex + 1,
|
|
27
|
+
columnStart: focus.colIndex,
|
|
28
|
+
columnEnd: focus.colIndex + 1,
|
|
29
|
+
}
|
|
30
|
+
: dataRectFromCellPosition(focus);
|
|
31
|
+
onCellSelectionChange([adjustRectForRowAndCellSpan(api.cellRoot, rect)]);
|
|
32
|
+
}
|
|
33
|
+
}, [api, excludeMarker, focus, keepSelection, onCellSelectionChange, setCellSelectionAdditiveRects]);
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DataRectSplit } from "./split-cell-selection-rect.js";
|
|
2
|
+
export declare function CellStyleRow({ rect, isRowPinnedTop, isDeselect, isRowPinnedBottom, isPivot, }: {
|
|
3
|
+
rect: DataRectSplit;
|
|
4
|
+
isRowPinnedTop?: boolean;
|
|
5
|
+
isDeselect?: boolean;
|
|
6
|
+
isRowPinnedBottom?: boolean;
|
|
7
|
+
isPivot?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { getTranslate, sizeFromCoord } from "@1771technologies/lytenyte-shared";
|
|
4
|
+
import { useRoot } from "@1771technologies/lytenyte-core/internal";
|
|
5
|
+
export function CellStyleRow({ rect, isRowPinnedTop, isDeselect, isRowPinnedBottom, isPivot, }) {
|
|
6
|
+
const { xPositions, yPositions, rtl, view, source, dimensions } = useRoot();
|
|
7
|
+
const startCount = view.startCount;
|
|
8
|
+
const centerCount = view.centerCount;
|
|
9
|
+
const rowCount = source.useRowCount();
|
|
10
|
+
const rowTopCount = source.useTopCount();
|
|
11
|
+
const rowBotCount = source.useBottomCount();
|
|
12
|
+
const vpWidth = dimensions.innerWidth;
|
|
13
|
+
const style = useMemo(() => {
|
|
14
|
+
const columnStart = rect.columnStart;
|
|
15
|
+
const columnEnd = rect.columnEnd;
|
|
16
|
+
const isStart = columnStart < startCount;
|
|
17
|
+
const isEnd = columnStart >= startCount + centerCount;
|
|
18
|
+
const isTop = isRowPinnedTop;
|
|
19
|
+
const isBot = isRowPinnedBottom;
|
|
20
|
+
const columnIndex = columnStart;
|
|
21
|
+
const rowIndex = rect.rowStart;
|
|
22
|
+
const width = sizeFromCoord(columnStart, xPositions, columnEnd - columnStart);
|
|
23
|
+
const height = sizeFromCoord(rect.rowStart, yPositions, rect.rowEnd - rect.rowStart);
|
|
24
|
+
const firstBotIndex = rowCount - rowBotCount;
|
|
25
|
+
const x = isEnd ? xPositions[columnIndex] - xPositions.at(-1) + vpWidth : xPositions[columnIndex];
|
|
26
|
+
let y;
|
|
27
|
+
if (isBot)
|
|
28
|
+
y = yPositions[rowIndex] - yPositions[firstBotIndex];
|
|
29
|
+
else if (isTop)
|
|
30
|
+
y = yPositions[rowIndex];
|
|
31
|
+
else {
|
|
32
|
+
y = `calc(${yPositions[rowIndex] - yPositions[rowTopCount]}px - var(--ln-y-offset, 0px))`;
|
|
33
|
+
}
|
|
34
|
+
const transform = getTranslate(x * (rtl ? -1 : 1), y);
|
|
35
|
+
const pinnedRow = isTop || isBot;
|
|
36
|
+
const pinnedCell = isStart || isEnd;
|
|
37
|
+
const style = {
|
|
38
|
+
height: height - 1, // Minus 1 because the bottom border is not included in cell heights.
|
|
39
|
+
width,
|
|
40
|
+
transform,
|
|
41
|
+
position: "absolute",
|
|
42
|
+
pointerEvents: "none",
|
|
43
|
+
top: 0,
|
|
44
|
+
zIndex: 1,
|
|
45
|
+
gridRowStart: "1",
|
|
46
|
+
gridRowEnd: "2",
|
|
47
|
+
gridColumnStart: "1",
|
|
48
|
+
gridColumnEnd: "2",
|
|
49
|
+
};
|
|
50
|
+
if (pinnedCell) {
|
|
51
|
+
style.insetInlineStart = "0px";
|
|
52
|
+
style.position = "sticky";
|
|
53
|
+
style.zIndex = pinnedRow ? 6 : 3;
|
|
54
|
+
}
|
|
55
|
+
if (pinnedRow) {
|
|
56
|
+
style.position = "sticky";
|
|
57
|
+
style.top = "0px";
|
|
58
|
+
style.zIndex = pinnedCell ? 6 : 3;
|
|
59
|
+
}
|
|
60
|
+
return style;
|
|
61
|
+
}, [
|
|
62
|
+
rect.columnStart,
|
|
63
|
+
rect.columnEnd,
|
|
64
|
+
rect.rowStart,
|
|
65
|
+
rect.rowEnd,
|
|
66
|
+
startCount,
|
|
67
|
+
centerCount,
|
|
68
|
+
isRowPinnedTop,
|
|
69
|
+
isRowPinnedBottom,
|
|
70
|
+
rowCount,
|
|
71
|
+
rowBotCount,
|
|
72
|
+
xPositions,
|
|
73
|
+
vpWidth,
|
|
74
|
+
yPositions,
|
|
75
|
+
rowTopCount,
|
|
76
|
+
rtl,
|
|
77
|
+
]);
|
|
78
|
+
return (_jsx("div", { style: style, "data-ln-cell-selection-rect": true, "data-ln-cell-selection-is-deselect": isDeselect, "data-ln-cell-selection-is-pivot": isPivot, "data-ln-cell-selection-is-unit": rect.isUnit, "data-ln-cell-selection-border-top": rect.borderTop, "data-ln-cell-selection-border-bottom": rect.borderBottom, "data-ln-cell-selection-border-start": rect.borderStart, "data-ln-cell-selection-border-end": rect.borderEnd }));
|
|
79
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function dataRectFromCellPosition(position) {
|
|
2
|
+
if (position.root) {
|
|
3
|
+
const r = position.root;
|
|
4
|
+
return {
|
|
5
|
+
rowStart: r.rowIndex,
|
|
6
|
+
rowEnd: r.rowIndex + r.rowSpan,
|
|
7
|
+
columnStart: r.colIndex,
|
|
8
|
+
columnEnd: r.colIndex + r.colSpan,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
rowStart: position.rowIndex,
|
|
13
|
+
rowEnd: position.rowIndex + 1,
|
|
14
|
+
columnStart: position.colIndex,
|
|
15
|
+
columnEnd: position.colIndex + 1,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isOverlappingRect } from "./is-overlapping-rect.js";
|
|
2
|
+
export function deselectRectRange(rect, deselectRect) {
|
|
3
|
+
if (!isOverlappingRect(rect, deselectRect))
|
|
4
|
+
return [rect];
|
|
5
|
+
const result = [];
|
|
6
|
+
// Check for top split
|
|
7
|
+
if (deselectRect.rowStart > rect.rowStart) {
|
|
8
|
+
result.push({
|
|
9
|
+
rowStart: rect.rowStart,
|
|
10
|
+
rowEnd: deselectRect.rowStart,
|
|
11
|
+
columnStart: rect.columnStart,
|
|
12
|
+
columnEnd: rect.columnEnd,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
// Check for bottom split
|
|
16
|
+
if (deselectRect.rowEnd < rect.rowEnd) {
|
|
17
|
+
result.push({
|
|
18
|
+
rowStart: deselectRect.rowEnd,
|
|
19
|
+
rowEnd: rect.rowEnd,
|
|
20
|
+
columnStart: rect.columnStart,
|
|
21
|
+
columnEnd: rect.columnEnd,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
// Check for left split
|
|
25
|
+
if (deselectRect.columnStart > rect.columnStart) {
|
|
26
|
+
result.push({
|
|
27
|
+
rowStart: Math.max(deselectRect.rowStart, rect.rowStart),
|
|
28
|
+
rowEnd: Math.min(deselectRect.rowEnd, rect.rowEnd),
|
|
29
|
+
columnStart: rect.columnStart,
|
|
30
|
+
columnEnd: deselectRect.columnStart,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
// Check for right split
|
|
34
|
+
if (deselectRect.columnEnd < rect.columnEnd) {
|
|
35
|
+
result.push({
|
|
36
|
+
rowStart: Math.max(deselectRect.rowStart, rect.rowStart),
|
|
37
|
+
rowEnd: Math.min(deselectRect.rowEnd, rect.rowEnd),
|
|
38
|
+
columnStart: deselectRect.columnEnd,
|
|
39
|
+
columnEnd: rect.columnEnd,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return result.filter((rect) => !(rect.rowStart >= rect.rowEnd || rect.columnStart >= rect.columnEnd));
|
|
43
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PositionGridCell } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import type { API, DataRect } from "../types/api.js";
|
|
3
|
+
export declare function expandSelectionDown(api: API, selections: DataRect[], setSelections: (d: DataRect[]) => void, meta: boolean, position: PositionGridCell, rowCount: number): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { dataRectFromCellPosition } from "./data-rect-from-cell-position.js";
|
|
2
|
+
import { isOverlappingRect } from "./is-overlapping-rect.js";
|
|
3
|
+
import { isFullyWithinRect } from "./is-fully-within-rect.js";
|
|
4
|
+
export function expandSelectionDown(api, selections, setSelections, meta, position, rowCount) {
|
|
5
|
+
const pos = dataRectFromCellPosition(position);
|
|
6
|
+
const rect = selections.at(-1);
|
|
7
|
+
if (!rect || !isOverlappingRect(rect, pos) || isFullyWithinRect(pos, rect))
|
|
8
|
+
return;
|
|
9
|
+
if (meta) {
|
|
10
|
+
const next = { ...rect, rowEnd: rowCount, rowStart: pos.rowStart };
|
|
11
|
+
const nextSelections = [...selections];
|
|
12
|
+
nextSelections[nextSelections.length - 1] = next;
|
|
13
|
+
setSelections(nextSelections);
|
|
14
|
+
if (pos.rowStart !== 0)
|
|
15
|
+
api.scrollIntoView({ row: rowCount - 1 });
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const isAtEdge = pos.rowStart == rect.rowStart || pos.rowEnd === rect.rowEnd;
|
|
19
|
+
let pivotStart = pos.rowStart;
|
|
20
|
+
let pivotEnd = pos.rowEnd;
|
|
21
|
+
// Our cell some how is spanned over. so for the current rowIndex, find the maximum span along the columns
|
|
22
|
+
if (!isAtEdge) {
|
|
23
|
+
for (let i = rect.columnStart; i < rect.columnEnd; i++) {
|
|
24
|
+
const cell = dataRectFromCellPosition(api.cellRoot(pos.rowStart, i));
|
|
25
|
+
pivotStart = Math.min(pivotStart, cell.rowStart);
|
|
26
|
+
pivotEnd = Math.max(pivotEnd, cell.rowEnd);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
let next;
|
|
30
|
+
// Reduce our rect by one level
|
|
31
|
+
if (rect.rowStart < pivotStart) {
|
|
32
|
+
let highestRowEnd = -Infinity;
|
|
33
|
+
let setCell = rect;
|
|
34
|
+
for (let i = rect.columnStart; i < rect.columnEnd; i++) {
|
|
35
|
+
const cell = dataRectFromCellPosition(api.cellRoot(rect.rowStart + 1, i));
|
|
36
|
+
if (cell.rowStart > highestRowEnd) {
|
|
37
|
+
setCell = cell;
|
|
38
|
+
highestRowEnd = cell.rowStart;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
api.scrollIntoView({ row: highestRowEnd });
|
|
42
|
+
next = {
|
|
43
|
+
...rect,
|
|
44
|
+
rowStart: highestRowEnd,
|
|
45
|
+
columnStart: Math.min(setCell.columnStart, rect.columnStart),
|
|
46
|
+
columnEnd: Math.max(setCell.columnEnd, rect.columnEnd),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
// Move the rect level down by one.
|
|
51
|
+
let highestRowEnd = -Infinity;
|
|
52
|
+
let setCell = rect;
|
|
53
|
+
if (rect.rowEnd >= rowCount) {
|
|
54
|
+
highestRowEnd = rowCount;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
for (let i = rect.columnStart; i < rect.columnEnd; i++) {
|
|
58
|
+
const cell = dataRectFromCellPosition(api.cellRoot(rect.rowEnd, i));
|
|
59
|
+
highestRowEnd = Math.max(cell.rowEnd, highestRowEnd);
|
|
60
|
+
if (cell.rowEnd > highestRowEnd) {
|
|
61
|
+
setCell = cell;
|
|
62
|
+
highestRowEnd = cell.rowEnd;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
api.scrollIntoView({ row: highestRowEnd - 1 });
|
|
67
|
+
next = {
|
|
68
|
+
...rect,
|
|
69
|
+
rowEnd: highestRowEnd,
|
|
70
|
+
columnStart: Math.min(setCell.columnStart, rect.columnStart),
|
|
71
|
+
columnEnd: Math.max(setCell.columnEnd, rect.columnEnd),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const nextSelections = [...selections];
|
|
75
|
+
nextSelections[nextSelections.length - 1] = next;
|
|
76
|
+
setSelections(nextSelections);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ColumnView, PositionGridCell } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import type { API, DataRect } from "../types/api.js";
|
|
3
|
+
export declare function expandSelectionEnd(api: API, selections: DataRect[], setSelections: (d: DataRect[]) => void, meta: boolean, position: PositionGridCell, view: ColumnView): void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { dataRectFromCellPosition } from "./data-rect-from-cell-position.js";
|
|
2
|
+
import { isOverlappingRect } from "./is-overlapping-rect.js";
|
|
3
|
+
import { isFullyWithinRect } from "./is-fully-within-rect.js";
|
|
4
|
+
export function expandSelectionEnd(api, selections, setSelections, meta, position, view) {
|
|
5
|
+
const pos = dataRectFromCellPosition(position);
|
|
6
|
+
const rect = selections.at(-1);
|
|
7
|
+
if (!rect || !isOverlappingRect(rect, pos) || isFullyWithinRect(pos, rect))
|
|
8
|
+
return;
|
|
9
|
+
if (meta) {
|
|
10
|
+
const next = {
|
|
11
|
+
...rect,
|
|
12
|
+
columnStart: pos.columnStart,
|
|
13
|
+
columnEnd: view.visibleColumns.length,
|
|
14
|
+
};
|
|
15
|
+
const nextSelections = [...selections];
|
|
16
|
+
nextSelections[nextSelections.length - 1] = next;
|
|
17
|
+
setSelections(nextSelections);
|
|
18
|
+
if (pos.columnStart !== 0)
|
|
19
|
+
api.scrollIntoView({ column: view.visibleColumns.length - 1 });
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const isAtEdge = pos.columnStart == rect.columnStart || pos.columnEnd === rect.columnEnd;
|
|
23
|
+
let pivotStart = pos.columnStart;
|
|
24
|
+
let pivotEnd = pos.columnEnd;
|
|
25
|
+
// Our cell some how is spanned over. so for the current rowIndex, find the maximum span along the columns
|
|
26
|
+
if (!isAtEdge) {
|
|
27
|
+
for (let i = rect.rowStart; i < rect.rowEnd; i++) {
|
|
28
|
+
const cell = dataRectFromCellPosition(api.cellRoot(pos.columnStart, i));
|
|
29
|
+
pivotStart = Math.min(pivotStart, cell.columnStart);
|
|
30
|
+
pivotEnd = Math.max(pivotEnd, cell.columnEnd);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
let next;
|
|
34
|
+
if (rect.columnStart < pivotStart) {
|
|
35
|
+
let highestColEnd = -Infinity;
|
|
36
|
+
let setCell = rect;
|
|
37
|
+
for (let i = rect.rowStart; i < rect.rowEnd; i++) {
|
|
38
|
+
const cell = dataRectFromCellPosition(api.cellRoot(i, rect.columnStart + 1));
|
|
39
|
+
if (cell.columnStart > highestColEnd) {
|
|
40
|
+
highestColEnd = cell.columnStart;
|
|
41
|
+
setCell = cell;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
next = {
|
|
45
|
+
...rect,
|
|
46
|
+
columnStart: highestColEnd,
|
|
47
|
+
rowStart: Math.min(setCell.rowStart, rect.rowStart),
|
|
48
|
+
rowEnd: Math.max(setCell.rowEnd, rect.rowEnd),
|
|
49
|
+
};
|
|
50
|
+
api.scrollIntoView({ column: highestColEnd });
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (rect.columnEnd === view.visibleColumns.length)
|
|
54
|
+
return;
|
|
55
|
+
let highestColEnd = -Infinity;
|
|
56
|
+
let setCell = rect;
|
|
57
|
+
for (let i = rect.rowStart; i < rect.rowEnd; i++) {
|
|
58
|
+
const cell = dataRectFromCellPosition(api.cellRoot(i, rect.columnEnd));
|
|
59
|
+
if (cell.columnStart > highestColEnd) {
|
|
60
|
+
highestColEnd = cell.columnStart;
|
|
61
|
+
setCell = cell;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
next = {
|
|
65
|
+
...rect,
|
|
66
|
+
columnEnd: highestColEnd + 1,
|
|
67
|
+
rowStart: Math.min(setCell.rowStart, rect.rowStart),
|
|
68
|
+
rowEnd: Math.max(setCell.rowEnd, rect.rowEnd),
|
|
69
|
+
};
|
|
70
|
+
api.scrollIntoView({ column: highestColEnd - 1 });
|
|
71
|
+
}
|
|
72
|
+
const nextSelections = [...selections];
|
|
73
|
+
nextSelections[nextSelections.length - 1] = next;
|
|
74
|
+
setSelections(nextSelections);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ColumnView, PositionGridCell } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import type { API, DataRect } from "../types/api.js";
|
|
3
|
+
export declare function expandSelectionStart(api: API, selections: DataRect[], setSelections: (d: DataRect[]) => void, meta: boolean, position: PositionGridCell, excludeMarker: boolean, view: ColumnView): void;
|