tippy.vue
Version:
Nesting-free Vue components for Tippy.js - a drop-in addition with no structural or css changes required
1 lines • 33.6 kB
Source Map (JSON)
{"version":3,"file":"index.umd.min.js","sources":["../src/TippyDirective.ts","../src/common.ts","../src/builtin.ts","../src/Tippy.ts","../src/TippySingleton.ts","../src/index.ts"],"sourcesContent":["import tippy, {Instance as TippyInstance, Props} from \"tippy.js\";\nimport {Directive, DirectiveBinding} from \"vue\";\n\nconst _mode = Symbol(\"v-tippy mode\")\ntype VTippyMode = 'inline' | 'target'\nconst _tippy = Symbol(\"v-tippy instance\")\n\ndeclare global {\n interface HTMLElement {\n [_mode]?: VTippyMode\n [_tippy]?: TippyInstance\n }\n}\n\nfunction createOptions(value: string | Partial<Props> | undefined): Partial<Props> {\n if(typeof value === 'string') {\n return {content: value}\n } else if(typeof value === 'undefined') {\n return {}\n } else {\n return value\n }\n}\n\nexport const TippyDirective: Directive<HTMLElement, string | Partial<Props> | undefined> = {\n mounted(el: HTMLElement, binding: DirectiveBinding<string | Partial<Props> | undefined>): void {\n if (binding.value === undefined) {\n el[_mode] = 'target'\n el.dataset.tippyTarget = binding.arg || \"\"\n } else {\n el[_mode] = 'inline'\n el[_tippy] = tippy(el, createOptions(binding.value))\n }\n },\n beforeUnmount(el: HTMLElement): void {\n if (el[_mode] === 'inline') {\n let tip = el[_tippy]\n tip && tip.destroy()\n } else {\n delete el.dataset.tippyTarget;\n }\n },\n updated(el: HTMLElement, binding: DirectiveBinding<string | Partial<Props> | undefined>): void {\n if (el[_mode] === 'inline') {\n let tip = el[_tippy]\n tip && tip.setProps(createOptions(binding.value))\n }\n }\n}\n","import tippy, {Instance as TippyInstance, LifecycleHooks, Props} from \"tippy.js\";\nimport {computed, Ref, ToRefs, toRefs, watch} from \"vue\";\nimport {ComponentPropsOptions, ExtractPropTypes, PropType, SetupContext} from \"@vue/runtime-core\";\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const commonEmits = {\n mount: (instance: TippyInstance) => true,\n show: (instance: TippyInstance) => true,\n shown: (instance: TippyInstance) => true,\n hidden: (instance: TippyInstance) => true,\n hide: (instance: TippyInstance) => true,\n trigger: (instance: TippyInstance, event: Event) => true,\n untrigger: (instance: TippyInstance, event: Event) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nexport type Plugin<P extends ComponentPropsOptions = {}> = {\n props: P,\n setup?(props: Required<ToRefs<ExtractPropTypes<P>>> & Record<string, Ref<unknown>>, tip: Ref<TippyInstance | undefined>): void\n build?(props: Required<ToRefs<ExtractPropTypes<P>>> & Record<string, Ref<unknown>>, options: Partial<Props>): void\n}\n\n/**\n * Infers the plugin type to provide type hinting for the parameter\n */\nexport function inferPlugin<P extends ComponentPropsOptions>(plugin: Plugin<P>): Plugin<P> {\n return plugin\n}\n\n/**\n * Creates a plugin that exposes a Tippy.js option as a Vue prop\n * @param name The name of the Tippy.js option\n * @param type The type of the Vue property (e.g. `String`, `Boolean`, etc.)\n * @param def The default value, if any\n */\nexport function optionPlugin<T extends keyof Props>(name: T, type?: PropType<any>, def?: Props[T]): Plugin<Record<T, { type: PropType<Props[T]>, required: false }>> {\n return {\n props: {\n [name]: {\n type: type ? type : null,\n required: false,\n default: def,\n },\n } as Record<T, {type: PropType<Props[T]>, required: false, default: typeof def}>,\n build(props, options) {\n if (props[name].value !== undefined) {\n options[name] = props[name].value;\n }\n }\n }\n}\n\nexport function commonSetup<P extends Plugin[], E extends typeof commonEmits>(\n props: Record<string, unknown>,\n plugins: P,\n baseContext: SetupContext<E>,\n tip: Ref<TippyInstance | undefined>,\n hooks?: Partial<LifecycleHooks>,\n) {\n const context = baseContext as unknown as SetupContext<typeof commonEmits>\n\n let refs = toRefs(props)\n const tippyOptions = computed<Partial<Props>>(() => {\n const options: Partial<Props> = {}\n\n for (const plugin of plugins) {\n let buildFn = plugin.build\n if(buildFn) buildFn(refs, options)\n }\n\n options.onShow = joinCallbacks(instance => context.emit(\"show\", instance), hooks && hooks.onShow, options.onShow)\n options.onShown = joinCallbacks(instance => context.emit(\"shown\", instance), hooks && hooks.onShown, options.onShown)\n options.onHidden = joinCallbacks(instance => context.emit(\"hidden\", instance), hooks && hooks.onHidden, options.onHidden)\n options.onHide = joinCallbacks(instance => context.emit(\"hide\", instance), hooks && hooks.onHide, options.onHide)\n options.onMount = joinCallbacks(instance => context.emit(\"mount\", instance), hooks && hooks.onMount, options.onMount)\n options.onTrigger = joinCallbacks((instance, event) => context.emit(\"trigger\", instance, event), hooks && hooks.onTrigger, options.onTrigger)\n options.onUntrigger = joinCallbacks((instance, event) => context.emit(\"untrigger\", instance, event), hooks && hooks.onUntrigger, options.onUntrigger)\n\n return options;\n })\n\n for (const plugin of plugins) {\n let setupFn = plugin.setup\n if (setupFn) setupFn(refs, tip)\n }\n\n watch(tippyOptions, value => {\n if(tip.value)\n tip.value.setProps(value)\n }, {\n deep: true\n })\n\n return {\n tippyOptions\n }\n}\n\nfunction joinCallbacks<Args extends any[], Return>(\n ...callbacks: (((...args: Args) => Return) | undefined)[]\n): (...args: Args) => Return {\n return (...args: Args) => {\n let result\n for(let callback of callbacks) {\n if(callback)\n result = callback(...args)\n }\n return result as Return\n }\n}\n","import {watch} from \"vue\";\nimport {PropType} from \"@vue/runtime-core\";\nimport {CreateSingletonProps, Props} from \"tippy.js\";\nimport {Plugin, optionPlugin, inferPlugin} from \"./common\";\n\n\n/**\n * Extra options for tippy.js\n */\nexport const extra = inferPlugin({\n props: {\n extra: {\n type: Object as PropType<Partial<Props>>,\n required: false,\n },\n },\n build(props, options) {\n Object.assign(options, props.extra.value || {});\n }\n})\n\n/**\n * Whether the tooltip should be enabled\n */\nexport const enabled = inferPlugin({\n props: {\n enabled: {\n type: Boolean,\n required: false,\n default: true,\n }\n },\n\n setup(props, tip) {\n watch(props.enabled, value => {\n if (!tip.value) return;\n if (value) {\n tip.value.enable();\n } else {\n tip.value.hide();\n tip.value.disable();\n }\n })\n }\n})\n\n/**\n * Where to place the tooltip relative to the target element\n */\nexport const placement = optionPlugin(\"placement\", String, 'top')\n\n/**\n * Whether the tippy should be interactive. You don't need to specify a value for this property, its presence is\n * sufficient (e.g. `<tippy interactive>`).\n *\n * This is a shorthand for `interactive: true` in the `extra` property.\n */\nexport const interactive = optionPlugin(\"interactive\", Boolean)\n\n/**\n * Whether to hide the tooltip when the target element is clicked. Defaults to false when using the `'manual'`\n * trigger, otherwise defaults to true.\n */\nexport const hideOnClick = optionPlugin(\"hideOnClick\", Boolean)\n\n/**\n * Whether the tippy should *always* be appended to the `<body>`. You don't need to specify a value for this property,\n * its presence is sufficient (e.g. `<tippy on-body>`).\n *\n * Normally, tooltips will be appended to the document body element, *however*, interactive elements are appended\n * adjacent to their trigger, in the interest of maintaining keyboard focus order.\n * [more info](https://atomiks.github.io/tippyjs/v6/accessibility/#clipping-issues)\n *\n * This can cause zIndex issues, so sometimes it's necessary to put an interactive tooltip on the body element.\n *\n * This is a shorthand for `appendTo: () => document.body` in the `extra` property. (Note that you can't access\n * `document` directly in a vue template, so you would have to use a computed property if you wanted to set this in\n * `extra` yourself.\n */\nexport const onBody = inferPlugin({\n props: {\n onBody: {\n type: Boolean,\n required: false,\n },\n },\n\n build(props, options) {\n if (props.onBody.value === true) {\n options.appendTo = () => document.body;\n }\n }\n})\n\n/**\n * The events that trigger the tooltip. Setting the trigger key in `extra` will override this property.\n */\nexport const trigger = inferPlugin({\n props: {\n trigger: {\n type: String,\n required: false,\n },\n },\n build(props, options) {\n if (props.trigger.value) {\n options.trigger = props.trigger.value;\n if (props.trigger.value === 'manual' && options.hideOnClick === undefined) {\n options.hideOnClick = false;\n }\n }\n }\n})\n\nconst delayPattern = /^([0-9]+)$|^([0-9]+|-)\\s*,\\s*([0-9]+|-)$/\ntype DelayType = number | [number | null, number | null] | `${number}` | `${number | '-'},${number | '-'}`\n\nfunction parseDelay(input: DelayType): number | [number | null, number | null] | undefined {\n if (typeof input === \"string\") {\n let match = input.match(delayPattern)\n if (match) {\n if (match[1]) {\n return parseFloat(match[1])\n } else {\n return [\n match[2] === '-' ? null : parseFloat(match[2]),\n match[3] === '-' ? null : parseFloat(match[3])\n ]\n }\n } else {\n return undefined\n }\n } else {\n return input\n }\n}\n\n/**\n * The delay when showing or hiding the tooltip. One of four formats:\n * - A number (or number string) representing the delay in milliseconds\n * - A string consisting of two comma-separated elements representing the show and hide delays, each of which is\n * either a number or a '-'\n * - An array of two `number | null` elements\n */\nexport const delay = inferPlugin<{\n delay: {\n type: PropType<DelayType>;\n required: boolean;\n validator(value: unknown): boolean;\n }\n}>({\n props: {\n delay: {\n type: [String, Number, Array] as PropType<DelayType>,\n required: false,\n validator(value: unknown): boolean {\n return parseDelay(value as DelayType) !== undefined\n }\n }\n },\n build(props, options) {\n if (props.delay.value !== undefined) {\n options.delay = parseDelay(props.delay.value)\n }\n }\n})\n\n/**\n * Only used when using the manual trigger. To show/hide when using another trigger, use `tippy().show()` and\n * `tippy().hide()`\n */\nexport const visible = inferPlugin({\n props: {\n visible: {\n type: Boolean,\n required: false,\n },\n },\n setup(props, tip) {\n watch(props.visible, value => {\n if (!tip.value || (props.trigger && props.trigger.value !== 'manual')) return;\n if (value) {\n tip.value.show();\n } else {\n tip.value.hide();\n }\n })\n }\n})\n\n/**\n * Tippy.js options that should be overridden by the individual instances.\n */\nexport const overrides = inferPlugin({\n props: {\n overrides: {\n type: Array as PropType<Array<keyof Props>>,\n required: false,\n },\n },\n build(props, options) {\n const sOptions = options as Partial<CreateSingletonProps>\n sOptions.overrides = (sOptions.overrides || []).concat(props.overrides.value || [])\n }\n})\n\n/**\n * The CSS transition to use when moving between instances within the singleton\n */\nexport const moveTransition = optionPlugin(\"moveTransition\", String)\n","import {ComputedRef, defineComponent, h, nextTick, Ref, ref} from \"vue\";\nimport {PropType} from \"@vue/runtime-core\";\nimport {commonEmits, commonSetup, Plugin} from \"./common\";\nimport tippy, {Instance as TippyInstance, Props as TippyProps} from \"tippy.js\";\nimport {VueSingleton} from \"./TippySingleton\";\nimport {\n delay,\n enabled,\n extra,\n hideOnClick,\n interactive,\n onBody,\n placement,\n trigger,\n visible\n} from \"./builtin\";\nimport {DefineComponent, ExtractPluginProps} from \"./types\";\n\nexport const defaultTippyProps = [\n visible,\n\n enabled,\n placement,\n onBody,\n interactive,\n trigger,\n hideOnClick,\n delay,\n extra,\n]\n\nconst baseProps = {\n /**\n * The v-tippy target name. Defaults to `\"\"` (the default name used by `v-tippy`)\n */\n target: {\n type: String as PropType<string | '_parent'>,\n required: false,\n default: \"\"\n },\n\n /**\n * Whether to perform a deep search for targets (using querySelector) or to only search for direct siblings.\n */\n deepSearch: {\n type: Boolean,\n required: false,\n default: false\n },\n\n singleton: {\n type: String as PropType<boolean | string | '' | null>,\n required: false,\n default: null,\n },\n\n /**\n * Whether to eagerly render the content or only render when the tooltip is visible\n */\n eager: {\n type: Boolean,\n required: false,\n default: false\n },\n}\n\nexport type TippyComponentType<Plugins extends Plugin[] = [], DefaultPlugins extends Plugin[] = typeof defaultTippyProps> = DefineComponent<//\n /* Props = */ typeof baseProps & ExtractPluginProps<Plugins[number] | DefaultPlugins[number]>,\n /* Emits = */ typeof commonEmits & { attach: (instance: TippyInstance) => true },\n /* Data = */ { tip: Ref<TippyInstance | undefined>, tippyOptions: ComputedRef<Partial<TippyProps>> },\n /* Methods = */ { attach(): void }>;\n\nexport function createTippyComponent<P extends Plugin[]>(...plugins: P): TippyComponentType<P> {\n let pluginProps = {}\n for (const plugin of plugins) {\n Object.assign(pluginProps, plugin.props)\n }\n\n return defineComponent({\n props: {\n ...baseProps,\n ...pluginProps\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n attach: (instance: TippyInstance) => true,\n ...commonEmits\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n render() {\n return h('div', {\n 'tippy-missing-target': this.tippyTargetMissing ? '' : undefined,\n }, (this.$props.eager || this.singletonInstance || this.shouldRenderContent) && this.$slots.default ? this.$slots.default() : [])\n },\n setup(props, context) {\n const tip = ref<TippyInstance>()\n const singletonInstance = ref<VueSingleton>()\n const tippyTargetMissing = ref<boolean>(false)\n const shouldRenderContent = ref<boolean>(false)\n\n const { tippyOptions } = commonSetup(props, plugins, context, tip, {\n onShow() {\n shouldRenderContent.value = true\n },\n onHidden() {\n shouldRenderContent.value = false\n }\n })\n\n return {\n tip,\n tippyOptions,\n singletonInstance,\n tippyTargetMissing,\n shouldRenderContent,\n }\n },\n methods: {\n attach() {\n // destroy old tip\n if (this.tip) {\n const tip = this.tip\n this.tip = undefined\n if(this.singletonInstance) {\n this.singletonInstance.remove(tip)\n this.singletonInstance = undefined\n }\n tip.destroy();\n }\n\n // find the target\n let target: Element | null\n if(this.target === '_parent') {\n target = this.$el.parentElement\n } else if (this.deepSearch) {\n target = this.$el.parentElement.querySelector(`[data-tippy-target=\"${this.target}\"]`);\n } else {\n const targetValue = this.target\n target = findElement(this.$el, {\n test(el): boolean {\n let a = el as any\n return a && a.dataset && a.dataset.tippyTarget === targetValue\n }\n })\n }\n this.tippyTargetMissing = !target\n if (!target) {\n throw new Error(`Unable to find tippy target named '${this.target}'`)\n }\n\n // find the singleton\n if (this.singleton != null) {\n const targetValue = this.singleton\n const singletonElement = findElement(this.$el, {\n test(el): boolean {\n let a = el as any\n return a && a.dataset && a.dataset.tippySingleton === targetValue\n },\n recurse: true\n })\n this.singletonInstance = singletonElement ? singletonElement._tippySingleton : undefined;\n } else {\n this.singletonInstance = undefined\n }\n\n // create and bind tip\n this.tip = tippy(target, this.tippyOptions);\n if (!this.tip) {\n throw new Error(`Unable to create tippy instance`)\n }\n this.tip.setContent(this.$el)\n this.singletonInstance && this.singletonInstance.add(this.tip)\n\n if((this as any).enabled === false) {\n this.tip.disable();\n }\n if ((this as any).trigger === 'manual' && (this as any).visible === true) {\n this.tip.show();\n }\n\n this.$emit(\"attach\", this.tip);\n }\n },\n async mounted() {\n await nextTick()\n this.attach()\n },\n beforeUnmount() {\n this.tip && this.tip.destroy()\n },\n }) as unknown as TippyComponentType<P>\n}\n\ntype StandardSearch = {\n /**\n * Tests if an element matches\n */\n test(element: Element): boolean,\n /**\n * Whether to recurse up through the element's parents.\n */\n recurse?: boolean,\n /**\n * Whether to test the starting element. When recursing this also controls whether to test the element's direct\n * parents.\n */\n selftest?: boolean\n}\n\n/**\n * @param start the element to start at. will not test the starting element or any of its parents\n * @param search the search parameters to use\n */\nfunction findElement(start: any, search: StandardSearch): Element | null {\n let found: Element | null = null\n let current = start\n do {\n found = findSibling(current, search.test, search.selftest === undefined ? false : search.selftest)\n current = current.parentElement\n } while(search.recurse && current && !found)\n return found\n}\n\nfunction findSibling(element: Element, test: (element: Element) => boolean, testSelf: boolean): Element | null {\n if(testSelf && test(element)) {\n return element\n }\n for(let sibling = element.previousElementSibling; sibling; sibling = sibling.previousElementSibling) {\n if (test(sibling))\n return sibling;\n }\n for(let sibling = element.nextElementSibling; sibling; sibling = sibling.nextElementSibling) {\n if (test(sibling))\n return sibling;\n }\n return null;\n}\n","import {defineComponent, h, Ref, ref} from \"vue\";\nimport {PropType} from \"@vue/runtime-core\";\nimport {commonEmits, commonSetup, Plugin} from \"./common\";\nimport {createSingleton, CreateSingletonInstance, Instance as TippyInstance} from \"tippy.js\";\nimport {\n delay,\n enabled, extra,\n hideOnClick,\n interactive,\n moveTransition,\n onBody,\n overrides,\n placement,\n trigger\n} from \"./builtin\";\nimport {DefineComponent, ExtractPluginProps} from \"./types\";\n\nexport type VueSingleton = {\n add(instance: TippyInstance): void,\n remove(instance: TippyInstance): void\n}\n\ndeclare global {\n interface Element {\n _tippySingleton?: VueSingleton\n }\n}\n\nexport const defaultTippySingletonProps = [\n overrides,\n moveTransition,\n\n enabled,\n placement,\n onBody,\n interactive,\n trigger,\n hideOnClick,\n delay,\n extra,\n]\n\nconst baseProps = {\n /**\n * The singleton name. Defaults to `\"\"` (the default name used by `<tippy singleton>`)\n */\n name: {\n type: String as PropType<string>,\n required: false,\n default: \"\"\n },\n}\n\nexport type TippySingletonComponentType<Plugins extends Plugin[] = [], DefaultPlugins extends Plugin[] = typeof defaultTippySingletonProps> = DefineComponent<//\n /* Props = */ typeof baseProps & ExtractPluginProps<Plugins[number] | DefaultPlugins[number]>,\n /* Emits = */ typeof commonEmits & { add: (instance: TippyInstance) => true, remove: (instance: TippyInstance) => true },\n /* Data = */ { instances: Ref<TippyInstance[]>, singleton: Ref<CreateSingletonInstance> },\n /* Methods = */ { add(instance: TippyInstance): void, remove(instance: TippyInstance): void }>;\n\nexport function createTippySingletonComponent<P extends Plugin[]>(...plugins: P): TippySingletonComponentType<P> {\n let pluginProps = {}\n for (const plugin of plugins) {\n Object.assign(pluginProps, plugin.props)\n }\n\n return defineComponent({\n props: {\n ...baseProps,\n ...pluginProps\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n add: (instance: TippyInstance) => true,\n remove: (instance: TippyInstance) => true,\n ...commonEmits\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n render() {\n return h('div', {\n 'style': 'display: none;',\n 'data-tippy-singleton': this.name\n }, [])\n },\n setup(props, context) {\n const singleton = ref<CreateSingletonInstance>()\n const {tippyOptions} = commonSetup(props, plugins, context, singleton)\n\n const instances = ref<TippyInstance[]>([])\n\n return {\n tippyOptions,\n instances,\n singleton,\n }\n },\n mounted() {\n this.$el._tippySingleton = this\n this.singleton = createSingleton(this.instances as TippyInstance[], this.tippyOptions)\n if ((this as any).enabled === false) {\n this.singleton.disable();\n }\n },\n beforeUnmount() {\n this.singleton && this.singleton.destroy()\n },\n methods: {\n remove(instance: TippyInstance) {\n const index = this.instances.indexOf(instance)\n if (index === -1) {\n return\n }\n this.instances.splice(index, 1)\n this.$emit('remove', instance)\n this.singleton && this.singleton.setInstances(this.instances as TippyInstance[])\n },\n\n add(instance: TippyInstance) {\n if (this.instances.indexOf(instance) !== -1) {\n return\n }\n this.instances.push(instance)\n this.$emit('add', instance)\n this.singleton && this.singleton.setInstances(this.instances as TippyInstance[])\n }\n }\n }) as unknown as TippySingletonComponentType<P>\n}\n","import {App, Plugin as VuePlugin} from \"vue\";\nimport tippy, {DefaultProps} from \"tippy.js\";\nimport {TippyDirective} from \"./TippyDirective\";\nimport {createTippyComponent, defaultTippyProps, TippyComponentType} from \"./Tippy\";\nimport {createTippySingletonComponent, defaultTippySingletonProps, TippySingletonComponentType} from \"./TippySingleton\";\nimport {Plugin} from \"./common\";\n\nexport function install(app: App, options?: {\n tippyDefaults?: Partial<DefaultProps>,\n tippyProps?: Plugin[],\n tippySingletonProps?: Plugin[],\n}) {\n if (options && options.tippyDefaults) {\n tippy.setDefaultProps(options.tippyDefaults)\n }\n app.directive('tippy', TippyDirective)\n app.component(\n 'tippy',\n createTippyComponent(...(options && options.tippyProps || defaultTippyProps))\n )\n app.component(\n 'tippy-singleton',\n createTippySingletonComponent(...(options && options.tippySingletonProps || defaultTippySingletonProps))\n )\n}\n\nexport const TippyPlugin: VuePlugin = {\n install\n}\nexport const Tippy = createTippyComponent(...defaultTippyProps)\nexport const TippySingleton = createTippySingletonComponent(...defaultTippySingletonProps)\n\nexport type {Plugin, TippyComponentType, TippySingletonComponentType};\nexport {inferPlugin, optionPlugin} from './common'\nexport {TippyDirective} from \"./TippyDirective\";\nexport {createTippyComponent, defaultTippyProps} from \"./Tippy\";\nexport {createTippySingletonComponent, defaultTippySingletonProps} from \"./TippySingleton\";\nexport * as props from \"./builtin\";\n"],"names":["_mode","Symbol","_tippy","createOptions","value","content","TippyDirective","mounted","el","binding","undefined","dataset","tippyTarget","arg","tippy","beforeUnmount","tip","destroy","updated","setProps","commonEmits","mount","instance","show","shown","hidden","hide","trigger","event","untrigger","inferPlugin","plugin","optionPlugin","name","type","def","props","required","default","build","options","commonSetup","plugins","baseContext","hooks","context","refs","toRefs","tippyOptions","computed","buildFn","onShow","joinCallbacks","emit","onShown","onHidden","onHide","onMount","onTrigger","onUntrigger","setupFn","setup","watch","deep","callbacks","args","result","callback","extra","Object","assign","enabled","Boolean","enable","disable","placement","String","interactive","hideOnClick","onBody","appendTo","document","body","delayPattern","parseDelay","input","match","parseFloat","delay","Number","Array","validator","visible","overrides","sOptions","concat","moveTransition","defaultTippyProps","baseProps","target","deepSearch","singleton","eager","createTippyComponent","pluginProps","defineComponent","emits","attach","render","h","this","tippyTargetMissing","$props","singletonInstance","shouldRenderContent","$slots","ref","methods","remove","$el","parentElement","querySelector","targetValue","findElement","test","a","Error","singletonElement","tippySingleton","recurse","_tippySingleton","setContent","add","$emit","async","nextTick","start","search","found","current","findSibling","selftest","element","testSelf","sibling","previousElementSibling","nextElementSibling","defaultTippySingletonProps","createTippySingletonComponent","style","instances","createSingleton","index","indexOf","splice","setInstances","push","install","app","tippyDefaults","setDefaultProps","directive","component","tippyProps","tippySingletonProps","TippyPlugin","Tippy","TippySingleton"],"mappings":"yYAGA,MAAMA,EAAQC,OAAO,gBAEfC,EAASD,OAAO,oBAStB,SAASE,EAAcC,GACrB,MAAoB,iBAAVA,EACD,CAACC,QAASD,QACQ,IAAVA,EACR,GAEAA,QAIEE,EAA8E,CACzFC,QAAQC,EAAiBC,QACDC,IAAlBD,EAAQL,OACVI,EAAGR,GAAS,SACZQ,EAAGG,QAAQC,YAAcH,EAAQI,KAAO,KAExCL,EAAGR,GAAS,SACZQ,EAAGN,GAAUY,UAAMN,EAAIL,EAAcM,EAAQL,UAGjDW,cAAcP,GACZ,GAAkB,WAAdA,EAAGR,GAAqB,CAC1B,IAAIgB,EAAMR,EAAGN,GACbc,GAAOA,EAAIC,sBAEJT,EAAGG,QAAQC,aAGtBM,QAAQV,EAAiBC,GACvB,GAAkB,WAAdD,EAAGR,GAAqB,CAC1B,IAAIgB,EAAMR,EAAGN,GACbc,GAAOA,EAAIG,SAAShB,EAAcM,EAAQL,WCxCnCgB,EAAc,CACzBC,MAAQC,IAA4B,EACpCC,KAAOD,IAA4B,EACnCE,MAAQF,IAA4B,EACpCG,OAASH,IAA4B,EACrCI,KAAOJ,IAA4B,EACnCK,QAAS,CAACL,EAAyBM,KAAiB,EACpDC,UAAW,CAACP,EAAyBM,KAAiB,YAaxCE,EAA6CC,GAC3D,OAA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