@dialpad/dialtone-vue 3.223.0-next.3 → 3.223.0-next.4

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 (387) hide show
  1. package/dist/Combobox-CYEmi3dv.cjs +3 -0
  2. package/dist/Combobox-CYEmi3dv.cjs.map +1 -0
  3. package/dist/{Combobox-By01ETlj.js → Combobox-D8nQeBIf.js} +33 -32
  4. package/dist/Combobox-D8nQeBIf.js.map +1 -0
  5. package/dist/TextList-B6XFfQfD.js +88 -0
  6. package/dist/TextList-B6XFfQfD.js.map +1 -0
  7. package/dist/TextList-Dd-ROFiI.cjs +2 -0
  8. package/dist/TextList-Dd-ROFiI.cjs.map +1 -0
  9. package/dist/TextListItem-DIlrCkaM.cjs +2 -0
  10. package/dist/TextListItem-DIlrCkaM.cjs.map +1 -0
  11. package/dist/TextListItem-ImUi_FWh.js +62 -0
  12. package/dist/TextListItem-ImUi_FWh.js.map +1 -0
  13. package/dist/{Toast-CHbVmbBg.js → Toast-BIHkIpZP.js} +95 -94
  14. package/dist/Toast-BIHkIpZP.js.map +1 -0
  15. package/dist/Toast-D8ARDEgT.cjs +2 -0
  16. package/dist/Toast-D8ARDEgT.cjs.map +1 -0
  17. package/dist/{attachment_carousel-BFIAXWOZ.js → attachment_carousel-CyiexPBk.js} +1 -1
  18. package/dist/{attachment_carousel-BFIAXWOZ.js.map → attachment_carousel-CyiexPBk.js.map} +1 -1
  19. package/dist/{attachment_carousel-BJxqNJ5T.cjs → attachment_carousel-DJqILY7f.cjs} +1 -1
  20. package/dist/{attachment_carousel-BJxqNJ5T.cjs.map → attachment_carousel-DJqILY7f.cjs.map} +1 -1
  21. package/dist/common/mixins/input.d.ts +4 -4
  22. package/dist/common/mixins/input_group.d.ts +2 -2
  23. package/dist/common/sr_only_close_button.vue.d.ts +30 -30
  24. package/dist/common/sr_only_close_button.vue.d.ts.map +1 -1
  25. package/dist/common/validators/index.cjs +1 -1
  26. package/dist/common/validators/index.cjs.map +1 -1
  27. package/dist/common/validators/index.d.ts +2 -0
  28. package/dist/common/validators/index.d.ts.map +1 -1
  29. package/dist/common/validators/index.js +9 -2
  30. package/dist/common/validators/index.js.map +1 -1
  31. package/dist/component-documentation.json +1 -1
  32. package/dist/components/Avatar/Avatar.vue.d.ts +10 -10
  33. package/dist/components/Avatar/Avatar.vue.d.ts.map +1 -1
  34. package/dist/components/Badge/Badge.vue.d.ts +13 -13
  35. package/dist/components/Banner/Banner.vue.d.ts +106 -106
  36. package/dist/components/Banner/Banner.vue.d.ts.map +1 -1
  37. package/dist/components/Box/Box.vue.d.ts +18 -0
  38. package/dist/components/Box/Box.vue.d.ts.map +1 -1
  39. package/dist/components/Box/BoxConstants.d.ts +4 -0
  40. package/dist/components/Box/BoxConstants.d.ts.map +1 -1
  41. package/dist/components/Box/Validators.d.ts +4 -0
  42. package/dist/components/Box/Validators.d.ts.map +1 -1
  43. package/dist/components/Box/index.d.ts +1 -1
  44. package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +1 -0
  45. package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts.map +1 -1
  46. package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +3 -2
  47. package/dist/components/Button/Button.vue.d.ts +25 -25
  48. package/dist/components/Button/Button.vue.d.ts.map +1 -1
  49. package/dist/components/Card/Card.vue.d.ts +6 -6
  50. package/dist/components/Checkbox/Checkbox.vue.d.ts +26 -26
  51. package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
  52. package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +46 -46
  53. package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +1 -1
  54. package/dist/components/Chip/Chip.vue.d.ts +40 -40
  55. package/dist/components/Chip/Chip.vue.d.ts.map +1 -1
  56. package/dist/components/Codeblock/Codeblock.vue.d.ts +2 -2
  57. package/dist/components/Collapsible/Collapsible.vue.d.ts +39 -39
  58. package/dist/components/Collapsible/Collapsible.vue.d.ts.map +1 -1
  59. package/dist/components/Combobox/Combobox.vue.d.ts +66 -66
  60. package/dist/components/Combobox/Combobox.vue.d.ts.map +1 -1
  61. package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts +29 -29
  62. package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts.map +1 -1
  63. package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts +35 -35
  64. package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts.map +1 -1
  65. package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts +216 -216
  66. package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts.map +1 -1
  67. package/dist/components/DescriptionList/DescriptionList.vue.d.ts +4 -4
  68. package/dist/components/Dropdown/Dropdown.vue.d.ts +82 -82
  69. package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  70. package/dist/components/Emoji/Emoji.vue.d.ts +17 -17
  71. package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts +37 -37
  72. package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts.map +1 -1
  73. package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts +37 -37
  74. package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts.map +1 -1
  75. package/dist/components/EmojiTextWrapper/EmojiTextWrapper.vue.d.ts +24 -24
  76. package/dist/components/EmojiTextWrapper/EmojiTextWrapper.vue.d.ts.map +1 -1
  77. package/dist/components/EmptyState/EmptyState.vue.d.ts.map +1 -1
  78. package/dist/components/FilterPill/FilterPill.vue.d.ts +308 -308
  79. package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
  80. package/dist/components/Hovercard/Hovercard.vue.d.ts +156 -156
  81. package/dist/components/Hovercard/Hovercard.vue.d.ts.map +1 -1
  82. package/dist/components/Icon/Icon.vue.d.ts +7 -7
  83. package/dist/components/ImageViewer/ImageViewer.vue.d.ts +60 -60
  84. package/dist/components/ImageViewer/ImageViewer.vue.d.ts.map +1 -1
  85. package/dist/components/Input/Input.vue.d.ts +37 -37
  86. package/dist/components/Input/Input.vue.d.ts.map +1 -1
  87. package/dist/components/InputGroup/InputGroup.vue.d.ts +46 -46
  88. package/dist/components/InputGroup/InputGroup.vue.d.ts.map +1 -1
  89. package/dist/components/ItemLayout/ItemLayout.vue.d.ts +20 -20
  90. package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts +80 -80
  91. package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts.map +1 -1
  92. package/dist/components/Link/Link.vue.d.ts +1 -0
  93. package/dist/components/Link/LinkConstants.d.ts +3 -0
  94. package/dist/components/Link/LinkConstants.d.ts.map +1 -1
  95. package/dist/components/ListItem/ListItem.vue.d.ts +27 -27
  96. package/dist/components/ListItem/ListItem.vue.d.ts.map +1 -1
  97. package/dist/components/ListItemGroup/ListItemGroup.vue.d.ts +4 -4
  98. package/dist/components/Loader/Loader.vue.d.ts +7 -7
  99. package/dist/components/Modal/Modal.vue.d.ts +79 -85
  100. package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
  101. package/dist/components/Modal/ModalConstants.d.ts +0 -5
  102. package/dist/components/Modal/index.d.ts +1 -1
  103. package/dist/components/Notice/Notice.vue.d.ts +106 -106
  104. package/dist/components/Notice/Notice.vue.d.ts.map +1 -1
  105. package/dist/components/Notice/NoticeAction.vue.d.ts +62 -62
  106. package/dist/components/Notice/NoticeAction.vue.d.ts.map +1 -1
  107. package/dist/components/Notice/NoticeContent.vue.d.ts +4 -4
  108. package/dist/components/Notice/NoticeIcon.vue.d.ts +32 -32
  109. package/dist/components/Notice/NoticeIcon.vue.d.ts.map +1 -1
  110. package/dist/components/Pagination/Pagination.vue.d.ts +40 -40
  111. package/dist/components/Pagination/Pagination.vue.d.ts.map +1 -1
  112. package/dist/components/Popover/Popover.vue.d.ts +78 -78
  113. package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
  114. package/dist/components/Popover/PopoverHeaderFooter.vue.d.ts +34 -34
  115. package/dist/components/Popover/PopoverHeaderFooter.vue.d.ts.map +1 -1
  116. package/dist/components/ProgressCircle/ProgressCircle.vue.d.ts +7 -7
  117. package/dist/components/Prose/Prose.vue.d.ts.map +1 -1
  118. package/dist/components/Radio/Radio.vue.d.ts +26 -26
  119. package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
  120. package/dist/components/RadioGroup/RadioGroup.vue.d.ts +46 -46
  121. package/dist/components/RadioGroup/RadioGroup.vue.d.ts.map +1 -1
  122. package/dist/components/RichTextEditor/Extensions/Channels/ChannelComponent.vue.d.ts +6 -5
  123. package/dist/components/RichTextEditor/Extensions/Channels/ChannelComponent.vue.d.ts.map +1 -1
  124. package/dist/components/RichTextEditor/Extensions/Channels/ChannelSuggestion.vue.d.ts +10 -10
  125. package/dist/components/RichTextEditor/Extensions/Channels/ChannelSuggestion.vue.d.ts.map +1 -1
  126. package/dist/components/RichTextEditor/Extensions/Emoji/EmojiComponent.vue.d.ts +17 -17
  127. package/dist/components/RichTextEditor/Extensions/Emoji/EmojiSuggestion.vue.d.ts +17 -17
  128. package/dist/components/RichTextEditor/Extensions/Mentions/MentionComponent.vue.d.ts +1 -0
  129. package/dist/components/RichTextEditor/Extensions/Mentions/MentionSuggestion.vue.d.ts +10 -10
  130. package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts +27 -27
  131. package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts.map +1 -1
  132. package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +153 -153
  133. package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts.map +1 -1
  134. package/dist/components/RootLayout/RootLayout.vue.d.ts +10 -10
  135. package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts.map +1 -1
  136. package/dist/components/SelectMenu/SelectMenu.vue.d.ts +33 -33
  137. package/dist/components/SelectMenu/SelectMenu.vue.d.ts.map +1 -1
  138. package/dist/components/Skeleton/Skeleton.vue.d.ts +8 -8
  139. package/dist/components/Skeleton/SkeletonListItem.vue.d.ts +4 -4
  140. package/dist/components/Skeleton/SkeletonParagraph.vue.d.ts +2 -2
  141. package/dist/components/Skeleton/SkeletonShape.vue.d.ts +2 -2
  142. package/dist/components/SplitButton/SplitButton.vue.d.ts +157 -157
  143. package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
  144. package/dist/components/SplitButton/SplitButtonEnd.vue.d.ts +30 -30
  145. package/dist/components/SplitButton/SplitButtonEnd.vue.d.ts.map +1 -1
  146. package/dist/components/SplitButton/SplitButtonStart.vue.d.ts +31 -31
  147. package/dist/components/Tab/Tab.vue.d.ts +33 -33
  148. package/dist/components/Tab/TabGroup.vue.d.ts +6 -6
  149. package/dist/components/Tab/TabPanel.vue.d.ts +2 -2
  150. package/dist/components/TextList/TextList.vue.d.ts +87 -0
  151. package/dist/components/TextList/TextList.vue.d.ts.map +1 -0
  152. package/dist/components/TextList/TextListConstants.d.ts +20 -0
  153. package/dist/components/TextList/TextListConstants.d.ts.map +1 -0
  154. package/dist/components/TextList/TextListItem.vue.d.ts +60 -0
  155. package/dist/components/TextList/TextListItem.vue.d.ts.map +1 -0
  156. package/dist/components/TextList/Validators.d.ts +5 -0
  157. package/dist/components/TextList/Validators.d.ts.map +1 -0
  158. package/dist/components/TextList/index.d.ts +4 -0
  159. package/dist/components/TextList/index.d.ts.map +1 -0
  160. package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts +108 -108
  161. package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts.map +1 -1
  162. package/dist/components/Toast/Layouts/ToastLayoutAlternateIcon.vue.d.ts +34 -34
  163. package/dist/components/Toast/Layouts/ToastLayoutAlternateIcon.vue.d.ts.map +1 -1
  164. package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts +106 -106
  165. package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts.map +1 -1
  166. package/dist/components/Toast/Toast.vue.d.ts +436 -436
  167. package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
  168. package/dist/components/Toggle/Toggle.vue.d.ts +4 -4
  169. package/dist/components/Toggle/Toggle.vue.d.ts.map +1 -1
  170. package/dist/components/Tooltip/Tooltip.vue.d.ts +4 -4
  171. package/dist/components/ValidationMessages/ValidationMessages.vue.d.ts +22 -22
  172. package/dist/components/ValidationMessages/ValidationMessages.vue.d.ts.map +1 -1
  173. package/dist/dialtone-vue.cjs +1 -1
  174. package/dist/dialtone-vue.js +134 -130
  175. package/dist/index.d.ts +1 -0
  176. package/dist/lib/attachment-carousel/attachment-carousel.cjs +1 -1
  177. package/dist/lib/attachment-carousel/attachment-carousel.js +1 -1
  178. package/dist/lib/attachment-carousel/index.cjs +1 -1
  179. package/dist/lib/attachment-carousel/index.js +1 -1
  180. package/dist/lib/avatar/avatar.cjs +1 -1
  181. package/dist/lib/avatar/avatar.cjs.map +1 -1
  182. package/dist/lib/avatar/avatar.js +55 -54
  183. package/dist/lib/avatar/avatar.js.map +1 -1
  184. package/dist/lib/badge/badge.cjs +1 -1
  185. package/dist/lib/badge/badge.cjs.map +1 -1
  186. package/dist/lib/badge/badge.js +36 -35
  187. package/dist/lib/badge/badge.js.map +1 -1
  188. package/dist/lib/box/box-constants.cjs +1 -1
  189. package/dist/lib/box/box-constants.cjs.map +1 -1
  190. package/dist/lib/box/box-constants.js +34 -7
  191. package/dist/lib/box/box-constants.js.map +1 -1
  192. package/dist/lib/box/box.cjs +1 -1
  193. package/dist/lib/box/box.cjs.map +1 -1
  194. package/dist/lib/box/box.js +93 -34
  195. package/dist/lib/box/box.js.map +1 -1
  196. package/dist/lib/box/index.cjs +1 -1
  197. package/dist/lib/box/index.js +3 -3
  198. package/dist/lib/box/validators.cjs +1 -1
  199. package/dist/lib/box/validators.cjs.map +1 -1
  200. package/dist/lib/box/validators.js +4 -4
  201. package/dist/lib/box/validators.js.map +1 -1
  202. package/dist/lib/button/button.cjs +1 -1
  203. package/dist/lib/button/button.cjs.map +1 -1
  204. package/dist/lib/button/button.js +69 -68
  205. package/dist/lib/button/button.js.map +1 -1
  206. package/dist/lib/chip/chip.cjs +1 -1
  207. package/dist/lib/chip/chip.cjs.map +1 -1
  208. package/dist/lib/chip/chip.js +36 -35
  209. package/dist/lib/chip/chip.js.map +1 -1
  210. package/dist/lib/codeblock/codeblock.cjs +1 -1
  211. package/dist/lib/codeblock/codeblock.cjs.map +1 -1
  212. package/dist/lib/codeblock/codeblock.js +11 -10
  213. package/dist/lib/codeblock/codeblock.js.map +1 -1
  214. package/dist/lib/combobox/combobox.cjs +1 -1
  215. package/dist/lib/combobox/combobox.js +1 -1
  216. package/dist/lib/combobox/index.cjs +1 -1
  217. package/dist/lib/combobox/index.js +1 -1
  218. package/dist/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
  219. package/dist/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
  220. package/dist/lib/combobox-multi-select/combobox-multi-select.js +53 -53
  221. package/dist/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
  222. package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
  223. package/dist/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
  224. package/dist/lib/combobox-with-popover/combobox-with-popover.js +48 -47
  225. package/dist/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
  226. package/dist/lib/editor/editor.cjs +1 -1
  227. package/dist/lib/editor/editor.js +1 -1
  228. package/dist/lib/emoji/emoji.cjs +1 -1
  229. package/dist/lib/emoji/emoji.cjs.map +1 -1
  230. package/dist/lib/emoji/emoji.js +25 -24
  231. package/dist/lib/emoji/emoji.js.map +1 -1
  232. package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.cjs +1 -1
  233. package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.cjs.map +1 -1
  234. package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.js +20 -19
  235. package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.js.map +1 -1
  236. package/dist/lib/empty-state/empty-state.cjs +1 -1
  237. package/dist/lib/empty-state/empty-state.cjs.map +1 -1
  238. package/dist/lib/empty-state/empty-state.js +31 -30
  239. package/dist/lib/empty-state/empty-state.js.map +1 -1
  240. package/dist/lib/filter-pill/filter-pill.cjs +1 -1
  241. package/dist/lib/filter-pill/filter-pill.cjs.map +1 -1
  242. package/dist/lib/filter-pill/filter-pill.js +73 -72
  243. package/dist/lib/filter-pill/filter-pill.js.map +1 -1
  244. package/dist/lib/icon/icon.cjs +1 -1
  245. package/dist/lib/icon/icon.cjs.map +1 -1
  246. package/dist/lib/icon/icon.js +16 -15
  247. package/dist/lib/icon/icon.js.map +1 -1
  248. package/dist/lib/input/input.cjs +1 -1
  249. package/dist/lib/input/input.cjs.map +1 -1
  250. package/dist/lib/input/input.js +64 -63
  251. package/dist/lib/input/input.js.map +1 -1
  252. package/dist/lib/link/link-constants.cjs +1 -1
  253. package/dist/lib/link/link-constants.cjs.map +1 -1
  254. package/dist/lib/link/link-constants.js +11 -9
  255. package/dist/lib/link/link-constants.js.map +1 -1
  256. package/dist/lib/link/link.cjs +1 -1
  257. package/dist/lib/link/link.cjs.map +1 -1
  258. package/dist/lib/link/link.js +17 -14
  259. package/dist/lib/link/link.js.map +1 -1
  260. package/dist/lib/loader/loader.cjs +3 -3
  261. package/dist/lib/loader/loader.cjs.map +1 -1
  262. package/dist/lib/loader/loader.js +21 -20
  263. package/dist/lib/loader/loader.js.map +1 -1
  264. package/dist/lib/message-input/index.cjs +1 -1
  265. package/dist/lib/message-input/index.js +1 -1
  266. package/dist/lib/message-input/message-input.cjs +1 -1
  267. package/dist/lib/message-input/message-input.js +1 -1
  268. package/dist/lib/modal/index.cjs +1 -1
  269. package/dist/lib/modal/index.js +3 -3
  270. package/dist/lib/modal/modal-constants.cjs +1 -1
  271. package/dist/lib/modal/modal-constants.cjs.map +1 -1
  272. package/dist/lib/modal/modal-constants.js +1 -4
  273. package/dist/lib/modal/modal-constants.js.map +1 -1
  274. package/dist/lib/modal/modal.cjs +1 -1
  275. package/dist/lib/modal/modal.cjs.map +1 -1
  276. package/dist/lib/modal/modal.js +40 -42
  277. package/dist/lib/modal/modal.js.map +1 -1
  278. package/dist/lib/progress-circle/progress-circle.cjs +1 -1
  279. package/dist/lib/progress-circle/progress-circle.cjs.map +1 -1
  280. package/dist/lib/progress-circle/progress-circle.js +33 -32
  281. package/dist/lib/progress-circle/progress-circle.js.map +1 -1
  282. package/dist/lib/prose/prose.cjs +1 -1
  283. package/dist/lib/prose/prose.cjs.map +1 -1
  284. package/dist/lib/prose/prose.js +23 -22
  285. package/dist/lib/prose/prose.js.map +1 -1
  286. package/dist/lib/segmented-control/segmented-control.cjs +1 -1
  287. package/dist/lib/segmented-control/segmented-control.cjs.map +1 -1
  288. package/dist/lib/segmented-control/segmented-control.js +42 -41
  289. package/dist/lib/segmented-control/segmented-control.js.map +1 -1
  290. package/dist/lib/select-menu/select-menu.cjs +1 -1
  291. package/dist/lib/select-menu/select-menu.cjs.map +1 -1
  292. package/dist/lib/select-menu/select-menu.js +48 -47
  293. package/dist/lib/select-menu/select-menu.js.map +1 -1
  294. package/dist/lib/split-button/split-button.cjs +1 -1
  295. package/dist/lib/split-button/split-button.cjs.map +1 -1
  296. package/dist/lib/split-button/split-button.js +45 -44
  297. package/dist/lib/split-button/split-button.js.map +1 -1
  298. package/dist/lib/tab/tab-group.cjs +1 -1
  299. package/dist/lib/tab/tab-group.cjs.map +1 -1
  300. package/dist/lib/tab/tab-group.js +34 -35
  301. package/dist/lib/tab/tab-group.js.map +1 -1
  302. package/dist/lib/text-list/index.cjs +1 -0
  303. package/dist/lib/text-list/index.js +4 -0
  304. package/dist/lib/text-list/text-list-constants.cjs +2 -0
  305. package/dist/lib/text-list/text-list-constants.cjs.map +1 -0
  306. package/dist/lib/text-list/text-list-constants.js +31 -0
  307. package/dist/lib/text-list/text-list-constants.js.map +1 -0
  308. package/dist/lib/text-list/text-list-item.cjs +1 -0
  309. package/dist/lib/text-list/text-list-item.js +2 -0
  310. package/dist/lib/text-list/text-list.cjs +1 -0
  311. package/dist/lib/text-list/text-list.js +2 -0
  312. package/dist/lib/text-list/validators.cjs +2 -0
  313. package/dist/lib/text-list/validators.cjs.map +1 -0
  314. package/dist/lib/text-list/validators.js +10 -0
  315. package/dist/lib/text-list/validators.js.map +1 -0
  316. package/dist/lib/toast/index.cjs +1 -1
  317. package/dist/lib/toast/index.js +1 -1
  318. package/dist/lib/toast/toast.cjs +1 -1
  319. package/dist/lib/toast/toast.js +1 -1
  320. package/dist/lib/toggle/toggle.cjs +1 -1
  321. package/dist/lib/toggle/toggle.cjs.map +1 -1
  322. package/dist/lib/toggle/toggle.js +23 -22
  323. package/dist/lib/toggle/toggle.js.map +1 -1
  324. package/dist/{message_input-DOE5NEU9.js → message_input-C6BcWqr8.js} +1 -1
  325. package/dist/{message_input-DOE5NEU9.js.map → message_input-C6BcWqr8.js.map} +1 -1
  326. package/dist/{message_input-DMyIOe4y.cjs → message_input-ftx8f8wC.cjs} +1 -1
  327. package/dist/{message_input-DMyIOe4y.cjs.map → message_input-ftx8f8wC.cjs.map} +1 -1
  328. package/dist/recipes/buttons/callbar_button/callbar_button.vue.d.ts +33 -33
  329. package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +149 -149
  330. package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
  331. package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +147 -147
  332. package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
  333. package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts +173 -173
  334. package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
  335. package/dist/recipes/chips/grouped_chip/grouped_chip.vue.d.ts +40 -40
  336. package/dist/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +1 -1
  337. package/dist/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +132 -132
  338. package/dist/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
  339. package/dist/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +97 -97
  340. package/dist/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
  341. package/dist/recipes/conversation_view/editor/EditorToolbarButton.vue.d.ts +25 -25
  342. package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts +107 -107
  343. package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts.map +1 -1
  344. package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts +103 -103
  345. package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts.map +1 -1
  346. package/dist/recipes/conversation_view/editor/editor.vue.d.ts +636 -636
  347. package/dist/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  348. package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +70 -70
  349. package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
  350. package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +66 -66
  351. package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
  352. package/dist/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +55 -55
  353. package/dist/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
  354. package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +55 -55
  355. package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
  356. package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts +604 -604
  357. package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  358. package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts +109 -109
  359. package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -1
  360. package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts +254 -254
  361. package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
  362. package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +149 -149
  363. package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
  364. package/dist/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts +30 -30
  365. package/dist/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts.map +1 -1
  366. package/dist/recipes/item_layout/contact_info/contact_info.vue.d.ts +30 -30
  367. package/dist/recipes/leftbar/callbox/callbox.vue.d.ts +28 -28
  368. package/dist/recipes/leftbar/callbox/callbox.vue.d.ts.map +1 -1
  369. package/dist/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +72 -72
  370. package/dist/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
  371. package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts +215 -215
  372. package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
  373. package/dist/recipes/leftbar/general_row/general_row.vue.d.ts +176 -176
  374. package/dist/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
  375. package/dist/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +80 -80
  376. package/dist/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts.map +1 -1
  377. package/dist/recipes/leftbar/group_row/group_row.vue.d.ts +181 -181
  378. package/dist/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
  379. package/dist/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +10 -10
  380. package/dist/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
  381. package/package.json +4 -4
  382. package/dist/Combobox-By01ETlj.js.map +0 -1
  383. package/dist/Combobox-D4hc1-41.cjs +0 -3
  384. package/dist/Combobox-D4hc1-41.cjs.map +0 -1
  385. package/dist/Toast-CHbVmbBg.js.map +0 -1
  386. package/dist/Toast-DX-REYXG.cjs +0 -2
  387. package/dist/Toast-DX-REYXG.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"emoji.cjs","names":[],"sources":["../../../components/Emoji/Emoji.vue"],"sourcesContent":["<template>\n <span :class=\"['d-emoji d-icon', emojiSize]\">\n <dt-skeleton\n v-show=\"imgLoading && showSkeleton\"\n :offset=\"0\"\n :class=\"['d-icon', emojiSize]\"\n :shape-option=\"{ shape: 'circle', size: '100%' }\"\n />\n <img\n v-show=\"!imgLoading\"\n ref=\"emojiImg\"\n :class=\"['d-icon', emojiSize, imgClass]\"\n :aria-label=\"emojiLabel\"\n :alt=\"emojiAlt\"\n :title=\"emojiLabel\"\n :src=\"emojiSrc\"\n @load=\"imageLoaded\"\n @error=\"imageErrored\"\n >\n </span>\n</template>\n\n<script>\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon';\nimport {\n codeToEmojiData,\n stringToUnicode,\n emojiImageUrlSmall,\n emojiFileExtensionSmall,\n emojiImageUrlLarge,\n emojiFileExtensionLarge,\n} from '@/common/emoji';\nimport { DtSkeleton } from '@/components/Skeleton';\n\n/**\n * Renders an emoji from a shortcode such as :smile: or unicode character such as 😄\n * @see https://dialtone.dialpad.com/components/emoji.html\n */\nexport default {\n name: 'DtEmoji',\n\n components: {\n DtSkeleton,\n },\n\n props: {\n /**\n * Supports shortcode ex: :smile: or unicode ex: 😄. Will display the resulting emoji.\n * <a class=\"d-link\" href=\"https://emojipedia.org/joypixels/\" target=\"_blank\">JoyPixels</a>\n * for all supported shortcode/unicode or the docs for setting up custom emojis.\n */\n code: {\n type: String,\n required: true,\n },\n\n /**\n * The size of the emoji. Can be any of the icon size utility classes from\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/icon.html\" target=\"_blank\"> Dialpad Icon Size</a>\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (t) => Object.keys(ICON_SIZE_MODIFIERS).includes(t),\n },\n\n /**\n * Additional class name for the emoji img element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n imgClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Will be read out on a screen reader for this emoji. You must use this prop if you want your emoji to be i18n\n * Compatible as Dialtone Vue will not translate it by itself. If you do not set this prop the aria-label will\n * be set to the english description of the emoji. You can retrieve the description for an emoji yourself via the\n * getEmojiData() function\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Shows a skeleton loader while the emoji asset is loading.\n * @values true, false\n */\n showSkeleton: {\n type: Boolean,\n default: true,\n },\n },\n\n data () {\n return {\n emojiData: null,\n imgLoading: false,\n };\n },\n\n computed: {\n emojiDataValid () {\n return !!this.emojiData;\n },\n\n emojiSrc () {\n if (!this.emojiDataValid) { return 'invalid'; }\n\n // custom emoji\n if (this.emojiData?.custom) {\n return this.emojiData.image;\n }\n\n if (['100', '200'].includes(this.size)) {\n return emojiImageUrlSmall + this.emojiData.key + emojiFileExtensionSmall;\n } else {\n return emojiImageUrlLarge + this.emojiData.key + emojiFileExtensionLarge;\n }\n },\n\n emojiAlt () {\n if (!this.emojiDataValid) { return undefined; }\n return this.emojiData.unicode_output ? stringToUnicode(this.emojiData.unicode_output) : this.emojiData.name;\n },\n\n emojiLabel () {\n if (!this.emojiDataValid) { return 'Invalid Emoji'; }\n return this.ariaLabel ? this.ariaLabel : this.emojiData.name;\n },\n\n emojiSize () {\n return ICON_SIZE_MODIFIERS[this.size];\n },\n },\n\n watch: {\n code: {\n handler: function () {\n this.getEmojiData();\n },\n\n immediate: true,\n },\n\n emojiSrc: {\n handler: async function () {\n this.imgLoading = true;\n },\n\n immediate: true,\n },\n },\n\n methods: {\n getEmojiData () {\n this.emojiData = codeToEmojiData(this.code);\n },\n\n imageLoaded () {\n this.imgLoading = false;\n },\n\n imageErrored () {\n this.imgLoading = false;\n },\n },\n};\n</script>\n"],"mappings":"gVAsCA,IA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AAA,EAAA,gBAAK,CAAA,iBAAqB,EAAA,UAAS,CAAA,CAAA,CAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,EAAA,aAMtC,EAAA,CAHC,OAAQ,EACR,OAAA,EAAA,EAAA,gBAAK,CAAA,SAAa,EAAA,UAAS,CAAA,CAC3B,eAAc,CAAA,MAAA,SAAA,KAAA,OAAiC,8BAHxC,EAAA,YAAc,EAAA,aAAY,CAAA,CAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,EAAA,oBAenC,MAAA,CARC,IAAI,WACH,OAAA,EAAA,EAAA,gBAAK,CAAA,SAAa,EAAA,UAAW,EAAA,SAAQ,CAAA,CACrC,aAAY,EAAA,WACZ,IAAK,EAAA,SACL,MAAO,EAAA,WACP,IAAK,EAAA,SACL,OAAI,EAAA,KAAA,EAAA,IAAA,GAAA,IAAE,EAAA,aAAA,EAAA,YAAA,GAAA,EAAW,EACjB,QAAK,EAAA,KAAA,EAAA,IAAA,GAAA,IAAE,EAAA,cAAA,EAAA,aAAA,GAAA,EAAY,yBARX,EAAA,WAAU,CAAA,CAAA,CAAA,CAAA,EAAA"}
1
+ {"version":3,"file":"emoji.cjs","names":[],"sources":["../../../components/Emoji/Emoji.vue"],"sourcesContent":["<template>\n <span :class=\"['d-emoji d-icon', emojiSize]\">\n <dt-skeleton\n v-show=\"imgLoading && showSkeleton\"\n :offset=\"0\"\n :class=\"['d-icon', emojiSize]\"\n :shape-option=\"{ shape: 'circle', size: '100%' }\"\n />\n <img\n v-show=\"!imgLoading\"\n ref=\"emojiImg\"\n :class=\"['d-icon', emojiSize, imgClass]\"\n :aria-label=\"emojiLabel\"\n :alt=\"emojiAlt\"\n :title=\"emojiLabel\"\n :src=\"emojiSrc\"\n @load=\"imageLoaded\"\n @error=\"imageErrored\"\n >\n </span>\n</template>\n\n<script>\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport {\n codeToEmojiData,\n stringToUnicode,\n emojiImageUrlSmall,\n emojiFileExtensionSmall,\n emojiImageUrlLarge,\n emojiFileExtensionLarge,\n} from '@/common/emoji';\nimport { DtSkeleton } from '@/components/Skeleton';\n\n/**\n * Renders an emoji from a shortcode such as :smile: or unicode character such as 😄\n * @see https://dialtone.dialpad.com/components/emoji.html\n */\nexport default {\n name: 'DtEmoji',\n\n components: {\n DtSkeleton,\n },\n\n props: {\n /**\n * Supports shortcode ex: :smile: or unicode ex: 😄. Will display the resulting emoji.\n * <a class=\"d-link\" href=\"https://emojipedia.org/joypixels/\" target=\"_blank\">JoyPixels</a>\n * for all supported shortcode/unicode or the docs for setting up custom emojis.\n */\n code: {\n type: String,\n required: true,\n },\n\n /**\n * The size of the emoji. Can be any of the icon size utility classes from\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/icon.html\" target=\"_blank\"> Dialpad Icon Size</a>\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: [String, Number],\n default: 500,\n validator: ordinalSizeValidator(ICON_SIZE_MODIFIERS),\n },\n\n /**\n * Additional class name for the emoji img element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n imgClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Will be read out on a screen reader for this emoji. You must use this prop if you want your emoji to be i18n\n * Compatible as Dialtone Vue will not translate it by itself. If you do not set this prop the aria-label will\n * be set to the english description of the emoji. You can retrieve the description for an emoji yourself via the\n * getEmojiData() function\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Shows a skeleton loader while the emoji asset is loading.\n * @values true, false\n */\n showSkeleton: {\n type: Boolean,\n default: true,\n },\n },\n\n data () {\n return {\n emojiData: null,\n imgLoading: false,\n };\n },\n\n computed: {\n emojiDataValid () {\n return !!this.emojiData;\n },\n\n emojiSrc () {\n if (!this.emojiDataValid) { return 'invalid'; }\n\n // custom emoji\n if (this.emojiData?.custom) {\n return this.emojiData.image;\n }\n\n if (['100', '200'].includes(String(this.size))) {\n return emojiImageUrlSmall + this.emojiData.key + emojiFileExtensionSmall;\n } else {\n return emojiImageUrlLarge + this.emojiData.key + emojiFileExtensionLarge;\n }\n },\n\n emojiAlt () {\n if (!this.emojiDataValid) { return undefined; }\n return this.emojiData.unicode_output ? stringToUnicode(this.emojiData.unicode_output) : this.emojiData.name;\n },\n\n emojiLabel () {\n if (!this.emojiDataValid) { return 'Invalid Emoji'; }\n return this.ariaLabel ? this.ariaLabel : this.emojiData.name;\n },\n\n emojiSize () {\n return ICON_SIZE_MODIFIERS[this.size];\n },\n },\n\n watch: {\n code: {\n handler: function () {\n this.getEmojiData();\n },\n\n immediate: true,\n },\n\n emojiSrc: {\n handler: async function () {\n this.imgLoading = true;\n },\n\n immediate: true,\n },\n },\n\n methods: {\n getEmojiData () {\n this.emojiData = codeToEmojiData(this.code);\n },\n\n imageLoaded () {\n this.imgLoading = false;\n },\n\n imageErrored () {\n this.imgLoading = false;\n },\n },\n};\n</script>\n"],"mappings":"+XAuCA,IAAK,EAAU,CACb,KAAM,UAEN,WAAY,CACV,WAAA,EAAA,QACD,CAED,MAAO,CAML,KAAM,CACJ,KAAM,OACN,SAAU,GACX,CAOD,KAAM,CACJ,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,IACT,UAAW,EAAA,qBAAqB,EAAA,oBAAoB,CACrD,CAOD,SAAU,CACR,KAAM,CAAC,OAAQ,OAAQ,MAAM,CAC7B,QAAS,GACV,CAQD,UAAW,CACT,KAAM,OACN,QAAS,KACV,CAMD,aAAc,CACZ,KAAM,QACN,QAAS,GACV,CACF,CAED,MAAQ,CACN,MAAO,CACL,UAAW,KACX,WAAY,GACb,EAGH,SAAU,CACR,gBAAkB,CAChB,MAAO,CAAC,CAAC,KAAK,WAGhB,UAAY,CAWR,OAVG,KAAK,eAGN,KAAK,WAAW,OACX,KAAK,UAAU,MAGpB,CAAC,MAAO,MAAM,CAAC,SAAS,OAAO,KAAK,KAAK,CAAC,CACrC,EAAA,m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,IAAA,GAAA,IAAE,EAAA,cAAA,EAAA,aAAA,GAAA,EAAY,yBARX,EAAA,WAAU,CAAA,CAAA,CAAA,CAAA,EAAA"}
@@ -1,21 +1,22 @@
1
- import { t as e } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
2
- import { codeToEmojiData as t, emojiFileExtensionLarge as n, emojiFileExtensionSmall as r, emojiImageUrlLarge as i, emojiImageUrlSmall as a, stringToUnicode as o } from "../../common/emoji/index.js";
3
- import { ICON_SIZE_MODIFIERS as s } from "../icon/icon-constants.js";
4
- import c from "../skeleton/skeleton.js";
5
- import { createElementBlock as l, createElementVNode as u, createVNode as d, normalizeClass as f, openBlock as p, resolveComponent as m, vShow as h, withDirectives as g } from "vue";
1
+ import { ordinalSizeValidator as e } from "../../common/validators/index.js";
2
+ import { t } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
3
+ import { codeToEmojiData as n, emojiFileExtensionLarge as r, emojiFileExtensionSmall as i, emojiImageUrlLarge as a, emojiImageUrlSmall as o, stringToUnicode as s } from "../../common/emoji/index.js";
4
+ import { ICON_SIZE_MODIFIERS as c } from "../icon/icon-constants.js";
5
+ import l from "../skeleton/skeleton.js";
6
+ import { createElementBlock as u, createElementVNode as d, createVNode as f, normalizeClass as p, openBlock as m, resolveComponent as h, vShow as g, withDirectives as _ } from "vue";
6
7
  //#region components/Emoji/Emoji.vue
7
- var _ = {
8
+ var v = {
8
9
  name: "DtEmoji",
9
- components: { DtSkeleton: c },
10
+ components: { DtSkeleton: l },
10
11
  props: {
11
12
  code: {
12
13
  type: String,
13
14
  required: !0
14
15
  },
15
16
  size: {
16
- type: String,
17
- default: "500",
18
- validator: (e) => Object.keys(s).includes(e)
17
+ type: [String, Number],
18
+ default: 500,
19
+ validator: e(c)
19
20
  },
20
21
  imgClass: {
21
22
  type: [
@@ -45,16 +46,16 @@ var _ = {
45
46
  return !!this.emojiData;
46
47
  },
47
48
  emojiSrc() {
48
- return this.emojiDataValid ? this.emojiData?.custom ? this.emojiData.image : ["100", "200"].includes(this.size) ? a + this.emojiData.key + r : i + this.emojiData.key + n : "invalid";
49
+ return this.emojiDataValid ? this.emojiData?.custom ? this.emojiData.image : ["100", "200"].includes(String(this.size)) ? o + this.emojiData.key + i : a + this.emojiData.key + r : "invalid";
49
50
  },
50
51
  emojiAlt() {
51
- if (this.emojiDataValid) return this.emojiData.unicode_output ? o(this.emojiData.unicode_output) : this.emojiData.name;
52
+ if (this.emojiDataValid) return this.emojiData.unicode_output ? s(this.emojiData.unicode_output) : this.emojiData.name;
52
53
  },
53
54
  emojiLabel() {
54
55
  return this.emojiDataValid ? this.ariaLabel ? this.ariaLabel : this.emojiData.name : "Invalid Emoji";
55
56
  },
56
57
  emojiSize() {
57
- return s[this.size];
58
+ return c[this.size];
58
59
  }
59
60
  },
60
61
  watch: {
@@ -73,7 +74,7 @@ var _ = {
73
74
  },
74
75
  methods: {
75
76
  getEmojiData() {
76
- this.emojiData = t(this.code);
77
+ this.emojiData = n(this.code);
77
78
  },
78
79
  imageLoaded() {
79
80
  this.imgLoading = !1;
@@ -82,24 +83,24 @@ var _ = {
82
83
  this.imgLoading = !1;
83
84
  }
84
85
  }
85
- }, v = [
86
+ }, y = [
86
87
  "aria-label",
87
88
  "alt",
88
89
  "title",
89
90
  "src"
90
91
  ];
91
- function y(e, t, n, r, i, a) {
92
- let o = m("dt-skeleton");
93
- return p(), l("span", { class: f(["d-emoji d-icon", a.emojiSize]) }, [g(d(o, {
92
+ function b(e, t, n, r, i, a) {
93
+ let o = h("dt-skeleton");
94
+ return m(), u("span", { class: p(["d-emoji d-icon", a.emojiSize]) }, [_(f(o, {
94
95
  offset: 0,
95
- class: f(["d-icon", a.emojiSize]),
96
+ class: p(["d-icon", a.emojiSize]),
96
97
  "shape-option": {
97
98
  shape: "circle",
98
99
  size: "100%"
99
100
  }
100
- }, null, 8, ["class"]), [[h, i.imgLoading && n.showSkeleton]]), g(u("img", {
101
+ }, null, 8, ["class"]), [[g, i.imgLoading && n.showSkeleton]]), _(d("img", {
101
102
  ref: "emojiImg",
102
- class: f([
103
+ class: p([
103
104
  "d-icon",
104
105
  a.emojiSize,
105
106
  n.imgClass
@@ -110,10 +111,10 @@ function y(e, t, n, r, i, a) {
110
111
  src: a.emojiSrc,
111
112
  onLoad: t[0] || (t[0] = (...e) => a.imageLoaded && a.imageLoaded(...e)),
112
113
  onError: t[1] || (t[1] = (...e) => a.imageErrored && a.imageErrored(...e))
113
- }, null, 42, v), [[h, !i.imgLoading]])], 2);
114
+ }, null, 42, y), [[g, !i.imgLoading]])], 2);
114
115
  }
115
- var b = /* @__PURE__ */ e(_, [["render", y]]);
116
+ var x = /* @__PURE__ */ t(v, [["render", b]]);
116
117
  //#endregion
117
- export { b as default };
118
+ export { x as default };
118
119
 
119
120
  //# sourceMappingURL=emoji.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"emoji.js","names":[],"sources":["../../../components/Emoji/Emoji.vue"],"sourcesContent":["<template>\n <span :class=\"['d-emoji d-icon', emojiSize]\">\n <dt-skeleton\n v-show=\"imgLoading && showSkeleton\"\n :offset=\"0\"\n :class=\"['d-icon', emojiSize]\"\n :shape-option=\"{ shape: 'circle', size: '100%' }\"\n />\n <img\n v-show=\"!imgLoading\"\n ref=\"emojiImg\"\n :class=\"['d-icon', emojiSize, imgClass]\"\n :aria-label=\"emojiLabel\"\n :alt=\"emojiAlt\"\n :title=\"emojiLabel\"\n :src=\"emojiSrc\"\n @load=\"imageLoaded\"\n @error=\"imageErrored\"\n >\n </span>\n</template>\n\n<script>\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon';\nimport {\n codeToEmojiData,\n stringToUnicode,\n emojiImageUrlSmall,\n emojiFileExtensionSmall,\n emojiImageUrlLarge,\n emojiFileExtensionLarge,\n} from '@/common/emoji';\nimport { DtSkeleton } from '@/components/Skeleton';\n\n/**\n * Renders an emoji from a shortcode such as :smile: or unicode character such as 😄\n * @see https://dialtone.dialpad.com/components/emoji.html\n */\nexport default {\n name: 'DtEmoji',\n\n components: {\n DtSkeleton,\n },\n\n props: {\n /**\n * Supports shortcode ex: :smile: or unicode ex: 😄. Will display the resulting emoji.\n * <a class=\"d-link\" href=\"https://emojipedia.org/joypixels/\" target=\"_blank\">JoyPixels</a>\n * for all supported shortcode/unicode or the docs for setting up custom emojis.\n */\n code: {\n type: String,\n required: true,\n },\n\n /**\n * The size of the emoji. Can be any of the icon size utility classes from\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/icon.html\" target=\"_blank\"> Dialpad Icon Size</a>\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (t) => Object.keys(ICON_SIZE_MODIFIERS).includes(t),\n },\n\n /**\n * Additional class name for the emoji img element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n imgClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Will be read out on a screen reader for this emoji. You must use this prop if you want your emoji to be i18n\n * Compatible as Dialtone Vue will not translate it by itself. If you do not set this prop the aria-label will\n * be set to the english description of the emoji. You can retrieve the description for an emoji yourself via the\n * getEmojiData() function\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Shows a skeleton loader while the emoji asset is loading.\n * @values true, false\n */\n showSkeleton: {\n type: Boolean,\n default: true,\n },\n },\n\n data () {\n return {\n emojiData: null,\n imgLoading: false,\n };\n },\n\n computed: {\n emojiDataValid () {\n return !!this.emojiData;\n },\n\n emojiSrc () {\n if (!this.emojiDataValid) { return 'invalid'; }\n\n // custom emoji\n if (this.emojiData?.custom) {\n return this.emojiData.image;\n }\n\n if (['100', '200'].includes(this.size)) {\n return emojiImageUrlSmall + this.emojiData.key + emojiFileExtensionSmall;\n } else {\n return emojiImageUrlLarge + this.emojiData.key + emojiFileExtensionLarge;\n }\n },\n\n emojiAlt () {\n if (!this.emojiDataValid) { return undefined; }\n return this.emojiData.unicode_output ? stringToUnicode(this.emojiData.unicode_output) : this.emojiData.name;\n },\n\n emojiLabel () {\n if (!this.emojiDataValid) { return 'Invalid Emoji'; }\n return this.ariaLabel ? this.ariaLabel : this.emojiData.name;\n },\n\n emojiSize () {\n return ICON_SIZE_MODIFIERS[this.size];\n },\n },\n\n watch: {\n code: {\n handler: function () {\n this.getEmojiData();\n },\n\n immediate: true,\n },\n\n emojiSrc: {\n handler: async function () {\n this.imgLoading = true;\n },\n\n immediate: true,\n },\n },\n\n methods: {\n getEmojiData () {\n this.emojiData = codeToEmojiData(this.code);\n },\n\n imageLoaded () {\n this.imgLoading = false;\n },\n\n imageErrored () {\n this.imgLoading = false;\n },\n },\n};\n</script>\n"],"mappings":";;;;;;AAsCA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY,EACV,YAAA,GACD;CAED,OAAO;EAML,MAAM;GACJ,MAAM;GACN,UAAU;GACX;EAOD,MAAM;GACJ,MAAM;GACN,SAAS;GACT,YAAY,MAAM,OAAO,KAAK,EAAoB,CAAC,SAAS,EAAE;GAC/D;EAOD,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAM;GAC7B,SAAS;GACV;EAQD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAMD,cAAc;GACZ,MAAM;GACN,SAAS;GACV;EACF;CAED,OAAQ;AACN,SAAO;GACL,WAAW;GACX,YAAY;GACb;;CAGH,UAAU;EACR,iBAAkB;AAChB,UAAO,CAAC,CAAC,KAAK;;EAGhB,WAAY;AAWR,UAVG,KAAK,iBAGN,KAAK,WAAW,SACX,KAAK,UAAU,QAGpB,CAAC,OAAO,MAAM,CAAC,SAAS,KAAK,KAAK,GAC7B,IAAqB,KAAK,UAAU,MAAM,IAE1C,IAAqB,KAAK,UAAU,MAAM,IAVhB;;EAcrC,WAAY;AACL,YAAK,eACV,QAAO,KAAK,UAAU,iBAAiB,EAAgB,KAAK,UAAU,eAAc,GAAI,KAAK,UAAU;;EAGzG,aAAc;AAEZ,UADK,KAAK,iBACH,KAAK,YAAY,KAAK,YAAY,KAAK,UAAU,OADrB;;EAIrC,YAAa;AACX,UAAO,EAAoB,KAAK;;EAEnC;CAED,OAAO;EACL,MAAM;GACJ,SAAS,WAAY;AACnB,SAAK,cAAc;;GAGrB,WAAW;GACZ;EAED,UAAU;GACR,SAAS,iBAAkB;AACzB,SAAK,aAAa;;GAGpB,WAAW;GACZ;EACF;CAED,SAAS;EACP,eAAgB;AACd,QAAK,YAAY,EAAgB,KAAK,KAAK;;EAG7C,cAAe;AACb,QAAK,aAAa;;EAGpB,eAAgB;AACd,QAAK,aAAa;;EAErB;CACF;;;;;;;;aA1KC,EAkBO,QAAA,EAlBA,OAAK,EAAA,CAAA,kBAAqB,EAAA,UAAS,CAAA,EAAA,EAAA,CAAA,EACxC,EAKE,GAAA;EAHC,QAAQ;EACR,OAAK,EAAA,CAAA,UAAa,EAAA,UAAS,CAAA;EAC3B,gBAAc;GAAA,OAAA;GAAA,MAAA;GAAiC;8BAHxC,EAAA,cAAc,EAAA,aAAY,CAAA,CAAA,EAAA,EAKpC,EAUC,OAAA;EARC,KAAI;EACH,OAAK,EAAA;GAAA;GAAa,EAAA;GAAW,EAAA;GAAQ,CAAA;EACrC,cAAY,EAAA;EACZ,KAAK,EAAA;EACL,OAAO,EAAA;EACP,KAAK,EAAA;EACL,QAAI,EAAA,OAAA,EAAA,MAAA,GAAA,MAAE,EAAA,eAAA,EAAA,YAAA,GAAA,EAAW;EACjB,SAAK,EAAA,OAAA,EAAA,MAAA,GAAA,MAAE,EAAA,gBAAA,EAAA,aAAA,GAAA,EAAY;wBARX,EAAA,WAAU,CAAA,CAAA,CAAA,EAAA,EAAA"}
1
+ {"version":3,"file":"emoji.js","names":[],"sources":["../../../components/Emoji/Emoji.vue"],"sourcesContent":["<template>\n <span :class=\"['d-emoji d-icon', emojiSize]\">\n <dt-skeleton\n v-show=\"imgLoading && showSkeleton\"\n :offset=\"0\"\n :class=\"['d-icon', emojiSize]\"\n :shape-option=\"{ shape: 'circle', size: '100%' }\"\n />\n <img\n v-show=\"!imgLoading\"\n ref=\"emojiImg\"\n :class=\"['d-icon', emojiSize, imgClass]\"\n :aria-label=\"emojiLabel\"\n :alt=\"emojiAlt\"\n :title=\"emojiLabel\"\n :src=\"emojiSrc\"\n @load=\"imageLoaded\"\n @error=\"imageErrored\"\n >\n </span>\n</template>\n\n<script>\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport {\n codeToEmojiData,\n stringToUnicode,\n emojiImageUrlSmall,\n emojiFileExtensionSmall,\n emojiImageUrlLarge,\n emojiFileExtensionLarge,\n} from '@/common/emoji';\nimport { DtSkeleton } from '@/components/Skeleton';\n\n/**\n * Renders an emoji from a shortcode such as :smile: or unicode character such as 😄\n * @see https://dialtone.dialpad.com/components/emoji.html\n */\nexport default {\n name: 'DtEmoji',\n\n components: {\n DtSkeleton,\n },\n\n props: {\n /**\n * Supports shortcode ex: :smile: or unicode ex: 😄. Will display the resulting emoji.\n * <a class=\"d-link\" href=\"https://emojipedia.org/joypixels/\" target=\"_blank\">JoyPixels</a>\n * for all supported shortcode/unicode or the docs for setting up custom emojis.\n */\n code: {\n type: String,\n required: true,\n },\n\n /**\n * The size of the emoji. Can be any of the icon size utility classes from\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/icon.html\" target=\"_blank\"> Dialpad Icon Size</a>\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: [String, Number],\n default: 500,\n validator: ordinalSizeValidator(ICON_SIZE_MODIFIERS),\n },\n\n /**\n * Additional class name for the emoji img element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n imgClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Will be read out on a screen reader for this emoji. You must use this prop if you want your emoji to be i18n\n * Compatible as Dialtone Vue will not translate it by itself. If you do not set this prop the aria-label will\n * be set to the english description of the emoji. You can retrieve the description for an emoji yourself via the\n * getEmojiData() function\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Shows a skeleton loader while the emoji asset is loading.\n * @values true, false\n */\n showSkeleton: {\n type: Boolean,\n default: true,\n },\n },\n\n data () {\n return {\n emojiData: null,\n imgLoading: false,\n };\n },\n\n computed: {\n emojiDataValid () {\n return !!this.emojiData;\n },\n\n emojiSrc () {\n if (!this.emojiDataValid) { return 'invalid'; }\n\n // custom emoji\n if (this.emojiData?.custom) {\n return this.emojiData.image;\n }\n\n if (['100', '200'].includes(String(this.size))) {\n return emojiImageUrlSmall + this.emojiData.key + emojiFileExtensionSmall;\n } else {\n return emojiImageUrlLarge + this.emojiData.key + emojiFileExtensionLarge;\n }\n },\n\n emojiAlt () {\n if (!this.emojiDataValid) { return undefined; }\n return this.emojiData.unicode_output ? stringToUnicode(this.emojiData.unicode_output) : this.emojiData.name;\n },\n\n emojiLabel () {\n if (!this.emojiDataValid) { return 'Invalid Emoji'; }\n return this.ariaLabel ? this.ariaLabel : this.emojiData.name;\n },\n\n emojiSize () {\n return ICON_SIZE_MODIFIERS[this.size];\n },\n },\n\n watch: {\n code: {\n handler: function () {\n this.getEmojiData();\n },\n\n immediate: true,\n },\n\n emojiSrc: {\n handler: async function () {\n this.imgLoading = true;\n },\n\n immediate: true,\n },\n },\n\n methods: {\n getEmojiData () {\n this.emojiData = codeToEmojiData(this.code);\n },\n\n imageLoaded () {\n this.imgLoading = false;\n },\n\n imageErrored () {\n this.imgLoading = false;\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;AAuCA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY,EACV,YAAA,GACD;CAED,OAAO;EAML,MAAM;GACJ,MAAM;GACN,UAAU;GACX;EAOD,MAAM;GACJ,MAAM,CAAC,QAAQ,OAAO;GACtB,SAAS;GACT,WAAW,EAAqB,EAAoB;GACrD;EAOD,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAM;GAC7B,SAAS;GACV;EAQD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAMD,c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,EAAA;EACZ,KAAK,EAAA;EACL,OAAO,EAAA;EACP,KAAK,EAAA;EACL,QAAI,EAAA,OAAA,EAAA,MAAA,GAAA,MAAE,EAAA,eAAA,EAAA,YAAA,GAAA,EAAW;EACjB,SAAK,EAAA,OAAA,EAAA,MAAA,GAAA,MAAE,EAAA,gBAAA,EAAA,aAAA,GAAA,EAAY;wBARX,EAAA,WAAU,CAAA,CAAA,CAAA,EAAA,EAAA"}
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/emoji/index.cjs`),t=require(`../icon/icon-constants.cjs`),n=require(`../emoji/emoji.cjs`);let r=require(`vue`);var i=(0,r.h)((0,r.resolveDynamicComponent)(null)).type,a={name:`DtEmojiTextWrapper`,components:{DtEmoji:n.default},props:{elementType:{type:String,default:`div`},size:{type:String,default:`500`,validator:e=>Object.keys(t.ICON_SIZE_MODIFIERS).includes(e)}},data(){return{loadingEmojiJson:!0}},async created(){this.loadingEmojiJson=!1},methods:{replaceDtEmojis(e,t){if(!e.length)return t;let i=e.map(e=>e.replace(/\*/g,`\\*`)),a=RegExp(`(${i.join(`|`)})`,`g`);return t.split(a).filter(e=>e.trim()!==``).map(t=>e.includes(t)?(0,r.h)(n.default,{code:t,size:this.size}):(0,r.h)(`span`,{class:`d-emoji-text-wrapper__text`},t))},searchVNodes(e){if(!e)return;if(typeof e==`string`)return this.searchCodes(e);if(e.type===i)return e;if(typeof e.type==`symbol`)return this.searchCodes(e.children);if(e.props?.innerHTML)return this.searchVNodes(e.props.innerHTML);let t=Array.isArray(e.children)?e.children:[e.children];return(0,r.h)(e.type,e.props,t.map(e=>this.searchVNodes(e)))},replaceVueComponentVNodeContent(){},searchCodes(t){let n=e.findShortCodes(t),r=e.findEmojis(t),i=[...n,...r];return i.length===0?t:this.replaceDtEmojis(i,t)}},render(){let e=this.$slots.default?this.$slots.default():[];return(0,r.h)(this.elementType,{"data-qa":`emoji-text-wrapper`,class:`d-emoji-text-wrapper`},this.loadingEmojiJson?e:e.map(e=>this.searchVNodes(e)))}};exports.default=a;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../common/emoji/index.cjs`),n=require(`../icon/icon-constants.cjs`),r=require(`../emoji/emoji.cjs`);let i=require(`vue`);var a=(0,i.h)((0,i.resolveDynamicComponent)(null)).type,o={name:`DtEmojiTextWrapper`,components:{DtEmoji:r.default},props:{elementType:{type:String,default:`div`},size:{type:[String,Number],default:500,validator:e.ordinalSizeValidator(n.ICON_SIZE_MODIFIERS)}},data(){return{loadingEmojiJson:!0}},async created(){this.loadingEmojiJson=!1},methods:{replaceDtEmojis(e,t){if(!e.length)return t;let n=e.map(e=>e.replace(/\*/g,`\\*`)),a=RegExp(`(${n.join(`|`)})`,`g`);return t.split(a).filter(e=>e.trim()!==``).map(t=>e.includes(t)?(0,i.h)(r.default,{code:t,size:this.size}):(0,i.h)(`span`,{class:`d-emoji-text-wrapper__text`},t))},searchVNodes(e){if(!e)return;if(typeof e==`string`)return this.searchCodes(e);if(e.type===a)return e;if(typeof e.type==`symbol`)return this.searchCodes(e.children);if(e.props?.innerHTML)return this.searchVNodes(e.props.innerHTML);let t=Array.isArray(e.children)?e.children:[e.children];return(0,i.h)(e.type,e.props,t.map(e=>this.searchVNodes(e)))},replaceVueComponentVNodeContent(){},searchCodes(e){let n=t.findShortCodes(e),r=t.findEmojis(e),i=[...n,...r];return i.length===0?e:this.replaceDtEmojis(i,e)}},render(){let e=this.$slots.default?this.$slots.default():[];return(0,i.h)(this.elementType,{"data-qa":`emoji-text-wrapper`,class:`d-emoji-text-wrapper`},this.loadingEmojiJson?e:e.map(e=>this.searchVNodes(e)))}};exports.default=o;
2
2
  //# sourceMappingURL=emoji-text-wrapper.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"emoji-text-wrapper.cjs","names":[],"sources":["../../../components/EmojiTextWrapper/EmojiTextWrapper.vue"],"sourcesContent":["<script>\nimport { DtEmoji } from '../Emoji';\nimport { findEmojis, findShortCodes } from '@/common/emoji';\nimport { h, resolveDynamicComponent } from 'vue';\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon/IconConstants';\n\nconst COMMENT_TYPE = h(resolveDynamicComponent(null)).type;\n\n/**\n * Wrapper to find and replace shortcodes like :smile: or unicode chars such as 😄 with our custom Emojis implementation.\n * @see https://dialtone.dialpad.com/components/emoji_text_wrapper.html\n */\nexport default {\n name: 'DtEmojiTextWrapper',\n\n components: {\n DtEmoji,\n },\n\n props: {\n /**\n * Element type (tag name) to use for the wrapper.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * The icon size to render the emojis at.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (t) => Object.keys(ICON_SIZE_MODIFIERS).includes(t),\n },\n },\n\n data () {\n return {\n loadingEmojiJson: true,\n };\n },\n\n async created () {\n this.loadingEmojiJson = false;\n },\n\n methods: {\n /**\n * Replaces the valid codes from the text content with a DtEmoji component.\n * @returns {Array<VNode|string>}\n */\n replaceDtEmojis (replaceList, textContent) {\n if (!replaceList.length) return textContent;\n // Escape the asterisk to avoid breaking the regex for the asterisk emoji\n const escapedReplaceList = replaceList.map(item =>\n item.replace(/\\*/g, '\\\\*'),\n );\n\n const regexp = new RegExp(`(${escapedReplaceList.join('|')})`, 'g');\n const items = textContent.split(regexp);\n\n return items\n .filter(item => item.trim() !== '')\n .map((item) => {\n if (replaceList.includes(item)) {\n return h(DtEmoji, { code: item, size: this.size });\n }\n return h('span', { class: 'd-emoji-text-wrapper__text' }, item);\n });\n },\n\n /**\n * Recursively search the Vue virtual DOM to find text\n * @param VNode\n * @returns {VNode|*}\n */\n searchVNodes (VNode) {\n if (!VNode) return;\n if (typeof VNode === 'string') return this.searchCodes(VNode);\n if (VNode.type === COMMENT_TYPE) return VNode;\n if (typeof VNode.type === 'symbol') return this.searchCodes(VNode.children);\n if (VNode.props?.innerHTML) return this.searchVNodes(VNode.props.innerHTML);\n\n const children = Array.isArray(VNode.children) ? VNode.children : [VNode.children];\n return h(VNode.type, VNode.props, children.map(VNodeChild => this.searchVNodes(VNodeChild)));\n },\n\n // TODO: Find a way to crawl vue components\n replaceVueComponentVNodeContent () {\n //\n },\n\n /**\n * Find codes in text.\n * @param textContent string\n * @returns {Array<VNode|string>|string}\n */\n searchCodes (textContent) {\n const shortcodes = findShortCodes(textContent);\n const emojis = findEmojis(textContent);\n\n const replaceList = [...shortcodes, ...emojis];\n if (replaceList.length === 0) return textContent;\n return this.replaceDtEmojis(replaceList, textContent);\n },\n },\n\n render () {\n const defaultSlotContent = this.$slots.default ? this.$slots.default() : [];\n return h(\n this.elementType,\n {\n 'data-qa': 'emoji-text-wrapper',\n class: 'd-emoji-text-wrapper',\n },\n this.loadingEmojiJson\n ? defaultSlotContent\n : defaultSlotContent.map(VNode => this.searchVNodes(VNode)),\n );\n },\n};\n</script>\n"],"mappings":"gRAMA,IAAM,GAAA,EAAA,EAAA,IAAA,EAAA,EAAA,yBAAyC,KAAK,CAAC,CAAC,KAMjD,EAAU,CACb,KAAM,qBAEN,WAAY,CACV,QAAA,EAAA,QACD,CAED,MAAO,CAIL,YAAa,CACX,KAAM,OACN,QAAS,MACV,CAMD,KAAM,CACJ,KAAM,OACN,QAAS,MACT,UAAY,GAAM,OAAO,KAAK,EAAA,oBAAoB,CAAC,SAAS,EAAE,CAC/D,CACF,CAED,MAAQ,CACN,MAAO,CACL,iBAAkB,GACnB,EAGH,MAAM,SAAW,CACf,KAAK,iBAAmB,IAG1B,QAAS,CAKP,gBAAiB,EAAa,EAAa,CACzC,GAAI,CAAC,EAAY,OAAQ,OAAO,EAEhC,IAAM,EAAqB,EAAY,IAAI,GACzC,EAAK,QAAQ,MAAO,MAAM,CAC3B,CAEK,EAAa,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apper.cjs","names":[],"sources":["../../../components/EmojiTextWrapper/EmojiTextWrapper.vue"],"sourcesContent":["<script>\nimport { DtEmoji } from '../Emoji';\nimport { findEmojis, findShortCodes } from '@/common/emoji';\nimport { h, resolveDynamicComponent } from 'vue';\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon/IconConstants';\nimport { ordinalSizeValidator } from '@/common/validators';\n\nconst COMMENT_TYPE = h(resolveDynamicComponent(null)).type;\n\n/**\n * Wrapper to find and replace shortcodes like :smile: or unicode chars such as 😄 with our custom Emojis implementation.\n * @see https://dialtone.dialpad.com/components/emoji_text_wrapper.html\n */\nexport default {\n name: 'DtEmojiTextWrapper',\n\n components: {\n DtEmoji,\n },\n\n props: {\n /**\n * Element type (tag name) to use for the wrapper.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * The icon size to render the emojis at.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: [String, Number],\n default: 500,\n validator: ordinalSizeValidator(ICON_SIZE_MODIFIERS),\n },\n },\n\n data () {\n return {\n loadingEmojiJson: true,\n };\n },\n\n async created () {\n this.loadingEmojiJson = false;\n },\n\n methods: {\n /**\n * Replaces the valid codes from the text content with a DtEmoji component.\n * @returns {Array<VNode|string>}\n */\n replaceDtEmojis (replaceList, textContent) {\n if (!replaceList.length) return textContent;\n // Escape the asterisk to avoid breaking the regex for the asterisk emoji\n const escapedReplaceList = replaceList.map(item =>\n item.replace(/\\*/g, '\\\\*'),\n );\n\n const regexp = new RegExp(`(${escapedReplaceList.join('|')})`, 'g');\n const items = textContent.split(regexp);\n\n return items\n .filter(item => item.trim() !== '')\n .map((item) => {\n if (replaceList.includes(item)) {\n return h(DtEmoji, { code: item, size: this.size });\n }\n return h('span', { class: 'd-emoji-text-wrapper__text' }, item);\n });\n },\n\n /**\n * Recursively search the Vue virtual DOM to find text\n * @param VNode\n * @returns {VNode|*}\n */\n searchVNodes (VNode) {\n if (!VNode) return;\n if (typeof VNode === 'string') return this.searchCodes(VNode);\n if (VNode.type === COMMENT_TYPE) return VNode;\n if (typeof VNode.type === 'symbol') return this.searchCodes(VNode.children);\n if (VNode.props?.innerHTML) return this.searchVNodes(VNode.props.innerHTML);\n\n const children = Array.isArray(VNode.children) ? VNode.children : [VNode.children];\n return h(VNode.type, VNode.props, children.map(VNodeChild => this.searchVNodes(VNodeChild)));\n },\n\n // TODO: Find a way to crawl vue components\n replaceVueComponentVNodeContent () {\n //\n },\n\n /**\n * Find codes in text.\n * @param textContent string\n * @returns {Array<VNode|string>|string}\n */\n searchCodes (textContent) {\n const shortcodes = findShortCodes(textContent);\n const emojis = findEmojis(textContent);\n\n const replaceList = [...shortcodes, ...emojis];\n if (replaceList.length === 0) return textContent;\n return this.replaceDtEmojis(replaceList, textContent);\n },\n },\n\n render () {\n const defaultSlotContent = this.$slots.default ? this.$slots.default() : [];\n return h(\n this.elementType,\n {\n 'data-qa': 'emoji-text-wrapper',\n class: 'd-emoji-text-wrapper',\n },\n this.loadingEmojiJson\n ? defaultSlotContent\n : defaultSlotContent.map(VNode => this.searchVNodes(VNode)),\n );\n },\n};\n</script>\n"],"mappings":"+TAOA,IAAM,GAAA,EAAA,EAAA,IAAA,EAAA,EAAA,yBAAyC,KAAK,CAAC,CAAC,KAMjD,EAAU,CACb,KAAM,qBAEN,WAAY,CACV,QAAA,EAAA,QACD,CAED,MAAO,CAIL,YAAa,CACX,KAAM,OACN,QAAS,MACV,CAMD,KAAM,CACJ,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,IACT,UAAW,EAAA,qBAAqB,EAAA,oBAAoB,CACrD,CACF,CAED,MAAQ,CACN,MAAO,CACL,iBAAkB,GACnB,EAGH,MAAM,SAAW,CACf,KAAK,iBAAmB,IAG1B,QAAS,CAKP,gBAAiB,EAAa,EAAa,CACzC,GAAI,CAAC,EAAY,OAAQ,OAAO,EAEhC,IAAM,EAAqB,EAAY,IAAI,GACzC,EAAK,QAAQ,MAAO,MAAM,CAC3B,CAEK,EAAa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findEmojis as e, findShortCodes as t } from "../../common/emoji/index.js";
2
- import { ICON_SIZE_MODIFIERS as n } from "../icon/icon-constants.js";
3
- import r from "../emoji/emoji.js";
4
- import { h as i, resolveDynamicComponent as a } from "vue";
1
+ import { ordinalSizeValidator as e } from "../../common/validators/index.js";
2
+ import { findEmojis as t, findShortCodes as n } from "../../common/emoji/index.js";
3
+ import { ICON_SIZE_MODIFIERS as r } from "../icon/icon-constants.js";
4
+ import i from "../emoji/emoji.js";
5
+ import { h as a, resolveDynamicComponent as o } from "vue";
5
6
  //#region components/EmojiTextWrapper/EmojiTextWrapper.vue
6
- var o = i(a(null)).type, s = {
7
+ var s = a(o(null)).type, c = {
7
8
  name: "DtEmojiTextWrapper",
8
- components: { DtEmoji: r },
9
+ components: { DtEmoji: i },
9
10
  props: {
10
11
  elementType: {
11
12
  type: String,
12
13
  default: "div"
13
14
  },
14
15
  size: {
15
- type: String,
16
- default: "500",
17
- validator: (e) => Object.keys(n).includes(e)
16
+ type: [String, Number],
17
+ default: 500,
18
+ validator: e(r)
18
19
  }
19
20
  },
20
21
  data() {
@@ -26,36 +27,36 @@ var o = i(a(null)).type, s = {
26
27
  methods: {
27
28
  replaceDtEmojis(e, t) {
28
29
  if (!e.length) return t;
29
- let n = e.map((e) => e.replace(/\*/g, "\\*")), a = RegExp(`(${n.join("|")})`, "g");
30
- return t.split(a).filter((e) => e.trim() !== "").map((t) => e.includes(t) ? i(r, {
30
+ let n = e.map((e) => e.replace(/\*/g, "\\*")), r = RegExp(`(${n.join("|")})`, "g");
31
+ return t.split(r).filter((e) => e.trim() !== "").map((t) => e.includes(t) ? a(i, {
31
32
  code: t,
32
33
  size: this.size
33
- }) : i("span", { class: "d-emoji-text-wrapper__text" }, t));
34
+ }) : a("span", { class: "d-emoji-text-wrapper__text" }, t));
34
35
  },
35
36
  searchVNodes(e) {
36
37
  if (!e) return;
37
38
  if (typeof e == "string") return this.searchCodes(e);
38
- if (e.type === o) return e;
39
+ if (e.type === s) return e;
39
40
  if (typeof e.type == "symbol") return this.searchCodes(e.children);
40
41
  if (e.props?.innerHTML) return this.searchVNodes(e.props.innerHTML);
41
42
  let t = Array.isArray(e.children) ? e.children : [e.children];
42
- return i(e.type, e.props, t.map((e) => this.searchVNodes(e)));
43
+ return a(e.type, e.props, t.map((e) => this.searchVNodes(e)));
43
44
  },
44
45
  replaceVueComponentVNodeContent() {},
45
- searchCodes(n) {
46
- let r = t(n), i = e(n), a = [...r, ...i];
47
- return a.length === 0 ? n : this.replaceDtEmojis(a, n);
46
+ searchCodes(e) {
47
+ let r = n(e), i = t(e), a = [...r, ...i];
48
+ return a.length === 0 ? e : this.replaceDtEmojis(a, e);
48
49
  }
49
50
  },
50
51
  render() {
51
52
  let e = this.$slots.default ? this.$slots.default() : [];
52
- return i(this.elementType, {
53
+ return a(this.elementType, {
53
54
  "data-qa": "emoji-text-wrapper",
54
55
  class: "d-emoji-text-wrapper"
55
56
  }, this.loadingEmojiJson ? e : e.map((e) => this.searchVNodes(e)));
56
57
  }
57
58
  };
58
59
  //#endregion
59
- export { s as default };
60
+ export { c as default };
60
61
 
61
62
  //# sourceMappingURL=emoji-text-wrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"emoji-text-wrapper.js","names":[],"sources":["../../../components/EmojiTextWrapper/EmojiTextWrapper.vue"],"sourcesContent":["<script>\nimport { DtEmoji } from '../Emoji';\nimport { findEmojis, findShortCodes } from '@/common/emoji';\nimport { h, resolveDynamicComponent } from 'vue';\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon/IconConstants';\n\nconst COMMENT_TYPE = h(resolveDynamicComponent(null)).type;\n\n/**\n * Wrapper to find and replace shortcodes like :smile: or unicode chars such as 😄 with our custom Emojis implementation.\n * @see https://dialtone.dialpad.com/components/emoji_text_wrapper.html\n */\nexport default {\n name: 'DtEmojiTextWrapper',\n\n components: {\n DtEmoji,\n },\n\n props: {\n /**\n * Element type (tag name) to use for the wrapper.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * The icon size to render the emojis at.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default: '500',\n validator: (t) => Object.keys(ICON_SIZE_MODIFIERS).includes(t),\n },\n },\n\n data () {\n return {\n loadingEmojiJson: true,\n };\n },\n\n async created () {\n this.loadingEmojiJson = false;\n },\n\n methods: {\n /**\n * Replaces the valid codes from the text content with a DtEmoji component.\n * @returns {Array<VNode|string>}\n */\n replaceDtEmojis (replaceList, textContent) {\n if (!replaceList.length) return textContent;\n // Escape the asterisk to avoid breaking the regex for the asterisk emoji\n const escapedReplaceList = replaceList.map(item =>\n item.replace(/\\*/g, '\\\\*'),\n );\n\n const regexp = new RegExp(`(${escapedReplaceList.join('|')})`, 'g');\n const items = textContent.split(regexp);\n\n return items\n .filter(item => item.trim() !== '')\n .map((item) => {\n if (replaceList.includes(item)) {\n return h(DtEmoji, { code: item, size: this.size });\n }\n return h('span', { class: 'd-emoji-text-wrapper__text' }, item);\n });\n },\n\n /**\n * Recursively search the Vue virtual DOM to find text\n * @param VNode\n * @returns {VNode|*}\n */\n searchVNodes (VNode) {\n if (!VNode) return;\n if (typeof VNode === 'string') return this.searchCodes(VNode);\n if (VNode.type === COMMENT_TYPE) return VNode;\n if (typeof VNode.type === 'symbol') return this.searchCodes(VNode.children);\n if (VNode.props?.innerHTML) return this.searchVNodes(VNode.props.innerHTML);\n\n const children = Array.isArray(VNode.children) ? VNode.children : [VNode.children];\n return h(VNode.type, VNode.props, children.map(VNodeChild => this.searchVNodes(VNodeChild)));\n },\n\n // TODO: Find a way to crawl vue components\n replaceVueComponentVNodeContent () {\n //\n },\n\n /**\n * Find codes in text.\n * @param textContent string\n * @returns {Array<VNode|string>|string}\n */\n searchCodes (textContent) {\n const shortcodes = findShortCodes(textContent);\n const emojis = findEmojis(textContent);\n\n const replaceList = [...shortcodes, ...emojis];\n if (replaceList.length === 0) return textContent;\n return this.replaceDtEmojis(replaceList, textContent);\n },\n },\n\n render () {\n const defaultSlotContent = this.$slots.default ? this.$slots.default() : [];\n return h(\n this.elementType,\n {\n 'data-qa': 'emoji-text-wrapper',\n class: 'd-emoji-text-wrapper',\n },\n this.loadingEmojiJson\n ? defaultSlotContent\n : defaultSlotContent.map(VNode => this.searchVNodes(VNode)),\n );\n },\n};\n</script>\n"],"mappings":";;;;;AAMA,IAAM,IAAe,EAAE,EAAwB,KAAK,CAAC,CAAC,MAMjD,IAAU;CACb,MAAM;CAEN,YAAY,EACV,SAAA,GACD;CAED,OAAO;EAIL,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAMD,MAAM;GACJ,MAAM;GACN,SAAS;GACT,YAAY,MAAM,OAAO,KAAK,EAAoB,CAAC,SAAS,EAAE;GAC/D;EACF;CAED,OAAQ;AACN,SAAO,EACL,kBAAkB,IACnB;;CAGH,MAAM,UAAW;AACf,OAAK,mBAAmB;;CAG1B,SAAS;EAKP,gBAAiB,GAAa,GAAa;AACzC,OAAI,CAAC,EAAY,OAAQ,QAAO;GAEhC,IAAM,IAAqB,EAAY,KAAI,MACzC,EAAK,QAAQ,OAAO,MAAM,CAC3B,EAEK,IAAa,OAAO,IAAI,EAAmB,KAAK,IAAI,CAAC,IAAI,IAAI;AAGnE,UAFc,EAAY,MAAM,EAAO,CAGpC,QAAO,MAAQ,EAAK,MAAK,KAAM,GAAE,CACjC,KAAK,MACA,EAAY,SAAS,EAAK,GACrB,EAAE,GAAS;IAAE,MAAM;IAAM,MAAM,KAAK;IAAM,CAAC,GAE7C,EAAE,QAAQ,EAAE,OAAO,8BAA8B,EAAE,EAAK,CAC/D;;EAQN,aAAc,GAAO;AACnB,OAAI,CAAC,EAAO;AACZ,OAAI,OAAO,KAAU,SAAU,QAAO,KAAK,YAAY,EAAM;AAC7D,OAAI,EAAM,SAAS,EAAc,QAAO;AACxC,OAAI,OAAO,EAAM,QAAS,SAAU,QAAO,KAAK,YAAY,EAAM,SAAS;AAC3E,OAAI,EAAM,OAAO,UAAW,QAAO,KAAK,aAAa,EAAM,MAAM,UAAU;GAE3E,IAAM,IAAW,MAAM,QAAQ,EAAM,SAAQ,GAAI,EAAM,WAAW,CAAC,EAAM,SAAS;AAClF,UAAO,EAAE,EAAM,MAAM,EAAM,OAAO,EAAS,KAAI,MAAc,KAAK,aAAa,EAAW,CAAC,CAAC;;EAI9F,kCAAmC;EASnC,YAAa,GAAa;GACxB,IAAM,IAAa,EAAe,EAAY,EACxC,IAAS,EAAW,EAAY,EAEhC,IAAc,CAAC,GAAG,GAAY,GAAG,EAAO;AAE9C,UADI,EAAY,WAAW,IAAU,IAC9B,KAAK,gBAAgB,GAAa,EAAY;;EAExD;CAED,SAAU;EACR,IAAM,IAAqB,KAAK,OAAO,UAAU,KAAK,OAAO,SAAQ,GAAI,EAAE;AAC3E,SAAO,EACL,KAAK,aACL;GACE,WAAW;GACX,OAAO;GACR,EACD,KAAK,mBACD,IACA,EAAmB,KAAI,MAAS,KAAK,aAAa,EAAM,CAAC,CAC9D;;CAEJ"}
1
+ {"version":3,"file":"emoji-text-wrapper.js","names":[],"sources":["../../../components/EmojiTextWrapper/EmojiTextWrapper.vue"],"sourcesContent":["<script>\nimport { DtEmoji } from '../Emoji';\nimport { findEmojis, findShortCodes } from '@/common/emoji';\nimport { h, resolveDynamicComponent } from 'vue';\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon/IconConstants';\nimport { ordinalSizeValidator } from '@/common/validators';\n\nconst COMMENT_TYPE = h(resolveDynamicComponent(null)).type;\n\n/**\n * Wrapper to find and replace shortcodes like :smile: or unicode chars such as 😄 with our custom Emojis implementation.\n * @see https://dialtone.dialpad.com/components/emoji_text_wrapper.html\n */\nexport default {\n name: 'DtEmojiTextWrapper',\n\n components: {\n DtEmoji,\n },\n\n props: {\n /**\n * Element type (tag name) to use for the wrapper.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * The icon size to render the emojis at.\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: [String, Number],\n default: 500,\n validator: ordinalSizeValidator(ICON_SIZE_MODIFIERS),\n },\n },\n\n data () {\n return {\n loadingEmojiJson: true,\n };\n },\n\n async created () {\n this.loadingEmojiJson = false;\n },\n\n methods: {\n /**\n * Replaces the valid codes from the text content with a DtEmoji component.\n * @returns {Array<VNode|string>}\n */\n replaceDtEmojis (replaceList, textContent) {\n if (!replaceList.length) return textContent;\n // Escape the asterisk to avoid breaking the regex for the asterisk emoji\n const escapedReplaceList = replaceList.map(item =>\n item.replace(/\\*/g, '\\\\*'),\n );\n\n const regexp = new RegExp(`(${escapedReplaceList.join('|')})`, 'g');\n const items = textContent.split(regexp);\n\n return items\n .filter(item => item.trim() !== '')\n .map((item) => {\n if (replaceList.includes(item)) {\n return h(DtEmoji, { code: item, size: this.size });\n }\n return h('span', { class: 'd-emoji-text-wrapper__text' }, item);\n });\n },\n\n /**\n * Recursively search the Vue virtual DOM to find text\n * @param VNode\n * @returns {VNode|*}\n */\n searchVNodes (VNode) {\n if (!VNode) return;\n if (typeof VNode === 'string') return this.searchCodes(VNode);\n if (VNode.type === COMMENT_TYPE) return VNode;\n if (typeof VNode.type === 'symbol') return this.searchCodes(VNode.children);\n if (VNode.props?.innerHTML) return this.searchVNodes(VNode.props.innerHTML);\n\n const children = Array.isArray(VNode.children) ? VNode.children : [VNode.children];\n return h(VNode.type, VNode.props, children.map(VNodeChild => this.searchVNodes(VNodeChild)));\n },\n\n // TODO: Find a way to crawl vue components\n replaceVueComponentVNodeContent () {\n //\n },\n\n /**\n * Find codes in text.\n * @param textContent string\n * @returns {Array<VNode|string>|string}\n */\n searchCodes (textContent) {\n const shortcodes = findShortCodes(textContent);\n const emojis = findEmojis(textContent);\n\n const replaceList = [...shortcodes, ...emojis];\n if (replaceList.length === 0) return textContent;\n return this.replaceDtEmojis(replaceList, textContent);\n },\n },\n\n render () {\n const defaultSlotContent = this.$slots.default ? this.$slots.default() : [];\n return h(\n this.elementType,\n {\n 'data-qa': 'emoji-text-wrapper',\n class: 'd-emoji-text-wr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AAO,EAAE,EAAM,MAAM,EAAM,OAAO,EAAS,KAAI,MAAc,KAAK,aAAa,EAAW,CAAC,CAAC;;EAI9F,kCAAmC;EASnC,YAAa,GAAa;GACxB,IAAM,IAAa,EAAe,EAAY,EACxC,IAAS,EAAW,EAAY,EAEhC,IAAc,CAAC,GAAG,GAAY,GAAG,EAAO;AAE9C,UADI,EAAY,WAAW,IAAU,IAC9B,KAAK,gBAAgB,GAAa,EAAY;;EAExD;CAED,SAAU;EACR,IAAM,IAAqB,KAAK,OAAO,UAAU,KAAK,OAAO,SAAQ,GAAI,EAAE;AAC3E,SAAO,EACL,KAAK,aACL;GACE,WAAW;GACX,OAAO;GACR,EACD,KAAK,mBACD,IACA,EAAmB,KAAI,MAAS,KAAK,aAAa,EAAM,CAAC,CAC9D;;CAEJ"}
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/utils/index.cjs`),t=require(`../text/text.cjs`),n=require(`../stack/stack.cjs`),r=require(`./empty-state-constants.cjs`);let i=require(`vue`);var a=Object.assign({name:`DtEmptyState`},{__name:`EmptyState`,props:{size:{type:[String,Number],default:400,validator:e=>Object.keys(r.EMPTY_STATE_SIZE_MODIFIERS).includes(String(e))},headerText:{type:String,required:!0},bodyText:{type:String,default:null},illustrationClass:{type:[String,Array,Object],default:``},iconClass:{type:[String,Array,Object],default:``},bodyClass:{type:[String,Array,Object],default:``}},setup(a){let o=(0,i.useSlots)(),s=a,c=(0,i.computed)(()=>e.hasSlotContent(o.icon)),l=(0,i.computed)(()=>e.hasSlotContent(o.illustration)),u=(0,i.computed)(()=>c.value&&(!l.value||p.value)),d=(0,i.computed)(()=>l.value&&!p.value),f=(0,i.computed)(()=>String(s.size)),p=(0,i.computed)(()=>f.value===`sm`||f.value===`200`),m=(0,i.computed)(()=>r.EMPTY_STATE_SIZE_MODIFIERS[f.value]),h=(0,i.computed)(()=>[`d-empty-state`,m.value]),g=(0,i.computed)(()=>r.EMPTY_STATE_CONTENT_SIZE_MODIFIERS[f.value]),_=(0,i.computed)(()=>r.EMPTY_STATE_HEADLINE_SIZES[f.value]),v=(0,i.computed)(()=>r.EMPTY_STATE_HEADLINE_DENSITIES[f.value]),y=(0,i.computed)(()=>r.EMPTY_STATE_BODY_SIZES[f.value]),b=(0,i.computed)(()=>r.EMPTY_STATE_BODY_DENSITIES[f.value]);return(0,i.onMounted)(()=>{!s.bodyText&&!e.hasSlotContent(o.body)&&console.error(`DtEmptyState: You should provide either bodyText or content on body slot.`)}),(r,s)=>((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(n.default),{class:(0,i.normalizeClass)(h.value)},{default:(0,i.withCtx)(()=>[d.value?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,{key:0,class:(0,i.normalizeClass)([`d-empty-state__illustration`,a.illustrationClass])},[(0,i.renderSlot)(r.$slots,`illustration`)],2)):(0,i.createCommentVNode)(``,!0),u.value?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,{key:1,class:(0,i.normalizeClass)([`d-empty-state__icon`,a.iconClass])},[(0,i.renderSlot)(r.$slots,`icon`,{iconSize:`800`})],2)):(0,i.createCommentVNode)(``,!0),(0,i.createVNode)((0,i.unref)(n.default),{gap:`150`,class:(0,i.normalizeClass)([`d-empty-state__content`,g.value])},{default:(0,i.withCtx)(()=>[(0,i.createVNode)((0,i.unref)(t.default),{kind:`headline`,size:_.value,density:v.value,wrap:`balance`,as:`div`,class:`d-empty-state__header-text`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(a.headerText),1)]),_:1},8,[`size`,`density`]),a.bodyText?((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(t.default),{key:0,kind:`body`,size:y.value,density:b.value,tone:`secondary`,wrap:`balance`,as:`p`,class:`d-empty-state__body-text`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(a.bodyText),1)]),_:1},8,[`size`,`density`])):(0,i.createCommentVNode)(``,!0)]),_:1},8,[`class`]),(0,i.unref)(e.hasSlotContent)((0,i.unref)(o).body)?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:2,class:(0,i.normalizeClass)(a.bodyClass)},[(0,i.renderSlot)(r.$slots,`body`)],2)):(0,i.createCommentVNode)(``,!0)]),_:3},8,[`class`]))}});exports.default=a;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../common/utils/index.cjs`),n=require(`../text/text.cjs`),r=require(`../stack/stack.cjs`),i=require(`./empty-state-constants.cjs`);let a=require(`vue`);var o=Object.assign({name:`DtEmptyState`},{__name:`EmptyState`,props:{size:{type:[String,Number],default:400,validator:e.ordinalSizeValidator(i.EMPTY_STATE_SIZE_MODIFIERS)},headerText:{type:String,required:!0},bodyText:{type:String,default:null},illustrationClass:{type:[String,Array,Object],default:``},iconClass:{type:[String,Array,Object],default:``},bodyClass:{type:[String,Array,Object],default:``}},setup(e){let o=(0,a.useSlots)(),s=e,c=(0,a.computed)(()=>t.hasSlotContent(o.icon)),l=(0,a.computed)(()=>t.hasSlotContent(o.illustration)),u=(0,a.computed)(()=>c.value&&(!l.value||p.value)),d=(0,a.computed)(()=>l.value&&!p.value),f=(0,a.computed)(()=>String(s.size)),p=(0,a.computed)(()=>f.value===`sm`||f.value===`200`),m=(0,a.computed)(()=>i.EMPTY_STATE_SIZE_MODIFIERS[f.value]),h=(0,a.computed)(()=>[`d-empty-state`,m.value]),g=(0,a.computed)(()=>i.EMPTY_STATE_CONTENT_SIZE_MODIFIERS[f.value]),_=(0,a.computed)(()=>i.EMPTY_STATE_HEADLINE_SIZES[f.value]),v=(0,a.computed)(()=>i.EMPTY_STATE_HEADLINE_DENSITIES[f.value]),y=(0,a.computed)(()=>i.EMPTY_STATE_BODY_SIZES[f.value]),b=(0,a.computed)(()=>i.EMPTY_STATE_BODY_DENSITIES[f.value]);return(0,a.onMounted)(()=>{!s.bodyText&&!t.hasSlotContent(o.body)&&console.error(`DtEmptyState: You should provide either bodyText or content on body slot.`)}),(i,s)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(r.default),{class:(0,a.normalizeClass)(h.value)},{default:(0,a.withCtx)(()=>[d.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,{key:0,class:(0,a.normalizeClass)([`d-empty-state__illustration`,e.illustrationClass])},[(0,a.renderSlot)(i.$slots,`illustration`)],2)):(0,a.createCommentVNode)(``,!0),u.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,{key:1,class:(0,a.normalizeClass)([`d-empty-state__icon`,e.iconClass])},[(0,a.renderSlot)(i.$slots,`icon`,{iconSize:`800`})],2)):(0,a.createCommentVNode)(``,!0),(0,a.createVNode)((0,a.unref)(r.default),{gap:`150`,class:(0,a.normalizeClass)([`d-empty-state__content`,g.value])},{default:(0,a.withCtx)(()=>[(0,a.createVNode)((0,a.unref)(n.default),{kind:`headline`,size:_.value,density:v.value,wrap:`balance`,as:`div`,class:`d-empty-state__header-text`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(e.headerText),1)]),_:1},8,[`size`,`density`]),e.bodyText?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(n.default),{key:0,kind:`body`,size:y.value,density:b.value,tone:`secondary`,wrap:`balance`,as:`p`,class:`d-empty-state__body-text`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(e.bodyText),1)]),_:1},8,[`size`,`density`])):(0,a.createCommentVNode)(``,!0)]),_:1},8,[`class`]),(0,a.unref)(t.hasSlotContent)((0,a.unref)(o).body)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:2,class:(0,a.normalizeClass)(e.bodyClass)},[(0,a.renderSlot)(i.$slots,`body`)],2)):(0,a.createCommentVNode)(``,!0)]),_:3},8,[`class`]))}});exports.default=o;
2
2
  //# sourceMappingURL=empty-state.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty-state.cjs","names":[],"sources":["../../../components/EmptyState/EmptyState.vue"],"sourcesContent":["<template>\n <dt-stack\n :class=\"emptyStateClasses\"\n >\n <span\n v-if=\"showIllustration\"\n :class=\"['d-empty-state__illustration', illustrationClass]\"\n >\n <!-- @slot Slot for the illustration. Displays when size is 'lg' or 'md'. Overrides icon. -->\n <slot name=\"illustration\" />\n </span>\n\n <span\n v-if=\"showIcon\"\n :class=\"['d-empty-state__icon', iconClass]\"\n >\n <!-- @slot Slot for the icon. Displayed if illustration is not provided. -->\n <slot\n name=\"icon\"\n :icon-size=\"'800'\"\n />\n </span>\n\n <dt-stack\n gap=\"150\"\n :class=\"['d-empty-state__content', contentClass]\"\n >\n <dt-text\n kind=\"headline\"\n :size=\"headlineSize\"\n :density=\"headlineDensity\"\n wrap=\"balance\"\n as=\"div\"\n class=\"d-empty-state__header-text\"\n >\n {{ headerText }}\n </dt-text>\n\n <dt-text\n v-if=\"bodyText\"\n kind=\"body\"\n :size=\"bodySize\"\n :density=\"bodyDensity\"\n tone=\"secondary\"\n wrap=\"balance\"\n as=\"p\"\n class=\"d-empty-state__body-text\"\n >\n {{ bodyText }}\n </dt-text>\n </dt-stack>\n\n <div\n v-if=\"hasSlotContent(slots.body)\"\n :class=\"bodyClass\"\n >\n <slot name=\"body\" />\n </div>\n </dt-stack>\n</template>\n\n<script setup>\nimport { useSlots, computed, onMounted } from 'vue';\nimport { DtStack } from '@/components/Stack';\nimport { DtText } from '@/components/Text';\nimport { hasSlotContent } from '@/common/utils';\nimport {\n EMPTY_STATE_BODY_DENSITIES,\n EMPTY_STATE_BODY_SIZES,\n EMPTY_STATE_CONTENT_SIZE_MODIFIERS,\n EMPTY_STATE_HEADLINE_DENSITIES,\n EMPTY_STATE_HEADLINE_SIZES,\n EMPTY_STATE_SIZE_MODIFIERS,\n} from './EmptyStateConstants.js';\n\ndefineOptions({\n name: 'DtEmptyState',\n});\n\nconst slots = useSlots();\n\nconst props = defineProps({\n /**\n * The empty state size.\n * @values 200, 300, 400\n */\n size: {\n type: [String, Number],\n default: 400,\n validator: (s) => Object.keys(EMPTY_STATE_SIZE_MODIFIERS).includes(String(s)),\n },\n\n /**\n * Header text\n * @type {String}\n */\n headerText: {\n type: String,\n required: true,\n },\n\n /**\n * Body text\n * @type {String}\n */\n bodyText: {\n type: String,\n default: null,\n },\n\n /**\n * Additional class name for the illustration wrapper element.\n */\n illustrationClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the body slot wrapper element.\n */\n bodyClass: {\n type: [String, Array, Object],\n default: '',\n },\n});\n\nconst hasIcon = computed(() => {\n return hasSlotContent(slots.icon);\n});\nconst hasIllustration = computed(() => hasSlotContent(slots.illustration));\n\n/**\n * Icon will be shown in lg and md size only if illustration is not provided\n * Icon will always be shown in sm size\n */\nconst showIcon = computed(() => hasIcon.value && (!hasIllustration.value || isSmallSize.value));\n\n/**\n * Illustration will always be shown in lg and md size\n * Illustration will not be shown in sm size\n */\nconst showIllustration = computed(() => hasIllustration.value && !isSmallSize.value);\n\nconst sizeKey = computed(() => String(props.size));\nconst isSmallSize = computed(() => sizeKey.value === 'sm' || sizeKey.value === '200');\n\nconst sizeClass = computed(() => EMPTY_STATE_SIZE_MODIFIERS[sizeKey.value]);\n\nconst emptyStateClasses = computed(() => ['d-empty-state', sizeClass.value]);\n\nconst contentClass = computed(() => EMPTY_STATE_CONTENT_SIZE_MODIFIERS[sizeKey.value]);\n\nconst headlineSize = computed(() => EMPTY_STATE_HEADLINE_SIZES[sizeKey.value]);\nconst headlineDensity = computed(() => EMPTY_STATE_HEADLINE_DENSITIES[sizeKey.value]);\n\nconst bodySize = computed(() => EMPTY_STATE_BODY_SIZES[sizeKey.value]);\nconst bodyDensity = computed(() => EMPTY_STATE_BODY_DENSITIES[sizeKey.value]);\n\nonMounted(() => {\n if (!props.bodyText && !hasSlotContent(slots.body)) {\n console.error('DtEmptyState: You should provide either bodyText or content on body slot.');\n }\n});\n</script>\n"],"mappings":"ytBA+EA,IAAM,GAAA,EAAA,EAAA,WAAkB,CAElB,EAAQ,EAsDR,GAAA,EAAA,EAAA,cACG,EAAA,eAAe,EAAM,KAAK,CACjC,CACI,GAAA,EAAA,EAAA,cAAiC,EAAA,eAAe,EAAM,aAAa,CAAC,CAMpE,GAAA,EAAA,EAAA,cAA0B,EAAQ,QAAU,CAAC,EAAgB,OAAS,EAAY,OAAO,CAMzF,GAAA,EAAA,EAAA,cAAkC,EAAgB,OAAS,CAAC,EAAY,MAAM,CAE9E,GAAA,EAAA,EAAA,cAAyB,OAAO,EAAM,KAAK,CAAC,CAC5C,GAAA,EAAA,EAAA,cAA6B,EAAQ,QAAU,MAAQ,EAAQ,QAAU,MAAM,CAE/E,GAAA,EAAA,EAAA,cAA2B,EAAA,2BAA2B,EAAQ,OAAO,CAErE,GAAA,EAAA,EAAA,cAAmC,CAAC,gBAAiB,EAAU,MAAM,CAAC,CAEtE,GAAA,EAAA,EAAA,cAA8B,EAAA,mCAAmC,EAAQ,OAAO,CAEhF,GAAA,EAAA,EAAA,cAA8B,EAAA,2BAA2B,EAAQ,OAAO,CACxE,GAAA,EAAA,EAAA,cAAiC,EAAA,+BAA+B,EAAQ,OAAO,CAE/E,GAAA,EAAA,EAAA,cAA0B,EAAA,uBAAuB,EAAQ,OAAO,CAChE,GAAA,EAAA,EAAA,cAA6B,EAAA,2BAA2B,EAAQ,OAAO,QAE7E,EAAA,EAAA,eAAgB,CACV,CAAC,EAAM,UAAY,CAAC,EAAA,eAAe,EAAM,KAAK,EAChD,QAAQ,MAAM,4EAA4E,EAE5F,yDAjHW,EAAA,QAAA,CAAA,CAxDR,OAAA,EAAA,EAAA,gBAAO,EAAA,MAAiB,CAAA,CAAA,2BAQlB,CALC,EAAA,QAA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OAAA,CAAA,CAAA,EAAA,GAAA,EAAA,EAAA,oBAAA,GAAA,GAAA"}
1
+ {"version":3,"file":"empty-state.cjs","names":[],"sources":["../../../components/EmptyState/EmptyState.vue"],"sourcesContent":["<template>\n <dt-stack\n :class=\"emptyStateClasses\"\n >\n <span\n v-if=\"showIllustration\"\n :class=\"['d-empty-state__illustration', illustrationClass]\"\n >\n <!-- @slot Slot for the illustration. Displays when size is 'lg' or 'md'. Overrides icon. -->\n <slot name=\"illustration\" />\n </span>\n\n <span\n v-if=\"showIcon\"\n :class=\"['d-empty-state__icon', iconClass]\"\n >\n <!-- @slot Slot for the icon. Displayed if illustration is not provided. -->\n <slot\n name=\"icon\"\n :icon-size=\"'800'\"\n />\n </span>\n\n <dt-stack\n gap=\"150\"\n :class=\"['d-empty-state__content', contentClass]\"\n >\n <dt-text\n kind=\"headline\"\n :size=\"headlineSize\"\n :density=\"headlineDensity\"\n wrap=\"balance\"\n as=\"div\"\n class=\"d-empty-state__header-text\"\n >\n {{ headerText }}\n </dt-text>\n\n <dt-text\n v-if=\"bodyText\"\n kind=\"body\"\n :size=\"bodySize\"\n :density=\"bodyDensity\"\n tone=\"secondary\"\n wrap=\"balance\"\n as=\"p\"\n class=\"d-empty-state__body-text\"\n >\n {{ bodyText }}\n </dt-text>\n </dt-stack>\n\n <div\n v-if=\"hasSlotContent(slots.body)\"\n :class=\"bodyClass\"\n >\n <slot name=\"body\" />\n </div>\n </dt-stack>\n</template>\n\n<script setup>\nimport { useSlots, computed, onMounted } from 'vue';\nimport { DtStack } from '@/components/Stack';\nimport { DtText } from '@/components/Text';\nimport { hasSlotContent } from '@/common/utils';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport {\n EMPTY_STATE_BODY_DENSITIES,\n EMPTY_STATE_BODY_SIZES,\n EMPTY_STATE_CONTENT_SIZE_MODIFIERS,\n EMPTY_STATE_HEADLINE_DENSITIES,\n EMPTY_STATE_HEADLINE_SIZES,\n EMPTY_STATE_SIZE_MODIFIERS,\n} from './EmptyStateConstants.js';\n\ndefineOptions({\n name: 'DtEmptyState',\n});\n\nconst slots = useSlots();\n\nconst props = defineProps({\n /**\n * The empty state size.\n * @values 200, 300, 400\n */\n size: {\n type: [String, Number],\n default: 400,\n validator: ordinalSizeValidator(EMPTY_STATE_SIZE_MODIFIERS),\n },\n\n /**\n * Header text\n * @type {String}\n */\n headerText: {\n type: String,\n required: true,\n },\n\n /**\n * Body text\n * @type {String}\n */\n bodyText: {\n type: String,\n default: null,\n },\n\n /**\n * Additional class name for the illustration wrapper element.\n */\n illustrationClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the body slot wrapper element.\n */\n bodyClass: {\n type: [String, Array, Object],\n default: '',\n },\n});\n\nconst hasIcon = computed(() => {\n return hasSlotContent(slots.icon);\n});\nconst hasIllustration = computed(() => hasSlotContent(slots.illustration));\n\n/**\n * Icon will be shown in lg and md size only if illustration is not provided\n * Icon will always be shown in sm size\n */\nconst showIcon = computed(() => hasIcon.value && (!hasIllustration.value || isSmallSize.value));\n\n/**\n * Illustration will always be shown in lg and md size\n * Illustration will not be shown in sm size\n */\nconst showIllustration = computed(() => hasIllustration.value && !isSmallSize.value);\n\nconst sizeKey = computed(() => String(props.size));\nconst isSmallSize = computed(() => sizeKey.value === 'sm' || sizeKey.value === '200');\n\nconst sizeClass = computed(() => EMPTY_STATE_SIZE_MODIFIERS[sizeKey.value]);\n\nconst emptyStateClasses = computed(() => ['d-empty-state', sizeClass.value]);\n\nconst contentClass = computed(() => EMPTY_STATE_CONTENT_SIZE_MODIFIERS[sizeKey.value]);\n\nconst headlineSize = computed(() => EMPTY_STATE_HEADLINE_SIZES[sizeKey.value]);\nconst headlineDensity = computed(() => EMPTY_STATE_HEADLINE_DENSITIES[sizeKey.value]);\n\nconst bodySize = computed(() => EMPTY_STATE_BODY_SIZES[sizeKey.value]);\nconst bodyDensity = computed(() => EMPTY_STATE_BODY_DENSITIES[sizeKey.value]);\n\nonMounted(() => {\n if (!props.bodyText && !hasSlotContent(slots.body)) {\n console.error('DtEmptyState: You should provide either bodyText or content on body slot.');\n }\n});\n</script>\n"],"mappings":"4vBAgFA,IAAM,GAAA,EAAA,EAAA,WAAkB,CAElB,EAAQ,EAsDR,GAAA,EAAA,EAAA,cACG,EAAA,eAAe,EAAM,KAAK,CACjC,CACI,GAAA,EAAA,EAAA,cAAiC,EAAA,eAAe,EAAM,aAAa,CAAC,CAMpE,GAAA,EAAA,EAAA,cAA0B,EAAQ,QAAU,CAAC,EAAgB,OAAS,EAAY,OAAO,CAMzF,GAAA,EAAA,EAAA,cAAkC,EAAgB,OAAS,CAAC,EAAY,MAAM,CAE9E,GAAA,EAAA,EAAA,cAAyB,OAAO,EAAM,KAAK,CAAC,CAC5C,GAAA,EAAA,EAAA,cAA6B,EAAQ,QAAU,MAAQ,EAAQ,QAAU,MAAM,CAE/E,GAAA,EAAA,EAAA,cAA2B,EAAA,2BAA2B,EAAQ,OAAO,CAErE,GAAA,EAAA,EAAA,cAAmC,CAAC,gBAAiB,EAAU,MAAM,CAAC,CAEtE,GAAA,EAAA,EAAA,cAA8B,EAAA,mCAAmC,EAAQ,OAAO,CAEhF,GAAA,EAAA,EAAA,cAA8B,EAAA,2BAA2B,EAAQ,OAAO,CACxE,GAAA,EAAA,EAAA,cAAiC,EAAA,+BAA+B,EAAQ,OAAO,CAE/E,GAAA,EAAA,EAAA,cAA0B,EAAA,uBAAuB,EAAQ,OAAO,CAChE,GAAA,EAAA,EAAA,cAA6B,EAAA,2BAA2B,EAAQ,OAAO,QAE7E,EAAA,EAAA,eAAgB,CACV,CAAC,EAAM,UAAY,CAAC,EAAA,eAAe,EAAM,KAAK,EAChD,QAAQ,MAAM,4EAA4E,EAE5F,yDAlHW,EAAA,QAAA,CAAA,CAxDR,OAAA,EAAA,EAAA,gBAAO,EAAA,MAAiB,CAAA,CAAA,2BAQl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AEG,EAAA,OAAA,OAAA,CAAA,CAAA,EAAA,GAAA,EAAA,EAAA,oBAAA,GAAA,GAAA"}
@@ -1,16 +1,17 @@
1
- import { hasSlotContent as e } from "../../common/utils/index.js";
2
- import t from "../text/text.js";
3
- import n from "../stack/stack.js";
4
- import { EMPTY_STATE_BODY_DENSITIES as r, EMPTY_STATE_BODY_SIZES as i, EMPTY_STATE_CONTENT_SIZE_MODIFIERS as a, EMPTY_STATE_HEADLINE_DENSITIES as o, EMPTY_STATE_HEADLINE_SIZES as s, EMPTY_STATE_SIZE_MODIFIERS as c } from "./empty-state-constants.js";
5
- import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createTextVNode as p, createVNode as m, normalizeClass as h, onMounted as g, openBlock as _, renderSlot as v, toDisplayString as y, unref as b, useSlots as x, withCtx as S } from "vue";
1
+ import { ordinalSizeValidator as e } from "../../common/validators/index.js";
2
+ import { hasSlotContent as t } from "../../common/utils/index.js";
3
+ import n from "../text/text.js";
4
+ import r from "../stack/stack.js";
5
+ import { EMPTY_STATE_BODY_DENSITIES as i, EMPTY_STATE_BODY_SIZES as a, EMPTY_STATE_CONTENT_SIZE_MODIFIERS as o, EMPTY_STATE_HEADLINE_DENSITIES as s, EMPTY_STATE_HEADLINE_SIZES as c, EMPTY_STATE_SIZE_MODIFIERS as l } from "./empty-state-constants.js";
6
+ import { computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createTextVNode as m, createVNode as h, normalizeClass as g, onMounted as _, openBlock as v, renderSlot as y, toDisplayString as b, unref as x, useSlots as S, withCtx as C } from "vue";
6
7
  //#region components/EmptyState/EmptyState.vue
7
- var C = /* @__PURE__ */ Object.assign({ name: "DtEmptyState" }, {
8
+ var w = /* @__PURE__ */ Object.assign({ name: "DtEmptyState" }, {
8
9
  __name: "EmptyState",
9
10
  props: {
10
11
  size: {
11
12
  type: [String, Number],
12
13
  default: 400,
13
- validator: (e) => Object.keys(c).includes(String(e))
14
+ validator: e(l)
14
15
  },
15
16
  headerText: {
16
17
  type: String,
@@ -45,25 +46,25 @@ var C = /* @__PURE__ */ Object.assign({ name: "DtEmptyState" }, {
45
46
  default: ""
46
47
  }
47
48
  },
48
- setup(C) {
49
- let w = x(), T = C, E = l(() => e(w.icon)), D = l(() => e(w.illustration)), O = l(() => E.value && (!D.value || j.value)), k = l(() => D.value && !j.value), A = l(() => String(T.size)), j = l(() => A.value === "sm" || A.value === "200"), M = l(() => c[A.value]), N = l(() => ["d-empty-state", M.value]), P = l(() => a[A.value]), F = l(() => s[A.value]), I = l(() => o[A.value]), L = l(() => i[A.value]), R = l(() => r[A.value]);
50
- return g(() => {
51
- !T.bodyText && !e(w.body) && console.error("DtEmptyState: You should provide either bodyText or content on body slot.");
52
- }), (r, i) => (_(), u(b(n), { class: h(N.value) }, {
53
- default: S(() => [
54
- k.value ? (_(), f("span", {
49
+ setup(e) {
50
+ let w = S(), T = e, E = u(() => t(w.icon)), D = u(() => t(w.illustration)), O = u(() => E.value && (!D.value || j.value)), k = u(() => D.value && !j.value), A = u(() => String(T.size)), j = u(() => A.value === "sm" || A.value === "200"), M = u(() => l[A.value]), N = u(() => ["d-empty-state", M.value]), P = u(() => o[A.value]), F = u(() => c[A.value]), I = u(() => s[A.value]), L = u(() => a[A.value]), R = u(() => i[A.value]);
51
+ return _(() => {
52
+ !T.bodyText && !t(w.body) && console.error("DtEmptyState: You should provide either bodyText or content on body slot.");
53
+ }), (i, a) => (v(), d(x(r), { class: g(N.value) }, {
54
+ default: C(() => [
55
+ k.value ? (v(), p("span", {
55
56
  key: 0,
56
- class: h(["d-empty-state__illustration", C.illustrationClass])
57
- }, [v(r.$slots, "illustration")], 2)) : d("", !0),
58
- O.value ? (_(), f("span", {
57
+ class: g(["d-empty-state__illustration", e.illustrationClass])
58
+ }, [y(i.$slots, "illustration")], 2)) : f("", !0),
59
+ O.value ? (v(), p("span", {
59
60
  key: 1,
60
- class: h(["d-empty-state__icon", C.iconClass])
61
- }, [v(r.$slots, "icon", { iconSize: "800" })], 2)) : d("", !0),
62
- m(b(n), {
61
+ class: g(["d-empty-state__icon", e.iconClass])
62
+ }, [y(i.$slots, "icon", { iconSize: "800" })], 2)) : f("", !0),
63
+ h(x(r), {
63
64
  gap: "150",
64
- class: h(["d-empty-state__content", P.value])
65
+ class: g(["d-empty-state__content", P.value])
65
66
  }, {
66
- default: S(() => [m(b(t), {
67
+ default: C(() => [h(x(n), {
67
68
  kind: "headline",
68
69
  size: F.value,
69
70
  density: I.value,
@@ -71,9 +72,9 @@ var C = /* @__PURE__ */ Object.assign({ name: "DtEmptyState" }, {
71
72
  as: "div",
72
73
  class: "d-empty-state__header-text"
73
74
  }, {
74
- default: S(() => [p(y(C.headerText), 1)]),
75
+ default: C(() => [m(b(e.headerText), 1)]),
75
76
  _: 1
76
- }, 8, ["size", "density"]), C.bodyText ? (_(), u(b(t), {
77
+ }, 8, ["size", "density"]), e.bodyText ? (v(), d(x(n), {
77
78
  key: 0,
78
79
  kind: "body",
79
80
  size: L.value,
@@ -83,21 +84,21 @@ var C = /* @__PURE__ */ Object.assign({ name: "DtEmptyState" }, {
83
84
  as: "p",
84
85
  class: "d-empty-state__body-text"
85
86
  }, {
86
- default: S(() => [p(y(C.bodyText), 1)]),
87
+ default: C(() => [m(b(e.bodyText), 1)]),
87
88
  _: 1
88
- }, 8, ["size", "density"])) : d("", !0)]),
89
+ }, 8, ["size", "density"])) : f("", !0)]),
89
90
  _: 1
90
91
  }, 8, ["class"]),
91
- b(e)(b(w).body) ? (_(), f("div", {
92
+ x(t)(x(w).body) ? (v(), p("div", {
92
93
  key: 2,
93
- class: h(C.bodyClass)
94
- }, [v(r.$slots, "body")], 2)) : d("", !0)
94
+ class: g(e.bodyClass)
95
+ }, [y(i.$slots, "body")], 2)) : f("", !0)
95
96
  ]),
96
97
  _: 3
97
98
  }, 8, ["class"]));
98
99
  }
99
100
  });
100
101
  //#endregion
101
- export { C as default };
102
+ export { w as default };
102
103
 
103
104
  //# sourceMappingURL=empty-state.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty-state.js","names":[],"sources":["../../../components/EmptyState/EmptyState.vue"],"sourcesContent":["<template>\n <dt-stack\n :class=\"emptyStateClasses\"\n >\n <span\n v-if=\"showIllustration\"\n :class=\"['d-empty-state__illustration', illustrationClass]\"\n >\n <!-- @slot Slot for the illustration. Displays when size is 'lg' or 'md'. Overrides icon. -->\n <slot name=\"illustration\" />\n </span>\n\n <span\n v-if=\"showIcon\"\n :class=\"['d-empty-state__icon', iconClass]\"\n >\n <!-- @slot Slot for the icon. Displayed if illustration is not provided. -->\n <slot\n name=\"icon\"\n :icon-size=\"'800'\"\n />\n </span>\n\n <dt-stack\n gap=\"150\"\n :class=\"['d-empty-state__content', contentClass]\"\n >\n <dt-text\n kind=\"headline\"\n :size=\"headlineSize\"\n :density=\"headlineDensity\"\n wrap=\"balance\"\n as=\"div\"\n class=\"d-empty-state__header-text\"\n >\n {{ headerText }}\n </dt-text>\n\n <dt-text\n v-if=\"bodyText\"\n kind=\"body\"\n :size=\"bodySize\"\n :density=\"bodyDensity\"\n tone=\"secondary\"\n wrap=\"balance\"\n as=\"p\"\n class=\"d-empty-state__body-text\"\n >\n {{ bodyText }}\n </dt-text>\n </dt-stack>\n\n <div\n v-if=\"hasSlotContent(slots.body)\"\n :class=\"bodyClass\"\n >\n <slot name=\"body\" />\n </div>\n </dt-stack>\n</template>\n\n<script setup>\nimport { useSlots, computed, onMounted } from 'vue';\nimport { DtStack } from '@/components/Stack';\nimport { DtText } from '@/components/Text';\nimport { hasSlotContent } from '@/common/utils';\nimport {\n EMPTY_STATE_BODY_DENSITIES,\n EMPTY_STATE_BODY_SIZES,\n EMPTY_STATE_CONTENT_SIZE_MODIFIERS,\n EMPTY_STATE_HEADLINE_DENSITIES,\n EMPTY_STATE_HEADLINE_SIZES,\n EMPTY_STATE_SIZE_MODIFIERS,\n} from './EmptyStateConstants.js';\n\ndefineOptions({\n name: 'DtEmptyState',\n});\n\nconst slots = useSlots();\n\nconst props = defineProps({\n /**\n * The empty state size.\n * @values 200, 300, 400\n */\n size: {\n type: [String, Number],\n default: 400,\n validator: (s) => Object.keys(EMPTY_STATE_SIZE_MODIFIERS).includes(String(s)),\n },\n\n /**\n * Header text\n * @type {String}\n */\n headerText: {\n type: String,\n required: true,\n },\n\n /**\n * Body text\n * @type {String}\n */\n bodyText: {\n type: String,\n default: null,\n },\n\n /**\n * Additional class name for the illustration wrapper element.\n */\n illustrationClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the body slot wrapper element.\n */\n bodyClass: {\n type: [String, Array, Object],\n default: '',\n },\n});\n\nconst hasIcon = computed(() => {\n return hasSlotContent(slots.icon);\n});\nconst hasIllustration = computed(() => hasSlotContent(slots.illustration));\n\n/**\n * Icon will be shown in lg and md size only if illustration is not provided\n * Icon will always be shown in sm size\n */\nconst showIcon = computed(() => hasIcon.value && (!hasIllustration.value || isSmallSize.value));\n\n/**\n * Illustration will always be shown in lg and md size\n * Illustration will not be shown in sm size\n */\nconst showIllustration = computed(() => hasIllustration.value && !isSmallSize.value);\n\nconst sizeKey = computed(() => String(props.size));\nconst isSmallSize = computed(() => sizeKey.value === 'sm' || sizeKey.value === '200');\n\nconst sizeClass = computed(() => EMPTY_STATE_SIZE_MODIFIERS[sizeKey.value]);\n\nconst emptyStateClasses = computed(() => ['d-empty-state', sizeClass.value]);\n\nconst contentClass = computed(() => EMPTY_STATE_CONTENT_SIZE_MODIFIERS[sizeKey.value]);\n\nconst headlineSize = computed(() => EMPTY_STATE_HEADLINE_SIZES[sizeKey.value]);\nconst headlineDensity = computed(() => EMPTY_STATE_HEADLINE_DENSITIES[sizeKey.value]);\n\nconst bodySize = computed(() => EMPTY_STATE_BODY_SIZES[sizeKey.value]);\nconst bodyDensity = computed(() => EMPTY_STATE_BODY_DENSITIES[sizeKey.value]);\n\nonMounted(() => {\n if (!props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C,EAGE,EAAA,QAAA,QAAA,EADC,UAAW,OAAK,CAAA,CAAA,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA;IAIrB,EA2BW,EAAA,EAAA,EAAA;KA1BT,KAAI;KACH,OAAK,EAAA,CAAA,0BAA6B,EAAA,MAAY,CAAA;;sBAWrC,CATV,EASU,EAAA,EAAA,EAAA;MARR,MAAK;MACJ,MAAM,EAAA;MACN,SAAS,EAAA;MACV,MAAK;MACL,IAAG;MACH,OAAM;;uBAEU,CAAA,EAAA,EAAb,EAAA,WAAU,EAAA,EAAA,CAAA,CAAA;;iCAIP,EAAA,YAAA,GAAA,EADR,EAWU,EAAA,EAAA,EAAA;;MATR,MAAK;MACJ,MAAM,EAAA;MACN,SAAS,EAAA;MACV,MAAK;MACL,MAAK;MACL,IAAG;MACH,OAAM;;uBAEQ,CAAA,EAAA,EAAX,EAAA,SAAQ,EAAA,EAAA,CAAA,CAAA;;;;;IAKP,EAAA,EAAc,CAAC,EAAA,EAAK,CAAC,KAAI,IAAA,GAAA,EADjC,EAKM,OAAA;;KAHH,OAAK,EAAE,EAAA,UAAS;QAEjB,EAAoB,EAAA,QAAA,OAAA,CAAA,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA"}
1
+ {"version":3,"file":"empty-state.js","names":[],"sources":["../../../components/EmptyState/EmptyState.vue"],"sourcesContent":["<template>\n <dt-stack\n :class=\"emptyStateClasses\"\n >\n <span\n v-if=\"showIllustration\"\n :class=\"['d-empty-state__illustration', illustrationClass]\"\n >\n <!-- @slot Slot for the illustration. Displays when size is 'lg' or 'md'. Overrides icon. -->\n <slot name=\"illustration\" />\n </span>\n\n <span\n v-if=\"showIcon\"\n :class=\"['d-empty-state__icon', iconClass]\"\n >\n <!-- @slot Slot for the icon. Displayed if illustration is not provided. -->\n <slot\n name=\"icon\"\n :icon-size=\"'800'\"\n />\n </span>\n\n <dt-stack\n gap=\"150\"\n :class=\"['d-empty-state__content', contentClass]\"\n >\n <dt-text\n kind=\"headline\"\n :size=\"headlineSize\"\n :density=\"headlineDensity\"\n wrap=\"balance\"\n as=\"div\"\n class=\"d-empty-state__header-text\"\n >\n {{ headerText }}\n </dt-text>\n\n <dt-text\n v-if=\"bodyText\"\n kind=\"body\"\n :size=\"bodySize\"\n :density=\"bodyDensity\"\n tone=\"secondary\"\n wrap=\"balance\"\n as=\"p\"\n class=\"d-empty-state__body-text\"\n >\n {{ bodyText }}\n </dt-text>\n </dt-stack>\n\n <div\n v-if=\"hasSlotContent(slots.body)\"\n :class=\"bodyClass\"\n >\n <slot name=\"body\" />\n </div>\n </dt-stack>\n</template>\n\n<script setup>\nimport { useSlots, computed, onMounted } from 'vue';\nimport { DtStack } from '@/components/Stack';\nimport { DtText } from '@/components/Text';\nimport { hasSlotContent } from '@/common/utils';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport {\n EMPTY_STATE_BODY_DENSITIES,\n EMPTY_STATE_BODY_SIZES,\n EMPTY_STATE_CONTENT_SIZE_MODIFIERS,\n EMPTY_STATE_HEADLINE_DENSITIES,\n EMPTY_STATE_HEADLINE_SIZES,\n EMPTY_STATE_SIZE_MODIFIERS,\n} from './EmptyStateConstants.js';\n\ndefineOptions({\n name: 'DtEmptyState',\n});\n\nconst slots = useSlots();\n\nconst props = defineProps({\n /**\n * The empty state size.\n * @values 200, 300, 400\n */\n size: {\n type: [String, Number],\n default: 400,\n validator: ordinalSizeValidator(EMPTY_STATE_SIZE_MODIFIERS),\n },\n\n /**\n * Header text\n * @type {String}\n */\n headerText: {\n type: String,\n required: true,\n },\n\n /**\n * Body text\n * @type {String}\n */\n bodyText: {\n type: String,\n default: null,\n },\n\n /**\n * Additional class name for the illustration wrapper element.\n */\n illustrationClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the icon wrapper element.\n */\n iconClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the body slot wrapper element.\n */\n bodyClass: {\n type: [String, Array, Object],\n default: '',\n },\n});\n\nconst hasIcon = computed(() => {\n return hasSlotContent(slots.icon);\n});\nconst hasIllustration = computed(() => hasSlotContent(slots.illustration));\n\n/**\n * Icon will be shown in lg and md size only if illustration is not provided\n * Icon will always be shown in sm size\n */\nconst showIcon = computed(() => hasIcon.value && (!hasIllustration.value || isSmallSize.value));\n\n/**\n * Illustration will always be shown in lg and md size\n * Illustration will not be shown in sm size\n */\nconst showIllustration = computed(() => hasIllustration.value && !isSmallSize.value);\n\nconst sizeKey = computed(() => String(props.size));\nconst isSmallSize = computed(() => sizeKey.value === 'sm' || sizeKey.value === '200');\n\nconst sizeClass = computed(() => EMPTY_STATE_SIZE_MODIFIERS[sizeKey.value]);\n\nconst emptyStateClasses = computed(() => ['d-empty-state', sizeClass.value]);\n\nconst contentClass = computed(() => EMPTY_STATE_CONTENT_SIZE_MODIFIERS[sizeKey.value]);\n\nconst headlineSize = computed(() => EMPTY_STATE_HEADLINE_SIZES[sizeKey.value]);\nconst headlineDensity = computed(() => EMPTY_STATE_HEADLINE_DENSITIES[sizeKey.value]);\n\nconst bodySize = computed(() => EMPTY_STATE_BODY_SIZES[sizeKey.value]);\nconst bodyDensity = computed(() => EMPTY_STATE_BODY_DENSITIES[sizeKey.value]);\n\nonMounted(() => {\n if (!props.bodyText && !hasSlotContent(slots.body)) {\n console.error('DtEmptyState: You should provide either bodyText or content on body slot.');\n }\n});\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFA,IAAM,IAAQ,GAAU,EAElB,IAAQ,GAsDR,IAAU,QACP,EAAe,EAAM,KAAK,CACjC,EACI,IAAkB,QAAe,EAAe,EAAM,aAAa,CAAC,EAMpE,IAAW,QAAe,EAAQ,UAAU,CAAC,EAAgB,SAAS,EAAY,OAAO,EAMzF,IAAmB,QAAe,EAAgB,SAAS,CAAC,EAAY,MAAM,EAE9E,IAAU,QAAe,OAAO,EAAM,KAAK,CAAC,EAC5C,IAAc,QAAe,EAAQ,UAA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S,EAAA;MACV,MAAK;MACL,MAAK;MACL,IAAG;MACH,OAAM;;uBAEQ,CAAA,EAAA,EAAX,EAAA,SAAQ,EAAA,EAAA,CAAA,CAAA;;;;;IAKP,EAAA,EAAc,CAAC,EAAA,EAAK,CAAC,KAAI,IAAA,GAAA,EADjC,EAKM,OAAA;;KAHH,OAAK,EAAE,EAAA,UAAS;QAEjB,EAAoB,EAAA,QAAA,OAAA,CAAA,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA"}
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`../../mode_constants-CzYJW9ua.cjs`),r=require(`../button/button-constants.cjs`),i=require(`../../localization/index.cjs`),a=require(`../button/button.cjs`),o=require(`../checkbox/checkbox.cjs`),s=require(`../checkbox-group/checkbox-group.cjs`),c=require(`../list-item/list-item.cjs`),l=require(`../stack/stack.cjs`),u=require(`../popover/popover-constants.cjs`),d=require(`../popover/popover.cjs`),f=require(`../dropdown/dropdown.cjs`);let p=require(`vue`),m=require(`@dialpad/dialtone-icons/vue`);var h={name:`DtFilterPill`,components:{DtCheckboxGroup:s.default,DtCheckbox:o.default,DtPopover:d.default,DtButton:a.default,DtIconClose:m.DtIconClose,DtIconChevronDown:m.DtIconChevronDown,DtDropdown:f.default,DtListItem:c.default,DtStack:l.default},props:{useDropdown:{type:Boolean,default:!1},deferSelection:{type:Boolean,default:!1},modelValue:{type:Array,default:()=>[]},startTooltipText:{type:String,default:``},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},showClear:{type:Boolean,default:!0},label:{type:String,default:void 0},endTooltipText:{type:String,default:``},popoverAppendTo:{type:[e.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>u.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},popoverFallbackPlacements:{type:Array,default:()=>[`auto`]},popoverMaxHeight:{type:String,default:``},popoverMaxWidth:{type:String,default:``},popoverPadding:{type:String,default:`large`,validator:e=>Object.keys(u.POPOVER_PADDING_CLASSES).some(t=>t===e)},popoverPlacement:{type:String,default:`bottom-start`},labelClass:{type:[String,Array,Object],default:``},popoverContentClass:{type:[String,Array,Object],default:``},popoverHeaderClass:{type:[String,Array,Object],default:``},popoverFooterClass:{type:[String,Array,Object],default:``},popoverDialogClass:{type:[String,Array,Object],default:``},dropdownListClass:{type:[String,Array,Object],default:``},contentMode:n.t,size:{type:[String,Number],default:200,validator:e=>Object.keys(r.BUTTON_SIZE_MODIFIERS).includes(String(e))}},emits:[`clear`,`open`,`update:modelValue`,`apply`],data(){return{isOpen:!1,i18n:new i.DialtoneLocalization,filters:this.modelValue,pendingFilters:null}},computed:{overlayComponent(){return this.useDropdown?`dt-dropdown`:`dt-popover`},overlayProps(){let e={"append-to":this.popoverAppendTo,"fallback-placements":this.popoverFallbackPlacements,"max-height":this.popoverMaxHeight,"max-width":this.popoverMaxWidth,modal:!0,placement:this.popoverPlacement};return this.useDropdown?e[`list-class`]=this.dropdownListClass:(e.padding=this.popoverPadding,e[`content-class`]=this.popoverContentClass,e[`header-wrapper-class`]=this.popoverHeaderClass,e[`footer-wrapper-class`]=this.popoverFooterClass,e[`dialog-class`]=this.popoverDialogClass),e},buttonKind(){return this.isActive&&!this.disabled?`default`:`muted`},resolvedStartTooltipText(){return this.readOnly?this.startTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_READ_ONLY_TOOLTIP`):this.startTooltipText},clearButtonAriaLabel(){return this.endTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_CLEAR_BUTTON_LABEL`)},clearButtonTitle(){if(!this.endTooltipText)return this.clearButtonAriaLabel},activeFilters(){return this.filters.filter(e=>e.active).map(e=>e.name)},activeFilterList(){return this.activeFilters.length===this.filters.length&&this.filters.length>1?`All`:this.activeFilters[0]??``},activeFilterOverflow(){return this.activeFilters.length<=1||this.activeFilters.length===this.filters.length&&this.filters.length>1?``:`+`+(this.activeFilters.length-1)},isActive(){return this.activeFilterList.length>0},hasClear(){return!this.readOnly&&this.showClear&&this.activeFilterList.length>0},displayFilters(){return this.deferSelection&&this.pendingFilters?this.pendingFilters:this.filters},pendingActiveFilters(){return this.pendingFilters?this.pendingFilters.filter(e=>e.active).map(e=>e.name):[]},cancelButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_CANCEL_BUTTON_LABEL`)},applyButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL`)},clearIconSize(){return String(this.size)===`100`?`100`:r.BUTTON_ICON_SIZES[String(this.size)]}},watch:{isOpen(e){this.$emit(`open`,e),this.deferSelection&&(e?this.pendingFilters=JSON.parse(JSON.stringify(this.filters)):this.pendingFilters=null)},filters:{deep:!0,handler(e){this.$emit(`update:modelValue`,e)}}},mounted(){this.modelValue?.length||this.$slots.content&&this.$slots.content()||console.warn(`Please provide content through the v-model or the "content" slot.`),this.deferSelection&&this.useDropdown&&console.warn(`deferSelection has no effect when useDropdown is true.`)},methods:{clearFilter(e){this.filters.forEach(e=>delete e.active),this.$emit(`clear`,e)},openPopover(){this.readOnly||(this.isOpen=!0)},selectFilter(e,t){this.filters.forEach(t=>{t.active=t===e}),t()},applySelection(){this.pendingFilters&&(this.filters.forEach((e,t)=>{this.pendingFilters[t]?e.active=this.pendingFilters[t].active:delete e.active}),this.$emit(`apply`),this.isOpen=!1)},cancelSelection(){this.isOpen=!1}}},g=[`title`,`textContent`],_=[`title`,`textContent`],v=[`title`,`textContent`];function y(e,t,n,r,i,a){let o=(0,p.resolveComponent)(`dt-icon-chevron-down`),s=(0,p.resolveComponent)(`dt-button`),c=(0,p.resolveComponent)(`dt-checkbox`),l=(0,p.resolveComponent)(`dt-checkbox-group`),u=(0,p.resolveComponent)(`dt-stack`),d=(0,p.resolveComponent)(`dt-list-item`),f=(0,p.resolveComponent)(`dt-icon-close`),m=(0,p.resolveDirective)(`dt-tooltip`);return(0,p.openBlock)(),(0,p.createElementBlock)(`div`,{class:(0,p.normalizeClass)([`d-filter-pill`,{"d-filter-pill--read-only":n.readOnly}]),"data-qa":`dt-filter-pill`},[((0,p.openBlock)(),(0,p.createBlock)((0,p.resolveDynamicComponent)(a.overlayComponent),(0,p.mergeProps)({open:i.isOpen,"onUpdate:open":t[0]||(t[0]=e=>i.isOpen=e)},a.overlayProps,{"content-mode":n.contentMode}),(0,p.createSlots)({anchor:(0,p.withCtx)(t=>[(0,p.withDirectives)(((0,p.openBlock)(),(0,p.createBlock)(s,(0,p.mergeProps)(n.useDropdown?t:t.attrs,{active:a.isActive,"aria-disabled":n.readOnly||void 0,class:[`d-filter-pill__primary`,{"d-filter-pill--selected":a.isActive}],disabled:n.disabled,kind:a.buttonKind,size:n.size,"data-qa":`dt-filter-pill__button`,importance:`outlined`,onClick:a.openPopover,onKeydown:(0,p.withKeys)((0,p.withModifiers)(a.openPopover,[`prevent`]),[`up`,`down`])}),(0,p.createSlots)({default:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`span`,{class:(0,p.normalizeClass)([`d-filter-pill__label`,n.labelClass])},[(0,p.renderSlot)(e.$slots,`default`,{label:n.label,filters:i.filters,activeFilters:a.activeFilters,activeFilterList:a.activeFilterList,activeFilterOverflow:a.activeFilterOverflow},()=>[(0,p.createElementVNode)(`span`,{class:`d-filter-pill__label-start`,title:n.label,textContent:(0,p.toDisplayString)(n.label)},null,8,g),a.activeFilterList?((0,p.openBlock)(),(0,p.createElementBlock)(`span`,{key:0,class:`d-filter-pill__label-end`,title:a.activeFilterList,textContent:(0,p.toDisplayString)(a.activeFilterList)},null,8,_)):(0,p.createCommentVNode)(``,!0),a.activeFilterOverflow?((0,p.openBlock)(),(0,p.createElementBlock)(`span`,{key:1,class:`d-filter-pill__label-end-overflow`,title:`plus ${a.activeFilters.length-1} others`,textContent:(0,p.toDisplayString)(a.activeFilterOverflow)},null,8,v)):(0,p.createCommentVNode)(``,!0)])],2)]),_:2},[e.$slots.startIcon?{name:`startIcon`,fn:(0,p.withCtx)(({iconSize:t})=>[(0,p.renderSlot)(e.$slots,`startIcon`,{iconSize:t})]),key:`0`}:void 0,n.readOnly?void 0:{name:`endIcon`,fn:(0,p.withCtx)(({iconSize:e})=>[(0,p.createVNode)(o,{size:e,class:`d-filter-pill__icon`,"data-qa":`dt-filter-pill__icon`},null,8,[`size`])]),key:`1`}]),1040,[`active`,`aria-disabled`,`class`,`disabled`,`kind`,`size`,`onClick`,`onKeydown`])),[[m,a.resolvedStartTooltipText]])]),_:2},[n.useDropdown?void 0:{name:`content`,fn:(0,p.withCtx)(({close:t})=>[(0,p.renderSlot)(e.$slots,`content`,{close:t,apply:a.applySelection,cancel:a.cancelSelection,pendingFilters:i.pendingFilters},()=>[n.modelValue?.length?((0,p.openBlock)(),(0,p.createBlock)(l,{key:0,"model-value":n.deferSelection?a.pendingActiveFilters:a.activeFilters,"aria-label":n.label,name:n.label||`filter-pill`},{default:(0,p.withCtx)(()=>[((0,p.openBlock)(!0),(0,p.createElementBlock)(p.Fragment,null,(0,p.renderList)(a.displayFilters,e=>((0,p.openBlock)(),(0,p.createBlock)(c,{key:e.name,label:e.name,value:e.name,"onUpdate:modelValue":t=>e.active=t},null,8,[`label`,`value`,`onUpdate:modelValue`]))),128))]),_:1},8,[`model-value`,`aria-label`,`name`])):(0,p.createCommentVNode)(``,!0)])]),key:`0`},!n.useDropdown&&e.$slots.headerContent?{name:`headerContent`,fn:(0,p.withCtx)(({close:t})=>[(0,p.renderSlot)(e.$slots,`headerContent`,{close:t})]),key:`1`}:void 0,!n.useDropdown&&(n.deferSelection||e.$slots.footerContent)?{name:`footerContent`,fn:(0,p.withCtx)(({close:t})=>[(0,p.renderSlot)(e.$slots,`footerContent`,{close:t,apply:a.applySelection,cancel:a.cancelSelection},()=>[n.deferSelection?((0,p.openBlock)(),(0,p.createBlock)(u,{key:0,direction:`row`,gap:`400`,justify:`end`,"data-qa":`dt-filter-pill__deferred-footer`},{default:(0,p.withCtx)(()=>[(0,p.createVNode)(s,{importance:`clear`,kind:`muted`,size:200,"data-qa":`dt-filter-pill__cancel-button`,onClick:a.cancelSelection},{default:(0,p.withCtx)(()=>[(0,p.createTextVNode)((0,p.toDisplayString)(a.cancelButtonLabel),1)]),_:1},8,[`onClick`]),(0,p.createVNode)(s,{importance:`primary`,size:200,"data-qa":`dt-filter-pill__apply-button`,onClick:a.applySelection},{default:(0,p.withCtx)(()=>[(0,p.createTextVNode)((0,p.toDisplayString)(a.applyButtonLabel),1)]),_:1},8,[`onClick`])]),_:1})):(0,p.createCommentVNode)(``,!0)])]),key:`2`}:void 0,n.useDropdown?{name:`list`,fn:(0,p.withCtx)(({close:t})=>[(0,p.renderSlot)(e.$slots,`content`,{close:t},()=>[((0,p.openBlock)(!0),(0,p.createElementBlock)(p.Fragment,null,(0,p.renderList)(i.filters,e=>((0,p.openBlock)(),(0,p.createBlock)(d,{key:e.name,role:`menuitem`,"navigation-type":`arrow-keys`,selected:e.active,onClick:n=>a.selectFilter(e,t)},{default:(0,p.withCtx)(()=>[(0,p.createTextVNode)((0,p.toDisplayString)(e.name),1)]),_:2},1032,[`selected`,`onClick`]))),128))])]),key:`3`}:void 0]),1040,[`open`,`content-mode`])),a.hasClear?(0,p.withDirectives)(((0,p.openBlock)(),(0,p.createBlock)(s,{key:0,active:a.isActive,"aria-label":a.clearButtonAriaLabel,class:(0,p.normalizeClass)([`d-filter-pill__clear`,{"d-filter-pill__clear--selected":a.isActive}]),disabled:n.disabled,kind:a.buttonKind,size:n.size,title:a.clearButtonTitle,"data-qa":`dt-filter-pill__clear-button`,importance:`outlined`,onClick:a.clearFilter},{icon:(0,p.withCtx)(()=>[(0,p.createVNode)(f,{size:a.clearIconSize},null,8,[`size`])]),_:1},8,[`active`,`aria-label`,`class`,`disabled`,`kind`,`size`,`title`,`onClick`])),[[m,n.endTooltipText]]):(0,p.createCommentVNode)(``,!0)],2)}var b=t.t(h,[[`render`,y]]);exports.default=b;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/index.cjs`),t=require(`../../common/validators/index.cjs`),n=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`../../mode_constants-CzYJW9ua.cjs`),i=require(`../button/button-constants.cjs`),a=require(`../../localization/index.cjs`),o=require(`../button/button.cjs`),s=require(`../checkbox/checkbox.cjs`),c=require(`../checkbox-group/checkbox-group.cjs`),l=require(`../list-item/list-item.cjs`),u=require(`../stack/stack.cjs`),d=require(`../popover/popover-constants.cjs`),f=require(`../popover/popover.cjs`),p=require(`../dropdown/dropdown.cjs`);let m=require(`vue`),h=require(`@dialpad/dialtone-icons/vue`);var g={name:`DtFilterPill`,components:{DtCheckboxGroup:c.default,DtCheckbox:s.default,DtPopover:f.default,DtButton:o.default,DtIconClose:h.DtIconClose,DtIconChevronDown:h.DtIconChevronDown,DtDropdown:p.default,DtListItem:l.default,DtStack:u.default},props:{useDropdown:{type:Boolean,default:!1},deferSelection:{type:Boolean,default:!1},modelValue:{type:Array,default:()=>[]},startTooltipText:{type:String,default:``},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},showClear:{type:Boolean,default:!0},label:{type:String,default:void 0},endTooltipText:{type:String,default:``},popoverAppendTo:{type:[e.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>d.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},popoverFallbackPlacements:{type:Array,default:()=>[`auto`]},popoverMaxHeight:{type:String,default:``},popoverMaxWidth:{type:String,default:``},popoverPadding:{type:String,default:`large`,validator:e=>Object.keys(d.POPOVER_PADDING_CLASSES).some(t=>t===e)},popoverPlacement:{type:String,default:`bottom-start`},labelClass:{type:[String,Array,Object],default:``},popoverContentClass:{type:[String,Array,Object],default:``},popoverHeaderClass:{type:[String,Array,Object],default:``},popoverFooterClass:{type:[String,Array,Object],default:``},popoverDialogClass:{type:[String,Array,Object],default:``},dropdownListClass:{type:[String,Array,Object],default:``},contentMode:r.t,size:{type:[String,Number],default:200,validator:t.ordinalSizeValidator(i.BUTTON_SIZE_MODIFIERS)}},emits:[`clear`,`open`,`update:modelValue`,`apply`],data(){return{isOpen:!1,i18n:new a.DialtoneLocalization,filters:this.modelValue,pendingFilters:null}},computed:{overlayComponent(){return this.useDropdown?`dt-dropdown`:`dt-popover`},overlayProps(){let e={"append-to":this.popoverAppendTo,"fallback-placements":this.popoverFallbackPlacements,"max-height":this.popoverMaxHeight,"max-width":this.popoverMaxWidth,modal:!0,placement:this.popoverPlacement};return this.useDropdown?e[`list-class`]=this.dropdownListClass:(e.padding=this.popoverPadding,e[`content-class`]=this.popoverContentClass,e[`header-wrapper-class`]=this.popoverHeaderClass,e[`footer-wrapper-class`]=this.popoverFooterClass,e[`dialog-class`]=this.popoverDialogClass),e},buttonKind(){return this.isActive&&!this.disabled?`default`:`muted`},resolvedStartTooltipText(){return this.readOnly?this.startTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_READ_ONLY_TOOLTIP`):this.startTooltipText},clearButtonAriaLabel(){return this.endTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_CLEAR_BUTTON_LABEL`)},clearButtonTitle(){if(!this.endTooltipText)return this.clearButtonAriaLabel},activeFilters(){return this.filters.filter(e=>e.active).map(e=>e.name)},activeFilterList(){return this.activeFilters.length===this.filters.length&&this.filters.length>1?`All`:this.activeFilters[0]??``},activeFilterOverflow(){return this.activeFilters.length<=1||this.activeFilters.length===this.filters.length&&this.filters.length>1?``:`+`+(this.activeFilters.length-1)},isActive(){return this.activeFilterList.length>0},hasClear(){return!this.readOnly&&this.showClear&&this.activeFilterList.length>0},displayFilters(){return this.deferSelection&&this.pendingFilters?this.pendingFilters:this.filters},pendingActiveFilters(){return this.pendingFilters?this.pendingFilters.filter(e=>e.active).map(e=>e.name):[]},cancelButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_CANCEL_BUTTON_LABEL`)},applyButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL`)},clearIconSize(){return String(this.size)===`100`?`100`:i.BUTTON_ICON_SIZES[String(this.size)]}},watch:{isOpen(e){this.$emit(`open`,e),this.deferSelection&&(e?this.pendingFilters=JSON.parse(JSON.stringify(this.filters)):this.pendingFilters=null)},filters:{deep:!0,handler(e){this.$emit(`update:modelValue`,e)}}},mounted(){this.modelValue?.length||this.$slots.content&&this.$slots.content()||console.warn(`Please provide content through the v-model or the "content" slot.`),this.deferSelection&&this.useDropdown&&console.warn(`deferSelection has no effect when useDropdown is true.`)},methods:{clearFilter(e){this.filters.forEach(e=>delete e.active),this.$emit(`clear`,e)},openPopover(){this.readOnly||(this.isOpen=!0)},selectFilter(e,t){this.filters.forEach(t=>{t.active=t===e}),t()},applySelection(){this.pendingFilters&&(this.filters.forEach((e,t)=>{this.pendingFilters[t]?e.active=this.pendingFilters[t].active:delete e.active}),this.$emit(`apply`),this.isOpen=!1)},cancelSelection(){this.isOpen=!1}}},_=[`title`,`textContent`],v=[`title`,`textContent`],y=[`title`,`textContent`];function b(e,t,n,r,i,a){let o=(0,m.resolveComponent)(`dt-icon-chevron-down`),s=(0,m.resolveComponent)(`dt-button`),c=(0,m.resolveComponent)(`dt-checkbox`),l=(0,m.resolveComponent)(`dt-checkbox-group`),u=(0,m.resolveComponent)(`dt-stack`),d=(0,m.resolveComponent)(`dt-list-item`),f=(0,m.resolveComponent)(`dt-icon-close`),p=(0,m.resolveDirective)(`dt-tooltip`);return(0,m.openBlock)(),(0,m.createElementBlock)(`div`,{class:(0,m.normalizeClass)([`d-filter-pill`,{"d-filter-pill--read-only":n.readOnly}]),"data-qa":`dt-filter-pill`},[((0,m.openBlock)(),(0,m.createBlock)((0,m.resolveDynamicComponent)(a.overlayComponent),(0,m.mergeProps)({open:i.isOpen,"onUpdate:open":t[0]||(t[0]=e=>i.isOpen=e)},a.overlayProps,{"content-mode":n.contentMode}),(0,m.createSlots)({anchor:(0,m.withCtx)(t=>[(0,m.withDirectives)(((0,m.openBlock)(),(0,m.createBlock)(s,(0,m.mergeProps)(n.useDropdown?t:t.attrs,{active:a.isActive,"aria-disabled":n.readOnly||void 0,class:[`d-filter-pill__primary`,{"d-filter-pill--selected":a.isActive}],disabled:n.disabled,kind:a.buttonKind,size:n.size,"data-qa":`dt-filter-pill__button`,importance:`outlined`,onClick:a.openPopover,onKeydown:(0,m.withKeys)((0,m.withModifiers)(a.openPopover,[`prevent`]),[`up`,`down`])}),(0,m.createSlots)({default:(0,m.withCtx)(()=>[(0,m.createElementVNode)(`span`,{class:(0,m.normalizeClass)([`d-filter-pill__label`,n.labelClass])},[(0,m.renderSlot)(e.$slots,`default`,{label:n.label,filters:i.filters,activeFilters:a.activeFilters,activeFilterList:a.activeFilterList,activeFilterOverflow:a.activeFilterOverflow},()=>[(0,m.createElementVNode)(`span`,{class:`d-filter-pill__label-start`,title:n.label,textContent:(0,m.toDisplayString)(n.label)},null,8,_),a.activeFilterList?((0,m.openBlock)(),(0,m.createElementBlock)(`span`,{key:0,class:`d-filter-pill__label-end`,title:a.activeFilterList,textContent:(0,m.toDisplayString)(a.activeFilterList)},null,8,v)):(0,m.createCommentVNode)(``,!0),a.activeFilterOverflow?((0,m.openBlock)(),(0,m.createElementBlock)(`span`,{key:1,class:`d-filter-pill__label-end-overflow`,title:`plus ${a.activeFilters.length-1} others`,textContent:(0,m.toDisplayString)(a.activeFilterOverflow)},null,8,y)):(0,m.createCommentVNode)(``,!0)])],2)]),_:2},[e.$slots.startIcon?{name:`startIcon`,fn:(0,m.withCtx)(({iconSize:t})=>[(0,m.renderSlot)(e.$slots,`startIcon`,{iconSize:t})]),key:`0`}:void 0,n.readOnly?void 0:{name:`endIcon`,fn:(0,m.withCtx)(({iconSize:e})=>[(0,m.createVNode)(o,{size:e,class:`d-filter-pill__icon`,"data-qa":`dt-filter-pill__icon`},null,8,[`size`])]),key:`1`}]),1040,[`active`,`aria-disabled`,`class`,`disabled`,`kind`,`size`,`onClick`,`onKeydown`])),[[p,a.resolvedStartTooltipText]])]),_:2},[n.useDropdown?void 0:{name:`content`,fn:(0,m.withCtx)(({close:t})=>[(0,m.renderSlot)(e.$slots,`content`,{close:t,apply:a.applySelection,cancel:a.cancelSelection,pendingFilters:i.pendingFilters},()=>[n.modelValue?.length?((0,m.openBlock)(),(0,m.createBlock)(l,{key:0,"model-value":n.deferSelection?a.pendingActiveFilters:a.activeFilters,"aria-label":n.label,name:n.label||`filter-pill`},{default:(0,m.withCtx)(()=>[((0,m.openBlock)(!0),(0,m.createElementBlock)(m.Fragment,null,(0,m.renderList)(a.displayFilters,e=>((0,m.openBlock)(),(0,m.createBlock)(c,{key:e.name,label:e.name,value:e.name,"onUpdate:modelValue":t=>e.active=t},null,8,[`label`,`value`,`onUpdate:modelValue`]))),128))]),_:1},8,[`model-value`,`aria-label`,`name`])):(0,m.createCommentVNode)(``,!0)])]),key:`0`},!n.useDropdown&&e.$slots.headerContent?{name:`headerContent`,fn:(0,m.withCtx)(({close:t})=>[(0,m.renderSlot)(e.$slots,`headerContent`,{close:t})]),key:`1`}:void 0,!n.useDropdown&&(n.deferSelection||e.$slots.footerContent)?{name:`footerContent`,fn:(0,m.withCtx)(({close:t})=>[(0,m.renderSlot)(e.$slots,`footerContent`,{close:t,apply:a.applySelection,cancel:a.cancelSelection},()=>[n.deferSelection?((0,m.openBlock)(),(0,m.createBlock)(u,{key:0,direction:`row`,gap:`400`,justify:`end`,"data-qa":`dt-filter-pill__deferred-footer`},{default:(0,m.withCtx)(()=>[(0,m.createVNode)(s,{importance:`clear`,kind:`muted`,size:200,"data-qa":`dt-filter-pill__cancel-button`,onClick:a.cancelSelection},{default:(0,m.withCtx)(()=>[(0,m.createTextVNode)((0,m.toDisplayString)(a.cancelButtonLabel),1)]),_:1},8,[`onClick`]),(0,m.createVNode)(s,{importance:`primary`,size:200,"data-qa":`dt-filter-pill__apply-button`,onClick:a.applySelection},{default:(0,m.withCtx)(()=>[(0,m.createTextVNode)((0,m.toDisplayString)(a.applyButtonLabel),1)]),_:1},8,[`onClick`])]),_:1})):(0,m.createCommentVNode)(``,!0)])]),key:`2`}:void 0,n.useDropdown?{name:`list`,fn:(0,m.withCtx)(({close:t})=>[(0,m.renderSlot)(e.$slots,`content`,{close:t},()=>[((0,m.openBlock)(!0),(0,m.createElementBlock)(m.Fragment,null,(0,m.renderList)(i.filters,e=>((0,m.openBlock)(),(0,m.createBlock)(d,{key:e.name,role:`menuitem`,"navigation-type":`arrow-keys`,selected:e.active,onClick:n=>a.selectFilter(e,t)},{default:(0,m.withCtx)(()=>[(0,m.createTextVNode)((0,m.toDisplayString)(e.name),1)]),_:2},1032,[`selected`,`onClick`]))),128))])]),key:`3`}:void 0]),1040,[`open`,`content-mode`])),a.hasClear?(0,m.withDirectives)(((0,m.openBlock)(),(0,m.createBlock)(s,{key:0,active:a.isActive,"aria-label":a.clearButtonAriaLabel,class:(0,m.normalizeClass)([`d-filter-pill__clear`,{"d-filter-pill__clear--selected":a.isActive}]),disabled:n.disabled,kind:a.buttonKind,size:n.size,title:a.clearButtonTitle,"data-qa":`dt-filter-pill__clear-button`,importance:`outlined`,onClick:a.clearFilter},{icon:(0,m.withCtx)(()=>[(0,m.createVNode)(f,{size:a.clearIconSize},null,8,[`size`])]),_:1},8,[`active`,`aria-label`,`class`,`disabled`,`kind`,`size`,`title`,`onClick`])),[[p,n.endTooltipText]]):(0,m.createCommentVNode)(``,!0)],2)}var x=n.t(g,[[`render`,b]]);exports.default=x;
2
2
  //# sourceMappingURL=filter-pill.cjs.map