UNPKG

bootstrap-vue-next

Version:

BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.

49 lines (48 loc) 1.78 kB
import "vue"; import { r as resolveActiveStatus, a as resolveContent, b as bind, c as resolveDirectiveProps, u as unbind } from "../../../floatingUi-DWL_DNW7.mjs"; import { d as defaultsKey } from "../../../keys-41Cw9q6f.mjs"; import { f as findProvides } from "../../../utils-DPq73bs8.mjs"; const vBTooltip = { mounted(el, binding, vnode) { var _a; const defaults = (_a = findProvides(binding, vnode)[defaultsKey]) == null ? void 0 : _a.value; const isActive = resolveActiveStatus(binding.value); if (!isActive) return; const text = resolveContent(binding.value, el); if (!text.content && !text.title) return; el.$__binding = JSON.stringify([binding.modifiers, binding.value]); bind(el, binding, { noninteractive: true, ...defaults["BTooltip"] || void 0, ...resolveDirectiveProps(binding, el), title: text.title ?? text.content ?? "", tooltip: isActive }); }, updated(el, binding, vnode) { var _a; const defaults = (_a = findProvides(binding, vnode)[defaultsKey]) == null ? void 0 : _a.value; const isActive = resolveActiveStatus(binding.value); if (!isActive) return; const text = resolveContent(binding.value, el); if (!text.content && !text.title) return; delete binding.oldValue; if (el.$__binding === JSON.stringify([binding.modifiers, binding.value])) return; unbind(el); bind(el, binding, { noninteractive: true, ...defaults["BTooltip"] || void 0, ...resolveDirectiveProps(binding, el), title: text.title ?? text.content ?? "", tooltip: isActive }); el.$__binding = JSON.stringify([binding.modifiers, binding.value]); }, beforeUnmount(el) { unbind(el); } }; export { vBTooltip }; //# sourceMappingURL=index.mjs.map