Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/utils/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`../button/button-constants.cjs`),r=require(`../dropdown/dropdown.cjs`),i=require(`./split-button-alpha.cjs`),a=require(`./split-button-omega.cjs`);let o=require(`vue`);var s={compatConfig:{MODE:3},name:`DtSplitButton`,components:{SplitButtonOmega:a.default,DtDropdown:r.default,SplitButtonAlpha:i.default},inheritAttrs:!1,props:{alphaActive:{type:Boolean,default:!1},alphaAriaLabel:{type:String,default:null},alphaIconPosition:{type:String,default:`left`,validator:e=>Object.keys(n.ICON_POSITION_MODIFIERS).includes(e)},alphaLabelClass:{type:[String,Array,Object],default:``},alphaDisabled:{type:Boolean,default:!1},alphaLoading:{type:Boolean,default:!1},alphaTooltipText:{type:String,default:void 0},assertiveOnFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dropdownPlacement:{type:String,default:`bottom-end`},importance:{type:String,default:`primary`,validator:e=>Object.keys(n.BUTTON_IMPORTANCE_MODIFIERS).includes(e)},kind:{type:String,default:`default`,validator:e=>Object.keys(n.BUTTON_KIND_MODIFIERS).includes(e)},omegaActive:{type:Boolean,default:!1},omegaAriaLabel:{type:String,default:null},omegaDisabled:{type:Boolean,default:!1},omegaId:{type:String,default:void 0},omegaTooltipText:{type:String,default:void 0},size:{type:String,default:`md`,validator:e=>Object.keys(n.BUTTON_SIZE_MODIFIERS).includes(e)},width:{type:String,default:null},rootClass:{type:[String,Object,Array],default:``}},emits:[`alpha-clicked`,`omega-clicked`],data(){return{isDropdownOpen:!1}},computed:{alphaButtonProps(){return{active:this.alphaActive,ariaLabel:this.alphaAriaLabel,assertiveOnFocus:this.assertiveOnFocus,disabled:this.disabled||this.alphaDisabled,iconPosition:this.alphaIconPosition,labelClass:this.alphaLabelClass,loading:this.alphaLoading,importance:this.importance,kind:this.kind,size:this.size,tooltipText:this.alphaTooltipText,class:this.$attrs.class,style:this.$attrs.style}},omegaButtonProps(){return{id:this.omegaId,active:this.omegaActive,ariaLabel:this.omegaAriaLabel,disabled:this.disabled||this.omegaDisabled,importance:this.importance,kind:this.kind,size:this.size,tooltipText:this.omegaTooltipText,class:this.$attrs.class,style:this.$attrs.style}}},created(){this.validateProps()},updated(){this.validateProps()},mounted(){e.warnIfUnmounted(e.returnFirstEl(this.$el),this.$options.name)},methods:{validateProps(){this.validateAlphaButtonProps(),this.validateOmegaButtonProps()},validateAlphaButtonProps(){e.hasSlotContent(this.$slots.default)||e.hasSlotContent(this.$slots.alphaIcon)&&!this.alphaTooltipText&&console.warn(`alpha-tooltip-text prop must be set if alpha button has an icon only`)},validateOmegaButtonProps(){e.hasSlotContent(this.$slots.omega)||this.omegaTooltipText||console.warn(`omega-tooltip-text prop is required as it is an icon-only button`)}}};function c(e,t,n,r,i,a){let s=(0,o.resolveComponent)(`split-button-alpha`),c=(0,o.resolveComponent)(`split-button-omega`),l=(0,o.resolveComponent)(`dt-dropdown`);return(0,o.openBlock)(),(0,o.createElementBlock)(`span`,{"data-qa":`dt-split-button`,class:(0,o.normalizeClass)([n.rootClass,`d-split-btn`]),style:(0,o.normalizeStyle)({width:n.width})},[(0,o.createVNode)(s,(0,o.mergeProps)(a.alphaButtonProps,{ref:`alphaButton`,onClick:t[0]||(t[0]=t=>e.$emit(`alpha-clicked`))}),{icon:(0,o.withCtx)(({size:t})=>[(0,o.renderSlot)(e.$slots,`alphaIcon`,{size:t})]),default:(0,o.withCtx)(()=>[(0,o.renderSlot)(e.$slots,`default`)]),_:3},16),(0,o.renderSlot)(e.$slots,`omega`,{},()=>[e.$slots.dropdownList?((0,o.openBlock)(),(0,o.createBlock)(l,{key:0,placement:n.dropdownPlacement,onClick:t[2]||(t[2]=e=>i.isDropdownOpen=!0),onOpened:t[3]||(t[3]=e=>i.isDropdownOpen=e)},{anchor:(0,o.withCtx)(n=>[(0,o.createVNode)(c,(0,o.mergeProps)({...n,...a.omegaButtonProps},{active:i.isDropdownOpen,onClick:t[1]||(t[1]=t=>e.$emit(`omega-clicked`))}),{icon:(0,o.withCtx)(({size:t})=>[(0,o.renderSlot)(e.$slots,`omegaIcon`,{size:t})]),_:3},16,[`active`])]),list:(0,o.withCtx)(({close:t})=>[(0,o.renderSlot)(e.$slots,`dropdownList`,{close:t})]),_:3},8,[`placement`])):((0,o.openBlock)(),(0,o.createBlock)(c,(0,o.mergeProps)({key:1},a.omegaButtonProps,{onClick:t[4]||(t[4]=t=>e.$emit(`omega-clicked`))}),{icon:(0,o.withCtx)(({size:t})=>[(0,o.renderSlot)(e.$slots,`omegaIcon`,{size:t})]),_:3},16))])],6)}var l=t.t(s,[[`render`,c]]);exports.default=l;
//# sourceMappingURL=split-button.cjs.map