import e from"../_util/classNames.mjs";import t from"../_util/vue-types/index.mjs";import n from"../vc-trigger/index.mjs";import{computed as r,createVNode as i,defineComponent as a,ref as o}from"vue";var s=e=>{let t=e===!0?0:1;return{bottomLeft:{points:[`tl`,`bl`],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:[`tr`,`br`],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:[`bl`,`tl`],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:[`br`,`tr`],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}},c=a({name:`SelectTrigger`,inheritAttrs:!1,props:{dropdownAlign:Object,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},dropdownClassName:String,dropdownStyle:t.object,placement:String,empty:{type:Boolean,default:void 0},prefixCls:String,popupClassName:String,animation:String,transitionName:String,getPopupContainer:Function,dropdownRender:Function,containerWidth:Number,dropdownMatchSelectWidth:t.oneOfType([Number,Boolean]).def(!0),popupElement:t.any,direction:String,getTriggerDOMNode:Function,onPopupVisibleChange:Function,onPopupMouseEnter:Function,onPopupFocusin:Function,onPopupFocusout:Function},setup(t,{slots:a,attrs:c,expose:l}){let u=r(()=>{let{dropdownMatchSelectWidth:e}=t;return s(e)}),d=o();return l({getPopupElement:()=>d.value}),()=>{let{empty:r=!1,...o}={...t,...c},{visible:s,dropdownAlign:l,prefixCls:f,popupElement:p,dropdownClassName:m,dropdownStyle:h,direction:g=`ltr`,placement:_,dropdownMatchSelectWidth:v,containerWidth:y,dropdownRender:b,animation:x,transitionName:S,getPopupContainer:C,getTriggerDOMNode:w,onPopupVisibleChange:T,onPopupMouseEnter:E,onPopupFocusin:D,onPopupFocusout:O}=o,k=`${f}-dropdown`,A=p;b&&(A=b({menuNode:p,props:t}));let j=x?`${k}-${x}`:S,M={minWidth:`${y}px`,...h};return typeof v==`number`?M.width=`${v}px`:v&&(M.width=`${y}px`),i(n,{...t,showAction:T?[`click`]:[],hideAction:T?[`click`]:[],popupPlacement:_||(g===`rtl`?`bottomRight`:`bottomLeft`),builtinPlacements:u.value,prefixCls:k,popupTransitionName:j,popupAlign:l,popupVisible:s,getPopupContainer:C,popupClassName:e(m,{[`${k}-empty`]:r}),popupStyle:M,getTriggerDOMNode:w,onPopupVisibleChange:T},{default:a.default,popup:()=>i(`div`,{ref:d,onMouseenter:E,onFocusin:D,onFocusout:O},[A])})}}});export{c as default};