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