@dialpad/dialtone 9.127.0 → 9.127.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tokens/doc.json +22741 -22741
- package/dist/vue2/common/mixins/index.cjs +1 -1
- package/dist/vue2/common/mixins/index.js +2 -4
- package/dist/vue2/common/mixins/index.js.map +1 -1
- package/dist/vue2/component-documentation.json +1 -1
- package/dist/vue2/dialtone-vue.cjs +1 -1
- package/dist/vue2/dialtone-vue.js +345 -347
- package/dist/vue2/dialtone-vue.js.map +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs.map +1 -1
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.js +16 -12
- package/dist/vue2/lib/attachment-carousel/attachment-carousel.js.map +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.cjs +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.cjs.map +1 -1
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.js +6 -6
- package/dist/vue2/lib/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/vue2/lib/button/button.cjs +1 -1
- package/dist/vue2/lib/button/button.cjs.map +1 -1
- package/dist/vue2/lib/button/button.js +6 -6
- package/dist/vue2/lib/button/button.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +13 -13
- package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs.map +1 -1
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js +9 -9
- package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +1 -1
- package/dist/vue2/lib/chip/chip.cjs +1 -1
- package/dist/vue2/lib/chip/chip.cjs.map +1 -1
- package/dist/vue2/lib/chip/chip.js +7 -7
- package/dist/vue2/lib/chip/chip.js.map +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs.map +1 -1
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js +13 -13
- package/dist/vue2/lib/contact-centers-row/contact-centers-row.js.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker.cjs +1 -1
- package/dist/vue2/lib/datepicker/datepicker.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/datepicker.js +19 -19
- package/dist/vue2/lib/datepicker/datepicker.js.map +1 -1
- package/dist/vue2/lib/datepicker/formatUtils.cjs +1 -1
- package/dist/vue2/lib/datepicker/formatUtils.cjs.map +1 -1
- package/dist/vue2/lib/datepicker/formatUtils.js +21 -20
- package/dist/vue2/lib/datepicker/formatUtils.js.map +1 -1
- package/dist/vue2/lib/editor/editor.cjs +1 -1
- package/dist/vue2/lib/editor/editor.cjs.map +1 -1
- package/dist/vue2/lib/editor/editor.js +17 -17
- package/dist/vue2/lib/editor/editor.js.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.cjs.map +1 -1
- package/dist/vue2/lib/emoji-picker/emoji-picker.js +6 -6
- package/dist/vue2/lib/emoji-picker/emoji-picker.js.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.cjs.map +1 -1
- package/dist/vue2/lib/emoji-row/emoji-row.js +24 -20
- package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs.map +1 -1
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.js +8 -8
- package/dist/vue2/lib/feed-item-pill/feed-item-pill.js.map +1 -1
- package/dist/vue2/lib/general-row/general-row.cjs +1 -1
- package/dist/vue2/lib/general-row/general-row.cjs.map +1 -1
- package/dist/vue2/lib/general-row/general-row.js +17 -17
- package/dist/vue2/lib/general-row/general-row.js.map +1 -1
- package/dist/vue2/lib/group-row/group-row.cjs +1 -1
- package/dist/vue2/lib/group-row/group-row.cjs.map +1 -1
- package/dist/vue2/lib/group-row/group-row.js +11 -7
- package/dist/vue2/lib/group-row/group-row.js.map +1 -1
- package/dist/vue2/lib/icon/icon.cjs +1 -1
- package/dist/vue2/lib/icon/icon.cjs.map +1 -1
- package/dist/vue2/lib/icon/icon.js +10 -6
- package/dist/vue2/lib/icon/icon.js.map +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.cjs +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.cjs.map +1 -1
- package/dist/vue2/lib/image-viewer/image-viewer.js +8 -7
- package/dist/vue2/lib/image-viewer/image-viewer.js.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.cjs +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.cjs.map +1 -1
- package/dist/vue2/lib/ivr-node/ivr-node.js +17 -17
- package/dist/vue2/lib/ivr-node/ivr-node.js.map +1 -1
- package/dist/vue2/lib/loader/loader.cjs +1 -1
- package/dist/vue2/lib/loader/loader.cjs.map +1 -1
- package/dist/vue2/lib/loader/loader.js +12 -8
- package/dist/vue2/lib/loader/loader.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-link.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-link.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input-link.js +15 -15
- package/dist/vue2/lib/message-input/message-input-link.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input-topbar.js +14 -10
- package/dist/vue2/lib/message-input/message-input-topbar.js.map +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs +1 -1
- package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
- package/dist/vue2/lib/message-input/message-input.js +14 -10
- package/dist/vue2/lib/message-input/message-input.js.map +1 -1
- package/dist/vue2/lib/modal/modal.cjs +1 -1
- package/dist/vue2/lib/modal/modal.cjs.map +1 -1
- package/dist/vue2/lib/modal/modal.js +12 -11
- package/dist/vue2/lib/modal/modal.js.map +1 -1
- package/dist/vue2/lib/notice/notice-action.cjs +1 -1
- package/dist/vue2/lib/notice/notice-action.cjs.map +1 -1
- package/dist/vue2/lib/notice/notice-action.js +10 -6
- package/dist/vue2/lib/notice/notice-action.js.map +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs +1 -1
- package/dist/vue2/lib/pagination/pagination.cjs.map +1 -1
- package/dist/vue2/lib/pagination/pagination.js +7 -7
- package/dist/vue2/lib/pagination/pagination.js.map +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.cjs +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.cjs.map +1 -1
- package/dist/vue2/lib/popover/popover-header-footer.js +13 -9
- package/dist/vue2/lib/popover/popover-header-footer.js.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +35 -35
- package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.cjs +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.cjs.map +1 -1
- package/dist/vue2/lib/unread-pill/unread-pill.js +15 -11
- package/dist/vue2/lib/unread-pill/unread-pill.js.map +1 -1
- package/dist/vue2/localization/index.cjs +1 -1
- package/dist/vue2/localization/index.cjs.map +1 -1
- package/dist/vue2/localization/index.js +59 -53
- package/dist/vue2/localization/index.js.map +1 -1
- package/dist/vue2/shared/sr_only_close_button.cjs +1 -1
- package/dist/vue2/shared/sr_only_close_button.cjs.map +1 -1
- package/dist/vue2/shared/sr_only_close_button.js +14 -10
- package/dist/vue2/shared/sr_only_close_button.js.map +1 -1
- package/dist/vue2/types/common/mixins/index.d.ts +0 -1
- package/dist/vue2/types/common/sr_only_close_button.vue.d.ts +5 -8
- package/dist/vue2/types/common/sr_only_close_button.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/breadcrumbs/breadcrumbs.vue.d.ts +3 -5
- package/dist/vue2/types/components/breadcrumbs/breadcrumbs.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/button/button.vue.d.ts +4 -6
- package/dist/vue2/types/components/button/button.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/chip/chip.vue.d.ts +6 -8
- package/dist/vue2/types/components/chip/chip.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/datepicker/formatUtils.d.ts.map +1 -1
- package/dist/vue2/types/components/datepicker/modules/calendar.vue.d.ts +3 -5
- package/dist/vue2/types/components/datepicker/modules/calendar.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/datepicker/modules/month-year-picker.vue.d.ts +3 -5
- package/dist/vue2/types/components/datepicker/modules/month-year-picker.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/emoji_picker/emoji_picker.vue.d.ts +1 -5
- package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts +2 -4
- package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/loader/loader.vue.d.ts +5 -6
- package/dist/vue2/types/components/loader/loader.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/modal/modal.vue.d.ts +2 -4
- package/dist/vue2/types/components/modal/modal.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/notice/notice_action.vue.d.ts +5 -6
- package/dist/vue2/types/components/notice/notice_action.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts +4 -6
- package/dist/vue2/types/components/pagination/pagination.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/popover/popover_header_footer.vue.d.ts +5 -6
- package/dist/vue2/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +5 -7
- package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +4 -6
- package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +4 -6
- package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +4 -6
- package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +3 -5
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +5 -6
- package/dist/vue2/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +14 -16
- package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +5 -6
- package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +6 -8
- package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +5 -6
- package/dist/vue2/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +5 -7
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +3 -5
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +5 -6
- package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +5 -7
- package/dist/vue2/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts +17 -19
- package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/group_row/group_row.vue.d.ts +8 -9
- package/dist/vue2/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/dist/vue2/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +5 -6
- package/dist/vue2/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/dist/vue3/lib/icon/icon.cjs +1 -1
- package/dist/vue3/lib/icon/icon.cjs.map +1 -1
- package/dist/vue3/lib/icon/icon.js +4 -5
- package/dist/vue3/lib/icon/icon.js.map +1 -1
- package/dist/vue3/types/components/icon/icon.vue.d.ts +1 -3
- package/package.json +1 -1
- package/dist/vue2/common/mixins/localization.cjs +0 -2
- package/dist/vue2/common/mixins/localization.cjs.map +0 -1
- package/dist/vue2/common/mixins/localization.js +0 -10
- package/dist/vue2/common/mixins/localization.js.map +0 -1
- package/dist/vue2/types/common/mixins/localization.d.ts +0 -8
- package/dist/vue2/types/common/mixins/localization.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./general-row-constants.cjs"),c=require("@dialpad/dialtone-icons/vue2"),_=require("./leftbar-general-row-icon.cjs"),p=require("../../common/utils/index.cjs"),h=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./general-row-constants.cjs"),c=require("@dialpad/dialtone-icons/vue2"),_=require("./leftbar-general-row-icon.cjs"),p=require("../../common/utils/index.cjs"),h=require("../../localization/index.cjs"),f=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),b=require("../emoji-text-wrapper/emoji-text-wrapper.cjs"),C=require("../badge/badge.cjs"),T=require("../button/button.cjs"),E=require("../tooltip/tooltip.cjs"),w={name:"DtRecipeGeneralRow",components:{DtEmojiTextWrapper:b.default,DtBadge:C.default,DtButton:T.default,DtTooltip:E.default,DtIconPhone:c.DtIconPhone,DtIconWaveform:c.DtIconWaveform,DtRecipeLeftbarGeneralRowIcon:_.default},inheritAttrs:!1,props:{type:{type:String,default:"inbox",validator:a=>Object.values(n.LEFTBAR_GENERAL_ROW_TYPES).includes(a)},ariaLabel:{type:String,default:""},description:{type:String,required:!0},color:{type:String,default:null,validator:a=>Object.keys(n.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(a)},channelSetting:{type:String,default:null},hasUnreads:{type:Boolean,default:!1},unreadCount:{type:String,default:null},unreadMentionCount:{type:String,default:null},selected:{type:Boolean,default:!1},muted:{type:Boolean,default:!1},activeVoiceChat:{type:Boolean,default:!1},dndText:{type:String,default:""},hasCallButton:{type:Boolean,default:!1},isTyping:{type:Boolean,default:!1},iconSize:{type:String,default:"300",validator:a=>n.LEFTBAR_GENERAL_ROW_ICON_SIZES.includes(a)}},emits:["click","call"],data(){return{actionFocused:!1,labelWidth:"100%",i18n:new h.DialtoneLocalization}},computed:{leftbarGeneralRowClasses(){return["d-recipe-leftbar-row",{"d-recipe-leftbar-row--no-action":!this.hasCallButton,"d-recipe-leftbar-row--has-unread":this.hasUnreads,"d-recipe-leftbar-row__unread-count":this.showUnreadCount||this.showUnreadMentionCount,"d-recipe-leftbar-row--selected":this.selected,"d-recipe-leftbar-row--muted":this.muted,"d-recipe-leftbar-row--action-focused":this.actionFocused}]},getIcon(){switch(this.type){case n.LEFTBAR_GENERAL_ROW_TYPES.CHANNELS:if(this.hasUnreads)return"channel unread";break;case n.LEFTBAR_GENERAL_ROW_TYPES.LOCKED_CHANNEL:if(this.hasUnreads)return"locked channel unread";break}return this.type},getAriaLabel(){return this.ariaLabel?this.ariaLabel:p.safeConcatStrings([this.typingTooltip,this.description,this.unreadCountTooltip,this.dndTextTooltip,this.activeVoiceChatTooltip])},hasActions(){return this.dndText||this.activeVoiceChat||this.showUnreadCount||this.hasCallButton||this.showUnreadMentionCount},showUnreadCount(){return!!this.unreadCount&&this.hasUnreads},showUnreadMentionCount(){return!!this.unreadMentionCount&&this.hasUnreads},hasUnreadCount(){return this.unreadCount!==null},hasUnreadMentionCount(){return this.unreadMentionCount!==null},shouldApplyCustomStyleForCountBadge(){return this.hasUnreadCount&&this.hasUnreadMentionCount},shouldApplyCustomStyleForMentionOnly(){return this.channelSetting==="always"&&!this.hasUnreadCount&&this.hasUnreadMentionCount},messageCount(){return isNaN(this.unreadCount)?this.unreadCount:Number(this.unreadCount)},mentionCount(){return isNaN(this.unreadMentionCount)?this.unreadMentionCount:Number(this.unreadMentionCount)},unreadCountTooltip(){return p.safeConcatStrings([this.unreadCount&&this.i18n.$t("DIALTONE_UNREAD_MESSAGE_COUNT_TEXT",{unreadCount:this.messageCount}),this.unreadMentionCount&&this.i18n.$t("DIALTONE_UNREAD_MENTION_COUNT_TEXT",{unreadCount:this.mentionCount})])},dndTextTooltip(){return this.dndText&&this.i18n.$t("DIALTONE_GENERAL_ROW_DND_TEXT_TOOLTIP")},activeVoiceChatTooltip(){return this.activeVoiceChat&&this.i18n.$t("DIALTONE_GENERAL_ROW_ACTIVE_VOICE_CHAT_TEXT")},callButtonTooltip(){return this.i18n.$t("DIALTONE_GENERAL_ROW_CALL_BUTTON_TOOLTIP")},typingTooltip(){return this.isTyping&&this.i18n.$t("DIALTONE_TYPING_TEXT")}},watch:{$props:{immediate:!0,deep:!0,async handler(){this.validateProps(),await this.$nextTick(),this.adjustLabelWidth()}}},mounted(){this.resizeObserver=new ResizeObserver(this.adjustLabelWidth),this.resizeObserver.observe(this.$el),this.adjustLabelWidth()},beforeDestroy:function(){this.resizeObserver.disconnect()},methods:{validateProps(){this.type===n.LEFTBAR_GENERAL_ROW_TYPES.CONTACT_CENTER&&!Object.keys(n.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(this.color)&&console.error(n.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR)},adjustLabelWidth(){var i,o,s,l,d,u;const a=((o=(i=this.$el)==null?void 0:i.querySelector(".d-recipe-leftbar-row__primary"))==null?void 0:o.clientWidth)||0,t=((l=(s=this.$el)==null?void 0:s.querySelector(".d-recipe-leftbar-row__omega"))==null?void 0:l.clientWidth)||0,e=((u=(d=this.$el)==null?void 0:d.querySelector(".d-recipe-leftbar-row__alpha"))==null?void 0:u.clientWidth)||0,r=16;this.labelWidth=a-(t+e+r)+"px"}}};var y=function(){var t=this,e=t._self._c;return e("div",{class:t.leftbarGeneralRowClasses,attrs:{"data-qa":"dt-recipe-leftbar-row"}},[e("a",t._g(t._b({staticClass:"d-recipe-leftbar-row__primary",attrs:{"data-qa":"data-qa"in t.$attrs?t.$attrs["data-qa"]:"d-recipe-leftbar-row-link","aria-label":t.getAriaLabel,title:t.description,href:"href"in t.$attrs?t.$attrs.href:"javascript:void(0)"}},"a",t.$attrs,!1),t.$listeners),[e("div",{staticClass:"d-recipe-leftbar-row__alpha"},[t.isTyping?e("div",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip",value:t.typingTooltip,expression:"typingTooltip"}],staticClass:"d-recipe-leftbar-row__is-typing"},[e("span"),e("span"),e("span")]):t._t("left",function(){return[e("dt-recipe-leftbar-general-row-icon",{attrs:{type:t.getIcon,color:t.color,"icon-size":t.iconSize,"data-qa":"dt-recipe-leftbar-row-icon"}})]})],2),e("div",{staticClass:"d-recipe-leftbar-row__label",style:`flex-basis: ${t.labelWidth}`},[t._t("label",function(){return[e("dt-emoji-text-wrapper",{staticClass:"d-recipe-leftbar-row__description",attrs:{"data-qa":"dt-recipe-leftbar-row-description",size:"200"}},[t._v(" "+t._s(t.description)+" ")])]})],2)]),t.hasActions?e("div",{staticClass:"d-recipe-leftbar-row__omega"},[t.dndText?e("dt-tooltip",{attrs:{placement:"top",message:t.dndTextTooltip},scopedSlots:t._u([{key:"anchor",fn:function(){return[e("div",{ref:"d-recipe-leftbar-row-dnd",staticClass:"d-recipe-leftbar-row__dnd",attrs:{"data-qa":"dt-recipe-leftbar-row-dnd"}},[t._v(" "+t._s(t.dndText)+" ")])]},proxy:!0}],null,!1,3247296267)}):t._e(),t.activeVoiceChat?e("div",{directives:[{name:"dt-tooltip",rawName:"v-dt-tooltip",value:t.activeVoiceChatTooltip,expression:"activeVoiceChatTooltip"}],staticClass:"d-recipe-leftbar-row__active-voice"},[e("dt-icon-waveform",{attrs:{size:"300"}})],1):t.showUnreadCount||t.showUnreadMentionCount?e("dt-tooltip",{attrs:{message:t.unreadCountTooltip,placement:"top"},scopedSlots:t._u([{key:"anchor",fn:function(){return[t.showUnreadCount?e("dt-badge",{class:["d-recipe-leftbar-row__unread-badge",{"d-recipe-leftbar-row__unread-count-badge":t.shouldApplyCustomStyleForCountBadge}],attrs:{kind:"count",type:"bulletin","data-qa":"dt-recipe-leftbar-row-unread-badge"}},[t._v(" "+t._s(t.unreadCount)+" ")]):t._e(),t.showUnreadMentionCount?e("dt-badge",{class:["d-recipe-leftbar-row__unread-badge",{"d-recipe-leftbar-row__unread-mention-count-badge":t.shouldApplyCustomStyleForCountBadge},{"d-recipe-leftbar-row__unread-mention-only-count-badge":t.shouldApplyCustomStyleForMentionOnly}],attrs:{kind:"count",type:"bulletin","data-qa":"dt-recipe-leftbar-row-unread-mention-badge"}},[t._v(" "+t._s(t.unreadMentionCount)+" ")]):t._e()]},proxy:!0}],null,!1,715135836)}):t._e(),t.hasCallButton?e("div",{staticClass:"d-recipe-leftbar-row__action",attrs:{"data-qa":"dt-recipe-leftbar-row-action"}},[e("dt-tooltip",{attrs:{message:t.callButtonTooltip,placement:"top"},scopedSlots:t._u([{key:"anchor",fn:function(){return[e("dt-button",{staticClass:"d-recipe-leftbar-row__action-button",attrs:{"data-qa":"dt-recipe-leftbar-row-action-call-button",circle:"",size:"xs",kind:"inverted","aria-label":t.callButtonTooltip},on:{focus:function(r){t.actionFocused=!0},blur:function(r){t.actionFocused=!1},click:function(r){return r.stopPropagation(),t.$emit("call",r)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("dt-icon-phone",{attrs:{size:"200"}})]},proxy:!0}],null,!1,2193255039)})]},proxy:!0}],null,!1,3837984112)})],1):t._e()],1):t._e()])},g=[],m=f.n(w,y,g);const R=m.exports;exports.default=R;
|
|
2
2
|
//# sourceMappingURL=general-row.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general-row.cjs","sources":["../../../recipes/leftbar/general_row/general_row.vue"],"sourcesContent":["<template>\n <div\n :class=\"leftbarGeneralRowClasses\"\n data-qa=\"dt-recipe-leftbar-row\"\n >\n <a\n class=\"d-recipe-leftbar-row__primary\"\n :data-qa=\"'data-qa' in $attrs ? $attrs['data-qa'] : 'd-recipe-leftbar-row-link'\"\n :aria-label=\"getAriaLabel\"\n :title=\"description\"\n :href=\"'href' in $attrs ? $attrs.href : 'javascript:void(0)'\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <div\n class=\"d-recipe-leftbar-row__alpha\"\n >\n <div\n v-if=\"isTyping\"\n v-dt-tooltip=\"typingTooltip\"\n class=\"d-recipe-leftbar-row__is-typing\"\n >\n <span /><span /><span />\n </div>\n <slot\n v-else\n name=\"left\"\n >\n <dt-recipe-leftbar-general-row-icon\n :type=\"getIcon\"\n :color=\"color\"\n :icon-size=\"iconSize\"\n data-qa=\"dt-recipe-leftbar-row-icon\"\n />\n </slot>\n </div>\n <div\n class=\"d-recipe-leftbar-row__label\"\n :style=\"`flex-basis: ${labelWidth}`\"\n >\n <slot name=\"label\">\n <dt-emoji-text-wrapper\n class=\"d-recipe-leftbar-row__description\"\n data-qa=\"dt-recipe-leftbar-row-description\"\n size=\"200\"\n >\n {{ description }}\n </dt-emoji-text-wrapper>\n </slot>\n </div>\n </a>\n <div\n v-if=\"hasActions\"\n class=\"d-recipe-leftbar-row__omega\"\n >\n <dt-tooltip\n v-if=\"dndText\"\n placement=\"top\"\n :message=\"dndTextTooltip\"\n >\n <template #anchor>\n <div\n ref=\"d-recipe-leftbar-row-dnd\"\n class=\"d-recipe-leftbar-row__dnd\"\n data-qa=\"dt-recipe-leftbar-row-dnd\"\n >\n {{ dndText }}\n </div>\n </template>\n </dt-tooltip>\n <div\n v-if=\"activeVoiceChat\"\n v-dt-tooltip=\"activeVoiceChatTooltip\"\n class=\"d-recipe-leftbar-row__active-voice\"\n >\n <dt-icon-waveform\n size=\"300\"\n />\n </div>\n <dt-tooltip\n v-else-if=\"showUnreadCount || showUnreadMentionCount\"\n :message=\"unreadCountTooltip\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-badge\n v-if=\"showUnreadCount\"\n kind=\"count\"\n type=\"bulletin\"\n data-qa=\"dt-recipe-leftbar-row-unread-badge\"\n :class=\"['d-recipe-leftbar-row__unread-badge', {\n 'd-recipe-leftbar-row__unread-count-badge':\n shouldApplyCustomStyleForCountBadge,\n }]\"\n >\n {{ unreadCount }}\n </dt-badge>\n <dt-badge\n v-if=\"showUnreadMentionCount\"\n kind=\"count\"\n type=\"bulletin\"\n data-qa=\"dt-recipe-leftbar-row-unread-mention-badge\"\n :class=\"['d-recipe-leftbar-row__unread-badge',\n { 'd-recipe-leftbar-row__unread-mention-count-badge': shouldApplyCustomStyleForCountBadge },\n { 'd-recipe-leftbar-row__unread-mention-only-count-badge': shouldApplyCustomStyleForMentionOnly },\n ]\"\n >\n {{ unreadMentionCount }}\n </dt-badge>\n </template>\n </dt-tooltip>\n <div\n v-if=\"hasCallButton\"\n class=\"d-recipe-leftbar-row__action\"\n data-qa=\"dt-recipe-leftbar-row-action\"\n >\n <dt-tooltip\n :message=\"callButtonTooltip\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n class=\"d-recipe-leftbar-row__action-button\"\n data-qa=\"dt-recipe-leftbar-row-action-call-button\"\n circle\n size=\"xs\"\n kind=\"inverted\"\n :aria-label=\"callButtonTooltip\"\n @focus=\"actionFocused = true\"\n @blur=\"actionFocused = false\"\n @click.stop=\"$emit('call', $event)\"\n >\n <template #icon>\n <dt-icon-phone\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n </dt-tooltip>\n </div>\n </div>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n LEFTBAR_GENERAL_ROW_TYPES,\n LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS,\n LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR,\n LEFTBAR_GENERAL_ROW_ICON_SIZES,\n} from './general_row_constants';\nimport { DtBadge } from '@/components/badge';\nimport { DtIconPhone, DtIconWaveform } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtEmojiTextWrapper } from '@/components/emoji_text_wrapper';\nimport DtRecipeLeftbarGeneralRowIcon from './leftbar_general_row_icon.vue';\nimport { safeConcatStrings } from '@/common/utils';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\nexport default {\n name: 'DtRecipeGeneralRow',\n\n components: {\n DtEmojiTextWrapper,\n DtBadge,\n DtButton,\n DtTooltip,\n DtIconPhone,\n DtIconWaveform,\n DtRecipeLeftbarGeneralRowIcon,\n },\n\n mixins: [DtLocalizationMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Determines the icon to show.\n * If type is contact center, the color prop must be provided and will determine the color of the icon\n */\n type: {\n type: String,\n default: 'inbox',\n validator: (type) => {\n return Object.values(LEFTBAR_GENERAL_ROW_TYPES).includes(type);\n },\n },\n\n /**\n * Will be read out by a screen reader upon focus of this row. If not defined \"description\" will be read.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * Text displayed next to the icon. Required. Even if you are overriding this field using the label slot\n * you still must input this as it will be displayed as the \"title\" attribute for the row.\n */\n description: {\n type: String,\n required: true,\n },\n\n /**\n * Determines the color of the contact center icon\n */\n color: {\n type: String,\n default: null,\n validator: (color) => {\n return Object.keys(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(color);\n },\n },\n\n /**\n * The channel setting, either 'mention' or 'always'.\n * @values 'mention', 'always', null.\n */\n channelSetting: {\n type: String,\n default: null,\n },\n\n /**\n * Styles the row with an increased font weight to convey it has unreads. This must be true to see\n * the unread count badge.\n */\n hasUnreads: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Number of unread messages\n */\n unreadCount: {\n type: String,\n default: null,\n },\n\n /**\n * Number of unread mention messages\n */\n unreadMentionCount: {\n type: String,\n default: null,\n },\n\n /**\n * Determines if the row is selected\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Gives a faded style to be used when muted\n */\n muted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows styling to represent an active voice chat. This will display over unreadCount.\n */\n activeVoiceChat: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Acronym used to represent \"Do not Disturb\" state. If entered will display the entered text alongside\n * unreadCount.\n */\n dndText: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the row should have a call button. Usually only applicable to individual contact rows.\n */\n hasCallButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows an \"is typing\" animation over the avatar when true.\n */\n isTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the size of the icon.\n */\n iconSize: {\n type: String,\n default: '300',\n validator: (size) => {\n return LEFTBAR_GENERAL_ROW_ICON_SIZES.includes(size);\n },\n },\n },\n\n emits: [\n /**\n * Native click event on the row itself\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Call button clicked\n *\n * @event call\n * @type {PointerEvent | KeyboardEvent}\n */\n 'call',\n ],\n\n data () {\n return {\n actionFocused: false,\n labelWidth: '100%',\n };\n },\n\n computed: {\n leftbarGeneralRowClasses () {\n return [\n 'd-recipe-leftbar-row',\n {\n 'd-recipe-leftbar-row--no-action': !this.hasCallButton,\n 'd-recipe-leftbar-row--has-unread': this.hasUnreads,\n 'd-recipe-leftbar-row__unread-count': this.showUnreadCount || this.showUnreadMentionCount,\n 'd-recipe-leftbar-row--selected': this.selected,\n 'd-recipe-leftbar-row--muted': this.muted,\n 'd-recipe-leftbar-row--action-focused': this.actionFocused,\n },\n ];\n },\n\n getIcon () {\n switch (this.type) {\n case LEFTBAR_GENERAL_ROW_TYPES.CHANNELS:\n if (this.hasUnreads) return 'channel unread';\n break;\n case LEFTBAR_GENERAL_ROW_TYPES.LOCKED_CHANNEL:\n if (this.hasUnreads) return 'locked channel unread';\n break;\n }\n return this.type;\n },\n\n getAriaLabel () {\n if (this.ariaLabel) return this.ariaLabel;\n\n return safeConcatStrings([\n this.typingTooltip,\n this.description,\n this.unreadCountTooltip,\n this.dndTextTooltip,\n this.activeVoiceChatTooltip,\n ]);\n },\n\n hasActions () {\n return this.dndText || this.activeVoiceChat || this.showUnreadCount || this.hasCallButton ||\n this.showUnreadMentionCount;\n },\n\n showUnreadCount () {\n return !!this.unreadCount && this.hasUnreads;\n },\n\n showUnreadMentionCount () {\n return !!this.unreadMentionCount && this.hasUnreads;\n },\n\n hasUnreadCount () {\n return this.unreadCount !== null;\n },\n\n hasUnreadMentionCount () {\n return this.unreadMentionCount !== null;\n },\n\n shouldApplyCustomStyleForCountBadge () {\n return this.hasUnreadCount && this.hasUnreadMentionCount;\n },\n\n /**\n * When a channel in 'always' setting, meaning the user should see both unread count and unread mention count,\n * if there are only mention messages, we should apply the theme design tokens var(--dt-theme-mention-color-[background||foreground]-strong).\n * @returns {boolean}\n */\n shouldApplyCustomStyleForMentionOnly () {\n return this.channelSetting === 'always' && !this.hasUnreadCount && this.hasUnreadMentionCount;\n },\n\n messageCount () {\n return isNaN(this.unreadCount)\n ? this.unreadCount\n : Number(this.unreadCount);\n },\n\n mentionCount () {\n return isNaN(this.unreadMentionCount)\n ? this.unreadMentionCount\n : Number(this.unreadMentionCount);\n },\n\n unreadCountTooltip () {\n return safeConcatStrings([\n this.unreadCount && this.i18n.$t('DIALTONE_UNREAD_MESSAGE_COUNT_TEXT', { unreadCount: this.messageCount }),\n this.unreadMentionCount && this.i18n.$t('DIALTONE_UNREAD_MENTION_COUNT_TEXT', { unreadCount: this.mentionCount }),\n ]);\n },\n\n dndTextTooltip () {\n return this.dndText && this.i18n.$t('DIALTONE_GENERAL_ROW_DND_TEXT_TOOLTIP');\n },\n\n activeVoiceChatTooltip () {\n return this.activeVoiceChat && this.i18n.$t('DIALTONE_GENERAL_ROW_ACTIVE_VOICE_CHAT_TEXT');\n },\n\n callButtonTooltip () {\n return this.i18n.$t('DIALTONE_GENERAL_ROW_CALL_BUTTON_TOOLTIP');\n },\n\n typingTooltip () {\n return this.isTyping && this.i18n.$t('DIALTONE_TYPING_TEXT');\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n async handler () {\n this.validateProps();\n await this.$nextTick();\n this.adjustLabelWidth();\n },\n },\n },\n\n mounted () {\n this.resizeObserver = new ResizeObserver(this.adjustLabelWidth);\n this.resizeObserver.observe(this.$el);\n this.adjustLabelWidth();\n },\n\n beforeDestroy: function () {\n this.resizeObserver.disconnect();\n },\n\n methods: {\n validateProps () {\n if (this.type === LEFTBAR_GENERAL_ROW_TYPES.CONTACT_CENTER &&\n !Object.keys(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(this.color)) {\n console.error(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR);\n }\n },\n\n adjustLabelWidth () {\n const labelWidth = this.$el?.querySelector('.d-recipe-leftbar-row__primary')?.clientWidth || 0;\n const omegaWidth = this.$el?.querySelector('.d-recipe-leftbar-row__omega')?.clientWidth || 0;\n const alphaWidth = this.$el?.querySelector('.d-recipe-leftbar-row__alpha')?.clientWidth || 0;\n const paddings = 16;\n this.labelWidth = labelWidth - (omegaWidth + alphaWidth + paddings) + 'px';\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtEmojiTextWrapper","DtBadge","DtButton","DtTooltip","DtIconPhone","DtIconWaveform","DtRecipeLeftbarGeneralRowIcon","DtLocalizationMixin","type","LEFTBAR_GENERAL_ROW_TYPES","color","LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS","size","LEFTBAR_GENERAL_ROW_ICON_SIZES","safeConcatStrings","LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR","labelWidth","_b","_a","omegaWidth","_d","_c","alphaWidth","_f","_e","paddings"],"mappings":"qiBAkKAA,EAAA,CACA,KAAA,qBAEA,WAAA,CACA,mBAAAC,EAAA,QACA,QAAAC,EAAA,QACA,SAAAC,EAAA,QACA,UAAAC,EAAA,QACA,YAAAC,EAAA,YACA,eAAAC,EAAA,eACA,8BAAAC,EAAA,OACA,EAEA,OAAA,CAAAC,EAAAA,OAAA,EAEA,aAAA,GAEA,MAAA,CAKA,KAAA,CACA,KAAA,OACA,QAAA,QACA,UAAAC,GACA,OAAA,OAAAC,EAAAA,yBAAA,EAAA,SAAAD,CAAA,CAEA,EAKA,U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KAAA,iBAAA,CACA,EAEA,cAAA,UAAA,CACA,KAAA,eAAA,YACA,EAEA,QAAA,CACA,eAAA,CACA,KAAA,OAAAL,EAAAA,0BAAA,gBACA,CAAA,OAAA,KAAAE,EAAA,yCAAA,EAAA,SAAA,KAAA,KAAA,GACA,QAAA,MAAAI,EAAAA,mDAAA,CAEA,EAEA,kBAAA,iBACA,MAAAC,IAAAC,GAAAC,EAAA,KAAA,MAAA,YAAAA,EAAA,cAAA,oCAAA,YAAAD,EAAA,cAAA,EACAE,IAAAC,GAAAC,EAAA,KAAA,MAAA,YAAAA,EAAA,cAAA,kCAAA,YAAAD,EAAA,cAAA,EACAE,IAAAC,GAAAC,EAAA,KAAA,MAAA,YAAAA,EAAA,cAAA,kCAAA,YAAAD,EAAA,cAAA,EACAE,EAAA,GACA,KAAA,WAAAT,GAAAG,EAAAG,EAAAG,GAAA,IACA,CACA,CACA"}
|
|
1
|
+
{"version":3,"file":"general-row.cjs","sources":["../../../recipes/leftbar/general_row/general_row.vue"],"sourcesContent":["<template>\n <div\n :class=\"leftbarGeneralRowClasses\"\n data-qa=\"dt-recipe-leftbar-row\"\n >\n <a\n class=\"d-recipe-leftbar-row__primary\"\n :data-qa=\"'data-qa' in $attrs ? $attrs['data-qa'] : 'd-recipe-leftbar-row-link'\"\n :aria-label=\"getAriaLabel\"\n :title=\"description\"\n :href=\"'href' in $attrs ? $attrs.href : 'javascript:void(0)'\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <div\n class=\"d-recipe-leftbar-row__alpha\"\n >\n <div\n v-if=\"isTyping\"\n v-dt-tooltip=\"typingTooltip\"\n class=\"d-recipe-leftbar-row__is-typing\"\n >\n <span /><span /><span />\n </div>\n <slot\n v-else\n name=\"left\"\n >\n <dt-recipe-leftbar-general-row-icon\n :type=\"getIcon\"\n :color=\"color\"\n :icon-size=\"iconSize\"\n data-qa=\"dt-recipe-leftbar-row-icon\"\n />\n </slot>\n </div>\n <div\n class=\"d-recipe-leftbar-row__label\"\n :style=\"`flex-basis: ${labelWidth}`\"\n >\n <slot name=\"label\">\n <dt-emoji-text-wrapper\n class=\"d-recipe-leftbar-row__description\"\n data-qa=\"dt-recipe-leftbar-row-description\"\n size=\"200\"\n >\n {{ description }}\n </dt-emoji-text-wrapper>\n </slot>\n </div>\n </a>\n <div\n v-if=\"hasActions\"\n class=\"d-recipe-leftbar-row__omega\"\n >\n <dt-tooltip\n v-if=\"dndText\"\n placement=\"top\"\n :message=\"dndTextTooltip\"\n >\n <template #anchor>\n <div\n ref=\"d-recipe-leftbar-row-dnd\"\n class=\"d-recipe-leftbar-row__dnd\"\n data-qa=\"dt-recipe-leftbar-row-dnd\"\n >\n {{ dndText }}\n </div>\n </template>\n </dt-tooltip>\n <div\n v-if=\"activeVoiceChat\"\n v-dt-tooltip=\"activeVoiceChatTooltip\"\n class=\"d-recipe-leftbar-row__active-voice\"\n >\n <dt-icon-waveform\n size=\"300\"\n />\n </div>\n <dt-tooltip\n v-else-if=\"showUnreadCount || showUnreadMentionCount\"\n :message=\"unreadCountTooltip\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-badge\n v-if=\"showUnreadCount\"\n kind=\"count\"\n type=\"bulletin\"\n data-qa=\"dt-recipe-leftbar-row-unread-badge\"\n :class=\"['d-recipe-leftbar-row__unread-badge', {\n 'd-recipe-leftbar-row__unread-count-badge':\n shouldApplyCustomStyleForCountBadge,\n }]\"\n >\n {{ unreadCount }}\n </dt-badge>\n <dt-badge\n v-if=\"showUnreadMentionCount\"\n kind=\"count\"\n type=\"bulletin\"\n data-qa=\"dt-recipe-leftbar-row-unread-mention-badge\"\n :class=\"['d-recipe-leftbar-row__unread-badge',\n { 'd-recipe-leftbar-row__unread-mention-count-badge': shouldApplyCustomStyleForCountBadge },\n { 'd-recipe-leftbar-row__unread-mention-only-count-badge': shouldApplyCustomStyleForMentionOnly },\n ]\"\n >\n {{ unreadMentionCount }}\n </dt-badge>\n </template>\n </dt-tooltip>\n <div\n v-if=\"hasCallButton\"\n class=\"d-recipe-leftbar-row__action\"\n data-qa=\"dt-recipe-leftbar-row-action\"\n >\n <dt-tooltip\n :message=\"callButtonTooltip\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n class=\"d-recipe-leftbar-row__action-button\"\n data-qa=\"dt-recipe-leftbar-row-action-call-button\"\n circle\n size=\"xs\"\n kind=\"inverted\"\n :aria-label=\"callButtonTooltip\"\n @focus=\"actionFocused = true\"\n @blur=\"actionFocused = false\"\n @click.stop=\"$emit('call', $event)\"\n >\n <template #icon>\n <dt-icon-phone\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n </dt-tooltip>\n </div>\n </div>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n LEFTBAR_GENERAL_ROW_TYPES,\n LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS,\n LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR,\n LEFTBAR_GENERAL_ROW_ICON_SIZES,\n} from './general_row_constants';\nimport { DtBadge } from '@/components/badge';\nimport { DtIconPhone, DtIconWaveform } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtEmojiTextWrapper } from '@/components/emoji_text_wrapper';\nimport DtRecipeLeftbarGeneralRowIcon from './leftbar_general_row_icon.vue';\nimport { safeConcatStrings } from '@/common/utils';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtRecipeGeneralRow',\n\n components: {\n DtEmojiTextWrapper,\n DtBadge,\n DtButton,\n DtTooltip,\n DtIconPhone,\n DtIconWaveform,\n DtRecipeLeftbarGeneralRowIcon,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Determines the icon to show.\n * If type is contact center, the color prop must be provided and will determine the color of the icon\n */\n type: {\n type: String,\n default: 'inbox',\n validator: (type) => {\n return Object.values(LEFTBAR_GENERAL_ROW_TYPES).includes(type);\n },\n },\n\n /**\n * Will be read out by a screen reader upon focus of this row. If not defined \"description\" will be read.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * Text displayed next to the icon. Required. Even if you are overriding this field using the label slot\n * you still must input this as it will be displayed as the \"title\" attribute for the row.\n */\n description: {\n type: String,\n required: true,\n },\n\n /**\n * Determines the color of the contact center icon\n */\n color: {\n type: String,\n default: null,\n validator: (color) => {\n return Object.keys(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(color);\n },\n },\n\n /**\n * The channel setting, either 'mention' or 'always'.\n * @values 'mention', 'always', null.\n */\n channelSetting: {\n type: String,\n default: null,\n },\n\n /**\n * Styles the row with an increased font weight to convey it has unreads. This must be true to see\n * the unread count badge.\n */\n hasUnreads: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Number of unread messages\n */\n unreadCount: {\n type: String,\n default: null,\n },\n\n /**\n * Number of unread mention messages\n */\n unreadMentionCount: {\n type: String,\n default: null,\n },\n\n /**\n * Determines if the row is selected\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Gives a faded style to be used when muted\n */\n muted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows styling to represent an active voice chat. This will display over unreadCount.\n */\n activeVoiceChat: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Acronym used to represent \"Do not Disturb\" state. If entered will display the entered text alongside\n * unreadCount.\n */\n dndText: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the row should have a call button. Usually only applicable to individual contact rows.\n */\n hasCallButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows an \"is typing\" animation over the avatar when true.\n */\n isTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the size of the icon.\n */\n iconSize: {\n type: String,\n default: '300',\n validator: (size) => {\n return LEFTBAR_GENERAL_ROW_ICON_SIZES.includes(size);\n },\n },\n },\n\n emits: [\n /**\n * Native click event on the row itself\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Call button clicked\n *\n * @event call\n * @type {PointerEvent | KeyboardEvent}\n */\n 'call',\n ],\n\n data () {\n return {\n actionFocused: false,\n labelWidth: '100%',\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n leftbarGeneralRowClasses () {\n return [\n 'd-recipe-leftbar-row',\n {\n 'd-recipe-leftbar-row--no-action': !this.hasCallButton,\n 'd-recipe-leftbar-row--has-unread': this.hasUnreads,\n 'd-recipe-leftbar-row__unread-count': this.showUnreadCount || this.showUnreadMentionCount,\n 'd-recipe-leftbar-row--selected': this.selected,\n 'd-recipe-leftbar-row--muted': this.muted,\n 'd-recipe-leftbar-row--action-focused': this.actionFocused,\n },\n ];\n },\n\n getIcon () {\n switch (this.type) {\n case LEFTBAR_GENERAL_ROW_TYPES.CHANNELS:\n if (this.hasUnreads) return 'channel unread';\n break;\n case LEFTBAR_GENERAL_ROW_TYPES.LOCKED_CHANNEL:\n if (this.hasUnreads) return 'locked channel unread';\n break;\n }\n return this.type;\n },\n\n getAriaLabel () {\n if (this.ariaLabel) return this.ariaLabel;\n\n return safeConcatStrings([\n this.typingTooltip,\n this.description,\n this.unreadCountTooltip,\n this.dndTextTooltip,\n this.activeVoiceChatTooltip,\n ]);\n },\n\n hasActions () {\n return this.dndText || this.activeVoiceChat || this.showUnreadCount || this.hasCallButton ||\n this.showUnreadMentionCount;\n },\n\n showUnreadCount () {\n return !!this.unreadCount && this.hasUnreads;\n },\n\n showUnreadMentionCount () {\n return !!this.unreadMentionCount && this.hasUnreads;\n },\n\n hasUnreadCount () {\n return this.unreadCount !== null;\n },\n\n hasUnreadMentionCount () {\n return this.unreadMentionCount !== null;\n },\n\n shouldApplyCustomStyleForCountBadge () {\n return this.hasUnreadCount && this.hasUnreadMentionCount;\n },\n\n /**\n * When a channel in 'always' setting, meaning the user should see both unread count and unread mention count,\n * if there are only mention messages, we should apply the theme design tokens var(--dt-theme-mention-color-[background||foreground]-strong).\n * @returns {boolean}\n */\n shouldApplyCustomStyleForMentionOnly () {\n return this.channelSetting === 'always' && !this.hasUnreadCount && this.hasUnreadMentionCount;\n },\n\n messageCount () {\n return isNaN(this.unreadCount)\n ? this.unreadCount\n : Number(this.unreadCount);\n },\n\n mentionCount () {\n return isNaN(this.unreadMentionCount)\n ? this.unreadMentionCount\n : Number(this.unreadMentionCount);\n },\n\n unreadCountTooltip () {\n return safeConcatStrings([\n this.unreadCount && this.i18n.$t('DIALTONE_UNREAD_MESSAGE_COUNT_TEXT', { unreadCount: this.messageCount }),\n this.unreadMentionCount && this.i18n.$t('DIALTONE_UNREAD_MENTION_COUNT_TEXT', { unreadCount: this.mentionCount }),\n ]);\n },\n\n dndTextTooltip () {\n return this.dndText && this.i18n.$t('DIALTONE_GENERAL_ROW_DND_TEXT_TOOLTIP');\n },\n\n activeVoiceChatTooltip () {\n return this.activeVoiceChat && this.i18n.$t('DIALTONE_GENERAL_ROW_ACTIVE_VOICE_CHAT_TEXT');\n },\n\n callButtonTooltip () {\n return this.i18n.$t('DIALTONE_GENERAL_ROW_CALL_BUTTON_TOOLTIP');\n },\n\n typingTooltip () {\n return this.isTyping && this.i18n.$t('DIALTONE_TYPING_TEXT');\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n async handler () {\n this.validateProps();\n await this.$nextTick();\n this.adjustLabelWidth();\n },\n },\n },\n\n mounted () {\n this.resizeObserver = new ResizeObserver(this.adjustLabelWidth);\n this.resizeObserver.observe(this.$el);\n this.adjustLabelWidth();\n },\n\n beforeDestroy: function () {\n this.resizeObserver.disconnect();\n },\n\n methods: {\n validateProps () {\n if (this.type === LEFTBAR_GENERAL_ROW_TYPES.CONTACT_CENTER &&\n !Object.keys(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(this.color)) {\n console.error(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR);\n }\n },\n\n adjustLabelWidth () {\n const labelWidth = this.$el?.querySelector('.d-recipe-leftbar-row__primary')?.clientWidth || 0;\n const omegaWidth = this.$el?.querySelector('.d-recipe-leftbar-row__omega')?.clientWidth || 0;\n const alphaWidth = this.$el?.querySelector('.d-recipe-leftbar-row__alpha')?.clientWidth || 0;\n const paddings = 16;\n this.labelWidth = labelWidth - (omegaWidth + alphaWidth + paddings) + 'px';\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtEmojiTextWrapper","DtBadge","DtButton","DtTooltip","DtIconPhone","DtIconWaveform","DtRecipeLeftbarGeneralRowIcon","type","LEFTBAR_GENERAL_ROW_TYPES","color","LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS","size","LEFTBAR_GENERAL_ROW_ICON_SIZES","DialtoneLocalization","safeConcatStrings","LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR","labelWidth","_b","_a","omegaWidth","_d","_c","alphaWidth","_f","_e","paddings"],"mappings":"6hBAkKAA,EAAA,CACA,KAAA,qBAEA,WAAA,CACA,mBAAAC,EAAA,QACA,QAAAC,EAAA,QACA,SAAAC,EAAA,QACA,UAAAC,EAAA,QACA,YAAAC,EAAA,YACA,eAAAC,EAAA,eACA,8BAAAC,EAAA,OACA,EAEA,aAAA,GAEA,MAAA,CAKA,KAAA,CACA,KAAA,OACA,QAAA,QACA,UAAAC,GACA,OAAA,OAAAC,EAAAA,yBAAA,EAAA,SAAAD,CAAA,CAEA,EAKA,UAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,YAAA,CACA,KAAA,OACA,SAAA,EACA,EAKA,MAAA,CACA,KAAA,OACA,QAAA,KACA,UAAAE,GACA,OAAA,KAAAC,EAAAA,yCAAA,EAAA,SAAAD,CAAA,CAEA,EAMA,eAAA,CACA,KAAA,OACA,QAAA,IACA,EAMA,WAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,mBAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,MAAA,CACA,KAAA,QACA,QAAA,E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,kCAAA,YAAAD,EAAA,cAAA,EACAE,IAAAC,GAAAC,EAAA,KAAA,MAAA,YAAAA,EAAA,cAAA,kCAAA,YAAAD,EAAA,cAAA,EACAE,EAAA,GACA,KAAA,WAAAT,GAAAG,EAAAG,EAAAG,GAAA,IACA,CACA,CACA"}
|
|
@@ -2,24 +2,23 @@ import { LEFTBAR_GENERAL_ROW_TYPES as n, LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLO
|
|
|
2
2
|
import { DtIconPhone as f, DtIconWaveform as C } from "@dialpad/dialtone-icons/vue2";
|
|
3
3
|
import b from "./leftbar-general-row-icon.js";
|
|
4
4
|
import { safeConcatStrings as p } from "../../common/utils/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import m from "
|
|
7
|
-
import y from "../
|
|
8
|
-
import w from "../
|
|
9
|
-
import v from "../
|
|
10
|
-
import g from "
|
|
5
|
+
import { DialtoneLocalization as T } from "../../localization/index.js";
|
|
6
|
+
import { n as m } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
7
|
+
import y from "../emoji-text-wrapper/emoji-text-wrapper.js";
|
|
8
|
+
import w from "../badge/badge.js";
|
|
9
|
+
import v from "../button/button.js";
|
|
10
|
+
import g from "../tooltip/tooltip.js";
|
|
11
11
|
const E = {
|
|
12
12
|
name: "DtRecipeGeneralRow",
|
|
13
13
|
components: {
|
|
14
|
-
DtEmojiTextWrapper:
|
|
15
|
-
DtBadge:
|
|
16
|
-
DtButton:
|
|
17
|
-
DtTooltip:
|
|
14
|
+
DtEmojiTextWrapper: y,
|
|
15
|
+
DtBadge: w,
|
|
16
|
+
DtButton: v,
|
|
17
|
+
DtTooltip: g,
|
|
18
18
|
DtIconPhone: f,
|
|
19
19
|
DtIconWaveform: C,
|
|
20
20
|
DtRecipeLeftbarGeneralRowIcon: b
|
|
21
21
|
},
|
|
22
|
-
mixins: [g],
|
|
23
22
|
inheritAttrs: !1,
|
|
24
23
|
props: {
|
|
25
24
|
/**
|
|
@@ -155,7 +154,8 @@ const E = {
|
|
|
155
154
|
data() {
|
|
156
155
|
return {
|
|
157
156
|
actionFocused: !1,
|
|
158
|
-
labelWidth: "100%"
|
|
157
|
+
labelWidth: "100%",
|
|
158
|
+
i18n: new T()
|
|
159
159
|
};
|
|
160
160
|
},
|
|
161
161
|
computed: {
|
|
@@ -263,8 +263,8 @@ const E = {
|
|
|
263
263
|
this.type === n.CONTACT_CENTER && !Object.keys(c).includes(this.color) && console.error(_);
|
|
264
264
|
},
|
|
265
265
|
adjustLabelWidth() {
|
|
266
|
-
var
|
|
267
|
-
const a = ((
|
|
266
|
+
var o, i, s, l, d, u;
|
|
267
|
+
const a = ((i = (o = this.$el) == null ? void 0 : o.querySelector(".d-recipe-leftbar-row__primary")) == null ? void 0 : i.clientWidth) || 0, t = ((l = (s = this.$el) == null ? void 0 : s.querySelector(".d-recipe-leftbar-row__omega")) == null ? void 0 : l.clientWidth) || 0, e = ((u = (d = this.$el) == null ? void 0 : d.querySelector(".d-recipe-leftbar-row__alpha")) == null ? void 0 : u.clientWidth) || 0, r = 16;
|
|
268
268
|
this.labelWidth = a - (t + e + r) + "px";
|
|
269
269
|
}
|
|
270
270
|
}
|
|
@@ -296,13 +296,13 @@ var N = function() {
|
|
|
296
296
|
return [e("dt-icon-phone", { attrs: { size: "200" } })];
|
|
297
297
|
}, proxy: !0 }], null, !1, 2193255039) })];
|
|
298
298
|
}, proxy: !0 }], null, !1, 3837984112) })], 1) : t._e()], 1) : t._e()]);
|
|
299
|
-
}, A = [], O = /* @__PURE__ */
|
|
299
|
+
}, A = [], O = /* @__PURE__ */ m(
|
|
300
300
|
E,
|
|
301
301
|
N,
|
|
302
302
|
A
|
|
303
303
|
);
|
|
304
|
-
const
|
|
304
|
+
const M = O.exports;
|
|
305
305
|
export {
|
|
306
|
-
|
|
306
|
+
M as default
|
|
307
307
|
};
|
|
308
308
|
//# sourceMappingURL=general-row.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general-row.js","sources":["../../../recipes/leftbar/general_row/general_row.vue"],"sourcesContent":["<template>\n <div\n :class=\"leftbarGeneralRowClasses\"\n data-qa=\"dt-recipe-leftbar-row\"\n >\n <a\n class=\"d-recipe-leftbar-row__primary\"\n :data-qa=\"'data-qa' in $attrs ? $attrs['data-qa'] : 'd-recipe-leftbar-row-link'\"\n :aria-label=\"getAriaLabel\"\n :title=\"description\"\n :href=\"'href' in $attrs ? $attrs.href : 'javascript:void(0)'\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <div\n class=\"d-recipe-leftbar-row__alpha\"\n >\n <div\n v-if=\"isTyping\"\n v-dt-tooltip=\"typingTooltip\"\n class=\"d-recipe-leftbar-row__is-typing\"\n >\n <span /><span /><span />\n </div>\n <slot\n v-else\n name=\"left\"\n >\n <dt-recipe-leftbar-general-row-icon\n :type=\"getIcon\"\n :color=\"color\"\n :icon-size=\"iconSize\"\n data-qa=\"dt-recipe-leftbar-row-icon\"\n />\n </slot>\n </div>\n <div\n class=\"d-recipe-leftbar-row__label\"\n :style=\"`flex-basis: ${labelWidth}`\"\n >\n <slot name=\"label\">\n <dt-emoji-text-wrapper\n class=\"d-recipe-leftbar-row__description\"\n data-qa=\"dt-recipe-leftbar-row-description\"\n size=\"200\"\n >\n {{ description }}\n </dt-emoji-text-wrapper>\n </slot>\n </div>\n </a>\n <div\n v-if=\"hasActions\"\n class=\"d-recipe-leftbar-row__omega\"\n >\n <dt-tooltip\n v-if=\"dndText\"\n placement=\"top\"\n :message=\"dndTextTooltip\"\n >\n <template #anchor>\n <div\n ref=\"d-recipe-leftbar-row-dnd\"\n class=\"d-recipe-leftbar-row__dnd\"\n data-qa=\"dt-recipe-leftbar-row-dnd\"\n >\n {{ dndText }}\n </div>\n </template>\n </dt-tooltip>\n <div\n v-if=\"activeVoiceChat\"\n v-dt-tooltip=\"activeVoiceChatTooltip\"\n class=\"d-recipe-leftbar-row__active-voice\"\n >\n <dt-icon-waveform\n size=\"300\"\n />\n </div>\n <dt-tooltip\n v-else-if=\"showUnreadCount || showUnreadMentionCount\"\n :message=\"unreadCountTooltip\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-badge\n v-if=\"showUnreadCount\"\n kind=\"count\"\n type=\"bulletin\"\n data-qa=\"dt-recipe-leftbar-row-unread-badge\"\n :class=\"['d-recipe-leftbar-row__unread-badge', {\n 'd-recipe-leftbar-row__unread-count-badge':\n shouldApplyCustomStyleForCountBadge,\n }]\"\n >\n {{ unreadCount }}\n </dt-badge>\n <dt-badge\n v-if=\"showUnreadMentionCount\"\n kind=\"count\"\n type=\"bulletin\"\n data-qa=\"dt-recipe-leftbar-row-unread-mention-badge\"\n :class=\"['d-recipe-leftbar-row__unread-badge',\n { 'd-recipe-leftbar-row__unread-mention-count-badge': shouldApplyCustomStyleForCountBadge },\n { 'd-recipe-leftbar-row__unread-mention-only-count-badge': shouldApplyCustomStyleForMentionOnly },\n ]\"\n >\n {{ unreadMentionCount }}\n </dt-badge>\n </template>\n </dt-tooltip>\n <div\n v-if=\"hasCallButton\"\n class=\"d-recipe-leftbar-row__action\"\n data-qa=\"dt-recipe-leftbar-row-action\"\n >\n <dt-tooltip\n :message=\"callButtonTooltip\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n class=\"d-recipe-leftbar-row__action-button\"\n data-qa=\"dt-recipe-leftbar-row-action-call-button\"\n circle\n size=\"xs\"\n kind=\"inverted\"\n :aria-label=\"callButtonTooltip\"\n @focus=\"actionFocused = true\"\n @blur=\"actionFocused = false\"\n @click.stop=\"$emit('call', $event)\"\n >\n <template #icon>\n <dt-icon-phone\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n </dt-tooltip>\n </div>\n </div>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n LEFTBAR_GENERAL_ROW_TYPES,\n LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS,\n LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR,\n LEFTBAR_GENERAL_ROW_ICON_SIZES,\n} from './general_row_constants';\nimport { DtBadge } from '@/components/badge';\nimport { DtIconPhone, DtIconWaveform } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtEmojiTextWrapper } from '@/components/emoji_text_wrapper';\nimport DtRecipeLeftbarGeneralRowIcon from './leftbar_general_row_icon.vue';\nimport { safeConcatStrings } from '@/common/utils';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\nexport default {\n name: 'DtRecipeGeneralRow',\n\n components: {\n DtEmojiTextWrapper,\n DtBadge,\n DtButton,\n DtTooltip,\n DtIconPhone,\n DtIconWaveform,\n DtRecipeLeftbarGeneralRowIcon,\n },\n\n mixins: [DtLocalizationMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Determines the icon to show.\n * If type is contact center, the color prop must be provided and will determine the color of the icon\n */\n type: {\n type: String,\n default: 'inbox',\n validator: (type) => {\n return Object.values(LEFTBAR_GENERAL_ROW_TYPES).includes(type);\n },\n },\n\n /**\n * Will be read out by a screen reader upon focus of this row. If not defined \"description\" will be read.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * Text displayed next to the icon. Required. Even if you are overriding this field using the label slot\n * you still must input this as it will be displayed as the \"title\" attribute for the row.\n */\n description: {\n type: String,\n required: true,\n },\n\n /**\n * Determines the color of the contact center icon\n */\n color: {\n type: String,\n default: null,\n validator: (color) => {\n return Object.keys(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(color);\n },\n },\n\n /**\n * The channel setting, either 'mention' or 'always'.\n * @values 'mention', 'always', null.\n */\n channelSetting: {\n type: String,\n default: null,\n },\n\n /**\n * Styles the row with an increased font weight to convey it has unreads. This must be true to see\n * the unread count badge.\n */\n hasUnreads: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Number of unread messages\n */\n unreadCount: {\n type: String,\n default: null,\n },\n\n /**\n * Number of unread mention messages\n */\n unreadMentionCount: {\n type: String,\n default: null,\n },\n\n /**\n * Determines if the row is selected\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Gives a faded style to be used when muted\n */\n muted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows styling to represent an active voice chat. This will display over unreadCount.\n */\n activeVoiceChat: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Acronym used to represent \"Do not Disturb\" state. If entered will display the entered text alongside\n * unreadCount.\n */\n dndText: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the row should have a call button. Usually only applicable to individual contact rows.\n */\n hasCallButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows an \"is typing\" animation over the avatar when true.\n */\n isTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the size of the icon.\n */\n iconSize: {\n type: String,\n default: '300',\n validator: (size) => {\n return LEFTBAR_GENERAL_ROW_ICON_SIZES.includes(size);\n },\n },\n },\n\n emits: [\n /**\n * Native click event on the row itself\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Call button clicked\n *\n * @event call\n * @type {PointerEvent | KeyboardEvent}\n */\n 'call',\n ],\n\n data () {\n return {\n actionFocused: false,\n labelWidth: '100%',\n };\n },\n\n computed: {\n leftbarGeneralRowClasses () {\n return [\n 'd-recipe-leftbar-row',\n {\n 'd-recipe-leftbar-row--no-action': !this.hasCallButton,\n 'd-recipe-leftbar-row--has-unread': this.hasUnreads,\n 'd-recipe-leftbar-row__unread-count': this.showUnreadCount || this.showUnreadMentionCount,\n 'd-recipe-leftbar-row--selected': this.selected,\n 'd-recipe-leftbar-row--muted': this.muted,\n 'd-recipe-leftbar-row--action-focused': this.actionFocused,\n },\n ];\n },\n\n getIcon () {\n switch (this.type) {\n case LEFTBAR_GENERAL_ROW_TYPES.CHANNELS:\n if (this.hasUnreads) return 'channel unread';\n break;\n case LEFTBAR_GENERAL_ROW_TYPES.LOCKED_CHANNEL:\n if (this.hasUnreads) return 'locked channel unread';\n break;\n }\n return this.type;\n },\n\n getAriaLabel () {\n if (this.ariaLabel) return this.ariaLabel;\n\n return safeConcatStrings([\n this.typingTooltip,\n this.description,\n this.unreadCountTooltip,\n this.dndTextTooltip,\n this.activeVoiceChatTooltip,\n ]);\n },\n\n hasActions () {\n return this.dndText || this.activeVoiceChat || this.showUnreadCount || this.hasCallButton ||\n this.showUnreadMentionCount;\n },\n\n showUnreadCount () {\n return !!this.unreadCount && this.hasUnreads;\n },\n\n showUnreadMentionCount () {\n return !!this.unreadMentionCount && this.hasUnreads;\n },\n\n hasUnreadCount () {\n return this.unreadCount !== null;\n },\n\n hasUnreadMentionCount () {\n return this.unreadMentionCount !== null;\n },\n\n shouldApplyCustomStyleForCountBadge () {\n return this.hasUnreadCount && this.hasUnreadMentionCount;\n },\n\n /**\n * When a channel in 'always' setting, meaning the user should see both unread count and unread mention count,\n * if there are only mention messages, we should apply the theme design tokens var(--dt-theme-mention-color-[background||foreground]-strong).\n * @returns {boolean}\n */\n shouldApplyCustomStyleForMentionOnly () {\n return this.channelSetting === 'always' && !this.hasUnreadCount && this.hasUnreadMentionCount;\n },\n\n messageCount () {\n return isNaN(this.unreadCount)\n ? this.unreadCount\n : Number(this.unreadCount);\n },\n\n mentionCount () {\n return isNaN(this.unreadMentionCount)\n ? this.unreadMentionCount\n : Number(this.unreadMentionCount);\n },\n\n unreadCountTooltip () {\n return safeConcatStrings([\n this.unreadCount && this.i18n.$t('DIALTONE_UNREAD_MESSAGE_COUNT_TEXT', { unreadCount: this.messageCount }),\n this.unreadMentionCount && this.i18n.$t('DIALTONE_UNREAD_MENTION_COUNT_TEXT', { unreadCount: this.mentionCount }),\n ]);\n },\n\n dndTextTooltip () {\n return this.dndText && this.i18n.$t('DIALTONE_GENERAL_ROW_DND_TEXT_TOOLTIP');\n },\n\n activeVoiceChatTooltip () {\n return this.activeVoiceChat && this.i18n.$t('DIALTONE_GENERAL_ROW_ACTIVE_VOICE_CHAT_TEXT');\n },\n\n callButtonTooltip () {\n return this.i18n.$t('DIALTONE_GENERAL_ROW_CALL_BUTTON_TOOLTIP');\n },\n\n typingTooltip () {\n return this.isTyping && this.i18n.$t('DIALTONE_TYPING_TEXT');\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n async handler () {\n this.validateProps();\n await this.$nextTick();\n this.adjustLabelWidth();\n },\n },\n },\n\n mounted () {\n this.resizeObserver = new ResizeObserver(this.adjustLabelWidth);\n this.resizeObserver.observe(this.$el);\n this.adjustLabelWidth();\n },\n\n beforeDestroy: function () {\n this.resizeObserver.disconnect();\n },\n\n methods: {\n validateProps () {\n if (this.type === LEFTBAR_GENERAL_ROW_TYPES.CONTACT_CENTER &&\n !Object.keys(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(this.color)) {\n console.error(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR);\n }\n },\n\n adjustLabelWidth () {\n const labelWidth = this.$el?.querySelector('.d-recipe-leftbar-row__primary')?.clientWidth || 0;\n const omegaWidth = this.$el?.querySelector('.d-recipe-leftbar-row__omega')?.clientWidth || 0;\n const alphaWidth = this.$el?.querySelector('.d-recipe-leftbar-row__alpha')?.clientWidth || 0;\n const paddings = 16;\n this.labelWidth = labelWidth - (omegaWidth + alphaWidth + paddings) + 'px';\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtEmojiTextWrapper","DtBadge","DtButton","DtTooltip","DtIconPhone","DtIconWaveform","DtRecipeLeftbarGeneralRowIcon","DtLocalizationMixin","type","LEFTBAR_GENERAL_ROW_TYPES","color","LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS","size","LEFTBAR_GENERAL_ROW_ICON_SIZES","safeConcatStrings","LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR","labelWidth","_b","_a","omegaWidth","_d","_c","alphaWidth","_f","_e","paddings"],"mappings":";;;;;;;;;;AAkKA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,Y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AA,sBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,QAAA;AAAA,MACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,MAAA,UAAA;AACA,aAAA,cAAA,GACA,MAAA,KAAA,aACA,KAAA,iBAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AACA,SAAA,iBAAA,IAAA,eAAA,KAAA,gBAAA,GACA,KAAA,eAAA,QAAA,KAAA,GAAA,GACA,KAAA,iBAAA;AAAA,EACA;AAAA,EAEA,eAAA,WAAA;AACA,SAAA,eAAA;EACA;AAAA,EAEA,SAAA;AAAA,IACA,gBAAA;AACA,MAAA,KAAA,SAAAL,EAAA,kBACA,CAAA,OAAA,KAAAE,CAAA,EAAA,SAAA,KAAA,KAAA,KACA,QAAA,MAAAI,CAAA;AAAA,IAEA;AAAA,IAEA,mBAAA;;AACA,YAAAC,MAAAC,KAAAC,IAAA,KAAA,QAAA,gBAAAA,EAAA,cAAA,sCAAA,gBAAAD,EAAA,gBAAA,GACAE,MAAAC,KAAAC,IAAA,KAAA,QAAA,gBAAAA,EAAA,cAAA,oCAAA,gBAAAD,EAAA,gBAAA,GACAE,MAAAC,KAAAC,IAAA,KAAA,QAAA,gBAAAA,EAAA,cAAA,oCAAA,gBAAAD,EAAA,gBAAA,GACAE,IAAA;AACA,WAAA,aAAAT,KAAAG,IAAAG,IAAAG,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"general-row.js","sources":["../../../recipes/leftbar/general_row/general_row.vue"],"sourcesContent":["<template>\n <div\n :class=\"leftbarGeneralRowClasses\"\n data-qa=\"dt-recipe-leftbar-row\"\n >\n <a\n class=\"d-recipe-leftbar-row__primary\"\n :data-qa=\"'data-qa' in $attrs ? $attrs['data-qa'] : 'd-recipe-leftbar-row-link'\"\n :aria-label=\"getAriaLabel\"\n :title=\"description\"\n :href=\"'href' in $attrs ? $attrs.href : 'javascript:void(0)'\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <div\n class=\"d-recipe-leftbar-row__alpha\"\n >\n <div\n v-if=\"isTyping\"\n v-dt-tooltip=\"typingTooltip\"\n class=\"d-recipe-leftbar-row__is-typing\"\n >\n <span /><span /><span />\n </div>\n <slot\n v-else\n name=\"left\"\n >\n <dt-recipe-leftbar-general-row-icon\n :type=\"getIcon\"\n :color=\"color\"\n :icon-size=\"iconSize\"\n data-qa=\"dt-recipe-leftbar-row-icon\"\n />\n </slot>\n </div>\n <div\n class=\"d-recipe-leftbar-row__label\"\n :style=\"`flex-basis: ${labelWidth}`\"\n >\n <slot name=\"label\">\n <dt-emoji-text-wrapper\n class=\"d-recipe-leftbar-row__description\"\n data-qa=\"dt-recipe-leftbar-row-description\"\n size=\"200\"\n >\n {{ description }}\n </dt-emoji-text-wrapper>\n </slot>\n </div>\n </a>\n <div\n v-if=\"hasActions\"\n class=\"d-recipe-leftbar-row__omega\"\n >\n <dt-tooltip\n v-if=\"dndText\"\n placement=\"top\"\n :message=\"dndTextTooltip\"\n >\n <template #anchor>\n <div\n ref=\"d-recipe-leftbar-row-dnd\"\n class=\"d-recipe-leftbar-row__dnd\"\n data-qa=\"dt-recipe-leftbar-row-dnd\"\n >\n {{ dndText }}\n </div>\n </template>\n </dt-tooltip>\n <div\n v-if=\"activeVoiceChat\"\n v-dt-tooltip=\"activeVoiceChatTooltip\"\n class=\"d-recipe-leftbar-row__active-voice\"\n >\n <dt-icon-waveform\n size=\"300\"\n />\n </div>\n <dt-tooltip\n v-else-if=\"showUnreadCount || showUnreadMentionCount\"\n :message=\"unreadCountTooltip\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-badge\n v-if=\"showUnreadCount\"\n kind=\"count\"\n type=\"bulletin\"\n data-qa=\"dt-recipe-leftbar-row-unread-badge\"\n :class=\"['d-recipe-leftbar-row__unread-badge', {\n 'd-recipe-leftbar-row__unread-count-badge':\n shouldApplyCustomStyleForCountBadge,\n }]\"\n >\n {{ unreadCount }}\n </dt-badge>\n <dt-badge\n v-if=\"showUnreadMentionCount\"\n kind=\"count\"\n type=\"bulletin\"\n data-qa=\"dt-recipe-leftbar-row-unread-mention-badge\"\n :class=\"['d-recipe-leftbar-row__unread-badge',\n { 'd-recipe-leftbar-row__unread-mention-count-badge': shouldApplyCustomStyleForCountBadge },\n { 'd-recipe-leftbar-row__unread-mention-only-count-badge': shouldApplyCustomStyleForMentionOnly },\n ]\"\n >\n {{ unreadMentionCount }}\n </dt-badge>\n </template>\n </dt-tooltip>\n <div\n v-if=\"hasCallButton\"\n class=\"d-recipe-leftbar-row__action\"\n data-qa=\"dt-recipe-leftbar-row-action\"\n >\n <dt-tooltip\n :message=\"callButtonTooltip\"\n placement=\"top\"\n >\n <template #anchor>\n <dt-button\n class=\"d-recipe-leftbar-row__action-button\"\n data-qa=\"dt-recipe-leftbar-row-action-call-button\"\n circle\n size=\"xs\"\n kind=\"inverted\"\n :aria-label=\"callButtonTooltip\"\n @focus=\"actionFocused = true\"\n @blur=\"actionFocused = false\"\n @click.stop=\"$emit('call', $event)\"\n >\n <template #icon>\n <dt-icon-phone\n size=\"200\"\n />\n </template>\n </dt-button>\n </template>\n </dt-tooltip>\n </div>\n </div>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n LEFTBAR_GENERAL_ROW_TYPES,\n LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS,\n LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR,\n LEFTBAR_GENERAL_ROW_ICON_SIZES,\n} from './general_row_constants';\nimport { DtBadge } from '@/components/badge';\nimport { DtIconPhone, DtIconWaveform } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtEmojiTextWrapper } from '@/components/emoji_text_wrapper';\nimport DtRecipeLeftbarGeneralRowIcon from './leftbar_general_row_icon.vue';\nimport { safeConcatStrings } from '@/common/utils';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtRecipeGeneralRow',\n\n components: {\n DtEmojiTextWrapper,\n DtBadge,\n DtButton,\n DtTooltip,\n DtIconPhone,\n DtIconWaveform,\n DtRecipeLeftbarGeneralRowIcon,\n },\n\n inheritAttrs: false,\n\n props: {\n /**\n * Determines the icon to show.\n * If type is contact center, the color prop must be provided and will determine the color of the icon\n */\n type: {\n type: String,\n default: 'inbox',\n validator: (type) => {\n return Object.values(LEFTBAR_GENERAL_ROW_TYPES).includes(type);\n },\n },\n\n /**\n * Will be read out by a screen reader upon focus of this row. If not defined \"description\" will be read.\n */\n ariaLabel: {\n type: String,\n default: '',\n },\n\n /**\n * Text displayed next to the icon. Required. Even if you are overriding this field using the label slot\n * you still must input this as it will be displayed as the \"title\" attribute for the row.\n */\n description: {\n type: String,\n required: true,\n },\n\n /**\n * Determines the color of the contact center icon\n */\n color: {\n type: String,\n default: null,\n validator: (color) => {\n return Object.keys(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(color);\n },\n },\n\n /**\n * The channel setting, either 'mention' or 'always'.\n * @values 'mention', 'always', null.\n */\n channelSetting: {\n type: String,\n default: null,\n },\n\n /**\n * Styles the row with an increased font weight to convey it has unreads. This must be true to see\n * the unread count badge.\n */\n hasUnreads: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Number of unread messages\n */\n unreadCount: {\n type: String,\n default: null,\n },\n\n /**\n * Number of unread mention messages\n */\n unreadMentionCount: {\n type: String,\n default: null,\n },\n\n /**\n * Determines if the row is selected\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Gives a faded style to be used when muted\n */\n muted: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows styling to represent an active voice chat. This will display over unreadCount.\n */\n activeVoiceChat: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Acronym used to represent \"Do not Disturb\" state. If entered will display the entered text alongside\n * unreadCount.\n */\n dndText: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the row should have a call button. Usually only applicable to individual contact rows.\n */\n hasCallButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows an \"is typing\" animation over the avatar when true.\n */\n isTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the size of the icon.\n */\n iconSize: {\n type: String,\n default: '300',\n validator: (size) => {\n return LEFTBAR_GENERAL_ROW_ICON_SIZES.includes(size);\n },\n },\n },\n\n emits: [\n /**\n * Native click event on the row itself\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n\n /**\n * Call button clicked\n *\n * @event call\n * @type {PointerEvent | KeyboardEvent}\n */\n 'call',\n ],\n\n data () {\n return {\n actionFocused: false,\n labelWidth: '100%',\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n leftbarGeneralRowClasses () {\n return [\n 'd-recipe-leftbar-row',\n {\n 'd-recipe-leftbar-row--no-action': !this.hasCallButton,\n 'd-recipe-leftbar-row--has-unread': this.hasUnreads,\n 'd-recipe-leftbar-row__unread-count': this.showUnreadCount || this.showUnreadMentionCount,\n 'd-recipe-leftbar-row--selected': this.selected,\n 'd-recipe-leftbar-row--muted': this.muted,\n 'd-recipe-leftbar-row--action-focused': this.actionFocused,\n },\n ];\n },\n\n getIcon () {\n switch (this.type) {\n case LEFTBAR_GENERAL_ROW_TYPES.CHANNELS:\n if (this.hasUnreads) return 'channel unread';\n break;\n case LEFTBAR_GENERAL_ROW_TYPES.LOCKED_CHANNEL:\n if (this.hasUnreads) return 'locked channel unread';\n break;\n }\n return this.type;\n },\n\n getAriaLabel () {\n if (this.ariaLabel) return this.ariaLabel;\n\n return safeConcatStrings([\n this.typingTooltip,\n this.description,\n this.unreadCountTooltip,\n this.dndTextTooltip,\n this.activeVoiceChatTooltip,\n ]);\n },\n\n hasActions () {\n return this.dndText || this.activeVoiceChat || this.showUnreadCount || this.hasCallButton ||\n this.showUnreadMentionCount;\n },\n\n showUnreadCount () {\n return !!this.unreadCount && this.hasUnreads;\n },\n\n showUnreadMentionCount () {\n return !!this.unreadMentionCount && this.hasUnreads;\n },\n\n hasUnreadCount () {\n return this.unreadCount !== null;\n },\n\n hasUnreadMentionCount () {\n return this.unreadMentionCount !== null;\n },\n\n shouldApplyCustomStyleForCountBadge () {\n return this.hasUnreadCount && this.hasUnreadMentionCount;\n },\n\n /**\n * When a channel in 'always' setting, meaning the user should see both unread count and unread mention count,\n * if there are only mention messages, we should apply the theme design tokens var(--dt-theme-mention-color-[background||foreground]-strong).\n * @returns {boolean}\n */\n shouldApplyCustomStyleForMentionOnly () {\n return this.channelSetting === 'always' && !this.hasUnreadCount && this.hasUnreadMentionCount;\n },\n\n messageCount () {\n return isNaN(this.unreadCount)\n ? this.unreadCount\n : Number(this.unreadCount);\n },\n\n mentionCount () {\n return isNaN(this.unreadMentionCount)\n ? this.unreadMentionCount\n : Number(this.unreadMentionCount);\n },\n\n unreadCountTooltip () {\n return safeConcatStrings([\n this.unreadCount && this.i18n.$t('DIALTONE_UNREAD_MESSAGE_COUNT_TEXT', { unreadCount: this.messageCount }),\n this.unreadMentionCount && this.i18n.$t('DIALTONE_UNREAD_MENTION_COUNT_TEXT', { unreadCount: this.mentionCount }),\n ]);\n },\n\n dndTextTooltip () {\n return this.dndText && this.i18n.$t('DIALTONE_GENERAL_ROW_DND_TEXT_TOOLTIP');\n },\n\n activeVoiceChatTooltip () {\n return this.activeVoiceChat && this.i18n.$t('DIALTONE_GENERAL_ROW_ACTIVE_VOICE_CHAT_TEXT');\n },\n\n callButtonTooltip () {\n return this.i18n.$t('DIALTONE_GENERAL_ROW_CALL_BUTTON_TOOLTIP');\n },\n\n typingTooltip () {\n return this.isTyping && this.i18n.$t('DIALTONE_TYPING_TEXT');\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n async handler () {\n this.validateProps();\n await this.$nextTick();\n this.adjustLabelWidth();\n },\n },\n },\n\n mounted () {\n this.resizeObserver = new ResizeObserver(this.adjustLabelWidth);\n this.resizeObserver.observe(this.$el);\n this.adjustLabelWidth();\n },\n\n beforeDestroy: function () {\n this.resizeObserver.disconnect();\n },\n\n methods: {\n validateProps () {\n if (this.type === LEFTBAR_GENERAL_ROW_TYPES.CONTACT_CENTER &&\n !Object.keys(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS).includes(this.color)) {\n console.error(LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR);\n }\n },\n\n adjustLabelWidth () {\n const labelWidth = this.$el?.querySelector('.d-recipe-leftbar-row__primary')?.clientWidth || 0;\n const omegaWidth = this.$el?.querySelector('.d-recipe-leftbar-row__omega')?.clientWidth || 0;\n const alphaWidth = this.$el?.querySelector('.d-recipe-leftbar-row__alpha')?.clientWidth || 0;\n const paddings = 16;\n this.labelWidth = labelWidth - (omegaWidth + alphaWidth + paddings) + 'px';\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtEmojiTextWrapper","DtBadge","DtButton","DtTooltip","DtIconPhone","DtIconWaveform","DtRecipeLeftbarGeneralRowIcon","type","LEFTBAR_GENERAL_ROW_TYPES","color","LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS","size","LEFTBAR_GENERAL_ROW_ICON_SIZES","DialtoneLocalization","safeConcatStrings","LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR","labelWidth","_b","_a","omegaWidth","_d","_c","alphaWidth","_f","_e","paddings"],"mappings":";;;;;;;;;;AAkKA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,+BAAAC;AAAA,EACA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AA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,gBAAA,GACA,KAAA,eAAA,QAAA,KAAA,GAAA,GACA,KAAA,iBAAA;AAAA,EACA;AAAA,EAEA,eAAA,WAAA;AACA,SAAA,eAAA;EACA;AAAA,EAEA,SAAA;AAAA,IACA,gBAAA;AACA,MAAA,KAAA,SAAAN,EAAA,kBACA,CAAA,OAAA,KAAAE,CAAA,EAAA,SAAA,KAAA,KAAA,KACA,QAAA,MAAAK,CAAA;AAAA,IAEA;AAAA,IAEA,mBAAA;;AACA,YAAAC,MAAAC,KAAAC,IAAA,KAAA,QAAA,gBAAAA,EAAA,cAAA,sCAAA,gBAAAD,EAAA,gBAAA,GACAE,MAAAC,KAAAC,IAAA,KAAA,QAAA,gBAAAA,EAAA,cAAA,oCAAA,gBAAAD,EAAA,gBAAA,GACAE,MAAAC,KAAAC,IAAA,KAAA,QAAA,gBAAAA,EAAA,cAAA,oCAAA,gBAAAD,EAAA,gBAAA,GACAE,IAAA;AACA,WAAA,aAAAT,KAAAG,IAAAG,IAAAG,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/utils/index.cjs"),i=require("../../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/utils/index.cjs"),i=require("../../localization/index.cjs"),o=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),s=require("../general-row/general-row.cjs"),u={name:"DtRecipeGroupRow",components:{DtIconUsers:r.DtIconUsers,DtRecipeGeneralRow:s.default},inheritAttrs:!1,props:{names:{type:String,required:!0},unreadCount:{type:String,default:null},unreadMentionCount:{type:String,default:null},hasUnreads:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},isTyping:{type:Boolean,default:!1}},emits:["click"],data(){return{i18n:new i.DialtoneLocalization}},computed:{groupCount(){return this.names.split(",").length},messageCount(){return isNaN(this.unreadCount)?this.unreadCount:Number(this.unreadCount)},mentionCount(){return isNaN(this.unreadMentionCount)?this.unreadMentionCount:Number(this.unreadMentionCount)},unreadCountTooltip(){return n.safeConcatStrings([this.unreadCount&&this.i18n.$t("DIALTONE_UNREAD_MESSAGE_COUNT_TEXT",{unreadCount:this.messageCount}),this.unreadMentionCount&&this.i18n.$t("DIALTONE_UNREAD_MENTION_COUNT_TEXT",{unreadCount:this.mentionCount})])},typingTooltip(){return this.isTyping&&this.i18n.$t("DIALTONE_TYPING_TEXT")},ariaLabel(){return n.safeConcatStrings([this.typingTooltip,this.i18n.$t("DIALTONE_GROUP_ROW_GROUP_COUNT_TEXT",{count:this.groupCount}),this.names,this.unreadCountTooltip])}}};var a=function(){var e=this,t=e._self._c;return t("dt-recipe-general-row",e._g(e._b({attrs:{description:e.names,"aria-label":e.ariaLabel,"unread-count":e.unreadCount,"has-unreads":e.hasUnreads,"unread-mention-count":e.unreadMentionCount,selected:e.selected,"is-typing":e.isTyping},scopedSlots:e._u([{key:"left",fn:function(){return[t("dt-icon-users",{attrs:{size:"300"}})]},proxy:!0}])},"dt-recipe-general-row",e.$attrs,!1),e.$listeners))},l=[],d=o.n(u,a,l);const c=d.exports;exports.default=c;
|
|
2
2
|
//# sourceMappingURL=group-row.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-row.cjs","sources":["../../../recipes/leftbar/group_row/group_row.vue"],"sourcesContent":["<template>\n <dt-recipe-general-row\n :description=\"names\"\n :aria-label=\"ariaLabel\"\n :unread-count=\"unreadCount\"\n :has-unreads=\"hasUnreads\"\n :unread-mention-count=\"unreadMentionCount\"\n :selected=\"selected\"\n :is-typing=\"isTyping\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <template #left>\n <dt-icon-users\n size=\"300\"\n />\n </template>\n </dt-recipe-general-row>\n</template>\n\n<script>\nimport { DtRecipeGeneralRow } from '@/recipes/leftbar/general_row';\nimport { DtIconUsers } from '@dialpad/dialtone-icons/vue2';\nimport { safeConcatStrings } from '@/common/utils';\nimport {
|
|
1
|
+
{"version":3,"file":"group-row.cjs","sources":["../../../recipes/leftbar/group_row/group_row.vue"],"sourcesContent":["<template>\n <dt-recipe-general-row\n :description=\"names\"\n :aria-label=\"ariaLabel\"\n :unread-count=\"unreadCount\"\n :has-unreads=\"hasUnreads\"\n :unread-mention-count=\"unreadMentionCount\"\n :selected=\"selected\"\n :is-typing=\"isTyping\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <template #left>\n <dt-icon-users\n size=\"300\"\n />\n </template>\n </dt-recipe-general-row>\n</template>\n\n<script>\nimport { DtRecipeGeneralRow } from '@/recipes/leftbar/general_row';\nimport { DtIconUsers } from '@dialpad/dialtone-icons/vue2';\nimport { safeConcatStrings } from '@/common/utils';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtRecipeGroupRow',\n\n components: {\n DtIconUsers,\n DtRecipeGeneralRow,\n },\n\n inheritAttrs: false,\n\n props: {\n\n /**\n * Names of the group members\n */\n names: {\n type: String,\n required: true,\n },\n\n /**\n * Number of unread messages\n */\n unreadCount: {\n type: String,\n default: null,\n },\n\n /**\n * Number of unread mention messages\n */\n unreadMentionCount: {\n type: String,\n default: null,\n },\n\n /**\n * Styles the row with an increased font weight to convey it has unreads. This must be true to see\n * the unread count badge.\n */\n hasUnreads: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines if the row is selected\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows an \"is typing\" animation over the avatar when true.\n */\n isTyping: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native click event on the row itself\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n groupCount () {\n return this.names.split(',').length;\n },\n\n messageCount () {\n return isNaN(this.unreadCount)\n ? this.unreadCount\n : Number(this.unreadCount);\n },\n\n mentionCount () {\n return isNaN(this.unreadMentionCount)\n ? this.unreadMentionCount\n : Number(this.unreadMentionCount);\n },\n\n unreadCountTooltip () {\n return safeConcatStrings([\n this.unreadCount && this.i18n.$t('DIALTONE_UNREAD_MESSAGE_COUNT_TEXT', { unreadCount: this.messageCount }),\n this.unreadMentionCount && this.i18n.$t('DIALTONE_UNREAD_MENTION_COUNT_TEXT', { unreadCount: this.mentionCount }),\n ]);\n },\n\n typingTooltip () {\n return this.isTyping && this.i18n.$t('DIALTONE_TYPING_TEXT');\n },\n\n ariaLabel () {\n return safeConcatStrings([\n this.typingTooltip,\n this.i18n.$t('DIALTONE_GROUP_ROW_GROUP_COUNT_TEXT', { count: this.groupCount }),\n this.names,\n this.unreadCountTooltip,\n ]);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtIconUsers","DtRecipeGeneralRow","DialtoneLocalization","safeConcatStrings"],"mappings":"oVA0BAA,EAAA,CACA,KAAA,mBAEA,WAAA,CACA,YAAAC,EAAA,YACA,mBAAAC,EAAA,OACA,EAEA,aAAA,GAEA,MAAA,CAKA,MAAA,CACA,KAAA,OACA,SAAA,EACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,mBAAA,CACA,KAAA,OACA,QAAA,IACA,EAMA,WAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,SAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,SAAA,CACA,KAAA,QACA,QAAA,EACA,CACA,EAEA,MAAA,CAOA,OACA,EAEA,MAAA,CACA,MAAA,CACA,KAAA,IAAAC,EAAAA,oBACA,CACA,EAEA,SAAA,CACA,YAAA,CACA,OAAA,KAAA,MAAA,MAAA,GAAA,EAAA,MACA,EAEA,cAAA,CACA,OAAA,MAAA,KAAA,WAAA,EACA,KAAA,YACA,OAAA,KAAA,WAAA,CACA,EAEA,cAAA,CACA,OAAA,MAAA,KAAA,kBAAA,EACA,KAAA,mBACA,OAAA,KAAA,kBAAA,CACA,EAEA,oBAAA,CACA,OAAAC,oBAAA,CACA,KAAA,aAAA,KAAA,KAAA,GAAA,qCAAA,CAAA,YAAA,KAAA,aAAA,EACA,KAAA,oBAAA,KAAA,KAAA,GAAA,qCAAA,CAAA,YAAA,KAAA,aAAA,CACA,CAAA,CACA,EAEA,eAAA,CACA,OAAA,KAAA,UAAA,KAAA,KAAA,GAAA,sBAAA,CACA,EAEA,WAAA,CACA,OAAAA,oBAAA,CACA,KAAA,cACA,KAAA,KAAA,GAAA,sCAAA,CAAA,MAAA,KAAA,WAAA,EACA,KAAA,MACA,KAAA,kBACA,CAAA,CACA,CACA,CACA"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { DtIconUsers as r } from "@dialpad/dialtone-icons/vue2";
|
|
2
2
|
import { safeConcatStrings as e } from "../../common/utils/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import i from "
|
|
5
|
-
import s from "
|
|
3
|
+
import { DialtoneLocalization as o } from "../../localization/index.js";
|
|
4
|
+
import { n as i } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
5
|
+
import s from "../general-row/general-row.js";
|
|
6
6
|
const a = {
|
|
7
7
|
name: "DtRecipeGroupRow",
|
|
8
8
|
components: {
|
|
9
9
|
DtIconUsers: r,
|
|
10
|
-
DtRecipeGeneralRow:
|
|
10
|
+
DtRecipeGeneralRow: s
|
|
11
11
|
},
|
|
12
|
-
mixins: [s],
|
|
13
12
|
inheritAttrs: !1,
|
|
14
13
|
props: {
|
|
15
14
|
/**
|
|
@@ -65,6 +64,11 @@ const a = {
|
|
|
65
64
|
*/
|
|
66
65
|
"click"
|
|
67
66
|
],
|
|
67
|
+
data() {
|
|
68
|
+
return {
|
|
69
|
+
i18n: new o()
|
|
70
|
+
};
|
|
71
|
+
},
|
|
68
72
|
computed: {
|
|
69
73
|
groupCount() {
|
|
70
74
|
return this.names.split(",").length;
|
|
@@ -99,12 +103,12 @@ var u = function() {
|
|
|
99
103
|
return n("dt-recipe-general-row", t._g(t._b({ attrs: { description: t.names, "aria-label": t.ariaLabel, "unread-count": t.unreadCount, "has-unreads": t.hasUnreads, "unread-mention-count": t.unreadMentionCount, selected: t.selected, "is-typing": t.isTyping }, scopedSlots: t._u([{ key: "left", fn: function() {
|
|
100
104
|
return [n("dt-icon-users", { attrs: { size: "300" } })];
|
|
101
105
|
}, proxy: !0 }]) }, "dt-recipe-general-row", t.$attrs, !1), t.$listeners));
|
|
102
|
-
}, l = [],
|
|
106
|
+
}, l = [], d = /* @__PURE__ */ i(
|
|
103
107
|
a,
|
|
104
108
|
u,
|
|
105
109
|
l
|
|
106
110
|
);
|
|
107
|
-
const f =
|
|
111
|
+
const f = d.exports;
|
|
108
112
|
export {
|
|
109
113
|
f as default
|
|
110
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-row.js","sources":["../../../recipes/leftbar/group_row/group_row.vue"],"sourcesContent":["<template>\n <dt-recipe-general-row\n :description=\"names\"\n :aria-label=\"ariaLabel\"\n :unread-count=\"unreadCount\"\n :has-unreads=\"hasUnreads\"\n :unread-mention-count=\"unreadMentionCount\"\n :selected=\"selected\"\n :is-typing=\"isTyping\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <template #left>\n <dt-icon-users\n size=\"300\"\n />\n </template>\n </dt-recipe-general-row>\n</template>\n\n<script>\nimport { DtRecipeGeneralRow } from '@/recipes/leftbar/general_row';\nimport { DtIconUsers } from '@dialpad/dialtone-icons/vue2';\nimport { safeConcatStrings } from '@/common/utils';\nimport {
|
|
1
|
+
{"version":3,"file":"group-row.js","sources":["../../../recipes/leftbar/group_row/group_row.vue"],"sourcesContent":["<template>\n <dt-recipe-general-row\n :description=\"names\"\n :aria-label=\"ariaLabel\"\n :unread-count=\"unreadCount\"\n :has-unreads=\"hasUnreads\"\n :unread-mention-count=\"unreadMentionCount\"\n :selected=\"selected\"\n :is-typing=\"isTyping\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <template #left>\n <dt-icon-users\n size=\"300\"\n />\n </template>\n </dt-recipe-general-row>\n</template>\n\n<script>\nimport { DtRecipeGeneralRow } from '@/recipes/leftbar/general_row';\nimport { DtIconUsers } from '@dialpad/dialtone-icons/vue2';\nimport { safeConcatStrings } from '@/common/utils';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtRecipeGroupRow',\n\n components: {\n DtIconUsers,\n DtRecipeGeneralRow,\n },\n\n inheritAttrs: false,\n\n props: {\n\n /**\n * Names of the group members\n */\n names: {\n type: String,\n required: true,\n },\n\n /**\n * Number of unread messages\n */\n unreadCount: {\n type: String,\n default: null,\n },\n\n /**\n * Number of unread mention messages\n */\n unreadMentionCount: {\n type: String,\n default: null,\n },\n\n /**\n * Styles the row with an increased font weight to convey it has unreads. This must be true to see\n * the unread count badge.\n */\n hasUnreads: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines if the row is selected\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Shows an \"is typing\" animation over the avatar when true.\n */\n isTyping: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Native click event on the row itself\n *\n * @event click\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click',\n ],\n\n data () {\n return {\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n groupCount () {\n return this.names.split(',').length;\n },\n\n messageCount () {\n return isNaN(this.unreadCount)\n ? this.unreadCount\n : Number(this.unreadCount);\n },\n\n mentionCount () {\n return isNaN(this.unreadMentionCount)\n ? this.unreadMentionCount\n : Number(this.unreadMentionCount);\n },\n\n unreadCountTooltip () {\n return safeConcatStrings([\n this.unreadCount && this.i18n.$t('DIALTONE_UNREAD_MESSAGE_COUNT_TEXT', { unreadCount: this.messageCount }),\n this.unreadMentionCount && this.i18n.$t('DIALTONE_UNREAD_MENTION_COUNT_TEXT', { unreadCount: this.mentionCount }),\n ]);\n },\n\n typingTooltip () {\n return this.isTyping && this.i18n.$t('DIALTONE_TYPING_TEXT');\n },\n\n ariaLabel () {\n return safeConcatStrings([\n this.typingTooltip,\n this.i18n.$t('DIALTONE_GROUP_ROW_GROUP_COUNT_TEXT', { count: this.groupCount }),\n this.names,\n this.unreadCountTooltip,\n ]);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtIconUsers","DtRecipeGeneralRow","DialtoneLocalization","safeConcatStrings"],"mappings":";;;;;AA0BA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,EACA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,oBAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA,MACA,MAAA,IAAAC,EAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,aAAA;AACA,aAAA,KAAA,MAAA,MAAA,GAAA,EAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,aAAA,MAAA,KAAA,WAAA,IACA,KAAA,cACA,OAAA,KAAA,WAAA;AAAA,IACA;AAAA,IAEA,eAAA;AACA,aAAA,MAAA,KAAA,kBAAA,IACA,KAAA,qBACA,OAAA,KAAA,kBAAA;AAAA,IACA;AAAA,IAEA,qBAAA;AACA,aAAAC,EAAA;AAAA,QACA,KAAA,eAAA,KAAA,KAAA,GAAA,sCAAA,EAAA,aAAA,KAAA,cAAA;AAAA,QACA,KAAA,sBAAA,KAAA,KAAA,GAAA,sCAAA,EAAA,aAAA,KAAA,cAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,aAAA,KAAA,YAAA,KAAA,KAAA,GAAA,sBAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,aAAAA,EAAA;AAAA,QACA,KAAA;AAAA,QACA,KAAA,KAAA,GAAA,uCAAA,EAAA,OAAA,KAAA,YAAA;AAAA,QACA,KAAA;AAAA,QACA,KAAA;AAAA,MACA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@dialpad/dialtone-icons/vue2"),n=require("./icon-constants.cjs"),i=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),o={name:"DtIcon",props:{size:{type:String,default:"500",validator:t=>Object.keys(n.ICON_SIZE_MODIFIERS).includes(t)},name:{type:String,required:!0,validator:t=>n.ICON_NAMES.includes(t)},ariaLabel:{type:String,default:void 0}},data(){return{}},computed:{icon(){return a.icons[`./src/icons/${this.name}.vue`]},iconAriaLabel(){return this.ariaLabel}}};var c=function(){var e=this,r=e._self._c;return e.icon?r(e.icon,{tag:"component",attrs:{size:e.size,"aria-label":e.iconAriaLabel,"data-qa":e.$attrs["data-qa"]??"dt-icon"}}):e._e()},s=[],u=i.n(o,c,s);const _=u.exports;exports.default=_;
|
|
2
2
|
//# sourceMappingURL=icon.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.cjs","sources":["../../../components/icon/icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"iconAriaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue2';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './icon_constants';\n// import {
|
|
1
|
+
{"version":3,"file":"icon.cjs","sources":["../../../components/icon/icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"iconAriaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue2';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './icon_constants';\n// import { DialtoneLocalization } from '@/localization';\n// import { toFluentKeyString } from '@/common/utils';\n\n/**\n * The Icon component provides a set of glyphs and sizes to provide context your application.\n * @see https://dialtone.dialpad.com/components/icon.html\n */\nexport default {\n name: 'DtIcon',\n\n props: {\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (s) => Object.keys(ICON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * The icon name in kebab-case\n */\n name: {\n type: String,\n required: true,\n validator: (name) => ICON_NAMES.includes(name),\n },\n\n /**\n * The label of the icon as read out by a screen-reader. Leave this unset if your icon is purely presentational\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n },\n\n data () {\n return {\n // i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n icon () {\n return icons[`./src/icons/${this.name}.vue`];\n },\n\n iconAriaLabel () {\n // const fluentKey = toFluentKeyString(this.name);\n // return this.ariaLabel || this.i18n.$t(`DIALTONE_ICON_${fluentKey}`);\n return this.ariaLabel;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","s","ICON_SIZE_MODIFIERS","name","ICON_NAMES","icons"],"mappings":"sPAoBAA,EAAA,CACA,KAAA,SAEA,MAAA,CAKA,KAAA,CACA,KAAA,OACA,QAAA,MACA,UAAAC,GAAA,OAAA,KAAAC,qBAAA,EAAA,SAAAD,CAAA,CACA,EAKA,KAAA,CACA,KAAA,OACA,SAAA,GACA,UAAAE,GAAAC,aAAA,SAAAD,CAAA,CACA,EAKA,UAAA,CACA,KAAA,OACA,QAAA,MACA,CACA,EAEA,MAAA,CACA,MAAA,CAEA,CACA,EAEA,SAAA,CACA,MAAA,CACA,OAAAE,EAAAA,MAAA,eAAA,KAAA,IAAA,MAAA,CACA,EAEA,eAAA,CAGA,OAAA,KAAA,SACA,CACA,CACA"}
|
|
@@ -3,7 +3,6 @@ import { ICON_SIZE_MODIFIERS as n, ICON_NAMES as i } from "./icon-constants.js";
|
|
|
3
3
|
import { n as o } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
|
|
4
4
|
const c = {
|
|
5
5
|
name: "DtIcon",
|
|
6
|
-
// mixins: [DtLocalizationMixin],
|
|
7
6
|
props: {
|
|
8
7
|
/**
|
|
9
8
|
* The size of the icon.
|
|
@@ -23,13 +22,18 @@ const c = {
|
|
|
23
22
|
validator: (t) => i.includes(t)
|
|
24
23
|
},
|
|
25
24
|
/**
|
|
26
|
-
* The label of the icon as read out by a
|
|
25
|
+
* The label of the icon as read out by a screen-reader. Leave this unset if your icon is purely presentational
|
|
27
26
|
*/
|
|
28
27
|
ariaLabel: {
|
|
29
28
|
type: String,
|
|
30
29
|
default: void 0
|
|
31
30
|
}
|
|
32
31
|
},
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
// i18n: new DialtoneLocalization(),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
33
37
|
computed: {
|
|
34
38
|
icon() {
|
|
35
39
|
return r[`./src/icons/${this.name}.vue`];
|
|
@@ -42,13 +46,13 @@ const c = {
|
|
|
42
46
|
var s = function() {
|
|
43
47
|
var e = this, a = e._self._c;
|
|
44
48
|
return e.icon ? a(e.icon, { tag: "component", attrs: { size: e.size, "aria-label": e.iconAriaLabel, "data-qa": e.$attrs["data-qa"] ?? "dt-icon" } }) : e._e();
|
|
45
|
-
},
|
|
49
|
+
}, d = [], _ = /* @__PURE__ */ o(
|
|
46
50
|
c,
|
|
47
51
|
s,
|
|
48
|
-
|
|
52
|
+
d
|
|
49
53
|
);
|
|
50
|
-
const
|
|
54
|
+
const p = _.exports;
|
|
51
55
|
export {
|
|
52
|
-
|
|
56
|
+
p as default
|
|
53
57
|
};
|
|
54
58
|
//# sourceMappingURL=icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sources":["../../../components/icon/icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"iconAriaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue2';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './icon_constants';\n// import {
|
|
1
|
+
{"version":3,"file":"icon.js","sources":["../../../components/icon/icon.vue"],"sourcesContent":["<template>\n <component\n :is=\"icon\"\n v-if=\"icon\"\n :size=\"size\"\n :aria-label=\"iconAriaLabel\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-icon'\"\n />\n</template>\n\n<script>\nimport { icons } from '@dialpad/dialtone-icons/vue2';\nimport { ICON_SIZE_MODIFIERS, ICON_NAMES } from './icon_constants';\n// import { DialtoneLocalization } from '@/localization';\n// import { toFluentKeyString } from '@/common/utils';\n\n/**\n * The Icon component provides a set of glyphs and sizes to provide context your application.\n * @see https://dialtone.dialpad.com/components/icon.html\n */\nexport default {\n name: 'DtIcon',\n\n props: {\n /**\n * The size of the icon.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (s) => Object.keys(ICON_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * The icon name in kebab-case\n */\n name: {\n type: String,\n required: true,\n validator: (name) => ICON_NAMES.includes(name),\n },\n\n /**\n * The label of the icon as read out by a screen-reader. Leave this unset if your icon is purely presentational\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n },\n\n data () {\n return {\n // i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n icon () {\n return icons[`./src/icons/${this.name}.vue`];\n },\n\n iconAriaLabel () {\n // const fluentKey = toFluentKeyString(this.name);\n // return this.ariaLabel || this.i18n.$t(`DIALTONE_ICON_${fluentKey}`);\n return this.ariaLabel;\n },\n },\n};\n</script>\n"],"names":["_sfc_main","s","ICON_SIZE_MODIFIERS","name","ICON_NAMES","icons"],"mappings":";;;AAoBA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,KAAAC,CAAA,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA,CAAAE,MAAAC,EAAA,SAAAD,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AACA,WAAA;AAAA;AAAA,IAEA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,OAAA;AACA,aAAAE,EAAA,eAAA,KAAA,IAAA,MAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AAGA,aAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../common/mixins/modal.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../../common/mixins/modal.cjs"),o=require("../../common/constants/index.cjs"),n=require("@dialpad/dialtone-icons/vue2"),r=require("../../node_modules/@linusborg/vue-simple-portal.cjs"),l=require("../../shared/sr_only_close_button.cjs"),u=require("../../localization/index.cjs"),c=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),d=require("../button/button.cjs"),m={name:"DtImageViewer",components:{Portal:r.Portal,SrOnlyCloseButton:l.default,DtButton:d.default,DtIconClose:n.DtIconClose},mixins:[a.default],props:{appendTo:{type:String,default:"body"},open:{type:Boolean,default:null},imageSrc:{type:String,required:!0},imageAlt:{type:String,required:!0},imageButtonClass:{type:String,required:!1,default:""},ariaLabel:{type:String,required:!0}},emits:["opened","update:open"],data(){return{showCloseButton:!0,isOpen:!1,i18n:new u.DialtoneLocalization}},computed:{modalListeners(){return{...this.$listeners,click:t=>{t.target===t.currentTarget&&this.close()},keydown:t=>{switch(t.code){case o.EVENT_KEYNAMES.esc:case o.EVENT_KEYNAMES.escape:this.close();break;case o.EVENT_KEYNAMES.tab:this.trapFocus(t);break}}}},closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},watch:{isOpen:{immediate:!0,handler(t){var e;t?this.previousActiveElement=document.activeElement:((e=this.previousActiveElement)==null||e.focus(),this.previousActiveElement=null)}},open:{handler:function(t){t!==null&&(this.isOpen=t)},immediate:!0}},methods:{openModal(){this.open===null&&(this.isOpen=!0,this.showCloseButton=!0,this.$emit("opened",!0),setTimeout(()=>{this.focusAfterOpen()}))},close(){this.isOpen=!1,this.$emit("opened",!1),this.open!==null&&this.$emit("update:open",!1)},focusAfterOpen(){var t;(t=this.$refs.closeImage)==null||t.$el.focus()},trapFocus(t){this.isOpen&&this.focusTrappedTabPress(t)}}};var p=function(){var e=this,s=e._self._c;return s("div",[s("dt-button",{staticClass:"d-image-viewer__preview-button",attrs:{"data-qa":"dt-image-viewer-preview","aria-label":e.ariaLabel,importance:"clear"},on:{click:e.openModal}},[s("img",{class:e.imageButtonClass,attrs:{src:e.imageSrc,alt:e.imageAlt}})]),e.isOpen?s("portal",{attrs:{selector:e.appendTo}},[s("div",e._g({staticClass:"d-modal",attrs:{"aria-hidden":e.isOpen?"false":"true","data-qa":"dt-modal"},on:{mouseover:function(i){e.showCloseButton=!0},mouseleave:function(i){e.showCloseButton=!1},focusin:function(i){e.showCloseButton=!0},focusout:function(i){e.showCloseButton=!1}}},e.modalListeners),[s("div",{staticClass:"d-image-viewer__full",attrs:{"data-qa":"dt-image-viewer-full",role:"dialog","aria-modal":"true"}},[s("img",{staticClass:"d-image-viewer__full__image",attrs:{src:e.imageSrc,alt:e.imageAlt}})]),s("transition",{attrs:{name:"fade"}},[e.showCloseButton?s("dt-button",{ref:"closeImage",staticClass:"d-modal__close",attrs:{"data-qa":"dt-image-viewer-close-btn",circle:"",size:"lg",importance:"clear",kind:"inverted","aria-label":e.closeButtonTitle,title:e.closeButtonTitle},on:{click:e.close},scopedSlots:e._u([{key:"icon",fn:function(){return[s("dt-icon-close",{staticClass:"d-image-viewer__close-button",attrs:{size:"400"}})]},proxy:!0}],null,!1,3317018023)}):s("sr-only-close-button",{on:{close:e.close}})],1)],1)]):e._e()],1)},_=[],f=c.n(m,p,_);const g=f.exports;exports.default=g;
|
|
2
2
|
//# sourceMappingURL=image-viewer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-viewer.cjs","sources":["../../../components/image_viewer/image_viewer.vue"],"sourcesContent":["<template>\n <div>\n <dt-button\n data-qa=\"dt-image-viewer-preview\"\n class=\"d-image-viewer__preview-button\"\n :aria-label=\"ariaLabel\"\n importance=\"clear\"\n @click=\"openModal\"\n >\n <img\n :class=\"imageButtonClass\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </dt-button>\n <portal\n v-if=\"isOpen\"\n :selector=\"appendTo\"\n >\n <div\n :aria-hidden=\"!isOpen ? 'true' : 'false'\"\n class=\"d-modal\"\n data-qa=\"dt-modal\"\n v-on=\"modalListeners\"\n @mouseover=\"showCloseButton = true\"\n @mouseleave=\"showCloseButton = false\"\n @focusin=\" showCloseButton = true\"\n @focusout=\" showCloseButton = false\"\n >\n <div\n data-qa=\"dt-image-viewer-full\"\n class=\"d-image-viewer__full\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <img\n class=\"d-image-viewer__full__image\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </div>\n <transition name=\"fade\">\n <dt-button\n v-if=\"showCloseButton\"\n ref=\"closeImage\"\n data-qa=\"dt-image-viewer-close-btn\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n kind=\"inverted\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n class=\"d-image-viewer__close-button\"\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-else\n @close=\"close\"\n />\n </transition>\n </div>\n </portal>\n </div>\n</template>\n\n<script>\nimport Modal from '@/common/mixins/modal';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { Portal } from '@linusborg/vue-simple-portal';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport {
|
|
1
|
+
{"version":3,"file":"image-viewer.cjs","sources":["../../../components/image_viewer/image_viewer.vue"],"sourcesContent":["<template>\n <div>\n <dt-button\n data-qa=\"dt-image-viewer-preview\"\n class=\"d-image-viewer__preview-button\"\n :aria-label=\"ariaLabel\"\n importance=\"clear\"\n @click=\"openModal\"\n >\n <img\n :class=\"imageButtonClass\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </dt-button>\n <portal\n v-if=\"isOpen\"\n :selector=\"appendTo\"\n >\n <div\n :aria-hidden=\"!isOpen ? 'true' : 'false'\"\n class=\"d-modal\"\n data-qa=\"dt-modal\"\n v-on=\"modalListeners\"\n @mouseover=\"showCloseButton = true\"\n @mouseleave=\"showCloseButton = false\"\n @focusin=\" showCloseButton = true\"\n @focusout=\" showCloseButton = false\"\n >\n <div\n data-qa=\"dt-image-viewer-full\"\n class=\"d-image-viewer__full\"\n role=\"dialog\"\n aria-modal=\"true\"\n >\n <img\n class=\"d-image-viewer__full__image\"\n :src=\"imageSrc\"\n :alt=\"imageAlt\"\n >\n </div>\n <transition name=\"fade\">\n <dt-button\n v-if=\"showCloseButton\"\n ref=\"closeImage\"\n data-qa=\"dt-image-viewer-close-btn\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n kind=\"inverted\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n class=\"d-image-viewer__close-button\"\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-else\n @close=\"close\"\n />\n </transition>\n </div>\n </portal>\n </div>\n</template>\n\n<script>\nimport Modal from '@/common/mixins/modal';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { Portal } from '@linusborg/vue-simple-portal';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { DialtoneLocalization } from '@/localization';\n\nexport default {\n name: 'DtImageViewer',\n\n components: {\n Portal,\n SrOnlyCloseButton,\n DtButton,\n DtIconClose,\n },\n\n mixins: [Modal],\n\n props: {\n /**\n * By default the portal appends to the body of the root parent. We can modify\n * this behaviour by passing an appendTo prop that points to an id or an html tag from the root of the parent.\n * The appendTo prop expects a CSS selector string or an actual DOM node.\n * type: string | HTMLElement, default: 'body'\n */\n appendTo: {\n type: String,\n default: 'body',\n },\n\n /**\n * Controls whether the image modal is shown. Leaving this null will have the image modal\n * trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled and you can control it as you need.\n * Supports .sync modifier\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * URL of the image to be shown\n */\n imageSrc: {\n type: String,\n required: true,\n },\n\n /**\n * Alt text of image\n */\n imageAlt: {\n type: String,\n required: true,\n },\n\n /**\n * Image Class\n */\n imageButtonClass: {\n type: String,\n required: false,\n default: '',\n },\n\n /**\n * Aria label\n */\n ariaLabel: {\n type: String,\n required: true,\n },\n },\n\n emits: [\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean}\n */\n 'opened',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n ],\n\n data () {\n return {\n showCloseButton: true,\n isOpen: false,\n i18n: new DialtoneLocalization(),\n };\n },\n\n computed: {\n modalListeners () {\n return {\n ...this.$listeners,\n\n click: event => {\n (event.target === event.currentTarget) && this.close();\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n },\n };\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n watch: {\n isOpen: {\n immediate: true,\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n } else {\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n },\n\n immediate: true,\n },\n },\n\n methods: {\n openModal () {\n // Has custom control passed in\n if (this.open !== null) {\n return;\n }\n this.isOpen = true;\n this.showCloseButton = true;\n this.$emit('opened', true);\n\n setTimeout(() => {\n this.focusAfterOpen();\n });\n },\n\n close () {\n this.isOpen = false;\n this.$emit('opened', false);\n\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n focusAfterOpen () {\n this.$refs.closeImage?.$el.focus();\n },\n\n trapFocus (e) {\n if (this.isOpen) {\n this.focusTrappedTabPress(e);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","Portal","SrOnlyCloseButton","DtButton","DtIconClose","Modal","DialtoneLocalization","event","EVENT_KEYNAMES","isShowing","_a","open","e"],"mappings":"6eAiFAA,EAAA,CACA,KAAA,gBAEA,WAAA,CACA,OAAAC,EAAA,OACA,kBAAAC,EAAA,QACA,SAAAC,EAAA,QACA,YAAAC,EAAA,WACA,EAEA,OAAA,CAAAC,EAAAA,OAAA,EAEA,MAAA,CAOA,SAAA,CACA,KAAA,OACA,QAAA,MACA,EASA,KAAA,CACA,KAAA,QACA,QAAA,IACA,EAKA,SAAA,CACA,KAAA,OACA,SAAA,EACA,EAKA,SAAA,CACA,KAAA,OACA,SAAA,EACA,EAKA,iBAAA,CACA,KAAA,OACA,SAAA,GACA,QAAA,EACA,EAKA,UAAA,CACA,KAAA,OACA,SAAA,EACA,CACA,EAEA,MAAA,CAOA,SAMA,aACA,EAEA,MAAA,CACA,MAAA,CACA,gBAAA,GACA,OAAA,GACA,KAAA,IAAAC,EAAAA,oBACA,CACA,EAEA,SAAA,CACA,gBAAA,CACA,MAAA,CACA,GAAA,KAAA,WAEA,MAAAC,GAAA,CACAA,EAAA,SAAAA,EAAA,eAAA,KAAA,OACA,EAEA,QAAAA,GAAA,CACA,OAAAA,EAAA,KAAA,CACA,KAAAC,EAAAA,eAAA,IACA,KAAAA,EAAA,eAAA,OACA,KAAA,MAAA,EACA,MACA,KAAAA,EAAA,eAAA,IACA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