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