import{defineComponent as I,computed as L,createVNode as o}from"vue";import U from"@ant-design/icons-vue/EllipsisOutlined";import H from"../_util/classNames.mjs";import M from"../_util/props-util/initDefaultProps.mjs";import"../button/index.mjs";import $ from"../config-provider/hooks/useConfigInject.mjs";import q from"./dropdown.mjs";import{dropdownButtonProps as z}from"./props.mjs";import F from"./style/index.mjs";import i from"../button/button.mjs";const J=i.Group,at=I({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:M(z(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:Object,setup(a,{slots:t,attrs:d,emit:n}){const m=e=>{n("update:visible",e),n("visibleChange",e),n("update:open",e),n("openChange",e)},{prefixCls:l,direction:f,getPopupContainer:c}=$("dropdown",a),g=L(()=>`${l.value}-button`),[h,b]=F(l);return()=>{const{type:e="default",disabled:r,danger:p,loading:y,htmlType:C,class:v="",overlay:B=t.overlay?.(),trigger:P,align:w,open:D,visible:N,onVisibleChange:K,placement:O=f.value==="rtl"?"bottomLeft":"bottomRight",href:T,title:V,icon:_=t.icon?.()||o(U,null,null),mouseEnterDelay:S,mouseLeaveDelay:x,overlayClassName:A,overlayStyle:E,destroyPopupOnHide:R,onClick:j,"onUpdate:open":Q,...k}={...a,...d},G={align:w,disabled:r,trigger:r?[]:P,placement:O,getPopupContainer:c?.value,onOpenChange:m,mouseEnterDelay:S,mouseLeaveDelay:x,open:D??N,overlayClassName:A,overlayStyle:E,destroyPopupOnHide:R},u=o(i,{danger:p,type:e,disabled:r,loading:y,onClick:j,htmlType:C,href:T,title:V},{default:t.default}),s=o(i,{danger:p,type:e,icon:_},null);return h(o(J,{...k,class:H(g.value,v,b.value)},{default:()=>[t.leftButton?t.leftButton({button:u}):u,o(q,G,{default:()=>[t.rightButton?t.rightButton({button:s}):s],overlay:()=>B})]}))}}});export{at as default};
