@dialpad/dialtone 9.124.0 → 9.125.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/README.md +9 -2
  2. package/dist/tokens/doc.json +24416 -24416
  3. package/dist/vue2/common/mixins/index.cjs +1 -1
  4. package/dist/vue2/common/mixins/index.js +10 -10
  5. package/dist/vue2/common/mixins/localization.cjs +2 -0
  6. package/dist/vue2/common/mixins/localization.cjs.map +1 -0
  7. package/dist/vue2/common/mixins/localization.js +10 -0
  8. package/dist/vue2/common/mixins/localization.js.map +1 -0
  9. package/dist/vue2/common/utils/index.cjs +1 -1
  10. package/dist/vue2/common/utils/index.cjs.map +1 -1
  11. package/dist/vue2/common/utils/index.js +43 -39
  12. package/dist/vue2/common/utils/index.js.map +1 -1
  13. package/dist/vue2/component-documentation.json +1 -1
  14. package/dist/vue2/dialtone-vue.cjs +1 -1
  15. package/dist/vue2/dialtone-vue.js +341 -340
  16. package/dist/vue2/dialtone-vue.js.map +1 -1
  17. package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs +1 -1
  18. package/dist/vue2/lib/attachment-carousel/attachment-carousel.cjs.map +1 -1
  19. package/dist/vue2/lib/attachment-carousel/attachment-carousel.js +61 -86
  20. package/dist/vue2/lib/attachment-carousel/attachment-carousel.js.map +1 -1
  21. package/dist/vue2/lib/banner/banner.cjs +2 -2
  22. package/dist/vue2/lib/banner/banner.cjs.map +1 -1
  23. package/dist/vue2/lib/banner/banner.js +25 -33
  24. package/dist/vue2/lib/banner/banner.js.map +1 -1
  25. package/dist/vue2/lib/breadcrumbs/breadcrumbs.cjs +1 -1
  26. package/dist/vue2/lib/breadcrumbs/breadcrumbs.cjs.map +1 -1
  27. package/dist/vue2/lib/breadcrumbs/breadcrumbs.js +14 -12
  28. package/dist/vue2/lib/breadcrumbs/breadcrumbs.js.map +1 -1
  29. package/dist/vue2/lib/button/button.cjs +1 -1
  30. package/dist/vue2/lib/button/button.cjs.map +1 -1
  31. package/dist/vue2/lib/button/button.js +11 -9
  32. package/dist/vue2/lib/button/button.js.map +1 -1
  33. package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
  34. package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs.map +1 -1
  35. package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +19 -25
  36. package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +1 -1
  37. package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
  38. package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs.map +1 -1
  39. package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js +18 -21
  40. package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +1 -1
  41. package/dist/vue2/lib/chip/chip.cjs +1 -1
  42. package/dist/vue2/lib/chip/chip.cjs.map +1 -1
  43. package/dist/vue2/lib/chip/chip.js +24 -29
  44. package/dist/vue2/lib/chip/chip.js.map +1 -1
  45. package/dist/vue2/lib/combobox/combobox-constants.cjs +1 -1
  46. package/dist/vue2/lib/combobox/combobox-constants.cjs.map +1 -1
  47. package/dist/vue2/lib/combobox/combobox-constants.js +2 -2
  48. package/dist/vue2/lib/combobox/combobox-constants.js.map +1 -1
  49. package/dist/vue2/lib/combobox/combobox-empty-list.cjs.map +1 -1
  50. package/dist/vue2/lib/combobox/combobox-empty-list.js.map +1 -1
  51. package/dist/vue2/lib/combobox/combobox-loading-list.cjs.map +1 -1
  52. package/dist/vue2/lib/combobox/combobox-loading-list.js.map +1 -1
  53. package/dist/vue2/lib/combobox/combobox.cjs +2 -2
  54. package/dist/vue2/lib/combobox/combobox.cjs.map +1 -1
  55. package/dist/vue2/lib/combobox/combobox.js +12 -12
  56. package/dist/vue2/lib/combobox/combobox.js.map +1 -1
  57. package/dist/vue2/lib/combobox/index.cjs +1 -1
  58. package/dist/vue2/lib/combobox/index.js +3 -3
  59. package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
  60. package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
  61. package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js +16 -18
  62. package/dist/vue2/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
  63. package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
  64. package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
  65. package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.js +22 -24
  66. package/dist/vue2/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
  67. package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs +1 -1
  68. package/dist/vue2/lib/contact-centers-row/contact-centers-row.cjs.map +1 -1
  69. package/dist/vue2/lib/contact-centers-row/contact-centers-row.js +40 -36
  70. package/dist/vue2/lib/contact-centers-row/contact-centers-row.js.map +1 -1
  71. package/dist/vue2/lib/contact-row/contact-row.cjs +1 -1
  72. package/dist/vue2/lib/contact-row/contact-row.cjs.map +1 -1
  73. package/dist/vue2/lib/contact-row/contact-row.js +11 -25
  74. package/dist/vue2/lib/contact-row/contact-row.js.map +1 -1
  75. package/dist/vue2/lib/datepicker/datepicker-constants.cjs +1 -1
  76. package/dist/vue2/lib/datepicker/datepicker-constants.cjs.map +1 -1
  77. package/dist/vue2/lib/datepicker/datepicker-constants.js +2 -3
  78. package/dist/vue2/lib/datepicker/datepicker-constants.js.map +1 -1
  79. package/dist/vue2/lib/datepicker/datepicker.cjs +1 -1
  80. package/dist/vue2/lib/datepicker/datepicker.cjs.map +1 -1
  81. package/dist/vue2/lib/datepicker/datepicker.js +143 -229
  82. package/dist/vue2/lib/datepicker/datepicker.js.map +1 -1
  83. package/dist/vue2/lib/datepicker/utils.cjs +1 -1
  84. package/dist/vue2/lib/datepicker/utils.cjs.map +1 -1
  85. package/dist/vue2/lib/datepicker/utils.js +12 -11
  86. package/dist/vue2/lib/datepicker/utils.js.map +1 -1
  87. package/dist/vue2/lib/description-list/description-list.cjs +1 -1
  88. package/dist/vue2/lib/description-list/description-list.cjs.map +1 -1
  89. package/dist/vue2/lib/description-list/description-list.js +8 -8
  90. package/dist/vue2/lib/description-list/description-list.js.map +1 -1
  91. package/dist/vue2/lib/dropdown/dropdown.cjs +1 -1
  92. package/dist/vue2/lib/dropdown/dropdown.cjs.map +1 -1
  93. package/dist/vue2/lib/dropdown/dropdown.js +48 -50
  94. package/dist/vue2/lib/dropdown/dropdown.js.map +1 -1
  95. package/dist/vue2/lib/editor/editor.cjs +1 -1
  96. package/dist/vue2/lib/editor/editor.cjs.map +1 -1
  97. package/dist/vue2/lib/editor/editor.js +78 -87
  98. package/dist/vue2/lib/editor/editor.js.map +1 -1
  99. package/dist/vue2/lib/emoji-picker/emoji-picker-constants.cjs +1 -1
  100. package/dist/vue2/lib/emoji-picker/emoji-picker-constants.cjs.map +1 -1
  101. package/dist/vue2/lib/emoji-picker/emoji-picker-constants.js +6 -19
  102. package/dist/vue2/lib/emoji-picker/emoji-picker-constants.js.map +1 -1
  103. package/dist/vue2/lib/emoji-picker/emoji-picker.cjs +1 -1
  104. package/dist/vue2/lib/emoji-picker/emoji-picker.cjs.map +1 -1
  105. package/dist/vue2/lib/emoji-picker/emoji-picker.js +106 -145
  106. package/dist/vue2/lib/emoji-picker/emoji-picker.js.map +1 -1
  107. package/dist/vue2/lib/emoji-picker/index.cjs +1 -1
  108. package/dist/vue2/lib/emoji-picker/index.js +6 -7
  109. package/dist/vue2/lib/emoji-row/emoji-row-constants.cjs +1 -1
  110. package/dist/vue2/lib/emoji-row/emoji-row-constants.cjs.map +1 -1
  111. package/dist/vue2/lib/emoji-row/emoji-row-constants.js +5 -7
  112. package/dist/vue2/lib/emoji-row/emoji-row-constants.js.map +1 -1
  113. package/dist/vue2/lib/emoji-row/emoji-row.cjs +1 -1
  114. package/dist/vue2/lib/emoji-row/emoji-row.cjs.map +1 -1
  115. package/dist/vue2/lib/emoji-row/emoji-row.js +31 -22
  116. package/dist/vue2/lib/emoji-row/emoji-row.js.map +1 -1
  117. package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs +1 -1
  118. package/dist/vue2/lib/feed-item-pill/feed-item-pill.cjs.map +1 -1
  119. package/dist/vue2/lib/feed-item-pill/feed-item-pill.js +20 -22
  120. package/dist/vue2/lib/feed-item-pill/feed-item-pill.js.map +1 -1
  121. package/dist/vue2/lib/general-row/general-row.cjs +1 -1
  122. package/dist/vue2/lib/general-row/general-row.cjs.map +1 -1
  123. package/dist/vue2/lib/general-row/general-row.js +63 -52
  124. package/dist/vue2/lib/general-row/general-row.js.map +1 -1
  125. package/dist/vue2/lib/group-row/group-row.cjs +1 -1
  126. package/dist/vue2/lib/group-row/group-row.cjs.map +1 -1
  127. package/dist/vue2/lib/group-row/group-row.js +43 -32
  128. package/dist/vue2/lib/group-row/group-row.js.map +1 -1
  129. package/dist/vue2/lib/icon/icon-constants.cjs.map +1 -1
  130. package/dist/vue2/lib/icon/icon-constants.js.map +1 -1
  131. package/dist/vue2/lib/icon/icon.cjs +1 -1
  132. package/dist/vue2/lib/icon/icon.cjs.map +1 -1
  133. package/dist/vue2/lib/icon/icon.js +12 -8
  134. package/dist/vue2/lib/icon/icon.js.map +1 -1
  135. package/dist/vue2/lib/image-viewer/image-viewer.cjs +1 -1
  136. package/dist/vue2/lib/image-viewer/image-viewer.cjs.map +1 -1
  137. package/dist/vue2/lib/image-viewer/image-viewer.js +30 -31
  138. package/dist/vue2/lib/image-viewer/image-viewer.js.map +1 -1
  139. package/dist/vue2/lib/ivr-node/ivr-node-constants.cjs +1 -1
  140. package/dist/vue2/lib/ivr-node/ivr-node-constants.cjs.map +1 -1
  141. package/dist/vue2/lib/ivr-node/ivr-node-constants.js +24 -24
  142. package/dist/vue2/lib/ivr-node/ivr-node-constants.js.map +1 -1
  143. package/dist/vue2/lib/ivr-node/ivr-node.cjs +1 -1
  144. package/dist/vue2/lib/ivr-node/ivr-node.cjs.map +1 -1
  145. package/dist/vue2/lib/ivr-node/ivr-node.js +38 -36
  146. package/dist/vue2/lib/ivr-node/ivr-node.js.map +1 -1
  147. package/dist/vue2/lib/message-input/message-input-link.cjs +1 -1
  148. package/dist/vue2/lib/message-input/message-input-link.cjs.map +1 -1
  149. package/dist/vue2/lib/message-input/message-input-link.js +48 -23
  150. package/dist/vue2/lib/message-input/message-input-link.js.map +1 -1
  151. package/dist/vue2/lib/message-input/message-input-topbar.cjs +1 -1
  152. package/dist/vue2/lib/message-input/message-input-topbar.cjs.map +1 -1
  153. package/dist/vue2/lib/message-input/message-input-topbar.js +50 -22
  154. package/dist/vue2/lib/message-input/message-input-topbar.js.map +1 -1
  155. package/dist/vue2/lib/message-input/message-input.cjs +1 -1
  156. package/dist/vue2/lib/message-input/message-input.cjs.map +1 -1
  157. package/dist/vue2/lib/message-input/message-input.js +112 -143
  158. package/dist/vue2/lib/message-input/message-input.js.map +1 -1
  159. package/dist/vue2/lib/modal/modal.cjs +1 -2
  160. package/dist/vue2/lib/modal/modal.cjs.map +1 -1
  161. package/dist/vue2/lib/modal/modal.js +25 -42
  162. package/dist/vue2/lib/modal/modal.js.map +1 -1
  163. package/dist/vue2/lib/notice/notice-action.cjs +1 -1
  164. package/dist/vue2/lib/notice/notice-action.cjs.map +1 -1
  165. package/dist/vue2/lib/notice/notice-action.js +19 -26
  166. package/dist/vue2/lib/notice/notice-action.js.map +1 -1
  167. package/dist/vue2/lib/notice/notice.cjs +1 -1
  168. package/dist/vue2/lib/notice/notice.cjs.map +1 -1
  169. package/dist/vue2/lib/notice/notice.js +18 -27
  170. package/dist/vue2/lib/notice/notice.js.map +1 -1
  171. package/dist/vue2/lib/pagination/pagination.cjs +1 -1
  172. package/dist/vue2/lib/pagination/pagination.cjs.map +1 -1
  173. package/dist/vue2/lib/pagination/pagination.js +49 -58
  174. package/dist/vue2/lib/pagination/pagination.js.map +1 -1
  175. package/dist/vue2/lib/popover/popover-header-footer.cjs +1 -1
  176. package/dist/vue2/lib/popover/popover-header-footer.cjs.map +1 -1
  177. package/dist/vue2/lib/popover/popover-header-footer.js +24 -26
  178. package/dist/vue2/lib/popover/popover-header-footer.js.map +1 -1
  179. package/dist/vue2/lib/popover/popover.cjs +1 -1
  180. package/dist/vue2/lib/popover/popover.cjs.map +1 -1
  181. package/dist/vue2/lib/popover/popover.js +26 -35
  182. package/dist/vue2/lib/popover/popover.js.map +1 -1
  183. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +5 -5
  184. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  185. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +330 -320
  186. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  187. package/dist/vue2/lib/settings-menu-button/settings-menu-button.cjs.map +1 -1
  188. package/dist/vue2/lib/settings-menu-button/settings-menu-button.js.map +1 -1
  189. package/dist/vue2/lib/time-pill/time-pill.cjs.map +1 -1
  190. package/dist/vue2/lib/time-pill/time-pill.js.map +1 -1
  191. package/dist/vue2/lib/toast/toast.cjs +1 -1
  192. package/dist/vue2/lib/toast/toast.cjs.map +1 -1
  193. package/dist/vue2/lib/toast/toast.js +64 -97
  194. package/dist/vue2/lib/toast/toast.js.map +1 -1
  195. package/dist/vue2/lib/unread-pill/unread-pill.cjs +1 -1
  196. package/dist/vue2/lib/unread-pill/unread-pill.cjs.map +1 -1
  197. package/dist/vue2/lib/unread-pill/unread-pill.js +27 -18
  198. package/dist/vue2/lib/unread-pill/unread-pill.js.map +1 -1
  199. package/dist/vue2/localization/en-US.cjs +185 -0
  200. package/dist/vue2/localization/en-US.cjs.map +1 -0
  201. package/dist/vue2/localization/en-US.js +188 -0
  202. package/dist/vue2/localization/en-US.js.map +1 -0
  203. package/dist/vue2/localization/es-LA.cjs +169 -0
  204. package/dist/vue2/localization/es-LA.cjs.map +1 -0
  205. package/dist/vue2/localization/es-LA.js +172 -0
  206. package/dist/vue2/localization/es-LA.js.map +1 -0
  207. package/dist/vue2/localization/index.cjs +1176 -0
  208. package/dist/vue2/localization/index.cjs.map +1 -0
  209. package/dist/vue2/localization/index.js +1239 -0
  210. package/dist/vue2/localization/index.js.map +1 -0
  211. package/dist/vue2/node_modules/@tiptap/vue-2.cjs.map +1 -1
  212. package/dist/vue2/node_modules/@tiptap/vue-2.js.map +1 -1
  213. package/dist/vue2/shared/sr_only_close_button.cjs +1 -1
  214. package/dist/vue2/shared/sr_only_close_button.cjs.map +1 -1
  215. package/dist/vue2/shared/sr_only_close_button.js +19 -22
  216. package/dist/vue2/shared/sr_only_close_button.js.map +1 -1
  217. package/dist/vue2/types/common/mixins/index.d.ts +1 -1
  218. package/dist/vue2/types/common/mixins/localization.d.ts +8 -0
  219. package/dist/vue2/types/common/mixins/localization.d.ts.map +1 -0
  220. package/dist/vue2/types/common/sr_only_close_button.vue.d.ts +7 -13
  221. package/dist/vue2/types/common/sr_only_close_button.vue.d.ts.map +1 -1
  222. package/dist/vue2/types/common/utils/index.d.ts +1 -0
  223. package/dist/vue2/types/common/utils/index.d.ts.map +1 -1
  224. package/dist/vue2/types/components/banner/banner.vue.d.ts +0 -33
  225. package/dist/vue2/types/components/banner/banner.vue.d.ts.map +1 -1
  226. package/dist/vue2/types/components/breadcrumbs/breadcrumbs.vue.d.ts +5 -1
  227. package/dist/vue2/types/components/button/button.vue.d.ts +6 -2
  228. package/dist/vue2/types/components/chip/chip.vue.d.ts +8 -18
  229. package/dist/vue2/types/components/combobox/combobox_constants.d.ts +2 -2
  230. package/dist/vue2/types/components/combobox/index.d.ts +1 -1
  231. package/dist/vue2/types/components/datepicker/datepicker.vue.d.ts.map +1 -1
  232. package/dist/vue2/types/components/datepicker/datepicker_constants.d.ts +0 -1
  233. package/dist/vue2/types/components/datepicker/datepicker_constants.d.ts.map +1 -1
  234. package/dist/vue2/types/components/datepicker/modules/calendar.vue.d.ts +5 -17
  235. package/dist/vue2/types/components/datepicker/modules/month-year-picker.vue.d.ts +8 -48
  236. package/dist/vue2/types/components/datepicker/utils.d.ts +1 -0
  237. package/dist/vue2/types/components/datepicker/utils.d.ts.map +1 -1
  238. package/dist/vue2/types/components/dropdown/dropdown.vue.d.ts +0 -24
  239. package/dist/vue2/types/components/dropdown/dropdown.vue.d.ts.map +1 -1
  240. package/dist/vue2/types/components/emoji_picker/emoji_picker.vue.d.ts +5 -1
  241. package/dist/vue2/types/components/emoji_picker/emoji_picker_constants.d.ts +0 -13
  242. package/dist/vue2/types/components/icon/icon.vue.d.ts +1 -0
  243. package/dist/vue2/types/components/icon/icon_constants.d.ts.map +1 -1
  244. package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts +5 -8
  245. package/dist/vue2/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
  246. package/dist/vue2/types/components/modal/modal.vue.d.ts +3 -33
  247. package/dist/vue2/types/components/notice/notice.vue.d.ts +1 -34
  248. package/dist/vue2/types/components/notice/notice.vue.d.ts.map +1 -1
  249. package/dist/vue2/types/components/notice/notice_action.vue.d.ts +3 -31
  250. package/dist/vue2/types/components/notice/notice_action.vue.d.ts.map +1 -1
  251. package/dist/vue2/types/components/pagination/pagination.vue.d.ts +9 -26
  252. package/dist/vue2/types/components/pagination/pagination.vue.d.ts.map +1 -1
  253. package/dist/vue2/types/components/popover/popover.vue.d.ts +0 -33
  254. package/dist/vue2/types/components/popover/popover.vue.d.ts.map +1 -1
  255. package/dist/vue2/types/components/popover/popover_header_footer.vue.d.ts +8 -11
  256. package/dist/vue2/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
  257. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts +15 -2
  258. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  259. package/dist/vue2/types/components/toast/layouts/toast_layout_alternate.vue.d.ts +1 -43
  260. package/dist/vue2/types/components/toast/layouts/toast_layout_alternate.vue.d.ts.map +1 -1
  261. package/dist/vue2/types/components/toast/layouts/toast_layout_default.vue.d.ts +1 -34
  262. package/dist/vue2/types/components/toast/layouts/toast_layout_default.vue.d.ts.map +1 -1
  263. package/dist/vue2/types/components/toast/toast.vue.d.ts +3 -111
  264. package/dist/vue2/types/components/toast/toast.vue.d.ts.map +1 -1
  265. package/dist/vue2/types/index.d.ts +1 -0
  266. package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +7 -13
  267. package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +7 -12
  268. package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +8 -10
  269. package/dist/vue2/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
  270. package/dist/vue2/types/recipes/cards/ivr_node/ivr_node_constants.d.ts +7 -7
  271. package/dist/vue2/types/recipes/cards/ivr_node/ivr_node_constants.d.ts.map +1 -1
  272. package/dist/vue2/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -25
  273. package/dist/vue2/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts.map +1 -1
  274. package/dist/vue2/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +1 -25
  275. package/dist/vue2/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
  276. package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +5 -41
  277. package/dist/vue2/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
  278. package/dist/vue2/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +8 -26
  279. package/dist/vue2/types/recipes/conversation_view/attachment_carousel/media_components/progress_bar.vue.d.ts +2 -2
  280. package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts +20 -61
  281. package/dist/vue2/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  282. package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +6 -1
  283. package/dist/vue2/types/recipes/conversation_view/emoji_row/emoji_row_constants.d.ts.map +1 -1
  284. package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +9 -12
  285. package/dist/vue2/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
  286. package/dist/vue2/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +8 -2
  287. package/dist/vue2/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
  288. package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts +15 -90
  289. package/dist/vue2/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  290. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +14 -2
  291. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +14 -1
  292. package/dist/vue2/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
  293. package/dist/vue2/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +10 -11
  294. package/dist/vue2/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
  295. package/dist/vue2/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +0 -18
  296. package/dist/vue2/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
  297. package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts +21 -37
  298. package/dist/vue2/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
  299. package/dist/vue2/types/recipes/leftbar/group_row/group_row.vue.d.ts +9 -18
  300. package/dist/vue2/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
  301. package/dist/vue2/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +7 -1
  302. package/dist/vue2/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
  303. package/package.json +4 -3
  304. package/dist/vue2/common/mixins/sr-only-close-button.cjs +0 -3
  305. package/dist/vue2/common/mixins/sr-only-close-button.cjs.map +0 -1
  306. package/dist/vue2/common/mixins/sr-only-close-button.js +0 -44
  307. package/dist/vue2/common/mixins/sr-only-close-button.js.map +0 -1
  308. package/dist/vue2/lib/contact-row/contact-row-constants.cjs +0 -2
  309. package/dist/vue2/lib/contact-row/contact-row-constants.cjs.map +0 -1
  310. package/dist/vue2/lib/contact-row/contact-row-constants.js +0 -5
  311. package/dist/vue2/lib/contact-row/contact-row-constants.js.map +0 -1
  312. package/dist/vue2/lib/emoji/emoji-constants.cjs +0 -2
  313. package/dist/vue2/lib/emoji/emoji-constants.cjs.map +0 -1
  314. package/dist/vue2/lib/emoji/emoji-constants.js +0 -5
  315. package/dist/vue2/lib/emoji/emoji-constants.js.map +0 -1
  316. package/dist/vue2/lib/group-row/group-row-constants.cjs +0 -2
  317. package/dist/vue2/lib/group-row/group-row-constants.cjs.map +0 -1
  318. package/dist/vue2/lib/group-row/group-row-constants.js +0 -8
  319. package/dist/vue2/lib/group-row/group-row-constants.js.map +0 -1
  320. package/dist/vue2/lib/time-pill/time-pill-constants.cjs +0 -2
  321. package/dist/vue2/lib/time-pill/time-pill-constants.cjs.map +0 -1
  322. package/dist/vue2/lib/time-pill/time-pill-constants.js +0 -8
  323. package/dist/vue2/lib/time-pill/time-pill-constants.js.map +0 -1
  324. package/dist/vue2/types/common/mixins/sr_only_close_button.d.ts +0 -30
  325. package/dist/vue2/types/common/mixins/sr_only_close_button.d.ts.map +0 -1
  326. package/dist/vue2/types/components/emoji/emoji_constants.d.ts +0 -3
  327. package/dist/vue2/types/components/emoji/emoji_constants.d.ts.map +0 -1
  328. package/dist/vue2/types/recipes/conversation_view/time_pill/time_pill_constants.d.ts +0 -6
  329. package/dist/vue2/types/recipes/conversation_view/time_pill/time_pill_constants.d.ts.map +0 -1
  330. package/dist/vue2/types/recipes/leftbar/contact_row/contact_row_constants.d.ts +0 -3
  331. package/dist/vue2/types/recipes/leftbar/contact_row/contact_row_constants.d.ts.map +0 -1
  332. package/dist/vue2/types/recipes/leftbar/group_row/group_row_constants.d.ts +0 -6
  333. package/dist/vue2/types/recipes/leftbar/group_row/group_row_constants.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"message-input.js","sources":["../../../recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue","../../../recipes/conversation_view/message_input/extensions/meeting_pill/meeting_pill.js","../../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<template>\n <node-view-wrapper class=\"d-recipe-message-input-meeting-pill\">\n <dt-item-layout\n class=\"d-recipe-message-input-meeting-pill__layout\"\n unstyled\n >\n <template #left>\n <div class=\"d-recipe-message-input-meeting-pill__icon\">\n <dt-icon-video\n size=\"400\"\n />\n </div>\n </template>\n {{ node.attrs.text }}\n <template #right>\n <div class=\"d-recipe-message-input-meeting-pill__close\">\n <dt-button\n circle\n :aria-label=\"node.attrs['close-button-aria-label']\"\n size=\"xs\"\n importance=\"clear\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"300\"\n />\n </template>\n </dt-button>\n </div>\n </template>\n </dt-item-layout>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-2';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\n\nexport default {\n name: 'MeetingPill',\n\n components: {\n NodeViewWrapper,\n DtItemLayout,\n DtIconClose,\n DtButton,\n DtIconVideo,\n },\n\n props: nodeViewProps,\n\n emits: ['meeting-pill-close'],\n\n methods: {\n close (e) {\n this.$parent.$emit('meeting-pill-close', e);\n },\n },\n};\n</script>\n","import { mergeAttributes, Node } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport MeetingPill from './MeetingPill.vue';\n\nexport default Node.create({\n\n atom: true,\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(MeetingPill);\n },\n\n addAttributes () {\n return {\n text: {\n default: 'Please pass in \"text\" attribute',\n },\n 'close-button-aria-label': {},\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'meeting-pill',\n },\n ];\n },\n\n renderText ({ node }) {\n return '/dpm';\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['meeting-pill', mergeAttributes(HTMLAttributes)];\n },\n});\n","<!-- eslint-disable max-lines -->\n<template>\n <div\n data-qa=\"dt-recipe-message-input\"\n role=\"presentation\"\n class=\"d-recipe-message-input\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n\n <!-- set key to selectedText to force update. otherwise this component may not reflect the active selection -->\n <dt-recipe-message-input-topbar\n v-if=\"richText\"\n :key=\"selectedText\"\n :bold-button-options=\"boldButtonOptions\"\n :italic-button-options=\"italicButtonOptions\"\n :strike-button-options=\"strikeButtonOptions\"\n :bullet-list-button-options=\"bulletListButtonOptions\"\n :ordered-list-button-options=\"orderedListButtonOptions\"\n :block-quote-button-options=\"blockQuoteButtonOptions\"\n :code-button-options=\"codeButtonOptions\"\n :code-block-button-options=\"codeBlockButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @click=\"handleTopbarClick\"\n >\n <template #link>\n <dt-recipe-message-input-link\n ref=\"link\"\n :open=\"linkDialogOpen\"\n :link-button-options=\"linkButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @opened=\"linkDialogOpened\"\n @set-link=\"setLink\"\n @remove-link=\"removeLink\"\n />\n </template>\n </dt-recipe-message-input-topbar>\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"d-recipe-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"richText\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :allow-blockquote=\"richText\"\n :allow-bold=\"richText\"\n :allow-bullet-list=\"richText\"\n :allow-code=\"richText\"\n :allow-codeblock=\"richText\"\n :allow-italic=\"richText\"\n :allow-strike=\"richText\"\n :allow-underline=\"richText\"\n :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n @text-input=\"onTextInput\"\n @enter=\"onSend\"\n @selected=\"selectedText = $event\"\n @edit-link=\"initLinkDialog\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n v-on=\"$listeners\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-recipe-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"d-recipe-message-input__bottom-section-left\">\n <dt-stack\n direction=\"row\"\n gap=\"200\"\n >\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"showImagePicker?.tooltipLabel\"\n data-qa=\"dt-recipe-message-input-image-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showImagePicker.ariaLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon-image size=\"300\" />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-recipe-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-recipe-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n open.sync=\"emojiPickerOpened\"\n data-qa=\"dt-recipe-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiTooltipMessage\"\n v-bind=\"attrs\"\n data-qa=\"dt-recipe-message-input-emoji-picker-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"emojiButtonAriaLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon-very-satisfied\n v-if=\"emojiPickerHovered\"\n size=\"300\"\n />\n <dt-icon-satisfied\n v-else\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template #content=\"{ close }\">\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @add-emoji=\"$emit('add-emoji')\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => onSelectEmoji(emoji, close)\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n <!-- @slot Slot to add extra action icons next to default ones -->\n <slot name=\"customActionIcons\" />\n </dt-stack>\n </div>\n <!-- Right content -->\n <div class=\"d-recipe-message-input__bottom-section-right\">\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n >\n <!-- @slot Slot for sms count -->\n <div class=\"d-recipe-message-input__sms-count\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"d-recipe-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"d-recipe-message-input__remaining-char\"\n data-qa=\"dt-recipe-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n data-qa=\"dt-recipe-message-input-cancel-button\"\n class=\"d-recipe-message-input__button d-recipe-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"showCancel.ariaLabel\"\n @click=\"onCancel\"\n >\n <p>{{ showCancel.text }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"showSend?.tooltipLabel\"\n data-qa=\"dt-recipe-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n 'd-recipe-message-input__button d-recipe-message-input__send-button',\n {\n 'd-recipe-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--icon-only': showSendIcon,\n },\n ]\"\n :aria-label=\"showSend.ariaLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSendIcon\"\n #icon\n >\n <!-- @slot Slot for send button icon -->\n <slot\n name=\"sendIcon\"\n :icon-size=\"sendIconSize\"\n >\n <dt-icon-send\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </dt-stack>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport lastActiveNodes from './last_active_nodes';\nimport MeetingPill from './extensions/meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtStack } from '@/components/stack';\nimport {\n DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend,\n} from '@dialpad/dialtone-icons/vue2';\nimport DtRecipeMessageInputTopbar from './message_input_topbar.vue';\nimport DtRecipeMessageInputLink from './message_input_link.vue';\n\nimport {\n EDITOR_SUPPORTED_LINK_PROTOCOLS,\n EDITOR_DEFAULT_LINK_PREFIX,\n} from '../editor/editor_constants.js';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtInput,\n DtPopover,\n DtRecipeMessageInputTopbar,\n DtRecipeMessageInputLink,\n DtRichTextEditor,\n DtTooltip,\n DtStack,\n DtIconImage,\n DtIconVerySatisfied,\n DtIconSatisfied,\n DtIconSend,\n },\n\n mixins: [],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Displays all the buttons for rich text formatting above the message input, and enables it within the editor.\n * Rich text formatting for the purposes of this component is defined as:\n *\n * bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks.\n *\n * If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false.\n */\n richText: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'json',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n validate (emojiPickerProps) {\n return [\n 'searchNoResultsLabel',\n 'searchResultsLabel',\n 'searchPlaceholderLabel',\n 'skinSelectorButtonTooltipLabel',\n 'tabSetLabels',\n ].every(prop => emojiPickerProps[prop] != null);\n },\n },\n\n /**\n * Emoji button tooltip label\n */\n emojiTooltipMessage: {\n type: String,\n default: 'Emoji',\n },\n\n // Aria label for buttons\n /**\n * Emoji button aria label\n */\n emojiButtonAriaLabel: {\n type: String,\n default: 'emoji button',\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({ tooltipLabel: 'Attach Image', ariaLabel: 'image button' }),\n },\n\n /**\n * Send button defaults.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * Cancel button defaults.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({ text: 'Cancel' }),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * descriptive text fields for the bold button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n boldButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle bold on selected text',\n tooltipText: 'Bold',\n keyboardShortcutText: 'Mod + B',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n italicButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle italic on selected text',\n tooltipText: 'Italic',\n keyboardShortcutText: 'Mod + I',\n }),\n },\n\n /**\n * descriptive text fields for the strikethrough button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n strikeButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle strikethrough on selected text',\n tooltipText: 'Strikethrough',\n keyboardShortcutText: 'Mod + Shift + S',\n }),\n },\n\n /**\n * descriptive text fields for the link button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n linkButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Create or edit link on selected text',\n tooltipText: 'Link',\n // TODO: implement mod k\n keyboardShortcutText: 'Mod + K',\n dialogTitle: 'Add a link',\n textLabel: 'Text to display (optional)',\n linkLabel: 'Link',\n linkPlaceholder: 'e.g. https://www.dialpad.com',\n removeLabel: 'Remove',\n cancelLabel: 'Cancel',\n confirmLabel: 'Done',\n visuallyHiddenCloseText: 'Close link dialog',\n }),\n },\n\n /**\n * descriptive text fields for the bullet list button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n bulletListButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle bullet list on selected text',\n tooltipText: 'Bullet list',\n keyboardShortcutText: 'Mod + Shift + 8',\n }),\n },\n\n /**\n * descriptive text fields for the ordered list button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n orderedListButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle ordered list on selected text',\n tooltipText: 'Ordered list',\n keyboardShortcutText: 'Mod + Shift + 7',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n blockQuoteButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle Blockquote on selected text',\n tooltipText: 'Blockquote',\n keyboardShortcutText: 'Mod + Shift + B',\n }),\n },\n\n /**\n * descriptive text fields for the code button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n codeButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle code tag on selected text',\n tooltipText: 'Code',\n keyboardShortcutText: 'Mod + E',\n }),\n },\n\n /**\n * descriptive text fields for the code block button\n *\n * object format:\n * { ariaLabel: string, tooltipText: string, keyboardShortcutText: string }\n */\n codeBlockButtonOptions: {\n type: Object,\n default: () => ({\n ariaLabel: 'Toggle code block on selected text',\n tooltipText: 'Code block',\n keyboardShortcutText: 'Mod + Alt + C',\n }),\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Emitted when input changes, returns text content only\n * @event text-input\n * @type {String}\n */\n 'text-input',\n\n /**\n * Emitted when the 'Add emoji' button is clicked\n * @event add-emoji\n * @type {Boolean}\n */\n 'add-emoji',\n ],\n\n data () {\n return {\n // If an ordered list is nested within an unordered list, we only want to show the currently selected list as\n // active. This function performs the logic to determine the farthest active node from the root.\n lastActiveNodes,\n additionalExtensions: [MeetingPill],\n internalInputValue: this.value, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n isFocused: false,\n linkOptions: {\n class: 'd-link d-c-text d-d-inline-block',\n },\n\n linkDialogOpen: false,\n selectedText: '',\n text: '',\n hideLinkBubbleMenu: false,\n };\n },\n\n computed: {\n\n showSendIcon () {\n return !this.showSend.text;\n },\n\n inputLength () {\n return this.text.length;\n },\n\n displayCharacterLimitWarning () {\n return Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\n },\n\n computedCloseButtonProps () {\n return {\n ariaLabel: 'Close',\n };\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n\n sendIconSize () {\n return '300';\n },\n },\n\n watch: {\n value (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.value;\n }\n },\n\n methods: {\n linkDialogOpened (value) {\n this.linkDialogOpen = value;\n if (value === true) {\n this.initLinkDialog();\n } else {\n this.hideLinkBubbleMenu = false;\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n\n // eslint-disable-next-line complexity\n handleTopbarClick (type) {\n const editor = this.$refs.richTextEditor?.editor;\n // Key is the name returned in the event, value is the name of the TipTap command function to run.\n const typeToCommandMap = {\n bold: () => editor?.chain().focus().toggleBold().run(),\n italic: () => editor?.chain().focus().toggleItalic().run(),\n strike: () => editor?.chain().focus().toggleStrike().run(),\n bulletList: () => editor?.chain().focus().toggleBulletList().run(),\n orderedList: () => editor?.chain().focus().toggleOrderedList().run(),\n blockquote: () => editor?.chain().focus().toggleBlockquote().run(),\n code: () => editor?.chain().focus().toggleCode().run(),\n codeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n };\n\n if (editor && typeToCommandMap[type]) {\n typeToCommandMap[type]();\n }\n },\n\n // Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold\n isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\n return this.lastActiveNodes(this.$refs.richTextEditor?.editor?.state, [{ type: 'bulletList' }, { type: 'orderedList' }]).includes(type) && this.isFocused;\n }\n return this.$refs.richTextEditor?.editor?.isActive(type) && this.isFocused;\n },\n\n initLinkDialog () {\n this.$refs.link.setInitialValues(this.selectedText, this.$refs.richTextEditor?.editor?.getAttributes('link')?.href);\n this.hideLinkBubbleMenu = true;\n this.linkDialogOpen = true;\n },\n\n removeLink () {\n this.$refs.richTextEditor?.removeLink();\n this.linkDialogOpen = false;\n },\n\n setLink (linkText, linkInput) {\n this.$refs.richTextEditor.setLink(\n linkInput, linkText, this.linkOptions, EDITOR_SUPPORTED_LINK_PROTOCOLS, EDITOR_DEFAULT_LINK_PREFIX,\n );\n this.linkDialogOpen = false;\n },\n\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = this.$refs.richTextEditor.$el.querySelector('.tiptap').contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji, close) {\n if (!emoji) {\n return;\n }\n\n if (!emoji.shift_key) {\n close();\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:value', event);\n },\n\n onTextInput (event) {\n this.text = event;\n this.$emit('text-input', event);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","NodeViewWrapper","DtItemLayout","DtIconClose","DtButton","DtIconVideo","nodeViewProps","e","MeetingPill","Node","VueNodeViewRenderer","node","HTMLAttributes","mergeAttributes","DtEmojiPicker","DtInput","DtPopover","DtRecipeMessageInputTopbar","DtRecipeMessageInputLink","DtRichTextEditor","DtTooltip","DtStack","DtIconImage","DtIconVerySatisfied","DtIconSatisfied","DtIconSend","autoFocus","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","outputFormat","RICH_TEXT_EDITOR_OUTPUT_FORMATS","emojiPickerProps","prop","lastActiveNodes","newValue","_a","value","type","editor","typeToCommandMap","_b","_d","_c","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","dt","files","skinTone","emoji","close","event"],"mappings":";;;;;;;;;;;;;;;;;AAyCA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,EACA;AAAA,EAEA,OAAAC;AAAA,EAEA,OAAA,CAAA,oBAAA;AAAA,EAEA,SAAA;AAAA,IACA,MAAAC,GAAA;AACA,WAAA,QAAA,MAAA,sBAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;qBCzDeC,IAAAC,EAAK,OAAO;AAAA,EAEzB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EAER,cAAe;AACb,WAAOC,EAAoBF,CAAW;AAAA,EACvC;AAAA,EAED,gBAAiB;AACf,WAAO;AAAA,MACL,MAAM;AAAA,QACJ,SAAS;AAAA,MACV;AAAA,MACD,2BAA2B,CAAE;AAAA,IACnC;AAAA,EACG;AAAA,EAED,YAAa;AACX,WAAO;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACN;AAAA,IACP;AAAA,EACG;AAAA,EAED,WAAY,EAAE,MAAAG,KAAQ;AACpB,WAAO;AAAA,EACR;AAAA,EAED,WAAY,EAAE,gBAAAC,KAAkB;AAC9B,WAAO,CAAC,gBAAgBC,EAAgBD,CAAc,CAAC;AAAA,EACxD;AACH,CAAC,GC6PDZ,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,UAAAI;AAAA,IACA,eAAAU;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,4BAAAC;AAAA,IACA,0BAAAC;AAAA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A,KAAA,MAAA,eAAA,OAAA,SAAA,cAAA;AAAA,QACA,MAAA;AAAA,QACA,OAAA;AAAA,UACA,MAAAD,EAAA;AAAA,QACA;AAAA,MACA,CAAA,GACA,KAAA,MAAA,kBAAAA,CAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,MAAA,wBAAA,MAAA,MAAA,MAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,WAAA,MAAA,gBAAA,KAAA,MAAA,wBAAA,MAAA,MAAA,KAAA;AAAA,IACA;AAAA,IAEA,oBAAA;AACA,WAAA,oBAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,MAAA,KAAA,kBAGA,KAAA,MAAA,UAAA,KAAA,kBAAA;AAAA,IACA;AAAA,IAEA,WAAA;AACA,WAAA,MAAA,QAAA;AAAA,IACA;AAAA,IAEA,QAAAE,GAAA;AACA,WAAA,MAAA,gBAAAA,CAAA;AAAA,IACA;AAAA,IAEA,YAAAA,GAAA;AACA,WAAA,OAAAA,GACA,KAAA,MAAA,cAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"message-input.js","sources":["../../../recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue","../../../recipes/conversation_view/message_input/extensions/meeting_pill/meeting_pill.js","../../../recipes/conversation_view/message_input/message_input.vue"],"sourcesContent":["<template>\n <node-view-wrapper class=\"d-recipe-message-input-meeting-pill\">\n <dt-item-layout\n class=\"d-recipe-message-input-meeting-pill__layout\"\n unstyled\n >\n <template #left>\n <div class=\"d-recipe-message-input-meeting-pill__icon\">\n <dt-icon-video\n size=\"400\"\n />\n </div>\n </template>\n {{ node.attrs.text }}\n <template #right>\n <div class=\"d-recipe-message-input-meeting-pill__close\">\n <dt-button\n circle\n importance=\"clear\"\n size=\"xs\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"300\"\n />\n </template>\n </dt-button>\n </div>\n </template>\n </dt-item-layout>\n </node-view-wrapper>\n</template>\n\n<script>\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-2';\nimport { DtItemLayout } from '@/components/item_layout';\nimport { DtIconClose, DtIconVideo } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\nexport default {\n name: 'MeetingPill',\n\n components: {\n NodeViewWrapper,\n DtItemLayout,\n DtIconClose,\n DtButton,\n DtIconVideo,\n },\n\n mixins: [DtLocalizationMixin],\n\n props: nodeViewProps,\n\n emits: ['meeting-pill-close'],\n\n computed: {\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n methods: {\n close (e) {\n this.$parent.$emit('meeting-pill-close', e);\n },\n },\n};\n</script>\n","import { mergeAttributes, Node } from '@tiptap/core';\nimport { VueNodeViewRenderer } from '@tiptap/vue-2';\nimport MeetingPill from './MeetingPill.vue';\n\nexport default Node.create({\n\n atom: true,\n group: 'inline',\n inline: true,\n\n addNodeView () {\n return VueNodeViewRenderer(MeetingPill);\n },\n\n addAttributes () {\n return {\n text: {\n default: 'Please pass in \"text\" attribute',\n },\n };\n },\n\n parseHTML () {\n return [\n {\n tag: 'meeting-pill',\n },\n ];\n },\n\n renderText ({ node }) {\n return '/dpm';\n },\n\n renderHTML ({ HTMLAttributes }) {\n return ['meeting-pill', mergeAttributes(HTMLAttributes)];\n },\n});\n","<!-- eslint-disable max-lines -->\n<template>\n <div\n data-qa=\"dt-recipe-message-input\"\n role=\"presentation\"\n class=\"d-recipe-message-input\"\n @dragover.prevent\n @drop.prevent=\"onDrop\"\n @paste=\"onPaste\"\n @mousedown=\"onMousedown\"\n >\n <!-- @slot Renders above the input, but still within the borders. -->\n <slot name=\"top\" />\n\n <!-- set key to selectedText to force update. otherwise this component may not reflect the active selection -->\n <dt-recipe-message-input-topbar\n v-if=\"richText\"\n :key=\"selectedText\"\n :bold-button-options=\"boldButtonOptions\"\n :italic-button-options=\"italicButtonOptions\"\n :strike-button-options=\"strikeButtonOptions\"\n :bullet-list-button-options=\"bulletListButtonOptions\"\n :ordered-list-button-options=\"orderedListButtonOptions\"\n :block-quote-button-options=\"blockQuoteButtonOptions\"\n :code-button-options=\"codeButtonOptions\"\n :code-block-button-options=\"codeBlockButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @click=\"handleTopbarClick\"\n >\n <template #link>\n <dt-recipe-message-input-link\n ref=\"link\"\n :open=\"linkDialogOpen\"\n :link-button-options=\"linkButtonOptions\"\n :is-selection-active=\"isSelectionActive\"\n @opened=\"linkDialogOpened\"\n @set-link=\"setLink\"\n @remove-link=\"removeLink\"\n />\n </template>\n </dt-recipe-message-input-topbar>\n <!-- Some wrapper to restrict the height and show the scrollbar -->\n <div\n v-dt-scrollbar\n class=\"d-recipe-message-input__editor-wrapper\"\n :style=\"{ 'max-height': maxHeight }\"\n >\n <dt-rich-text-editor\n ref=\"richTextEditor\"\n v-model=\"internalInputValue\"\n :editable=\"editable\"\n :input-aria-label=\"inputAriaLabel\"\n :input-class=\"inputClass\"\n :output-format=\"outputFormat\"\n :auto-focus=\"autoFocus\"\n :link=\"richText\"\n :placeholder=\"placeholder\"\n :prevent-typing=\"preventTyping\"\n :mention-suggestion=\"mentionSuggestion\"\n :channel-suggestion=\"channelSuggestion\"\n :slash-command-suggestion=\"slashCommandSuggestion\"\n :paste-rich-text=\"richText\"\n :allow-blockquote=\"richText\"\n :allow-bold=\"richText\"\n :allow-bullet-list=\"richText\"\n :allow-code=\"richText\"\n :allow-codeblock=\"richText\"\n :allow-italic=\"richText\"\n :allow-strike=\"richText\"\n :allow-underline=\"richText\"\n :additional-extensions=\"additionalExtensions\"\n :hide-link-bubble-menu=\"hideLinkBubbleMenu\"\n v-bind=\"$attrs\"\n @input=\"onInput\"\n @text-input=\"onTextInput\"\n @enter=\"onSend\"\n @selected=\"selectedText = $event\"\n @edit-link=\"initLinkDialog\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n v-on=\"$listeners\"\n />\n </div>\n <!-- @slot Slot for attachment carousel -->\n <slot name=\"middle\" />\n <!-- Section for the bottom UI -->\n <section class=\"d-recipe-message-input__bottom-section\">\n <!-- Left content -->\n <div class=\"d-recipe-message-input__bottom-section-left\">\n <dt-stack\n direction=\"row\"\n gap=\"200\"\n >\n <dt-button\n v-if=\"showImagePicker\"\n v-dt-tooltip:top-start=\"imagePickerButtonLabel\"\n data-qa=\"dt-recipe-message-input-image-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"imagePickerButtonLabel\"\n @click=\"onSelectImage\"\n @mouseenter=\"imagePickerFocus = true\"\n @mouseleave=\"imagePickerFocus = false\"\n @focus=\"imagePickerFocus = true\"\n @blur=\"imagePickerFocus = false\"\n >\n <template #icon>\n <dt-icon-image size=\"300\" />\n </template>\n </dt-button>\n <dt-input\n ref=\"messageInputImageUpload\"\n data-qa=\"dt-recipe-message-input-image-input\"\n accept=\"image/*, video/*\"\n type=\"file\"\n class=\"d-recipe-message-input__image-input\"\n multiple\n hidden\n @input=\"onImageUpload\"\n />\n <dt-popover\n v-if=\"showEmojiPicker\"\n open.sync=\"emojiPickerOpened\"\n data-qa=\"dt-recipe-message-input-emoji-picker-popover\"\n initial-focus-element=\"#searchInput\"\n padding=\"none\"\n >\n <template #anchor=\"{ attrs }\">\n <dt-button\n v-dt-tooltip=\"emojiPickerButtonLabel\"\n v-bind=\"attrs\"\n data-qa=\"dt-recipe-message-input-emoji-picker-btn\"\n size=\"sm\"\n class=\"d-recipe-message-input__button\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"emojiPickerButtonLabel\"\n @click=\"toggleEmojiPicker\"\n @mouseenter=\"emojiPickerFocus = true\"\n @mouseleave=\"emojiPickerFocus = false\"\n @focus=\"emojiPickerFocus = true\"\n @blur=\"emojiPickerFocus = false\"\n >\n <template #icon>\n <dt-icon-very-satisfied\n v-if=\"emojiPickerHovered\"\n size=\"300\"\n />\n <dt-icon-satisfied\n v-else\n size=\"300\"\n />\n </template>\n </dt-button>\n </template>\n <template #content=\"{ close }\">\n <dt-emoji-picker\n v-bind=\"emojiPickerProps\"\n @add-emoji=\"$emit('add-emoji')\"\n @skin-tone=\"onSkinTone\"\n @selected-emoji=\"(emoji) => onSelectEmoji(emoji, close)\"\n />\n </template>\n </dt-popover>\n <!-- @slot Slot for emojiGiphy picker -->\n <slot name=\"emojiGiphyPicker\" />\n <!-- @slot Slot to add extra action icons next to default ones -->\n <slot name=\"customActionIcons\" />\n </dt-stack>\n </div>\n <!-- Right content -->\n <div class=\"d-recipe-message-input__bottom-section-right\">\n <dt-stack\n direction=\"row\"\n gap=\"300\"\n >\n <!-- @slot Slot for sms count -->\n <div class=\"d-recipe-message-input__sms-count\">\n <slot name=\"smsCount\" />\n </div>\n\n <!-- Optionally displayed remaining character counter -->\n <dt-tooltip\n v-if=\"Boolean(showCharacterLimit)\"\n class=\"d-recipe-message-input__remaining-char-tooltip\"\n placement=\"top-end\"\n :enabled=\"characterLimitTooltipEnabled\"\n :message=\"showCharacterLimit.message\"\n :offset=\"[10, 8]\"\n >\n <template #anchor>\n <p\n v-show=\"displayCharacterLimitWarning\"\n class=\"d-recipe-message-input__remaining-char\"\n data-qa=\"dt-recipe-message-input-character-limit\"\n >\n {{ showCharacterLimit.count - inputLength }}\n </p>\n </template>\n </dt-tooltip>\n\n <!-- Cancel button for edit mode -->\n <dt-button\n v-if=\"showCancel\"\n v-dt-tooltip=\"cancelButtonLabel\"\n data-qa=\"dt-recipe-message-input-cancel-button\"\n class=\"d-recipe-message-input__button d-recipe-message-input__cancel-button\"\n size=\"sm\"\n kind=\"muted\"\n importance=\"clear\"\n :aria-label=\"cancelButtonLabel\"\n @click=\"onCancel\"\n >\n <p>{{ cancelButtonLabel }}</p>\n </dt-button>\n\n <!-- @slot Slot for sendButton picker -->\n <slot name=\"sendButton\">\n <!-- Send button -->\n <!-- Right positioned UI - send button -->\n <dt-button\n v-if=\"showSend\"\n v-dt-tooltip:top-end=\"sendButtonLabel\"\n data-qa=\"dt-recipe-message-input-send-btn\"\n size=\"sm\"\n kind=\"default\"\n importance=\"primary\"\n :class=\"[\n 'd-recipe-message-input__button d-recipe-message-input__send-button',\n {\n 'd-recipe-message-input__send-button--disabled': isSendDisabled,\n 'd-btn--icon-only': showSendIcon,\n },\n ]\"\n :aria-label=\"sendButtonLabel\"\n :aria-disabled=\"isSendDisabled\"\n @click=\"onSend\"\n >\n <template\n v-if=\"showSendIcon\"\n #icon\n >\n <!-- @slot Slot for send button icon -->\n <slot\n name=\"sendIcon\"\n :icon-size=\"sendIconSize\"\n >\n <dt-icon-send\n :size=\"sendIconSize\"\n />\n </slot>\n </template>\n <template\n v-if=\"showSend.text\"\n >\n <p>{{ showSend.text }}</p>\n </template>\n </dt-button>\n </slot>\n </dt-stack>\n </div>\n </section>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n DtRichTextEditor,\n RICH_TEXT_EDITOR_OUTPUT_FORMATS,\n RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,\n} from '@/components/rich_text_editor';\nimport lastActiveNodes from './last_active_nodes';\nimport MeetingPill from './extensions/meeting_pill/meeting_pill';\nimport { DtButton } from '@/components/button';\nimport { DtEmojiPicker } from '@/components/emoji_picker';\nimport { DtPopover } from '@/components/popover';\nimport { DtInput } from '@/components/input';\nimport { DtTooltip } from '@/components/tooltip';\nimport { DtStack } from '@/components/stack';\nimport {\n DtIconImage, DtIconVerySatisfied, DtIconSatisfied, DtIconSend,\n} from '@dialpad/dialtone-icons/vue2';\nimport DtRecipeMessageInputTopbar from './message_input_topbar.vue';\nimport DtRecipeMessageInputLink from './message_input_link.vue';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\nimport {\n EDITOR_SUPPORTED_LINK_PROTOCOLS,\n EDITOR_DEFAULT_LINK_PREFIX,\n} from '../editor/editor_constants.js';\n\nexport default {\n name: 'DtRecipeMessageInput',\n\n components: {\n DtButton,\n DtEmojiPicker,\n DtInput,\n DtPopover,\n DtRecipeMessageInputTopbar,\n DtRecipeMessageInputLink,\n DtRichTextEditor,\n DtTooltip,\n DtStack,\n DtIconImage,\n DtIconVerySatisfied,\n DtIconSatisfied,\n DtIconSend,\n },\n\n mixins: [DtLocalizationMixin],\n\n inheritAttrs: false,\n\n props: {\n /**\n * Displays all the buttons for rich text formatting above the message input, and enables it within the editor.\n * Rich text formatting for the purposes of this component is defined as:\n *\n * bold, italic, strikethrough, lists, blockquotes, inline code tags, and code blocks.\n *\n * If you are sending a message to a phone rather than a Dialpad to Dialpad message, you should have this as false.\n */\n richText: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Value of the input. The object format should match TipTap's JSON\n * document structure: https://tiptap.dev/guide/output#option-1-json\n */\n value: {\n type: [Object, String],\n default: '',\n },\n\n /**\n * Whether the input is editable\n */\n editable: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Descriptive label for the input element\n */\n inputAriaLabel: {\n type: String,\n required: true,\n default: '',\n },\n\n /**\n * Prevents the user from typing any further. Deleting text will still work.\n */\n preventTyping: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the input element. Only accepts a String value\n * because this is passed to the editor via options. For multiple classes,\n * join them into one string, e.g. \"d-p8 d-hmx96\"\n */\n inputClass: {\n type: String,\n default: '',\n },\n\n /**\n * Whether the input should receive focus after the component has been\n * mounted. Either one of `start`, `end`, `all` or a Boolean or a Number.\n * - `start` Sets the focus to the beginning of the input\n * - `end` Sets the focus to the end of the input\n * - `all` Selects the whole contents of the input\n * - `Number` Sets the focus to a specific position in the input\n * - `true` Defaults to `start`\n * - `false` Disables autofocus\n * @values true, false, start, end, all, number\n */\n autoFocus: {\n type: [Boolean, String, Number],\n default: false,\n validator (autoFocus) {\n if (typeof autoFocus === 'string') {\n return RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(autoFocus);\n }\n return true;\n },\n },\n\n /**\n * The output format that the editor uses when emitting the \"@input\" event.\n * One of `text`, `json`, `html`. See https://tiptap.dev/guide/output for\n * examples.\n * @values text, json, html\n */\n outputFormat: {\n type: String,\n default: 'json',\n validator (outputFormat) {\n return RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(outputFormat);\n },\n },\n\n /**\n * Placeholder text\n */\n placeholder: {\n type: String,\n default: '',\n },\n\n /**\n * Disable Send Button\n */\n disableSend: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Content area needs to dynamically adjust height based on the conversation area height.\n * can be vh|px|rem|em|%\n */\n maxHeight: {\n type: String,\n default: 'unset',\n },\n\n // Emoji picker props\n showEmojiPicker: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Props to pass into the emoji picker.\n */\n emojiPickerProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Enable character Limit warning\n */\n showCharacterLimit: {\n type: [Boolean, Object],\n default: () => ({ count: 1500, warning: 500, message: '' }),\n },\n\n showImagePicker: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * Send button defaults.\n * TODO (Dialtone 10):\n * - Change to `showSendButton`, boolean only.\n */\n showSend: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * TODO (Dialtone 10):\n * - Add a prop `iconOnly` default: true to control if localized send button text should be shown\n */\n\n /**\n * Cancel button defaults.\n * TODO (Dialtone 10): Change to `showCancelButton`, boolean only.\n */\n showCancel: {\n type: [Boolean, Object],\n default: () => ({}),\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the contacts for suggestion.\n * items({ query }) => { return [ContactObject]; }\n * ContactObject format:\n * { name: string, avatarSrc: string, id: string }\n *\n * When null, it does not add the plugin.\n */\n mentionSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the channels for suggestion.\n * items({ query }) => { return [ChannelObject]; }\n * ChannelObject format:\n * { name: string, id: string, locked: boolean }\n *\n * When null, it does not add the plugin. Setting locked to true will display a lock rather than hash.\n */\n channelSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * suggestion object containing the items query function.\n * The valid keys passed into this object can be found here: https://tiptap.dev/api/utilities/suggestion\n *\n * The only required key is the items function which is used to query the slash commands for suggestion.\n * items({ query }) => { return [SlashCommandObject]; }\n * SlashCommandObject format:\n * { command: string, description: string, parametersExample?: string }\n * The \"parametersExample\" parameter is optional, and describes an example\n * of the parameters that command can take.\n *\n * When null, it does not add the plugin.\n */\n slashCommandSuggestion: {\n type: Object,\n default: null,\n },\n\n /**\n * descriptive text fields for the bold button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n boldButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + B',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n italicButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + I',\n }),\n },\n\n /**\n * descriptive text fields for the strikethrough button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n strikeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + S',\n }),\n },\n\n /**\n * descriptive text fields for the link button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n linkButtonOptions: {\n type: Object,\n default: () => ({\n // TODO: implement mod k\n keyboardShortcutText: 'Mod + K',\n linkPlaceholder: 'e.g. https://www.dialpad.com',\n }),\n },\n\n /**\n * descriptive text fields for the bullet list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n bulletListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 8',\n }),\n },\n\n /**\n * descriptive text fields for the ordered list button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n orderedListButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + 7',\n }),\n },\n\n /**\n * descriptive text fields for the italic button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n blockQuoteButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Shift + B',\n }),\n },\n\n /**\n * descriptive text fields for the code button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + E',\n }),\n },\n\n /**\n * descriptive text fields for the code block button\n *\n * object format:\n * { keyboardShortcutText: string }\n */\n codeBlockButtonOptions: {\n type: Object,\n default: () => ({\n keyboardShortcutText: 'Mod + Alt + C',\n }),\n },\n },\n\n emits: [\n /**\n * Fires when send button is clicked\n *\n * @event submit\n * @type {String}\n */\n 'submit',\n\n /**\n * Fires when media is selected from image button\n *\n * @event select-media\n * @type {Array}\n */\n 'select-media',\n\n /**\n * Fires when media is dropped into the message input\n *\n * @event add-media\n * @type {Array}\n */\n 'add-media',\n\n /**\n * Fires when media is pasted into the message input\n *\n * @event paste-media\n * @type {Array}\n */\n 'paste-media',\n\n /**\n * Fires when cancel button is pressed (only on edit mode)\n *\n * @event cancel\n * @type {Boolean}\n */\n 'cancel',\n\n /**\n * Fires when skin tone is selected from the emoji picker\n *\n * @event skin-tone\n * @type {String}\n */\n 'skin-tone',\n\n /**\n * Fires when emoji is selected from the emoji picker\n *\n * @event selected-emoji\n * @type {String}\n */\n 'selected-emoji',\n\n /**\n * Fires when a slash command is selected\n *\n * @event selected-command\n * @type {String}\n */\n 'selected-command',\n\n /**\n * Fires when meeting pill is closed\n *\n * @event meeting-pill-close\n * @type {String}\n */\n 'meeting-pill-close',\n\n /**\n * Event to sync the value with the parent\n * @event update:value\n * @type {String|JSON}\n */\n 'update:value',\n\n /**\n * Emitted when input changes, returns text content only\n * @event text-input\n * @type {String}\n */\n 'text-input',\n\n /**\n * Emitted when the 'Add emoji' button is clicked\n * @event add-emoji\n * @type {Boolean}\n */\n 'add-emoji',\n ],\n\n data () {\n return {\n // If an ordered list is nested within an unordered list, we only want to show the currently selected list as\n // active. This function performs the logic to determine the farthest active node from the root.\n lastActiveNodes,\n additionalExtensions: [MeetingPill],\n internalInputValue: this.value, // internal input content\n imagePickerFocus: false,\n emojiPickerFocus: false,\n emojiPickerOpened: false,\n isFocused: false,\n linkOptions: {\n class: 'd-link d-c-text d-d-inline-block',\n },\n\n linkDialogOpen: false,\n selectedText: '',\n text: '',\n hideLinkBubbleMenu: false,\n };\n },\n\n computed: {\n\n showSendIcon () {\n return !this.showSend.text;\n },\n\n inputLength () {\n return this.text.length;\n },\n\n displayCharacterLimitWarning () {\n return Boolean(this.showCharacterLimit) &&\n ((this.showCharacterLimit.count - this.inputLength) <= this.showCharacterLimit.warning);\n },\n\n characterLimitTooltipEnabled () {\n return this.showCharacterLimit.message && (this.showCharacterLimit.count - this.inputLength < 0);\n },\n\n isSendDisabled () {\n return this.disableSend ||\n (this.showCharacterLimit && this.inputLength > this.showCharacterLimit.count);\n },\n\n emojiPickerHovered () {\n return this.emojiPickerFocus || this.emojiPickerOpened;\n },\n\n sendIconSize () {\n return '300';\n },\n\n sendButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_SEND_BUTTON_ARIA_LABEL');\n },\n\n imagePickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_IMAGE_PICKER_BUTTON_ARIA_LABEL');\n },\n\n emojiPickerButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_EMOJI_PICKER_BUTTON_ARIA_LABEL');\n },\n\n cancelButtonLabel () {\n return this.i18n.$t('DIALTONE_MESSAGE_INPUT_CANCEL_BUTTON_ARIA_LABEL');\n },\n },\n\n watch: {\n value (newValue) {\n this.internalInputValue = newValue;\n },\n\n emojiPickerOpened (newValue) {\n if (!newValue) {\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n },\n\n created () {\n if (this.value && this.outputFormat === 'text') {\n this.internalInputValue = this.value.replace(/\\n/g, '<br>');\n } else {\n this.internalInputValue = this.value;\n }\n },\n\n methods: {\n linkDialogOpened (value) {\n this.linkDialogOpen = value;\n if (value === true) {\n this.initLinkDialog();\n } else {\n this.hideLinkBubbleMenu = false;\n this.$refs.richTextEditor?.focusEditor();\n }\n },\n\n // eslint-disable-next-line complexity\n handleTopbarClick (type) {\n const editor = this.$refs.richTextEditor?.editor;\n // Key is the name returned in the event, value is the name of the TipTap command function to run.\n const typeToCommandMap = {\n bold: () => editor?.chain().focus().toggleBold().run(),\n italic: () => editor?.chain().focus().toggleItalic().run(),\n strike: () => editor?.chain().focus().toggleStrike().run(),\n bulletList: () => editor?.chain().focus().toggleBulletList().run(),\n orderedList: () => editor?.chain().focus().toggleOrderedList().run(),\n blockquote: () => editor?.chain().focus().toggleBlockquote().run(),\n code: () => editor?.chain().focus().toggleCode().run(),\n codeBlock: () => editor?.chain().focus().toggleCodeBlock().run(),\n };\n\n if (editor && typeToCommandMap[type]) {\n typeToCommandMap[type]();\n }\n },\n\n // Checks if the node currently selected is active ex/ the bold button is active if the selected text is bold\n isSelectionActive (type) {\n if (['bulletList', 'orderedList'].includes(type)) {\n return this.lastActiveNodes(this.$refs.richTextEditor?.editor?.state, [{ type: 'bulletList' }, { type: 'orderedList' }]).includes(type) && this.isFocused;\n }\n return this.$refs.richTextEditor?.editor?.isActive(type) && this.isFocused;\n },\n\n initLinkDialog () {\n this.$refs.link.setInitialValues(this.selectedText, this.$refs.richTextEditor?.editor?.getAttributes('link')?.href);\n this.hideLinkBubbleMenu = true;\n this.linkDialogOpen = true;\n },\n\n removeLink () {\n this.$refs.richTextEditor?.removeLink();\n this.linkDialogOpen = false;\n },\n\n setLink (linkText, linkInput) {\n this.$refs.richTextEditor.setLink(\n linkInput, linkText, this.linkOptions, EDITOR_SUPPORTED_LINK_PROTOCOLS, EDITOR_DEFAULT_LINK_PREFIX,\n );\n this.linkDialogOpen = false;\n },\n\n // Mousedown instead of click because it fires before the blur event.\n onMousedown (e) {\n const isWithinInput = this.$refs.richTextEditor.$el.querySelector('.tiptap').contains(e.target);\n\n // If the click is not within the tiptap rich text editor input itself, but still within the wrapping div,\n // focus the editor.\n if (!isWithinInput) {\n // Prevent default prevents blurring the rich text editor input when it is already focused.\n e.preventDefault();\n this.$refs.richTextEditor.focusEditor();\n }\n },\n\n onDrop (e) {\n const dt = e.dataTransfer;\n const files = Array.from(dt.files);\n this.$emit('add-media', files);\n },\n\n onPaste (e) {\n if (e.clipboardData.files.length) {\n e.stopPropagation();\n e.preventDefault();\n const files = [...e.clipboardData.files];\n this.$emit('paste-media', files);\n }\n },\n\n onSkinTone (skinTone) {\n this.$emit('skin-tone', skinTone);\n },\n\n onSelectEmoji (emoji, close) {\n if (!emoji) {\n return;\n }\n\n if (!emoji.shift_key) {\n close();\n }\n\n // Insert emoji into the editor\n this.$refs.richTextEditor.editor.commands.insertContent({\n type: 'emoji',\n attrs: {\n code: emoji.shortname,\n },\n });\n this.$emit('selected-emoji', emoji);\n },\n\n onSelectImage () {\n this.$refs.messageInputImageUpload.$refs.input.click();\n },\n\n onImageUpload () {\n this.$emit('select-media', this.$refs.messageInputImageUpload.$refs.input.files);\n },\n\n toggleEmojiPicker () {\n this.emojiPickerOpened = !this.emojiPickerOpened;\n },\n\n onSend () {\n if (this.isSendDisabled) {\n return;\n }\n this.$emit('submit', this.internalInputValue);\n },\n\n onCancel () {\n this.$emit('cancel');\n },\n\n onInput (event) {\n this.$emit('update:value', event);\n },\n\n onTextInput (event) {\n this.text = event;\n this.$emit('text-input', event);\n },\n },\n};\n</script>\n"],"names":["_sfc_main","NodeViewWrapper","DtItemLayout","DtIconClose","DtButton","DtIconVideo","DtLocalizationMixin","nodeViewProps","e","MeetingPill","Node","VueNodeViewRenderer","node","HTMLAttributes","mergeAttributes","DtEmojiPicker","DtInput","DtPopover","DtRecipeMessageInputTopbar","DtRecipeMessageInputLink","DtRichTextEditor","DtTooltip","DtStack","DtIconImage","DtIconVerySatisfied","DtIconSatisfied","DtIconSend","autoFocus","RICH_TEXT_EDITOR_AUTOFOCUS_TYPES","outputFormat","RICH_TEXT_EDITOR_OUTPUT_FORMATS","lastActiveNodes","newValue","_a","value","type","editor","typeToCommandMap","_b","_d","_c","linkText","linkInput","EDITOR_SUPPORTED_LINK_PROTOCOLS","EDITOR_DEFAULT_LINK_PREFIX","dt","files","skinTone","emoji","close","event"],"mappings":";;;;;;;;;;;;;;;;;;AA2CA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,CAAA;AAAA,EAEA,OAAAC;AAAA,EAEA,OAAA,CAAA,oBAAA;AAAA,EAEA,UAAA;AAAA,IACA,mBAAA;AACA,aAAA,KAAA,KAAA,GAAA,uBAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,MAAAC,GAAA;AACA,WAAA,QAAA,MAAA,sBAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;qBCnEeC,IAAAC,EAAK,OAAO;AAAA,EAEzB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EAER,cAAe;AACb,WAAOC,EAAoBF,CAAW;AAAA,EACvC;AAAA,EAED,gBAAiB;AACf,WAAO;AAAA,MACL,MAAM;AAAA,QACJ,SAAS;AAAA,MACV;AAAA,IACP;AAAA,EACG;AAAA,EAED,YAAa;AACX,WAAO;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACN;AAAA,IACP;AAAA,EACG;AAAA,EAED,WAAY,EAAE,MAAAG,KAAQ;AACpB,WAAO;AAAA,EACR;AAAA,EAED,WAAY,EAAE,gBA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,MAAA,wBAAA,MAAA,MAAA,KAAA;AAAA,IACA;AAAA,IAEA,oBAAA;AACA,WAAA,oBAAA,CAAA,KAAA;AAAA,IACA;AAAA,IAEA,SAAA;AACA,MAAA,KAAA,kBAGA,KAAA,MAAA,UAAA,KAAA,kBAAA;AAAA,IACA;AAAA,IAEA,WAAA;AACA,WAAA,MAAA,QAAA;AAAA,IACA;AAAA,IAEA,QAAAE,GAAA;AACA,WAAA,MAAA,gBAAAA,CAAA;AAAA,IACA;AAAA,IAEA,YAAAA,GAAA;AACA,WAAA,OAAAA,GACA,KAAA,MAAA,cAAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,3 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/mixins/modal.cjs"),a=require("./modal-constants.cjs"),l=require("../../common/utils/index.cjs"),o=require("../../common/constants/index.cjs"),r=require("../../common/mixins/sr-only-close-button.cjs"),d=require("../../shared/sr_only_close_button.cjs"),c=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),u=require("../lazy-show/lazy-show.cjs"),_=require("../button/button.cjs"),h=require("../notice/notice-constants.cjs"),m={name:"DtModal",components:{DtLazyShow:u.default,DtButton:_.default,DtIconClose:i.DtIconClose,SrOnlyCloseButton:d.default},mixins:[n.default,r.default],props:{closeButtonProps:{type:Object,required:!0,validator:t=>!!t.ariaLabel},copy:{type:String,default:""},describedById:{type:String,default:""},labelledById:{type:String,default:function(){return l.getUniqueString()}},show:{type:Boolean,default:!1},title:{type:String,default:""},bannerTitle:{type:String,default:""},kind:{type:String,default:"default",validator:t=>Object.keys(a.MODAL_KIND_MODIFIERS).includes(t)},size:{type:String,default:"default",validator:t=>Object.keys(a.MODAL_SIZE_MODIFIERS).includes(t)},modalClass:{type:[String,Object,Array],default:""},dialogClass:{type:[String,Object,Array],default:""},contentClass:{type:[String,Object,Array],default:""},bannerKind:{type:String,default:"warning",validate(t){return h.NOTICE_KINDS.includes(t)}},bannerClass:{type:[String,Object,Array],default:""},hideClose:{type:Boolean,default:!1},closeOnClick:{type:Boolean,default:!0},fixedHeaderFooter:{type:Boolean,default:!0},initialFocusElement:{type:[String,HTMLElement],default:"first",validator:t=>t==="first"||t instanceof HTMLElement||t.startsWith("#")}},emits:["update:show"],data(){return{MODAL_KIND_MODIFIERS:a.MODAL_KIND_MODIFIERS,MODAL_SIZE_MODIFIERS:a.MODAL_SIZE_MODIFIERS,MODAL_BANNER_KINDS:a.MODAL_BANNER_KINDS,EVENT_KEYNAMES:o.EVENT_KEYNAMES}},computed:{modalListeners(){return{...this.$listeners,click:t=>{this.closeOnClick&&(t.target===t.currentTarget&&this.close(),this.$emit("click",t))},keydown:t=>{switch(t.code){case o.EVENT_KEYNAMES.esc:case o.EVENT_KEYNAMES.escape:this.close();break;case o.EVENT_KEYNAMES.tab:this.trapFocus(t);break}this.$emit("keydown",t)},"after-enter":t=>{this.$emit("update:show",!0),t.target===t.currentTarget&&this.setFocusAfterTransition()}}},open(){return`${!this.show}`},hasFooterSlot(){return!!this.$slots.footer},bannerKindClass(){return a.MODAL_BANNER_KINDS[this.bannerKind]}},watch:{show:{handler(t){var e;t?(this.previousActiveElement=document.activeElement,l.disableRootScrolling(this.$el.getRootNode().host)):(l.enableRootScrolling(this.$el.getRootNode().host),(e=this.previousActiveElement)==null||e.focus(),this.previousActiveElement=null)}},$props:{immediate:!0,deep:!0,handler(){this.validateProps()}}},methods:{close(){this.$emit("update:show",!1)},setFocusAfterTransition(){this.initialFocusElement==="first"?this.focusFirstElement():this.initialFocusElement.startsWith("#")?this.focusElementById(this.initialFocusElement):this.initialFocusElement instanceof HTMLElement&&this.initialFocusElement.focus()},trapFocus(t){this.show&&this.focusTrappedTabPress(t)},validateProps(){this.hideClose&&!this.visuallyHiddenClose&&console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props
2
- need to be set so the component always includes a close button`)}}};var f=function(){var e=this,s=e._self._c;return s("dt-lazy-show",e._g({class:["d-modal",e.MODAL_KIND_MODIFIERS[e.kind],e.MODAL_SIZE_MODIFIERS[e.size],e.modalClass],attrs:{transition:"d-zoom",show:e.show,"data-qa":"dt-modal","aria-hidden":e.open}},e.modalListeners),[e.show&&(e.$slots.banner||e.bannerTitle)?s("div",{class:["d-modal__banner",e.bannerClass,e.bannerKindClass],attrs:{"data-qa":"dt-modal-banner"}},[e._t("banner",function(){return[e._v(" "+e._s(e.bannerTitle)+" ")]})],2):e._e(),s("transition",{attrs:{appear:"",name:"d-modal__dialog"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],class:["d-modal__dialog",{"d-modal__dialog--scrollable":e.fixedHeaderFooter},e.dialogClass],attrs:{role:"dialog","aria-modal":"true","aria-describedby":e.describedById,"aria-labelledby":e.labelledById}},[e.$slots.header?s("div",{staticClass:"d-modal__header",attrs:{id:e.labelledById,"data-qa":"dt-modal-title"}},[e._t("header")],2):s("h2",{staticClass:"d-modal__header",attrs:{id:e.labelledById,"data-qa":"dt-modal-title"}},[e._v(" "+e._s(e.title)+" ")]),e.$slots.default?s("div",{class:["d-modal__content",e.contentClass],attrs:{"data-qa":"dt-modal-copy"}},[e._t("default")],2):s("p",{class:["d-modal__content",e.contentClass],attrs:{"data-qa":"dt-modal-copy"}},[e._v(" "+e._s(e.copy)+" ")]),e.hasFooterSlot?s("footer",{staticClass:"d-modal__footer"},[e._t("footer")],2):e._e(),e.hideClose?e._e():s("dt-button",e._b({staticClass:"d-modal__close",attrs:{circle:"",size:"lg",importance:"clear","aria-label":e.closeButtonProps.ariaLabel},on:{click:e.close},scopedSlots:e._u([{key:"icon",fn:function(){return[s("dt-icon-close",{attrs:{size:"400"}})]},proxy:!0}],null,!1,4008927507)},"dt-button",e.closeButtonProps,!1)),e.showVisuallyHiddenClose?s("sr-only-close-button",{attrs:{"visually-hidden-close-label":e.visuallyHiddenCloseLabel},on:{close:e.close}}):e._e()],1)])],1)},p=[],b=c.n(m,f,p);const y=b.exports;exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/mixins/modal.cjs"),a=require("./modal-constants.cjs"),l=require("../../common/utils/index.cjs"),o=require("../../common/constants/index.cjs"),r=require("../../shared/sr_only_close_button.cjs"),d=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),c=require("../lazy-show/lazy-show.cjs"),u=require("../button/button.cjs"),_=require("../../common/mixins/localization.cjs"),m=require("../notice/notice-constants.cjs"),h={name:"DtModal",components:{DtLazyShow:c.default,DtButton:u.default,DtIconClose:i.DtIconClose,SrOnlyCloseButton:r.default},mixins:[n.default,_.default],props:{copy:{type:String,default:""},describedById:{type:String,default:""},labelledById:{type:String,default:function(){return l.getUniqueString()}},show:{type:Boolean,default:!1},title:{type:String,default:""},bannerTitle:{type:String,default:""},kind:{type:String,default:"default",validator:e=>Object.keys(a.MODAL_KIND_MODIFIERS).includes(e)},size:{type:String,default:"default",validator:e=>Object.keys(a.MODAL_SIZE_MODIFIERS).includes(e)},modalClass:{type:[String,Object,Array],default:""},dialogClass:{type:[String,Object,Array],default:""},contentClass:{type:[String,Object,Array],default:""},bannerKind:{type:String,default:"warning",validate(e){return m.NOTICE_KINDS.includes(e)}},bannerClass:{type:[String,Object,Array],default:""},hideClose:{type:Boolean,default:!1},closeOnClick:{type:Boolean,default:!0},fixedHeaderFooter:{type:Boolean,default:!0},initialFocusElement:{type:[String,HTMLElement],default:"first",validator:e=>e==="first"||e instanceof HTMLElement||e.startsWith("#")}},emits:["update:show"],data(){return{MODAL_KIND_MODIFIERS:a.MODAL_KIND_MODIFIERS,MODAL_SIZE_MODIFIERS:a.MODAL_SIZE_MODIFIERS,MODAL_BANNER_KINDS:a.MODAL_BANNER_KINDS,EVENT_KEYNAMES:o.EVENT_KEYNAMES}},computed:{modalListeners(){return{...this.$listeners,click:e=>{this.closeOnClick&&(e.target===e.currentTarget&&this.close(),this.$emit("click",e))},keydown:e=>{switch(e.code){case o.EVENT_KEYNAMES.esc:case o.EVENT_KEYNAMES.escape:this.close();break;case o.EVENT_KEYNAMES.tab:this.trapFocus(e);break}this.$emit("keydown",e)},"after-enter":e=>{this.$emit("update:show",!0),e.target===e.currentTarget&&this.setFocusAfterTransition()}}},open(){return`${!this.show}`},hasFooterSlot(){return!!this.$slots.footer},bannerKindClass(){return a.MODAL_BANNER_KINDS[this.bannerKind]},closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},watch:{show:{handler(e){var t;e?(this.previousActiveElement=document.activeElement,l.disableRootScrolling(this.$el.getRootNode().host)):(l.enableRootScrolling(this.$el.getRootNode().host),(t=this.previousActiveElement)==null||t.focus(),this.previousActiveElement=null)}}},methods:{close(){this.$emit("update:show",!1)},setFocusAfterTransition(){this.initialFocusElement==="first"?this.focusFirstElement():this.initialFocusElement.startsWith("#")?this.focusElementById(this.initialFocusElement):this.initialFocusElement instanceof HTMLElement&&this.initialFocusElement.focus()},trapFocus(e){this.show&&this.focusTrappedTabPress(e)}}};var f=function(){var t=this,s=t._self._c;return s("dt-lazy-show",t._g({class:["d-modal",t.MODAL_KIND_MODIFIERS[t.kind],t.MODAL_SIZE_MODIFIERS[t.size],t.modalClass],attrs:{transition:"d-zoom",show:t.show,"data-qa":"dt-modal","aria-hidden":t.open}},t.modalListeners),[t.show&&(t.$slots.banner||t.bannerTitle)?s("div",{class:["d-modal__banner",t.bannerClass,t.bannerKindClass],attrs:{"data-qa":"dt-modal-banner"}},[t._t("banner",function(){return[t._v(" "+t._s(t.bannerTitle)+" ")]})],2):t._e(),s("transition",{attrs:{appear:"",name:"d-modal__dialog"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],class:["d-modal__dialog",{"d-modal__dialog--scrollable":t.fixedHeaderFooter},t.dialogClass],attrs:{role:"dialog","aria-modal":"true","aria-describedby":t.describedById,"aria-labelledby":t.labelledById}},[t.$slots.header?s("div",{staticClass:"d-modal__header",attrs:{id:t.labelledById,"data-qa":"dt-modal-title"}},[t._t("header")],2):s("h2",{staticClass:"d-modal__header",attrs:{id:t.labelledById,"data-qa":"dt-modal-title"}},[t._v(" "+t._s(t.title)+" ")]),t.$slots.default?s("div",{class:["d-modal__content",t.contentClass],attrs:{"data-qa":"dt-modal-copy"}},[t._t("default")],2):s("p",{class:["d-modal__content",t.contentClass],attrs:{"data-qa":"dt-modal-copy"}},[t._v(" "+t._s(t.copy)+" ")]),t.hasFooterSlot?s("footer",{staticClass:"d-modal__footer"},[t._t("footer")],2):t._e(),t.hideClose?s("sr-only-close-button",{on:{close:t.close}}):s("dt-button",{staticClass:"d-modal__close",attrs:{"data-qa":"dt-modal-close-button",circle:"",size:"lg",importance:"clear","aria-label":t.closeButtonTitle,title:t.closeButtonTitle},on:{click:t.close},scopedSlots:t._u([{key:"icon",fn:function(){return[s("dt-icon-close",{attrs:{size:"400"}})]},proxy:!0}])})],1)])],1)},E=[],b=d.n(h,f,E);const p=b.exports;exports.default=p;
3
2
  //# sourceMappingURL=modal.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"modal.cjs","sources":["../../../components/modal/modal.vue"],"sourcesContent":["<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && ($slots.banner || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"$slots.header\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"$slots.default\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal 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 modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\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 dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\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 contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\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 bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n ...this.$listeners,\n\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n disableRootScrolling(this.$el.getRootNode().host);\n } else {\n enableRootScrolling(this.$el.getRootNode().host);\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtLazyShow","DtButton","DtIconClose","SrOnlyCloseButton","Modal","SrOnlyCloseButtonMixin","props","getUniqueString","k","MODAL_KIND_MODIFIERS","s","MODAL_SIZE_MODIFIERS","kind","NOTICE_KINDS","initialFocusElement","MODAL_BANNER_KINDS","EVENT_KEYNAMES","event","isShowing","disableRootScrolling","enableRootScrolling","_a","e"],"mappings":"6lBAyIAA,EAAA,CACA,KAAA,UAEA,WAAA,CACA,WAAAC,EAAA,QACA,SAAAC,EAAA,QACA,YAAAC,EAAA,YACA,kBAAAC,EAAA,OACA,EAEA,OAAA,CAAAC,EAAA,QAAAC,SAAA,EAEA,MAAA,CAKA,iBAAA,CACA,KAAA,OACA,SAAA,GACA,UAAAC,GACA,CAAA,CAAAA,EAAA,SAEA,EAKA,KAAA,CACA,KAAA,OACA,QAAA,EACA,EAOA,cAAA,CACA,KAAA,OACA,QAAA,EACA,EAKA,aAAA,CACA,KAAA,OACA,QAAA,UAAA,CAAA,OAAAC,EAAA,gBAAA,CAAA,CACA,EAOA,KAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,MAAA,CACA,KAAA,OACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,KAAA,CACA,KAAA,OACA,QAAA,UACA,UAAAC,GAAA,OAAA,KAAAC,sBAAA,EAAA,SAAAD,CAAA,CACA,EAMA,KAAA,CACA,KAAA,OACA,QAAA,UACA,UAAAE,GAAA,OAAA,KAAAC,sBAAA,EAAA,SAAAD,CAAA,CACA,EAOA,WAAA,CACA,KAAA,CAAA,OAAA,OAAA,KAAA,EACA,QAAA,EACA,EAOA,YAAA,CACA,KAAA,CAAA,OA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,KAAA,UAAA,CACA,CACA,EAEA,MAAA,CACA,KAAA,CACA,QAAAG,EAAA,OACAA,GAEA,KAAA,sBAAA,SAAA,cACAC,EAAAA,qBAAA,KAAA,IAAA,YAAA,EAAA,IAAA,IAEAC,EAAAA,oBAAA,KAAA,IAAA,YAAA,EAAA,IAAA,GAEAC,EAAA,KAAA,wBAAA,MAAAA,EAAA,QACA,KAAA,sBAAA,KAEA,CACA,EAEA,OAAA,CACA,UAAA,GACA,KAAA,GACA,SAAA,CACA,KAAA,cAAA,CACA,CACA,CACA,EAEA,QAAA,CACA,OAAA,CACA,KAAA,MAAA,cAAA,EAAA,CACA,EAEA,yBAAA,CACA,KAAA,sBAAA,QACA,KAAA,kBAAA,EACA,KAAA,oBAAA,WAAA,GAAA,EACA,KAAA,iBAAA,KAAA,mBAAA,EACA,KAAA,+BAAA,aACA,KAAA,oBAAA,OAEA,EAEA,UAAAC,EAAA,CACA,KAAA,MACA,KAAA,qBAAAA,CAAA,CAEA,EAEA,eAAA,CACA,KAAA,WAAA,CAAA,KAAA,qBACA,QAAA,MAAA;AAAA,uEACA,CAEA,CACA,CACA"}
1
+ {"version":3,"file":"modal.cjs","sources":["../../../components/modal/modal.vue"],"sourcesContent":["<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && ($slots.banner || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"$slots.header\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"$slots.default\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <sr-only-close-button\n v-if=\"hideClose\"\n @close=\"close\"\n />\n <dt-button\n v-else\n class=\"d-modal__close\"\n data-qa=\"dt-modal-close-button\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, DtLocalizationMixin],\n\n props: {\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal 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 modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\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 dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\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 contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\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 bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n ...this.$listeners,\n\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n watch: {\n show: {\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n disableRootScrolling(this.$el.getRootNode().host);\n } else {\n enableRootScrolling(this.$el.getRootNode().host);\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtLazyShow","DtButton","DtIconClose","SrOnlyCloseButton","Modal","DtLocalizationMixin","getUniqueString","k","MODAL_KIND_MODIFIERS","s","MODAL_SIZE_MODIFIERS","kind","NOTICE_KINDS","initialFocusElement","MODAL_BANNER_KINDS","EVENT_KEYNAMES","event","isShowing","disableRootScrolling","enableRootScrolling","_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KAAA,+BAAA,aACA,KAAA,oBAAA,OAEA,EAEA,UAAA,EAAA,CACA,KAAA,MACA,KAAA,qBAAA,CAAA,CAEA,CACA,CACA"}
@@ -2,12 +2,12 @@ import { DtIconClose as r } from "@dialpad/dialtone-icons/vue2";
2
2
  import n from "../../common/mixins/modal.js";
3
3
  import { MODAL_KIND_MODIFIERS as o, MODAL_SIZE_MODIFIERS as l, MODAL_BANNER_KINDS as i } from "./modal-constants.js";
4
4
  import { getUniqueString as d, disableRootScrolling as c, enableRootScrolling as u } from "../../common/utils/index.js";
5
- import { EVENT_KEYNAMES as a } from "../../common/constants/index.js";
6
- import m from "../../common/mixins/sr-only-close-button.js";
7
- import f from "../../shared/sr_only_close_button.js";
8
- import { n as p } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
5
+ import { EVENT_KEYNAMES as s } from "../../common/constants/index.js";
6
+ import m from "../../shared/sr_only_close_button.js";
7
+ import { n as f } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
9
8
  import h from "../lazy-show/lazy-show.js";
10
9
  import _ from "../button/button.js";
10
+ import p from "../../common/mixins/localization.js";
11
11
  import { NOTICE_KINDS as y } from "../notice/notice-constants.js";
12
12
  const b = {
13
13
  name: "DtModal",
@@ -15,19 +15,10 @@ const b = {
15
15
  DtLazyShow: h,
16
16
  DtButton: _,
17
17
  DtIconClose: r,
18
- SrOnlyCloseButton: f
18
+ SrOnlyCloseButton: m
19
19
  },
20
- mixins: [n, m],
20
+ mixins: [n, p],
21
21
  props: {
22
- /**
23
- * A set of props to be passed into the modal's close button.
24
- * Requires an 'ariaLabel' property.
25
- */
26
- closeButtonProps: {
27
- type: Object,
28
- required: !0,
29
- validator: (e) => !!e.ariaLabel
30
- },
31
22
  /**
32
23
  * Body text to display as the modal's main content.
33
24
  */
@@ -193,7 +184,7 @@ const b = {
193
184
  MODAL_KIND_MODIFIERS: o,
194
185
  MODAL_SIZE_MODIFIERS: l,
195
186
  MODAL_BANNER_KINDS: i,
196
- EVENT_KEYNAMES: a
187
+ EVENT_KEYNAMES: s
197
188
  };
198
189
  },
199
190
  computed: {
@@ -205,11 +196,11 @@ const b = {
205
196
  },
206
197
  keydown: (e) => {
207
198
  switch (e.code) {
208
- case a.esc:
209
- case a.escape:
199
+ case s.esc:
200
+ case s.escape:
210
201
  this.close();
211
202
  break;
212
- case a.tab:
203
+ case s.tab:
213
204
  this.trapFocus(e);
214
205
  break;
215
206
  }
@@ -228,6 +219,9 @@ const b = {
228
219
  },
229
220
  bannerKindClass() {
230
221
  return i[this.bannerKind];
222
+ },
223
+ closeButtonTitle() {
224
+ return this.i18n.$t("DIALTONE_CLOSE_BUTTON");
231
225
  }
232
226
  },
233
227
  watch: {
@@ -236,13 +230,6 @@ const b = {
236
230
  var t;
237
231
  e ? (this.previousActiveElement = document.activeElement, c(this.$el.getRootNode().host)) : (u(this.$el.getRootNode().host), (t = this.previousActiveElement) == null || t.focus(), this.previousActiveElement = null);
238
232
  }
239
- },
240
- $props: {
241
- immediate: !0,
242
- deep: !0,
243
- handler() {
244
- this.validateProps();
245
- }
246
233
  }
247
234
  },
248
235
  methods: {
@@ -254,45 +241,41 @@ const b = {
254
241
  },
255
242
  trapFocus(e) {
256
243
  this.show && this.focusTrappedTabPress(e);
257
- },
258
- validateProps() {
259
- this.hideClose && !this.visuallyHiddenClose && console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props
260
- need to be set so the component always includes a close button`);
261
244
  }
262
245
  }
263
246
  };
264
247
  var g = function() {
265
- var t = this, s = t._self._c;
266
- return s("dt-lazy-show", t._g({ class: [
248
+ var t = this, a = t._self._c;
249
+ return a("dt-lazy-show", t._g({ class: [
267
250
  "d-modal",
268
251
  t.MODAL_KIND_MODIFIERS[t.kind],
269
252
  t.MODAL_SIZE_MODIFIERS[t.size],
270
253
  t.modalClass
271
- ], attrs: { transition: "d-zoom", show: t.show, "data-qa": "dt-modal", "aria-hidden": t.open } }, t.modalListeners), [t.show && (t.$slots.banner || t.bannerTitle) ? s("div", { class: [
254
+ ], attrs: { transition: "d-zoom", show: t.show, "data-qa": "dt-modal", "aria-hidden": t.open } }, t.modalListeners), [t.show && (t.$slots.banner || t.bannerTitle) ? a("div", { class: [
272
255
  "d-modal__banner",
273
256
  t.bannerClass,
274
257
  t.bannerKindClass
275
258
  ], attrs: { "data-qa": "dt-modal-banner" } }, [t._t("banner", function() {
276
259
  return [t._v(" " + t._s(t.bannerTitle) + " ")];
277
- })], 2) : t._e(), s("transition", { attrs: { appear: "", name: "d-modal__dialog" } }, [s("div", { directives: [{ name: "show", rawName: "v-show", value: t.show, expression: "show" }], class: [
260
+ })], 2) : t._e(), a("transition", { attrs: { appear: "", name: "d-modal__dialog" } }, [a("div", { directives: [{ name: "show", rawName: "v-show", value: t.show, expression: "show" }], class: [
278
261
  "d-modal__dialog",
279
262
  { "d-modal__dialog--scrollable": t.fixedHeaderFooter },
280
263
  t.dialogClass
281
- ], attrs: { role: "dialog", "aria-modal": "true", "aria-describedby": t.describedById, "aria-labelledby": t.labelledById } }, [t.$slots.header ? s("div", { staticClass: "d-modal__header", attrs: { id: t.labelledById, "data-qa": "dt-modal-title" } }, [t._t("header")], 2) : s("h2", { staticClass: "d-modal__header", attrs: { id: t.labelledById, "data-qa": "dt-modal-title" } }, [t._v(" " + t._s(t.title) + " ")]), t.$slots.default ? s("div", { class: [
264
+ ], attrs: { role: "dialog", "aria-modal": "true", "aria-describedby": t.describedById, "aria-labelledby": t.labelledById } }, [t.$slots.header ? a("div", { staticClass: "d-modal__header", attrs: { id: t.labelledById, "data-qa": "dt-modal-title" } }, [t._t("header")], 2) : a("h2", { staticClass: "d-modal__header", attrs: { id: t.labelledById, "data-qa": "dt-modal-title" } }, [t._v(" " + t._s(t.title) + " ")]), t.$slots.default ? a("div", { class: [
282
265
  "d-modal__content",
283
266
  t.contentClass
284
- ], attrs: { "data-qa": "dt-modal-copy" } }, [t._t("default")], 2) : s("p", { class: [
267
+ ], attrs: { "data-qa": "dt-modal-copy" } }, [t._t("default")], 2) : a("p", { class: [
285
268
  "d-modal__content",
286
269
  t.contentClass
287
- ], attrs: { "data-qa": "dt-modal-copy" } }, [t._v(" " + t._s(t.copy) + " ")]), t.hasFooterSlot ? s("footer", { staticClass: "d-modal__footer" }, [t._t("footer")], 2) : t._e(), t.hideClose ? t._e() : s("dt-button", t._b({ staticClass: "d-modal__close", attrs: { circle: "", size: "lg", importance: "clear", "aria-label": t.closeButtonProps.ariaLabel }, on: { click: t.close }, scopedSlots: t._u([{ key: "icon", fn: function() {
288
- return [s("dt-icon-close", { attrs: { size: "400" } })];
289
- }, proxy: !0 }], null, !1, 4008927507) }, "dt-button", t.closeButtonProps, !1)), t.showVisuallyHiddenClose ? s("sr-only-close-button", { attrs: { "visually-hidden-close-label": t.visuallyHiddenCloseLabel }, on: { close: t.close } }) : t._e()], 1)])], 1);
290
- }, C = [], S = /* @__PURE__ */ p(
270
+ ], attrs: { "data-qa": "dt-modal-copy" } }, [t._v(" " + t._s(t.copy) + " ")]), t.hasFooterSlot ? a("footer", { staticClass: "d-modal__footer" }, [t._t("footer")], 2) : t._e(), t.hideClose ? a("sr-only-close-button", { on: { close: t.close } }) : a("dt-button", { staticClass: "d-modal__close", attrs: { "data-qa": "dt-modal-close-button", circle: "", size: "lg", importance: "clear", "aria-label": t.closeButtonTitle, title: t.closeButtonTitle }, on: { click: t.close }, scopedSlots: t._u([{ key: "icon", fn: function() {
271
+ return [a("dt-icon-close", { attrs: { size: "400" } })];
272
+ }, proxy: !0 }]) })], 1)])], 1);
273
+ }, S = [], E = /* @__PURE__ */ f(
291
274
  b,
292
275
  g,
293
- C
276
+ S
294
277
  );
295
- const k = S.exports;
278
+ const k = E.exports;
296
279
  export {
297
280
  k as default
298
281
  };
@@ -1 +1 @@
1
- {"version":3,"file":"modal.js","sources":["../../../components/modal/modal.vue"],"sourcesContent":["<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && ($slots.banner || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"$slots.header\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"$slots.default\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <dt-button\n v-if=\"!hideClose\"\n class=\"d-modal__close\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonProps.ariaLabel\"\n v-bind=\"closeButtonProps\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * A set of props to be passed into the modal's close button.\n * Requires an 'ariaLabel' property.\n */\n closeButtonProps: {\n type: Object,\n required: true,\n validator: (props) => {\n return !!props.ariaLabel;\n },\n },\n\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal 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 modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\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 dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\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 contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\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 bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n ...this.$listeners,\n\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n },\n\n watch: {\n show: {\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n disableRootScrolling(this.$el.getRootNode().host);\n } else {\n enableRootScrolling(this.$el.getRootNode().host);\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n\n validateProps () {\n if (this.hideClose && !this.visuallyHiddenClose) {\n console.error(`If hideClose prop is true, visuallyHiddenClose and visuallyHiddenCloseLabel props\n need to be set so the component always includes a close button`);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtLazyShow","DtButton","DtIconClose","SrOnlyCloseButton","Modal","SrOnlyCloseButtonMixin","props","getUniqueString","k","MODAL_KIND_MODIFIERS","s","MODAL_SIZE_MODIFIERS","kind","NOTICE_KINDS","initialFocusElement","MODAL_BANNER_KINDS","EVENT_KEYNAMES","event","isShowing","disableRootScrolling","enableRootScrolling","_a"],"mappings":";;;;;;;;;;;AAyIA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,GAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,kBAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA,CAAAC,MACA,CAAA,CAAAA,EAAA;AAAA,IAEA;AAAA;AAAA;AAAA;AAAA,IAKA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;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A,EAAA,GACAA,EAAA,WAAAA,EAAA,iBAAA,KAAA;QACA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,OAAA;AACA,aAAA,GAAA,CAAA,KAAA,IAAA;AAAA,IACA;AAAA,IAEA,gBAAA;AACA,aAAA,CAAA,CAAA,KAAA,OAAA;AAAA,IACA;AAAA,IAEA,kBAAA;AACA,aAAAF,EAAA,KAAA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,MACA,QAAAG,GAAA;;AACA,QAAAA,KAEA,KAAA,wBAAA,SAAA,eACAC,EAAA,KAAA,IAAA,YAAA,EAAA,IAAA,MAEAC,EAAA,KAAA,IAAA,YAAA,EAAA,IAAA,IAEAC,IAAA,KAAA,0BAAA,QAAAA,EAAA,SACA,KAAA,wBAAA;AAAA,MAEA;AAAA,IACA;AAAA,IAEA,QAAA;AAAA,MACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AACA,aAAA,cAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,QAAA;AACA,WAAA,MAAA,eAAA,EAAA;AAAA,IACA;AAAA,IAEA,0BAAA;AACA,MAAA,KAAA,wBAAA,UACA,KAAA,kBAAA,IACA,KAAA,oBAAA,WAAA,GAAA,IACA,KAAA,iBAAA,KAAA,mBAAA,IACA,KAAA,+BAAA,eACA,KAAA,oBAAA;IAEA;AAAA,IAEA,UAAA,GAAA;AACA,MAAA,KAAA,QACA,KAAA,qBAAA,CAAA;AAAA,IAEA;AAAA,IAEA,gBAAA;AACA,MAAA,KAAA,aAAA,CAAA,KAAA,uBACA,QAAA,MAAA;AAAA,uEACA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"modal.js","sources":["../../../components/modal/modal.vue"],"sourcesContent":["<template>\n <dt-lazy-show\n transition=\"d-zoom\"\n :show=\"show\"\n :class=\"[\n 'd-modal',\n MODAL_KIND_MODIFIERS[kind],\n MODAL_SIZE_MODIFIERS[size],\n modalClass,\n ]\"\n data-qa=\"dt-modal\"\n :aria-hidden=\"open\"\n v-on=\"modalListeners\"\n >\n <div\n v-if=\"show && ($slots.banner || bannerTitle)\"\n data-qa=\"dt-modal-banner\"\n :class=\"[\n 'd-modal__banner',\n bannerClass,\n bannerKindClass,\n ]\"\n >\n <!-- @slot Slot for the banner, defaults to bannerTitle prop -->\n <slot name=\"banner\">\n {{ bannerTitle }}\n </slot>\n </div>\n <transition\n appear\n name=\"d-modal__dialog\"\n >\n <div\n v-show=\"show\"\n :class=\"[\n 'd-modal__dialog',\n { 'd-modal__dialog--scrollable': fixedHeaderFooter },\n dialogClass,\n ]\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-describedby=\"describedById\"\n :aria-labelledby=\"labelledById\"\n >\n <div\n v-if=\"$slots.header\"\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n <!-- @slot Slot for dialog header section, taking the place of any \"title\" text prop -->\n <slot name=\"header\" />\n </div>\n <h2\n v-else\n :id=\"labelledById\"\n class=\"d-modal__header\"\n data-qa=\"dt-modal-title\"\n >\n {{ title }}\n </h2>\n <div\n v-if=\"$slots.default\"\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n <!-- @slot Default slot for dialog body section, taking the place of any \"copy\" text prop -->\n <slot />\n </div>\n <p\n v-else\n :class=\"[\n 'd-modal__content',\n contentClass,\n ]\"\n data-qa=\"dt-modal-copy\"\n >\n {{ copy }}\n </p>\n <footer\n v-if=\"hasFooterSlot\"\n class=\"d-modal__footer\"\n >\n <!-- @slot Slot for dialog footer content, often containing cancel and confirm buttons. -->\n <slot name=\"footer\" />\n </footer>\n <sr-only-close-button\n v-if=\"hideClose\"\n @close=\"close\"\n />\n <dt-button\n v-else\n class=\"d-modal__close\"\n data-qa=\"dt-modal-close-button\"\n circle\n size=\"lg\"\n importance=\"clear\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n @click=\"close\"\n >\n <template #icon>\n <dt-icon-close\n size=\"400\"\n />\n </template>\n </dt-button>\n </div>\n </transition>\n </dt-lazy-show>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport { DtButton } from '@/components/button';\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport Modal from '@/common/mixins/modal';\nimport {\n MODAL_BANNER_KINDS,\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n} from './modal_constants';\nimport { getUniqueString, disableRootScrolling, enableRootScrolling } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport { EVENT_KEYNAMES } from '@/common/constants';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { NOTICE_KINDS } from '@/components/notice';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\n/**\n * Modals focus the user’s attention exclusively on one task or piece of information\n * via a window that sits on top of the page content.\n * @see https://dialtone.dialpad.com/components/modal.html\n */\nexport default {\n name: 'DtModal',\n\n components: {\n DtLazyShow,\n DtButton,\n DtIconClose,\n SrOnlyCloseButton,\n },\n\n mixins: [Modal, DtLocalizationMixin],\n\n props: {\n /**\n * Body text to display as the modal's main content.\n */\n copy: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-describedby.\n * Recommended only if the dialog content itself isn't enough to give full context,\n * as screen readers should recite the dialog contents by default before any aria-description.\n */\n describedById: {\n type: String,\n default: '',\n },\n\n /**\n * Id to use for the dialog's aria-labelledby.\n */\n labelledById: {\n type: String,\n default: function () { return getUniqueString(); },\n },\n\n /**\n * Whether the modal should be shown.\n * Parent component can sync on this value to control the modal's visibility.\n * @values true, false\n */\n show: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Title text to display in the modal header.\n */\n title: {\n type: String,\n default: '',\n },\n\n /**\n * Title text to display in the modal banner.\n */\n bannerTitle: {\n type: String,\n default: '',\n },\n\n /**\n * The theme of the modal. kind - default or danger,\n * @values default, danger\n */\n kind: {\n type: String,\n default: 'default',\n validator: (k) => Object.keys(MODAL_KIND_MODIFIERS).includes(k),\n },\n\n /**\n * The size of the modal. size - default or full,\n * @values default, full\n */\n size: {\n type: String,\n default: 'default',\n validator: (s) => Object.keys(MODAL_SIZE_MODIFIERS).includes(s),\n },\n\n /**\n * Additional class name for the root modal 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 modalClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element within the modal.\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 dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the content element within the modal.\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 contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Sets the color of the banner.\n * @values base, error, info, success, warning\n */\n bannerKind: {\n type: String,\n default: 'warning',\n validate (kind) {\n return NOTICE_KINDS.includes(kind);\n },\n },\n\n /**\n * Additional class name for the banner element within the modal.\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 bannerClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Hides the close button on the modal\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Whether the modal will close when you click outside of the dialog on the overlay.\n * @values true, false\n */\n closeOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Scrollable modal that allows scroll the modal content keeping the header and footer fixed\n * @values true, false\n */\n fixedHeaderFooter: {\n type: Boolean,\n default: true,\n },\n\n /**\n * The element that is focused when the modal is opened. This can be an\n * HTMLElement within the modal, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return initialFocusElement === 'first' ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n },\n\n emits: [\n /**\n * The modal will emit a \"false\" boolean value for this event when the user performs a modal-closing action.\n * Parent components can sync on this value to create a 2-way binding to control modal visibility.\n *\n * @event update:show\n * @type {Boolean}\n */\n 'update:show',\n ],\n\n data () {\n return {\n MODAL_KIND_MODIFIERS,\n MODAL_SIZE_MODIFIERS,\n MODAL_BANNER_KINDS,\n EVENT_KEYNAMES,\n };\n },\n\n computed: {\n modalListeners () {\n return {\n ...this.$listeners,\n\n click: event => {\n if (!this.closeOnClick) return;\n (event.target === event.currentTarget) && this.close();\n this.$emit('click', event);\n },\n\n keydown: event => {\n switch (event.code) {\n case EVENT_KEYNAMES.esc:\n case EVENT_KEYNAMES.escape:\n this.close();\n break;\n case EVENT_KEYNAMES.tab:\n this.trapFocus(event);\n break;\n }\n this.$emit('keydown', event);\n },\n\n 'after-enter': event => {\n this.$emit('update:show', true);\n (event.target === event.currentTarget) && this.setFocusAfterTransition();\n },\n };\n },\n\n open () {\n return `${!this.show}`;\n },\n\n hasFooterSlot () {\n return !!this.$slots.footer;\n },\n\n bannerKindClass () {\n return MODAL_BANNER_KINDS[this.bannerKind];\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n watch: {\n show: {\n handler (isShowing) {\n if (isShowing) {\n // Set a reference to the previously-active element, to which we'll return focus on modal close.\n this.previousActiveElement = document.activeElement;\n disableRootScrolling(this.$el.getRootNode().host);\n } else {\n enableRootScrolling(this.$el.getRootNode().host);\n // Modal is being hidden, so return focus to the previously active element before clearing the reference.\n this.previousActiveElement?.focus();\n this.previousActiveElement = null;\n }\n },\n },\n },\n\n methods: {\n close () {\n this.$emit('update:show', false);\n },\n\n setFocusAfterTransition () {\n if (this.initialFocusElement === 'first') {\n this.focusFirstElement();\n } else if (this.initialFocusElement.startsWith('#')) {\n this.focusElementById(this.initialFocusElement);\n } else if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n trapFocus (e) {\n if (this.show) {\n this.focusTrappedTabPress(e);\n }\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtLazyShow","DtButton","DtIconClose","SrOnlyCloseButton","Modal","DtLocalizationMixin","getUniqueString","k","MODAL_KIND_MODIFIERS","s","MODAL_SIZE_MODIFIERS","kind","NOTICE_KINDS","initialFocusElement","MODAL_BANNER_KINDS","EVENT_KEYNAMES","event","isShowing","disableRootScrolling","enableRootScrolling","_a"],"mappings":";;;;;;;;;;;AAyIA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,mBAAAC;AAAA,EACA;AAAA,EAEA,QAAA,CAAAC,GAAAC,CAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,WAAA;AAAA,eAAAC,EAAA;AAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,MAAA;AAAA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AAA,wBAAA,SAAA,eACAC,EAAA,KAAA,IAAA,YAAA,EAAA,IAAA,MAEAC,EAAA,KAAA,IAAA,YAAA,EAAA,IAAA,IAEAC,IAAA,KAAA,0BAAA,QAAAA,EAAA,SACA,KAAA,wBAAA;AAAA,MAEA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,QAAA;AACA,WAAA,MAAA,eAAA,EAAA;AAAA,IACA;AAAA,IAEA,0BAAA;AACA,MAAA,KAAA,wBAAA,UACA,KAAA,kBAAA,IACA,KAAA,oBAAA,WAAA,GAAA,IACA,KAAA,iBAAA,KAAA,mBAAA,IACA,KAAA,+BAAA,eACA,KAAA,oBAAA;IAEA;AAAA,IAEA,UAAA,GAAA;AACA,MAAA,KAAA,QACA,KAAA,qBAAA,CAAA;AAAA,IAEA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@dialpad/dialtone-icons/vue2"),n=require("../../common/mixins/sr-only-close-button.cjs"),l=require("../../shared/sr_only_close_button.cjs"),i=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),c=require("../button/button.cjs"),a={name:"DtNoticeAction",components:{DtIconClose:s.DtIconClose,DtButton:c.default,SrOnlyCloseButton:l.default},mixins:[n.default],props:{closeButtonProps:{type:Object,default:()=>({})},hideClose:{type:Boolean,default:!1},hideAction:{type:Boolean,default:!1}},emits:["close"],computed:{noticeActionListeners(){return{...this.$listeners,click:t=>{this.close(),this.$emit("click",t)}}}},created(){!this.hideClose&&!this.closeButtonProps.ariaLabel&&console.error("Invalid props: you must pass in closeButtonProps.ariaLabel if the close button is displayed.")},mounted(){this.hideClose||(this.lastFocusedElement=document.activeElement)},beforeDestroy(){var t;(t=this.lastFocusedElement)==null||t.focus()},methods:{close(){this.$emit("close")}}};var r=function(){var e=this,o=e._self._c;return o("div",{staticClass:"d-notice__actions",attrs:{"data-qa":"notice-content-actions"}},[e.hideAction?e._e():e._t("default"),e.hideClose?e._e():o("dt-button",e._g(e._b({ref:"closeButton",attrs:{"data-qa":"dt-notice-action-close-button",size:"sm",importance:"clear",circle:"","aria-label":e.closeButtonProps.ariaLabel?e.closeButtonProps.ariaLabel:"Close"},scopedSlots:e._u([{key:"icon",fn:function(){return[o("dt-icon-close",{attrs:{size:"200"}})]},proxy:!0}],null,!1,4156074325)},"dt-button",e.closeButtonProps,!1),e.noticeActionListeners)),e.showVisuallyHiddenClose?o("sr-only-close-button",{attrs:{"visually-hidden-close-label":e.visuallyHiddenCloseLabel},on:{close:e.close}}):e._e()],2)},u=[],d=i.n(a,r,u);const _=d.exports;exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("@dialpad/dialtone-icons/vue2"),s=require("../../shared/sr_only_close_button.cjs"),i=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),c=require("../button/button.cjs"),l=require("../../common/mixins/localization.cjs"),r={name:"DtNoticeAction",components:{DtIconClose:n.DtIconClose,DtButton:c.default,SrOnlyCloseButton:s.default},mixins:[l.default],props:{hideClose:{type:Boolean,default:!1},hideAction:{type:Boolean,default:!1}},emits:["close"],computed:{noticeActionListeners(){return{...this.$listeners,click:e=>{this.close(),this.$emit("click",e)}}},closeButtonTitle(){return this.i18n.$t("DIALTONE_CLOSE_BUTTON")}},mounted(){this.hideClose||(this.lastFocusedElement=document.activeElement)},beforeDestroy(){var e;(e=this.lastFocusedElement)==null||e.focus()},methods:{close(){this.$emit("close")}}};var a=function(){var t=this,o=t._self._c;return o("div",{staticClass:"d-notice__actions",attrs:{"data-qa":"notice-content-actions"}},[t.hideAction?t._e():t._t("default"),t.hideClose?o("sr-only-close-button",{on:{close:t.close}}):o("dt-button",t._g({ref:"closeButton",attrs:{circle:"","data-qa":"dt-notice-action-close-button",importance:"clear",size:"sm","aria-label":t.closeButtonTitle,title:t.closeButtonTitle},scopedSlots:t._u([{key:"icon",fn:function(){return[o("dt-icon-close",{attrs:{size:"200"}})]},proxy:!0}],null,!1,4156074325)},t.noticeActionListeners))],2)},u=[],_=i.n(r,a,u);const d=_.exports;exports.default=d;
2
2
  //# sourceMappingURL=notice-action.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"notice-action.cjs","sources":["../../../components/notice/notice_action.vue"],"sourcesContent":["<template>\n <div\n class=\"d-notice__actions\"\n data-qa=\"notice-content-actions\"\n >\n <!-- @slot Slot for main content -->\n <slot v-if=\"!hideAction\" />\n <dt-button\n v-if=\"!hideClose\"\n ref=\"closeButton\"\n data-qa=\"dt-notice-action-close-button\"\n size=\"sm\"\n importance=\"clear\"\n circle\n :aria-label=\"closeButtonProps.ariaLabel ? closeButtonProps.ariaLabel : 'Close'\"\n v-bind=\"closeButtonProps\"\n v-on=\"noticeActionListeners\"\n >\n <template #icon>\n <dt-icon-close\n size=\"200\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"close\"\n />\n </div>\n</template>\n\n<script>\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\nexport default {\n name: 'DtNoticeAction',\n\n components: {\n DtIconClose,\n DtButton,\n SrOnlyCloseButton,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * Props for the notice close button.\n */\n closeButtonProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Hides the close button from the notice\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Hides the action from the notice\n * @values true, false\n */\n hideAction: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n ],\n\n computed: {\n noticeActionListeners () {\n return {\n ...this.$listeners,\n\n click: event => {\n this.close();\n this.$emit('click', event);\n },\n };\n },\n },\n\n created () {\n if (!this.hideClose && !this.closeButtonProps.ariaLabel) {\n console.error('Invalid props: you must pass in closeButtonProps.ariaLabel if the close button is displayed.');\n }\n },\n\n mounted () {\n if (!this.hideClose) {\n this.lastFocusedElement = document.activeElement;\n }\n },\n\n beforeDestroy () {\n this.lastFocusedElement?.focus();\n },\n\n methods: {\n close () {\n this.$emit('close');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtIconClose","DtButton","SrOnlyCloseButton","SrOnlyCloseButtonMixin","event","_a"],"mappings":"mWAsCAA,EAAA,CACA,KAAA,iBAEA,WAAA,CACA,YAAAC,EAAA,YACA,SAAAC,EAAA,QACA,kBAAAC,EAAA,OACA,EAEA,OAAA,CAAAC,EAAAA,OAAA,EAEA,MAAA,CAIA,iBAAA,CACA,KAAA,OACA,QAAA,KAAA,CAAA,EACA,EAMA,UAAA,CACA,KAAA,QACA,QAAA,EACA,EAMA,WAAA,CACA,KAAA,QACA,QAAA,EACA,CACA,EAEA,MAAA,CAMA,OACA,EAEA,SAAA,CACA,uBAAA,CACA,MAAA,CACA,GAAA,KAAA,WAEA,MAAAC,GAAA,CACA,KAAA,MAAA,EACA,KAAA,MAAA,QAAAA,CAAA,CACA,CACA,CACA,CACA,EAEA,SAAA,CACA,CAAA,KAAA,WAAA,CAAA,KAAA,iBAAA,WACA,QAAA,MAAA,8FAAA,CAEA,EAEA,SAAA,CACA,KAAA,YACA,KAAA,mBAAA,SAAA,cAEA,EAEA,eAAA,QACAC,EAAA,KAAA,qBAAA,MAAAA,EAAA,OACA,EAEA,QAAA,CACA,OAAA,CACA,KAAA,MAAA,OAAA,CACA,CACA,CACA"}
1
+ {"version":3,"file":"notice-action.cjs","sources":["../../../components/notice/notice_action.vue"],"sourcesContent":["<template>\n <div\n class=\"d-notice__actions\"\n data-qa=\"notice-content-actions\"\n >\n <!-- @slot Slot for main content -->\n <slot v-if=\"!hideAction\" />\n <dt-button\n v-if=\"!hideClose\"\n ref=\"closeButton\"\n circle\n data-qa=\"dt-notice-action-close-button\"\n importance=\"clear\"\n size=\"sm\"\n :aria-label=\"closeButtonTitle\"\n :title=\"closeButtonTitle\"\n v-on=\"noticeActionListeners\"\n >\n <template #icon>\n <dt-icon-close\n size=\"200\"\n />\n </template>\n </dt-button>\n <sr-only-close-button\n v-else\n @close=\"close\"\n />\n </div>\n</template>\n\n<script>\nimport { DtIconClose } from '@dialpad/dialtone-icons/vue2';\nimport { DtButton } from '@/components/button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\nimport { DtLocalizationMixin } from '@/common/mixins';\n\nexport default {\n name: 'DtNoticeAction',\n\n components: {\n DtIconClose,\n DtButton,\n SrOnlyCloseButton,\n },\n\n mixins: [DtLocalizationMixin],\n\n props: {\n /**\n * Hides the close button from the notice\n * @values true, false\n */\n hideClose: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Hides the action from the notice\n * @values true, false\n */\n hideAction: {\n type: Boolean,\n default: false,\n },\n },\n\n emits: [\n /**\n * Close button click event\n *\n * @event close\n */\n 'close',\n ],\n\n computed: {\n noticeActionListeners () {\n return {\n ...this.$listeners,\n\n click: event => {\n this.close();\n this.$emit('click', event);\n },\n };\n },\n\n closeButtonTitle () {\n return this.i18n.$t('DIALTONE_CLOSE_BUTTON');\n },\n },\n\n mounted () {\n if (!this.hideClose) {\n this.lastFocusedElement = document.activeElement;\n }\n },\n\n beforeDestroy () {\n this.lastFocusedElement?.focus();\n },\n\n methods: {\n close () {\n this.$emit('close');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","DtIconClose","DtButton","SrOnlyCloseButton","DtLocalizationMixin","event","_a"],"mappings":"2VAqCAA,EAAA,CACA,KAAA,iBAEA,WAAA,CACA,YAAAC,EAAA,YACA,SAAAC,EAAA,QACA,kBAAAC,EAAA,OACA,EAEA,OAAA,CAAAC,EAAAA,OAAA,EAEA,MAAA,CAKA,UAAA,CACA,KAAA,QACA,QAAA,EACA,EAMA,WAAA,CACA,KAAA,QACA,QAAA,EACA,CACA,EAEA,MAAA,CAMA,OACA,EAEA,SAAA,CACA,uBAAA,CACA,MAAA,CACA,GAAA,KAAA,WAEA,MAAAC,GAAA,CACA,KAAA,MAAA,EACA,KAAA,MAAA,QAAAA,CAAA,CACA,CACA,CACA,EAEA,kBAAA,CACA,OAAA,KAAA,KAAA,GAAA,uBAAA,CACA,CACA,EAEA,SAAA,CACA,KAAA,YACA,KAAA,mBAAA,SAAA,cAEA,EAEA,eAAA,QACAC,EAAA,KAAA,qBAAA,MAAAA,EAAA,OACA,EAEA,QAAA,CACA,OAAA,CACA,KAAA,MAAA,OAAA,CACA,CACA,CACA"}