"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),D=require("../../_util/props-util/index.js"),o=require("../../_util/vue-types/index.js"),O=require("../../vc-trigger/Trigger.js"),T=require("./Content.js"),A=require("./placements.js");function d(){}const x=n.defineComponent({compatConfig:{MODE:3},name:"Tooltip",inheritAttrs:!1,props:{trigger:o.default.any.def(["hover"]),defaultVisible:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},placement:o.default.string.def("right"),transitionName:String,animation:o.default.any,afterVisibleChange:o.default.func.def(()=>{}),overlayStyle:{type:Object,default:void 0},overlayClassName:String,prefixCls:o.default.string.def("rc-tooltip"),mouseEnterDelay:o.default.number.def(.1),mouseLeaveDelay:o.default.number.def(.1),getPopupContainer:Function,destroyTooltipOnHide:{type:Boolean,default:!1},align:o.default.object.def(()=>({})),arrowContent:o.default.any.def(null),tipId:String,builtinPlacements:o.default.object,overlayInnerStyle:{type:Object,default:void 0},popupVisible:{type:Boolean,default:void 0},onVisibleChange:Function,onPopupAlign:Function,arrow:{type:Boolean,default:!0}},setup(e,{slots:i,attrs:f,expose:c}){const a=n.shallowRef(),y=()=>{const{prefixCls:t,tipId:l,overlayInnerStyle:u}=e;return[e.arrow?n.createVNode("div",{class:`${t}-arrow`,key:"arrow"},[D.getPropsSlot(i,e,"arrowContent")]):null,n.createVNode(T.default,{key:"content",prefixCls:t,id:l,overlayInnerStyle:u},{overlay:i.overlay})]};c({getPopupDomNode:()=>a.value.getPopupDomNode(),triggerDOM:a,forcePopupAlign:()=>a.value?.forcePopupAlign()});const r=n.shallowRef(!1),p=n.shallowRef(!1);return n.watchEffect(()=>{const{destroyTooltipOnHide:t}=e;if(typeof t=="boolean")r.value=t;else if(t&&typeof t=="object"){const{keepParent:l}=t;r.value=l===!0,p.value=l===!1}}),()=>{const{overlayClassName:t,trigger:l,mouseEnterDelay:u,mouseLeaveDelay:g,overlayStyle:m,prefixCls:b,afterVisibleChange:v,transitionName:P,animation:C,placement:V,align:h,destroyTooltipOnHide:q,defaultVisible:w,...N}=e,s={...N};e.visible!==void 0&&(s.popupVisible=e.visible);const S={popupClassName:t,prefixCls:b,action:l,builtinPlacements:A.placements,popupPlacement:V,popupAlign:h,afterPopupVisibleChange:v,popupTransitionName:P,popupAnimation:C,defaultPopupVisible:w,destroyPopupOnHide:r.value,autoDestroy:p.value,mouseLeaveDelay:g,popupStyle:m,mouseEnterDelay:u,...s,...f,onPopupVisibleChange:e.onVisibleChange||d,onPopupAlign:e.onPopupAlign||d,ref:a,arrow:!!e.arrow,popup:y()};return n.createVNode(O.default,S,{default:i.default})}}});exports.default=x;
