@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,10 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
export declare const RadioItem: import("react").ForwardRefExoticComponent<Omit<RadioItem.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare namespace RadioItem {
|
|
4
|
+
type Props = Omit<JSX.IntrinsicElements["div"], "children"> & {
|
|
5
|
+
readonly disabled?: boolean;
|
|
6
|
+
readonly value: string;
|
|
7
|
+
readonly children?: ReactNode | ((checked: boolean) => ReactNode);
|
|
8
|
+
readonly closeOnAction?: boolean;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useContext, useState } from "react";
|
|
3
|
+
import { useMenuItemEvents } from "../item/use-menu-item-events.js";
|
|
4
|
+
import { handleVerticalNavigation } from "../item/handle-vertical-navigation.js";
|
|
5
|
+
import { context } from "./context.js";
|
|
6
|
+
import { useDialogRoot } from "../../dialog/context.js";
|
|
7
|
+
import { useCombinedRefs } from "@1771technologies/lytenyte-core/internal";
|
|
8
|
+
function ItemImpl({ value, disabled, children, closeOnAction, ...props }, ref) {
|
|
9
|
+
const [item, setItem] = useState(null);
|
|
10
|
+
const combinedRefs = useCombinedRefs(ref, setItem);
|
|
11
|
+
const [active, setActive] = useMenuItemEvents(item);
|
|
12
|
+
const ctx = useContext(context);
|
|
13
|
+
const Node = typeof children === "function" ? children(ctx.value === value) : children;
|
|
14
|
+
const d = useDialogRoot();
|
|
15
|
+
return (_jsx("div", { ...props, role: "menuitemradio", ref: combinedRefs, tabIndex: 0, "aria-checked": ctx.value === value, "data-ln-disabled": disabled ? true : undefined, inert: disabled ? true : undefined, "data-ln-menu-item": true, "data-ln-active": active, "data-ln-checked": ctx.value === value, onFocus: (ev) => {
|
|
16
|
+
props.onFocus?.(ev);
|
|
17
|
+
if (ev.isPropagationStopped())
|
|
18
|
+
return;
|
|
19
|
+
setActive(true);
|
|
20
|
+
}, onBlur: (ev) => {
|
|
21
|
+
props.onBlur?.(ev);
|
|
22
|
+
if (ev.isPropagationStopped())
|
|
23
|
+
return;
|
|
24
|
+
setActive(false);
|
|
25
|
+
}, onClick: (ev) => {
|
|
26
|
+
props.onClick?.(ev);
|
|
27
|
+
if (ev.isPropagationStopped())
|
|
28
|
+
return;
|
|
29
|
+
ctx.onChange?.(value);
|
|
30
|
+
if (closeOnAction === false)
|
|
31
|
+
return;
|
|
32
|
+
d?.onOpenChange(false);
|
|
33
|
+
}, onKeyDown: (ev) => {
|
|
34
|
+
if (ev.key === "ArrowUp" || ev.key === "ArrowDown")
|
|
35
|
+
handleVerticalNavigation(ev);
|
|
36
|
+
if (ev.key === " " || ev.key === "Enter") {
|
|
37
|
+
ctx.onChange?.(value);
|
|
38
|
+
if (closeOnAction === false)
|
|
39
|
+
return;
|
|
40
|
+
d?.onOpenChange(false);
|
|
41
|
+
}
|
|
42
|
+
}, children: Node }));
|
|
43
|
+
}
|
|
44
|
+
export const RadioItem = forwardRef(ItemImpl);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
interface SubmenuContextValue {
|
|
3
|
+
readonly submenuRef: JSX.IntrinsicElements["div"]["ref"];
|
|
4
|
+
readonly open: boolean;
|
|
5
|
+
readonly onOpenChange: (b: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const submenuContext: import("react").Context<SubmenuContextValue | null>;
|
|
8
|
+
export declare const useSubmenuContext: () => SubmenuContextValue | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
export declare const SubmenuTrigger: import("react").ForwardRefExoticComponent<Omit<SubmenuTrigger.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare namespace SubmenuTrigger {
|
|
4
|
+
type Props = JSX.IntrinsicElements["div"] & {
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useSubmenuContext } from "./submenu-context.js";
|
|
4
|
+
import { getNearestMatching, getTabbables } from "@1771technologies/lytenyte-shared";
|
|
5
|
+
import { handleVerticalNavigation } from "../item/handle-vertical-navigation.js";
|
|
6
|
+
import { useCombinedRefs } from "@1771technologies/lytenyte-core/internal";
|
|
7
|
+
function SubmenuTriggerImpl({ disabled, ...props }, ref) {
|
|
8
|
+
const [active, setActive] = useState(false);
|
|
9
|
+
const sub = useSubmenuContext();
|
|
10
|
+
const [triggerEl, setTriggerEl] = useState(null);
|
|
11
|
+
const combined = useCombinedRefs(setTriggerEl, ref);
|
|
12
|
+
const blurRef = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!triggerEl || !sub)
|
|
15
|
+
return;
|
|
16
|
+
const controller = new AbortController();
|
|
17
|
+
const signal = controller.signal;
|
|
18
|
+
triggerEl.addEventListener("ln-activate-mouse", () => {
|
|
19
|
+
triggerEl.focus();
|
|
20
|
+
sub.onOpenChange(true);
|
|
21
|
+
if (blurRef.current)
|
|
22
|
+
clearTimeout(blurRef.current);
|
|
23
|
+
}, { signal });
|
|
24
|
+
triggerEl.addEventListener("ln-deactivate-mouse", () => {
|
|
25
|
+
blurRef.current = setTimeout(() => {
|
|
26
|
+
triggerEl.blur();
|
|
27
|
+
}, 100);
|
|
28
|
+
}, { signal });
|
|
29
|
+
return () => controller.abort();
|
|
30
|
+
}, [sub, triggerEl]);
|
|
31
|
+
if (!sub)
|
|
32
|
+
return null;
|
|
33
|
+
return (_jsx("div", { ...props, tabIndex: 0, "data-ln-open": sub.open, "data-ln-menu-item": true, "data-ln-subtrigger": true, "data-ln-active": active, "data-ln-disabled": disabled ? true : undefined, inert: disabled ? true : undefined, ref: combined, onFocus: (ev) => {
|
|
34
|
+
props.onFocus?.(ev);
|
|
35
|
+
if (ev.isPropagationStopped())
|
|
36
|
+
return;
|
|
37
|
+
setActive(true);
|
|
38
|
+
}, onBlur: (ev) => {
|
|
39
|
+
props.onBlur?.(ev);
|
|
40
|
+
if (ev.isPropagationStopped())
|
|
41
|
+
return;
|
|
42
|
+
setActive(false);
|
|
43
|
+
const triggerRoot = getNearestMatching(triggerEl, (el) => el.getAttribute("data-ln-submenu-root") === "true");
|
|
44
|
+
if (!triggerRoot || triggerRoot.contains(ev.relatedTarget))
|
|
45
|
+
return;
|
|
46
|
+
sub.onOpenChange(false);
|
|
47
|
+
}, onKeyDown: (ev) => {
|
|
48
|
+
if (ev.key === "ArrowUp" || ev.key === "ArrowDown") {
|
|
49
|
+
handleVerticalNavigation(ev);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (ev.key === "ArrowRight") {
|
|
53
|
+
ev.stopPropagation();
|
|
54
|
+
ev.preventDefault();
|
|
55
|
+
sub.onOpenChange(true);
|
|
56
|
+
const el = ev.currentTarget;
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
const submenu = getNearestMatching(el, (el) => {
|
|
59
|
+
return el.getAttribute("data-ln-submenu-root") === "true";
|
|
60
|
+
});
|
|
61
|
+
const menu = submenu?.querySelector('[data-ln-menu="true"][data-ln-submenu="true"]');
|
|
62
|
+
if (!menu)
|
|
63
|
+
return;
|
|
64
|
+
const first = getTabbables(menu).filter((x) => x.getAttribute("data-ln-menu-item") === "true")[0];
|
|
65
|
+
first?.focus();
|
|
66
|
+
}, 20);
|
|
67
|
+
}
|
|
68
|
+
} }));
|
|
69
|
+
}
|
|
70
|
+
export const SubmenuTrigger = forwardRef(SubmenuTriggerImpl);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import type { Placement } from "../../../external/floating-ui.js";
|
|
3
|
+
export interface SubmenuProps {
|
|
4
|
+
readonly open?: boolean;
|
|
5
|
+
readonly onOpenChange?: (b: boolean) => void;
|
|
6
|
+
readonly placement?: Placement;
|
|
7
|
+
readonly shiftPadding?: number;
|
|
8
|
+
readonly sideOffset?: number;
|
|
9
|
+
readonly alignOffset?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const Submenu: import("react").ForwardRefExoticComponent<Omit<Submenu.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare namespace Submenu {
|
|
13
|
+
type Props = JSX.IntrinsicElements["div"] & {
|
|
14
|
+
readonly open?: boolean;
|
|
15
|
+
readonly onOpenChange?: (b: boolean) => void;
|
|
16
|
+
readonly placement?: Placement;
|
|
17
|
+
readonly shiftPadding?: number;
|
|
18
|
+
readonly sideOffset?: number;
|
|
19
|
+
readonly alignOffset?: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { useSubmenuPosition } from "./use-submenu-position.js";
|
|
4
|
+
import { submenuContext } from "./submenu-context.js";
|
|
5
|
+
import { useCombinedRefs, useControlled } from "@1771technologies/lytenyte-core/internal";
|
|
6
|
+
import { useTransitioned } from "../../../../hooks/use-transitioned-open.js";
|
|
7
|
+
function SubmenuImpl({ open: userOpen, onOpenChange, placement = "right-start", shiftPadding, sideOffset = 2, alignOffset = 0, ...props }, ref) {
|
|
8
|
+
const [open, setOpen] = useControlled({ controlled: userOpen, default: false });
|
|
9
|
+
const [sub, submenuRef] = useState(null);
|
|
10
|
+
const [, shouldMount] = useTransitioned(open, sub);
|
|
11
|
+
const openChange = useCallback((b) => {
|
|
12
|
+
setOpen(b);
|
|
13
|
+
onOpenChange?.(b);
|
|
14
|
+
}, [onOpenChange, setOpen]);
|
|
15
|
+
const [root, setRoot] = useState(null);
|
|
16
|
+
const combined = useCombinedRefs(ref, setRoot);
|
|
17
|
+
useSubmenuPosition({
|
|
18
|
+
placement,
|
|
19
|
+
shiftPadding,
|
|
20
|
+
sideOffset,
|
|
21
|
+
alignOffset,
|
|
22
|
+
sub,
|
|
23
|
+
root,
|
|
24
|
+
});
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!root)
|
|
27
|
+
return;
|
|
28
|
+
const controller = new AbortController();
|
|
29
|
+
const signal = controller.signal;
|
|
30
|
+
root.addEventListener("ln-close", () => {
|
|
31
|
+
openChange(false);
|
|
32
|
+
}, { signal });
|
|
33
|
+
return () => controller.abort();
|
|
34
|
+
}, [openChange, root]);
|
|
35
|
+
return (_jsx(submenuContext.Provider, { value: useMemo(() => ({
|
|
36
|
+
submenuRef,
|
|
37
|
+
open: shouldMount,
|
|
38
|
+
onOpenChange: openChange,
|
|
39
|
+
}), [openChange, shouldMount]), children: _jsx("div", { ...props, "data-ln-open": open, "data-ln-submenu-root": true, role: "menuitem", style: {
|
|
40
|
+
...props.style,
|
|
41
|
+
position: "relative",
|
|
42
|
+
}, ref: combined, onKeyDown: (ev) => {
|
|
43
|
+
props.onKeyDown?.(ev);
|
|
44
|
+
if (ev.isPropagationStopped())
|
|
45
|
+
return;
|
|
46
|
+
if (ev.key === "ArrowLeft") {
|
|
47
|
+
setOpen(false);
|
|
48
|
+
const trigger = ev.currentTarget.querySelector('[data-ln-subtrigger="true"]');
|
|
49
|
+
trigger?.focus();
|
|
50
|
+
ev.stopPropagation();
|
|
51
|
+
ev.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
}, children: props.children }) }));
|
|
54
|
+
}
|
|
55
|
+
export const Submenu = forwardRef(SubmenuImpl);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SubmenuProps } from "./submenu.js";
|
|
2
|
+
export declare function useSubmenuPosition({ placement, shiftPadding, sideOffset, alignOffset, sub, root, }: Pick<SubmenuProps, "alignOffset" | "placement" | "shiftPadding" | "sideOffset"> & {
|
|
3
|
+
sub: HTMLElement | null;
|
|
4
|
+
root: HTMLElement | null;
|
|
5
|
+
}): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { autoUpdate, computePosition, flip, offset } from "../../../external/floating-ui.js";
|
|
3
|
+
import { transformOrigin } from "../../dialog/transform-origin.js";
|
|
4
|
+
export function useSubmenuPosition({ placement = "right-start", shiftPadding, sideOffset = 2, alignOffset = 0, sub, root, }) {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
if (!sub || !open || !root)
|
|
7
|
+
return;
|
|
8
|
+
const middleware = [offset({ alignmentAxis: alignOffset, mainAxis: sideOffset })];
|
|
9
|
+
const flipMw = flip({
|
|
10
|
+
crossAxis: true,
|
|
11
|
+
});
|
|
12
|
+
if (placement.includes("-"))
|
|
13
|
+
middleware.push(flipMw);
|
|
14
|
+
else
|
|
15
|
+
middleware.push(flipMw);
|
|
16
|
+
middleware.push(transformOrigin({ arrowHeight: 0, arrowWidth: 0 }));
|
|
17
|
+
const clean = autoUpdate(root, sub, async () => {
|
|
18
|
+
const pos = await computePosition(root, sub, {
|
|
19
|
+
strategy: "fixed",
|
|
20
|
+
placement: placement,
|
|
21
|
+
middleware,
|
|
22
|
+
});
|
|
23
|
+
const x = pos.middlewareData.transformOrigin.x;
|
|
24
|
+
const y = pos.middlewareData.transformOrigin.y;
|
|
25
|
+
sub.style.transformOrigin = `${x} ${y}`;
|
|
26
|
+
sub.style.top = `${pos.y}px`;
|
|
27
|
+
sub.style.left = `${pos.x}px`;
|
|
28
|
+
});
|
|
29
|
+
return () => clean();
|
|
30
|
+
}, [alignOffset, placement, root, shiftPadding, sideOffset, sub]);
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useMenu(el: HTMLElement | null): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useSubmenuContext } from "./submenu/submenu-context.js";
|
|
3
|
+
import { getNearestMatching } from "@1771technologies/lytenyte-shared";
|
|
4
|
+
import { dispatchActivate, dispatchClose, dispatchDeactivate, getSubmenuRoots } from "./dom.js";
|
|
5
|
+
export function useMenu(el) {
|
|
6
|
+
const sub = useSubmenuContext();
|
|
7
|
+
const mouseOutTime = useRef(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!el || sub)
|
|
10
|
+
return;
|
|
11
|
+
const controller = new AbortController();
|
|
12
|
+
document.addEventListener("keydown", (ev) => {
|
|
13
|
+
if (el.contains(document.activeElement))
|
|
14
|
+
return;
|
|
15
|
+
if (ev.key !== "ArrowDown" && ev.key !== "ArrowUp")
|
|
16
|
+
return;
|
|
17
|
+
const menu = Array.from(document.querySelectorAll("[data-ln-menu]")).at(-1);
|
|
18
|
+
if (!menu)
|
|
19
|
+
return;
|
|
20
|
+
const firstItem = menu.querySelector("[data-ln-menu-item");
|
|
21
|
+
firstItem.focus?.();
|
|
22
|
+
}, { signal: controller.signal });
|
|
23
|
+
el.addEventListener("mouseover", (ev) => {
|
|
24
|
+
const target = ev.target;
|
|
25
|
+
const item = getNearestMatching(target, (el) => el.getAttribute("data-ln-menu-item") === "true");
|
|
26
|
+
if (!item)
|
|
27
|
+
return;
|
|
28
|
+
if (item) {
|
|
29
|
+
const itemRoots = getSubmenuRoots(item);
|
|
30
|
+
const menus = el.querySelectorAll('[data-ln-submenu-root="true"]');
|
|
31
|
+
menus.forEach((m) => {
|
|
32
|
+
if (!itemRoots.includes(m))
|
|
33
|
+
dispatchClose(m);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (mouseOutTime.current)
|
|
37
|
+
clearTimeout(mouseOutTime.current);
|
|
38
|
+
dispatchActivate(item);
|
|
39
|
+
}, { signal: controller.signal });
|
|
40
|
+
el.addEventListener("mouseout", (ev) => {
|
|
41
|
+
const target = ev.target;
|
|
42
|
+
const item = getNearestMatching(target, (el) => el.getAttribute("data-ln-menu-item") === "true");
|
|
43
|
+
if (!item)
|
|
44
|
+
return;
|
|
45
|
+
mouseOutTime.current = setTimeout(() => {
|
|
46
|
+
dispatchDeactivate(item);
|
|
47
|
+
mouseOutTime.current = null;
|
|
48
|
+
});
|
|
49
|
+
}, { signal: controller.signal });
|
|
50
|
+
return () => controller.abort();
|
|
51
|
+
}, [el, sub]);
|
|
52
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DialogContainer } from "../dialog/container.js";
|
|
2
|
+
export declare const PopoverContainer: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, "ref"> & import("react").RefAttributes<HTMLDialogElement>>;
|
|
3
|
+
export declare namespace PopoverContainer {
|
|
4
|
+
type Props = DialogContainer.Props;
|
|
5
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { DialogContainer } from "../dialog/container.js";
|
|
4
|
+
const PopoverContainerBase = (props, ref) => {
|
|
5
|
+
return (_jsx(DialogContainer, { ...props, ref: ref, "data-ln-popover": props["data-ln-menu-popover"] ? undefined : true }));
|
|
6
|
+
};
|
|
7
|
+
export const PopoverContainer = forwardRef(PopoverContainerBase);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from "react";
|
|
2
|
+
export interface PopoverContext {
|
|
3
|
+
readonly setTrigger: Dispatch<SetStateAction<HTMLElement | null>>;
|
|
4
|
+
}
|
|
5
|
+
export declare const PopoverContext: import("react").Context<PopoverContext>;
|
|
6
|
+
export declare const usePopoverContext: () => PopoverContext;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PropsWithChildren } from "react";
|
|
2
|
+
import { PopoverRoot } from "./root.js";
|
|
3
|
+
import { PopoverTrigger } from "./trigger.js";
|
|
4
|
+
import { DialogArrow } from "../dialog/arrow.js";
|
|
5
|
+
import { DialogClose } from "../dialog/close.js";
|
|
6
|
+
import { PopoverContainer } from "./container.js";
|
|
7
|
+
import { DialogDescription } from "../dialog/description.js";
|
|
8
|
+
import { DialogTitle } from "../dialog/title.js";
|
|
9
|
+
import { useDialog } from "../dialog/use-dialog.js";
|
|
10
|
+
export declare const Popover: {
|
|
11
|
+
(props: PropsWithChildren<PopoverRoot.Props>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<import("../dialog/trigger.js").DialogTrigger.Props, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
Arrow: import("react").ForwardRefExoticComponent<Omit<DialogArrow.Props, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
14
|
+
Close: import("react").ForwardRefExoticComponent<Omit<DialogClose.Props, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
Container: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, "ref"> & import("react").RefAttributes<HTMLDialogElement>>;
|
|
16
|
+
Description: import("react").ForwardRefExoticComponent<Omit<DialogDescription.Props, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
17
|
+
Title: import("react").ForwardRefExoticComponent<Omit<DialogTitle.Props, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
useControls: typeof useDialog;
|
|
19
|
+
};
|
|
20
|
+
export declare namespace Popover {
|
|
21
|
+
type Props = PopoverRoot.Props;
|
|
22
|
+
namespace Component {
|
|
23
|
+
type Trigger = PopoverTrigger.Props;
|
|
24
|
+
type Arrow = DialogArrow.Props;
|
|
25
|
+
type Close = DialogClose.Props;
|
|
26
|
+
type Container = PopoverContainer.Props;
|
|
27
|
+
type Description = DialogDescription.Props;
|
|
28
|
+
type Title = DialogTitle.Props;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PopoverRoot } from "./root.js";
|
|
3
|
+
import { PopoverTrigger } from "./trigger.js";
|
|
4
|
+
import { DialogArrow } from "../dialog/arrow.js";
|
|
5
|
+
import { DialogClose } from "../dialog/close.js";
|
|
6
|
+
import { PopoverContainer } from "./container.js";
|
|
7
|
+
import { DialogDescription } from "../dialog/description.js";
|
|
8
|
+
import { DialogTitle } from "../dialog/title.js";
|
|
9
|
+
import { useDialog } from "../dialog/use-dialog.js";
|
|
10
|
+
export const Popover = (props) => _jsx(PopoverRoot, { ...props });
|
|
11
|
+
Popover.Trigger = PopoverTrigger;
|
|
12
|
+
Popover.Arrow = DialogArrow;
|
|
13
|
+
Popover.Close = DialogClose;
|
|
14
|
+
Popover.Container = PopoverContainer;
|
|
15
|
+
Popover.Description = DialogDescription;
|
|
16
|
+
Popover.Title = DialogTitle;
|
|
17
|
+
Popover.useControls = useDialog;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PropsWithChildren } from "react";
|
|
2
|
+
import { DialogRoot } from "../dialog/root.js";
|
|
3
|
+
export declare function PopoverRoot(props: PropsWithChildren<PopoverRoot.Props>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare namespace PopoverRoot {
|
|
5
|
+
type Props = DialogRoot.Props;
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import { DialogRoot } from "../dialog/root.js";
|
|
4
|
+
import { PopoverContext } from "./context.js";
|
|
5
|
+
export function PopoverRoot(props) {
|
|
6
|
+
const [trigger, setTrigger] = useState(null);
|
|
7
|
+
return (_jsx(PopoverContext.Provider, { value: useMemo(() => ({ setTrigger }), []), children: _jsx(DialogRoot, { ...props, anchor: props.anchor ?? trigger }) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DialogTrigger } from "../dialog/trigger.js";
|
|
2
|
+
export declare const PopoverTriggerBase: (props: DialogTrigger.Props, ref: DialogTrigger.Props["ref"]) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<Omit<DialogTrigger.Props, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export declare namespace PopoverTrigger {
|
|
5
|
+
type Props = DialogTrigger.Props;
|
|
6
|
+
type State = DialogTrigger.State;
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { DialogTrigger } from "../dialog/trigger.js";
|
|
4
|
+
import { usePopoverContext } from "./context.js";
|
|
5
|
+
import { useCombinedRefs } from "@1771technologies/lytenyte-core/internal";
|
|
6
|
+
export const PopoverTriggerBase = (props, ref) => {
|
|
7
|
+
const { setTrigger } = usePopoverContext();
|
|
8
|
+
const combined = useCombinedRefs(ref, setTrigger);
|
|
9
|
+
return _jsx(DialogTrigger, { ...props, ref: combined });
|
|
10
|
+
};
|
|
11
|
+
export const PopoverTrigger = forwardRef(PopoverTriggerBase);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
export declare const PillContainer: import("react").NamedExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare namespace PillContainer {
|
|
4
|
+
type Props = JSX.IntrinsicElements["div"];
|
|
5
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, memo, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { usePillRoot } from "./root.context.js";
|
|
4
|
+
import { usePillRow } from "./pill-row.context.js";
|
|
5
|
+
import { dragX, dragY, getDragData, useCombinedRefs, useSelector, } from "@1771technologies/lytenyte-core/internal";
|
|
6
|
+
import { getFocusables } from "@1771technologies/lytenyte-shared";
|
|
7
|
+
function ContainerBase(props, forwarded) {
|
|
8
|
+
const { setCloned, orientation, rows, movedRef } = usePillRoot();
|
|
9
|
+
const { row } = usePillRow();
|
|
10
|
+
const [over, setOver] = useState(false);
|
|
11
|
+
const x = useSelector(dragX);
|
|
12
|
+
const y = useSelector(dragY);
|
|
13
|
+
const [container, setContainer] = useState(null);
|
|
14
|
+
const wasOver = useRef(false);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!container)
|
|
17
|
+
return;
|
|
18
|
+
const ds = getDragData();
|
|
19
|
+
if (!ds?.pill?.data) {
|
|
20
|
+
setOver(false);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const { item: dragged, id } = ds.pill.data;
|
|
24
|
+
const bb = container.getBoundingClientRect();
|
|
25
|
+
const isOver = bb.left < x && bb.right > x && bb.top < y && bb.bottom > y;
|
|
26
|
+
// The current drag is from the current row.
|
|
27
|
+
if (id === row.id) {
|
|
28
|
+
movedRef.current = !isOver ? { id: row.id, pillId: dragged.id } : null;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const thisRow = rows.findIndex((x) => x.id === row.id);
|
|
32
|
+
const originalRow = rows[thisRow];
|
|
33
|
+
if (isOver) {
|
|
34
|
+
wasOver.current = true;
|
|
35
|
+
if (row.pills.find((x) => x.id === dragged.id))
|
|
36
|
+
return;
|
|
37
|
+
if (!row.accepts || !dragged.tags || dragged.tags.every((x) => !row.accepts?.includes(x)))
|
|
38
|
+
return;
|
|
39
|
+
setOver(true);
|
|
40
|
+
const thisRow = rows.findIndex((x) => x.id === row.id);
|
|
41
|
+
const originalRow = rows[thisRow];
|
|
42
|
+
const newPills = [...originalRow.pills, { ...dragged, __temp: true }];
|
|
43
|
+
setCloned((prev) => {
|
|
44
|
+
if (!prev)
|
|
45
|
+
throw new Error("Can't call drag function without cloning nodes.");
|
|
46
|
+
const newPill = { ...prev[thisRow] };
|
|
47
|
+
newPill.pills = newPills;
|
|
48
|
+
const newDef = [...prev];
|
|
49
|
+
newDef[thisRow] = newPill;
|
|
50
|
+
return newDef;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
if (wasOver.current) {
|
|
55
|
+
setCloned((prev) => {
|
|
56
|
+
if (!prev)
|
|
57
|
+
return prev;
|
|
58
|
+
const next = [...prev];
|
|
59
|
+
next[thisRow] = structuredClone(originalRow);
|
|
60
|
+
return next;
|
|
61
|
+
});
|
|
62
|
+
wasOver.current = false;
|
|
63
|
+
}
|
|
64
|
+
setOver(false);
|
|
65
|
+
// The original row has the dragged pill as an ID so we can safely skip it.
|
|
66
|
+
if (originalRow.pills.find((x) => x.id === dragged.id))
|
|
67
|
+
return;
|
|
68
|
+
if (!row.pills.find((x) => x.id === dragged.id))
|
|
69
|
+
return;
|
|
70
|
+
const newPills = row.pills.filter((x) => x.id !== dragged.id);
|
|
71
|
+
const newRow = { ...row, pills: newPills };
|
|
72
|
+
setCloned((prev) => {
|
|
73
|
+
if (!prev)
|
|
74
|
+
throw new Error("Can't call drag function without cloning nodes.");
|
|
75
|
+
const newDef = [...prev];
|
|
76
|
+
newDef[thisRow] = newRow;
|
|
77
|
+
return newDef;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}, [container, movedRef, over, row, rows, setCloned, x, y]);
|
|
81
|
+
const combined = useCombinedRefs(forwarded, setContainer);
|
|
82
|
+
const rtl = useRef(null);
|
|
83
|
+
return (_jsx("div", { ...props, ref: combined, "data-ln-over": over, "data-ln-orientation": orientation, "data-ln-pill-container": true, "data-ln-pill-type": row.type, tabIndex: 0, onKeyDown: (ev) => {
|
|
84
|
+
if (rtl.current == null) {
|
|
85
|
+
const dir = getComputedStyle(ev.currentTarget).direction;
|
|
86
|
+
rtl.current = dir === "rtl";
|
|
87
|
+
}
|
|
88
|
+
const start = rtl.current ? "ArrowRight" : "ArrowLeft";
|
|
89
|
+
const end = rtl.current ? "ArrowLeft" : "ArrowRight";
|
|
90
|
+
const next = orientation === "horizontal" ? end : "ArrowDown";
|
|
91
|
+
const prev = orientation === "horizontal" ? start : "ArrowUp";
|
|
92
|
+
if (ev.key === next) {
|
|
93
|
+
const focusables = getFocusables(ev.currentTarget);
|
|
94
|
+
if (!focusables.length)
|
|
95
|
+
return;
|
|
96
|
+
const active = focusables.indexOf(document.activeElement);
|
|
97
|
+
if (active === -1 || active === focusables.length - 1) {
|
|
98
|
+
focusables[0].focus();
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
focusables[active + 1].focus();
|
|
102
|
+
}
|
|
103
|
+
ev.preventDefault();
|
|
104
|
+
}
|
|
105
|
+
else if (ev.key === prev) {
|
|
106
|
+
const focusables = getFocusables(ev.currentTarget);
|
|
107
|
+
if (!focusables.length)
|
|
108
|
+
return;
|
|
109
|
+
const active = focusables.indexOf(document.activeElement);
|
|
110
|
+
if (active === -1 || active === 0) {
|
|
111
|
+
focusables.at(-1)?.focus();
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
focusables[active - 1].focus();
|
|
115
|
+
}
|
|
116
|
+
ev.preventDefault();
|
|
117
|
+
}
|
|
118
|
+
}, onDrop: (e) => {
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
e.stopPropagation();
|
|
121
|
+
}, onDragOver: (e) => {
|
|
122
|
+
e.dataTransfer.dropEffect = "move";
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
} }));
|
|
126
|
+
}
|
|
127
|
+
export const PillContainer = memo(forwardRef(ContainerBase));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import { type SlotComponent } from "../../hooks/use-slot/index.js";
|
|
3
|
+
import type { PillState } from "./types.js";
|
|
4
|
+
export declare const PillRowExpander: import("react").NamedExoticComponent<Omit<PillRowExpander.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare namespace PillRowExpander {
|
|
6
|
+
type Props = JSX.IntrinsicElements["div"] & {
|
|
7
|
+
readonly render?: SlotComponent<PillState>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, memo } from "react";
|
|
3
|
+
import { useSlot } from "../../hooks/use-slot/index.js";
|
|
4
|
+
import { usePillRow } from "./pill-row.context.js";
|
|
5
|
+
import { CollapseIcon, ExpandIcon, Icon } from "./icons.js";
|
|
6
|
+
function PillRowExpanderBase({ render, ...props }, forwarded) {
|
|
7
|
+
const { expandToggle, expanded, row } = usePillRow();
|
|
8
|
+
const expander = render ?? (_jsx("div", { "data-ln-pill-expander": true, children: _jsx("button", { "data-ln-button": "secondary", "data-ln-size": "md", "data-ln-expanded": expanded, "data-ln-icon": true, onClick: () => expandToggle(), children: _jsx(Icon, { children: expanded ? _jsx(CollapseIcon, {}) : _jsx(ExpandIcon, {}) }) }) }));
|
|
9
|
+
const slot = useSlot({
|
|
10
|
+
props: [props],
|
|
11
|
+
slot: expander,
|
|
12
|
+
ref: forwarded,
|
|
13
|
+
state: {
|
|
14
|
+
expanded,
|
|
15
|
+
expandToggle,
|
|
16
|
+
row,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
return slot;
|
|
20
|
+
}
|
|
21
|
+
export const PillRowExpander = memo(forwardRef(PillRowExpanderBase));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
export declare function Icon(props: JSX.IntrinsicElements["div"]): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
type Props = JSX.IntrinsicElements["svg"];
|
|
4
|
+
export declare const DragDots: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const Measure: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const RowGroups: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Columns: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const RowPivots: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const ColumnPivots: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ExpandIcon: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const CollapseIcon: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|