@dialpad/dialtone-vue
Version:
Vue component library for Dialpad's design system Dialtone
3 lines (2 loc) • 3.94 kB
JavaScript
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@dialpad/dialtone-icons/vue2"),o=require("./ivr-node-constants.cjs"),i=require("../../localization/index.cjs"),a=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),d=require("../dropdown/dropdown.cjs"),s=require("../button/button.cjs"),l=require("../card/card.cjs"),_=new Map([[o.IVR_NODE_PROMPT_MENU,t.DtIconKeypad],[o.IVR_NODE_PROMPT_COLLECT,t.DtIconDialer],[o.IVR_NODE_PROMPT_PLAY,t.DtIconVolume2],[o.IVR_NODE_EXPERT,t.DtIconExpertNode],[o.IVR_NODE_BRANCH,t.DtIconBranch],[o.IVR_NODE_GO_TO,t.DtIconCallMerge],[o.IVR_NODE_ASSIGN,t.DtIconChevronsRight],[o.IVR_NODE_CUSTOMER_DATA,t.DtIconListBullet],[o.IVR_NODE_TRANSFER,t.DtIconTransfer],[o.IVR_NODE_HANGUP,t.DtIconPhoneHangUp]]),u={name:"DtRecipeIvrNode",components:{DtCard:l.default,DtButton:s.default,DtDropdown:d.default,DtIconKeypad:t.DtIconKeypad,DtIconDialer:t.DtIconDialer,DtIconVolume2:t.DtIconVolume2,DtIconExpertNode:t.DtIconExpertNode,DtIconBranch:t.DtIconBranch,DtIconCallMerge:t.DtIconCallMerge,DtIconChevronsRight:t.DtIconChevronsRight,DtIconTransfer:t.DtIconTransfer,DtIconPhoneHangUp:t.DtIconPhoneHangUp,DtIconMoreVertical:t.DtIconMoreVertical,DtIconListBullet:t.DtIconListBullet},props:{nodeType:{type:String,required:!0},nodeLabel:{type:String,required:!0},isSelected:{type:Boolean,default:!1},dtmfKey:{type:String,default:null}},emits:["click"],data(){return{isOpen:!1,i18n:new i.DialtoneLocalization}},computed:{nodeIcon(){return _.get(this.nodeType)},nodeClass(){const{normal:c,selected:e}=o.IVR_NODE_CLASS_MAPPING[this.nodeType];return this.isSelected?e:c},isGotoNode(){return this.nodeType===o.IVR_NODE_GO_TO},nodeAriaLabel(){const c=this.nodeType.toUpperCase();return this.i18n.$t(`DIALTONE_IVR_NODE_${c}_ARIA_LABEL`)},menuButtonAriaLabel(){return this.i18n.$t("DIALTONE_IVR_NODE_MENU_BUTTON_ARIA_LABEL")}},methods:{openMenu(){this.isOpen=!0}}};var p=function(){var e=this,n=e._self._c;return n("div",e._g({class:["d-recipe-ivr-node",e.nodeClass]},e.$listeners),[e.dtmfKey?n("div",{staticClass:"d-recipe-ivr-node__connector d-recipe-ivr-node__connector-dtmf",class:{"d-recipe-ivr-node__connector-dtmf--selected":e.isSelected},attrs:{"data-qa":"dt-top-connector-dtmf"}},[e._v(" "+e._s(e.dtmfKey)+" ")]):e._e(),e.$slots.connector?e._t("connector"):e._e(),!e.dtmfKey&&!e.$slots.connector?n("div",{staticClass:"d-recipe-ivr-node__connector",class:{"d-recipe-ivr-node__connector--selected":e.isSelected},attrs:{"data-qa":"dt-top-connector"}}):e._e(),n("dt-card",{scopedSlots:e._u([{key:"header",fn:function(){return[n("div",{staticClass:"d-recipe-ivr-node__header-left"},[n("dt-button",{attrs:{importance:"clear",kind:"muted","data-qa":"dt-ivr-node-icon","aria-label":e.nodeAriaLabel,title:e.nodeAriaLabel},scopedSlots:e._u([{key:"icon",fn:function(){return[n(e.nodeIcon,{tag:"component",class:["",{"d-recipe-ivr-node__goto-icon":e.isGotoNode}],attrs:{size:"200"}})]},proxy:!0}])}),n("p",{staticClass:"d-recipe-ivr-node__label",attrs:{"data-qa":"ivr-node-label"}},[e._v(" "+e._s(e.nodeLabel)+" ")])],1),n("dt-dropdown",{attrs:{placement:"bottom",open:e.isOpen},on:{"update:open":function(r){e.isOpen=r}},scopedSlots:e._u([{key:"anchor",fn:function(){return[n("dt-button",{attrs:{importance:"clear",kind:"muted","aria-label":e.menuButtonAriaLabel,title:e.menuButtonAriaLabel},on:{click:function(r){return r.stopPropagation(),r.preventDefault(),e.openMenu.apply(null,arguments)}},scopedSlots:e._u([{key:"icon",fn:function(){return[n("dt-icon-more-vertical",{attrs:{size:"200"}})]},proxy:!0}])})]},proxy:!0},{key:"list",fn:function({close:r}){return[n("div",{staticClass:"d-recipe-ivr-node__dropdown-list"},[e._t("menuItems",null,{close:r})],2)]}}],null,!0)})]},proxy:!0},{key:"content",fn:function(){return[e._t("content")]},proxy:!0}],null,!0)})],2)},D=[],I=a.n(u,p,D);const f=I.exports;exports.default=f;
//# sourceMappingURL=ivr-node.cjs.map