"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./split-button-alpha.cjs"),s=require("./split-button-omega.cjs"),r=require("../../common/utils/index.cjs"),u=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),p=require("../dropdown/dropdown.cjs"),i=require("../button/button-constants.cjs");require("./split-button-constants.cjs");const d={name:"DtSplitButton",components:{SplitButtonOmega:s.default,DtDropdown:p.default,SplitButtonAlpha:l.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:""},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},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}},emits:["alpha-clicked","omega-clicked"],data(){return{isDropdownOpen:!1}},computed:{alphaButtonProps(){return{active:this.alphaActive,ariaLabel:this.alphaAriaLabel,assertiveOnFocus:this.assertiveOnFocus,disabled:this.disabled,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}},omegaButtonProps(){return{id:this.omegaId,active:this.omegaActive,ariaLabel:this.omegaAriaLabel,disabled:this.disabled,importance:this.importance,kind:this.kind,size:this.size,tooltipText:this.omegaTooltipText,class:this.$attrs.class}},defaultSlotHasContent(){var e,t;return this.$scopedSlots.default&&this.$scopedSlots.default()&&((t=(e=this.$scopedSlots.default()[0])==null?void 0:e.text)==null?void 0:t.trim())},omegaSlotIsSet(){return this.$scopedSlots.omega&&this.$scopedSlots.omega()}},created(){this.validateProps()},updated(){this.validateProps()},mounted(){r.warnIfUnmounted(this.$el,this.$options.name)},methods:{validateProps(){this.validateAlphaButtonProps(),this.validateOmegaButtonProps()},validateAlphaButtonProps(){var t;if(this.defaultSlotHasContent)return;((t=this.$refs.alphaButton)==null?void 0:t.$scopedSlots.icon)&&this.$refs.alphaButton.$scopedSlots.icon()&&!this.alphaTooltipText&&console.warn("alpha-tooltip-text prop must be set if alpha button has an icon only")},validateOmegaButtonProps(){this.omegaSlotIsSet||this.omegaTooltipText||console.warn("omega-tooltip-text prop is required as it is an icon-only button")}}};var c=function(){var t=this,a=t._self._c;return a("span",{staticClass:"d-split-btn",style:{width:t.width},attrs:{"data-qa":"dt-split-button"}},[a("split-button-alpha",t._b({ref:"alphaButton",nativeOn:{click:function(o){return t.$emit("alpha-clicked")}},scopedSlots:t._u([{key:"icon",fn:function({size:o}){return[t._t("alphaIcon",null,{size:o})]}}],null,!0)},"split-button-alpha",t.alphaButtonProps,!1),[t._t("default")],2),t._t("omega",function(){return[t.$slots.dropdownList?a("dt-dropdown",{attrs:{placement:t.dropdownPlacement},on:{click:function(o){t.isDropdownOpen=!0},opened:o=>t.isDropdownOpen=o},scopedSlots:t._u([{key:"anchor",fn:function(o){return[a("split-button-omega",t._b({attrs:{active:t.isDropdownOpen},nativeOn:{click:function(n){return t.$emit("omega-clicked")}},scopedSlots:t._u([{key:"icon",fn:function({size:n}){return[t._t("omegaIcon",null,{size:n})]}}],null,!0)},"split-button-omega",{...o,...t.omegaButtonProps},!1))]}},{key:"list",fn:function({close:o}){return[t._t("dropdownList",null,{close:o})]}}],null,!0)}):a("split-button-omega",t._b({nativeOn:{click:function(o){return t.$emit("omega-clicked")}},scopedSlots:t._u([{key:"icon",fn:function({size:o}){return[t._t("omegaIcon",null,{size:o})]}}],null,!0)},"split-button-omega",t.omegaButtonProps,!1))]})],2)},h=[],f=u.n(d,c,h);const m=f.exports;exports.default=m;
//# sourceMappingURL=split-button.cjs.map
