index-DD5zBLku.js 2.5 KB

1
  1. import{_ as b,h as w,v as S,w as v}from"./index-Ccm7NuMR.js";import{T as P}from"./index-AcuTc0YO.js";import{d as V,r as h,c as r,m as _,o as O,p as T,y as u,k as c,F as $,G as j,n as k}from"./vue-vendor-B3m6NcsA.js";var B=Object.defineProperty,f=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,d=(e,o,t)=>o in e?B(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,m=(e,o)=>{for(var t in o||(o={}))A.call(o,t)&&d(e,t,o[t]);if(f)for(var t of f(o))z.call(o,t)&&d(e,t,o[t]);return e};const E=V({name:"Tooltip",components:{Trigger:P},props:{popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},content:String,position:{type:String,default:"top"},mini:{type:Boolean,default:!1},backgroundColor:{type:String},contentClass:{type:[String,Array,Object]},contentStyle:{type:Object},arrowClass:{type:[String,Array,Object]},arrowStyle:{type:Object},popupContainer:{type:[String,Object]}},emits:{"update:popupVisible":e=>!0,popupVisibleChange:e=>!0},setup(e,{emit:o}){const t=w("tooltip"),a=h(e.defaultPopupVisible),s=r(()=>{var n;return(n=e.popupVisible)!=null?n:a.value}),p=n=>{a.value=n,o("update:popupVisible",n),o("popupVisibleChange",n)},i=r(()=>[`${t}-content`,e.contentClass,{[`${t}-mini`]:e.mini}]),g=r(()=>{if(e.backgroundColor||e.contentStyle)return m({backgroundColor:e.backgroundColor},e.contentStyle)}),y=r(()=>[`${t}-popup-arrow`,e.arrowClass]),C=r(()=>{if(e.backgroundColor||e.arrowStyle)return m({backgroundColor:e.backgroundColor},e.arrowStyle)});return{prefixCls:t,computedPopupVisible:s,contentCls:i,computedContentStyle:g,arrowCls:y,computedArrowStyle:C,handlePopupVisibleChange:p}}});function G(e,o,t,a,s,p){const i=_("Trigger");return O(),T(i,{class:k(e.prefixCls),trigger:"hover",position:e.position,"popup-visible":e.computedPopupVisible,"popup-offset":10,"show-arrow":"","content-class":e.contentCls,"content-style":e.computedContentStyle,"arrow-class":e.arrowCls,"arrow-style":e.computedArrowStyle,"popup-container":e.popupContainer,"animation-name":"zoom-in-fade-out","auto-fit-transform-origin":"",role:"tooltip",onPopupVisibleChange:e.handlePopupVisibleChange},{content:u(()=>[c(e.$slots,"content",{},()=>[$(j(e.content),1)])]),default:u(()=>[c(e.$slots,"default")]),_:3},8,["class","position","popup-visible","content-class","content-style","arrow-class","arrow-style","popup-container","onPopupVisibleChange"])}var l=b(E,[["render",G]]);const F=Object.assign(l,{install:(e,o)=>{S(e,o);const t=v(o);e.component(t+l.name,l)}});export{F as T};