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(`../../localization/index.cjs`),r=require(`../button/button.cjs`),i=require(`../dropdown/dropdown.cjs`),a=require(`../callbar-button/callbar-button-constants.cjs`),o=require(`../callbar-button/callbar-button.cjs`);let s=require(`vue`),c=require(`@dialpad/dialtone-icons/vue3`);var l={name:`DtRecipeCallbarButtonWithDropdown`,components:{DtRecipeCallbarButton:o.default,DtDropdown:i.default,DtButton:r.default,DtIconChevronUp:c.DtIconChevronUp},inheritAttrs:!1,props:{id:{type:String,default(){return e.default.getUniqueString()}},ariaLabel:{type:String,default:null,validator:e=>e||(void 0).$slots.default},placement:{type:String,default:`top`},fallbackPlacements:{type:Array,default:()=>[`auto`]},disabled:{type:Boolean,default:!1},forceShowArrow:{type:Boolean,default:!1},active:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},onClick:{type:Function,default:null},buttonClass:{type:[String,Array,Object],default:``},textClass:{type:[String,Array,Object],default:``},buttonWidthSize:{type:String,default:`xl`,validator:e=>a.CALLBAR_BUTTON_VALID_WIDTH_SIZE.includes(e)},invertedTooltip:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:null},tooltipText:{type:String,default:void 0},tooltipDelay:{type:Boolean,default:void 0}},emits:[`arrow-click`,`click`,`opened`],data(){return{open:!1,i18n:new n.DialtoneLocalization}},computed:{showArrowButton(){return this.forceShowArrow||!this.disabled},isCompactMode(){return this.buttonWidthSize===`sm`||this.buttonWidthSize===`md`},arrowButtonLabel(){return this.i18n.$t(`DIALTONE_CALLBAR_BUTTON_WITH_DROPDOWN_ARROW_BUTTON_ARIA_LABEL`)}},mounted(){e.warnIfUnmounted(e.returnFirstEl(this.$el),this.$options.name)},methods:{removeClassStyleAttrs:e.removeClassStyleAttrs,addClassStyleAttrs:e.addClassStyleAttrs,arrowClick(e){return this.$emit(`arrow-click`,e),this.toggleOpen()},toggleOpen(){return this.open=!this.open},syncOpenState(){this.open=this.openDropdown},buttonClick(e){this.$props.onClick?this.$emit(`click`,e):this.arrowClick(e)},onModalIsOpened(e){this.open=e,this.$emit(`opened`,e)}}};function u(e,t,n,r,i,a){let o=(0,s.resolveComponent)(`dt-recipe-callbar-button`),c=(0,s.resolveComponent)(`dt-icon-chevron-up`),l=(0,s.resolveComponent)(`dt-button`),u=(0,s.resolveComponent)(`dt-dropdown`);return(0,s.openBlock)(),(0,s.createElementBlock)(`div`,(0,s.mergeProps)({class:`dt-recipe--callbar-button-with-dropdown`},a.addClassStyleAttrs(e.$attrs)),[(0,s.createVNode)(o,{active:n.active,"aria-label":n.ariaLabel,"button-class":n.buttonClass,"button-width-size":n.buttonWidthSize,danger:n.danger,disabled:n.disabled,"inverted-tooltip":n.invertedTooltip,"show-tooltip":n.showTooltip,"text-class":n.textClass,"tooltip-delay":n.tooltipDelay,"tooltip-text":n.tooltipText,class:`dt-recipe--callbar-button-with-dropdown--main-button`,onClick:a.buttonClick},{icon:(0,s.withCtx)(()=>[(0,s.renderSlot)(e.$slots,`icon`)]),tooltip:(0,s.withCtx)(()=>[(0,s.renderSlot)(e.$slots,`tooltip`)]),default:(0,s.withCtx)(()=>[(0,s.renderSlot)(e.$slots,`default`)]),_:3},8,[`active`,`aria-label`,`button-class`,`button-width-size`,`danger`,`disabled`,`inverted-tooltip`,`show-tooltip`,`text-class`,`tooltip-delay`,`tooltip-text`,`onClick`]),a.showArrowButton?((0,s.openBlock)(),(0,s.createBlock)(u,(0,s.mergeProps)({key:0,id:n.id,"fallback-placements":n.fallbackPlacements,open:i.open,modal:!1,placement:n.placement,class:`dt-recipe--callbar-button-with-dropdown--dropdown-wrapper`,padding:`none`},a.removeClassStyleAttrs(e.$attrs),{onOpened:a.onModalIsOpened}),{anchor:(0,s.withCtx)(()=>[(0,s.createVNode)(l,{active:i.open,class:(0,s.normalizeClass)([`dt-recipe--callbar-button-with-dropdown--arrow`,{"dt-recipe--callbar-button-with-dropdown--arrow--large":!a.isCompactMode}]),circle:!0,importance:`clear`,size:`lg`,"aria-label":a.arrowButtonLabel,title:a.arrowButtonLabel,width:`2rem`,onClick:a.arrowClick},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(c,{class:`dt-recipe--callbar-button-with-dropdown--arrow__icon`,size:`200`})]),_:1},8,[`active`,`class`,`aria-label`,`title`,`onClick`])]),list:(0,s.withCtx)(({close:t})=>[(0,s.renderSlot)(e.$slots,`list`,{close:t})]),_:3},16,[`id`,`fallback-placements`,`open`,`placement`,`onOpened`])):(0,s.createCommentVNode)(``,!0)],16)}var d=t.t(l,[[`render`,u]]);exports.default=d;
//# sourceMappingURL=callbar-button-with-dropdown.cjs.map