"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),R=require("../_util/classNames.js"),d=require("../_util/vue-types/index.js"),V=require("../vc-trigger/Trigger.js"),W=e=>{const 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}}}},B=o.defineComponent({name:"SelectTrigger",inheritAttrs:!1,props:{dropdownAlign:Object,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},dropdownClassName:String,dropdownStyle:d.default.object,placement:String,empty:{type:Boolean,default:void 0},prefixCls:String,popupClassName:String,animation:String,transitionName:String,getPopupContainer:Function,dropdownRender:Function,containerWidth:Number,dropdownMatchSelectWidth:d.default.oneOfType([Number,Boolean]).def(!0),popupElement:d.default.any,direction:String,getTriggerDOMNode:Function,onPopupVisibleChange:Function,onPopupMouseEnter:Function,onPopupFocusin:Function,onPopupFocusout:Function},setup(e,{slots:t,attrs:m,expose:b}){const h=o.computed(()=>{const{dropdownMatchSelectWidth:n}=e;return W(n)}),l=o.ref();return b({getPopupElement:()=>l.value}),()=>{const{empty:n=!1,...w}={...e,...m},{visible:P,dropdownAlign:N,prefixCls:S,popupElement:s,dropdownClassName:C,dropdownStyle:y,direction:F="ltr",placement:v,dropdownMatchSelectWidth:i,containerWidth:a,dropdownRender:c,animation:f,transitionName:M,getPopupContainer:T,getTriggerDOMNode:j,onPopupVisibleChange:p,onPopupMouseEnter:x,onPopupFocusin:$,onPopupFocusout:A}=w,r=`${S}-dropdown`;let g=s;c&&(g=c({menuNode:s,props:e}));const O=f?`${r}-${f}`:M,u={minWidth:`${a}px`,...y};return typeof i=="number"?u.width=`${i}px`:i&&(u.width=`${a}px`),o.createVNode(V.default,{...e,showAction:p?["click"]:[],hideAction:p?["click"]:[],popupPlacement:v||(F==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:h.value,prefixCls:r,popupTransitionName:O,popupAlign:N,popupVisible:P,getPopupContainer:T,popupClassName:R.default(C,{[`${r}-empty`]:n}),popupStyle:u,getTriggerDOMNode:j,onPopupVisibleChange:p},{default:t.default,popup:()=>o.createVNode("div",{ref:l,onMouseenter:x,onFocusin:$,onFocusout:A},[g])})}}});exports.default=B;
