@dialpad/dialtone-vue 2.125.0 → 2.125.1-alpha.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.
Files changed (282) hide show
  1. package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +33 -0
  2. package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +1 -0
  3. package/dist/chunks/dropdown-SMWaTWyF.js +357 -0
  4. package/dist/chunks/dropdown-SMWaTWyF.js.map +1 -0
  5. package/dist/chunks/dropdown_constants-EUcDxBrX.js +9 -0
  6. package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +1 -0
  7. package/dist/chunks/icon_constants-OpYAAKwF.js +16 -0
  8. package/dist/chunks/icon_constants-OpYAAKwF.js.map +1 -0
  9. package/dist/chunks/index-nIyl_PL6.js +372 -0
  10. package/dist/chunks/index-nIyl_PL6.js.map +1 -0
  11. package/dist/chunks/index-o4OMWMuv.js +244 -0
  12. package/dist/chunks/index-o4OMWMuv.js.map +1 -0
  13. package/dist/chunks/input-1tm09l_-.js +273 -0
  14. package/dist/chunks/input-1tm09l_-.js.map +1 -0
  15. package/dist/chunks/input_group-zcAq3DQl.js +141 -0
  16. package/dist/chunks/input_group-zcAq3DQl.js.map +1 -0
  17. package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +197 -0
  18. package/dist/chunks/keyboard_list_navigation-F0O8nht0.js.map +1 -0
  19. package/dist/chunks/link_constants-vIUB92L4.js +16 -0
  20. package/dist/chunks/link_constants-vIUB92L4.js.map +1 -0
  21. package/dist/chunks/list_item_constants-LTUc74pD.js +13 -0
  22. package/dist/chunks/list_item_constants-LTUc74pD.js.map +1 -0
  23. package/dist/chunks/modal-VuMFkZFH.js +82 -0
  24. package/dist/chunks/modal-VuMFkZFH.js.map +1 -0
  25. package/dist/chunks/notice_action-9NmtQRai.js +182 -0
  26. package/dist/chunks/notice_action-9NmtQRai.js.map +1 -0
  27. package/dist/chunks/notice_constants-c--hBFQw.js +6 -0
  28. package/dist/chunks/notice_constants-c--hBFQw.js.map +1 -0
  29. package/dist/chunks/popover_constants-qjlEkroB.js +114 -0
  30. package/dist/chunks/popover_constants-qjlEkroB.js.map +1 -0
  31. package/dist/chunks/sr_only_close_button-JGole5Xi.js +86 -0
  32. package/dist/chunks/sr_only_close_button-JGole5Xi.js.map +1 -0
  33. package/dist/chunks/stack_constants-u7tNqGtc.js +13 -0
  34. package/dist/chunks/stack_constants-u7tNqGtc.js.map +1 -0
  35. package/dist/chunks/tab-Qm9LVkYj.js +346 -0
  36. package/dist/chunks/tab-Qm9LVkYj.js.map +1 -0
  37. package/dist/component-documentation.json +1 -1
  38. package/dist/dialtone-vue.js +354 -10368
  39. package/dist/dialtone-vue.js.map +1 -1
  40. package/dist/lib/attachment-carousel.js +250 -0
  41. package/dist/lib/attachment-carousel.js.map +1 -0
  42. package/dist/lib/avatar.js +369 -0
  43. package/dist/lib/avatar.js.map +1 -0
  44. package/dist/lib/badge.js +169 -0
  45. package/dist/lib/badge.js.map +1 -0
  46. package/dist/lib/banner.js +200 -0
  47. package/dist/lib/banner.js.map +1 -0
  48. package/dist/lib/breadcrumbs.js +138 -0
  49. package/dist/lib/breadcrumbs.js.map +1 -0
  50. package/dist/lib/button-group.js +45 -0
  51. package/dist/lib/button-group.js.map +1 -0
  52. package/dist/lib/button.js +328 -0
  53. package/dist/lib/button.js.map +1 -0
  54. package/dist/lib/callbar-button-with-popover.js +235 -0
  55. package/dist/lib/callbar-button-with-popover.js.map +1 -0
  56. package/dist/lib/callbar-button.js +175 -0
  57. package/dist/lib/callbar-button.js.map +1 -0
  58. package/dist/lib/callbox.js +142 -0
  59. package/dist/lib/callbox.js.map +1 -0
  60. package/dist/lib/card.js +72 -0
  61. package/dist/lib/card.js.map +1 -0
  62. package/dist/lib/checkbox-group.js +117 -0
  63. package/dist/lib/checkbox-group.js.map +1 -0
  64. package/dist/lib/checkbox.js +117 -0
  65. package/dist/lib/checkbox.js.map +1 -0
  66. package/dist/lib/chip.js +186 -0
  67. package/dist/lib/chip.js.map +1 -0
  68. package/dist/lib/codeblock.js +29 -0
  69. package/dist/lib/codeblock.js.map +1 -0
  70. package/dist/lib/collapsible.js +313 -0
  71. package/dist/lib/collapsible.js.map +1 -0
  72. package/dist/lib/combobox-multi-select.js +433 -0
  73. package/dist/lib/combobox-multi-select.js.map +1 -0
  74. package/dist/lib/combobox-with-popover.js +341 -0
  75. package/dist/lib/combobox-with-popover.js.map +1 -0
  76. package/dist/lib/combobox.js +19 -0
  77. package/dist/lib/combobox.js.map +1 -0
  78. package/dist/lib/constants.js +53 -0
  79. package/dist/lib/constants.js.map +1 -0
  80. package/dist/lib/contact-info.js +145 -0
  81. package/dist/lib/contact-info.js.map +1 -0
  82. package/dist/lib/contact-row.js +203 -0
  83. package/dist/lib/contact-row.js.map +1 -0
  84. package/dist/lib/datepicker.js +552 -0
  85. package/dist/lib/datepicker.js.map +1 -0
  86. package/dist/lib/dates.js +57 -0
  87. package/dist/lib/dates.js.map +1 -0
  88. package/dist/lib/description-list.js +83 -0
  89. package/dist/lib/description-list.js.map +1 -0
  90. package/dist/lib/dropdown.js +45 -0
  91. package/dist/lib/dropdown.js.map +1 -0
  92. package/dist/lib/editor.js +527 -0
  93. package/dist/lib/editor.js.map +1 -0
  94. package/dist/{emoji_picker-kiTOKaq8.js → lib/emoji-picker.js} +30 -12
  95. package/dist/lib/emoji-picker.js.map +1 -0
  96. package/dist/lib/emoji-row.js +83 -0
  97. package/dist/lib/emoji-row.js.map +1 -0
  98. package/dist/{emoji_text_wrapper-48ClwKvf.js → lib/emoji-text-wrapper.js} +19 -14
  99. package/dist/lib/emoji-text-wrapper.js.map +1 -0
  100. package/dist/lib/emoji.js +11 -0
  101. package/dist/{emoji.js.map → lib/emoji.js.map} +1 -1
  102. package/dist/lib/feed-item-row.js +207 -0
  103. package/dist/lib/feed-item-row.js.map +1 -0
  104. package/dist/lib/feed-pill.js +142 -0
  105. package/dist/lib/feed-pill.js.map +1 -0
  106. package/dist/lib/general-row.js +379 -0
  107. package/dist/lib/general-row.js.map +1 -0
  108. package/dist/lib/group-row.js +115 -0
  109. package/dist/lib/group-row.js.map +1 -0
  110. package/dist/lib/grouped-chip.js +45 -0
  111. package/dist/lib/grouped-chip.js.map +1 -0
  112. package/dist/lib/hovercard.js +194 -0
  113. package/dist/lib/hovercard.js.map +1 -0
  114. package/dist/lib/icon.js +82 -0
  115. package/dist/lib/icon.js.map +1 -0
  116. package/dist/lib/image-viewer.js +171 -0
  117. package/dist/lib/image-viewer.js.map +1 -0
  118. package/dist/lib/input-group.js +90 -0
  119. package/dist/lib/input-group.js.map +1 -0
  120. package/dist/lib/input.js +455 -0
  121. package/dist/lib/input.js.map +1 -0
  122. package/dist/lib/item-layout.js +39 -0
  123. package/dist/lib/item-layout.js.map +1 -0
  124. package/dist/lib/ivr-node.js +195 -0
  125. package/dist/lib/ivr-node.js.map +1 -0
  126. package/dist/lib/keyboard-shortcut.js +100 -0
  127. package/dist/lib/keyboard-shortcut.js.map +1 -0
  128. package/dist/lib/lazy-show.js +77 -0
  129. package/dist/lib/lazy-show.js.map +1 -0
  130. package/dist/lib/link.js +69 -0
  131. package/dist/lib/link.js.map +1 -0
  132. package/dist/lib/list-item-group.js +59 -0
  133. package/dist/lib/list-item-group.js.map +1 -0
  134. package/dist/lib/list-item.js +195 -0
  135. package/dist/lib/list-item.js.map +1 -0
  136. package/dist/{message_input.js → lib/message-input.js} +107 -56
  137. package/dist/lib/message-input.js.map +1 -0
  138. package/dist/lib/mixins.js +17 -0
  139. package/dist/lib/mixins.js.map +1 -0
  140. package/dist/lib/modal.js +324 -0
  141. package/dist/lib/modal.js.map +1 -0
  142. package/dist/lib/notice.js +158 -0
  143. package/dist/lib/notice.js.map +1 -0
  144. package/dist/lib/pagination.js +142 -0
  145. package/dist/lib/pagination.js.map +1 -0
  146. package/dist/lib/popover.js +779 -0
  147. package/dist/lib/popover.js.map +1 -0
  148. package/dist/lib/presence.js +60 -0
  149. package/dist/lib/presence.js.map +1 -0
  150. package/dist/lib/radio-group.js +97 -0
  151. package/dist/lib/radio-group.js.map +1 -0
  152. package/dist/lib/radio.js +111 -0
  153. package/dist/lib/radio.js.map +1 -0
  154. package/dist/lib/rich-text-editor.js +920 -0
  155. package/dist/lib/rich-text-editor.js.map +1 -0
  156. package/dist/lib/root-layout.js +127 -0
  157. package/dist/lib/root-layout.js.map +1 -0
  158. package/dist/lib/select-menu.js +243 -0
  159. package/dist/lib/select-menu.js.map +1 -0
  160. package/dist/lib/settings-menu-button.js +65 -0
  161. package/dist/lib/settings-menu-button.js.map +1 -0
  162. package/dist/lib/skeleton.js +574 -0
  163. package/dist/lib/skeleton.js.map +1 -0
  164. package/dist/lib/stack.js +118 -0
  165. package/dist/lib/stack.js.map +1 -0
  166. package/dist/lib/tabs.js +93 -0
  167. package/dist/lib/tabs.js.map +1 -0
  168. package/dist/lib/time-pill.js +43 -0
  169. package/dist/lib/time-pill.js.map +1 -0
  170. package/dist/lib/toast.js +226 -0
  171. package/dist/lib/toast.js.map +1 -0
  172. package/dist/lib/toggle.js +169 -0
  173. package/dist/lib/toggle.js.map +1 -0
  174. package/dist/{directives.js → lib/tooltip-directive.js} +24 -18
  175. package/dist/lib/tooltip-directive.js.map +1 -0
  176. package/dist/lib/tooltip.js +376 -0
  177. package/dist/lib/tooltip.js.map +1 -0
  178. package/dist/lib/top-banner-info.js +60 -0
  179. package/dist/lib/top-banner-info.js.map +1 -0
  180. package/dist/lib/unread-pill.js +61 -0
  181. package/dist/lib/unread-pill.js.map +1 -0
  182. package/dist/lib/utils.js +175 -0
  183. package/dist/lib/utils.js.map +1 -0
  184. package/dist/lib/validation-messages.js +83 -0
  185. package/dist/lib/validation-messages.js.map +1 -0
  186. package/dist/lib/validators.js +12 -0
  187. package/dist/lib/validators.js.map +1 -0
  188. package/dist/style.css +1 -1
  189. package/dist/types/common/{constants.d.ts → constants/index.d.ts} +1 -1
  190. package/dist/types/common/constants/index.d.ts.map +1 -0
  191. package/dist/types/common/{dates.d.ts → dates/index.d.ts} +1 -1
  192. package/dist/types/common/dates/index.d.ts.map +1 -0
  193. package/dist/types/common/{emoji.d.ts → emoji/index.d.ts} +1 -1
  194. package/dist/types/common/{emoji.d.ts.map → emoji/index.d.ts.map} +1 -1
  195. package/dist/types/common/{utils.d.ts → utils/index.d.ts} +1 -1
  196. package/dist/types/common/utils/index.d.ts.map +1 -0
  197. package/dist/types/common/{validators.d.ts → validators/index.d.ts} +1 -1
  198. package/dist/types/common/validators/index.d.ts.map +1 -0
  199. package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
  200. package/dist/types/components/button/button.vue.d.ts +2 -2
  201. package/dist/types/components/card/card.vue.d.ts +1 -1
  202. package/dist/types/components/checkbox/checkbox.vue.d.ts +7 -7
  203. package/dist/types/components/checkbox/checkbox.vue.d.ts.map +1 -1
  204. package/dist/types/components/chip/chip.vue.d.ts +2 -2
  205. package/dist/types/components/collapsible/collapsible.vue.d.ts +3 -3
  206. package/dist/types/components/combobox/combobox.vue.d.ts +7 -8
  207. package/dist/types/components/combobox/combobox.vue.d.ts.map +1 -1
  208. package/dist/types/components/dropdown/dropdown.vue.d.ts +1 -1
  209. package/dist/types/components/emoji/emoji.vue.d.ts +1 -1
  210. package/dist/types/components/emoji_picker/modules/emoji_selector.vue.d.ts +1 -219
  211. package/dist/types/components/icon/icon.vue.d.ts +20 -16
  212. package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
  213. package/dist/types/components/icon/icon_constants.d.ts +2 -0
  214. package/dist/types/components/icon/icon_constants.d.ts.map +1 -1
  215. package/dist/types/components/icon/index.d.ts +1 -1
  216. package/dist/types/components/input_group/input_group.vue.d.ts +15 -6
  217. package/dist/types/components/input_group/input_group.vue.d.ts.map +1 -1
  218. package/dist/types/components/list_item_group/list_item_group.vue.d.ts +1 -1
  219. package/dist/types/components/modal/modal.vue.d.ts +7 -2
  220. package/dist/types/components/modal/modal.vue.d.ts.map +1 -1
  221. package/dist/types/components/notice/notice_action.vue.d.ts +3 -1
  222. package/dist/types/components/notice/notice_action.vue.d.ts.map +1 -1
  223. package/dist/types/components/popover/popover_header_footer.vue.d.ts +1 -1
  224. package/dist/types/components/radio/radio.vue.d.ts +2 -12
  225. package/dist/types/components/radio/radio.vue.d.ts.map +1 -1
  226. package/dist/types/components/skeleton/skeleton-list-item.vue.d.ts +1 -1
  227. package/dist/types/components/skeleton/skeleton-paragraph.vue.d.ts +3 -3
  228. package/dist/types/components/skeleton/skeleton-shape.vue.d.ts +2 -2
  229. package/dist/types/components/skeleton/skeleton-text.vue.d.ts +8 -3
  230. package/dist/types/components/skeleton/skeleton-text.vue.d.ts.map +1 -1
  231. package/dist/types/components/skeleton/skeleton.vue.d.ts +1 -1
  232. package/dist/types/components/toggle/toggle.vue.d.ts +1 -1
  233. package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
  234. package/dist/types/index.d.ts +36 -29
  235. package/dist/types/recipes/buttons/callbar_button/callbar_button.vue.d.ts +1 -1
  236. package/dist/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +2 -2
  237. package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
  238. package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +2 -2
  239. package/package.json +18 -58
  240. package/CHANGELOG.json +0 -1
  241. package/CHANGELOG.md +0 -2904
  242. package/dist/dialtone-vue.cjs +0 -6
  243. package/dist/dialtone-vue.cjs.map +0 -1
  244. package/dist/directives.cjs +0 -2
  245. package/dist/directives.cjs.map +0 -1
  246. package/dist/directives.js.map +0 -1
  247. package/dist/emoji.cjs +0 -2
  248. package/dist/emoji.cjs.map +0 -1
  249. package/dist/emoji.js +0 -36
  250. package/dist/emoji_picker-kiTOKaq8.js.map +0 -1
  251. package/dist/emoji_picker-njWWAm6V.cjs +0 -2
  252. package/dist/emoji_picker-njWWAm6V.cjs.map +0 -1
  253. package/dist/emoji_text_wrapper-48ClwKvf.js.map +0 -1
  254. package/dist/emoji_text_wrapper-ZlynvHnd.cjs +0 -2
  255. package/dist/emoji_text_wrapper-ZlynvHnd.cjs.map +0 -1
  256. package/dist/index-OF94C6nQ.js +0 -142834
  257. package/dist/index-OF94C6nQ.js.map +0 -1
  258. package/dist/index-Wx7Jagcr.cjs +0 -2
  259. package/dist/index-Wx7Jagcr.cjs.map +0 -1
  260. package/dist/message_input.cjs +0 -2
  261. package/dist/message_input.cjs.map +0 -1
  262. package/dist/message_input.js.map +0 -1
  263. package/dist/rich_text_editor-RVMsCB8N.cjs +0 -98
  264. package/dist/rich_text_editor-RVMsCB8N.cjs.map +0 -1
  265. package/dist/rich_text_editor-eMvTs_Gp.js +0 -16479
  266. package/dist/rich_text_editor-eMvTs_Gp.js.map +0 -1
  267. package/dist/tooltip-88U5vFMA.js +0 -2517
  268. package/dist/tooltip-88U5vFMA.js.map +0 -1
  269. package/dist/tooltip-i2wxFIIi.cjs +0 -22
  270. package/dist/tooltip-i2wxFIIi.cjs.map +0 -1
  271. package/dist/types/common/constants.d.ts.map +0 -1
  272. package/dist/types/common/dates.d.ts.map +0 -1
  273. package/dist/types/common/utils.d.ts.map +0 -1
  274. package/dist/types/common/validators.d.ts.map +0 -1
  275. package/dist/types/components/emoji_picker/emojis/index.d.ts +0 -50
  276. package/dist/types/components/emoji_picker/emojis/index.d.ts.map +0 -1
  277. package/dist/types/directives.d.ts +0 -2
  278. package/dist/types/directives.d.ts.map +0 -1
  279. package/dist/types/emoji.d.ts +0 -5
  280. package/dist/types/emoji.d.ts.map +0 -1
  281. package/dist/types/message_input.d.ts +0 -3
  282. package/dist/types/message_input.d.ts.map +0 -1
@@ -0,0 +1,372 @@
1
+ import { K as l } from "./keyboard_list_navigation-F0O8nht0.js";
2
+ import { getUniqueString as r } from "../lib/utils.js";
3
+ import { n } from "./_plugin-vue2_normalizer-u6G_3nkj.js";
4
+ import { DtListItem as o } from "../lib/list-item.js";
5
+ import { DtSkeleton as a } from "../lib/skeleton.js";
6
+ const d = {
7
+ name: "ComboboxLoadingList",
8
+ components: { DtListItem: o, DtSkeleton: a }
9
+ };
10
+ var h = function() {
11
+ var t = this, s = t._self._c;
12
+ return s("ol", { staticClass: "d-combobox__loading-list", attrs: { "aria-busy": "true" } }, t._l(7, function(e) {
13
+ return s("dt-list-item", { key: e, attrs: { role: "option", "navigation-type": "none" } }, [s("dt-skeleton", { attrs: { "text-option": { type: "body" }, offset: 0 } })], 1);
14
+ }), 1);
15
+ }, p = [], u = /* @__PURE__ */ n(
16
+ d,
17
+ h,
18
+ p,
19
+ !1,
20
+ null,
21
+ null,
22
+ null,
23
+ null
24
+ );
25
+ const m = u.exports, g = {
26
+ name: "ComboboxEmptyList",
27
+ components: { DtListItem: o },
28
+ props: {
29
+ /**
30
+ * Message to display when list is empty
31
+ */
32
+ message: {
33
+ type: String,
34
+ required: !0
35
+ },
36
+ /**
37
+ * Additional class name for the empty list element.
38
+ * Can accept all of String, Object, and Array, i.e. has the
39
+ * same api as Vue's built-in handling of the class attribute.
40
+ */
41
+ itemClass: {
42
+ type: [String, Object, Array],
43
+ default: ""
44
+ }
45
+ }
46
+ };
47
+ var f = function() {
48
+ var t = this, s = t._self._c;
49
+ return s("ol", { staticClass: "d-combobox__empty-list", attrs: { "data-qa": "dt-combobox-empty-list" } }, [t._t("default", function() {
50
+ return [s("dt-list-item", { class: ["dt-empty-list-item", t.itemClass], attrs: { role: "option", "navigation-type": "none", type: "custom" } }, [s("span", [t._v(t._s(t.message))])])];
51
+ })], 2);
52
+ }, c = [], y = /* @__PURE__ */ n(
53
+ g,
54
+ f,
55
+ c,
56
+ !1,
57
+ null,
58
+ null,
59
+ null,
60
+ null
61
+ );
62
+ const _ = y.exports, b = {
63
+ EXTRA_SMALL: "xs",
64
+ SMALL: "sm",
65
+ DEFAULT: "md",
66
+ LARGE: "lg",
67
+ EXTRA_LARGE: "xl"
68
+ }, L = {
69
+ name: "DtCombobox",
70
+ components: {
71
+ ComboboxLoadingList: m,
72
+ ComboboxEmptyList: _
73
+ },
74
+ mixins: [
75
+ l({
76
+ indexKey: "highlightIndex",
77
+ idKey: "highlightId",
78
+ listElementKey: "getListElement",
79
+ afterHighlightMethod: "afterHighlight",
80
+ beginningOfListMethod: "beginningOfListMethod",
81
+ endOfListMethod: "endOfListMethod",
82
+ activeItemKey: "activeItemEl"
83
+ })
84
+ ],
85
+ props: {
86
+ /**
87
+ * String to use for the input label.
88
+ */
89
+ label: {
90
+ type: String,
91
+ required: !0
92
+ },
93
+ /**
94
+ * Determines visibility of input label.
95
+ * @values true, false
96
+ */
97
+ labelVisible: {
98
+ type: Boolean,
99
+ default: !0
100
+ },
101
+ /**
102
+ * Size of the input, one of `xs`, `sm`, `md`, `lg`, `xl`
103
+ * @values null, xs, sm, md, lg, xl
104
+ */
105
+ size: {
106
+ type: String,
107
+ default: null,
108
+ validator: (i) => Object.values(b).includes(i)
109
+ },
110
+ /**
111
+ * Description for the input
112
+ */
113
+ description: {
114
+ type: String,
115
+ default: ""
116
+ },
117
+ /**
118
+ * Sets an ID on the list element of the component. Used by several aria attributes
119
+ * as well as when deriving the IDs for each item.
120
+ */
121
+ listId: {
122
+ type: String,
123
+ default() {
124
+ return r();
125
+ }
126
+ },
127
+ /**
128
+ * A method that will be called when the selection goes past the beginning of the list.
129
+ */
130
+ onBeginningOfList: {
131
+ type: Function,
132
+ default: null
133
+ },
134
+ /**
135
+ * A method that will be called when the selection goes past the end of the list.
136
+ */
137
+ onEndOfList: {
138
+ type: Function,
139
+ default: null
140
+ },
141
+ /**
142
+ * Determines when to show the list element and also controls the aria-expanded attribute.
143
+ * @values true, false
144
+ */
145
+ showList: {
146
+ type: Boolean,
147
+ default: !1
148
+ },
149
+ /**
150
+ * If the list is rendered outside the component, like when using popover as the list wrapper.
151
+ * @values true, false
152
+ */
153
+ listRenderedOutside: {
154
+ type: Boolean,
155
+ default: !1
156
+ },
157
+ /**
158
+ * Determines when to show the skeletons and also controls aria-busy attribute.
159
+ * @values true, false
160
+ */
161
+ loading: {
162
+ type: Boolean,
163
+ default: !1
164
+ },
165
+ /**
166
+ * Sets the list to an empty state, and displays the message from prop `emptyStateMessage`.
167
+ * @values true, false
168
+ */
169
+ emptyList: {
170
+ type: Boolean,
171
+ default: !1
172
+ },
173
+ /**
174
+ * Message to show when the list is empty
175
+ */
176
+ emptyStateMessage: {
177
+ type: String,
178
+ default: ""
179
+ },
180
+ /**
181
+ * Additional class name for the empty list element.
182
+ * Can accept all of String, Object, and Array, i.e. has the
183
+ * same api as Vue's built-in handling of the class attribute.
184
+ */
185
+ emptyStateClass: {
186
+ type: [String, Object, Array],
187
+ default: ""
188
+ },
189
+ /**
190
+ * Programmatically click on the active list item element when a selection
191
+ * comes from keyboard navigation, i.e. pressing the "Enter" key.
192
+ * @values true, false
193
+ */
194
+ clickOnSelect: {
195
+ type: Boolean,
196
+ default: !1
197
+ }
198
+ },
199
+ emits: [
200
+ /**
201
+ * Event fired when item selected
202
+ *
203
+ * @event select
204
+ * @type {Number}
205
+ */
206
+ "select",
207
+ /**
208
+ * Event fired when pressing escape
209
+ *
210
+ * @event escape
211
+ */
212
+ "escape",
213
+ /**
214
+ * Event fired when the highlight changes
215
+ *
216
+ * @event highlight
217
+ * @type {Number}
218
+ */
219
+ "highlight",
220
+ /**
221
+ * Event fired when list is shown or hidden
222
+ *
223
+ * @event opened
224
+ * @type {Boolean}
225
+ */
226
+ "opened"
227
+ ],
228
+ data() {
229
+ return {
230
+ // If the list is rendered at the root, rather than as a child
231
+ // of this component, this is the ref to that dom element. Set
232
+ // by the onOpen method.
233
+ outsideRenderedListRef: null
234
+ };
235
+ },
236
+ computed: {
237
+ inputProps() {
238
+ return {
239
+ label: this.label,
240
+ labelVisible: this.labelVisible,
241
+ size: this.size,
242
+ description: this.description,
243
+ role: "combobox",
244
+ "aria-label": this.label,
245
+ "aria-expanded": this.showList.toString(),
246
+ "aria-owns": this.listId,
247
+ "aria-haspopup": "listbox",
248
+ "aria-activedescendant": this.activeItemId,
249
+ "aria-controls": this.listId
250
+ };
251
+ },
252
+ listProps() {
253
+ return {
254
+ role: "listbox",
255
+ id: this.listId,
256
+ // The list has to be positioned relatively so that the auto-scroll can
257
+ // calculate the correct offset for the list items.
258
+ class: "d-ps-relative",
259
+ "aria-label": this.label
260
+ };
261
+ },
262
+ beginningOfListMethod() {
263
+ return this.onBeginningOfList || this.jumpToEnd;
264
+ },
265
+ endOfListMethod() {
266
+ return this.onEndOfList || this.jumpToBeginning;
267
+ },
268
+ activeItemId() {
269
+ if (!(!this.showList || this.highlightIndex < 0 || this.loading))
270
+ return this.highlightId;
271
+ },
272
+ activeItemEl() {
273
+ return this.highlightId ? this.getListElement().querySelector("#" + this.highlightId) : "";
274
+ }
275
+ },
276
+ watch: {
277
+ showList(i) {
278
+ this.listRenderedOutside || (this.setInitialHighlightIndex(), this.$emit("opened", i)), !i && this.outsideRenderedListRef && (this.outsideRenderedListRef.removeEventListener("mousemove", this.onMouseHighlight), this.outsideRenderedListRef = null);
279
+ },
280
+ loading(i) {
281
+ this.$nextTick(() => {
282
+ this.setInitialHighlightIndex();
283
+ });
284
+ },
285
+ $props: {
286
+ deep: !0,
287
+ immediate: !0,
288
+ handler() {
289
+ this.validateEmptyListProps();
290
+ }
291
+ }
292
+ },
293
+ created() {
294
+ this.validateEmptyListProps();
295
+ },
296
+ methods: {
297
+ onMouseHighlight(i) {
298
+ if (this.loading)
299
+ return;
300
+ const t = i.target.closest("li");
301
+ t && this.highlightId !== t.id && this.setHighlightId(t.id);
302
+ },
303
+ getListElement() {
304
+ var i;
305
+ return this.outsideRenderedListRef ?? ((i = this.$refs.listWrapper) == null ? void 0 : i.querySelector(`#${this.listId}`));
306
+ },
307
+ clearHighlightIndex() {
308
+ this.showList && this.setHighlightIndex(-1);
309
+ },
310
+ afterHighlight() {
311
+ this.loading || this.$emit("highlight", this.highlightIndex);
312
+ },
313
+ onEnterKey() {
314
+ var i;
315
+ this.loading || this.emptyList || this.highlightIndex >= 0 && (this.$emit("select", this.highlightIndex), this.clickOnSelect && ((i = this.activeItemEl) == null || i.click()));
316
+ },
317
+ onEscapeKey() {
318
+ this.$emit("escape");
319
+ },
320
+ onOpen(i, t) {
321
+ var s;
322
+ this.outsideRenderedListRef = t, (s = this.outsideRenderedListRef) == null || s.addEventListener("mousemove", this.onMouseHighlight), this.$emit("opened", i), i && this.setInitialHighlightIndex();
323
+ },
324
+ onKeyValidation(i, t) {
325
+ !this.showList || !this.getListElement() || this[t](i);
326
+ },
327
+ setInitialHighlightIndex() {
328
+ this.showList && this.$nextTick(() => {
329
+ this.setHighlightIndex(this.loading ? -1 : 0);
330
+ });
331
+ },
332
+ validateEmptyListProps() {
333
+ this.$slots.emptyListItem || (this.emptyList && !this.emptyStateMessage || !this.emptyList && this.emptyStateMessage) && console.error(`Invalid props: you must pass both props emptyList and emptyStateMessage to show the
334
+ empty message.`);
335
+ }
336
+ }
337
+ };
338
+ var x = function() {
339
+ var t = this, s = t._self._c;
340
+ return s("div", { on: { keydown: [function(e) {
341
+ return !e.type.indexOf("key") && t._k(e.keyCode, "esc", 27, e.key, ["Esc", "Escape"]) ? null : (e.stopPropagation(), t.onKeyValidation(e, "onEscapeKey"));
342
+ }, function(e) {
343
+ return !e.type.indexOf("key") && t._k(e.keyCode, "enter", 13, e.key, "Enter") || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey ? null : t.onKeyValidation(e, "onEnterKey");
344
+ }, function(e) {
345
+ return !e.type.indexOf("key") && t._k(e.keyCode, "up", 38, e.key, ["Up", "ArrowUp"]) ? null : (e.stopPropagation(), e.preventDefault(), t.onKeyValidation(e, "onUpKey"));
346
+ }, function(e) {
347
+ return !e.type.indexOf("key") && t._k(e.keyCode, "down", 40, e.key, ["Down", "ArrowDown"]) ? null : (e.stopPropagation(), e.preventDefault(), t.onKeyValidation(e, "onDownKey"));
348
+ }, function(e) {
349
+ return !e.type.indexOf("key") && t._k(e.keyCode, "home", void 0, e.key, void 0) ? null : (e.stopPropagation(), e.preventDefault(), t.onKeyValidation(e, "onHomeKey"));
350
+ }, function(e) {
351
+ return !e.type.indexOf("key") && t._k(e.keyCode, "end", void 0, e.key, void 0) ? null : (e.stopPropagation(), e.preventDefault(), t.onKeyValidation(e, "onEndKey"));
352
+ }] } }, [s("div", { attrs: { "data-qa": "dt-combobox-input-wrapper" } }, [t._t("input", null, { inputProps: t.inputProps })], 2), t.showList ? s("div", { ref: "listWrapper", attrs: { "data-qa": "dt-combobox-list-wrapper" }, on: { mouseleave: t.clearHighlightIndex, focusout: t.clearHighlightIndex, "!mousemove": function(e) {
353
+ return t.onMouseHighlight.apply(null, arguments);
354
+ } } }, [t.loading && !t.listRenderedOutside ? s("combobox-loading-list", t._b({}, "combobox-loading-list", t.listProps, !1)) : t.emptyList && (t.emptyStateMessage || t.$slots.emptyListItem) && !t.listRenderedOutside ? s("combobox-empty-list", t._b({ attrs: { message: t.emptyStateMessage, "item-class": t.emptyStateClass } }, "combobox-empty-list", t.listProps, !1), [t._t("emptyListItem")], 2) : t._t("list", null, { listProps: t.listProps, opened: t.onOpen, clearHighlightIndex: t.clearHighlightIndex })], 2) : t._e()]);
355
+ }, I = [], E = /* @__PURE__ */ n(
356
+ L,
357
+ x,
358
+ I,
359
+ !1,
360
+ null,
361
+ null,
362
+ null,
363
+ null
364
+ );
365
+ const C = E.exports;
366
+ export {
367
+ m as C,
368
+ C as D,
369
+ b as L,
370
+ _ as a
371
+ };
372
+ //# sourceMappingURL=index-nIyl_PL6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-nIyl_PL6.js","sources":["../../components/combobox/combobox_loading-list.vue","../../components/combobox/combobox_empty-list.vue","../../components/combobox/combobox_constants.js","../../components/combobox/combobox.vue"],"sourcesContent":["<template>\n <ol\n class=\"d-combobox__loading-list\"\n aria-busy=\"true\"\n >\n <dt-list-item\n v-for=\"index in 7\"\n :key=\"index\"\n role=\"option\"\n navigation-type=\"none\"\n >\n <dt-skeleton\n :text-option=\"{ type: 'body' }\"\n :offset=\"0\"\n />\n </dt-list-item>\n </ol>\n</template>\n\n<script>\nimport { DtListItem } from '../list_item';\nimport { DtSkeleton } from '../skeleton';\n\nexport default {\n name: 'ComboboxLoadingList',\n\n components: { DtListItem, DtSkeleton },\n};\n</script>\n","<template>\n <ol\n class=\"d-combobox__empty-list\"\n data-qa=\"dt-combobox-empty-list\"\n >\n <slot>\n <dt-list-item\n role=\"option\"\n navigation-type=\"none\"\n type=\"custom\"\n :class=\"['dt-empty-list-item', itemClass]\"\n >\n <span>{{ message }}</span>\n </dt-list-item>\n </slot>\n </ol>\n</template>\n\n<script>\nimport { DtListItem } from '../list_item';\n\nexport default {\n name: 'ComboboxEmptyList',\n\n components: { DtListItem },\n\n props: {\n /**\n * Message to display when list is empty\n */\n message: {\n type: String,\n required: true,\n },\n\n /**\n * Additional class name for the empty list element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n itemClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n};\n</script>\n\n<style lang=\"less\">\n.dt-empty-list-item {\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--dt-font-size-200);\n line-height: var(--lh4);\n padding: var(--dt-space-300) var(--dt-space-450);\n}\n</style>\n","export const LABEL_SIZES = {\n EXTRA_SMALL: 'xs',\n SMALL: 'sm',\n DEFAULT: 'md',\n LARGE: 'lg',\n EXTRA_LARGE: 'xl',\n};\n\nexport default {\n LABEL_SIZES,\n};\n","<!-- eslint-disable vuejs-accessibility/no-static-element-interactions -->\n<template>\n <div\n @keydown.esc.stop=\"onKeyValidation($event, 'onEscapeKey')\"\n @keydown.enter.exact=\"onKeyValidation($event, 'onEnterKey')\"\n @keydown.up.stop.prevent=\"onKeyValidation($event, 'onUpKey')\"\n @keydown.down.stop.prevent=\"onKeyValidation($event, 'onDownKey')\"\n @keydown.home.stop.prevent=\"onKeyValidation($event, 'onHomeKey')\"\n @keydown.end.stop.prevent=\"onKeyValidation($event, 'onEndKey')\"\n >\n <div data-qa=\"dt-combobox-input-wrapper\">\n <!-- @slot Slot for the combobox input element -->\n <slot\n name=\"input\"\n :input-props=\"inputProps\"\n />\n </div>\n\n <div\n v-if=\"showList\"\n ref=\"listWrapper\"\n data-qa=\"dt-combobox-list-wrapper\"\n @mouseleave=\"clearHighlightIndex\"\n @focusout=\"clearHighlightIndex\"\n @mousemove.capture=\"onMouseHighlight\"\n >\n <combobox-loading-list\n v-if=\"loading && !listRenderedOutside\"\n v-bind=\"listProps\"\n />\n <combobox-empty-list\n v-else-if=\"emptyList && (emptyStateMessage || $slots.emptyListItem) && !listRenderedOutside\"\n v-bind=\"listProps\"\n :message=\"emptyStateMessage\"\n :item-class=\"emptyStateClass\"\n >\n <slot name=\"emptyListItem\" />\n </combobox-empty-list>\n <!-- @slot Slot for the combobox list element -->\n <slot\n v-else\n name=\"list\"\n :list-props=\"listProps\"\n :opened=\"onOpen\"\n :clear-highlight-index=\"clearHighlightIndex\"\n />\n </div>\n </div>\n</template>\n\n<script>\nimport KeyboardNavigation from '@/common/mixins/keyboard_list_navigation';\nimport { getUniqueString } from '@/common/utils';\nimport ComboboxLoadingList from './combobox_loading-list.vue';\nimport ComboboxEmptyList from './combobox_empty-list.vue';\nimport { LABEL_SIZES } from '@/components/combobox/combobox_constants';\n\n/**\n * A combobox is a semantic component that displays an input element combined with a listbox,\n * which enables the user to select items from the list.\n * @see https://dialtone.dialpad.com/components/combobox.html\n */\nexport default {\n name: 'DtCombobox',\n\n components: {\n ComboboxLoadingList,\n ComboboxEmptyList,\n },\n\n mixins: [\n KeyboardNavigation({\n indexKey: 'highlightIndex',\n idKey: 'highlightId',\n listElementKey: 'getListElement',\n afterHighlightMethod: 'afterHighlight',\n beginningOfListMethod: 'beginningOfListMethod',\n endOfListMethod: 'endOfListMethod',\n activeItemKey: 'activeItemEl',\n }),\n ],\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the input, one of `xs`, `sm`, `md`, `lg`, `xl`\n * @values null, xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: null,\n validator: (t) => Object.values(LABEL_SIZES).includes(t),\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Sets an ID on the list element of the component. Used by several aria attributes\n * as well as when deriving the IDs for each item.\n */\n listId: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * A method that will be called when the selection goes past the beginning of the list.\n */\n onBeginningOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * A method that will be called when the selection goes past the end of the list.\n */\n onEndOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * @values true, false\n */\n showList: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If the list is rendered outside the component, like when using popover as the list wrapper.\n * @values true, false\n */\n listRenderedOutside: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines when to show the skeletons and also controls aria-busy attribute.\n * @values true, false\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the list to an empty state, and displays the message from prop `emptyStateMessage`.\n * @values true, false\n */\n emptyList: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Message to show when the list is empty\n */\n emptyStateMessage: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the empty list element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n emptyStateClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Programmatically click on the active list item element when a selection\n * comes from keyboard navigation, i.e. pressing the \"Enter\" key.\n * @values true, false\n */\n clickOnSelect: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when pressing escape\n *\n * @event escape\n */\n 'escape',\n\n /**\n * Event fired when the highlight changes\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\n\n /**\n * Event fired when list is shown or hidden\n *\n * @event opened\n * @type {Boolean}\n */\n 'opened',\n ],\n\n data () {\n return {\n // If the list is rendered at the root, rather than as a child\n // of this component, this is the ref to that dom element. Set\n // by the onOpen method.\n outsideRenderedListRef: null,\n };\n },\n\n computed: {\n inputProps () {\n return {\n label: this.label,\n labelVisible: this.labelVisible,\n size: this.size,\n description: this.description,\n role: 'combobox',\n 'aria-label': this.label,\n 'aria-expanded': this.showList.toString(),\n 'aria-owns': this.listId,\n 'aria-haspopup': 'listbox',\n 'aria-activedescendant': this.activeItemId,\n 'aria-controls': this.listId,\n };\n },\n\n listProps () {\n return {\n role: 'listbox',\n id: this.listId,\n // The list has to be positioned relatively so that the auto-scroll can\n // calculate the correct offset for the list items.\n class: 'd-ps-relative',\n 'aria-label': this.label,\n };\n },\n\n beginningOfListMethod () {\n return this.onBeginningOfList || this.jumpToEnd;\n },\n\n endOfListMethod () {\n return this.onEndOfList || this.jumpToBeginning;\n },\n\n activeItemId () {\n if (!this.showList || this.highlightIndex < 0 || this.loading) {\n return;\n }\n return this.highlightId;\n },\n\n activeItemEl () {\n if (!this.highlightId) return '';\n return this.getListElement().querySelector('#' + this.highlightId);\n },\n },\n\n watch: {\n showList (showList) {\n // When the list's visibility changes reset the highlight index.\n\n if (!this.listRenderedOutside) {\n this.setInitialHighlightIndex();\n this.$emit('opened', showList);\n }\n\n if (!showList && this.outsideRenderedListRef) {\n this.outsideRenderedListRef.removeEventListener('mousemove', this.onMouseHighlight);\n this.outsideRenderedListRef = null;\n }\n },\n\n loading (loading) {\n this.$nextTick(() => {\n this.setInitialHighlightIndex();\n });\n },\n\n $props: {\n deep: true,\n immediate: true,\n handler () {\n this.validateEmptyListProps();\n },\n },\n },\n\n created () {\n this.validateEmptyListProps();\n },\n\n methods: {\n onMouseHighlight (e) {\n if (this.loading) return;\n\n const liElement = e.target.closest('li');\n\n if (liElement && this.highlightId !== liElement.id) {\n this.setHighlightId(liElement.id);\n }\n },\n\n getListElement () {\n return this.outsideRenderedListRef ?? this.$refs.listWrapper?.querySelector(`#${this.listId}`);\n },\n\n clearHighlightIndex () {\n if (this.showList) {\n this.setHighlightIndex(-1);\n }\n },\n\n afterHighlight () {\n if (this.loading) return;\n this.$emit('highlight', this.highlightIndex);\n },\n\n onEnterKey () {\n if (this.loading || this.emptyList) return;\n\n if (this.highlightIndex >= 0) {\n this.$emit('select', this.highlightIndex);\n\n if (this.clickOnSelect) {\n this.activeItemEl?.click();\n }\n }\n },\n\n onEscapeKey () {\n this.$emit('escape');\n },\n\n onOpen (open, contentRef) {\n this.outsideRenderedListRef = contentRef;\n this.outsideRenderedListRef?.addEventListener('mousemove', this.onMouseHighlight);\n this.$emit('opened', open);\n\n if (open) {\n this.setInitialHighlightIndex();\n }\n },\n\n onKeyValidation (e, eventHandler) {\n if (!this.showList || !this.getListElement()) return;\n\n this[eventHandler](e);\n },\n\n setInitialHighlightIndex () {\n if (!this.showList) return;\n this.$nextTick(() => {\n // When the list's is shown, reset the highlight index.\n // If the list is loading, set to -1\n this.setHighlightIndex(this.loading ? -1 : 0);\n });\n },\n\n validateEmptyListProps () {\n if (this.$slots.emptyListItem) { return; }\n\n if ((this.emptyList && !this.emptyStateMessage) || (!this.emptyList && this.emptyStateMessage)) {\n console.error(`Invalid props: you must pass both props emptyList and emptyStateMessage to show the\n empty message.`);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtListItem","DtSkeleton","LABEL_SIZES","ComboboxLoadingList","ComboboxEmptyList","KeyboardNavigation","t","getUniqueString","showList","loading","e","liElement","_a","open","contentRef","eventHandler"],"mappings":";;;;;AAuBA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,YAAAC,GAAA,YAAAC,EAAA;AACA;;;;;;;;;;;;;;;;qBCNAF,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA,EAAA,YAAAC,EAAA;AAAA,EAEA,OA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y.json";
3
+ import { n as D } from "./_plugin-vue2_normalizer-u6G_3nkj.js";
4
+ import { DtSkeleton as v } from "../lib/skeleton.js";
5
+ import { I as c } from "./icon_constants-OpYAAKwF.js";
6
+ const _ = "6.6", u = "https://cdn.jsdelivr.net/joypixels/assets/" + _ + "/png/unicode/32/";
7
+ let d = null, f = u, j = ".png", h = u, g = ".png";
8
+ const r = y;
9
+ function L() {
10
+ return r;
11
+ }
12
+ function T(t, e = ".png") {
13
+ t.endsWith("/") || (t = t + "/"), f = t, j = e;
14
+ }
15
+ function F(t, e = ".svg") {
16
+ t.endsWith("/") || (t = t + "/"), h = t, g = e;
17
+ }
18
+ function J(t) {
19
+ d = t;
20
+ }
21
+ function W(t) {
22
+ w(t);
23
+ }
24
+ function w(t) {
25
+ const e = ["extension", "custom"], i = [
26
+ "name",
27
+ "category",
28
+ "shortname",
29
+ "extension",
30
+ "custom"
31
+ ], o = (s, n, a) => {
32
+ if (s[n] === void 0) {
33
+ if (!e.includes(n))
34
+ return;
35
+ s[n] = a;
36
+ } else
37
+ Array.isArray(s[n]) ? s[n] = s[n].concat(a) : s[n] = a;
38
+ };
39
+ Object.entries(t).forEach((s) => {
40
+ const [n, a] = s;
41
+ if (n in r) {
42
+ const l = r[n];
43
+ for (const m in a) {
44
+ const E = a[m];
45
+ o(l, m, E);
46
+ }
47
+ } else
48
+ i.every((m) => a[m] !== void 0) ? r[n] = a : console.error(
49
+ "The following custom emoji doesn't contain the required properties:",
50
+ a
51
+ );
52
+ });
53
+ }
54
+ function p(t) {
55
+ function e(o, s) {
56
+ if (!(!o || typeof o != "object")) {
57
+ if ("shortname" in o && (o.shortname === t || o.shortname_alternates.includes(t)))
58
+ return o.key = s, i = o, !0;
59
+ Object.keys(o).some(function(n) {
60
+ return e(o[n], n);
61
+ });
62
+ }
63
+ }
64
+ let i;
65
+ return e(L(), null), i;
66
+ }
67
+ function b(t) {
68
+ let e = "";
69
+ for (const i of t) {
70
+ const o = i.codePointAt(0).toString(16).padStart(4, "0");
71
+ ["200d", "fe0f"].includes(o) || (e !== "" && (e = e + "-"), e = e + o);
72
+ }
73
+ return e;
74
+ }
75
+ function k(t) {
76
+ const e = t.split("-");
77
+ let i = "";
78
+ return e.forEach((o) => {
79
+ i = i + String.fromCodePoint(parseInt(o, 16));
80
+ }), i;
81
+ }
82
+ function x(t) {
83
+ if (t.startsWith(":") && t.endsWith(":"))
84
+ return p(t);
85
+ {
86
+ const e = b(t), i = r[e];
87
+ return i && (i.key = e), i;
88
+ }
89
+ }
90
+ function B(t) {
91
+ const e = t.match(/:\w+:/g);
92
+ return A(e);
93
+ }
94
+ function A(t) {
95
+ const e = t ? t.filter((i) => p(i)) : [];
96
+ return new Set(e);
97
+ }
98
+ function K(t) {
99
+ const e = [...t.matchAll(S())], i = e.length ? e.map((o) => o[0]) : [];
100
+ return new Set(i);
101
+ }
102
+ const C = {
103
+ name: "DtEmoji",
104
+ components: {
105
+ DtSkeleton: v
106
+ },
107
+ props: {
108
+ /**
109
+ * Supports shortcode ex: :smile: or unicode ex: 😄. Will display the resulting emoji.
110
+ * <a class="d-link" href="https://emojipedia.org/joypixels/" target="_blank">JoyPixels</a>
111
+ * for all supported shortcode/unicode or the docs for setting up custom emojis.
112
+ */
113
+ code: {
114
+ type: String,
115
+ required: !0
116
+ },
117
+ /**
118
+ * The size of the emoji. Can be any of the icon size utility classes from
119
+ * <a class="d-link" href="https://dialtone.dialpad.com/components/icon.html" target="_blank"> Dialpad Icon Size</a>
120
+ * @values 100, 200, 300, 400, 500, 600, 700, 800
121
+ */
122
+ size: {
123
+ type: String,
124
+ default: "500",
125
+ validator: (t) => Object.keys(c).includes(t)
126
+ },
127
+ /**
128
+ * Additional class name for the emoji img element.
129
+ * Can accept String, Object, and Array, i.e. has the
130
+ * same API as Vue's built-in handling of the class attribute.
131
+ */
132
+ imgClass: {
133
+ type: [String, Object, Array],
134
+ default: ""
135
+ },
136
+ /**
137
+ * Will be read out on a screen reader for this emoji. You must use this prop if you want your emoji to be i18n
138
+ * Compatible as Dialtone Vue will not translate it by itself. If you do not set this prop the aria-label will
139
+ * be set to the english description of the emoji. You can retrieve the description for an emoji yourself via the
140
+ * getEmojiData() function
141
+ */
142
+ ariaLabel: {
143
+ type: String,
144
+ default: null
145
+ },
146
+ /**
147
+ * Shows a skeleton loader while the emoji asset is loading.
148
+ * @values true, false
149
+ */
150
+ showSkeleton: {
151
+ type: Boolean,
152
+ default: !0
153
+ }
154
+ },
155
+ data() {
156
+ return {
157
+ emojiData: null,
158
+ imgLoading: !1
159
+ };
160
+ },
161
+ computed: {
162
+ emojiDataValid() {
163
+ return !!this.emojiData;
164
+ },
165
+ emojiSrc() {
166
+ var t;
167
+ return this.emojiDataValid ? (t = this.emojiData) != null && t.custom ? d + this.emojiData.key + this.emojiData.extension : ["100", "200"].includes(this.size) ? f + this.emojiData.key + j : h + this.emojiData.key + g : "invalid";
168
+ },
169
+ emojiAlt() {
170
+ if (this.emojiDataValid)
171
+ return this.emojiData.unicode_output ? k(this.emojiData.unicode_output) : this.emojiData.name;
172
+ },
173
+ emojiLabel() {
174
+ return this.emojiDataValid ? this.ariaLabel ? this.ariaLabel : this.emojiData.name : "Invalid Emoji";
175
+ },
176
+ emojiSize() {
177
+ return c[this.size];
178
+ }
179
+ },
180
+ watch: {
181
+ code: {
182
+ handler: function() {
183
+ this.getEmojiData();
184
+ },
185
+ immediate: !0
186
+ },
187
+ emojiSrc: {
188
+ handler: async function() {
189
+ this.imgLoading = !0;
190
+ },
191
+ immediate: !0
192
+ }
193
+ },
194
+ methods: {
195
+ getEmojiData() {
196
+ this.emojiData = x(this.code);
197
+ },
198
+ imageLoaded() {
199
+ this.imgLoading = !1;
200
+ },
201
+ imageErrored() {
202
+ this.imgLoading = !1;
203
+ }
204
+ }
205
+ };
206
+ var I = function() {
207
+ var e = this, i = e._self._c;
208
+ return i("span", { class: ["d-emoji", "d-icon", e.emojiSize] }, [i("dt-skeleton", { directives: [{ name: "show", rawName: "v-show", value: e.imgLoading && e.showSkeleton, expression: "imgLoading && showSkeleton" }], class: ["d-icon", e.emojiSize], attrs: { offset: 0, "shape-option": { shape: "circle", size: "100%" } } }), i("img", { directives: [{ name: "show", rawName: "v-show", value: !e.imgLoading, expression: "!imgLoading" }], ref: "emojiImg", class: ["d-icon", e.emojiSize, e.imgClass], attrs: { "aria-label": e.emojiLabel, alt: e.emojiAlt, title: e.emojiLabel, src: e.emojiSrc }, on: { load: e.imageLoaded, error: e.imageErrored } })], 1);
209
+ }, z = [], P = /* @__PURE__ */ D(
210
+ C,
211
+ I,
212
+ z,
213
+ !1,
214
+ null,
215
+ null,
216
+ null,
217
+ null
218
+ );
219
+ const M = P.exports;
220
+ export {
221
+ M as D,
222
+ f as a,
223
+ j as b,
224
+ d as c,
225
+ u as d,
226
+ _ as e,
227
+ h as f,
228
+ g,
229
+ r as h,
230
+ L as i,
231
+ F as j,
232
+ J as k,
233
+ W as l,
234
+ p as m,
235
+ k as n,
236
+ x as o,
237
+ B as p,
238
+ A as q,
239
+ K as r,
240
+ T as s,
241
+ b as u,
242
+ w as v
243
+ };
244
+ //# sourceMappingURL=index-o4OMWMuv.js.map