@dialpad/dialtone-vue 2.130.3 → 2.131.0

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.
@@ -82,6 +82,7 @@ const lib_timePill = require("./lib/time-pill.cjs");
82
82
  const lib_settingsMenuButton = require("./lib/settings-menu-button.cjs");
83
83
  const lib_contactInfo = require("./lib/contact-info.cjs");
84
84
  const lib_callbox = require("./lib/callbox.cjs");
85
+ const lib_contactCentersRow = require("./lib/contact-centers-row.cjs");
85
86
  const lib_contactRow = require("./lib/contact-row.cjs");
86
87
  const lib_generalRow = require("./lib/general-row.cjs");
87
88
  const lib_groupRow = require("./lib/group-row.cjs");
@@ -122,6 +123,8 @@ require("@tiptap/suggestion");
122
123
  require("@tiptap/extension-mention");
123
124
  require("@dialpad/dialtone-icons/vue2/hash");
124
125
  require("@dialpad/dialtone-icons/vue2/lock");
126
+ require("@dialpad/dialtone-icons/vue2/headphones");
127
+ require("@dialpad/dialtone-icons/vue2/chevron-down");
125
128
  exports.DEFAULT_VALIDATION_MESSAGE_TYPE = common_constants.DEFAULT_VALIDATION_MESSAGE_TYPE;
126
129
  exports.DESCRIPTION_SIZE_TYPES = common_constants.DESCRIPTION_SIZE_TYPES;
127
130
  exports.VALIDATION_MESSAGE_TYPES = common_constants.VALIDATION_MESSAGE_TYPES;
@@ -360,6 +363,7 @@ exports.DtRecipeContactInfo = lib_contactInfo.DtRecipeContactInfo;
360
363
  exports.CALLBOX_BADGE_COLORS = lib_callbox.CALLBOX_BADGE_COLORS;
361
364
  exports.CALLBOX_BORDER_COLORS = lib_callbox.CALLBOX_BORDER_COLORS;
362
365
  exports.DtRecipeCallbox = lib_callbox.DtRecipeCallbox;
366
+ exports.DtRecipeContactCentersRow = lib_contactCentersRow.DtRecipeContactCentersRow;
363
367
  exports.DtRecipeContactRow = lib_contactRow.DtRecipeContactRow;
364
368
  exports.DtRecipeGeneralRow = lib_generalRow.DtRecipeGeneralRow;
365
369
  exports.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS = lib_generalRow.LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS;
@@ -1 +1 @@
1
- {"version":3,"file":"dialtone-vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"dialtone-vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -80,6 +80,7 @@ import { DtRecipeTimePill } from "./lib/time-pill.js";
80
80
  import { DtRecipeSettingsMenuButton } from "./lib/settings-menu-button.js";
81
81
  import { DtRecipeContactInfo } from "./lib/contact-info.js";
82
82
  import { CALLBOX_BADGE_COLORS, CALLBOX_BORDER_COLORS, DtRecipeCallbox } from "./lib/callbox.js";
83
+ import { DtRecipeContactCentersRow } from "./lib/contact-centers-row.js";
83
84
  import { DtRecipeContactRow } from "./lib/contact-row.js";
84
85
  import { DtRecipeGeneralRow, LEFTBAR_GENERAL_ROW_CONTACT_CENTER_COLORS, LEFTBAR_GENERAL_ROW_CONTACT_CENTER_VALIDATION_ERROR, LEFTBAR_GENERAL_ROW_ICON_MAPPING, LEFTBAR_GENERAL_ROW_ICON_SIZES, LEFTBAR_GENERAL_ROW_TYPES } from "./lib/general-row.js";
85
86
  import { DtRecipeGroupRow } from "./lib/group-row.js";
@@ -120,6 +121,8 @@ import "@tiptap/suggestion";
120
121
  import "@tiptap/extension-mention";
121
122
  import "@dialpad/dialtone-icons/vue2/hash";
122
123
  import "@dialpad/dialtone-icons/vue2/lock";
124
+ import "@dialpad/dialtone-icons/vue2/headphones";
125
+ import "@dialpad/dialtone-icons/vue2/chevron-down";
123
126
  export {
124
127
  AVATAR_COLORS,
125
128
  AVATAR_GROUP_VALIDATOR,
@@ -210,6 +213,7 @@ export {
210
213
  DtRecipeCallbox,
211
214
  DtRecipeComboboxMultiSelect,
212
215
  DtRecipeComboboxWithPopover,
216
+ DtRecipeContactCentersRow,
213
217
  DtRecipeContactInfo,
214
218
  DtRecipeContactRow,
215
219
  DtRecipeEditor,
@@ -1 +1 @@
1
- {"version":3,"file":"dialtone-vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"dialtone-vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const DtIconHeadphones = require("@dialpad/dialtone-icons/vue2/headphones");
4
+ const DtIconChevronDown = require("@dialpad/dialtone-icons/vue2/chevron-down");
5
+ const lib_emojiTextWrapper = require("./emoji-text-wrapper.cjs");
6
+ const common_utils = require("../common/utils.cjs");
7
+ const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-1aBeR4AK.js");
8
+ const lib_button = require("./button.cjs");
9
+ const lib_badge = require("./badge.cjs");
10
+ require("../common/emoji.cjs");
11
+ require("emoji-regex");
12
+ require("emoji-toolkit/emoji_strategy.json");
13
+ require("../chunks/icon_constants-QYpmdE0R.js");
14
+ require("@dialpad/dialtone-icons/icons.json");
15
+ require("./emoji.cjs");
16
+ require("./skeleton.cjs");
17
+ require("../common/constants.cjs");
18
+ require("vue");
19
+ require("../chunks/link_constants-Huj7D_hm.js");
20
+ require("./icon.cjs");
21
+ require("@dialpad/dialtone-icons/vue2");
22
+ const _sfc_main = {
23
+ name: "DtRecipeGeneralRow",
24
+ components: {
25
+ DtButton: lib_button.DtButton,
26
+ DtBadge: lib_badge.DtBadge,
27
+ DtEmojiTextWrapper: lib_emojiTextWrapper.DtEmojiTextWrapper,
28
+ DtIconHeadphones,
29
+ DtIconChevronDown
30
+ },
31
+ inheritAttrs: false,
32
+ props: {
33
+ /**
34
+ * Will be read out by a screen reader upon focus of this row. If not defined "description" will be read.
35
+ */
36
+ ariaLabel: {
37
+ type: String,
38
+ default: ""
39
+ },
40
+ /**
41
+ * Text displayed next to the icon. Required.
42
+ */
43
+ description: {
44
+ type: String,
45
+ required: true
46
+ },
47
+ /**
48
+ * Determines if the row is selected
49
+ */
50
+ selected: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ /**
55
+ * Number of unread messages
56
+ */
57
+ unreadCount: {
58
+ type: Number,
59
+ default: 0
60
+ },
61
+ /**
62
+ * Aria label for the menu button.
63
+ */
64
+ menuButtonAriaLabel: {
65
+ type: String,
66
+ required: true
67
+ }
68
+ },
69
+ emits: [
70
+ /**
71
+ * Native click event on the row itself
72
+ *
73
+ * @event click
74
+ * @type {PointerEvent | KeyboardEvent}
75
+ */
76
+ "click",
77
+ /**
78
+ * Menu button clicked
79
+ *
80
+ * @event call
81
+ * @type {PointerEvent | KeyboardEvent}
82
+ */
83
+ "click-menu"
84
+ ],
85
+ data() {
86
+ return {
87
+ labelWidth: "auto"
88
+ };
89
+ },
90
+ computed: {
91
+ leftbarContactCentersRowClasses() {
92
+ return [
93
+ "dt-leftbar-row",
94
+ "dt-leftbar-row--contact-centers",
95
+ {
96
+ "dt-leftbar-row--unread-count": this.showUnreadCount,
97
+ "dt-leftbar-row--selected": this.selected
98
+ }
99
+ ];
100
+ },
101
+ getAriaLabel() {
102
+ return this.ariaLabel ? this.ariaLabel : common_utils.safeConcatStrings([this.description, this.unreadCountTooltip]);
103
+ },
104
+ showUnreadCount() {
105
+ return this.unreadCount > 0;
106
+ }
107
+ },
108
+ watch: {
109
+ $props: {
110
+ deep: true,
111
+ handler() {
112
+ this.adjustLabelWidth();
113
+ }
114
+ }
115
+ },
116
+ mounted() {
117
+ this.resizeObserver = new ResizeObserver(this.adjustLabelWidth);
118
+ this.resizeObserver.observe(this.$el);
119
+ this.adjustLabelWidth();
120
+ },
121
+ beforeDestroy: function() {
122
+ this.resizeObserver.disconnect();
123
+ },
124
+ methods: {
125
+ adjustLabelWidth() {
126
+ var _a, _b, _c, _d, _e, _f;
127
+ const labelWidth = ((_b = (_a = this.$el) == null ? void 0 : _a.querySelector(".dt-leftbar-row__primary")) == null ? void 0 : _b.clientWidth) || 0;
128
+ const omegaWidth = ((_d = (_c = this.$el) == null ? void 0 : _c.querySelector(".dt-leftbar-row__omega")) == null ? void 0 : _d.clientWidth) || 0;
129
+ const alphaWidth = ((_f = (_e = this.$el) == null ? void 0 : _e.querySelector(".dt-leftbar-row__alpha")) == null ? void 0 : _f.clientWidth) || 0;
130
+ const paddings = 12;
131
+ this.labelWidth = labelWidth - (omegaWidth + alphaWidth + paddings) + "px";
132
+ }
133
+ }
134
+ };
135
+ var _sfc_render = function render() {
136
+ var _vm = this, _c = _vm._self._c;
137
+ return _c("div", { class: [
138
+ "dt-leftbar-row__container",
139
+ { "dt-leftbar-row__container--off-duty": _vm.$slots.timer }
140
+ ] }, [_c("div", { class: _vm.leftbarContactCentersRowClasses, attrs: { "data-qa": "dt-recipe-contact-centers-row" } }, [_c("a", _vm._g(_vm._b({ staticClass: "dt-leftbar-row__primary", attrs: { "data-qa": _vm.$attrs["data-qa"] ?? "dt-leftbar-row-link", "aria-label": _vm.getAriaLabel, "title": _vm.description, "href": _vm.$attrs.href ?? "javascript:void(0)" } }, "a", _vm.$attrs, false), _vm.$listeners), [_c("div", { staticClass: "dt-leftbar-row__alpha" }, [_c("dt-icon-headphones", { attrs: { "size": "300", "data-qa": "dt-leftbar-row-icon" } })], 1), _c("div", { staticClass: "dt-leftbar-row__label", style: `flex-basis: ${_vm.labelWidth}` }, [_c("dt-emoji-text-wrapper", { staticClass: "dt-leftbar-row__description", attrs: { "data-qa": "dt-leftbar-row-description", "size": "200" } }, [_vm._v(" " + _vm._s(_vm.description) + " ")])], 1)]), _c("div", { staticClass: "dt-leftbar-row__omega" }, [_vm._t("right"), _c("div", { staticClass: "dt-leftbar-row__action-container" }, [_vm.showUnreadCount ? _c("dt-badge", { staticClass: "dt-leftbar-row__unread-badge", attrs: { "data-qa": "dt-leftbar-row-unread-badge", "kind": "count", "type": "bulletin" } }, [_vm._v(" " + _vm._s(_vm.unreadCount) + " ")]) : _vm._e(), _c("dt-button", { staticClass: "dt-leftbar-row__action", attrs: { "data-qa": "dt-leftbar-row-action-button", "aria-label": _vm.menuButtonAriaLabel, "importance": "clear", "size": "xs", "circle": "" }, on: { "click": function($event) {
141
+ $event.stopPropagation();
142
+ return _vm.$emit("click-menu", $event);
143
+ } }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
144
+ return [_c("dt-icon-chevron-down", { attrs: { "size": "100" } })];
145
+ }, proxy: true }]) })], 1)], 2)]), _c("div", { staticClass: "dt-leftbar-row__bottom" }, [_vm._t("timer")], 2)]);
146
+ };
147
+ var _sfc_staticRenderFns = [];
148
+ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
149
+ _sfc_main,
150
+ _sfc_render,
151
+ _sfc_staticRenderFns,
152
+ false,
153
+ null,
154
+ "f44e0386",
155
+ null,
156
+ null
157
+ );
158
+ const contact_centers_row = __component__.exports;
159
+ exports.DtRecipeContactCentersRow = contact_centers_row;
160
+ //# sourceMappingURL=contact-centers-row.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-centers-row.cjs","sources":["../../recipes/leftbar/contact_centers_row/contact_centers_row.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'dt-leftbar-row__container',\n { 'dt-leftbar-row__container--off-duty': $slots.timer },\n ]\"\n >\n <div\n :class=\"leftbarContactCentersRowClasses\"\n data-qa=\"dt-recipe-contact-centers-row\"\n >\n <a\n class=\"dt-leftbar-row__primary\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-leftbar-row-link'\"\n :aria-label=\"getAriaLabel\"\n :title=\"description\"\n :href=\"$attrs.href ?? 'javascript:void(0)'\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <div class=\"dt-leftbar-row__alpha\">\n <dt-icon-headphones\n size=\"300\"\n data-qa=\"dt-leftbar-row-icon\"\n />\n </div>\n <div\n class=\"dt-leftbar-row__label\"\n :style=\"`flex-basis: ${labelWidth}`\"\n >\n <dt-emoji-text-wrapper\n class=\"dt-leftbar-row__description\"\n data-qa=\"dt-leftbar-row-description\"\n size=\"200\"\n >\n {{ description }}\n </dt-emoji-text-wrapper>\n </div>\n </a>\n <div class=\"dt-leftbar-row__omega\">\n <slot name=\"right\" />\n <div class=\"dt-leftbar-row__action-container\">\n <dt-badge\n v-if=\"showUnreadCount\"\n class=\"dt-leftbar-row__unread-badge\"\n data-qa=\"dt-leftbar-row-unread-badge\"\n kind=\"count\"\n type=\"bulletin\"\n >\n {{ unreadCount }}\n </dt-badge>\n <dt-button\n class=\"dt-leftbar-row__action\"\n data-qa=\"dt-leftbar-row-action-button\"\n :aria-label=\"menuButtonAriaLabel\"\n importance=\"clear\"\n size=\"xs\"\n circle\n @click.stop=\"$emit('click-menu', $event)\"\n >\n <template #icon>\n <dt-icon-chevron-down size=\"100\" />\n </template>\n </dt-button>\n </div>\n </div>\n </div>\n <div class=\"dt-leftbar-row__bottom\">\n <slot name=\"timer\" />\n </div>\n </div>\n</template>\n\n<script>\nimport { DtBadge } from '@/components/badge';\nimport { DtButton } from '@/components/button';\nimport DtIconHeadphones from '@dialpad/dialtone-icons/vue2/headphones';\nimport DtIconChevronDown from '@dialpad/dialtone-icons/vue2/chevron-down';\nimport DtEmojiTextWrapper from '@/components/emoji_text_wrapper/emoji_text_wrapper.vue';\nimport { safeConcatStrings } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeGeneralRow',\n\n components: {\n DtButton,\n DtBadge,\n DtEmojiTextWrapper,\n DtIconHeadphones,\n DtIconChevronDown,\n },\n\n inheritAttrs: false,\n\n props: {\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.\n */\n description: {\n type: String,\n required: true,\n },\n\n /**\n * Determines if the row is selected\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Number of unread messages\n */\n unreadCount: {\n type: Number,\n default: 0,\n },\n\n /**\n * Aria label for the menu button.\n */\n menuButtonAriaLabel: {\n type: String,\n required: true,\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 * Menu button clicked\n *\n * @event call\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click-menu',\n ],\n\n data () {\n return {\n labelWidth: 'auto',\n };\n },\n\n computed: {\n leftbarContactCentersRowClasses () {\n return [\n 'dt-leftbar-row',\n 'dt-leftbar-row--contact-centers',\n {\n 'dt-leftbar-row--unread-count': this.showUnreadCount,\n 'dt-leftbar-row--selected': this.selected,\n },\n ];\n },\n\n getAriaLabel () {\n return this.ariaLabel\n ? this.ariaLabel\n : safeConcatStrings([this.description, this.unreadCountTooltip]);\n },\n\n showUnreadCount () {\n return this.unreadCount > 0;\n },\n },\n\n watch: {\n $props: {\n deep: true,\n handler () {\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 adjustLabelWidth () {\n const labelWidth = this.$el?.querySelector('.dt-leftbar-row__primary')?.clientWidth || 0;\n const omegaWidth = this.$el?.querySelector('.dt-leftbar-row__omega')?.clientWidth || 0;\n const alphaWidth = this.$el?.querySelector('.dt-leftbar-row__alpha')?.clientWidth || 0;\n const paddings = 12;\n this.labelWidth = labelWidth - (omegaWidth + alphaWidth + paddings) + 'px';\n },\n },\n};\n</script>\n\n<style lang=\"less\" scoped>\n@import \"../style/leftbar_row.less\";\n</style>\n"],"names":["DtButton","DtBadge","DtEmojiTextWrapper","safeConcatStrings"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiFA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAA,WAAA;AAAA,IACA,SAAAC,UAAA;AAAA,IACA,oBAAAC,qBAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;A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;AAAA,IACA,mBAAA;;AACA,YAAA,eAAA,gBAAA,QAAA,mBAAA,cAAA,gCAAA,mBAAA,gBAAA;AACA,YAAA,eAAA,gBAAA,QAAA,mBAAA,cAAA,8BAAA,mBAAA,gBAAA;AACA,YAAA,eAAA,gBAAA,QAAA,mBAAA,cAAA,8BAAA,mBAAA,gBAAA;AACA,YAAA,WAAA;AACA,WAAA,aAAA,cAAA,aAAA,aAAA,YAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,160 @@
1
+ import DtIconHeadphones from "@dialpad/dialtone-icons/vue2/headphones";
2
+ import DtIconChevronDown from "@dialpad/dialtone-icons/vue2/chevron-down";
3
+ import { DtEmojiTextWrapper } from "./emoji-text-wrapper.js";
4
+ import { safeConcatStrings } from "../common/utils.js";
5
+ import { normalizeComponent } from "../chunks/_plugin-vue2_normalizer-sOSkiPF3.js";
6
+ import { DtButton } from "./button.js";
7
+ import { DtBadge } from "./badge.js";
8
+ import "../common/emoji.js";
9
+ import "emoji-regex";
10
+ import "emoji-toolkit/emoji_strategy.json";
11
+ import "../chunks/icon_constants-Dy4MEUJL.js";
12
+ import "@dialpad/dialtone-icons/icons.json";
13
+ import "./emoji.js";
14
+ import "./skeleton.js";
15
+ import "../common/constants.js";
16
+ import "vue";
17
+ import "../chunks/link_constants-nWVlXQBs.js";
18
+ import "./icon.js";
19
+ import "@dialpad/dialtone-icons/vue2";
20
+ const _sfc_main = {
21
+ name: "DtRecipeGeneralRow",
22
+ components: {
23
+ DtButton,
24
+ DtBadge,
25
+ DtEmojiTextWrapper,
26
+ DtIconHeadphones,
27
+ DtIconChevronDown
28
+ },
29
+ inheritAttrs: false,
30
+ props: {
31
+ /**
32
+ * Will be read out by a screen reader upon focus of this row. If not defined "description" will be read.
33
+ */
34
+ ariaLabel: {
35
+ type: String,
36
+ default: ""
37
+ },
38
+ /**
39
+ * Text displayed next to the icon. Required.
40
+ */
41
+ description: {
42
+ type: String,
43
+ required: true
44
+ },
45
+ /**
46
+ * Determines if the row is selected
47
+ */
48
+ selected: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ /**
53
+ * Number of unread messages
54
+ */
55
+ unreadCount: {
56
+ type: Number,
57
+ default: 0
58
+ },
59
+ /**
60
+ * Aria label for the menu button.
61
+ */
62
+ menuButtonAriaLabel: {
63
+ type: String,
64
+ required: true
65
+ }
66
+ },
67
+ emits: [
68
+ /**
69
+ * Native click event on the row itself
70
+ *
71
+ * @event click
72
+ * @type {PointerEvent | KeyboardEvent}
73
+ */
74
+ "click",
75
+ /**
76
+ * Menu button clicked
77
+ *
78
+ * @event call
79
+ * @type {PointerEvent | KeyboardEvent}
80
+ */
81
+ "click-menu"
82
+ ],
83
+ data() {
84
+ return {
85
+ labelWidth: "auto"
86
+ };
87
+ },
88
+ computed: {
89
+ leftbarContactCentersRowClasses() {
90
+ return [
91
+ "dt-leftbar-row",
92
+ "dt-leftbar-row--contact-centers",
93
+ {
94
+ "dt-leftbar-row--unread-count": this.showUnreadCount,
95
+ "dt-leftbar-row--selected": this.selected
96
+ }
97
+ ];
98
+ },
99
+ getAriaLabel() {
100
+ return this.ariaLabel ? this.ariaLabel : safeConcatStrings([this.description, this.unreadCountTooltip]);
101
+ },
102
+ showUnreadCount() {
103
+ return this.unreadCount > 0;
104
+ }
105
+ },
106
+ watch: {
107
+ $props: {
108
+ deep: true,
109
+ handler() {
110
+ this.adjustLabelWidth();
111
+ }
112
+ }
113
+ },
114
+ mounted() {
115
+ this.resizeObserver = new ResizeObserver(this.adjustLabelWidth);
116
+ this.resizeObserver.observe(this.$el);
117
+ this.adjustLabelWidth();
118
+ },
119
+ beforeDestroy: function() {
120
+ this.resizeObserver.disconnect();
121
+ },
122
+ methods: {
123
+ adjustLabelWidth() {
124
+ var _a, _b, _c, _d, _e, _f;
125
+ const labelWidth = ((_b = (_a = this.$el) == null ? void 0 : _a.querySelector(".dt-leftbar-row__primary")) == null ? void 0 : _b.clientWidth) || 0;
126
+ const omegaWidth = ((_d = (_c = this.$el) == null ? void 0 : _c.querySelector(".dt-leftbar-row__omega")) == null ? void 0 : _d.clientWidth) || 0;
127
+ const alphaWidth = ((_f = (_e = this.$el) == null ? void 0 : _e.querySelector(".dt-leftbar-row__alpha")) == null ? void 0 : _f.clientWidth) || 0;
128
+ const paddings = 12;
129
+ this.labelWidth = labelWidth - (omegaWidth + alphaWidth + paddings) + "px";
130
+ }
131
+ }
132
+ };
133
+ var _sfc_render = function render() {
134
+ var _vm = this, _c = _vm._self._c;
135
+ return _c("div", { class: [
136
+ "dt-leftbar-row__container",
137
+ { "dt-leftbar-row__container--off-duty": _vm.$slots.timer }
138
+ ] }, [_c("div", { class: _vm.leftbarContactCentersRowClasses, attrs: { "data-qa": "dt-recipe-contact-centers-row" } }, [_c("a", _vm._g(_vm._b({ staticClass: "dt-leftbar-row__primary", attrs: { "data-qa": _vm.$attrs["data-qa"] ?? "dt-leftbar-row-link", "aria-label": _vm.getAriaLabel, "title": _vm.description, "href": _vm.$attrs.href ?? "javascript:void(0)" } }, "a", _vm.$attrs, false), _vm.$listeners), [_c("div", { staticClass: "dt-leftbar-row__alpha" }, [_c("dt-icon-headphones", { attrs: { "size": "300", "data-qa": "dt-leftbar-row-icon" } })], 1), _c("div", { staticClass: "dt-leftbar-row__label", style: `flex-basis: ${_vm.labelWidth}` }, [_c("dt-emoji-text-wrapper", { staticClass: "dt-leftbar-row__description", attrs: { "data-qa": "dt-leftbar-row-description", "size": "200" } }, [_vm._v(" " + _vm._s(_vm.description) + " ")])], 1)]), _c("div", { staticClass: "dt-leftbar-row__omega" }, [_vm._t("right"), _c("div", { staticClass: "dt-leftbar-row__action-container" }, [_vm.showUnreadCount ? _c("dt-badge", { staticClass: "dt-leftbar-row__unread-badge", attrs: { "data-qa": "dt-leftbar-row-unread-badge", "kind": "count", "type": "bulletin" } }, [_vm._v(" " + _vm._s(_vm.unreadCount) + " ")]) : _vm._e(), _c("dt-button", { staticClass: "dt-leftbar-row__action", attrs: { "data-qa": "dt-leftbar-row-action-button", "aria-label": _vm.menuButtonAriaLabel, "importance": "clear", "size": "xs", "circle": "" }, on: { "click": function($event) {
139
+ $event.stopPropagation();
140
+ return _vm.$emit("click-menu", $event);
141
+ } }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
142
+ return [_c("dt-icon-chevron-down", { attrs: { "size": "100" } })];
143
+ }, proxy: true }]) })], 1)], 2)]), _c("div", { staticClass: "dt-leftbar-row__bottom" }, [_vm._t("timer")], 2)]);
144
+ };
145
+ var _sfc_staticRenderFns = [];
146
+ var __component__ = /* @__PURE__ */ normalizeComponent(
147
+ _sfc_main,
148
+ _sfc_render,
149
+ _sfc_staticRenderFns,
150
+ false,
151
+ null,
152
+ "f44e0386",
153
+ null,
154
+ null
155
+ );
156
+ const contact_centers_row = __component__.exports;
157
+ export {
158
+ contact_centers_row as DtRecipeContactCentersRow
159
+ };
160
+ //# sourceMappingURL=contact-centers-row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-centers-row.js","sources":["../../recipes/leftbar/contact_centers_row/contact_centers_row.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n 'dt-leftbar-row__container',\n { 'dt-leftbar-row__container--off-duty': $slots.timer },\n ]\"\n >\n <div\n :class=\"leftbarContactCentersRowClasses\"\n data-qa=\"dt-recipe-contact-centers-row\"\n >\n <a\n class=\"dt-leftbar-row__primary\"\n :data-qa=\"$attrs['data-qa'] ?? 'dt-leftbar-row-link'\"\n :aria-label=\"getAriaLabel\"\n :title=\"description\"\n :href=\"$attrs.href ?? 'javascript:void(0)'\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n >\n <div class=\"dt-leftbar-row__alpha\">\n <dt-icon-headphones\n size=\"300\"\n data-qa=\"dt-leftbar-row-icon\"\n />\n </div>\n <div\n class=\"dt-leftbar-row__label\"\n :style=\"`flex-basis: ${labelWidth}`\"\n >\n <dt-emoji-text-wrapper\n class=\"dt-leftbar-row__description\"\n data-qa=\"dt-leftbar-row-description\"\n size=\"200\"\n >\n {{ description }}\n </dt-emoji-text-wrapper>\n </div>\n </a>\n <div class=\"dt-leftbar-row__omega\">\n <slot name=\"right\" />\n <div class=\"dt-leftbar-row__action-container\">\n <dt-badge\n v-if=\"showUnreadCount\"\n class=\"dt-leftbar-row__unread-badge\"\n data-qa=\"dt-leftbar-row-unread-badge\"\n kind=\"count\"\n type=\"bulletin\"\n >\n {{ unreadCount }}\n </dt-badge>\n <dt-button\n class=\"dt-leftbar-row__action\"\n data-qa=\"dt-leftbar-row-action-button\"\n :aria-label=\"menuButtonAriaLabel\"\n importance=\"clear\"\n size=\"xs\"\n circle\n @click.stop=\"$emit('click-menu', $event)\"\n >\n <template #icon>\n <dt-icon-chevron-down size=\"100\" />\n </template>\n </dt-button>\n </div>\n </div>\n </div>\n <div class=\"dt-leftbar-row__bottom\">\n <slot name=\"timer\" />\n </div>\n </div>\n</template>\n\n<script>\nimport { DtBadge } from '@/components/badge';\nimport { DtButton } from '@/components/button';\nimport DtIconHeadphones from '@dialpad/dialtone-icons/vue2/headphones';\nimport DtIconChevronDown from '@dialpad/dialtone-icons/vue2/chevron-down';\nimport DtEmojiTextWrapper from '@/components/emoji_text_wrapper/emoji_text_wrapper.vue';\nimport { safeConcatStrings } from '@/common/utils';\n\nexport default {\n name: 'DtRecipeGeneralRow',\n\n components: {\n DtButton,\n DtBadge,\n DtEmojiTextWrapper,\n DtIconHeadphones,\n DtIconChevronDown,\n },\n\n inheritAttrs: false,\n\n props: {\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.\n */\n description: {\n type: String,\n required: true,\n },\n\n /**\n * Determines if the row is selected\n */\n selected: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Number of unread messages\n */\n unreadCount: {\n type: Number,\n default: 0,\n },\n\n /**\n * Aria label for the menu button.\n */\n menuButtonAriaLabel: {\n type: String,\n required: true,\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 * Menu button clicked\n *\n * @event call\n * @type {PointerEvent | KeyboardEvent}\n */\n 'click-menu',\n ],\n\n data () {\n return {\n labelWidth: 'auto',\n };\n },\n\n computed: {\n leftbarContactCentersRowClasses () {\n return [\n 'dt-leftbar-row',\n 'dt-leftbar-row--contact-centers',\n {\n 'dt-leftbar-row--unread-count': this.showUnreadCount,\n 'dt-leftbar-row--selected': this.selected,\n },\n ];\n },\n\n getAriaLabel () {\n return this.ariaLabel\n ? this.ariaLabel\n : safeConcatStrings([this.description, this.unreadCountTooltip]);\n },\n\n showUnreadCount () {\n return this.unreadCount > 0;\n },\n },\n\n watch: {\n $props: {\n deep: true,\n handler () {\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 adjustLabelWidth () {\n const labelWidth = this.$el?.querySelector('.dt-leftbar-row__primary')?.clientWidth || 0;\n const omegaWidth = this.$el?.querySelector('.dt-leftbar-row__omega')?.clientWidth || 0;\n const alphaWidth = this.$el?.querySelector('.dt-leftbar-row__alpha')?.clientWidth || 0;\n const paddings = 12;\n this.labelWidth = labelWidth - (omegaWidth + alphaWidth + paddings) + 'px';\n },\n },\n};\n</script>\n\n<style lang=\"less\" scoped>\n@import \"../style/leftbar_row.less\";\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAiFA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;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,YAAA,eAAA,gBAAA,QAAA,mBAAA,cAAA,gCAAA,mBAAA,gBAAA;AACA,YAAA,eAAA,gBAAA,QAAA,mBAAA,cAAA,8BAAA,mBAAA,gBAAA;AACA,YAAA,eAAA,gBAAA,QAAA,mBAAA,cAAA,8BAAA,mBAAA,gBAAA;AACA,YAAA,WAAA;AACA,WAAA,aAAA,cAAA,aAAA,aAAA,YAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -266,25 +266,25 @@ const _sfc_main$2 = {
266
266
  };
267
267
  var _sfc_render$2 = function render() {
268
268
  var _vm = this, _c = _vm._self._c;
269
- return _c("dt-stack", { staticClass: "d-datepicker__month-year", attrs: { "direction": "row", "gap": "300" } }, [_c("dt-stack", { staticClass: "d-datepicker__nav", attrs: { "as": "nav", "direction": "row", "gap": "200" } }, [_c("dt-tooltip", { attrs: { "message": _vm.prevYearLabel, "placement": "top" }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
269
+ return _c("dt-stack", { staticClass: "d-datepicker__month-year", attrs: { "direction": "row", "gap": "300" } }, [_c("dt-stack", { staticClass: "d-datepicker__nav", attrs: { "as": "nav", "direction": "row", "gap": "200" } }, [_c("dt-tooltip", { attrs: { "message": _vm.prevYearLabel, "placement": "top", "fallback-placements": ["top-start", "auto"] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
270
270
  return [_c("dt-button", { ref: _vm.refNames[0], staticClass: "d-datepicker__nav-btn", attrs: { "id": "prevYearButton", "size": "xs", "importance": "clear", "kind": "muted", "circle": true, "type": "button", "aria-label": `${_vm.changeToLabel} ${_vm.prevYearLabel} ${_vm.selectYear - 1}` }, on: { "click": function($event) {
271
271
  return _vm.changeYear(-1);
272
272
  }, "keydown": function($event) {
273
273
  return _vm.handleKeyDown($event);
274
274
  } } }, [_c("dt-icon", { attrs: { "name": "chevrons-left", "size": "200" } })], 1)];
275
- }, proxy: true }]) }), _c("dt-tooltip", { attrs: { "message": _vm.prevMonthLabel, "placement": "top" }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
275
+ }, proxy: true }]) }), _c("dt-tooltip", { attrs: { "message": _vm.prevMonthLabel, "placement": "top", "fallback-placements": ["top-end", "auto"] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
276
276
  return [_c("dt-button", { ref: _vm.refNames[1], staticClass: "d-datepicker__nav-btn", attrs: { "id": "prevMonthButton", "size": "xs", "importance": "clear", "kind": "muted", "circle": true, "type": "button", "aria-label": `${_vm.changeToLabel} ${_vm.prevMonthLabel} ${_vm.formattedMonth(_vm.selectMonth - 1)}` }, on: { "click": function($event) {
277
277
  return _vm.changeMonth(-1);
278
278
  }, "keydown": function($event) {
279
279
  return _vm.handleKeyDown($event);
280
280
  } } }, [_c("dt-icon", { attrs: { "name": "chevron-left", "size": "200" } })], 1)];
281
- }, proxy: true }]) })], 1), _c("div", { staticClass: "d-datepicker__month-year-title", attrs: { "id": "calendar-heading" } }, [_vm._v(" " + _vm._s(_vm.formattedMonth(_vm.selectMonth)) + " " + _vm._s(_vm.selectYear) + " ")]), _c("dt-stack", { staticClass: "d-datepicker__nav", attrs: { "as": "nav", "direction": "row", "gap": "200" } }, [_c("dt-tooltip", { attrs: { "message": _vm.nextMonthLabel, "placement": "top" }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
281
+ }, proxy: true }]) })], 1), _c("div", { staticClass: "d-datepicker__month-year-title", attrs: { "id": "calendar-heading" } }, [_vm._v(" " + _vm._s(_vm.formattedMonth(_vm.selectMonth)) + " " + _vm._s(_vm.selectYear) + " ")]), _c("dt-stack", { staticClass: "d-datepicker__nav", attrs: { "as": "nav", "direction": "row", "gap": "200" } }, [_c("dt-tooltip", { attrs: { "message": _vm.nextMonthLabel, "placement": "top", "fallback-placements": ["top-start", "auto"] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
282
282
  return [_c("dt-button", { ref: _vm.refNames[2], staticClass: "d-datepicker__nav-btn", attrs: { "id": "nextMonthButton", "size": "xs", "importance": "clear", "circle": true, "kind": "muted", "type": "button", "aria-label": `${_vm.changeToLabel} ${_vm.nextMonthLabel} ${_vm.formattedMonth(_vm.selectMonth + 1)}` }, on: { "click": function($event) {
283
283
  return _vm.changeMonth(1);
284
284
  }, "keydown": function($event) {
285
285
  return _vm.handleKeyDown($event);
286
286
  } } }, [_c("dt-icon", { attrs: { "name": "chevron-right", "size": "200" } })], 1)];
287
- }, proxy: true }]) }), _c("dt-tooltip", { attrs: { "message": _vm.nextYearLabel, "placement": "top" }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
287
+ }, proxy: true }]) }), _c("dt-tooltip", { attrs: { "message": _vm.nextYearLabel, "placement": "top", "fallback-placements": ["top-end", "auto"] }, scopedSlots: _vm._u([{ key: "anchor", fn: function() {
288
288
  return [_c("dt-button", { ref: _vm.refNames[3], staticClass: "d-datepicker__nav-btn", attrs: { "id": "nextYearButton", "size": "xs", "kind": "muted", "circle": true, "importance": "clear", "type": "button", "aria-label": `${_vm.changeToLabel} ${_vm.nextYearLabel} ${_vm.selectYear + 1}` }, on: { "click": function($event) {
289
289
  return _vm.changeYear(1);
290
290
  }, "keydown": function($event) {