@vuesax-alpha/nightly
Version:
A Component Library for Vue 3
37 lines (36 loc) • 1.48 kB
TypeScript
import type { FloatingElement, ReferenceElement } from 'vuesax-alpha/es/hooks/use-floating/vue';
import type { PopperTriggerType } from 'vuesax-alpha/es/components/popper';
import type { Arrayable } from 'vuesax-alpha/es/utils';
import type { InjectionKey, Ref } from 'vue';
export declare type Measurable = {
getBoundingClientRect: () => DOMRect;
};
/**
* triggerRef indicates the element that triggers popper
* contentRef indicates the element of popper content
* referenceRef indicates the element that popper content relative with
*/
export declare type PopperContext = {
triggerRef: Ref<ReferenceElement | undefined>;
contentRef: Ref<FloatingElement | undefined>;
arrowRef: Ref<HTMLElement | undefined>;
referenceRef: Ref<ReferenceElement | undefined>;
controlled: Ref<boolean>;
id: Ref<string>;
open: Ref<boolean>;
trigger: Ref<Arrayable<PopperTriggerType>>;
onOpen: (e?: Event) => void;
onClose: (e?: Event) => void;
onToggle: (e: Event) => void;
onShow: () => void;
onHide: () => void;
onBeforeShow: () => void;
onBeforeHide: () => void;
updatePopper: (shouldUpdateZIndex?: boolean) => void;
};
export declare type PopperContentInjectionContext = {
arrowRef: Ref<HTMLElement | undefined>;
arrowOffset: Ref<number | undefined>;
};
export declare const popperContextKey: InjectionKey<PopperContext>;
export declare const popperContentContextKey: InjectionKey<PopperContentInjectionContext>;