From 835a30ff01ee20472ba8810d110ec302d6259eeb Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 23 Oct 2023 14:05:55 +0000 Subject: [PATCH] Release version 2.0.0-reedsy.1.0.2 --- .gitignore | 1 + .../dist/components/Dropdown.vue.d.ts | 29 + .../dist/components/Menu.vue.d.ts | 29 + .../floating-vue/dist/components/Popper.d.ts | 476 ++++++ .../dist/components/Popper.vue.d.ts | 460 ++++++ .../dist/components/PopperContent.vue.d.ts | 37 + .../dist/components/PopperMethods.d.ts | 9 + .../dist/components/PopperWrapper.vue.d.ts | 29 + .../dist/components/ThemeClass.d.ts | 6 + .../dist/components/Tooltip.vue.d.ts | 29 + .../dist/components/TooltipDirective.vue.d.ts | 67 + packages/floating-vue/dist/config.d.ts | 11 + .../dist/directives/v-close-popper.d.ts | 13 + .../dist/directives/v-tooltip.d.ts | 27 + .../dist/directives/v-tooltip.spec.d.ts | 1 + packages/floating-vue/dist/floating-vue.mjs | 1395 +++++++++++++++++ .../floating-vue/dist/floating-vue.umd.js | 1 + packages/floating-vue/dist/index.d.ts | 718 +++++++++ packages/floating-vue/dist/style.css | 1 + .../floating-vue/dist/util/assign-deep.d.ts | 1 + packages/floating-vue/dist/util/env.d.ts | 2 + packages/floating-vue/dist/util/events.d.ts | 14 + packages/floating-vue/dist/util/frame.d.ts | 1 + packages/floating-vue/dist/util/lang.d.ts | 1 + packages/floating-vue/dist/util/popper.d.ts | 3 + 25 files changed, 3361 insertions(+) create mode 100644 packages/floating-vue/dist/components/Dropdown.vue.d.ts create mode 100644 packages/floating-vue/dist/components/Menu.vue.d.ts create mode 100644 packages/floating-vue/dist/components/Popper.d.ts create mode 100644 packages/floating-vue/dist/components/Popper.vue.d.ts create mode 100644 packages/floating-vue/dist/components/PopperContent.vue.d.ts create mode 100644 packages/floating-vue/dist/components/PopperMethods.d.ts create mode 100644 packages/floating-vue/dist/components/PopperWrapper.vue.d.ts create mode 100644 packages/floating-vue/dist/components/ThemeClass.d.ts create mode 100644 packages/floating-vue/dist/components/Tooltip.vue.d.ts create mode 100644 packages/floating-vue/dist/components/TooltipDirective.vue.d.ts create mode 100644 packages/floating-vue/dist/config.d.ts create mode 100644 packages/floating-vue/dist/directives/v-close-popper.d.ts create mode 100644 packages/floating-vue/dist/directives/v-tooltip.d.ts create mode 100644 packages/floating-vue/dist/directives/v-tooltip.spec.d.ts create mode 100644 packages/floating-vue/dist/floating-vue.mjs create mode 100644 packages/floating-vue/dist/floating-vue.umd.js create mode 100644 packages/floating-vue/dist/index.d.ts create mode 100644 packages/floating-vue/dist/style.css create mode 100644 packages/floating-vue/dist/util/assign-deep.d.ts create mode 100644 packages/floating-vue/dist/util/env.d.ts create mode 100644 packages/floating-vue/dist/util/events.d.ts create mode 100644 packages/floating-vue/dist/util/frame.d.ts create mode 100644 packages/floating-vue/dist/util/lang.d.ts create mode 100644 packages/floating-vue/dist/util/popper.d.ts diff --git a/.gitignore b/.gitignore index c7f0539e..659adb48 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules/ npm-debug.log coverage/ dist/ +!packages/floating-vue/dist diff --git a/packages/floating-vue/dist/components/Dropdown.vue.d.ts b/packages/floating-vue/dist/components/Dropdown.vue.d.ts new file mode 100644 index 00000000..925ee1f0 --- /dev/null +++ b/packages/floating-vue/dist/components/Dropdown.vue.d.ts @@ -0,0 +1,29 @@ +declare const Component: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: any; + }; +}, unknown, unknown, { + finalTheme(): string; +}, { + getTargetNodes(): unknown[]; +}, { + computed: { + themeClass(): string[]; + }; +} | { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, { + theme: string; +}, {}>; +export default Component; diff --git a/packages/floating-vue/dist/components/Menu.vue.d.ts b/packages/floating-vue/dist/components/Menu.vue.d.ts new file mode 100644 index 00000000..925ee1f0 --- /dev/null +++ b/packages/floating-vue/dist/components/Menu.vue.d.ts @@ -0,0 +1,29 @@ +declare const Component: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: any; + }; +}, unknown, unknown, { + finalTheme(): string; +}, { + getTargetNodes(): unknown[]; +}, { + computed: { + themeClass(): string[]; + }; +} | { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, { + theme: string; +}, {}>; +export default Component; diff --git a/packages/floating-vue/dist/components/Popper.d.ts b/packages/floating-vue/dist/components/Popper.d.ts new file mode 100644 index 00000000..41e18795 --- /dev/null +++ b/packages/floating-vue/dist/components/Popper.d.ts @@ -0,0 +1,476 @@ +import { computePosition } from '@floating-ui/dom'; +import { Placement } from '../util/popper'; +export type ComputePositionConfig = Parameters[2]; +declare const _default: () => import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + required: true; + }; + targetNodes: { + type: FunctionConstructor; + required: true; + }; + referenceNode: { + type: FunctionConstructor; + default: any; + }; + popperNode: { + type: FunctionConstructor; + required: true; + }; + shown: { + type: BooleanConstructor; + default: boolean; + }; + showGroup: { + type: StringConstructor; + default: any; + }; + ariaId: { + default: any; + }; + disabled: { + type: BooleanConstructor; + default: (props: any) => any; + }; + positioningDisabled: { + type: BooleanConstructor; + default: (props: any) => any; + }; + placement: { + type: StringConstructor; + default: (props: any) => any; + validator: (value: Placement) => boolean; + }; + delay: { + type: (ObjectConstructor | StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + distance: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + skidding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + triggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + showTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + hideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperTriggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + popperShowTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperHideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + container: { + type: any[]; + default: (props: any) => any; + }; + boundary: { + type: any[]; + default: (props: any) => any; + }; + strategy: { + type: StringConstructor; + validator: (value: string) => boolean; + default: (props: any) => any; + }; + autoHide: { + type: (FunctionConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + handleResize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + instantMove: { + type: BooleanConstructor; + default: (props: any) => any; + }; + eagerMount: { + type: BooleanConstructor; + default: (props: any) => any; + }; + popperClass: { + type: (ObjectConstructor | StringConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + computeTransformOrigin: { + type: BooleanConstructor; + default: (props: any) => any; + }; + /** + * @deprecated + */ + autoMinSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoSize: { + type: (StringConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + /** + * @deprecated + */ + autoMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoBoundaryMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + preventOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + overflowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + flip: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shift: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shiftCrossAxis: { + type: BooleanConstructor; + default: (props: any) => any; + }; + noAutoFocus: { + type: BooleanConstructor; + default: (props: any) => any; + }; + disposeTimeout: { + type: NumberConstructor; + default: (props: any) => any; + }; +}, unknown, { + isShown: boolean; + isMounted: boolean; + skipTransition: boolean; + classes: { + showFrom: boolean; + showTo: boolean; + hideFrom: boolean; + hideTo: boolean; + }; + result: { + x: number; + y: number; + placement: string; + strategy: string; + arrow: { + x: number; + y: number; + centerOffset: number; + }; + transformOrigin: any; + }; + shownChildren: Set; + lastAutoHide: boolean; +}, { + popperId(): any; + shouldMountContent(): any; + slotData(): { + popperId: any; + isShown: any; + shouldMountContent: any; + skipTransition: any; + autoHide: any; + show: any; + hide: any; + handleResize: any; + onResize: any; + classes: any; + result: any; + attrs: any; + }; + parentPopper(): any; + hasPopperShowTriggerHover(): any; +}, { + show({ event, skipDelay, force }?: { + event?: any; + skipDelay?: boolean; + force?: boolean; + }): void; + hide({ event, skipDelay }?: { + event?: any; + skipDelay?: boolean; + }): void; + init(): void; + dispose(): void; + onResize(): Promise; + $_computePosition(): Promise; + $_scheduleShow(event?: any, skipDelay?: boolean): void; + $_scheduleHide(event?: any, skipDelay?: boolean): void; + $_computeDelay(type: any): number; + $_applyShow(skipTransition?: boolean): Promise; + $_applyShowEffect(): Promise; + $_applyHide(skipTransition?: boolean): Promise; + $_autoShowHide(): void; + $_ensureTeleport(): void; + $_addEventListeners(): void; + $_registerEventListeners(targetNodes: any[], eventType: string, handler: (event: Event) => void): void; + $_registerTriggerListeners(targetNodes: any[], eventMap: Record, commonTriggers: any, customTrigger: any, handler: (event: Event) => void): void; + $_removeEventListeners(filterEventType?: string): void; + $_refreshListeners(): void; + $_handleGlobalClose(event: any, touch?: boolean): void; + $_detachPopperNode(): void; + $_swapTargetAttrs(attrFrom: any, attrTo: any): void; + $_applyAttrsToTarget(attrs: any): void; + $_updateParentShownChildren(value: any): void; + $_isAimingPopper(): boolean; +}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("resize" | "show" | "hide" | "update:shown" | "apply-show" | "apply-hide" | "close-group" | "close-directive" | "auto-hide" | "dispose")[], "resize" | "show" | "hide" | "update:shown" | "apply-show" | "apply-hide" | "close-group" | "close-directive" | "auto-hide" | "dispose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly any; + }; + positioningDisabled: { + type: BooleanConstructor; + default: (props: any) => any; + }; + placement: { + type: StringConstructor; + default: (props: any) => any; + validator: (value: Placement) => boolean; + }; + delay: { + type: (ObjectConstructor | StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + distance: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + skidding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + triggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + showTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + hideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperTriggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + popperShowTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperHideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + container: { + type: any[]; + default: (props: any) => any; + }; + boundary: { + type: any[]; + default: (props: any) => any; + }; + strategy: { + type: StringConstructor; + validator: (value: string) => boolean; + default: (props: any) => any; + }; + autoHide: { + type: (FunctionConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + handleResize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + instantMove: { + type: BooleanConstructor; + default: (props: any) => any; + }; + eagerMount: { + type: BooleanConstructor; + default: (props: any) => any; + }; + popperClass: { + type: (ObjectConstructor | StringConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + computeTransformOrigin: { + type: BooleanConstructor; + default: (props: any) => any; + }; + /** + * @deprecated + */ + autoMinSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoSize: { + type: (StringConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + /** + * @deprecated + */ + autoMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoBoundaryMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + preventOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + overflowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + flip: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shift: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shiftCrossAxis: { + type: BooleanConstructor; + default: (props: any) => any; + }; + noAutoFocus: { + type: BooleanConstructor; + default: (props: any) => any; + }; + disposeTimeout: { + type: NumberConstructor; + default: (props: any) => any; + }; +}>> & { + onResize?: (...args: any[]) => any; + onShow?: (...args: any[]) => any; + onHide?: (...args: any[]) => any; + "onUpdate:shown"?: (...args: any[]) => any; + "onApply-show"?: (...args: any[]) => any; + "onApply-hide"?: (...args: any[]) => any; + "onClose-group"?: (...args: any[]) => any; + "onClose-directive"?: (...args: any[]) => any; + "onAuto-hide"?: (...args: any[]) => any; + onDispose?: (...args: any[]) => any; +}, { + placement: string; + strategy: string; + disabled: boolean; + positioningDisabled: boolean; + delay: string | number | Record; + distance: string | number; + skidding: string | number; + triggers: unknown[]; + showTriggers: Function | unknown[]; + hideTriggers: Function | unknown[]; + popperTriggers: unknown[]; + popperShowTriggers: Function | unknown[]; + popperHideTriggers: Function | unknown[]; + container: any; + boundary: any; + autoHide: boolean | Function; + handleResize: boolean; + instantMove: boolean; + eagerMount: boolean; + popperClass: string | unknown[] | Record; + computeTransformOrigin: boolean; + autoMinSize: boolean; + autoSize: string | boolean; + autoMaxSize: boolean; + autoBoundaryMaxSize: boolean; + preventOverflow: boolean; + overflowPadding: string | number; + arrowPadding: string | number; + arrowOverflow: boolean; + flip: boolean; + shift: boolean; + shiftCrossAxis: boolean; + noAutoFocus: boolean; + disposeTimeout: number; + shown: boolean; + referenceNode: Function; + showGroup: string; + ariaId: any; +}, {}>; +export default _default; +export declare function hideAllPoppers(): void; diff --git a/packages/floating-vue/dist/components/Popper.vue.d.ts b/packages/floating-vue/dist/components/Popper.vue.d.ts new file mode 100644 index 00000000..2e3914eb --- /dev/null +++ b/packages/floating-vue/dist/components/Popper.vue.d.ts @@ -0,0 +1,460 @@ +declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + required: true; + }; + targetNodes: { + type: FunctionConstructor; + required: true; + }; + referenceNode: { + type: FunctionConstructor; + default: any; + }; + popperNode: { + type: FunctionConstructor; + required: true; + }; + shown: { + type: BooleanConstructor; + default: boolean; + }; + showGroup: { + type: StringConstructor; + default: any; + }; + ariaId: { + default: any; + }; + disabled: { + type: BooleanConstructor; + default: (props: any) => any; + }; + positioningDisabled: { + type: BooleanConstructor; + default: (props: any) => any; + }; + placement: { + type: StringConstructor; + default: (props: any) => any; + validator: (value: import("..").Placement) => boolean; + }; + delay: { + type: (ObjectConstructor | StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + distance: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + skidding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + triggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + showTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + hideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperTriggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + popperShowTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperHideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + container: { + type: any[]; + default: (props: any) => any; + }; + boundary: { + type: any[]; + default: (props: any) => any; + }; + strategy: { + type: StringConstructor; + validator: (value: string) => boolean; + default: (props: any) => any; + }; + autoHide: { + type: (FunctionConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + handleResize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + instantMove: { + type: BooleanConstructor; + default: (props: any) => any; + }; + eagerMount: { + type: BooleanConstructor; + default: (props: any) => any; + }; + popperClass: { + type: (ObjectConstructor | StringConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + computeTransformOrigin: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoMinSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoSize: { + type: (StringConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + autoMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoBoundaryMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + preventOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + overflowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + flip: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shift: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shiftCrossAxis: { + type: BooleanConstructor; + default: (props: any) => any; + }; + noAutoFocus: { + type: BooleanConstructor; + default: (props: any) => any; + }; + disposeTimeout: { + type: NumberConstructor; + default: (props: any) => any; + }; +}, unknown, { + isShown: boolean; + isMounted: boolean; + skipTransition: boolean; + classes: { + showFrom: boolean; + showTo: boolean; + hideFrom: boolean; + hideTo: boolean; + }; + result: { + x: number; + y: number; + placement: string; + strategy: string; + arrow: { + x: number; + y: number; + centerOffset: number; + }; + transformOrigin: any; + }; + shownChildren: Set; + lastAutoHide: boolean; +}, { + popperId(): any; + shouldMountContent(): any; + slotData(): { + popperId: any; + isShown: any; + shouldMountContent: any; + skipTransition: any; + autoHide: any; + show: any; + hide: any; + handleResize: any; + onResize: any; + classes: any; + result: any; + attrs: any; + }; + parentPopper(): any; + hasPopperShowTriggerHover(): any; +}, { + show({ event, skipDelay, force }?: { + event?: any; + skipDelay?: boolean; + force?: boolean; + }): void; + hide({ event, skipDelay }?: { + event?: any; + skipDelay?: boolean; + }): void; + init(): void; + dispose(): void; + onResize(): Promise; + $_computePosition(): Promise; + $_scheduleShow(event?: any, skipDelay?: boolean): void; + $_scheduleHide(event?: any, skipDelay?: boolean): void; + $_computeDelay(type: any): number; + $_applyShow(skipTransition?: boolean): Promise; + $_applyShowEffect(): Promise; + $_applyHide(skipTransition?: boolean): Promise; + $_autoShowHide(): void; + $_ensureTeleport(): void; + $_addEventListeners(): void; + $_registerEventListeners(targetNodes: any[], eventType: string, handler: (event: Event) => void): void; + $_registerTriggerListeners(targetNodes: any[], eventMap: Record, commonTriggers: any, customTrigger: any, handler: (event: Event) => void): void; + $_removeEventListeners(filterEventType?: string): void; + $_refreshListeners(): void; + $_handleGlobalClose(event: any, touch?: boolean): void; + $_detachPopperNode(): void; + $_swapTargetAttrs(attrFrom: any, attrTo: any): void; + $_applyAttrsToTarget(attrs: any): void; + $_updateParentShownChildren(value: any): void; + $_isAimingPopper(): boolean; +}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("resize" | "show" | "hide" | "update:shown" | "apply-show" | "apply-hide" | "close-group" | "close-directive" | "auto-hide" | "dispose")[], "resize" | "show" | "hide" | "update:shown" | "apply-show" | "apply-hide" | "close-group" | "close-directive" | "auto-hide" | "dispose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly any; + }; + positioningDisabled: { + type: BooleanConstructor; + default: (props: any) => any; + }; + placement: { + type: StringConstructor; + default: (props: any) => any; + validator: (value: import("..").Placement) => boolean; + }; + delay: { + type: (ObjectConstructor | StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + distance: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + skidding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + triggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + showTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + hideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperTriggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + popperShowTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperHideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + container: { + type: any[]; + default: (props: any) => any; + }; + boundary: { + type: any[]; + default: (props: any) => any; + }; + strategy: { + type: StringConstructor; + validator: (value: string) => boolean; + default: (props: any) => any; + }; + autoHide: { + type: (FunctionConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + handleResize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + instantMove: { + type: BooleanConstructor; + default: (props: any) => any; + }; + eagerMount: { + type: BooleanConstructor; + default: (props: any) => any; + }; + popperClass: { + type: (ObjectConstructor | StringConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + computeTransformOrigin: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoMinSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoSize: { + type: (StringConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + autoMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoBoundaryMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + preventOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + overflowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + flip: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shift: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shiftCrossAxis: { + type: BooleanConstructor; + default: (props: any) => any; + }; + noAutoFocus: { + type: BooleanConstructor; + default: (props: any) => any; + }; + disposeTimeout: { + type: NumberConstructor; + default: (props: any) => any; + }; +}>> & { + onResize?: (...args: any[]) => any; + onShow?: (...args: any[]) => any; + onHide?: (...args: any[]) => any; + "onUpdate:shown"?: (...args: any[]) => any; + "onApply-show"?: (...args: any[]) => any; + "onApply-hide"?: (...args: any[]) => any; + "onClose-group"?: (...args: any[]) => any; + "onClose-directive"?: (...args: any[]) => any; + "onAuto-hide"?: (...args: any[]) => any; + onDispose?: (...args: any[]) => any; +}, { + placement: string; + strategy: string; + disabled: boolean; + positioningDisabled: boolean; + delay: string | number | Record; + distance: string | number; + skidding: string | number; + triggers: unknown[]; + showTriggers: Function | unknown[]; + hideTriggers: Function | unknown[]; + popperTriggers: unknown[]; + popperShowTriggers: Function | unknown[]; + popperHideTriggers: Function | unknown[]; + container: any; + boundary: any; + autoHide: boolean | Function; + handleResize: boolean; + instantMove: boolean; + eagerMount: boolean; + popperClass: string | unknown[] | Record; + computeTransformOrigin: boolean; + autoMinSize: boolean; + autoSize: string | boolean; + autoMaxSize: boolean; + autoBoundaryMaxSize: boolean; + preventOverflow: boolean; + overflowPadding: string | number; + arrowPadding: string | number; + arrowOverflow: boolean; + flip: boolean; + shift: boolean; + shiftCrossAxis: boolean; + noAutoFocus: boolean; + disposeTimeout: number; + shown: boolean; + referenceNode: Function; + showGroup: string; + ariaId: any; +}, {}>, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, {}, {}>; +export default _default; diff --git a/packages/floating-vue/dist/components/PopperContent.vue.d.ts b/packages/floating-vue/dist/components/PopperContent.vue.d.ts new file mode 100644 index 00000000..0ad9d55f --- /dev/null +++ b/packages/floating-vue/dist/components/PopperContent.vue.d.ts @@ -0,0 +1,37 @@ +declare const _default: import("vue").DefineComponent<{ + popperId: StringConstructor; + theme: StringConstructor; + shown: BooleanConstructor; + mounted: BooleanConstructor; + skipTransition: BooleanConstructor; + autoHide: BooleanConstructor; + handleResize: BooleanConstructor; + classes: ObjectConstructor; + result: ObjectConstructor; +}, unknown, unknown, {}, { + toPx(value: any): string; +}, { + computed: { + themeClass(): string[]; + }; +}, import("vue").ComponentOptionsMixin, ("resize" | "hide")[], "resize" | "hide", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly> & { + onResize?: (...args: any[]) => any; + onHide?: (...args: any[]) => any; +}, { + autoHide: boolean; + handleResize: boolean; + shown: boolean; + mounted: boolean; + skipTransition: boolean; +}, {}>; +export default _default; diff --git a/packages/floating-vue/dist/components/PopperMethods.d.ts b/packages/floating-vue/dist/components/PopperMethods.d.ts new file mode 100644 index 00000000..48eb29c7 --- /dev/null +++ b/packages/floating-vue/dist/components/PopperMethods.d.ts @@ -0,0 +1,9 @@ +declare const _default: { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}; +export default _default; diff --git a/packages/floating-vue/dist/components/PopperWrapper.vue.d.ts b/packages/floating-vue/dist/components/PopperWrapper.vue.d.ts new file mode 100644 index 00000000..2f760e83 --- /dev/null +++ b/packages/floating-vue/dist/components/PopperWrapper.vue.d.ts @@ -0,0 +1,29 @@ +declare const _default: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: any; + }; +}, unknown, unknown, { + finalTheme(): string; +}, { + getTargetNodes(): unknown[]; +}, { + computed: { + themeClass(): string[]; + }; +} | { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, { + theme: string; +}, {}>; +export default _default; diff --git a/packages/floating-vue/dist/components/ThemeClass.d.ts b/packages/floating-vue/dist/components/ThemeClass.d.ts new file mode 100644 index 00000000..e4672f5f --- /dev/null +++ b/packages/floating-vue/dist/components/ThemeClass.d.ts @@ -0,0 +1,6 @@ +declare const _default: (prop?: string) => { + computed: { + themeClass(): string[]; + }; +}; +export default _default; diff --git a/packages/floating-vue/dist/components/Tooltip.vue.d.ts b/packages/floating-vue/dist/components/Tooltip.vue.d.ts new file mode 100644 index 00000000..925ee1f0 --- /dev/null +++ b/packages/floating-vue/dist/components/Tooltip.vue.d.ts @@ -0,0 +1,29 @@ +declare const Component: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: any; + }; +}, unknown, unknown, { + finalTheme(): string; +}, { + getTargetNodes(): unknown[]; +}, { + computed: { + themeClass(): string[]; + }; +} | { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, { + theme: string; +}, {}>; +export default Component; diff --git a/packages/floating-vue/dist/components/TooltipDirective.vue.d.ts b/packages/floating-vue/dist/components/TooltipDirective.vue.d.ts new file mode 100644 index 00000000..f85ed63e --- /dev/null +++ b/packages/floating-vue/dist/components/TooltipDirective.vue.d.ts @@ -0,0 +1,67 @@ +declare const _default: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: string; + }; + html: { + type: BooleanConstructor; + default: (props: any) => any; + }; + content: { + type: (StringConstructor | FunctionConstructor | NumberConstructor)[]; + default: any; + }; + loadingContent: { + type: StringConstructor; + default: (props: any) => any; + }; + targetNodes: { + type: FunctionConstructor; + required: true; + }; +}, unknown, { + asyncContent: string; +}, { + isContentAsync(): boolean; + loading(): boolean; + finalContent(): string; +}, { + fetchContent(force: boolean): void; + onResult(fetchId: any, result: any): void; + onShow(): void; + onHide(): void; +}, { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly any; + }; + content: { + type: (StringConstructor | FunctionConstructor | NumberConstructor)[]; + default: any; + }; + loadingContent: { + type: StringConstructor; + default: (props: any) => any; + }; + targetNodes: { + type: FunctionConstructor; + required: true; + }; +}>>, { + theme: string; + html: boolean; + content: string | number | Function; + loadingContent: string; +}, {}>; +export default _default; diff --git a/packages/floating-vue/dist/config.d.ts b/packages/floating-vue/dist/config.d.ts new file mode 100644 index 00000000..87f67a35 --- /dev/null +++ b/packages/floating-vue/dist/config.d.ts @@ -0,0 +1,11 @@ +export type FloatingVueConfig = any; +export declare const config: FloatingVueConfig; +/** + * Get default config value depending on theme + */ +export declare function getDefaultConfig(theme: string, key: string): any; +/** + * Theme CSS inheritance + */ +export declare function getThemeClasses(theme: string): string[]; +export declare function getAllParentThemes(theme: string): string[]; diff --git a/packages/floating-vue/dist/directives/v-close-popper.d.ts b/packages/floating-vue/dist/directives/v-close-popper.d.ts new file mode 100644 index 00000000..f94fb8b8 --- /dev/null +++ b/packages/floating-vue/dist/directives/v-close-popper.d.ts @@ -0,0 +1,13 @@ +declare const _default: { + beforeMount(el: any, { value, modifiers }: { + value: any; + modifiers: any; + }): void; + updated(el: any, { value, oldValue, modifiers }: { + value: any; + oldValue: any; + modifiers: any; + }): void; + beforeUnmount(el: any): void; +}; +export default _default; diff --git a/packages/floating-vue/dist/directives/v-tooltip.d.ts b/packages/floating-vue/dist/directives/v-tooltip.d.ts new file mode 100644 index 00000000..4728e68e --- /dev/null +++ b/packages/floating-vue/dist/directives/v-tooltip.d.ts @@ -0,0 +1,27 @@ +import { Ref } from 'vue'; +/** + * Support placement as directive modifier + */ +export declare function getPlacement(options: any, modifiers: any): any; +export declare function getOptions(el: any, value: any, modifiers: any): any; +export declare function createTooltip(el: any, value: any, modifiers: any): { + options: any; + item: { + id: number; + options: any; + shown: Ref; + }; + show(): void; + hide(): void; +}; +export declare function destroyTooltip(el: any): void; +export declare function bind(el: any, { value, modifiers }: { + value: any; + modifiers: any; +}): void; +declare const _default: { + beforeMount: typeof bind; + updated: typeof bind; + beforeUnmount(el: any): void; +}; +export default _default; diff --git a/packages/floating-vue/dist/directives/v-tooltip.spec.d.ts b/packages/floating-vue/dist/directives/v-tooltip.spec.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/packages/floating-vue/dist/directives/v-tooltip.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/floating-vue/dist/floating-vue.mjs b/packages/floating-vue/dist/floating-vue.mjs new file mode 100644 index 00000000..62417c40 --- /dev/null +++ b/packages/floating-vue/dist/floating-vue.mjs @@ -0,0 +1,1395 @@ +import { defineComponent as H, openBlock as c, createElementBlock as P, normalizeClass as O, renderSlot as N, normalizeProps as Me, guardReactiveProps as ke, pushScopeId as Ee, popScopeId as Le, nextTick as Be, createBlock as M, withScopeId as De, resolveComponent as T, normalizeStyle as x, withKeys as Ie, createElementVNode as $, Fragment as Re, createCommentVNode as ee, withCtx as A, createVNode as ce, mergeProps as Fe, toDisplayString as Ve, ref as Y, createApp as je, h as xe } from "vue"; +import { offset as We, autoPlacement as Ge, shift as qe, flip as Ye, arrow as Xe, size as Ue, computePosition as Ke, getOverflowAncestors as te } from "@floating-ui/dom"; +function fe(e, t) { + for (const o in t) + Object.prototype.hasOwnProperty.call(t, o) && (typeof t[o] == "object" && e[o] ? fe(e[o], t[o]) : e[o] = t[o]); +} +const u = { + // Disable popper components + disabled: !1, + // Default position offset along main axis (px) + distance: 5, + // Default position offset along cross axis (px) + skidding: 0, + // Default container where the tooltip will be appended + container: "body", + // Element used to compute position and size boundaries + boundary: void 0, + // Skip delay & CSS transitions when another popper is shown, so that the popper appear to instanly move to the new position. + instantMove: !1, + // Auto destroy tooltip DOM nodes (ms) + disposeTimeout: 5e3, + // Triggers on the popper itself + popperTriggers: [], + // Positioning strategy + strategy: "absolute", + // Prevent overflow + preventOverflow: !0, + // Flip to the opposite placement if needed + flip: !0, + // Shift on the cross axis to prevent the popper from overflowing + shift: !0, + // Overflow padding (px) + overflowPadding: 0, + // Arrow padding (px) + arrowPadding: 0, + // Compute arrow overflow (useful to hide it) + arrowOverflow: !0, + // Themes + themes: { + tooltip: { + // Default tooltip placement relative to target element + placement: "top", + // Default events that trigger the tooltip + triggers: ["hover", "focus", "touch"], + // Close tooltip on click on tooltip target + hideTriggers: (e) => [...e, "click"], + // Delay (ms) + delay: { + show: 200, + hide: 0 + }, + // Update popper on content resize + handleResize: !1, + // Enable HTML content in directive + html: !1, + // Displayed when tooltip content is loading + loadingContent: "..." + }, + dropdown: { + // Default dropdown placement relative to target element + placement: "bottom", + // Default events that trigger the dropdown + triggers: ["click"], + // Delay (ms) + delay: 0, + // Update popper on content resize + handleResize: !0, + // Hide on clock outside + autoHide: !0 + }, + menu: { + $extend: "dropdown", + triggers: ["hover", "focus"], + popperTriggers: ["hover", "focus"], + delay: { + show: 0, + hide: 400 + } + } + } +}; +function b(e, t) { + let o = u.themes[e] || {}, i; + do + i = o[t], typeof i > "u" ? o.$extend ? o = u.themes[o.$extend] || {} : (o = null, i = u[t]) : o = null; + while (o); + return i; +} +function Je(e) { + const t = [e]; + let o = u.themes[e] || {}; + do + o.$extend && !o.$resetCss ? (t.push(o.$extend), o = u.themes[o.$extend] || {}) : o = null; + while (o); + return t.map((i) => `v-popper--theme-${i}`); +} +function oe(e) { + const t = [e]; + let o = u.themes[e] || {}; + do + o.$extend ? (t.push(o.$extend), o = u.themes[o.$extend] || {}) : o = null; + while (o); + return t; +} +let w = !1; +if (typeof window < "u") { + w = !1; + try { + const e = Object.defineProperty({}, "passive", { + get() { + w = !0; + } + }); + window.addEventListener("test", null, e); + } catch { + } +} +let me = !1; +typeof window < "u" && typeof navigator < "u" && (me = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream); +const ge = ["auto", "top", "bottom", "left", "right"].reduce((e, t) => e.concat([ + t, + `${t}-start`, + `${t}-end` +]), []), ie = { + hover: "mouseenter", + focus: "focus", + click: "click", + touch: "touchstart", + pointer: "pointerdown" +}, se = { + hover: "mouseleave", + focus: "blur", + click: "click", + touch: "touchend", + pointer: "pointerup" +}; +function ne(e, t) { + const o = e.indexOf(t); + o !== -1 && e.splice(o, 1); +} +function W() { + return new Promise((e) => requestAnimationFrame(() => { + requestAnimationFrame(e); + })); +} +const d = []; +let g = null; +const re = {}; +function pe(e) { + let t = re[e]; + return t || (t = re[e] = []), t; +} +let X = function() { +}; +typeof window < "u" && (X = window.Element); +function n(e) { + return function(t) { + return b(t.theme, e); + }; +} +const G = "__floating-vue__popper", K = () => H({ + name: "VPopper", + provide() { + return { + [G]: { + parentPopper: this + } + }; + }, + inject: { + [G]: { default: null } + }, + props: { + theme: { + type: String, + required: !0 + }, + targetNodes: { + type: Function, + required: !0 + }, + referenceNode: { + type: Function, + default: null + }, + popperNode: { + type: Function, + required: !0 + }, + shown: { + type: Boolean, + default: !1 + }, + showGroup: { + type: String, + default: null + }, + // eslint-disable-next-line vue/require-prop-types + ariaId: { + default: null + }, + disabled: { + type: Boolean, + default: n("disabled") + }, + positioningDisabled: { + type: Boolean, + default: n("positioningDisabled") + }, + placement: { + type: String, + default: n("placement"), + validator: (e) => ge.includes(e) + }, + delay: { + type: [String, Number, Object], + default: n("delay") + }, + distance: { + type: [Number, String], + default: n("distance") + }, + skidding: { + type: [Number, String], + default: n("skidding") + }, + triggers: { + type: Array, + default: n("triggers") + }, + showTriggers: { + type: [Array, Function], + default: n("showTriggers") + }, + hideTriggers: { + type: [Array, Function], + default: n("hideTriggers") + }, + popperTriggers: { + type: Array, + default: n("popperTriggers") + }, + popperShowTriggers: { + type: [Array, Function], + default: n("popperShowTriggers") + }, + popperHideTriggers: { + type: [Array, Function], + default: n("popperHideTriggers") + }, + container: { + type: [String, Object, X, Boolean], + default: n("container") + }, + boundary: { + type: [String, X], + default: n("boundary") + }, + strategy: { + type: String, + validator: (e) => ["absolute", "fixed"].includes(e), + default: n("strategy") + }, + autoHide: { + type: [Boolean, Function], + default: n("autoHide") + }, + handleResize: { + type: Boolean, + default: n("handleResize") + }, + instantMove: { + type: Boolean, + default: n("instantMove") + }, + eagerMount: { + type: Boolean, + default: n("eagerMount") + }, + popperClass: { + type: [String, Array, Object], + default: n("popperClass") + }, + computeTransformOrigin: { + type: Boolean, + default: n("computeTransformOrigin") + }, + /** + * @deprecated + */ + autoMinSize: { + type: Boolean, + default: n("autoMinSize") + }, + autoSize: { + type: [Boolean, String], + default: n("autoSize") + }, + /** + * @deprecated + */ + autoMaxSize: { + type: Boolean, + default: n("autoMaxSize") + }, + autoBoundaryMaxSize: { + type: Boolean, + default: n("autoBoundaryMaxSize") + }, + preventOverflow: { + type: Boolean, + default: n("preventOverflow") + }, + overflowPadding: { + type: [Number, String], + default: n("overflowPadding") + }, + arrowPadding: { + type: [Number, String], + default: n("arrowPadding") + }, + arrowOverflow: { + type: Boolean, + default: n("arrowOverflow") + }, + flip: { + type: Boolean, + default: n("flip") + }, + shift: { + type: Boolean, + default: n("shift") + }, + shiftCrossAxis: { + type: Boolean, + default: n("shiftCrossAxis") + }, + noAutoFocus: { + type: Boolean, + default: n("noAutoFocus") + }, + disposeTimeout: { + type: Number, + default: n("disposeTimeout") + } + }, + emits: [ + "show", + "hide", + "update:shown", + "apply-show", + "apply-hide", + "close-group", + "close-directive", + "auto-hide", + "resize", + "dispose" + ], + data() { + return { + isShown: !1, + isMounted: !1, + skipTransition: !1, + classes: { + showFrom: !1, + showTo: !1, + hideFrom: !1, + hideTo: !0 + }, + result: { + x: 0, + y: 0, + placement: "", + strategy: this.strategy, + arrow: { + x: 0, + y: 0, + centerOffset: 0 + }, + transformOrigin: null + }, + shownChildren: /* @__PURE__ */ new Set(), + lastAutoHide: !0 + }; + }, + computed: { + popperId() { + return this.ariaId != null ? this.ariaId : this.randomId; + }, + shouldMountContent() { + return this.eagerMount || this.isMounted; + }, + slotData() { + return { + popperId: this.popperId, + isShown: this.isShown, + shouldMountContent: this.shouldMountContent, + skipTransition: this.skipTransition, + autoHide: typeof this.autoHide == "function" ? this.lastAutoHide : this.autoHide, + show: this.show, + hide: this.hide, + handleResize: this.handleResize, + onResize: this.onResize, + classes: { + ...this.classes, + popperClass: this.popperClass + }, + result: this.positioningDisabled ? null : this.result, + attrs: this.$attrs + }; + }, + parentPopper() { + var e; + return (e = this[G]) == null ? void 0 : e.parentPopper; + }, + hasPopperShowTriggerHover() { + var e, t; + return ((e = this.popperTriggers) == null ? void 0 : e.includes("hover")) || ((t = this.popperShowTriggers) == null ? void 0 : t.includes("hover")); + } + }, + watch: { + shown: "$_autoShowHide", + disabled(e) { + e ? this.dispose() : this.init(); + }, + async container() { + this.isShown && (this.$_ensureTeleport(), await this.$_computePosition()); + }, + ...[ + "triggers", + "positioningDisabled" + ].reduce((e, t) => (e[t] = "$_refreshListeners", e), {}), + ...[ + "placement", + "distance", + "skidding", + "boundary", + "strategy", + "overflowPadding", + "arrowPadding", + "preventOverflow", + "shift", + "shiftCrossAxis", + "flip" + ].reduce((e, t) => (e[t] = "$_computePosition", e), {}) + }, + created() { + this.$_isDisposed = !0, this.randomId = `popper_${[Math.random(), Date.now()].map((e) => e.toString(36).substring(2, 10)).join("_")}`, this.autoMinSize && console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'), this.autoMaxSize && console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead."); + }, + mounted() { + this.init(), this.$_detachPopperNode(); + }, + activated() { + this.$_autoShowHide(); + }, + deactivated() { + this.hide(); + }, + beforeUnmount() { + this.dispose(); + }, + methods: { + show({ event: e = null, skipDelay: t = !1, force: o = !1 } = {}) { + var i, s; + (i = this.parentPopper) != null && i.lockedChild && this.parentPopper.lockedChild !== this || (this.$_pendingHide = !1, (o || !this.disabled) && (((s = this.parentPopper) == null ? void 0 : s.lockedChild) === this && (this.parentPopper.lockedChild = null), this.$_scheduleShow(e, t), this.$emit("show"), this.$_showFrameLocked = !0, requestAnimationFrame(() => { + this.$_showFrameLocked = !1; + })), this.$emit("update:shown", !0)); + }, + hide({ event: e = null, skipDelay: t = !1 } = {}) { + var o; + if (!this.$_hideInProgress) { + if (new Set(this.shownChildren).size > 0) { + this.$_pendingHide = !0; + return; + } + if (this.hasPopperShowTriggerHover && this.$_isAimingPopper()) { + this.parentPopper && (this.parentPopper.lockedChild = this, clearTimeout(this.parentPopper.lockedChildTimer), this.parentPopper.lockedChildTimer = setTimeout(() => { + this.parentPopper.lockedChild === this && (this.parentPopper.lockedChild.hide({ skipDelay: t }), this.parentPopper.lockedChild = null); + }, 1e3)); + return; + } + ((o = this.parentPopper) == null ? void 0 : o.lockedChild) === this && (this.parentPopper.lockedChild = null), this.$_pendingHide = !1, this.$_scheduleHide(e, t), this.$emit("hide"), this.$emit("update:shown", !1); + } + }, + init() { + var e; + this.$_isDisposed && (this.$_isDisposed = !1, this.isMounted = !1, this.$_events = [], this.$_preventShow = !1, this.$_referenceNode = ((e = this.referenceNode) == null ? void 0 : e.call(this)) ?? this.$el, this.$_targetNodes = this.targetNodes().filter((t) => t.nodeType === t.ELEMENT_NODE), this.$_popperNode = this.popperNode(), this.$_innerNode = this.$_popperNode.querySelector(".v-popper__inner"), this.$_arrowNode = this.$_popperNode.querySelector(".v-popper__arrow-container"), this.$_swapTargetAttrs("title", "data-original-title"), this.$_detachPopperNode(), this.triggers.length && this.$_addEventListeners(), this.shown && this.show()); + }, + dispose() { + this.$_isDisposed || (this.$_isDisposed = !0, this.$_removeEventListeners(), this.hide({ skipDelay: !0 }), this.$_detachPopperNode(), this.isMounted = !1, this.isShown = !1, this.$_updateParentShownChildren(!1), this.$_swapTargetAttrs("data-original-title", "title"), this.$emit("dispose")); + }, + async onResize() { + this.isShown && (await this.$_computePosition(), this.$emit("resize")); + }, + async $_computePosition() { + if (this.$_isDisposed || this.positioningDisabled) + return; + const e = { + strategy: this.strategy, + middleware: [] + }; + (this.distance || this.skidding) && e.middleware.push(We({ + mainAxis: this.distance, + crossAxis: this.skidding + })); + const t = this.placement.startsWith("auto"); + if (t ? e.middleware.push(Ge({ + alignment: this.placement.split("-")[1] ?? "" + })) : e.placement = this.placement, this.preventOverflow && (this.shift && e.middleware.push(qe({ + padding: this.overflowPadding, + boundary: this.boundary, + crossAxis: this.shiftCrossAxis + })), !t && this.flip && e.middleware.push(Ye({ + padding: this.overflowPadding, + boundary: this.boundary + }))), e.middleware.push(Xe({ + element: this.$_arrowNode, + padding: this.arrowPadding + })), this.arrowOverflow && e.middleware.push({ + name: "arrowOverflow", + fn: ({ placement: i, rects: s, middlewareData: r }) => { + let p; + const { centerOffset: a } = r.arrow; + return i.startsWith("top") || i.startsWith("bottom") ? p = Math.abs(a) > s.reference.width / 2 : p = Math.abs(a) > s.reference.height / 2, { + data: { + overflow: p + } + }; + } + }), this.autoMinSize || this.autoSize) { + const i = this.autoSize ? this.autoSize : this.autoMinSize ? "min" : null; + e.middleware.push({ + name: "autoSize", + fn: ({ rects: s, placement: r, middlewareData: p }) => { + var h; + if ((h = p.autoSize) != null && h.skip) + return {}; + let a, l; + return r.startsWith("top") || r.startsWith("bottom") ? a = s.reference.width : l = s.reference.height, this.$_innerNode.style[i === "min" ? "minWidth" : i === "max" ? "maxWidth" : "width"] = a != null ? `${a}px` : null, this.$_innerNode.style[i === "min" ? "minHeight" : i === "max" ? "maxHeight" : "height"] = l != null ? `${l}px` : null, { + data: { + skip: !0 + }, + reset: { + rects: !0 + } + }; + } + }); + } + (this.autoMaxSize || this.autoBoundaryMaxSize) && (this.$_innerNode.style.maxWidth = null, this.$_innerNode.style.maxHeight = null, e.middleware.push(Ue({ + boundary: this.boundary, + padding: this.overflowPadding, + apply: ({ availableWidth: i, availableHeight: s }) => { + this.$_innerNode.style.maxWidth = i != null ? `${i}px` : null, this.$_innerNode.style.maxHeight = s != null ? `${s}px` : null; + } + }))); + const o = await Ke(this.$_referenceNode, this.$_popperNode, e); + Object.assign(this.result, { + x: o.x, + y: o.y, + placement: o.placement, + strategy: o.strategy, + arrow: { + ...o.middlewareData.arrow, + ...o.middlewareData.arrowOverflow + } + }); + }, + $_scheduleShow(e = null, t = !1) { + if (this.$_updateParentShownChildren(!0), this.$_hideInProgress = !1, clearTimeout(this.$_scheduleTimer), g && this.instantMove && g.instantMove && g !== this.parentPopper) { + g.$_applyHide(!0), this.$_applyShow(!0); + return; + } + t ? this.$_applyShow() : this.$_scheduleTimer = setTimeout(this.$_applyShow.bind(this), this.$_computeDelay("show")); + }, + $_scheduleHide(e = null, t = !1) { + if (new Set(this.shownChildren).size > 0) { + this.$_pendingHide = !0; + return; + } + this.$_updateParentShownChildren(!1), this.$_hideInProgress = !0, clearTimeout(this.$_scheduleTimer), this.isShown && (g = this), t ? this.$_applyHide() : this.$_scheduleTimer = setTimeout(this.$_applyHide.bind(this), this.$_computeDelay("hide")); + }, + $_computeDelay(e) { + const t = this.delay; + return parseInt(t && t[e] || t || 0); + }, + async $_applyShow(e = !1) { + clearTimeout(this.$_disposeTimer), clearTimeout(this.$_scheduleTimer), this.skipTransition = e, !this.isShown && (this.$_ensureTeleport(), await W(), await this.$_computePosition(), await this.$_applyShowEffect(), this.positioningDisabled || this.$_registerEventListeners([ + ...te(this.$_referenceNode), + ...te(this.$_popperNode) + ], "scroll", () => { + this.$_computePosition(); + })); + }, + async $_applyShowEffect() { + if (this.$_hideInProgress) + return; + if (this.computeTransformOrigin) { + const t = this.$_referenceNode.getBoundingClientRect(), o = this.$_popperNode.querySelector(".v-popper__wrapper"), i = o.parentNode.getBoundingClientRect(), s = t.x + t.width / 2 - (i.left + o.offsetLeft), r = t.y + t.height / 2 - (i.top + o.offsetTop); + this.result.transformOrigin = `${s}px ${r}px`; + } + this.isShown = !0, this.$_applyAttrsToTarget({ + "aria-describedby": this.popperId, + "data-popper-shown": "" + }); + const e = this.showGroup; + if (e) { + let t; + for (let o = 0; o < d.length; o++) + t = d[o], t.showGroup !== e && (t.hide(), t.$emit("close-group")); + } + d.push(this), document.body.classList.add("v-popper--some-open"); + for (const t of oe(this.theme)) + pe(t).push(this), document.body.classList.add(`v-popper--some-open--${t}`); + this.$emit("apply-show"), this.classes.showFrom = !0, this.classes.showTo = !1, this.classes.hideFrom = !1, this.classes.hideTo = !1, await W(), this.classes.showFrom = !1, this.classes.showTo = !0, this.noAutoFocus || this.$_popperNode.focus(); + }, + async $_applyHide(e = !1) { + if (new Set(this.shownChildren).size > 0) { + this.$_pendingHide = !0, this.$_hideInProgress = !1; + return; + } + if (clearTimeout(this.$_scheduleTimer), !this.isShown) + return; + this.skipTransition = e, ne(d, this), d.length === 0 && document.body.classList.remove("v-popper--some-open"); + for (const o of oe(this.theme)) { + const i = pe(o); + ne(i, this), i.length === 0 && document.body.classList.remove(`v-popper--some-open--${o}`); + } + g === this && (g = null), this.isShown = !1, this.$_applyAttrsToTarget({ + "aria-describedby": void 0, + "data-popper-shown": void 0 + }), clearTimeout(this.$_disposeTimer); + const t = this.disposeTimeout; + t !== null && (this.$_disposeTimer = setTimeout(() => { + this.$_popperNode && (this.$_detachPopperNode(), this.isMounted = !1); + }, t)), this.$_removeEventListeners("scroll"), this.$emit("apply-hide"), this.classes.showFrom = !1, this.classes.showTo = !1, this.classes.hideFrom = !0, this.classes.hideTo = !1, await W(), this.classes.hideFrom = !1, this.classes.hideTo = !0; + }, + $_autoShowHide() { + this.shown ? this.show() : this.hide(); + }, + $_ensureTeleport() { + if (this.$_isDisposed) + return; + let e = this.container; + if (typeof e == "string" ? e = window.document.querySelector(e) : e === !1 && (e = this.$_targetNodes[0].parentNode), !e) + throw new Error("No container for popover: " + this.container); + e.appendChild(this.$_popperNode), this.isMounted = !0; + }, + $_addEventListeners() { + const e = (o) => { + this.isShown && !this.$_hideInProgress || (o.usedByTooltip = !0, !this.$_preventShow && this.show({ event: o })); + }; + this.$_registerTriggerListeners(this.$_targetNodes, ie, this.triggers, this.showTriggers, e), this.$_registerTriggerListeners([this.$_popperNode], ie, this.popperTriggers, this.popperShowTriggers, e); + const t = (o) => { + o.usedByTooltip || this.hide({ event: o }); + }; + this.$_registerTriggerListeners(this.$_targetNodes, se, this.triggers, this.hideTriggers, t), this.$_registerTriggerListeners([this.$_popperNode], se, this.popperTriggers, this.popperHideTriggers, t); + }, + $_registerEventListeners(e, t, o) { + this.$_events.push({ targetNodes: e, eventType: t, handler: o }), e.forEach((i) => i.addEventListener(t, o, w ? { + passive: !0 + } : void 0)); + }, + $_registerTriggerListeners(e, t, o, i, s) { + let r = o; + i != null && (r = typeof i == "function" ? i(r) : i), r.forEach((p) => { + const a = t[p]; + a && this.$_registerEventListeners(e, a, s); + }); + }, + $_removeEventListeners(e) { + const t = []; + this.$_events.forEach((o) => { + const { targetNodes: i, eventType: s, handler: r } = o; + !e || e === s ? i.forEach((p) => p.removeEventListener(s, r)) : t.push(o); + }), this.$_events = t; + }, + $_refreshListeners() { + this.$_isDisposed || (this.$_removeEventListeners(), this.$_addEventListeners()); + }, + $_handleGlobalClose(e, t = !1) { + this.$_showFrameLocked || (this.hide({ event: e }), e.closePopover ? this.$emit("close-directive") : this.$emit("auto-hide"), t && (this.$_preventShow = !0, setTimeout(() => { + this.$_preventShow = !1; + }, 300))); + }, + $_detachPopperNode() { + this.$_popperNode.parentNode && this.$_popperNode.parentNode.removeChild(this.$_popperNode); + }, + $_swapTargetAttrs(e, t) { + for (const o of this.$_targetNodes) { + const i = o.getAttribute(e); + i && (o.removeAttribute(e), o.setAttribute(t, i)); + } + }, + $_applyAttrsToTarget(e) { + for (const t of this.$_targetNodes) + for (const o in e) { + const i = e[o]; + i == null ? t.removeAttribute(o) : t.setAttribute(o, i); + } + }, + $_updateParentShownChildren(e) { + let t = this.parentPopper; + for (; t; ) + e ? t.shownChildren.add(this.randomId) : (t.shownChildren.delete(this.randomId), t.$_pendingHide && t.hide()), t = t.parentPopper; + }, + $_isAimingPopper() { + const e = this.$_referenceNode.getBoundingClientRect(); + if (v >= e.left && v <= e.right && y >= e.top && y <= e.bottom) { + const t = this.$_popperNode.getBoundingClientRect(), o = v - f, i = y - m, r = t.left + t.width / 2 - f + (t.top + t.height / 2) - m + t.width + t.height, p = f + o * r, a = m + i * r; + return S(f, m, p, a, t.left, t.top, t.left, t.bottom) || // Left edge + S(f, m, p, a, t.left, t.top, t.right, t.top) || // Top edge + S(f, m, p, a, t.right, t.top, t.right, t.bottom) || // Right edge + S(f, m, p, a, t.left, t.bottom, t.right, t.bottom); + } + return !1; + } + }, + render() { + return this.$slots.default(this.slotData); + } +}); +typeof document < "u" && typeof window < "u" && (me ? (document.addEventListener("touchstart", ae, w ? { + passive: !0, + capture: !0 +} : !0), document.addEventListener("touchend", Ze, w ? { + passive: !0, + capture: !0 +} : !0)) : (window.addEventListener("mousedown", ae, !0), window.addEventListener("click", Qe, !0)), window.addEventListener("resize", ot)); +function ae(e) { + for (let t = 0; t < d.length; t++) { + const o = d[t]; + try { + const i = o.popperNode(); + o.$_mouseDownContains = i.contains(e.target); + } catch { + } + } +} +function Qe(e) { + $e(e); +} +function Ze(e) { + $e(e, !0); +} +function $e(e, t = !1) { + const o = {}; + for (let i = d.length - 1; i >= 0; i--) { + const s = d[i]; + try { + const r = s.$_containsGlobalTarget = et(s, e); + s.$_pendingHide = !1, requestAnimationFrame(() => { + if (s.$_pendingHide = !1, !o[s.randomId] && de(s, r, e)) { + if (s.$_handleGlobalClose(e, t), !e.closeAllPopover && e.closePopover && r) { + let a = s.parentPopper; + for (; a; ) + o[a.randomId] = !0, a = a.parentPopper; + return; + } + let p = s.parentPopper; + for (; p && de(p, p.$_containsGlobalTarget, e); ) { + p.$_handleGlobalClose(e, t); + p = p.parentPopper; + } + } + }); + } catch { + } + } +} +function et(e, t) { + const o = e.popperNode(); + return e.$_mouseDownContains || o.contains(t.target); +} +function de(e, t, o) { + return o.closeAllPopover || o.closePopover && t || tt(e, o) && !t; +} +function tt(e, t) { + if (typeof e.autoHide == "function") { + const o = e.autoHide(t); + return e.lastAutoHide = o, o; + } + return e.autoHide; +} +function ot(e) { + for (let t = 0; t < d.length; t++) + d[t].$_computePosition(e); +} +function Ht() { + for (let e = 0; e < d.length; e++) + d[e].hide(); +} +let f = 0, m = 0, v = 0, y = 0; +typeof window < "u" && window.addEventListener("mousemove", (e) => { + f = v, m = y, v = e.clientX, y = e.clientY; +}, w ? { + passive: !0 +} : void 0); +function S(e, t, o, i, s, r, p, a) { + const l = ((p - s) * (t - r) - (a - r) * (e - s)) / ((a - r) * (o - e) - (p - s) * (i - t)), h = ((o - e) * (t - r) - (i - t) * (e - s)) / ((a - r) * (o - e) - (p - s) * (i - t)); + return l >= 0 && l <= 1 && h >= 0 && h <= 1; +} +const it = { + extends: K() +}, k = (e, t) => { + const o = e.__vccOpts || e; + for (const [i, s] of t) + o[i] = s; + return o; +}; +function st(e, t, o, i, s, r) { + return c(), P("div", { + ref: "reference", + class: O(["v-popper", { + "v-popper--shown": e.slotData.isShown + }]) + }, [ + N(e.$slots, "default", Me(ke(e.slotData))) + ], 2); +} +const nt = /* @__PURE__ */ k(it, [["render", st]]); +function rt() { + var e = window.navigator.userAgent, t = e.indexOf("MSIE "); + if (t > 0) + return parseInt(e.substring(t + 5, e.indexOf(".", t)), 10); + var o = e.indexOf("Trident/"); + if (o > 0) { + var i = e.indexOf("rv:"); + return parseInt(e.substring(i + 3, e.indexOf(".", i)), 10); + } + var s = e.indexOf("Edge/"); + return s > 0 ? parseInt(e.substring(s + 5, e.indexOf(".", s)), 10) : -1; +} +let z; +function U() { + U.init || (U.init = !0, z = rt() !== -1); +} +var E = { + name: "ResizeObserver", + props: { + emitOnMount: { + type: Boolean, + default: !1 + }, + ignoreWidth: { + type: Boolean, + default: !1 + }, + ignoreHeight: { + type: Boolean, + default: !1 + } + }, + emits: [ + "notify" + ], + mounted() { + U(), Be(() => { + this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitOnMount && this.emitSize(); + }); + const e = document.createElement("object"); + this._resizeObject = e, e.setAttribute("aria-hidden", "true"), e.setAttribute("tabindex", -1), e.onload = this.addResizeHandlers, e.type = "text/html", z && this.$el.appendChild(e), e.data = "about:blank", z || this.$el.appendChild(e); + }, + beforeUnmount() { + this.removeResizeHandlers(); + }, + methods: { + compareAndNotify() { + (!this.ignoreWidth && this._w !== this.$el.offsetWidth || !this.ignoreHeight && this._h !== this.$el.offsetHeight) && (this._w = this.$el.offsetWidth, this._h = this.$el.offsetHeight, this.emitSize()); + }, + emitSize() { + this.$emit("notify", { + width: this._w, + height: this._h + }); + }, + addResizeHandlers() { + this._resizeObject.contentDocument.defaultView.addEventListener("resize", this.compareAndNotify), this.compareAndNotify(); + }, + removeResizeHandlers() { + this._resizeObject && this._resizeObject.onload && (!z && this._resizeObject.contentDocument && this._resizeObject.contentDocument.defaultView.removeEventListener("resize", this.compareAndNotify), this.$el.removeChild(this._resizeObject), this._resizeObject.onload = null, this._resizeObject = null); + } + } +}; +const pt = /* @__PURE__ */ De("data-v-b329ee4c"); +Ee("data-v-b329ee4c"); +const at = { + class: "resize-observer", + tabindex: "-1" +}; +Le(); +const dt = /* @__PURE__ */ pt((e, t, o, i, s, r) => (c(), M("div", at))); +E.render = dt; +E.__scopeId = "data-v-b329ee4c"; +E.__file = "src/components/ResizeObserver.vue"; +const J = (e = "theme") => ({ + computed: { + themeClass() { + return Je(this[e]); + } + } +}), ht = H({ + name: "VPopperContent", + components: { + ResizeObserver: E + }, + mixins: [ + J() + ], + props: { + popperId: String, + theme: String, + shown: Boolean, + mounted: Boolean, + skipTransition: Boolean, + autoHide: Boolean, + handleResize: Boolean, + classes: Object, + result: Object + }, + emits: [ + "hide", + "resize" + ], + methods: { + toPx(e) { + return e != null && !isNaN(e) ? `${e}px` : null; + } + } +}); +const lt = ["id", "aria-hidden", "tabindex", "data-popper-placement"], ut = { + ref: "inner", + class: "v-popper__inner" +}, ct = /* @__PURE__ */ $("div", { class: "v-popper__arrow-outer" }, null, -1), ft = /* @__PURE__ */ $("div", { class: "v-popper__arrow-inner" }, null, -1), mt = [ + ct, + ft +]; +function gt(e, t, o, i, s, r) { + const p = T("ResizeObserver"); + return c(), P("div", { + id: e.popperId, + ref: "popover", + class: O(["v-popper__popper", [ + e.themeClass, + e.classes.popperClass, + { + "v-popper__popper--shown": e.shown, + "v-popper__popper--hidden": !e.shown, + "v-popper__popper--show-from": e.classes.showFrom, + "v-popper__popper--show-to": e.classes.showTo, + "v-popper__popper--hide-from": e.classes.hideFrom, + "v-popper__popper--hide-to": e.classes.hideTo, + "v-popper__popper--skip-transition": e.skipTransition, + "v-popper__popper--arrow-overflow": e.result && e.result.arrow.overflow, + "v-popper__popper--no-positioning": !e.result + } + ]]), + style: x(e.result ? { + position: e.result.strategy, + transform: `translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)` + } : void 0), + "aria-hidden": e.shown ? "false" : "true", + tabindex: e.autoHide ? 0 : void 0, + "data-popper-placement": e.result ? e.result.placement : void 0, + onKeyup: t[2] || (t[2] = Ie((a) => e.autoHide && e.$emit("hide"), ["esc"])) + }, [ + $("div", { + class: "v-popper__backdrop", + onClick: t[0] || (t[0] = (a) => e.autoHide && e.$emit("hide")) + }), + $("div", { + class: "v-popper__wrapper", + style: x(e.result ? { + transformOrigin: e.result.transformOrigin + } : void 0) + }, [ + $("div", ut, [ + e.mounted ? (c(), P(Re, { key: 0 }, [ + $("div", null, [ + N(e.$slots, "default") + ]), + e.handleResize ? (c(), M(p, { + key: 0, + onNotify: t[1] || (t[1] = (a) => e.$emit("resize", a)) + })) : ee("", !0) + ], 64)) : ee("", !0) + ], 512), + $("div", { + ref: "arrow", + class: "v-popper__arrow-container", + style: x(e.result ? { + left: e.toPx(e.result.arrow.x), + top: e.toPx(e.result.arrow.y) + } : void 0) + }, mt, 4) + ], 4) + ], 46, lt); +} +const Q = /* @__PURE__ */ k(ht, [["render", gt]]), Z = { + methods: { + show(...e) { + return this.$refs.popper.show(...e); + }, + hide(...e) { + return this.$refs.popper.hide(...e); + }, + dispose(...e) { + return this.$refs.popper.dispose(...e); + }, + onResize(...e) { + return this.$refs.popper.onResize(...e); + } + } +}, $t = H({ + name: "VPopperWrapper", + components: { + Popper: nt, + PopperContent: Q + }, + mixins: [ + Z, + J("finalTheme") + ], + props: { + theme: { + type: String, + default: null + } + }, + computed: { + finalTheme() { + return this.theme ?? this.$options.vPopperTheme; + } + }, + methods: { + getTargetNodes() { + return Array.from(this.$el.children).filter((e) => e !== this.$refs.popperContent.$el); + } + } +}); +function wt(e, t, o, i, s, r) { + const p = T("PopperContent"), a = T("Popper"); + return c(), M(a, { + ref: "popper", + theme: e.finalTheme, + "target-nodes": e.getTargetNodes, + "popper-node": () => e.$refs.popperContent.$el, + class: O([ + e.themeClass + ]) + }, { + default: A(({ + popperId: l, + isShown: h, + shouldMountContent: B, + skipTransition: D, + autoHide: I, + show: R, + hide: _, + handleResize: F, + onResize: V, + classes: j, + result: Oe + }) => [ + N(e.$slots, "default", { + shown: h, + show: R, + hide: _ + }), + ce(p, { + ref: "popperContent", + "popper-id": l, + theme: e.finalTheme, + shown: h, + mounted: B, + "skip-transition": D, + "auto-hide": I, + "handle-resize": F, + classes: j, + result: Oe, + onHide: _, + onResize: V + }, { + default: A(() => [ + N(e.$slots, "popper", { + shown: h, + hide: _ + }) + ]), + _: 2 + }, 1032, ["popper-id", "theme", "shown", "mounted", "skip-transition", "auto-hide", "handle-resize", "classes", "result", "onHide", "onResize"]) + ]), + _: 3 + }, 8, ["theme", "target-nodes", "popper-node", "class"]); +} +const L = /* @__PURE__ */ k($t, [["render", wt]]), we = { + ...L, + name: "VDropdown", + vPopperTheme: "dropdown" +}; +const _e = { + ...L, + name: "VMenu", + vPopperTheme: "menu" +}, ve = { + ...L, + name: "VTooltip", + vPopperTheme: "tooltip" +}; +const _t = H({ + name: "VTooltipDirective", + components: { + Popper: K(), + PopperContent: Q + }, + mixins: [ + Z + ], + inheritAttrs: !1, + props: { + theme: { + type: String, + default: "tooltip" + }, + html: { + type: Boolean, + default: (e) => b(e.theme, "html") + }, + content: { + type: [String, Number, Function], + default: null + }, + loadingContent: { + type: String, + default: (e) => b(e.theme, "loadingContent") + }, + targetNodes: { + type: Function, + required: !0 + } + }, + data() { + return { + asyncContent: null + }; + }, + computed: { + isContentAsync() { + return typeof this.content == "function"; + }, + loading() { + return this.isContentAsync && this.asyncContent == null; + }, + finalContent() { + return this.isContentAsync ? this.loading ? this.loadingContent : this.asyncContent : this.content; + } + }, + watch: { + content: { + handler() { + this.fetchContent(!0); + }, + immediate: !0 + }, + async finalContent() { + await this.$nextTick(), this.$refs.popper.onResize(); + } + }, + created() { + this.$_fetchId = 0; + }, + methods: { + fetchContent(e) { + if (typeof this.content == "function" && this.$_isShown && (e || !this.$_loading && this.asyncContent == null)) { + this.asyncContent = null, this.$_loading = !0; + const t = ++this.$_fetchId, o = this.content(this); + o.then ? o.then((i) => this.onResult(t, i)) : this.onResult(t, o); + } + }, + onResult(e, t) { + e === this.$_fetchId && (this.$_loading = !1, this.asyncContent = t); + }, + onShow() { + this.$_isShown = !0, this.fetchContent(); + }, + onHide() { + this.$_isShown = !1; + } + } +}), vt = ["innerHTML"], yt = ["textContent"]; +function Pt(e, t, o, i, s, r) { + const p = T("PopperContent"), a = T("Popper"); + return c(), M(a, Fe({ ref: "popper" }, e.$attrs, { + theme: e.theme, + "target-nodes": e.targetNodes, + "popper-node": () => e.$refs.popperContent.$el, + onApplyShow: e.onShow, + onApplyHide: e.onHide + }), { + default: A(({ + popperId: l, + isShown: h, + shouldMountContent: B, + skipTransition: D, + autoHide: I, + hide: R, + handleResize: _, + onResize: F, + classes: V, + result: j + }) => [ + ce(p, { + ref: "popperContent", + class: O({ + "v-popper--tooltip-loading": e.loading + }), + "popper-id": l, + theme: e.theme, + shown: h, + mounted: B, + "skip-transition": D, + "auto-hide": I, + "handle-resize": _, + classes: V, + result: j, + onHide: R, + onResize: F + }, { + default: A(() => [ + e.html ? (c(), P("div", { + key: 0, + innerHTML: e.finalContent + }, null, 8, vt)) : (c(), P("div", { + key: 1, + textContent: Ve(e.finalContent) + }, null, 8, yt)) + ]), + _: 2 + }, 1032, ["class", "popper-id", "theme", "shown", "mounted", "skip-transition", "auto-hide", "handle-resize", "classes", "result", "onHide", "onResize"]) + ]), + _: 1 + }, 16, ["theme", "target-nodes", "popper-node", "onApplyShow", "onApplyHide"]); +} +const ye = /* @__PURE__ */ k(_t, [["render", Pt]]), Pe = "v-popper--has-tooltip"; +function Tt(e, t) { + let o = e.placement; + if (!o && t) + for (const i of ge) + t[i] && (o = i); + return o || (o = b(e.theme || "tooltip", "placement")), o; +} +function Te(e, t, o) { + let i; + const s = typeof t; + return s === "string" ? i = { content: t } : t && s === "object" ? i = t : i = { content: !1 }, i.placement = Tt(i, o), i.targetNodes = () => [e], i.referenceNode = () => e, i; +} +let q, C, bt = 0; +function Ct() { + if (q) + return; + C = Y([]), q = je({ + name: "VTooltipDirectiveApp", + setup() { + return { + directives: C + }; + }, + render() { + return this.directives.map((t) => xe(ye, { + ...t.options, + shown: t.shown || t.options.shown, + key: t.id + })); + }, + devtools: { + hide: !0 + } + }); + const e = document.createElement("div"); + document.body.appendChild(e), q.mount(e); +} +function St(e, t, o) { + Ct(); + const i = Y(Te(e, t, o)), s = Y(!1), r = { + id: bt++, + options: i, + shown: s + }; + return C.value.push(r), e.classList && e.classList.add(Pe), e.$_popper = { + options: i, + item: r, + show() { + s.value = !0; + }, + hide() { + s.value = !1; + } + }; +} +function be(e) { + if (e.$_popper) { + const t = C.value.indexOf(e.$_popper.item); + t !== -1 && C.value.splice(t, 1), delete e.$_popper, delete e.$_popperOldShown, delete e.$_popperMountTarget; + } + e.classList && e.classList.remove(Pe); +} +function he(e, { value: t, modifiers: o }) { + const i = Te(e, t, o); + if (!i.content || b(i.theme || "tooltip", "disabled")) + be(e); + else { + let s; + e.$_popper ? (s = e.$_popper, s.options.value = i) : s = St(e, t, o), typeof t.shown < "u" && t.shown !== e.$_popperOldShown && (e.$_popperOldShown = t.shown, t.shown ? s.show() : s.hide()); + } +} +const Ce = { + beforeMount: he, + updated: he, + beforeUnmount(e) { + be(e); + } +}; +function le(e) { + e.addEventListener("click", Se), e.addEventListener("touchstart", ze, w ? { + passive: !0 + } : !1); +} +function ue(e) { + e.removeEventListener("click", Se), e.removeEventListener("touchstart", ze), e.removeEventListener("touchend", Ne), e.removeEventListener("touchcancel", Ae); +} +function Se(e) { + const t = e.currentTarget; + e.closePopover = !t.$_vclosepopover_touch, e.closeAllPopover = t.$_closePopoverModifiers && !!t.$_closePopoverModifiers.all; +} +function ze(e) { + if (e.changedTouches.length === 1) { + const t = e.currentTarget; + t.$_vclosepopover_touch = !0; + const o = e.changedTouches[0]; + t.$_vclosepopover_touchPoint = o, t.addEventListener("touchend", Ne), t.addEventListener("touchcancel", Ae); + } +} +function Ne(e) { + const t = e.currentTarget; + if (t.$_vclosepopover_touch = !1, e.changedTouches.length === 1) { + const o = e.changedTouches[0], i = t.$_vclosepopover_touchPoint; + e.closePopover = Math.abs(o.screenY - i.screenY) < 20 && Math.abs(o.screenX - i.screenX) < 20, e.closeAllPopover = t.$_closePopoverModifiers && !!t.$_closePopoverModifiers.all; + } +} +function Ae(e) { + const t = e.currentTarget; + t.$_vclosepopover_touch = !1; +} +const He = { + beforeMount(e, { value: t, modifiers: o }) { + e.$_closePopoverModifiers = o, (typeof t > "u" || t) && le(e); + }, + updated(e, { value: t, oldValue: o, modifiers: i }) { + e.$_closePopoverModifiers = i, t !== o && (typeof t > "u" || t ? le(e) : ue(e)); + }, + beforeUnmount(e) { + ue(e); + } +}, Ot = u, Mt = Ce, kt = He, Et = we, Lt = _e, Bt = K, Dt = Q, It = Z, Rt = L, Ft = J, Vt = ve, jt = ye; +function zt(e, t = {}) { + e.$_vTooltipInstalled || (e.$_vTooltipInstalled = !0, fe(u, t), e.directive("tooltip", Ce), e.directive("close-popper", He), e.component("VTooltip", ve), e.component("VDropdown", we), e.component("VMenu", _e)); +} +const xt = { + // eslint-disable-next-line no-undef + version: "2.0.0-reedsy.1.0.2", + install: zt, + options: u +}; +export { + Et as Dropdown, + se as HIDE_EVENT_MAP, + Lt as Menu, + Bt as Popper, + Dt as PopperContent, + It as PopperMethods, + Rt as PopperWrapper, + ie as SHOW_EVENT_MAP, + Ft as ThemeClass, + Vt as Tooltip, + jt as TooltipDirective, + kt as VClosePopper, + Mt as VTooltip, + St as createTooltip, + xt as default, + be as destroyTooltip, + Ht as hideAllPoppers, + zt as install, + Ot as options, + ge as placements +}; diff --git a/packages/floating-vue/dist/floating-vue.umd.js b/packages/floating-vue/dist/floating-vue.umd.js new file mode 100644 index 00000000..0008ec06 --- /dev/null +++ b/packages/floating-vue/dist/floating-vue.umd.js @@ -0,0 +1 @@ +(function(d,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],s):(d=typeof globalThis<"u"?globalThis:d||self,s(d.FloatingVue={},d.Vue,d.FloatingUIDOM))})(this,function(d,s,m){"use strict";function K(e,t){for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(typeof t[o]=="object"&&e[o]?K(e[o],t[o]):e[o]=t[o])}const c={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:5e3,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:e=>[...e,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover","focus"],delay:{show:0,hide:400}}}};function y(e,t){let o=c.themes[e]||{},i;do i=o[t],typeof i>"u"?o.$extend?o=c.themes[o.$extend]||{}:(o=null,i=c[t]):o=null;while(o);return i}function Te(e){const t=[e];let o=c.themes[e]||{};do o.$extend&&!o.$resetCss?(t.push(o.$extend),o=c.themes[o.$extend]||{}):o=null;while(o);return t.map(i=>`v-popper--theme-${i}`)}function J(e){const t=[e];let o=c.themes[e]||{};do o.$extend?(t.push(o.$extend),o=c.themes[o.$extend]||{}):o=null;while(o);return t}const dt="";let $=!1;if(typeof window<"u"){$=!1;try{const e=Object.defineProperty({},"passive",{get(){$=!0}});window.addEventListener("test",null,e)}catch{}}let Q=!1;typeof window<"u"&&typeof navigator<"u"&&(Q=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const k=["auto","top","bottom","left","right"].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),E={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},M={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"};function Z(e,t){const o=e.indexOf(t);o!==-1&&e.splice(o,1)}function O(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const h=[];let w=null;const ee={};function te(e){let t=ee[e];return t||(t=ee[e]=[]),t}let H=function(){};typeof window<"u"&&(H=window.Element);function r(e){return function(t){return y(t.theme,e)}}const B="__floating-vue__popper",L=()=>s.defineComponent({name:"VPopper",provide(){return{[B]:{parentPopper:this}}},inject:{[B]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:r("disabled")},positioningDisabled:{type:Boolean,default:r("positioningDisabled")},placement:{type:String,default:r("placement"),validator:e=>k.includes(e)},delay:{type:[String,Number,Object],default:r("delay")},distance:{type:[Number,String],default:r("distance")},skidding:{type:[Number,String],default:r("skidding")},triggers:{type:Array,default:r("triggers")},showTriggers:{type:[Array,Function],default:r("showTriggers")},hideTriggers:{type:[Array,Function],default:r("hideTriggers")},popperTriggers:{type:Array,default:r("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:r("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:r("popperHideTriggers")},container:{type:[String,Object,H,Boolean],default:r("container")},boundary:{type:[String,H],default:r("boundary")},strategy:{type:String,validator:e=>["absolute","fixed"].includes(e),default:r("strategy")},autoHide:{type:[Boolean,Function],default:r("autoHide")},handleResize:{type:Boolean,default:r("handleResize")},instantMove:{type:Boolean,default:r("instantMove")},eagerMount:{type:Boolean,default:r("eagerMount")},popperClass:{type:[String,Array,Object],default:r("popperClass")},computeTransformOrigin:{type:Boolean,default:r("computeTransformOrigin")},autoMinSize:{type:Boolean,default:r("autoMinSize")},autoSize:{type:[Boolean,String],default:r("autoSize")},autoMaxSize:{type:Boolean,default:r("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:r("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:r("preventOverflow")},overflowPadding:{type:[Number,String],default:r("overflowPadding")},arrowPadding:{type:[Number,String],default:r("arrowPadding")},arrowOverflow:{type:Boolean,default:r("arrowOverflow")},flip:{type:Boolean,default:r("flip")},shift:{type:Boolean,default:r("shift")},shiftCrossAxis:{type:Boolean,default:r("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:r("noAutoFocus")},disposeTimeout:{type:Number,default:r("disposeTimeout")}},emits:["show","hide","update:shown","apply-show","apply-hide","close-group","close-directive","auto-hide","resize","dispose"],data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},shownChildren:new Set,lastAutoHide:!0}},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[B])==null?void 0:e.parentPopper},hasPopperShowTriggerHover(){var e,t;return((e=this.popperTriggers)==null?void 0:e.includes("hover"))||((t=this.popperShowTriggers)==null?void 0:t.includes("hover"))}},watch:{shown:"$_autoShowHide",disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},...["triggers","positioningDisabled"].reduce((e,t)=>(e[t]="$_refreshListeners",e),{}),...["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((e,t)=>(e[t]="$_computePosition",e),{})},created(){this.$_isDisposed=!0,this.randomId=`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join("_")}`,this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:o=!1}={}){var i,n;(i=this.parentPopper)!=null&&i.lockedChild&&this.parentPopper.lockedChild!==this||(this.$_pendingHide=!1,(o||!this.disabled)&&(((n=this.parentPopper)==null?void 0:n.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:e=null,skipDelay:t=!1}={}){var o;if(!this.$_hideInProgress){if(new Set(this.shownChildren).size>0){this.$_pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}((o=this.parentPopper)==null?void 0:o.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_pendingHide=!1,this.$_scheduleHide(e,t),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var e;this.$_isDisposed&&(this.$_isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=((e=this.referenceNode)==null?void 0:e.call(this))??this.$el,this.$_targetNodes=this.targetNodes().filter(t=>t.nodeType===t.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.$_isDisposed||(this.$_isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"),this.$emit("dispose"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){if(this.$_isDisposed||this.positioningDisabled)return;const e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(m.offset({mainAxis:this.distance,crossAxis:this.skidding}));const t=this.placement.startsWith("auto");if(t?e.middleware.push(m.autoPlacement({alignment:this.placement.split("-")[1]??""})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(m.shift({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(m.flip({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(m.arrow({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:"arrowOverflow",fn:({placement:i,rects:n,middlewareData:p})=>{let a;const{centerOffset:l}=p.arrow;return i.startsWith("top")||i.startsWith("bottom")?a=Math.abs(l)>n.reference.width/2:a=Math.abs(l)>n.reference.height/2,{data:{overflow:a}}}}),this.autoMinSize||this.autoSize){const i=this.autoSize?this.autoSize:this.autoMinSize?"min":null;e.middleware.push({name:"autoSize",fn:({rects:n,placement:p,middlewareData:a})=>{var u;if((u=a.autoSize)!=null&&u.skip)return{};let l,f;return p.startsWith("top")||p.startsWith("bottom")?l=n.reference.width:f=n.reference.height,this.$_innerNode.style[i==="min"?"minWidth":i==="max"?"maxWidth":"width"]=l!=null?`${l}px`:null,this.$_innerNode.style[i==="min"?"minHeight":i==="max"?"maxHeight":"height"]=f!=null?`${f}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(m.size({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:i,availableHeight:n})=>{this.$_innerNode.style.maxWidth=i!=null?`${i}px`:null,this.$_innerNode.style.maxHeight=n!=null?`${n}px`:null}})));const o=await m.computePosition(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:o.x,y:o.y,placement:o.placement,strategy:o.strategy,arrow:{...o.middlewareData.arrow,...o.middlewareData.arrowOverflow}})},$_scheduleShow(e=null,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),w&&this.instantMove&&w.instantMove&&w!==this.parentPopper){w.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(e=null,t=!1){if(new Set(this.shownChildren).size>0){this.$_pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(w=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(e){const t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await O(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...m.getOverflowAncestors(this.$_referenceNode),...m.getOverflowAncestors(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const t=this.$_referenceNode.getBoundingClientRect(),o=this.$_popperNode.querySelector(".v-popper__wrapper"),i=o.parentNode.getBoundingClientRect(),n=t.x+t.width/2-(i.left+o.offsetLeft),p=t.y+t.height/2-(i.top+o.offsetTop);this.result.transformOrigin=`${n}px ${p}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const e=this.showGroup;if(e){let t;for(let o=0;o0){this.$_pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,Z(h,this),h.length===0&&document.body.classList.remove("v-popper--some-open");for(const o of J(this.theme)){const i=te(o);Z(i,this),i.length===0&&document.body.classList.remove(`v-popper--some-open--${o}`)}w===this&&(w=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await O(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.$_isDisposed)return;let e=this.container;if(typeof e=="string"?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw new Error("No container for popover: "+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const e=o=>{this.isShown&&!this.$_hideInProgress||(o.usedByTooltip=!0,!this.$_preventShow&&this.show({event:o}))};this.$_registerTriggerListeners(this.$_targetNodes,E,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],E,this.popperTriggers,this.popperShowTriggers,e);const t=o=>{o.usedByTooltip||this.hide({event:o})};this.$_registerTriggerListeners(this.$_targetNodes,M,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],M,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,o){this.$_events.push({targetNodes:e,eventType:t,handler:o}),e.forEach(i=>i.addEventListener(t,o,$?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,o,i,n){let p=o;i!=null&&(p=typeof i=="function"?i(p):i),p.forEach(a=>{const l=t[a];l&&this.$_registerEventListeners(e,l,n)})},$_removeEventListeners(e){const t=[];this.$_events.forEach(o=>{const{targetNodes:i,eventType:n,handler:p}=o;!e||e===n?i.forEach(a=>a.removeEventListener(n,p)):t.push(o)}),this.$_events=t},$_refreshListeners(){this.$_isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(const o of this.$_targetNodes){const i=o.getAttribute(e);i&&(o.removeAttribute(e),o.setAttribute(t,i))}},$_applyAttrsToTarget(e){for(const t of this.$_targetNodes)for(const o in e){const i=e[o];i==null?t.removeAttribute(o):t.setAttribute(o,i)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.$_pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){const e=this.$_referenceNode.getBoundingClientRect();if(v>=e.left&&v<=e.right&&T>=e.top&&T<=e.bottom){const t=this.$_popperNode.getBoundingClientRect(),o=v-g,i=T-_,p=t.left+t.width/2-g+(t.top+t.height/2)-_+t.width+t.height,a=g+o*p,l=_+i*p;return S(g,_,a,l,t.left,t.top,t.left,t.bottom)||S(g,_,a,l,t.left,t.top,t.right,t.top)||S(g,_,a,l,t.right,t.top,t.right,t.bottom)||S(g,_,a,l,t.left,t.bottom,t.right,t.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});typeof document<"u"&&typeof window<"u"&&(Q?(document.addEventListener("touchstart",oe,$?{passive:!0,capture:!0}:!0),document.addEventListener("touchend",Ce,$?{passive:!0,capture:!0}:!0)):(window.addEventListener("mousedown",oe,!0),window.addEventListener("click",Pe,!0)),window.addEventListener("resize",Ne));function oe(e){for(let t=0;t=0;i--){const n=h[i];try{const p=n.$_containsGlobalTarget=Se(n,e);n.$_pendingHide=!1,requestAnimationFrame(()=>{if(n.$_pendingHide=!1,!o[n.randomId]&&se(n,p,e)){if(n.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&p){let l=n.parentPopper;for(;l;)o[l.randomId]=!0,l=l.parentPopper;return}let a=n.parentPopper;for(;a&&se(a,a.$_containsGlobalTarget,e);){a.$_handleGlobalClose(e,t);a=a.parentPopper}}})}catch{}}}function Se(e,t){const o=e.popperNode();return e.$_mouseDownContains||o.contains(t.target)}function se(e,t,o){return o.closeAllPopover||o.closePopover&&t||be(e,o)&&!t}function be(e,t){if(typeof e.autoHide=="function"){const o=e.autoHide(t);return e.lastAutoHide=o,o}return e.autoHide}function Ne(e){for(let t=0;t{g=v,_=T,v=e.clientX,T=e.clientY},$?{passive:!0}:void 0);function S(e,t,o,i,n,p,a,l){const f=((a-n)*(t-p)-(l-p)*(e-n))/((l-p)*(o-e)-(a-n)*(i-t)),u=((o-e)*(t-p)-(i-t)*(e-n))/((l-p)*(o-e)-(a-n)*(i-t));return f>=0&&f<=1&&u>=0&&u<=1}const Ae={extends:L()},b=(e,t)=>{const o=e.__vccOpts||e;for(const[i,n]of t)o[i]=n;return o};function ke(e,t,o,i,n,p){return s.openBlock(),s.createElementBlock("div",{ref:"reference",class:s.normalizeClass(["v-popper",{"v-popper--shown":e.slotData.isShown}])},[s.renderSlot(e.$slots,"default",s.normalizeProps(s.guardReactiveProps(e.slotData)))],2)}const Ee=b(Ae,[["render",ke]]);function Me(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var o=e.indexOf("Trident/");if(o>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var n=e.indexOf("Edge/");return n>0?parseInt(e.substring(n+5,e.indexOf(".",n)),10):-1}let N;function D(){D.init||(D.init=!0,N=Me()!==-1)}var z={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){D(),s.nextTick(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",N&&this.$el.appendChild(e),e.data="about:blank",N||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!N&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Oe=s.withScopeId("data-v-b329ee4c");s.pushScopeId("data-v-b329ee4c");const He={class:"resize-observer",tabindex:"-1"};s.popScopeId();const Be=Oe((e,t,o,i,n,p)=>(s.openBlock(),s.createBlock("div",He)));z.render=Be,z.__scopeId="data-v-b329ee4c",z.__file="src/components/ResizeObserver.vue";const I=(e="theme")=>({computed:{themeClass(){return Te(this[e])}}}),Le=s.defineComponent({name:"VPopperContent",components:{ResizeObserver:z},mixins:[I()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),ht="",De=["id","aria-hidden","tabindex","data-popper-placement"],Ie={ref:"inner",class:"v-popper__inner"},Ve=[s.createElementVNode("div",{class:"v-popper__arrow-outer"},null,-1),s.createElementVNode("div",{class:"v-popper__arrow-inner"},null,-1)];function Re(e,t,o,i,n,p){const a=s.resolveComponent("ResizeObserver");return s.openBlock(),s.createElementBlock("div",{id:e.popperId,ref:"popover",class:s.normalizeClass(["v-popper__popper",[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:s.normalizeStyle(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?"false":"true",tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:t[2]||(t[2]=s.withKeys(l=>e.autoHide&&e.$emit("hide"),["esc"]))},[s.createElementVNode("div",{class:"v-popper__backdrop",onClick:t[0]||(t[0]=l=>e.autoHide&&e.$emit("hide"))}),s.createElementVNode("div",{class:"v-popper__wrapper",style:s.normalizeStyle(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[s.createElementVNode("div",Ie,[e.mounted?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("div",null,[s.renderSlot(e.$slots,"default")]),e.handleResize?(s.openBlock(),s.createBlock(a,{key:0,onNotify:t[1]||(t[1]=l=>e.$emit("resize",l))})):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)],512),s.createElementVNode("div",{ref:"arrow",class:"v-popper__arrow-container",style:s.normalizeStyle(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Ve,4)],4)],46,De)}const V=b(Le,[["render",Re]]),R={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}},Fe=s.defineComponent({name:"VPopperWrapper",components:{Popper:Ee,PopperContent:V},mixins:[R,I("finalTheme")],props:{theme:{type:String,default:null}},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function je(e,t,o,i,n,p){const a=s.resolveComponent("PopperContent"),l=s.resolveComponent("Popper");return s.openBlock(),s.createBlock(l,{ref:"popper",theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:s.normalizeClass([e.themeClass])},{default:s.withCtx(({popperId:f,isShown:u,shouldMountContent:W,skipTransition:q,autoHide:G,show:Y,hide:C,handleResize:x,onResize:U,classes:X,result:lt})=>[s.renderSlot(e.$slots,"default",{shown:u,show:Y,hide:C}),s.createVNode(a,{ref:"popperContent","popper-id":f,theme:e.finalTheme,shown:u,mounted:W,"skip-transition":q,"auto-hide":G,"handle-resize":x,classes:X,result:lt,onHide:C,onResize:U},{default:s.withCtx(()=>[s.renderSlot(e.$slots,"popper",{shown:u,hide:C})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},8,["theme","target-nodes","popper-node","class"])}const A=b(Fe,[["render",je]]),ne={...A,name:"VDropdown",vPopperTheme:"dropdown"},ft="",re={...A,name:"VMenu",vPopperTheme:"menu"},pe={...A,name:"VTooltip",vPopperTheme:"tooltip"},mt="",We=s.defineComponent({name:"VTooltipDirective",components:{Popper:L(),PopperContent:V},mixins:[R],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:e=>y(e.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>y(e.theme,"loadingContent")},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content=="function"&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const t=++this.$_fetchId,o=this.content(this);o.then?o.then(i=>this.onResult(t,i)):this.onResult(t,o)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),qe=["innerHTML"],Ge=["textContent"];function Ye(e,t,o,i,n,p){const a=s.resolveComponent("PopperContent"),l=s.resolveComponent("Popper");return s.openBlock(),s.createBlock(l,s.mergeProps({ref:"popper"},e.$attrs,{theme:e.theme,"target-nodes":e.targetNodes,"popper-node":()=>e.$refs.popperContent.$el,onApplyShow:e.onShow,onApplyHide:e.onHide}),{default:s.withCtx(({popperId:f,isShown:u,shouldMountContent:W,skipTransition:q,autoHide:G,hide:Y,handleResize:C,onResize:x,classes:U,result:X})=>[s.createVNode(a,{ref:"popperContent",class:s.normalizeClass({"v-popper--tooltip-loading":e.loading}),"popper-id":f,theme:e.theme,shown:u,mounted:W,"skip-transition":q,"auto-hide":G,"handle-resize":C,classes:U,result:X,onHide:Y,onResize:x},{default:s.withCtx(()=>[e.html?(s.openBlock(),s.createElementBlock("div",{key:0,innerHTML:e.finalContent},null,8,qe)):(s.openBlock(),s.createElementBlock("div",{key:1,textContent:s.toDisplayString(e.finalContent)},null,8,Ge))]),_:2},1032,["class","popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:1},16,["theme","target-nodes","popper-node","onApplyShow","onApplyHide"])}const ae=b(We,[["render",Ye]]),le="v-popper--has-tooltip";function xe(e,t){let o=e.placement;if(!o&&t)for(const i of k)t[i]&&(o=i);return o||(o=y(e.theme||"tooltip","placement")),o}function de(e,t,o){let i;const n=typeof t;return n==="string"?i={content:t}:t&&n==="object"?i=t:i={content:!1},i.placement=xe(i,o),i.targetNodes=()=>[e],i.referenceNode=()=>e,i}let F,P,Ue=0;function Xe(){if(F)return;P=s.ref([]),F=s.createApp({name:"VTooltipDirectiveApp",setup(){return{directives:P}},render(){return this.directives.map(t=>s.h(ae,{...t.options,shown:t.shown||t.options.shown,key:t.id}))},devtools:{hide:!0}});const e=document.createElement("div");document.body.appendChild(e),F.mount(e)}function he(e,t,o){Xe();const i=s.ref(de(e,t,o)),n=s.ref(!1),p={id:Ue++,options:i,shown:n};return P.value.push(p),e.classList&&e.classList.add(le),e.$_popper={options:i,item:p,show(){n.value=!0},hide(){n.value=!1}}}function j(e){if(e.$_popper){const t=P.value.indexOf(e.$_popper.item);t!==-1&&P.value.splice(t,1),delete e.$_popper,delete e.$_popperOldShown,delete e.$_popperMountTarget}e.classList&&e.classList.remove(le)}function ue(e,{value:t,modifiers:o}){const i=de(e,t,o);if(!i.content||y(i.theme||"tooltip","disabled"))j(e);else{let n;e.$_popper?(n=e.$_popper,n.options.value=i):n=he(e,t,o),typeof t.shown<"u"&&t.shown!==e.$_popperOldShown&&(e.$_popperOldShown=t.shown,t.shown?n.show():n.hide())}}const ce={beforeMount:ue,updated:ue,beforeUnmount(e){j(e)}};function fe(e){e.addEventListener("click",ge),e.addEventListener("touchstart",_e,$?{passive:!0}:!1)}function me(e){e.removeEventListener("click",ge),e.removeEventListener("touchstart",_e),e.removeEventListener("touchend",$e),e.removeEventListener("touchcancel",we)}function ge(e){const t=e.currentTarget;e.closePopover=!t.$_vclosepopover_touch,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}function _e(e){if(e.changedTouches.length===1){const t=e.currentTarget;t.$_vclosepopover_touch=!0;const o=e.changedTouches[0];t.$_vclosepopover_touchPoint=o,t.addEventListener("touchend",$e),t.addEventListener("touchcancel",we)}}function $e(e){const t=e.currentTarget;if(t.$_vclosepopover_touch=!1,e.changedTouches.length===1){const o=e.changedTouches[0],i=t.$_vclosepopover_touchPoint;e.closePopover=Math.abs(o.screenY-i.screenY)<20&&Math.abs(o.screenX-i.screenX)<20,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}}function we(e){const t=e.currentTarget;t.$_vclosepopover_touch=!1}const ye={beforeMount(e,{value:t,modifiers:o}){e.$_closePopoverModifiers=o,(typeof t>"u"||t)&&fe(e)},updated(e,{value:t,oldValue:o,modifiers:i}){e.$_closePopoverModifiers=i,t!==o&&(typeof t>"u"||t?fe(e):me(e))},beforeUnmount(e){me(e)}},Ke=c,Je=ce,Qe=ye,Ze=ne,et=re,tt=L,ot=V,it=R,st=A,nt=I,rt=pe,pt=ae;function ve(e,t={}){e.$_vTooltipInstalled||(e.$_vTooltipInstalled=!0,K(c,t),e.directive("tooltip",ce),e.directive("close-popper",ye),e.component("VTooltip",pe),e.component("VDropdown",ne),e.component("VMenu",re))}const at={version:"2.0.0-reedsy.1.0.2",install:ve,options:c};d.Dropdown=Ze,d.HIDE_EVENT_MAP=M,d.Menu=et,d.Popper=tt,d.PopperContent=ot,d.PopperMethods=it,d.PopperWrapper=st,d.SHOW_EVENT_MAP=E,d.ThemeClass=nt,d.Tooltip=rt,d.TooltipDirective=pt,d.VClosePopper=Qe,d.VTooltip=Je,d.createTooltip=he,d.default=at,d.destroyTooltip=j,d.hideAllPoppers=ze,d.install=ve,d.options=Ke,d.placements=k,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); diff --git a/packages/floating-vue/dist/index.d.ts b/packages/floating-vue/dist/index.d.ts new file mode 100644 index 00000000..1391ec9b --- /dev/null +++ b/packages/floating-vue/dist/index.d.ts @@ -0,0 +1,718 @@ +import { FloatingVueConfig } from './config'; +import 'vue-resize/dist/vue-resize.css'; +export declare const options: any; +export declare const VTooltip: { + beforeMount: typeof import("./directives/v-tooltip").bind; + updated: typeof import("./directives/v-tooltip").bind; + beforeUnmount(el: any): void; +}; +export { createTooltip, destroyTooltip } from './directives/v-tooltip'; +export declare const VClosePopper: { + beforeMount(el: any, { value, modifiers }: { + value: any; + modifiers: any; + }): void; + updated(el: any, { value, oldValue, modifiers }: { + value: any; + oldValue: any; + modifiers: any; + }): void; + beforeUnmount(el: any): void; +}; +export declare const Dropdown: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: any; + }; +}, unknown, unknown, { + finalTheme(): string; +}, { + getTargetNodes(): unknown[]; +}, { + computed: { + themeClass(): string[]; + }; +} | { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, { + theme: string; +}, {}>; +export declare const Menu: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: any; + }; +}, unknown, unknown, { + finalTheme(): string; +}, { + getTargetNodes(): unknown[]; +}, { + computed: { + themeClass(): string[]; + }; +} | { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, { + theme: string; +}, {}>; +export declare const Popper: () => import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + required: true; + }; + targetNodes: { + type: FunctionConstructor; + required: true; + }; + referenceNode: { + type: FunctionConstructor; + default: any; + }; + popperNode: { + type: FunctionConstructor; + required: true; + }; + shown: { + type: BooleanConstructor; + default: boolean; + }; + showGroup: { + type: StringConstructor; + default: any; + }; + ariaId: { + default: any; + }; + disabled: { + type: BooleanConstructor; + default: (props: any) => any; + }; + positioningDisabled: { + type: BooleanConstructor; + default: (props: any) => any; + }; + placement: { + type: StringConstructor; + default: (props: any) => any; + validator: (value: import("./util/popper").Placement) => boolean; + }; + delay: { + type: (ObjectConstructor | StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + distance: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + skidding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + triggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + showTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + hideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperTriggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + popperShowTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperHideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + container: { + type: any[]; + default: (props: any) => any; + }; + boundary: { + type: any[]; + default: (props: any) => any; + }; + strategy: { + type: StringConstructor; + validator: (value: string) => boolean; + default: (props: any) => any; + }; + autoHide: { + type: (FunctionConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + handleResize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + instantMove: { + type: BooleanConstructor; + default: (props: any) => any; + }; + eagerMount: { + type: BooleanConstructor; + default: (props: any) => any; + }; + popperClass: { + type: (ObjectConstructor | StringConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + computeTransformOrigin: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoMinSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoSize: { + type: (StringConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + autoMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoBoundaryMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + preventOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + overflowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + flip: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shift: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shiftCrossAxis: { + type: BooleanConstructor; + default: (props: any) => any; + }; + noAutoFocus: { + type: BooleanConstructor; + default: (props: any) => any; + }; + disposeTimeout: { + type: NumberConstructor; + default: (props: any) => any; + }; +}, unknown, { + isShown: boolean; + isMounted: boolean; + skipTransition: boolean; + classes: { + showFrom: boolean; + showTo: boolean; + hideFrom: boolean; + hideTo: boolean; + }; + result: { + x: number; + y: number; + placement: string; + strategy: string; + arrow: { + x: number; + y: number; + centerOffset: number; + }; + transformOrigin: any; + }; + shownChildren: Set; + lastAutoHide: boolean; +}, { + popperId(): any; + shouldMountContent(): any; + slotData(): { + popperId: any; + isShown: any; + shouldMountContent: any; + skipTransition: any; + autoHide: any; + show: any; + hide: any; + handleResize: any; + onResize: any; + classes: any; + result: any; + attrs: any; + }; + parentPopper(): any; + hasPopperShowTriggerHover(): any; +}, { + show({ event, skipDelay, force }?: { + event?: any; + skipDelay?: boolean; + force?: boolean; + }): void; + hide({ event, skipDelay }?: { + event?: any; + skipDelay?: boolean; + }): void; + init(): void; + dispose(): void; + onResize(): Promise; + $_computePosition(): Promise; + $_scheduleShow(event?: any, skipDelay?: boolean): void; + $_scheduleHide(event?: any, skipDelay?: boolean): void; + $_computeDelay(type: any): number; + $_applyShow(skipTransition?: boolean): Promise; + $_applyShowEffect(): Promise; + $_applyHide(skipTransition?: boolean): Promise; + $_autoShowHide(): void; + $_ensureTeleport(): void; + $_addEventListeners(): void; + $_registerEventListeners(targetNodes: any[], eventType: string, handler: (event: Event) => void): void; + $_registerTriggerListeners(targetNodes: any[], eventMap: Record, commonTriggers: any, customTrigger: any, handler: (event: Event) => void): void; + $_removeEventListeners(filterEventType?: string): void; + $_refreshListeners(): void; + $_handleGlobalClose(event: any, touch?: boolean): void; + $_detachPopperNode(): void; + $_swapTargetAttrs(attrFrom: any, attrTo: any): void; + $_applyAttrsToTarget(attrs: any): void; + $_updateParentShownChildren(value: any): void; + $_isAimingPopper(): boolean; +}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("resize" | "show" | "hide" | "update:shown" | "apply-show" | "apply-hide" | "close-group" | "close-directive" | "auto-hide" | "dispose")[], "resize" | "show" | "hide" | "update:shown" | "apply-show" | "apply-hide" | "close-group" | "close-directive" | "auto-hide" | "dispose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly any; + }; + positioningDisabled: { + type: BooleanConstructor; + default: (props: any) => any; + }; + placement: { + type: StringConstructor; + default: (props: any) => any; + validator: (value: import("./util/popper").Placement) => boolean; + }; + delay: { + type: (ObjectConstructor | StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + distance: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + skidding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + triggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + showTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + hideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperTriggers: { + type: ArrayConstructor; + default: (props: any) => any; + }; + popperShowTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + popperHideTriggers: { + type: (FunctionConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + container: { + type: any[]; + default: (props: any) => any; + }; + boundary: { + type: any[]; + default: (props: any) => any; + }; + strategy: { + type: StringConstructor; + validator: (value: string) => boolean; + default: (props: any) => any; + }; + autoHide: { + type: (FunctionConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + handleResize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + instantMove: { + type: BooleanConstructor; + default: (props: any) => any; + }; + eagerMount: { + type: BooleanConstructor; + default: (props: any) => any; + }; + popperClass: { + type: (ObjectConstructor | StringConstructor | ArrayConstructor)[]; + default: (props: any) => any; + }; + computeTransformOrigin: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoMinSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoSize: { + type: (StringConstructor | BooleanConstructor)[]; + default: (props: any) => any; + }; + autoMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + autoBoundaryMaxSize: { + type: BooleanConstructor; + default: (props: any) => any; + }; + preventOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + overflowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowPadding: { + type: (StringConstructor | NumberConstructor)[]; + default: (props: any) => any; + }; + arrowOverflow: { + type: BooleanConstructor; + default: (props: any) => any; + }; + flip: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shift: { + type: BooleanConstructor; + default: (props: any) => any; + }; + shiftCrossAxis: { + type: BooleanConstructor; + default: (props: any) => any; + }; + noAutoFocus: { + type: BooleanConstructor; + default: (props: any) => any; + }; + disposeTimeout: { + type: NumberConstructor; + default: (props: any) => any; + }; +}>> & { + onResize?: (...args: any[]) => any; + onShow?: (...args: any[]) => any; + onHide?: (...args: any[]) => any; + "onUpdate:shown"?: (...args: any[]) => any; + "onApply-show"?: (...args: any[]) => any; + "onApply-hide"?: (...args: any[]) => any; + "onClose-group"?: (...args: any[]) => any; + "onClose-directive"?: (...args: any[]) => any; + "onAuto-hide"?: (...args: any[]) => any; + onDispose?: (...args: any[]) => any; +}, { + placement: string; + strategy: string; + disabled: boolean; + positioningDisabled: boolean; + delay: string | number | Record; + distance: string | number; + skidding: string | number; + triggers: unknown[]; + showTriggers: Function | unknown[]; + hideTriggers: Function | unknown[]; + popperTriggers: unknown[]; + popperShowTriggers: Function | unknown[]; + popperHideTriggers: Function | unknown[]; + container: any; + boundary: any; + autoHide: boolean | Function; + handleResize: boolean; + instantMove: boolean; + eagerMount: boolean; + popperClass: string | unknown[] | Record; + computeTransformOrigin: boolean; + autoMinSize: boolean; + autoSize: string | boolean; + autoMaxSize: boolean; + autoBoundaryMaxSize: boolean; + preventOverflow: boolean; + overflowPadding: string | number; + arrowPadding: string | number; + arrowOverflow: boolean; + flip: boolean; + shift: boolean; + shiftCrossAxis: boolean; + noAutoFocus: boolean; + disposeTimeout: number; + shown: boolean; + referenceNode: Function; + showGroup: string; + ariaId: any; +}, {}>; +export declare const PopperContent: import("vue").DefineComponent<{ + popperId: StringConstructor; + theme: StringConstructor; + shown: BooleanConstructor; + mounted: BooleanConstructor; + skipTransition: BooleanConstructor; + autoHide: BooleanConstructor; + handleResize: BooleanConstructor; + classes: ObjectConstructor; + result: ObjectConstructor; +}, unknown, unknown, {}, { + toPx(value: any): string; +}, { + computed: { + themeClass(): string[]; + }; +}, import("vue").ComponentOptionsMixin, ("resize" | "hide")[], "resize" | "hide", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly> & { + onResize?: (...args: any[]) => any; + onHide?: (...args: any[]) => any; +}, { + autoHide: boolean; + handleResize: boolean; + shown: boolean; + mounted: boolean; + skipTransition: boolean; +}, {}>; +export declare const PopperMethods: { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}; +export declare const PopperWrapper: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: any; + }; +}, unknown, unknown, { + finalTheme(): string; +}, { + getTargetNodes(): unknown[]; +}, { + computed: { + themeClass(): string[]; + }; +} | { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, { + theme: string; +}, {}>; +export declare const ThemeClass: (prop?: string) => { + computed: { + themeClass(): string[]; + }; +}; +export declare const Tooltip: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: any; + }; +}, unknown, unknown, { + finalTheme(): string; +}, { + getTargetNodes(): unknown[]; +}, { + computed: { + themeClass(): string[]; + }; +} | { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly>, { + theme: string; +}, {}>; +export declare const TooltipDirective: import("vue").DefineComponent<{ + theme: { + type: StringConstructor; + default: string; + }; + html: { + type: BooleanConstructor; + default: (props: any) => any; + }; + content: { + type: (StringConstructor | FunctionConstructor | NumberConstructor)[]; + default: any; + }; + loadingContent: { + type: StringConstructor; + default: (props: any) => any; + }; + targetNodes: { + type: FunctionConstructor; + required: true; + }; +}, unknown, { + asyncContent: string; +}, { + isContentAsync(): boolean; + loading(): boolean; + finalContent(): string; +}, { + fetchContent(force: boolean): void; + onResult(fetchId: any, result: any): void; + onShow(): void; + onHide(): void; +}, { + methods: { + show(...args: any[]): any; + hide(...args: any[]): any; + dispose(...args: any[]): any; + onResize(...args: any[]): any; + }; +}, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly any; + }; + content: { + type: (StringConstructor | FunctionConstructor | NumberConstructor)[]; + default: any; + }; + loadingContent: { + type: StringConstructor; + default: (props: any) => any; + }; + targetNodes: { + type: FunctionConstructor; + required: true; + }; +}>>, { + theme: string; + html: boolean; + content: string | number | Function; + loadingContent: string; +}, {}>; +export { hideAllPoppers } from './components/Popper'; +export * from './util/events'; +export { placements } from './util/popper'; +export type { Placement } from './util/popper'; +export declare function install(app: any, options?: FloatingVueConfig): void; +declare const plugin: { + version: string; + install: typeof install; + options: any; +}; +export default plugin; diff --git a/packages/floating-vue/dist/style.css b/packages/floating-vue/dist/style.css new file mode 100644 index 00000000..16609872 --- /dev/null +++ b/packages/floating-vue/dist/style.css @@ -0,0 +1 @@ +.resize-observer[data-v-b329ee4c]{position:absolute;top:0;left:0;z-index:-1;width:100%;height:100%;border:none;background-color:transparent;pointer-events:none;display:block;overflow:hidden;opacity:0}.resize-observer[data-v-b329ee4c] object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}.v-popper__popper{z-index:10000;top:0;left:0;outline:none}.v-popper__popper.v-popper__popper--hidden{visibility:hidden;opacity:0;transition:opacity .15s,visibility .15s;pointer-events:none}.v-popper__popper.v-popper__popper--shown{visibility:visible;opacity:1;transition:opacity .15s}.v-popper__popper.v-popper__popper--skip-transition,.v-popper__popper.v-popper__popper--skip-transition>.v-popper__wrapper{transition:none!important}.v-popper__backdrop{position:absolute;top:0;left:0;width:100%;height:100%;display:none}.v-popper__inner{position:relative;box-sizing:border-box;overflow-y:auto}.v-popper__inner>div{position:relative;z-index:1;max-width:inherit;max-height:inherit}.v-popper__arrow-container{position:absolute;width:10px;height:10px}.v-popper__popper--arrow-overflow .v-popper__arrow-container,.v-popper__popper--no-positioning .v-popper__arrow-container{display:none}.v-popper__arrow-inner,.v-popper__arrow-outer{border-style:solid;position:absolute;top:0;left:0;width:0;height:0}.v-popper__arrow-inner{visibility:hidden;border-width:7px}.v-popper__arrow-outer{border-width:6px}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-inner{left:-2px}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-outer,.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-outer{left:-1px}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-outer{border-bottom-width:0;border-left-color:transparent!important;border-right-color:transparent!important;border-bottom-color:transparent!important}.v-popper__popper[data-popper-placement^=top] .v-popper__arrow-inner{top:-2px}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-container{top:0}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-outer{border-top-width:0;border-left-color:transparent!important;border-right-color:transparent!important;border-top-color:transparent!important}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-inner{top:-4px}.v-popper__popper[data-popper-placement^=bottom] .v-popper__arrow-outer{top:-6px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-inner{top:-2px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-outer,.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-outer{top:-1px}.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-outer{border-left-width:0;border-left-color:transparent!important;border-top-color:transparent!important;border-bottom-color:transparent!important}.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-inner{left:-4px}.v-popper__popper[data-popper-placement^=right] .v-popper__arrow-outer{left:-6px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-container{right:-10px}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-inner,.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-outer{border-right-width:0;border-top-color:transparent!important;border-right-color:transparent!important;border-bottom-color:transparent!important}.v-popper__popper[data-popper-placement^=left] .v-popper__arrow-inner{left:-2px}.v-popper--theme-dropdown .v-popper__inner{background:#fff;color:#000;border-radius:6px;border:1px solid #ddd;box-shadow:0 6px 30px #0000001a}.v-popper--theme-dropdown .v-popper__arrow-inner{visibility:visible;border-color:#fff}.v-popper--theme-dropdown .v-popper__arrow-outer{border-color:#ddd}.v-popper--theme-tooltip .v-popper__inner{background:rgba(0,0,0,.8);color:#fff;border-radius:6px;padding:7px 12px 6px}.v-popper--theme-tooltip .v-popper__arrow-outer{border-color:#000c} diff --git a/packages/floating-vue/dist/util/assign-deep.d.ts b/packages/floating-vue/dist/util/assign-deep.d.ts new file mode 100644 index 00000000..a9adc114 --- /dev/null +++ b/packages/floating-vue/dist/util/assign-deep.d.ts @@ -0,0 +1 @@ +export declare function assign(to: any, from: any): void; diff --git a/packages/floating-vue/dist/util/env.d.ts b/packages/floating-vue/dist/util/env.d.ts new file mode 100644 index 00000000..91bfe019 --- /dev/null +++ b/packages/floating-vue/dist/util/env.d.ts @@ -0,0 +1,2 @@ +export declare let supportsPassive: boolean; +export declare let isIOS: boolean; diff --git a/packages/floating-vue/dist/util/events.d.ts b/packages/floating-vue/dist/util/events.d.ts new file mode 100644 index 00000000..663c9d20 --- /dev/null +++ b/packages/floating-vue/dist/util/events.d.ts @@ -0,0 +1,14 @@ +export declare const SHOW_EVENT_MAP: { + hover: string; + focus: string; + click: string; + touch: string; + pointer: string; +}; +export declare const HIDE_EVENT_MAP: { + hover: string; + focus: string; + click: string; + touch: string; + pointer: string; +}; diff --git a/packages/floating-vue/dist/util/frame.d.ts b/packages/floating-vue/dist/util/frame.d.ts new file mode 100644 index 00000000..0963399d --- /dev/null +++ b/packages/floating-vue/dist/util/frame.d.ts @@ -0,0 +1 @@ +export declare function nextFrame(): Promise; diff --git a/packages/floating-vue/dist/util/lang.d.ts b/packages/floating-vue/dist/util/lang.d.ts new file mode 100644 index 00000000..bd789a48 --- /dev/null +++ b/packages/floating-vue/dist/util/lang.d.ts @@ -0,0 +1 @@ +export declare function removeFromArray(array: any, item: any): void; diff --git a/packages/floating-vue/dist/util/popper.d.ts b/packages/floating-vue/dist/util/popper.d.ts new file mode 100644 index 00000000..1fbbcdd2 --- /dev/null +++ b/packages/floating-vue/dist/util/popper.d.ts @@ -0,0 +1,3 @@ +import type { Placement as BasePlacement } from '@floating-ui/dom'; +export type Placement = BasePlacement | 'auto' | 'auto-start' | 'auto-end'; +export declare const placements: Placement[];