"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("./split-button-alpha.cjs"),m=require("./split-button-omega.cjs"),l=require("../../common/utils/index.cjs"),t=require("vue"),f=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),g=require("../dropdown/dropdown.cjs"),i=require("../button/button-constants.cjs");require("./split-button-constants.cjs");const b={compatConfig:{MODE:3},name:"DtSplitButton",components:{SplitButtonOmega:m.default,DtDropdown:g.default,SplitButtonAlpha:h.default},inheritAttrs:!1,props:{alphaActive:{type:Boolean,default:!1},alphaAriaLabel:{type:String,default:null},alphaIconPosition:{type:String,default:"left",validator:e=>Object.keys(i.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(i.BUTTON_IMPORTANCE_MODIFIERS).includes(e)},kind:{type:String,default:"default",validator:e=>Object.keys(i.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(i.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(){l.warnIfUnmounted(l.returnFirstEl(this.$el),this.$options.name)},methods:{validateProps(){this.validateAlphaButtonProps(),this.validateOmegaButtonProps()},validateAlphaButtonProps(){l.hasSlotContent(this.$slots.default)||l.hasSlotContent(this.$slots.alphaIcon)&&!this.alphaTooltipText&&console.warn("alpha-tooltip-text prop must be set if alpha button has an icon only")},validateOmegaButtonProps(){l.hasSlotContent(this.$slots.omega)||this.omegaTooltipText||console.warn("omega-tooltip-text prop is required as it is an icon-only button")}}};function y(e,a,s,B,n,r){const u=t.resolveComponent("split-button-alpha"),p=t.resolveComponent("split-button-omega"),c=t.resolveComponent("dt-dropdown");return t.openBlock(),t.createElementBlock("span",{"data-qa":"dt-split-button",class:t.normalizeClass([s.rootClass,"d-split-btn"]),style:t.normalizeStyle({width:s.width})},[t.createVNode(u,t.mergeProps(r.alphaButtonProps,{ref:"alphaButton",onClick:a[0]||(a[0]=o=>e.$emit("alpha-clicked"))}),{icon:t.withCtx(({size:o})=>[t.renderSlot(e.$slots,"alphaIcon",{size:o})]),default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16),t.renderSlot(e.$slots,"omega",{},()=>[e.$slots.dropdownList?(t.openBlock(),t.createBlock(c,{key:0,placement:s.dropdownPlacement,onClick:a[2]||(a[2]=o=>n.isDropdownOpen=!0),onOpened:a[3]||(a[3]=o=>n.isDropdownOpen=o)},{anchor:t.withCtx(o=>[t.createVNode(p,t.mergeProps({...o,...r.omegaButtonProps},{active:n.isDropdownOpen,onClick:a[1]||(a[1]=d=>e.$emit("omega-clicked"))}),{icon:t.withCtx(({size:d})=>[t.renderSlot(e.$slots,"omegaIcon",{size:d})]),_:3},16,["active"])]),list:t.withCtx(({close:o})=>[t.renderSlot(e.$slots,"dropdownList",{close:o})]),_:3},8,["placement"])):(t.openBlock(),t.createBlock(p,t.mergeProps({key:1},r.omegaButtonProps,{onClick:a[4]||(a[4]=o=>e.$emit("omega-clicked"))}),{icon:t.withCtx(({size:o})=>[t.renderSlot(e.$slots,"omegaIcon",{size:o})]),_:3},16))])],6)}const S=f._(b,[["render",y]]);exports.default=S;
//# sourceMappingURL=split-button.cjs.map
