UNPKG

maz-ui

Version:

A standalone components library for Vue.Js 3 & Nuxt.Js 3

55 lines (54 loc) 1.67 kB
import { DirectiveBinding, ObjectDirective, Plugin } from 'vue'; import { MazPopoverPosition, MazPopoverProps, MazPopoverTrigger } from '../components/MazPopover.vue'; interface VTooltipOptions extends Partial<Omit<MazPopoverProps, 'modelValue'>> { /** * Text to display in the tooltip */ text?: string; /** * HTML content (alternative to text) */ html?: string; /** * Color variant of the tooltip * @default contrast */ color?: MazPopoverProps['color']; /** * Position of the tooltip * The preferred position is set to 'top' if no position is provided * @default top */ position?: MazPopoverPosition; /** * Trigger of the tooltip * @default hover */ trigger?: MazPopoverTrigger; /** * Close on click outside * @default false */ closeOnClickOutside?: boolean; /** * Close on escape * @default false */ closeOnEscape?: boolean; /** * Open the tooltip * @default false */ open?: boolean; } type VTooltipBindingValue = string | VTooltipOptions; export type TooltipBinding = DirectiveBinding<VTooltipBindingValue, NonNullable<MazPopoverProps['position']>>; export type VTooltipDirective = ObjectDirective<HTMLElement, VTooltipBindingValue, NonNullable<MazPopoverProps['position']>>; declare const directive: VTooltipDirective; declare const plugin: Plugin<[Partial<VTooltipOptions>?]>; export { directive as vTooltip, type VTooltipBindingValue, plugin as vTooltipInstall, type VTooltipOptions, }; declare module 'vue' { interface GlobalDirectives { vTooltip: VTooltipDirective; } }