@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,1802 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
//#region node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
3
|
+
/**
|
|
4
|
+
* Custom positioning reference element.
|
|
5
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
6
|
+
*/
|
|
7
|
+
const sides = ["top", "right", "bottom", "left"];
|
|
8
|
+
const alignments = ["start", "end"];
|
|
9
|
+
const placements = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
10
|
+
const min = Math.min;
|
|
11
|
+
const max = Math.max;
|
|
12
|
+
const round = Math.round;
|
|
13
|
+
const floor = Math.floor;
|
|
14
|
+
const createCoords = (v) => ({
|
|
15
|
+
x: v,
|
|
16
|
+
y: v,
|
|
17
|
+
});
|
|
18
|
+
const oppositeSideMap = {
|
|
19
|
+
left: "right",
|
|
20
|
+
right: "left",
|
|
21
|
+
bottom: "top",
|
|
22
|
+
top: "bottom",
|
|
23
|
+
};
|
|
24
|
+
const oppositeAlignmentMap = {
|
|
25
|
+
start: "end",
|
|
26
|
+
end: "start",
|
|
27
|
+
};
|
|
28
|
+
function clamp(start, value, end) {
|
|
29
|
+
return max(start, min(value, end));
|
|
30
|
+
}
|
|
31
|
+
function evaluate(value, param) {
|
|
32
|
+
return typeof value === "function" ? value(param) : value;
|
|
33
|
+
}
|
|
34
|
+
function getSide(placement) {
|
|
35
|
+
return placement.split("-")[0];
|
|
36
|
+
}
|
|
37
|
+
function getAlignment(placement) {
|
|
38
|
+
return placement.split("-")[1];
|
|
39
|
+
}
|
|
40
|
+
function getOppositeAxis(axis) {
|
|
41
|
+
return axis === "x" ? "y" : "x";
|
|
42
|
+
}
|
|
43
|
+
function getAxisLength(axis) {
|
|
44
|
+
return axis === "y" ? "height" : "width";
|
|
45
|
+
}
|
|
46
|
+
const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
47
|
+
function getSideAxis(placement) {
|
|
48
|
+
return yAxisSides.has(getSide(placement)) ? "y" : "x";
|
|
49
|
+
}
|
|
50
|
+
function getAlignmentAxis(placement) {
|
|
51
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
52
|
+
}
|
|
53
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
54
|
+
if (rtl === void 0)
|
|
55
|
+
rtl = false;
|
|
56
|
+
const alignment = getAlignment(placement);
|
|
57
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
58
|
+
const length = getAxisLength(alignmentAxis);
|
|
59
|
+
let mainAlignmentSide = alignmentAxis === "x"
|
|
60
|
+
? alignment === (rtl ? "end" : "start")
|
|
61
|
+
? "right"
|
|
62
|
+
: "left"
|
|
63
|
+
: alignment === "start"
|
|
64
|
+
? "bottom"
|
|
65
|
+
: "top";
|
|
66
|
+
if (rects.reference[length] > rects.floating[length])
|
|
67
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
68
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
69
|
+
}
|
|
70
|
+
function getExpandedPlacements(placement) {
|
|
71
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
72
|
+
return [
|
|
73
|
+
getOppositeAlignmentPlacement(placement),
|
|
74
|
+
oppositePlacement,
|
|
75
|
+
getOppositeAlignmentPlacement(oppositePlacement),
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
79
|
+
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
80
|
+
}
|
|
81
|
+
const lrPlacement = ["left", "right"];
|
|
82
|
+
const rlPlacement = ["right", "left"];
|
|
83
|
+
const tbPlacement = ["top", "bottom"];
|
|
84
|
+
const btPlacement = ["bottom", "top"];
|
|
85
|
+
function getSideList(side, isStart, rtl) {
|
|
86
|
+
switch (side) {
|
|
87
|
+
case "top":
|
|
88
|
+
case "bottom":
|
|
89
|
+
if (rtl)
|
|
90
|
+
return isStart ? rlPlacement : lrPlacement;
|
|
91
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
92
|
+
case "left":
|
|
93
|
+
case "right":
|
|
94
|
+
return isStart ? tbPlacement : btPlacement;
|
|
95
|
+
default:
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
100
|
+
const alignment = getAlignment(placement);
|
|
101
|
+
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
102
|
+
if (alignment) {
|
|
103
|
+
list = list.map((side) => side + "-" + alignment);
|
|
104
|
+
if (flipAlignment)
|
|
105
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
106
|
+
}
|
|
107
|
+
return list;
|
|
108
|
+
}
|
|
109
|
+
function getOppositePlacement(placement) {
|
|
110
|
+
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
|
|
111
|
+
}
|
|
112
|
+
function expandPaddingObject(padding) {
|
|
113
|
+
return {
|
|
114
|
+
top: 0,
|
|
115
|
+
right: 0,
|
|
116
|
+
bottom: 0,
|
|
117
|
+
left: 0,
|
|
118
|
+
...padding,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function getPaddingObject(padding) {
|
|
122
|
+
return typeof padding !== "number"
|
|
123
|
+
? expandPaddingObject(padding)
|
|
124
|
+
: {
|
|
125
|
+
top: padding,
|
|
126
|
+
right: padding,
|
|
127
|
+
bottom: padding,
|
|
128
|
+
left: padding,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function rectToClientRect(rect) {
|
|
132
|
+
const { x, y, width, height } = rect;
|
|
133
|
+
return {
|
|
134
|
+
width,
|
|
135
|
+
height,
|
|
136
|
+
top: y,
|
|
137
|
+
left: x,
|
|
138
|
+
right: x + width,
|
|
139
|
+
bottom: y + height,
|
|
140
|
+
x,
|
|
141
|
+
y,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
146
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
147
|
+
let { reference, floating } = _ref;
|
|
148
|
+
const sideAxis = getSideAxis(placement);
|
|
149
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
150
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
151
|
+
const side = getSide(placement);
|
|
152
|
+
const isVertical = sideAxis === "y";
|
|
153
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
154
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
155
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
156
|
+
let coords;
|
|
157
|
+
switch (side) {
|
|
158
|
+
case "top":
|
|
159
|
+
coords = {
|
|
160
|
+
x: commonX,
|
|
161
|
+
y: reference.y - floating.height,
|
|
162
|
+
};
|
|
163
|
+
break;
|
|
164
|
+
case "bottom":
|
|
165
|
+
coords = {
|
|
166
|
+
x: commonX,
|
|
167
|
+
y: reference.y + reference.height,
|
|
168
|
+
};
|
|
169
|
+
break;
|
|
170
|
+
case "right":
|
|
171
|
+
coords = {
|
|
172
|
+
x: reference.x + reference.width,
|
|
173
|
+
y: commonY,
|
|
174
|
+
};
|
|
175
|
+
break;
|
|
176
|
+
case "left":
|
|
177
|
+
coords = {
|
|
178
|
+
x: reference.x - floating.width,
|
|
179
|
+
y: commonY,
|
|
180
|
+
};
|
|
181
|
+
break;
|
|
182
|
+
default:
|
|
183
|
+
coords = {
|
|
184
|
+
x: reference.x,
|
|
185
|
+
y: reference.y,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
switch (getAlignment(placement)) {
|
|
189
|
+
case "start":
|
|
190
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
191
|
+
break;
|
|
192
|
+
case "end":
|
|
193
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
return coords;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
200
|
+
* next to a given reference element.
|
|
201
|
+
*
|
|
202
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
203
|
+
* write one for the platform you are using Floating UI with.
|
|
204
|
+
*/
|
|
205
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
206
|
+
const { placement = "bottom", strategy = "absolute", middleware = [], platform: platform$1 } = config;
|
|
207
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
208
|
+
const rtl = await (platform$1.isRTL == null ? void 0 : platform$1.isRTL(floating));
|
|
209
|
+
let rects = await platform$1.getElementRects({
|
|
210
|
+
reference,
|
|
211
|
+
floating,
|
|
212
|
+
strategy,
|
|
213
|
+
});
|
|
214
|
+
let { x, y } = computeCoordsFromPlacement(rects, placement, rtl);
|
|
215
|
+
let statefulPlacement = placement;
|
|
216
|
+
let middlewareData = {};
|
|
217
|
+
let resetCount = 0;
|
|
218
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
219
|
+
const { name, fn } = validMiddleware[i];
|
|
220
|
+
const { x: nextX, y: nextY, data, reset, } = await fn({
|
|
221
|
+
x,
|
|
222
|
+
y,
|
|
223
|
+
initialPlacement: placement,
|
|
224
|
+
placement: statefulPlacement,
|
|
225
|
+
strategy,
|
|
226
|
+
middlewareData,
|
|
227
|
+
rects,
|
|
228
|
+
platform: platform$1,
|
|
229
|
+
elements: {
|
|
230
|
+
reference,
|
|
231
|
+
floating,
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
x = nextX != null ? nextX : x;
|
|
235
|
+
y = nextY != null ? nextY : y;
|
|
236
|
+
middlewareData = {
|
|
237
|
+
...middlewareData,
|
|
238
|
+
[name]: {
|
|
239
|
+
...middlewareData[name],
|
|
240
|
+
...data,
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
if (reset && resetCount <= 50) {
|
|
244
|
+
resetCount++;
|
|
245
|
+
if (typeof reset === "object") {
|
|
246
|
+
if (reset.placement)
|
|
247
|
+
statefulPlacement = reset.placement;
|
|
248
|
+
if (reset.rects)
|
|
249
|
+
rects =
|
|
250
|
+
reset.rects === true
|
|
251
|
+
? await platform$1.getElementRects({
|
|
252
|
+
reference,
|
|
253
|
+
floating,
|
|
254
|
+
strategy,
|
|
255
|
+
})
|
|
256
|
+
: reset.rects;
|
|
257
|
+
({ x, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
258
|
+
}
|
|
259
|
+
i = -1;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
x,
|
|
264
|
+
y,
|
|
265
|
+
placement: statefulPlacement,
|
|
266
|
+
strategy,
|
|
267
|
+
middlewareData,
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
272
|
+
* element is overflowing a given clipping boundary on each side.
|
|
273
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
274
|
+
* - negative = how many pixels left before it will overflow
|
|
275
|
+
* - 0 = lies flush with the boundary
|
|
276
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
277
|
+
*/
|
|
278
|
+
async function detectOverflow$1(state, options) {
|
|
279
|
+
var _await$platform$isEle;
|
|
280
|
+
if (options === void 0)
|
|
281
|
+
options = {};
|
|
282
|
+
const { x, y, platform: platform$1, rects, elements, strategy } = state;
|
|
283
|
+
const { boundary = "clippingAncestors", rootBoundary = "viewport", elementContext = "floating", altBoundary = false, padding = 0, } = evaluate(options, state);
|
|
284
|
+
const paddingObject = getPaddingObject(padding);
|
|
285
|
+
const element = elements[altBoundary ? (elementContext === "floating" ? "reference" : "floating") : elementContext];
|
|
286
|
+
const clippingClientRect = rectToClientRect(await platform$1.getClippingRect({
|
|
287
|
+
element: ((_await$platform$isEle = await (platform$1.isElement == null
|
|
288
|
+
? void 0
|
|
289
|
+
: platform$1.isElement(element))) != null
|
|
290
|
+
? _await$platform$isEle
|
|
291
|
+
: true)
|
|
292
|
+
? element
|
|
293
|
+
: element.contextElement ||
|
|
294
|
+
(await (platform$1.getDocumentElement == null
|
|
295
|
+
? void 0
|
|
296
|
+
: platform$1.getDocumentElement(elements.floating))),
|
|
297
|
+
boundary,
|
|
298
|
+
rootBoundary,
|
|
299
|
+
strategy,
|
|
300
|
+
}));
|
|
301
|
+
const rect = elementContext === "floating"
|
|
302
|
+
? {
|
|
303
|
+
x,
|
|
304
|
+
y,
|
|
305
|
+
width: rects.floating.width,
|
|
306
|
+
height: rects.floating.height,
|
|
307
|
+
}
|
|
308
|
+
: rects.reference;
|
|
309
|
+
const offsetParent = await (platform$1.getOffsetParent == null
|
|
310
|
+
? void 0
|
|
311
|
+
: platform$1.getOffsetParent(elements.floating));
|
|
312
|
+
const offsetScale = (await (platform$1.isElement == null ? void 0 : platform$1.isElement(offsetParent)))
|
|
313
|
+
? (await (platform$1.getScale == null ? void 0 : platform$1.getScale(offsetParent))) || {
|
|
314
|
+
x: 1,
|
|
315
|
+
y: 1,
|
|
316
|
+
}
|
|
317
|
+
: {
|
|
318
|
+
x: 1,
|
|
319
|
+
y: 1,
|
|
320
|
+
};
|
|
321
|
+
const elementClientRect = rectToClientRect(platform$1.convertOffsetParentRelativeRectToViewportRelativeRect
|
|
322
|
+
? await platform$1.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
323
|
+
elements,
|
|
324
|
+
rect,
|
|
325
|
+
offsetParent,
|
|
326
|
+
strategy,
|
|
327
|
+
})
|
|
328
|
+
: rect);
|
|
329
|
+
return {
|
|
330
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
331
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
332
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
333
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Provides data to position an inner element of the floating element so that it
|
|
338
|
+
* appears centered to the reference element.
|
|
339
|
+
* @see https://floating-ui.com/docs/arrow
|
|
340
|
+
*/
|
|
341
|
+
const arrow$1 = (options) => ({
|
|
342
|
+
name: "arrow",
|
|
343
|
+
options,
|
|
344
|
+
async fn(state) {
|
|
345
|
+
const { x, y, placement, rects, platform: platform$1, elements, middlewareData } = state;
|
|
346
|
+
const { element, padding = 0 } = evaluate(options, state) || {};
|
|
347
|
+
if (element == null)
|
|
348
|
+
return {};
|
|
349
|
+
const paddingObject = getPaddingObject(padding);
|
|
350
|
+
const coords = {
|
|
351
|
+
x,
|
|
352
|
+
y,
|
|
353
|
+
};
|
|
354
|
+
const axis = getAlignmentAxis(placement);
|
|
355
|
+
const length = getAxisLength(axis);
|
|
356
|
+
const arrowDimensions = await platform$1.getDimensions(element);
|
|
357
|
+
const isYAxis = axis === "y";
|
|
358
|
+
const minProp = isYAxis ? "top" : "left";
|
|
359
|
+
const maxProp = isYAxis ? "bottom" : "right";
|
|
360
|
+
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
361
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
362
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
363
|
+
const arrowOffsetParent = await (platform$1.getOffsetParent == null
|
|
364
|
+
? void 0
|
|
365
|
+
: platform$1.getOffsetParent(element));
|
|
366
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
367
|
+
if (!clientSize ||
|
|
368
|
+
!(await (platform$1.isElement == null ? void 0 : platform$1.isElement(arrowOffsetParent))))
|
|
369
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
370
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
371
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
372
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
373
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
374
|
+
const min$1 = minPadding;
|
|
375
|
+
const max$1 = clientSize - arrowDimensions[length] - maxPadding;
|
|
376
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
377
|
+
const offset$2 = clamp(min$1, center, max$1);
|
|
378
|
+
const shouldAddOffset = !middlewareData.arrow &&
|
|
379
|
+
getAlignment(placement) != null &&
|
|
380
|
+
center !== offset$2 &&
|
|
381
|
+
rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 <
|
|
382
|
+
0;
|
|
383
|
+
const alignmentOffset = shouldAddOffset ? (center < min$1 ? center - min$1 : center - max$1) : 0;
|
|
384
|
+
return {
|
|
385
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
386
|
+
data: {
|
|
387
|
+
[axis]: offset$2,
|
|
388
|
+
centerOffset: center - offset$2 - alignmentOffset,
|
|
389
|
+
...(shouldAddOffset && { alignmentOffset }),
|
|
390
|
+
},
|
|
391
|
+
reset: shouldAddOffset,
|
|
392
|
+
};
|
|
393
|
+
},
|
|
394
|
+
});
|
|
395
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
396
|
+
return (alignment
|
|
397
|
+
? [
|
|
398
|
+
...allowedPlacements.filter((placement) => getAlignment(placement) === alignment),
|
|
399
|
+
...allowedPlacements.filter((placement) => getAlignment(placement) !== alignment),
|
|
400
|
+
]
|
|
401
|
+
: allowedPlacements.filter((placement) => getSide(placement) === placement)).filter((placement) => {
|
|
402
|
+
if (alignment)
|
|
403
|
+
return (getAlignment(placement) === alignment ||
|
|
404
|
+
(autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false));
|
|
405
|
+
return true;
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
410
|
+
* that has the most space available automatically, without needing to specify a
|
|
411
|
+
* preferred placement. Alternative to `flip`.
|
|
412
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
413
|
+
*/
|
|
414
|
+
const autoPlacement$1 = function (options) {
|
|
415
|
+
if (options === void 0)
|
|
416
|
+
options = {};
|
|
417
|
+
return {
|
|
418
|
+
name: "autoPlacement",
|
|
419
|
+
options,
|
|
420
|
+
async fn(state) {
|
|
421
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
|
422
|
+
const { rects, middlewareData, placement, platform: platform$1, elements } = state;
|
|
423
|
+
const { crossAxis = false, alignment, allowedPlacements = placements, autoAlignment = true, ...detectOverflowOptions } = evaluate(options, state);
|
|
424
|
+
const placements$1 = alignment !== void 0 || allowedPlacements === placements
|
|
425
|
+
? getPlacementList(alignment || null, autoAlignment, allowedPlacements)
|
|
426
|
+
: allowedPlacements;
|
|
427
|
+
const overflow = await detectOverflow$1(state, detectOverflowOptions);
|
|
428
|
+
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null
|
|
429
|
+
? void 0
|
|
430
|
+
: _middlewareData$autoP.index) || 0;
|
|
431
|
+
const currentPlacement = placements$1[currentIndex];
|
|
432
|
+
if (currentPlacement == null)
|
|
433
|
+
return {};
|
|
434
|
+
const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform$1.isRTL == null ? void 0 : platform$1.isRTL(elements.floating)));
|
|
435
|
+
if (placement !== currentPlacement)
|
|
436
|
+
return { reset: { placement: placements$1[0] } };
|
|
437
|
+
const currentOverflows = [
|
|
438
|
+
overflow[getSide(currentPlacement)],
|
|
439
|
+
overflow[alignmentSides[0]],
|
|
440
|
+
overflow[alignmentSides[1]],
|
|
441
|
+
];
|
|
442
|
+
const allOverflows = [
|
|
443
|
+
...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null
|
|
444
|
+
? void 0
|
|
445
|
+
: _middlewareData$autoP2.overflows) || []),
|
|
446
|
+
{
|
|
447
|
+
placement: currentPlacement,
|
|
448
|
+
overflows: currentOverflows,
|
|
449
|
+
},
|
|
450
|
+
];
|
|
451
|
+
const nextPlacement = placements$1[currentIndex + 1];
|
|
452
|
+
if (nextPlacement)
|
|
453
|
+
return {
|
|
454
|
+
data: {
|
|
455
|
+
index: currentIndex + 1,
|
|
456
|
+
overflows: allOverflows,
|
|
457
|
+
},
|
|
458
|
+
reset: { placement: nextPlacement },
|
|
459
|
+
};
|
|
460
|
+
const placementsSortedByMostSpace = allOverflows
|
|
461
|
+
.map((d) => {
|
|
462
|
+
const alignment$1 = getAlignment(d.placement);
|
|
463
|
+
return [
|
|
464
|
+
d.placement,
|
|
465
|
+
alignment$1 && crossAxis
|
|
466
|
+
? d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0)
|
|
467
|
+
: d.overflows[0],
|
|
468
|
+
d.overflows,
|
|
469
|
+
];
|
|
470
|
+
})
|
|
471
|
+
.sort((a, b) => a[1] - b[1]);
|
|
472
|
+
const resetPlacement = ((_placementsThatFitOnE = placementsSortedByMostSpace.filter((d) => d[2].slice(0, getAlignment(d[0]) ? 2 : 3).every((v) => v <= 0))[0]) == null
|
|
473
|
+
? void 0
|
|
474
|
+
: _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
475
|
+
if (resetPlacement !== placement)
|
|
476
|
+
return {
|
|
477
|
+
data: {
|
|
478
|
+
index: currentIndex + 1,
|
|
479
|
+
overflows: allOverflows,
|
|
480
|
+
},
|
|
481
|
+
reset: { placement: resetPlacement },
|
|
482
|
+
};
|
|
483
|
+
return {};
|
|
484
|
+
},
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
/**
|
|
488
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
489
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
490
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
491
|
+
* @see https://floating-ui.com/docs/flip
|
|
492
|
+
*/
|
|
493
|
+
const flip$1 = function (options) {
|
|
494
|
+
if (options === void 0)
|
|
495
|
+
options = {};
|
|
496
|
+
return {
|
|
497
|
+
name: "flip",
|
|
498
|
+
options,
|
|
499
|
+
async fn(state) {
|
|
500
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
501
|
+
const { placement, middlewareData, rects, initialPlacement, platform: platform$1, elements } = state;
|
|
502
|
+
const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = "bestFit", fallbackAxisSideDirection = "none", flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state);
|
|
503
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)
|
|
504
|
+
return {};
|
|
505
|
+
const side = getSide(placement);
|
|
506
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
507
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
508
|
+
const rtl = await (platform$1.isRTL == null ? void 0 : platform$1.isRTL(elements.floating));
|
|
509
|
+
const fallbackPlacements = specifiedFallbackPlacements ||
|
|
510
|
+
(isBasePlacement || !flipAlignment
|
|
511
|
+
? [getOppositePlacement(initialPlacement)]
|
|
512
|
+
: getExpandedPlacements(initialPlacement));
|
|
513
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
514
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection)
|
|
515
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
516
|
+
const placements$1 = [initialPlacement, ...fallbackPlacements];
|
|
517
|
+
const overflow = await detectOverflow$1(state, detectOverflowOptions);
|
|
518
|
+
const overflows = [];
|
|
519
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) ||
|
|
520
|
+
[];
|
|
521
|
+
if (checkMainAxis)
|
|
522
|
+
overflows.push(overflow[side]);
|
|
523
|
+
if (checkCrossAxis) {
|
|
524
|
+
const sides$1 = getAlignmentSides(placement, rects, rtl);
|
|
525
|
+
overflows.push(overflow[sides$1[0]], overflow[sides$1[1]]);
|
|
526
|
+
}
|
|
527
|
+
overflowsData = [
|
|
528
|
+
...overflowsData,
|
|
529
|
+
{
|
|
530
|
+
placement,
|
|
531
|
+
overflows,
|
|
532
|
+
},
|
|
533
|
+
];
|
|
534
|
+
if (!overflows.every((side$1) => side$1 <= 0)) {
|
|
535
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
536
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) ||
|
|
537
|
+
0) + 1;
|
|
538
|
+
const nextPlacement = placements$1[nextIndex];
|
|
539
|
+
if (nextPlacement) {
|
|
540
|
+
if (!(checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false) ||
|
|
541
|
+
overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true))
|
|
542
|
+
return {
|
|
543
|
+
data: {
|
|
544
|
+
index: nextIndex,
|
|
545
|
+
overflows: overflowsData,
|
|
546
|
+
},
|
|
547
|
+
reset: { placement: nextPlacement },
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
let resetPlacement = (_overflowsData$filter = overflowsData
|
|
551
|
+
.filter((d) => d.overflows[0] <= 0)
|
|
552
|
+
.sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null
|
|
553
|
+
? void 0
|
|
554
|
+
: _overflowsData$filter.placement;
|
|
555
|
+
if (!resetPlacement)
|
|
556
|
+
switch (fallbackStrategy) {
|
|
557
|
+
case "bestFit": {
|
|
558
|
+
var _overflowsData$filter2;
|
|
559
|
+
const placement$1 = (_overflowsData$filter2 = overflowsData
|
|
560
|
+
.filter((d) => {
|
|
561
|
+
if (hasFallbackAxisSideDirection) {
|
|
562
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
563
|
+
return currentSideAxis === initialSideAxis || currentSideAxis === "y";
|
|
564
|
+
}
|
|
565
|
+
return true;
|
|
566
|
+
})
|
|
567
|
+
.map((d) => [
|
|
568
|
+
d.placement,
|
|
569
|
+
d.overflows
|
|
570
|
+
.filter((overflow$1) => overflow$1 > 0)
|
|
571
|
+
.reduce((acc, overflow$1) => acc + overflow$1, 0),
|
|
572
|
+
])
|
|
573
|
+
.sort((a, b) => a[1] - b[1])[0]) == null
|
|
574
|
+
? void 0
|
|
575
|
+
: _overflowsData$filter2[0];
|
|
576
|
+
if (placement$1)
|
|
577
|
+
resetPlacement = placement$1;
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
case "initialPlacement":
|
|
581
|
+
resetPlacement = initialPlacement;
|
|
582
|
+
break;
|
|
583
|
+
}
|
|
584
|
+
if (placement !== resetPlacement)
|
|
585
|
+
return { reset: { placement: resetPlacement } };
|
|
586
|
+
}
|
|
587
|
+
return {};
|
|
588
|
+
},
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
function getSideOffsets(overflow, rect) {
|
|
592
|
+
return {
|
|
593
|
+
top: overflow.top - rect.height,
|
|
594
|
+
right: overflow.right - rect.width,
|
|
595
|
+
bottom: overflow.bottom - rect.height,
|
|
596
|
+
left: overflow.left - rect.width,
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
function isAnySideFullyClipped(overflow) {
|
|
600
|
+
return sides.some((side) => overflow[side] >= 0);
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
604
|
+
* when it is not in the same clipping context as the reference element.
|
|
605
|
+
* @see https://floating-ui.com/docs/hide
|
|
606
|
+
*/
|
|
607
|
+
const hide$1 = function (options) {
|
|
608
|
+
if (options === void 0)
|
|
609
|
+
options = {};
|
|
610
|
+
return {
|
|
611
|
+
name: "hide",
|
|
612
|
+
options,
|
|
613
|
+
async fn(state) {
|
|
614
|
+
const { rects } = state;
|
|
615
|
+
const { strategy = "referenceHidden", ...detectOverflowOptions } = evaluate(options, state);
|
|
616
|
+
switch (strategy) {
|
|
617
|
+
case "referenceHidden": {
|
|
618
|
+
const offsets = getSideOffsets(await detectOverflow$1(state, {
|
|
619
|
+
...detectOverflowOptions,
|
|
620
|
+
elementContext: "reference",
|
|
621
|
+
}), rects.reference);
|
|
622
|
+
return {
|
|
623
|
+
data: {
|
|
624
|
+
referenceHiddenOffsets: offsets,
|
|
625
|
+
referenceHidden: isAnySideFullyClipped(offsets),
|
|
626
|
+
},
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
case "escaped": {
|
|
630
|
+
const offsets = getSideOffsets(await detectOverflow$1(state, {
|
|
631
|
+
...detectOverflowOptions,
|
|
632
|
+
altBoundary: true,
|
|
633
|
+
}), rects.floating);
|
|
634
|
+
return {
|
|
635
|
+
data: {
|
|
636
|
+
escapedOffsets: offsets,
|
|
637
|
+
escaped: isAnySideFullyClipped(offsets),
|
|
638
|
+
},
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
default:
|
|
642
|
+
return {};
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
function getBoundingRect(rects) {
|
|
648
|
+
const minX = min(...rects.map((rect) => rect.left));
|
|
649
|
+
const minY = min(...rects.map((rect) => rect.top));
|
|
650
|
+
const maxX = max(...rects.map((rect) => rect.right));
|
|
651
|
+
const maxY = max(...rects.map((rect) => rect.bottom));
|
|
652
|
+
return {
|
|
653
|
+
x: minX,
|
|
654
|
+
y: minY,
|
|
655
|
+
width: maxX - minX,
|
|
656
|
+
height: maxY - minY,
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
function getRectsByLine(rects) {
|
|
660
|
+
const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
|
|
661
|
+
const groups = [];
|
|
662
|
+
let prevRect = null;
|
|
663
|
+
for (let i = 0; i < sortedRects.length; i++) {
|
|
664
|
+
const rect = sortedRects[i];
|
|
665
|
+
if (!prevRect || rect.y - prevRect.y > prevRect.height / 2)
|
|
666
|
+
groups.push([rect]);
|
|
667
|
+
else
|
|
668
|
+
groups[groups.length - 1].push(rect);
|
|
669
|
+
prevRect = rect;
|
|
670
|
+
}
|
|
671
|
+
return groups.map((rect) => rectToClientRect(getBoundingRect(rect)));
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Provides improved positioning for inline reference elements that can span
|
|
675
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
676
|
+
* @see https://floating-ui.com/docs/inline
|
|
677
|
+
*/
|
|
678
|
+
const inline$1 = function (options) {
|
|
679
|
+
if (options === void 0)
|
|
680
|
+
options = {};
|
|
681
|
+
return {
|
|
682
|
+
name: "inline",
|
|
683
|
+
options,
|
|
684
|
+
async fn(state) {
|
|
685
|
+
const { placement, elements, rects, platform: platform$1, strategy } = state;
|
|
686
|
+
const { padding = 2, x, y } = evaluate(options, state);
|
|
687
|
+
const nativeClientRects = Array.from((await (platform$1.getClientRects == null
|
|
688
|
+
? void 0
|
|
689
|
+
: platform$1.getClientRects(elements.reference))) || []);
|
|
690
|
+
const clientRects = getRectsByLine(nativeClientRects);
|
|
691
|
+
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
692
|
+
const paddingObject = getPaddingObject(padding);
|
|
693
|
+
function getBoundingClientRect$1() {
|
|
694
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null)
|
|
695
|
+
return (clientRects.find((rect) => x > rect.left - paddingObject.left &&
|
|
696
|
+
x < rect.right + paddingObject.right &&
|
|
697
|
+
y > rect.top - paddingObject.top &&
|
|
698
|
+
y < rect.bottom + paddingObject.bottom) || fallback);
|
|
699
|
+
if (clientRects.length >= 2) {
|
|
700
|
+
if (getSideAxis(placement) === "y") {
|
|
701
|
+
const firstRect = clientRects[0];
|
|
702
|
+
const lastRect = clientRects[clientRects.length - 1];
|
|
703
|
+
const isTop = getSide(placement) === "top";
|
|
704
|
+
const top$1 = firstRect.top;
|
|
705
|
+
const bottom$1 = lastRect.bottom;
|
|
706
|
+
const left$1 = isTop ? firstRect.left : lastRect.left;
|
|
707
|
+
const right$1 = isTop ? firstRect.right : lastRect.right;
|
|
708
|
+
return {
|
|
709
|
+
top: top$1,
|
|
710
|
+
bottom: bottom$1,
|
|
711
|
+
left: left$1,
|
|
712
|
+
right: right$1,
|
|
713
|
+
width: right$1 - left$1,
|
|
714
|
+
height: bottom$1 - top$1,
|
|
715
|
+
x: left$1,
|
|
716
|
+
y: top$1,
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
const isLeftSide = getSide(placement) === "left";
|
|
720
|
+
const maxRight = max(...clientRects.map((rect) => rect.right));
|
|
721
|
+
const minLeft = min(...clientRects.map((rect) => rect.left));
|
|
722
|
+
const measureRects = clientRects.filter((rect) => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
723
|
+
const top = measureRects[0].top;
|
|
724
|
+
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
725
|
+
const left = minLeft;
|
|
726
|
+
const right = maxRight;
|
|
727
|
+
return {
|
|
728
|
+
top,
|
|
729
|
+
bottom,
|
|
730
|
+
left,
|
|
731
|
+
right,
|
|
732
|
+
width: right - left,
|
|
733
|
+
height: bottom - top,
|
|
734
|
+
x: left,
|
|
735
|
+
y: top,
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
return fallback;
|
|
739
|
+
}
|
|
740
|
+
const resetRects = await platform$1.getElementRects({
|
|
741
|
+
reference: { getBoundingClientRect: getBoundingClientRect$1 },
|
|
742
|
+
floating: elements.floating,
|
|
743
|
+
strategy,
|
|
744
|
+
});
|
|
745
|
+
if (rects.reference.x !== resetRects.reference.x ||
|
|
746
|
+
rects.reference.y !== resetRects.reference.y ||
|
|
747
|
+
rects.reference.width !== resetRects.reference.width ||
|
|
748
|
+
rects.reference.height !== resetRects.reference.height)
|
|
749
|
+
return { reset: { rects: resetRects } };
|
|
750
|
+
return {};
|
|
751
|
+
},
|
|
752
|
+
};
|
|
753
|
+
};
|
|
754
|
+
const originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
755
|
+
async function convertValueToCoords(state, options) {
|
|
756
|
+
const { placement, platform: platform$1, elements } = state;
|
|
757
|
+
const rtl = await (platform$1.isRTL == null ? void 0 : platform$1.isRTL(elements.floating));
|
|
758
|
+
const side = getSide(placement);
|
|
759
|
+
const alignment = getAlignment(placement);
|
|
760
|
+
const isVertical = getSideAxis(placement) === "y";
|
|
761
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
762
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
763
|
+
const rawValue = evaluate(options, state);
|
|
764
|
+
let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === "number"
|
|
765
|
+
? {
|
|
766
|
+
mainAxis: rawValue,
|
|
767
|
+
crossAxis: 0,
|
|
768
|
+
alignmentAxis: null,
|
|
769
|
+
}
|
|
770
|
+
: {
|
|
771
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
772
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
773
|
+
alignmentAxis: rawValue.alignmentAxis,
|
|
774
|
+
};
|
|
775
|
+
if (alignment && typeof alignmentAxis === "number")
|
|
776
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
777
|
+
return isVertical
|
|
778
|
+
? {
|
|
779
|
+
x: crossAxis * crossAxisMulti,
|
|
780
|
+
y: mainAxis * mainAxisMulti,
|
|
781
|
+
}
|
|
782
|
+
: {
|
|
783
|
+
x: mainAxis * mainAxisMulti,
|
|
784
|
+
y: crossAxis * crossAxisMulti,
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Modifies the placement by translating the floating element along the
|
|
789
|
+
* specified axes.
|
|
790
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
791
|
+
* object may be passed.
|
|
792
|
+
* @see https://floating-ui.com/docs/offset
|
|
793
|
+
*/
|
|
794
|
+
const offset$1 = function (options) {
|
|
795
|
+
if (options === void 0)
|
|
796
|
+
options = 0;
|
|
797
|
+
return {
|
|
798
|
+
name: "offset",
|
|
799
|
+
options,
|
|
800
|
+
async fn(state) {
|
|
801
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
802
|
+
const { x, y, placement, middlewareData } = state;
|
|
803
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
804
|
+
if (placement ===
|
|
805
|
+
((_middlewareData$offse = middlewareData.offset) == null
|
|
806
|
+
? void 0
|
|
807
|
+
: _middlewareData$offse.placement) &&
|
|
808
|
+
(_middlewareData$arrow = middlewareData.arrow) != null &&
|
|
809
|
+
_middlewareData$arrow.alignmentOffset)
|
|
810
|
+
return {};
|
|
811
|
+
return {
|
|
812
|
+
x: x + diffCoords.x,
|
|
813
|
+
y: y + diffCoords.y,
|
|
814
|
+
data: {
|
|
815
|
+
...diffCoords,
|
|
816
|
+
placement,
|
|
817
|
+
},
|
|
818
|
+
};
|
|
819
|
+
},
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
/**
|
|
823
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
824
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
825
|
+
* @see https://floating-ui.com/docs/shift
|
|
826
|
+
*/
|
|
827
|
+
const shift$1 = function (options) {
|
|
828
|
+
if (options === void 0)
|
|
829
|
+
options = {};
|
|
830
|
+
return {
|
|
831
|
+
name: "shift",
|
|
832
|
+
options,
|
|
833
|
+
async fn(state) {
|
|
834
|
+
const { x, y, placement } = state;
|
|
835
|
+
const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = {
|
|
836
|
+
fn: (_ref) => {
|
|
837
|
+
let { x: x$1, y: y$1 } = _ref;
|
|
838
|
+
return {
|
|
839
|
+
x: x$1,
|
|
840
|
+
y: y$1,
|
|
841
|
+
};
|
|
842
|
+
},
|
|
843
|
+
}, ...detectOverflowOptions } = evaluate(options, state);
|
|
844
|
+
const coords = {
|
|
845
|
+
x,
|
|
846
|
+
y,
|
|
847
|
+
};
|
|
848
|
+
const overflow = await detectOverflow$1(state, detectOverflowOptions);
|
|
849
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
850
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
851
|
+
let mainAxisCoord = coords[mainAxis];
|
|
852
|
+
let crossAxisCoord = coords[crossAxis];
|
|
853
|
+
if (checkMainAxis) {
|
|
854
|
+
const minSide = mainAxis === "y" ? "top" : "left";
|
|
855
|
+
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
856
|
+
const min$1 = mainAxisCoord + overflow[minSide];
|
|
857
|
+
const max$1 = mainAxisCoord - overflow[maxSide];
|
|
858
|
+
mainAxisCoord = clamp(min$1, mainAxisCoord, max$1);
|
|
859
|
+
}
|
|
860
|
+
if (checkCrossAxis) {
|
|
861
|
+
const minSide = crossAxis === "y" ? "top" : "left";
|
|
862
|
+
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
863
|
+
const min$1 = crossAxisCoord + overflow[minSide];
|
|
864
|
+
const max$1 = crossAxisCoord - overflow[maxSide];
|
|
865
|
+
crossAxisCoord = clamp(min$1, crossAxisCoord, max$1);
|
|
866
|
+
}
|
|
867
|
+
const limitedCoords = limiter.fn({
|
|
868
|
+
...state,
|
|
869
|
+
[mainAxis]: mainAxisCoord,
|
|
870
|
+
[crossAxis]: crossAxisCoord,
|
|
871
|
+
});
|
|
872
|
+
return {
|
|
873
|
+
...limitedCoords,
|
|
874
|
+
data: {
|
|
875
|
+
x: limitedCoords.x - x,
|
|
876
|
+
y: limitedCoords.y - y,
|
|
877
|
+
enabled: {
|
|
878
|
+
[mainAxis]: checkMainAxis,
|
|
879
|
+
[crossAxis]: checkCrossAxis,
|
|
880
|
+
},
|
|
881
|
+
},
|
|
882
|
+
};
|
|
883
|
+
},
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
888
|
+
*/
|
|
889
|
+
const limitShift$1 = function (options) {
|
|
890
|
+
if (options === void 0)
|
|
891
|
+
options = {};
|
|
892
|
+
return {
|
|
893
|
+
options,
|
|
894
|
+
fn(state) {
|
|
895
|
+
const { x, y, placement, rects, middlewareData } = state;
|
|
896
|
+
const { offset: offset$2 = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, } = evaluate(options, state);
|
|
897
|
+
const coords = {
|
|
898
|
+
x,
|
|
899
|
+
y,
|
|
900
|
+
};
|
|
901
|
+
const crossAxis = getSideAxis(placement);
|
|
902
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
903
|
+
let mainAxisCoord = coords[mainAxis];
|
|
904
|
+
let crossAxisCoord = coords[crossAxis];
|
|
905
|
+
const rawOffset = evaluate(offset$2, state);
|
|
906
|
+
const computedOffset = typeof rawOffset === "number"
|
|
907
|
+
? {
|
|
908
|
+
mainAxis: rawOffset,
|
|
909
|
+
crossAxis: 0,
|
|
910
|
+
}
|
|
911
|
+
: {
|
|
912
|
+
mainAxis: 0,
|
|
913
|
+
crossAxis: 0,
|
|
914
|
+
...rawOffset,
|
|
915
|
+
};
|
|
916
|
+
if (checkMainAxis) {
|
|
917
|
+
const len = mainAxis === "y" ? "height" : "width";
|
|
918
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
919
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
920
|
+
if (mainAxisCoord < limitMin)
|
|
921
|
+
mainAxisCoord = limitMin;
|
|
922
|
+
else if (mainAxisCoord > limitMax)
|
|
923
|
+
mainAxisCoord = limitMax;
|
|
924
|
+
}
|
|
925
|
+
if (checkCrossAxis) {
|
|
926
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
927
|
+
const len = mainAxis === "y" ? "width" : "height";
|
|
928
|
+
const isOriginSide = originSides.has(getSide(placement));
|
|
929
|
+
const limitMin = rects.reference[crossAxis] -
|
|
930
|
+
rects.floating[len] +
|
|
931
|
+
(isOriginSide
|
|
932
|
+
? ((_middlewareData$offse = middlewareData.offset) == null
|
|
933
|
+
? void 0
|
|
934
|
+
: _middlewareData$offse[crossAxis]) || 0
|
|
935
|
+
: 0) +
|
|
936
|
+
(isOriginSide ? 0 : computedOffset.crossAxis);
|
|
937
|
+
const limitMax = rects.reference[crossAxis] +
|
|
938
|
+
rects.reference[len] +
|
|
939
|
+
(isOriginSide
|
|
940
|
+
? 0
|
|
941
|
+
: ((_middlewareData$offse2 = middlewareData.offset) == null
|
|
942
|
+
? void 0
|
|
943
|
+
: _middlewareData$offse2[crossAxis]) || 0) -
|
|
944
|
+
(isOriginSide ? computedOffset.crossAxis : 0);
|
|
945
|
+
if (crossAxisCoord < limitMin)
|
|
946
|
+
crossAxisCoord = limitMin;
|
|
947
|
+
else if (crossAxisCoord > limitMax)
|
|
948
|
+
crossAxisCoord = limitMax;
|
|
949
|
+
}
|
|
950
|
+
return {
|
|
951
|
+
[mainAxis]: mainAxisCoord,
|
|
952
|
+
[crossAxis]: crossAxisCoord,
|
|
953
|
+
};
|
|
954
|
+
},
|
|
955
|
+
};
|
|
956
|
+
};
|
|
957
|
+
/**
|
|
958
|
+
* Provides data that allows you to change the size of the floating element —
|
|
959
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
960
|
+
* width of the reference element.
|
|
961
|
+
* @see https://floating-ui.com/docs/size
|
|
962
|
+
*/
|
|
963
|
+
const size$1 = function (options) {
|
|
964
|
+
if (options === void 0)
|
|
965
|
+
options = {};
|
|
966
|
+
return {
|
|
967
|
+
name: "size",
|
|
968
|
+
options,
|
|
969
|
+
async fn(state) {
|
|
970
|
+
var _state$middlewareData, _state$middlewareData2;
|
|
971
|
+
const { placement, rects, platform: platform$1, elements } = state;
|
|
972
|
+
const { apply = () => { }, ...detectOverflowOptions } = evaluate(options, state);
|
|
973
|
+
const overflow = await detectOverflow$1(state, detectOverflowOptions);
|
|
974
|
+
const side = getSide(placement);
|
|
975
|
+
const alignment = getAlignment(placement);
|
|
976
|
+
const isYAxis = getSideAxis(placement) === "y";
|
|
977
|
+
const { width, height } = rects.floating;
|
|
978
|
+
let heightSide;
|
|
979
|
+
let widthSide;
|
|
980
|
+
if (side === "top" || side === "bottom") {
|
|
981
|
+
heightSide = side;
|
|
982
|
+
widthSide =
|
|
983
|
+
alignment ===
|
|
984
|
+
((await (platform$1.isRTL == null ? void 0 : platform$1.isRTL(elements.floating)))
|
|
985
|
+
? "start"
|
|
986
|
+
: "end")
|
|
987
|
+
? "left"
|
|
988
|
+
: "right";
|
|
989
|
+
}
|
|
990
|
+
else {
|
|
991
|
+
widthSide = side;
|
|
992
|
+
heightSide = alignment === "end" ? "top" : "bottom";
|
|
993
|
+
}
|
|
994
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
995
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
996
|
+
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
997
|
+
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
998
|
+
const noShift = !state.middlewareData.shift;
|
|
999
|
+
let availableHeight = overflowAvailableHeight;
|
|
1000
|
+
let availableWidth = overflowAvailableWidth;
|
|
1001
|
+
if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x)
|
|
1002
|
+
availableWidth = maximumClippingWidth;
|
|
1003
|
+
if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y)
|
|
1004
|
+
availableHeight = maximumClippingHeight;
|
|
1005
|
+
if (noShift && !alignment) {
|
|
1006
|
+
const xMin = max(overflow.left, 0);
|
|
1007
|
+
const xMax = max(overflow.right, 0);
|
|
1008
|
+
const yMin = max(overflow.top, 0);
|
|
1009
|
+
const yMax = max(overflow.bottom, 0);
|
|
1010
|
+
if (isYAxis)
|
|
1011
|
+
availableWidth =
|
|
1012
|
+
width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
1013
|
+
else
|
|
1014
|
+
availableHeight =
|
|
1015
|
+
height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
1016
|
+
}
|
|
1017
|
+
await apply({
|
|
1018
|
+
...state,
|
|
1019
|
+
availableWidth,
|
|
1020
|
+
availableHeight,
|
|
1021
|
+
});
|
|
1022
|
+
const nextDimensions = await platform$1.getDimensions(elements.floating);
|
|
1023
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height)
|
|
1024
|
+
return { reset: { rects: true } };
|
|
1025
|
+
return {};
|
|
1026
|
+
},
|
|
1027
|
+
};
|
|
1028
|
+
};
|
|
1029
|
+
//#endregion
|
|
1030
|
+
//#region node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
1031
|
+
function hasWindow() {
|
|
1032
|
+
return typeof window !== "undefined";
|
|
1033
|
+
}
|
|
1034
|
+
function getNodeName(node) {
|
|
1035
|
+
if (isNode(node))
|
|
1036
|
+
return (node.nodeName || "").toLowerCase();
|
|
1037
|
+
return "#document";
|
|
1038
|
+
}
|
|
1039
|
+
function getWindow(node) {
|
|
1040
|
+
var _node$ownerDocument;
|
|
1041
|
+
return ((node == null || (_node$ownerDocument = node.ownerDocument) == null
|
|
1042
|
+
? void 0
|
|
1043
|
+
: _node$ownerDocument.defaultView) || window);
|
|
1044
|
+
}
|
|
1045
|
+
function getDocumentElement(node) {
|
|
1046
|
+
var _ref;
|
|
1047
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null
|
|
1048
|
+
? void 0
|
|
1049
|
+
: _ref.documentElement;
|
|
1050
|
+
}
|
|
1051
|
+
function isNode(value) {
|
|
1052
|
+
if (!hasWindow())
|
|
1053
|
+
return false;
|
|
1054
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
1055
|
+
}
|
|
1056
|
+
function isElement(value) {
|
|
1057
|
+
if (!hasWindow())
|
|
1058
|
+
return false;
|
|
1059
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
1060
|
+
}
|
|
1061
|
+
function isHTMLElement(value) {
|
|
1062
|
+
if (!hasWindow())
|
|
1063
|
+
return false;
|
|
1064
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
1065
|
+
}
|
|
1066
|
+
function isShadowRoot(value) {
|
|
1067
|
+
if (!hasWindow() || typeof ShadowRoot === "undefined")
|
|
1068
|
+
return false;
|
|
1069
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
1070
|
+
}
|
|
1071
|
+
const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
1072
|
+
function isOverflowElement(element) {
|
|
1073
|
+
const { overflow, overflowX, overflowY, display } = getComputedStyle$1(element);
|
|
1074
|
+
return (/auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) &&
|
|
1075
|
+
!invalidOverflowDisplayValues.has(display));
|
|
1076
|
+
}
|
|
1077
|
+
const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
1078
|
+
function isTableElement(element) {
|
|
1079
|
+
return tableElements.has(getNodeName(element));
|
|
1080
|
+
}
|
|
1081
|
+
const topLayerSelectors = [":popover-open", ":modal"];
|
|
1082
|
+
function isTopLayer(element) {
|
|
1083
|
+
return topLayerSelectors.some((selector) => {
|
|
1084
|
+
try {
|
|
1085
|
+
return element.matches(selector);
|
|
1086
|
+
}
|
|
1087
|
+
catch (_e) {
|
|
1088
|
+
return false;
|
|
1089
|
+
}
|
|
1090
|
+
});
|
|
1091
|
+
}
|
|
1092
|
+
const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
|
|
1093
|
+
const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
|
|
1094
|
+
const containValues = ["paint", "layout", "strict", "content"];
|
|
1095
|
+
function isContainingBlock(elementOrCss) {
|
|
1096
|
+
const webkit = isWebKit();
|
|
1097
|
+
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
1098
|
+
return (transformProperties.some((value) => (css[value] ? css[value] !== "none" : false)) ||
|
|
1099
|
+
(css.containerType ? css.containerType !== "normal" : false) ||
|
|
1100
|
+
(!webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false)) ||
|
|
1101
|
+
(!webkit && (css.filter ? css.filter !== "none" : false)) ||
|
|
1102
|
+
willChangeValues.some((value) => (css.willChange || "").includes(value)) ||
|
|
1103
|
+
containValues.some((value) => (css.contain || "").includes(value)));
|
|
1104
|
+
}
|
|
1105
|
+
function getContainingBlock(element) {
|
|
1106
|
+
let currentNode = getParentNode(element);
|
|
1107
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1108
|
+
if (isContainingBlock(currentNode))
|
|
1109
|
+
return currentNode;
|
|
1110
|
+
else if (isTopLayer(currentNode))
|
|
1111
|
+
return null;
|
|
1112
|
+
currentNode = getParentNode(currentNode);
|
|
1113
|
+
}
|
|
1114
|
+
return null;
|
|
1115
|
+
}
|
|
1116
|
+
function isWebKit() {
|
|
1117
|
+
if (typeof CSS === "undefined" || !CSS.supports)
|
|
1118
|
+
return false;
|
|
1119
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
1120
|
+
}
|
|
1121
|
+
const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
1122
|
+
function isLastTraversableNode(node) {
|
|
1123
|
+
return lastTraversableNodeNames.has(getNodeName(node));
|
|
1124
|
+
}
|
|
1125
|
+
function getComputedStyle$1(element) {
|
|
1126
|
+
return getWindow(element).getComputedStyle(element);
|
|
1127
|
+
}
|
|
1128
|
+
function getNodeScroll(element) {
|
|
1129
|
+
if (isElement(element))
|
|
1130
|
+
return {
|
|
1131
|
+
scrollLeft: element.scrollLeft,
|
|
1132
|
+
scrollTop: element.scrollTop,
|
|
1133
|
+
};
|
|
1134
|
+
return {
|
|
1135
|
+
scrollLeft: element.scrollX,
|
|
1136
|
+
scrollTop: element.scrollY,
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
function getParentNode(node) {
|
|
1140
|
+
if (getNodeName(node) === "html")
|
|
1141
|
+
return node;
|
|
1142
|
+
const result = node.assignedSlot || node.parentNode || (isShadowRoot(node) && node.host) || getDocumentElement(node);
|
|
1143
|
+
return isShadowRoot(result) ? result.host : result;
|
|
1144
|
+
}
|
|
1145
|
+
function getNearestOverflowAncestor(node) {
|
|
1146
|
+
const parentNode = getParentNode(node);
|
|
1147
|
+
if (isLastTraversableNode(parentNode))
|
|
1148
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
1149
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode))
|
|
1150
|
+
return parentNode;
|
|
1151
|
+
return getNearestOverflowAncestor(parentNode);
|
|
1152
|
+
}
|
|
1153
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
1154
|
+
var _node$ownerDocument2;
|
|
1155
|
+
if (list === void 0)
|
|
1156
|
+
list = [];
|
|
1157
|
+
if (traverseIframes === void 0)
|
|
1158
|
+
traverseIframes = true;
|
|
1159
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1160
|
+
const isBody = scrollableAncestor ===
|
|
1161
|
+
((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
1162
|
+
const win = getWindow(scrollableAncestor);
|
|
1163
|
+
if (isBody) {
|
|
1164
|
+
const frameElement = getFrameElement(win);
|
|
1165
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
1166
|
+
}
|
|
1167
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1168
|
+
}
|
|
1169
|
+
function getFrameElement(win) {
|
|
1170
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
1171
|
+
}
|
|
1172
|
+
//#endregion
|
|
1173
|
+
//#region node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
1174
|
+
function getCssDimensions(element) {
|
|
1175
|
+
const css = getComputedStyle$1(element);
|
|
1176
|
+
let width = parseFloat(css.width) || 0;
|
|
1177
|
+
let height = parseFloat(css.height) || 0;
|
|
1178
|
+
const hasOffset = isHTMLElement(element);
|
|
1179
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
1180
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
1181
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
1182
|
+
if (shouldFallback) {
|
|
1183
|
+
width = offsetWidth;
|
|
1184
|
+
height = offsetHeight;
|
|
1185
|
+
}
|
|
1186
|
+
return {
|
|
1187
|
+
width,
|
|
1188
|
+
height,
|
|
1189
|
+
$: shouldFallback,
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1192
|
+
function unwrapElement(element) {
|
|
1193
|
+
return !isElement(element) ? element.contextElement : element;
|
|
1194
|
+
}
|
|
1195
|
+
function getScale(element) {
|
|
1196
|
+
const domElement = unwrapElement(element);
|
|
1197
|
+
if (!isHTMLElement(domElement))
|
|
1198
|
+
return createCoords(1);
|
|
1199
|
+
const rect = domElement.getBoundingClientRect();
|
|
1200
|
+
const { width, height, $ } = getCssDimensions(domElement);
|
|
1201
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
1202
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
1203
|
+
if (!x || !Number.isFinite(x))
|
|
1204
|
+
x = 1;
|
|
1205
|
+
if (!y || !Number.isFinite(y))
|
|
1206
|
+
y = 1;
|
|
1207
|
+
return {
|
|
1208
|
+
x,
|
|
1209
|
+
y,
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
const noOffsets = /* @__PURE__ */ createCoords(0);
|
|
1213
|
+
function getVisualOffsets(element) {
|
|
1214
|
+
const win = getWindow(element);
|
|
1215
|
+
if (!isWebKit() || !win.visualViewport)
|
|
1216
|
+
return noOffsets;
|
|
1217
|
+
return {
|
|
1218
|
+
x: win.visualViewport.offsetLeft,
|
|
1219
|
+
y: win.visualViewport.offsetTop,
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1223
|
+
if (isFixed === void 0)
|
|
1224
|
+
isFixed = false;
|
|
1225
|
+
if (!floatingOffsetParent || (isFixed && floatingOffsetParent !== getWindow(element)))
|
|
1226
|
+
return false;
|
|
1227
|
+
return isFixed;
|
|
1228
|
+
}
|
|
1229
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1230
|
+
if (includeScale === void 0)
|
|
1231
|
+
includeScale = false;
|
|
1232
|
+
if (isFixedStrategy === void 0)
|
|
1233
|
+
isFixedStrategy = false;
|
|
1234
|
+
const clientRect = element.getBoundingClientRect();
|
|
1235
|
+
const domElement = unwrapElement(element);
|
|
1236
|
+
let scale = createCoords(1);
|
|
1237
|
+
if (includeScale)
|
|
1238
|
+
if (offsetParent) {
|
|
1239
|
+
if (isElement(offsetParent))
|
|
1240
|
+
scale = getScale(offsetParent);
|
|
1241
|
+
}
|
|
1242
|
+
else
|
|
1243
|
+
scale = getScale(element);
|
|
1244
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent)
|
|
1245
|
+
? getVisualOffsets(domElement)
|
|
1246
|
+
: createCoords(0);
|
|
1247
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1248
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1249
|
+
let width = clientRect.width / scale.x;
|
|
1250
|
+
let height = clientRect.height / scale.y;
|
|
1251
|
+
if (domElement) {
|
|
1252
|
+
const win = getWindow(domElement);
|
|
1253
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1254
|
+
let currentWin = win;
|
|
1255
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
1256
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1257
|
+
const iframeScale = getScale(currentIFrame);
|
|
1258
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1259
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
1260
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1261
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1262
|
+
x *= iframeScale.x;
|
|
1263
|
+
y *= iframeScale.y;
|
|
1264
|
+
width *= iframeScale.x;
|
|
1265
|
+
height *= iframeScale.y;
|
|
1266
|
+
x += left;
|
|
1267
|
+
y += top;
|
|
1268
|
+
currentWin = getWindow(currentIFrame);
|
|
1269
|
+
currentIFrame = getFrameElement(currentWin);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
return rectToClientRect({
|
|
1273
|
+
width,
|
|
1274
|
+
height,
|
|
1275
|
+
x,
|
|
1276
|
+
y,
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1279
|
+
function getWindowScrollBarX(element, rect) {
|
|
1280
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
1281
|
+
if (!rect)
|
|
1282
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
1283
|
+
return rect.left + leftScroll;
|
|
1284
|
+
}
|
|
1285
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
1286
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
1287
|
+
return {
|
|
1288
|
+
x: htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect),
|
|
1289
|
+
y: htmlRect.top + scroll.scrollTop,
|
|
1290
|
+
};
|
|
1291
|
+
}
|
|
1292
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1293
|
+
let { elements, rect, offsetParent, strategy } = _ref;
|
|
1294
|
+
const isFixed = strategy === "fixed";
|
|
1295
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1296
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1297
|
+
if (offsetParent === documentElement || (topLayer && isFixed))
|
|
1298
|
+
return rect;
|
|
1299
|
+
let scroll = {
|
|
1300
|
+
scrollLeft: 0,
|
|
1301
|
+
scrollTop: 0,
|
|
1302
|
+
};
|
|
1303
|
+
let scale = createCoords(1);
|
|
1304
|
+
const offsets = createCoords(0);
|
|
1305
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1306
|
+
if (isOffsetParentAnElement || (!isOffsetParentAnElement && !isFixed)) {
|
|
1307
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement))
|
|
1308
|
+
scroll = getNodeScroll(offsetParent);
|
|
1309
|
+
if (isHTMLElement(offsetParent)) {
|
|
1310
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1311
|
+
scale = getScale(offsetParent);
|
|
1312
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1313
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed
|
|
1317
|
+
? getHTMLOffset(documentElement, scroll)
|
|
1318
|
+
: createCoords(0);
|
|
1319
|
+
return {
|
|
1320
|
+
width: rect.width * scale.x,
|
|
1321
|
+
height: rect.height * scale.y,
|
|
1322
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1323
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y,
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
function getClientRects(element) {
|
|
1327
|
+
return Array.from(element.getClientRects());
|
|
1328
|
+
}
|
|
1329
|
+
function getDocumentRect(element) {
|
|
1330
|
+
const html = getDocumentElement(element);
|
|
1331
|
+
const scroll = getNodeScroll(element);
|
|
1332
|
+
const body = element.ownerDocument.body;
|
|
1333
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1334
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1335
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1336
|
+
const y = -scroll.scrollTop;
|
|
1337
|
+
if (getComputedStyle$1(body).direction === "rtl")
|
|
1338
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1339
|
+
return {
|
|
1340
|
+
width,
|
|
1341
|
+
height,
|
|
1342
|
+
x,
|
|
1343
|
+
y,
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
const SCROLLBAR_MAX = 25;
|
|
1347
|
+
function getViewportRect(element, strategy) {
|
|
1348
|
+
const win = getWindow(element);
|
|
1349
|
+
const html = getDocumentElement(element);
|
|
1350
|
+
const visualViewport = win.visualViewport;
|
|
1351
|
+
let width = html.clientWidth;
|
|
1352
|
+
let height = html.clientHeight;
|
|
1353
|
+
let x = 0;
|
|
1354
|
+
let y = 0;
|
|
1355
|
+
if (visualViewport) {
|
|
1356
|
+
width = visualViewport.width;
|
|
1357
|
+
height = visualViewport.height;
|
|
1358
|
+
const visualViewportBased = isWebKit();
|
|
1359
|
+
if (!visualViewportBased || (visualViewportBased && strategy === "fixed")) {
|
|
1360
|
+
x = visualViewport.offsetLeft;
|
|
1361
|
+
y = visualViewport.offsetTop;
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1365
|
+
if (windowScrollbarX <= 0) {
|
|
1366
|
+
const doc = html.ownerDocument;
|
|
1367
|
+
const body = doc.body;
|
|
1368
|
+
const bodyStyles = getComputedStyle(body);
|
|
1369
|
+
const bodyMarginInline = doc.compatMode === "CSS1Compat"
|
|
1370
|
+
? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0
|
|
1371
|
+
: 0;
|
|
1372
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1373
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX)
|
|
1374
|
+
width -= clippingStableScrollbarWidth;
|
|
1375
|
+
}
|
|
1376
|
+
else if (windowScrollbarX <= SCROLLBAR_MAX)
|
|
1377
|
+
width += windowScrollbarX;
|
|
1378
|
+
return {
|
|
1379
|
+
width,
|
|
1380
|
+
height,
|
|
1381
|
+
x,
|
|
1382
|
+
y,
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1386
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1387
|
+
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
1388
|
+
const top = clientRect.top + element.clientTop;
|
|
1389
|
+
const left = clientRect.left + element.clientLeft;
|
|
1390
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
1391
|
+
return {
|
|
1392
|
+
width: element.clientWidth * scale.x,
|
|
1393
|
+
height: element.clientHeight * scale.y,
|
|
1394
|
+
x: left * scale.x,
|
|
1395
|
+
y: top * scale.y,
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1399
|
+
let rect;
|
|
1400
|
+
if (clippingAncestor === "viewport")
|
|
1401
|
+
rect = getViewportRect(element, strategy);
|
|
1402
|
+
else if (clippingAncestor === "document")
|
|
1403
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
1404
|
+
else if (isElement(clippingAncestor))
|
|
1405
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1406
|
+
else {
|
|
1407
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1408
|
+
rect = {
|
|
1409
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1410
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
1411
|
+
width: clippingAncestor.width,
|
|
1412
|
+
height: clippingAncestor.height,
|
|
1413
|
+
};
|
|
1414
|
+
}
|
|
1415
|
+
return rectToClientRect(rect);
|
|
1416
|
+
}
|
|
1417
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
1418
|
+
const parentNode = getParentNode(element);
|
|
1419
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode))
|
|
1420
|
+
return false;
|
|
1421
|
+
return (getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode));
|
|
1422
|
+
}
|
|
1423
|
+
function getClippingElementAncestors(element, cache) {
|
|
1424
|
+
const cachedResult = cache.get(element);
|
|
1425
|
+
if (cachedResult)
|
|
1426
|
+
return cachedResult;
|
|
1427
|
+
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
1428
|
+
let currentContainingBlockComputedStyle = null;
|
|
1429
|
+
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
|
1430
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1431
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1432
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
1433
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1434
|
+
if (!currentNodeIsContaining && computedStyle.position === "fixed")
|
|
1435
|
+
currentContainingBlockComputedStyle = null;
|
|
1436
|
+
if (elementIsFixed
|
|
1437
|
+
? !currentNodeIsContaining && !currentContainingBlockComputedStyle
|
|
1438
|
+
: (!currentNodeIsContaining &&
|
|
1439
|
+
computedStyle.position === "static" &&
|
|
1440
|
+
!!currentContainingBlockComputedStyle &&
|
|
1441
|
+
absoluteOrFixed.has(currentContainingBlockComputedStyle.position)) ||
|
|
1442
|
+
(isOverflowElement(currentNode) &&
|
|
1443
|
+
!currentNodeIsContaining &&
|
|
1444
|
+
hasFixedPositionAncestor(element, currentNode)))
|
|
1445
|
+
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
1446
|
+
else
|
|
1447
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1448
|
+
currentNode = getParentNode(currentNode);
|
|
1449
|
+
}
|
|
1450
|
+
cache.set(element, result);
|
|
1451
|
+
return result;
|
|
1452
|
+
}
|
|
1453
|
+
function getClippingRect(_ref) {
|
|
1454
|
+
let { element, boundary, rootBoundary, strategy } = _ref;
|
|
1455
|
+
const clippingAncestors = [
|
|
1456
|
+
...(boundary === "clippingAncestors"
|
|
1457
|
+
? isTopLayer(element)
|
|
1458
|
+
? []
|
|
1459
|
+
: getClippingElementAncestors(element, this._c)
|
|
1460
|
+
: [].concat(boundary)),
|
|
1461
|
+
rootBoundary,
|
|
1462
|
+
];
|
|
1463
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
1464
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1465
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1466
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1467
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1468
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1469
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1470
|
+
return accRect;
|
|
1471
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1472
|
+
return {
|
|
1473
|
+
width: clippingRect.right - clippingRect.left,
|
|
1474
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
1475
|
+
x: clippingRect.left,
|
|
1476
|
+
y: clippingRect.top,
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1479
|
+
function getDimensions(element) {
|
|
1480
|
+
const { width, height } = getCssDimensions(element);
|
|
1481
|
+
return {
|
|
1482
|
+
width,
|
|
1483
|
+
height,
|
|
1484
|
+
};
|
|
1485
|
+
}
|
|
1486
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1487
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1488
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1489
|
+
const isFixed = strategy === "fixed";
|
|
1490
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1491
|
+
let scroll = {
|
|
1492
|
+
scrollLeft: 0,
|
|
1493
|
+
scrollTop: 0,
|
|
1494
|
+
};
|
|
1495
|
+
const offsets = createCoords(0);
|
|
1496
|
+
function setLeftRTLScrollbarOffset() {
|
|
1497
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1498
|
+
}
|
|
1499
|
+
if (isOffsetParentAnElement || (!isOffsetParentAnElement && !isFixed)) {
|
|
1500
|
+
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement))
|
|
1501
|
+
scroll = getNodeScroll(offsetParent);
|
|
1502
|
+
if (isOffsetParentAnElement) {
|
|
1503
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1504
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1505
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1506
|
+
}
|
|
1507
|
+
else if (documentElement)
|
|
1508
|
+
setLeftRTLScrollbarOffset();
|
|
1509
|
+
}
|
|
1510
|
+
if (isFixed && !isOffsetParentAnElement && documentElement)
|
|
1511
|
+
setLeftRTLScrollbarOffset();
|
|
1512
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed
|
|
1513
|
+
? getHTMLOffset(documentElement, scroll)
|
|
1514
|
+
: createCoords(0);
|
|
1515
|
+
return {
|
|
1516
|
+
x: rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
|
|
1517
|
+
y: rect.top + scroll.scrollTop - offsets.y - htmlOffset.y,
|
|
1518
|
+
width: rect.width,
|
|
1519
|
+
height: rect.height,
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
function isStaticPositioned(element) {
|
|
1523
|
+
return getComputedStyle$1(element).position === "static";
|
|
1524
|
+
}
|
|
1525
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
1526
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed")
|
|
1527
|
+
return null;
|
|
1528
|
+
if (polyfill)
|
|
1529
|
+
return polyfill(element);
|
|
1530
|
+
let rawOffsetParent = element.offsetParent;
|
|
1531
|
+
if (getDocumentElement(element) === rawOffsetParent)
|
|
1532
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1533
|
+
return rawOffsetParent;
|
|
1534
|
+
}
|
|
1535
|
+
function getOffsetParent(element, polyfill) {
|
|
1536
|
+
const win = getWindow(element);
|
|
1537
|
+
if (isTopLayer(element))
|
|
1538
|
+
return win;
|
|
1539
|
+
if (!isHTMLElement(element)) {
|
|
1540
|
+
let svgOffsetParent = getParentNode(element);
|
|
1541
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
1542
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent))
|
|
1543
|
+
return svgOffsetParent;
|
|
1544
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
1545
|
+
}
|
|
1546
|
+
return win;
|
|
1547
|
+
}
|
|
1548
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1549
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent))
|
|
1550
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1551
|
+
if (offsetParent &&
|
|
1552
|
+
isLastTraversableNode(offsetParent) &&
|
|
1553
|
+
isStaticPositioned(offsetParent) &&
|
|
1554
|
+
!isContainingBlock(offsetParent))
|
|
1555
|
+
return win;
|
|
1556
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
1557
|
+
}
|
|
1558
|
+
const getElementRects = async function (data) {
|
|
1559
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1560
|
+
const getDimensionsFn = this.getDimensions;
|
|
1561
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1562
|
+
return {
|
|
1563
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1564
|
+
floating: {
|
|
1565
|
+
x: 0,
|
|
1566
|
+
y: 0,
|
|
1567
|
+
width: floatingDimensions.width,
|
|
1568
|
+
height: floatingDimensions.height,
|
|
1569
|
+
},
|
|
1570
|
+
};
|
|
1571
|
+
};
|
|
1572
|
+
function isRTL(element) {
|
|
1573
|
+
return getComputedStyle$1(element).direction === "rtl";
|
|
1574
|
+
}
|
|
1575
|
+
const platform = {
|
|
1576
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1577
|
+
getDocumentElement,
|
|
1578
|
+
getClippingRect,
|
|
1579
|
+
getOffsetParent,
|
|
1580
|
+
getElementRects,
|
|
1581
|
+
getClientRects,
|
|
1582
|
+
getDimensions,
|
|
1583
|
+
getScale,
|
|
1584
|
+
isElement,
|
|
1585
|
+
isRTL,
|
|
1586
|
+
};
|
|
1587
|
+
function rectsAreEqual(a, b) {
|
|
1588
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1589
|
+
}
|
|
1590
|
+
function observeMove(element, onMove) {
|
|
1591
|
+
let io = null;
|
|
1592
|
+
let timeoutId;
|
|
1593
|
+
const root = getDocumentElement(element);
|
|
1594
|
+
function cleanup() {
|
|
1595
|
+
var _io;
|
|
1596
|
+
clearTimeout(timeoutId);
|
|
1597
|
+
(_io = io) == null || _io.disconnect();
|
|
1598
|
+
io = null;
|
|
1599
|
+
}
|
|
1600
|
+
function refresh(skip, threshold) {
|
|
1601
|
+
if (skip === void 0)
|
|
1602
|
+
skip = false;
|
|
1603
|
+
if (threshold === void 0)
|
|
1604
|
+
threshold = 1;
|
|
1605
|
+
cleanup();
|
|
1606
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
1607
|
+
const { left, top, width, height } = elementRectForRootMargin;
|
|
1608
|
+
if (!skip)
|
|
1609
|
+
onMove();
|
|
1610
|
+
if (!width || !height)
|
|
1611
|
+
return;
|
|
1612
|
+
const insetTop = floor(top);
|
|
1613
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
1614
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
1615
|
+
const insetLeft = floor(left);
|
|
1616
|
+
const options = {
|
|
1617
|
+
rootMargin: -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px",
|
|
1618
|
+
threshold: max(0, min(1, threshold)) || 1,
|
|
1619
|
+
};
|
|
1620
|
+
let isFirstUpdate = true;
|
|
1621
|
+
function handleObserve(entries) {
|
|
1622
|
+
const ratio = entries[0].intersectionRatio;
|
|
1623
|
+
if (ratio !== threshold) {
|
|
1624
|
+
if (!isFirstUpdate)
|
|
1625
|
+
return refresh();
|
|
1626
|
+
if (!ratio)
|
|
1627
|
+
timeoutId = setTimeout(() => {
|
|
1628
|
+
refresh(false, 1e-7);
|
|
1629
|
+
}, 1e3);
|
|
1630
|
+
else
|
|
1631
|
+
refresh(false, ratio);
|
|
1632
|
+
}
|
|
1633
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect()))
|
|
1634
|
+
refresh();
|
|
1635
|
+
isFirstUpdate = false;
|
|
1636
|
+
}
|
|
1637
|
+
try {
|
|
1638
|
+
io = new IntersectionObserver(handleObserve, {
|
|
1639
|
+
...options,
|
|
1640
|
+
root: root.ownerDocument,
|
|
1641
|
+
});
|
|
1642
|
+
}
|
|
1643
|
+
catch (_e) {
|
|
1644
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
1645
|
+
}
|
|
1646
|
+
io.observe(element);
|
|
1647
|
+
}
|
|
1648
|
+
refresh(true);
|
|
1649
|
+
return cleanup;
|
|
1650
|
+
}
|
|
1651
|
+
/**
|
|
1652
|
+
* Automatically updates the position of the floating element when necessary.
|
|
1653
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
1654
|
+
* visible on the screen.
|
|
1655
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
1656
|
+
* removed from the DOM or hidden from the screen.
|
|
1657
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
1658
|
+
*/
|
|
1659
|
+
function autoUpdate(reference, floating, update, options) {
|
|
1660
|
+
if (options === void 0)
|
|
1661
|
+
options = {};
|
|
1662
|
+
const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === "function", layoutShift = typeof IntersectionObserver === "function", animationFrame = false, } = options;
|
|
1663
|
+
const referenceEl = unwrapElement(reference);
|
|
1664
|
+
const ancestors = ancestorScroll || ancestorResize
|
|
1665
|
+
? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)]
|
|
1666
|
+
: [];
|
|
1667
|
+
ancestors.forEach((ancestor) => {
|
|
1668
|
+
ancestorScroll && ancestor.addEventListener("scroll", update, { passive: true });
|
|
1669
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
|
1670
|
+
});
|
|
1671
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
1672
|
+
let reobserveFrame = -1;
|
|
1673
|
+
let resizeObserver = null;
|
|
1674
|
+
if (elementResize) {
|
|
1675
|
+
resizeObserver = new ResizeObserver((_ref) => {
|
|
1676
|
+
let [firstEntry] = _ref;
|
|
1677
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
1678
|
+
resizeObserver.unobserve(floating);
|
|
1679
|
+
cancelAnimationFrame(reobserveFrame);
|
|
1680
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
1681
|
+
var _resizeObserver;
|
|
1682
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1685
|
+
update();
|
|
1686
|
+
});
|
|
1687
|
+
if (referenceEl && !animationFrame)
|
|
1688
|
+
resizeObserver.observe(referenceEl);
|
|
1689
|
+
resizeObserver.observe(floating);
|
|
1690
|
+
}
|
|
1691
|
+
let frameId;
|
|
1692
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1693
|
+
if (animationFrame)
|
|
1694
|
+
frameLoop();
|
|
1695
|
+
function frameLoop() {
|
|
1696
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
1697
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect))
|
|
1698
|
+
update();
|
|
1699
|
+
prevRefRect = nextRefRect;
|
|
1700
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
1701
|
+
}
|
|
1702
|
+
update();
|
|
1703
|
+
return () => {
|
|
1704
|
+
var _resizeObserver2;
|
|
1705
|
+
ancestors.forEach((ancestor) => {
|
|
1706
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
1707
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
1708
|
+
});
|
|
1709
|
+
cleanupIo?.();
|
|
1710
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
1711
|
+
resizeObserver = null;
|
|
1712
|
+
if (animationFrame)
|
|
1713
|
+
cancelAnimationFrame(frameId);
|
|
1714
|
+
};
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
1718
|
+
* element is overflowing a given clipping boundary on each side.
|
|
1719
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
1720
|
+
* - negative = how many pixels left before it will overflow
|
|
1721
|
+
* - 0 = lies flush with the boundary
|
|
1722
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
1723
|
+
*/
|
|
1724
|
+
const detectOverflow = detectOverflow$1;
|
|
1725
|
+
/**
|
|
1726
|
+
* Modifies the placement by translating the floating element along the
|
|
1727
|
+
* specified axes.
|
|
1728
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1729
|
+
* object may be passed.
|
|
1730
|
+
* @see https://floating-ui.com/docs/offset
|
|
1731
|
+
*/
|
|
1732
|
+
const offset = offset$1;
|
|
1733
|
+
/**
|
|
1734
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
1735
|
+
* that has the most space available automatically, without needing to specify a
|
|
1736
|
+
* preferred placement. Alternative to `flip`.
|
|
1737
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
1738
|
+
*/
|
|
1739
|
+
const autoPlacement = autoPlacement$1;
|
|
1740
|
+
/**
|
|
1741
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
1742
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
1743
|
+
* @see https://floating-ui.com/docs/shift
|
|
1744
|
+
*/
|
|
1745
|
+
const shift = shift$1;
|
|
1746
|
+
/**
|
|
1747
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1748
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1749
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
1750
|
+
* @see https://floating-ui.com/docs/flip
|
|
1751
|
+
*/
|
|
1752
|
+
const flip = flip$1;
|
|
1753
|
+
/**
|
|
1754
|
+
* Provides data that allows you to change the size of the floating element —
|
|
1755
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
1756
|
+
* width of the reference element.
|
|
1757
|
+
* @see https://floating-ui.com/docs/size
|
|
1758
|
+
*/
|
|
1759
|
+
const size = size$1;
|
|
1760
|
+
/**
|
|
1761
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
1762
|
+
* when it is not in the same clipping context as the reference element.
|
|
1763
|
+
* @see https://floating-ui.com/docs/hide
|
|
1764
|
+
*/
|
|
1765
|
+
const hide = hide$1;
|
|
1766
|
+
/**
|
|
1767
|
+
* Provides data to position an inner element of the floating element so that it
|
|
1768
|
+
* appears centered to the reference element.
|
|
1769
|
+
* @see https://floating-ui.com/docs/arrow
|
|
1770
|
+
*/
|
|
1771
|
+
const arrow = arrow$1;
|
|
1772
|
+
/**
|
|
1773
|
+
* Provides improved positioning for inline reference elements that can span
|
|
1774
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
1775
|
+
* @see https://floating-ui.com/docs/inline
|
|
1776
|
+
*/
|
|
1777
|
+
const inline = inline$1;
|
|
1778
|
+
/**
|
|
1779
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
1780
|
+
*/
|
|
1781
|
+
const limitShift = limitShift$1;
|
|
1782
|
+
/**
|
|
1783
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1784
|
+
* next to a given reference element.
|
|
1785
|
+
*/
|
|
1786
|
+
const computePosition = (reference, floating, options) => {
|
|
1787
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1788
|
+
const mergedOptions = {
|
|
1789
|
+
platform,
|
|
1790
|
+
...options,
|
|
1791
|
+
};
|
|
1792
|
+
const platformWithCache = {
|
|
1793
|
+
...mergedOptions.platform,
|
|
1794
|
+
_c: cache,
|
|
1795
|
+
};
|
|
1796
|
+
return computePosition$1(reference, floating, {
|
|
1797
|
+
...mergedOptions,
|
|
1798
|
+
platform: platformWithCache,
|
|
1799
|
+
});
|
|
1800
|
+
};
|
|
1801
|
+
//#endregion
|
|
1802
|
+
export { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size, };
|