2 lines
2.4 KiB
JavaScript
2 lines
2.4 KiB
JavaScript
import{_ as m,d as w,e as S,h as v,o as P,A as u,u as c,D as V,G as h,n as _,ae as O,g as $,i as j,b as r,y as T,z as k}from"./index-C4UKuwCQ.js";var A=Object.defineProperty,d=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,f=(e,o,t)=>o in e?A(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,g=(e,o)=>{for(var t in o||(o={}))B.call(o,t)&&f(e,t,o[t]);if(d)for(var t of d(o))z.call(o,t)&&f(e,t,o[t]);return e};const D=w({name:"Tooltip",components:{Trigger:O},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=$("tooltip"),a=j(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)},l=r(()=>[`${t}-content`,e.contentClass,{[`${t}-mini`]:e.mini}]),b=r(()=>{if(e.backgroundColor||e.contentStyle)return g({backgroundColor:e.backgroundColor},e.contentStyle)}),y=r(()=>[`${t}-popup-arrow`,e.arrowClass]),C=r(()=>{if(e.backgroundColor||e.arrowStyle)return g({backgroundColor:e.backgroundColor},e.arrowStyle)});return{prefixCls:t,computedPopupVisible:s,contentCls:l,computedContentStyle:b,arrowCls:y,computedArrowStyle:C,handlePopupVisibleChange:p}}});function E(e,o,t,a,s,p){const l=S("Trigger");return P(),v(l,{class:_(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",{},()=>[V(h(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 i=m(D,[["render",E]]);const I=Object.assign(i,{install:(e,o)=>{T(e,o);const t=k(o);e.component(t+i.name,i)}});export{I as T};
|