UNPKG

@volverjs/ui-vue

Version:

@volverjs/ui-vue is a lightweight Vue 3 component library to accompany @volverjs/style.

41 lines (40 loc) 1.58 kB
import type { Ref } from 'vue'; import type { DropdownItemState } from '../../constants'; import { DropdownItemRole, DropdownRole } from '../../constants'; /** * Share the dropdown reference and the event bus with all its children. * @param {Ref<HTMLElement | null>} reference the dropdown reference */ export declare function useDropdownProvideTrigger({ reference, id, expanded, aria, }: { reference: Ref<HTMLElement | null | undefined>; id: Ref<string | number>; expanded: Ref<boolean>; aria: Ref<{ 'aria-controls': string; 'aria-haspopup': boolean; 'aria-expanded': boolean; }>; }): { bus: import("mitt").Emitter<{ click: Event; mouseover: Event; mouseleave: Event; }>; component: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; }; /** * Share the dropdown item role with all its children. * @param {Ref<string>} role the dropdown item role */ export declare function useDropdownProvideItem({ role, ...others }: Omit<DropdownItemState, 'role'> & { role: Ref<`${DropdownRole}`>; }): { itemRole: globalThis.ComputedRef<DropdownItemRole>; }; /** * Share the dropdown item role with all its children. * @param {Ref<string>} role the dropdown item role */ export declare function useDropdownProvideAction({ expanded, }: { expanded?: Ref<boolean>; }): void;