@volverjs/ui-vue
Version:
@volverjs/ui-vue is a lightweight Vue 3 component library to accompany @volverjs/style.
2 lines (1 loc) • 1.31 kB
JavaScript
import{computed as t,unref as o,defineComponent as e,toRefs as r,createElementBlock as n,openBlock as i,normalizeClass as s,renderSlot as u,createTextVNode as a,toDisplayString as l}from"vue";var f=/* @__PURE__ */(t=>(t.local="local",t.session="session",t))(f||{}),p=/* @__PURE__ */(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(p||{}),b=/* @__PURE__ */(t=>(t.before="before",t.after="after",t))(b||{}),v=/* @__PURE__ */(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(v||{}),c=/* @__PURE__ */(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(c||{});const m={modifiers:{type:[String,Array],default:void 0}};b.before,p.bottom,v.button,c.button,f.local;const y=/* @__PURE__ */e({name:"VvTooltip",props:{...m,position:{type:String,default:p.bottom},value:{type:String}},setup(e){const f=e,{modifiers:p}=r(f),b=function(e,r,n){return t(()=>{const t={[e]:!0},i="string"==typeof r?.value?r.value.split(" "):r?.value;return i&&Array.isArray(i)&&i.forEach(o=>{o&&(t[`${e}--${o}`]=!0)}),n&&Object.keys(n.value).forEach(r=>{t[`${e}--${r}`]=o(n.value[r])}),t})}("vv-tooltip",p,t(()=>({[f.position]:!0})));return(t,e)=>(i(),n("span",{class:s(o(b)),role:"tooltip",inert:""},[u(t.$slots,"default",{},()=>[a(l(t.value),1)])],2))}});export{y as default};