@dialpad/dialtone-vue 3.120.0 → 3.120.2

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 (425) hide show
  1. package/dist/chunks/_plugin-vue_export-helper-caHeSgYY.js +11 -0
  2. package/dist/chunks/_plugin-vue_export-helper-caHeSgYY.js.map +1 -0
  3. package/dist/chunks/_plugin-vue_export-helper-fhnQq0tA.js +10 -0
  4. package/dist/chunks/_plugin-vue_export-helper-fhnQq0tA.js.map +1 -0
  5. package/dist/chunks/{dropdown-eWOvBvwq.js → dropdown-Hn-TeTvZ.js} +151 -104
  6. package/dist/chunks/{dropdown-UO3UJalk.js.map → dropdown-Hn-TeTvZ.js.map} +1 -1
  7. package/dist/chunks/dropdown-w8Do29L5.js +442 -0
  8. package/dist/chunks/{dropdown-eWOvBvwq.js.map → dropdown-w8Do29L5.js.map} +1 -1
  9. package/dist/chunks/dropdown_constants-2pGCXy7m.js +8 -0
  10. package/dist/chunks/dropdown_constants-2pGCXy7m.js.map +1 -0
  11. package/dist/chunks/dropdown_constants-w1MXGC3Z.js +9 -0
  12. package/dist/chunks/dropdown_constants-w1MXGC3Z.js.map +1 -0
  13. package/dist/chunks/{icon_constants-OpYAAKwF.js → icon_constants-Dy4MEUJL.js} +7 -6
  14. package/dist/chunks/{icon_constants-2S_OSQ1t.js.map → icon_constants-Dy4MEUJL.js.map} +1 -1
  15. package/dist/chunks/icon_constants-QYpmdE0R.js +16 -0
  16. package/dist/chunks/{icon_constants-OpYAAKwF.js.map → icon_constants-QYpmdE0R.js.map} +1 -1
  17. package/dist/chunks/index-4qgKeErp.js +446 -0
  18. package/dist/chunks/{index-b4iXYvId.js.map → index-4qgKeErp.js.map} +1 -1
  19. package/dist/chunks/index-b_MgDylR.js +447 -0
  20. package/dist/chunks/{index-6tYeqbgP.js.map → index-b_MgDylR.js.map} +1 -1
  21. package/dist/chunks/{input-4UQWegUk.js → input-NmYDD5bn.js} +83 -60
  22. package/dist/chunks/{input-0Uksk4DP.js.map → input-NmYDD5bn.js.map} +1 -1
  23. package/dist/chunks/input-ttnte8zB.js +295 -0
  24. package/dist/chunks/{input-4UQWegUk.js.map → input-ttnte8zB.js.map} +1 -1
  25. package/dist/chunks/input_group-M-D25pOJ.js +152 -0
  26. package/dist/chunks/{input_group-bBKaq3Wi.js.map → input_group-M-D25pOJ.js.map} +1 -1
  27. package/dist/chunks/{input_group-bBKaq3Wi.js → input_group-jWnq2DJT.js} +27 -24
  28. package/dist/chunks/{input_group-AS760Cp7.js.map → input_group-jWnq2DJT.js.map} +1 -1
  29. package/dist/chunks/keyboard_list_navigation-ScXhrxya.js +284 -0
  30. package/dist/chunks/{keyboard_list_navigation-N74Bpdq7.js.map → keyboard_list_navigation-ScXhrxya.js.map} +1 -1
  31. package/dist/chunks/keyboard_list_navigation-fJnl_Iox.js +283 -0
  32. package/dist/chunks/{keyboard_list_navigation-F0O8nht0.js.map → keyboard_list_navigation-fJnl_Iox.js.map} +1 -1
  33. package/dist/chunks/link_constants-Huj7D_hm.js +22 -0
  34. package/dist/chunks/{link_constants-Kn6kP4i1.js.map → link_constants-Huj7D_hm.js.map} +1 -1
  35. package/dist/chunks/link_constants-nWVlXQBs.js +23 -0
  36. package/dist/chunks/{link_constants-vIUB92L4.js.map → link_constants-nWVlXQBs.js.map} +1 -1
  37. package/dist/chunks/list_item_constants-EiqkqZvP.js +13 -0
  38. package/dist/chunks/{list_item_constants-Tsz5CO1m.js.map → list_item_constants-EiqkqZvP.js.map} +1 -1
  39. package/dist/chunks/list_item_constants-u1xcN9Dd.js +14 -0
  40. package/dist/chunks/{list_item_constants-LTUc74pD.js.map → list_item_constants-u1xcN9Dd.js.map} +1 -1
  41. package/dist/chunks/modal-VgxXAQFP.js +105 -0
  42. package/dist/chunks/{modal-qEzlo0Sj.js.map → modal-VgxXAQFP.js.map} +1 -1
  43. package/dist/chunks/modal-XOr4kiNZ.js +106 -0
  44. package/dist/chunks/{modal-VuMFkZFH.js.map → modal-XOr4kiNZ.js.map} +1 -1
  45. package/dist/chunks/notice_action-WTucGhvr.js +222 -0
  46. package/dist/chunks/{notice_action-tJfD5Qw1.js.map → notice_action-WTucGhvr.js.map} +1 -1
  47. package/dist/chunks/notice_action-p-ePanW_.js +223 -0
  48. package/dist/chunks/{notice_action-jO199emq.js.map → notice_action-p-ePanW_.js.map} +1 -1
  49. package/dist/chunks/notice_constants-7Qt2CQEY.js +7 -0
  50. package/dist/chunks/{notice_constants-mC6al2Dm.js.map → notice_constants-7Qt2CQEY.js.map} +1 -1
  51. package/dist/chunks/notice_constants-UXo9e3bS.js +6 -0
  52. package/dist/chunks/{notice_constants-c--hBFQw.js.map → notice_constants-UXo9e3bS.js.map} +1 -1
  53. package/dist/chunks/popover_constants-JwBF9h1Z.js +143 -0
  54. package/dist/chunks/{popover_constants-hOEhklvr.js.map → popover_constants-JwBF9h1Z.js.map} +1 -1
  55. package/dist/chunks/popover_constants-Qkpb0yh2.js +144 -0
  56. package/dist/chunks/{popover_constants-qjlEkroB.js.map → popover_constants-Qkpb0yh2.js.map} +1 -1
  57. package/dist/chunks/{sr_only_close_button-7O-Ev8uM.js → sr_only_close_button-3EdsV-dH.js} +28 -24
  58. package/dist/chunks/{sr_only_close_button-iD7s1Pbj.js.map → sr_only_close_button-3EdsV-dH.js.map} +1 -1
  59. package/dist/chunks/sr_only_close_button-xGrHFjwA.js +91 -0
  60. package/dist/chunks/{sr_only_close_button-7O-Ev8uM.js.map → sr_only_close_button-xGrHFjwA.js.map} +1 -1
  61. package/dist/chunks/stack_constants-HraCekPm.js +15 -0
  62. package/dist/chunks/{stack_constants-m9Ickqw0.js.map → stack_constants-HraCekPm.js.map} +1 -1
  63. package/dist/chunks/stack_constants-SMzMWnAQ.js +14 -0
  64. package/dist/chunks/{stack_constants-u7tNqGtc.js.map → stack_constants-SMzMWnAQ.js.map} +1 -1
  65. package/dist/chunks/tab-RTDgnD9-.js +391 -0
  66. package/dist/chunks/{tab-at7WWglk.js.map → tab-RTDgnD9-.js.map} +1 -1
  67. package/dist/chunks/tab-qc3f42Yp.js +390 -0
  68. package/dist/chunks/{tab-GQZFMq83.js.map → tab-qc3f42Yp.js.map} +1 -1
  69. package/dist/common/constants.cjs +60 -0
  70. package/dist/{lib → common}/constants.cjs.map +1 -1
  71. package/dist/{lib → common}/constants.js +25 -18
  72. package/dist/{lib → common}/constants.js.map +1 -1
  73. package/dist/common/dates.cjs +72 -0
  74. package/dist/{lib → common}/dates.cjs.map +1 -1
  75. package/dist/common/dates.js +72 -0
  76. package/dist/{lib → common}/dates.js.map +1 -1
  77. package/dist/common/emoji.cjs +163 -0
  78. package/dist/common/emoji.cjs.map +1 -0
  79. package/dist/common/emoji.js +168 -0
  80. package/dist/common/emoji.js.map +1 -0
  81. package/dist/common/mixins.cjs +17 -0
  82. package/dist/{lib → common}/mixins.cjs.map +1 -1
  83. package/dist/common/mixins.js +17 -0
  84. package/dist/common/utils.cjs +243 -0
  85. package/dist/{lib → common}/utils.cjs.map +1 -1
  86. package/dist/common/utils.js +243 -0
  87. package/dist/{lib → common}/utils.js.map +1 -1
  88. package/dist/common/validators.cjs +23 -0
  89. package/dist/{lib → common}/validators.cjs.map +1 -1
  90. package/dist/common/validators.js +23 -0
  91. package/dist/{lib → common}/validators.js.map +1 -1
  92. package/dist/dialtone-vue.cjs +373 -1
  93. package/dist/dialtone-vue.cjs.map +1 -1
  94. package/dist/dialtone-vue.js +328 -327
  95. package/dist/dialtone-vue.js.map +1 -1
  96. package/dist/lib/attachment-carousel.cjs +345 -1
  97. package/dist/lib/attachment-carousel.cjs.map +1 -1
  98. package/dist/lib/attachment-carousel.js +126 -108
  99. package/dist/lib/attachment-carousel.js.map +1 -1
  100. package/dist/lib/avatar.cjs +447 -1
  101. package/dist/lib/avatar.cjs.map +1 -1
  102. package/dist/lib/avatar.js +135 -101
  103. package/dist/lib/avatar.js.map +1 -1
  104. package/dist/lib/badge.cjs +206 -1
  105. package/dist/lib/badge.cjs.map +1 -1
  106. package/dist/lib/badge.js +64 -48
  107. package/dist/lib/badge.js.map +1 -1
  108. package/dist/lib/banner.cjs +242 -2
  109. package/dist/lib/banner.cjs.map +1 -1
  110. package/dist/lib/banner.js +81 -71
  111. package/dist/lib/banner.js.map +1 -1
  112. package/dist/lib/breadcrumbs.cjs +150 -1
  113. package/dist/lib/breadcrumbs.cjs.map +1 -1
  114. package/dist/lib/breadcrumbs.js +60 -52
  115. package/dist/lib/breadcrumbs.js.map +1 -1
  116. package/dist/lib/button-group.cjs +41 -1
  117. package/dist/lib/button-group.cjs.map +1 -1
  118. package/dist/lib/button-group.js +15 -14
  119. package/dist/lib/button-group.js.map +1 -1
  120. package/dist/lib/button.cjs +356 -1
  121. package/dist/lib/button.cjs.map +1 -1
  122. package/dist/lib/button.js +108 -88
  123. package/dist/lib/button.js.map +1 -1
  124. package/dist/lib/callbar-button-with-popover.cjs +322 -1
  125. package/dist/lib/callbar-button-with-popover.cjs.map +1 -1
  126. package/dist/lib/callbar-button-with-popover.js +101 -83
  127. package/dist/lib/callbar-button-with-popover.js.map +1 -1
  128. package/dist/lib/callbar-button.cjs +200 -1
  129. package/dist/lib/callbar-button.cjs.map +1 -1
  130. package/dist/lib/callbar-button.js +52 -45
  131. package/dist/lib/callbar-button.js.map +1 -1
  132. package/dist/lib/callbox.cjs +217 -1
  133. package/dist/lib/callbox.cjs.map +1 -1
  134. package/dist/lib/callbox.js +80 -67
  135. package/dist/lib/callbox.js.map +1 -1
  136. package/dist/lib/card.cjs +91 -1
  137. package/dist/lib/card.cjs.map +1 -1
  138. package/dist/lib/card.js +27 -27
  139. package/dist/lib/card.js.map +1 -1
  140. package/dist/lib/checkbox-group.cjs +115 -1
  141. package/dist/lib/checkbox-group.cjs.map +1 -1
  142. package/dist/lib/checkbox-group.js +34 -23
  143. package/dist/lib/checkbox-group.js.map +1 -1
  144. package/dist/lib/checkbox.cjs +156 -1
  145. package/dist/lib/checkbox.cjs.map +1 -1
  146. package/dist/lib/checkbox.js +72 -60
  147. package/dist/lib/checkbox.js.map +1 -1
  148. package/dist/lib/chip.cjs +235 -1
  149. package/dist/lib/chip.cjs.map +1 -1
  150. package/dist/lib/chip.js +84 -67
  151. package/dist/lib/chip.js.map +1 -1
  152. package/dist/lib/codeblock.cjs +23 -2
  153. package/dist/lib/codeblock.cjs.map +1 -1
  154. package/dist/lib/codeblock.js +13 -13
  155. package/dist/lib/codeblock.js.map +1 -1
  156. package/dist/lib/collapsible.cjs +398 -1
  157. package/dist/lib/collapsible.cjs.map +1 -1
  158. package/dist/lib/collapsible.js +123 -100
  159. package/dist/lib/collapsible.js.map +1 -1
  160. package/dist/lib/combobox-multi-select.cjs +589 -1
  161. package/dist/lib/combobox-multi-select.cjs.map +1 -1
  162. package/dist/lib/combobox-multi-select.js +270 -177
  163. package/dist/lib/combobox-multi-select.js.map +1 -1
  164. package/dist/lib/combobox-with-popover.cjs +452 -1
  165. package/dist/lib/combobox-with-popover.cjs.map +1 -1
  166. package/dist/lib/combobox-with-popover.js +172 -127
  167. package/dist/lib/combobox-with-popover.js.map +1 -1
  168. package/dist/lib/combobox.cjs +18 -1
  169. package/dist/lib/combobox.cjs.map +1 -1
  170. package/dist/lib/combobox.js +9 -9
  171. package/dist/lib/contact-info.cjs +205 -1
  172. package/dist/lib/contact-info.cjs.map +1 -1
  173. package/dist/lib/contact-info.js +69 -60
  174. package/dist/lib/contact-info.js.map +1 -1
  175. package/dist/lib/contact-row.cjs +246 -1
  176. package/dist/lib/contact-row.cjs.map +1 -1
  177. package/dist/lib/contact-row.js +67 -63
  178. package/dist/lib/contact-row.js.map +1 -1
  179. package/dist/lib/datepicker.cjs +854 -1
  180. package/dist/lib/datepicker.cjs.map +1 -1
  181. package/dist/lib/datepicker.js +585 -441
  182. package/dist/lib/datepicker.js.map +1 -1
  183. package/dist/lib/description-list.cjs +116 -1
  184. package/dist/lib/description-list.cjs.map +1 -1
  185. package/dist/lib/description-list.js +56 -24
  186. package/dist/lib/description-list.js.map +1 -1
  187. package/dist/lib/dropdown.cjs +36 -1
  188. package/dist/lib/dropdown.cjs.map +1 -1
  189. package/dist/lib/dropdown.js +22 -21
  190. package/dist/lib/dropdown.js.map +1 -1
  191. package/dist/lib/editor.cjs +711 -1
  192. package/dist/lib/editor.cjs.map +1 -1
  193. package/dist/lib/editor.js +271 -235
  194. package/dist/lib/editor.js.map +1 -1
  195. package/dist/lib/emoji-picker.cjs +1277 -1
  196. package/dist/lib/emoji-picker.cjs.map +1 -1
  197. package/dist/lib/emoji-picker.js +859 -569
  198. package/dist/lib/emoji-picker.js.map +1 -1
  199. package/dist/lib/emoji-row.cjs +128 -1
  200. package/dist/lib/emoji-row.cjs.map +1 -1
  201. package/dist/lib/emoji-row.js +89 -75
  202. package/dist/lib/emoji-row.js.map +1 -1
  203. package/dist/lib/emoji-text-wrapper.cjs +102 -1
  204. package/dist/lib/emoji-text-wrapper.cjs.map +1 -1
  205. package/dist/lib/emoji-text-wrapper.js +42 -31
  206. package/dist/lib/emoji-text-wrapper.js.map +1 -1
  207. package/dist/lib/emoji.cjs +158 -1
  208. package/dist/lib/emoji.cjs.map +1 -1
  209. package/dist/lib/emoji.js +153 -6
  210. package/dist/lib/emoji.js.map +1 -1
  211. package/dist/lib/feed-item-row.cjs +296 -1
  212. package/dist/lib/feed-item-row.cjs.map +1 -1
  213. package/dist/lib/feed-item-row.js +119 -100
  214. package/dist/lib/feed-item-row.js.map +1 -1
  215. package/dist/lib/feed-pill.cjs +173 -1
  216. package/dist/lib/feed-pill.cjs.map +1 -1
  217. package/dist/lib/feed-pill.js +70 -57
  218. package/dist/lib/feed-pill.js.map +1 -1
  219. package/dist/lib/general-row.cjs +518 -1
  220. package/dist/lib/general-row.cjs.map +1 -1
  221. package/dist/lib/general-row.js +186 -148
  222. package/dist/lib/general-row.js.map +1 -1
  223. package/dist/lib/group-row.cjs +116 -1
  224. package/dist/lib/group-row.cjs.map +1 -1
  225. package/dist/lib/group-row.js +37 -35
  226. package/dist/lib/group-row.js.map +1 -1
  227. package/dist/lib/grouped-chip.cjs +96 -1
  228. package/dist/lib/grouped-chip.cjs.map +1 -1
  229. package/dist/lib/grouped-chip.js +51 -46
  230. package/dist/lib/grouped-chip.js.map +1 -1
  231. package/dist/lib/hovercard.cjs +223 -1
  232. package/dist/lib/hovercard.cjs.map +1 -1
  233. package/dist/lib/hovercard.js +115 -80
  234. package/dist/lib/hovercard.js.map +1 -1
  235. package/dist/lib/icon.cjs +58 -1
  236. package/dist/lib/icon.cjs.map +1 -1
  237. package/dist/lib/icon.js +20 -20
  238. package/dist/lib/icon.js.map +1 -1
  239. package/dist/lib/image-viewer.cjs +243 -1
  240. package/dist/lib/image-viewer.cjs.map +1 -1
  241. package/dist/lib/image-viewer.js +104 -80
  242. package/dist/lib/image-viewer.js.map +1 -1
  243. package/dist/lib/input-group.cjs +91 -1
  244. package/dist/lib/input-group.cjs.map +1 -1
  245. package/dist/lib/input-group.js +41 -39
  246. package/dist/lib/input-group.js.map +1 -1
  247. package/dist/lib/input.cjs +578 -1
  248. package/dist/lib/input.cjs.map +1 -1
  249. package/dist/lib/input.js +185 -137
  250. package/dist/lib/input.js.map +1 -1
  251. package/dist/lib/item-layout.cjs +91 -1
  252. package/dist/lib/item-layout.cjs.map +1 -1
  253. package/dist/lib/item-layout.js +45 -39
  254. package/dist/lib/item-layout.js.map +1 -1
  255. package/dist/lib/ivr-node.cjs +263 -1
  256. package/dist/lib/ivr-node.cjs.map +1 -1
  257. package/dist/lib/ivr-node.js +130 -112
  258. package/dist/lib/ivr-node.js.map +1 -1
  259. package/dist/lib/keyboard-shortcut.cjs +119 -1
  260. package/dist/lib/keyboard-shortcut.cjs.map +1 -1
  261. package/dist/lib/keyboard-shortcut.js +58 -48
  262. package/dist/lib/keyboard-shortcut.js.map +1 -1
  263. package/dist/lib/lazy-show.cjs +82 -1
  264. package/dist/lib/lazy-show.cjs.map +1 -1
  265. package/dist/lib/lazy-show.js +21 -19
  266. package/dist/lib/lazy-show.js.map +1 -1
  267. package/dist/lib/link.cjs +43 -1
  268. package/dist/lib/link.cjs.map +1 -1
  269. package/dist/lib/link.js +20 -19
  270. package/dist/lib/link.js.map +1 -1
  271. package/dist/lib/list-item-group.cjs +67 -1
  272. package/dist/lib/list-item-group.cjs.map +1 -1
  273. package/dist/lib/list-item-group.js +24 -22
  274. package/dist/lib/list-item-group.js.map +1 -1
  275. package/dist/lib/list-item.cjs +216 -1
  276. package/dist/lib/list-item.cjs.map +1 -1
  277. package/dist/lib/list-item.js +71 -60
  278. package/dist/lib/list-item.js.map +1 -1
  279. package/dist/lib/message-input.cjs +708 -1
  280. package/dist/lib/message-input.cjs.map +1 -1
  281. package/dist/lib/message-input.js +232 -206
  282. package/dist/lib/message-input.js.map +1 -1
  283. package/dist/lib/modal.cjs +444 -2
  284. package/dist/lib/modal.cjs.map +1 -1
  285. package/dist/lib/modal.js +153 -120
  286. package/dist/lib/modal.js.map +1 -1
  287. package/dist/lib/notice.cjs +197 -1
  288. package/dist/lib/notice.cjs.map +1 -1
  289. package/dist/lib/notice.js +66 -63
  290. package/dist/lib/notice.js.map +1 -1
  291. package/dist/lib/pagination.cjs +205 -1
  292. package/dist/lib/pagination.cjs.map +1 -1
  293. package/dist/lib/pagination.js +96 -81
  294. package/dist/lib/pagination.js.map +1 -1
  295. package/dist/lib/popover.cjs +1080 -1
  296. package/dist/lib/popover.cjs.map +1 -1
  297. package/dist/lib/popover.js +447 -267
  298. package/dist/lib/popover.js.map +1 -1
  299. package/dist/lib/presence.cjs +70 -1
  300. package/dist/lib/presence.cjs.map +1 -1
  301. package/dist/lib/presence.js +33 -27
  302. package/dist/lib/presence.js.map +1 -1
  303. package/dist/lib/radio-group.cjs +88 -1
  304. package/dist/lib/radio-group.cjs.map +1 -1
  305. package/dist/lib/radio-group.js +18 -18
  306. package/dist/lib/radio-group.js.map +1 -1
  307. package/dist/lib/radio.cjs +162 -1
  308. package/dist/lib/radio.cjs.map +1 -1
  309. package/dist/lib/radio.js +66 -57
  310. package/dist/lib/radio.js.map +1 -1
  311. package/dist/lib/rich-text-editor.cjs +1137 -1
  312. package/dist/lib/rich-text-editor.cjs.map +1 -1
  313. package/dist/lib/rich-text-editor.js +567 -386
  314. package/dist/lib/rich-text-editor.js.map +1 -1
  315. package/dist/lib/root-layout.cjs +158 -1
  316. package/dist/lib/root-layout.cjs.map +1 -1
  317. package/dist/lib/root-layout.js +33 -31
  318. package/dist/lib/root-layout.js.map +1 -1
  319. package/dist/lib/scroller.cjs +1090 -1
  320. package/dist/lib/scroller.cjs.map +1 -1
  321. package/dist/lib/scroller.js +668 -345
  322. package/dist/lib/scroller.js.map +1 -1
  323. package/dist/lib/select-menu.cjs +312 -1
  324. package/dist/lib/select-menu.cjs.map +1 -1
  325. package/dist/lib/select-menu.js +124 -79
  326. package/dist/lib/select-menu.js.map +1 -1
  327. package/dist/lib/settings-menu-button.cjs +77 -1
  328. package/dist/lib/settings-menu-button.cjs.map +1 -1
  329. package/dist/lib/settings-menu-button.js +31 -30
  330. package/dist/lib/settings-menu-button.js.map +1 -1
  331. package/dist/lib/skeleton.cjs +635 -1
  332. package/dist/lib/skeleton.cjs.map +1 -1
  333. package/dist/lib/skeleton.js +189 -152
  334. package/dist/lib/skeleton.js.map +1 -1
  335. package/dist/lib/stack.cjs +123 -1
  336. package/dist/lib/stack.cjs.map +1 -1
  337. package/dist/lib/stack.js +61 -53
  338. package/dist/lib/stack.js.map +1 -1
  339. package/dist/lib/tabs.cjs +102 -1
  340. package/dist/lib/tabs.cjs.map +1 -1
  341. package/dist/lib/tabs.js +47 -41
  342. package/dist/lib/tabs.js.map +1 -1
  343. package/dist/lib/time-pill.cjs +41 -1
  344. package/dist/lib/time-pill.cjs.map +1 -1
  345. package/dist/lib/time-pill.js +18 -14
  346. package/dist/lib/time-pill.js.map +1 -1
  347. package/dist/lib/toast.cjs +281 -1
  348. package/dist/lib/toast.cjs.map +1 -1
  349. package/dist/lib/toast.js +96 -74
  350. package/dist/lib/toast.js.map +1 -1
  351. package/dist/lib/toggle.cjs +192 -1
  352. package/dist/lib/toggle.cjs.map +1 -1
  353. package/dist/lib/toggle.js +60 -49
  354. package/dist/lib/toggle.js.map +1 -1
  355. package/dist/lib/tooltip-directive.cjs +84 -1
  356. package/dist/lib/tooltip-directive.cjs.map +1 -1
  357. package/dist/lib/tooltip-directive.js +56 -42
  358. package/dist/lib/tooltip-directive.js.map +1 -1
  359. package/dist/lib/tooltip.cjs +460 -1
  360. package/dist/lib/tooltip.cjs.map +1 -1
  361. package/dist/lib/tooltip.js +162 -103
  362. package/dist/lib/tooltip.js.map +1 -1
  363. package/dist/lib/top-banner-info.cjs +71 -1
  364. package/dist/lib/top-banner-info.cjs.map +1 -1
  365. package/dist/lib/top-banner-info.js +27 -22
  366. package/dist/lib/top-banner-info.js.map +1 -1
  367. package/dist/lib/unread-pill.cjs +73 -1
  368. package/dist/lib/unread-pill.cjs.map +1 -1
  369. package/dist/lib/unread-pill.js +28 -25
  370. package/dist/lib/unread-pill.js.map +1 -1
  371. package/dist/lib/validation-messages.cjs +89 -1
  372. package/dist/lib/validation-messages.cjs.map +1 -1
  373. package/dist/lib/validation-messages.js +41 -36
  374. package/dist/lib/validation-messages.js.map +1 -1
  375. package/dist/style.css +1257 -1
  376. package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +2 -2
  377. package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +2 -2
  378. package/package.json +30 -29
  379. package/dist/chunks/_plugin-vue_export-helper-6_y-gaV6.js +0 -2
  380. package/dist/chunks/_plugin-vue_export-helper-6_y-gaV6.js.map +0 -1
  381. package/dist/chunks/_plugin-vue_export-helper-hUChTQA_.js +0 -10
  382. package/dist/chunks/_plugin-vue_export-helper-hUChTQA_.js.map +0 -1
  383. package/dist/chunks/dropdown-UO3UJalk.js +0 -2
  384. package/dist/chunks/dropdown_constants-EUcDxBrX.js +0 -9
  385. package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +0 -1
  386. package/dist/chunks/dropdown_constants-KHFvVI2L.js +0 -2
  387. package/dist/chunks/dropdown_constants-KHFvVI2L.js.map +0 -1
  388. package/dist/chunks/icon_constants-2S_OSQ1t.js +0 -2
  389. package/dist/chunks/index-6tYeqbgP.js +0 -3
  390. package/dist/chunks/index-IBtQ5jRJ.js +0 -2
  391. package/dist/chunks/index-IBtQ5jRJ.js.map +0 -1
  392. package/dist/chunks/index-b4iXYvId.js +0 -399
  393. package/dist/chunks/index-mRmwpCBG.js +0 -256
  394. package/dist/chunks/index-mRmwpCBG.js.map +0 -1
  395. package/dist/chunks/input-0Uksk4DP.js +0 -2
  396. package/dist/chunks/input_group-AS760Cp7.js +0 -2
  397. package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +0 -197
  398. package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js +0 -2
  399. package/dist/chunks/link_constants-Kn6kP4i1.js +0 -2
  400. package/dist/chunks/link_constants-vIUB92L4.js +0 -16
  401. package/dist/chunks/list_item_constants-LTUc74pD.js +0 -13
  402. package/dist/chunks/list_item_constants-Tsz5CO1m.js +0 -2
  403. package/dist/chunks/modal-VuMFkZFH.js +0 -82
  404. package/dist/chunks/modal-qEzlo0Sj.js +0 -2
  405. package/dist/chunks/notice_action-jO199emq.js +0 -2
  406. package/dist/chunks/notice_action-tJfD5Qw1.js +0 -209
  407. package/dist/chunks/notice_constants-c--hBFQw.js +0 -6
  408. package/dist/chunks/notice_constants-mC6al2Dm.js +0 -2
  409. package/dist/chunks/popover_constants-hOEhklvr.js +0 -2
  410. package/dist/chunks/popover_constants-qjlEkroB.js +0 -114
  411. package/dist/chunks/sr_only_close_button-iD7s1Pbj.js +0 -3
  412. package/dist/chunks/stack_constants-m9Ickqw0.js +0 -2
  413. package/dist/chunks/stack_constants-u7tNqGtc.js +0 -13
  414. package/dist/chunks/tab-GQZFMq83.js +0 -367
  415. package/dist/chunks/tab-at7WWglk.js +0 -2
  416. package/dist/lib/constants.cjs +0 -2
  417. package/dist/lib/dates.cjs +0 -2
  418. package/dist/lib/dates.js +0 -57
  419. package/dist/lib/mixins.cjs +0 -2
  420. package/dist/lib/mixins.js +0 -17
  421. package/dist/lib/utils.cjs +0 -2
  422. package/dist/lib/utils.js +0 -171
  423. package/dist/lib/validators.cjs +0 -2
  424. package/dist/lib/validators.js +0 -12
  425. /package/dist/{lib → common}/mixins.js.map +0 -0
@@ -1,2 +1,1081 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../chunks/popover_constants-hOEhklvr.js"),d=require("./utils.cjs"),m=require("../chunks/modal-qEzlo0Sj.js"),o=require("vue"),f=require("../chunks/_plugin-vue_export-helper-6_y-gaV6.js"),v=require("./button.cjs"),y=require("./icon.cjs"),u=require("../chunks/sr_only_close_button-iD7s1Pbj.js"),C=require("./lazy-show.cjs");require("tippy.js");require("./constants.cjs");require("../chunks/link_constants-Kn6kP4i1.js");require("@dialpad/dialtone-icons/vue3");require("../chunks/icon_constants-2S_OSQ1t.js");require("@dialpad/dialtone-icons/icons.json");const E={name:"PopoverHeaderFooter",components:{DtButton:v.DtButton,DtIcon:y.DtIcon},props:{type:{type:String,validator:function(e){return["header","footer"].includes(e)}},contentClass:{type:[String,Array,Object],default:""},showCloseButton:{type:Boolean,default:!1},closeButtonProps:{type:Object,default:()=>{}}},emits:["close"],data(){return{hasSlotContent:d.hasSlotContent}},methods:{focusCloseButton(){var t;const e=(t=this.$refs["popover__close-button"])==null?void 0:t.$el;e==null||e.focus()}}};function O(e,t,n,a,l,i){const c=o.resolveComponent("dt-icon"),h=o.resolveComponent("dt-button");return o.openBlock(),o.createElementBlock("div",{"data-qa":"dt-popover-header-footer",class:o.normalizeClass({"d-popover__header":n.type==="header","d-popover__footer":n.type==="footer"})},[l.hasSlotContent(e.$slots.content)?(o.openBlock(),o.createElementBlock("div",{key:0,"data-qa":"dt-popover-header-footer-content",class:o.normalizeClass([{"d-popover__header__content":n.type==="header","d-popover__footer__content":n.type==="footer"},n.contentClass])},[o.renderSlot(e.$slots,"content")],2)):o.createCommentVNode("",!0),n.showCloseButton?(o.openBlock(),o.createBlock(h,o.mergeProps({key:1,ref:"popover__close-button","data-qa":"dt-popover-close",class:{"d-popover__header__close-button":n.type==="header","d-popover__footer__close-button":n.type==="footer"},importance:"outlined",kind:"muted",circle:""},n.closeButtonProps,{onClick:t[0]||(t[0]=p=>e.$emit("close"))}),{icon:o.withCtx(()=>[o.createVNode(c,{name:"close",size:"300"})]),_:1},16,["class"])):o.createCommentVNode("",!0)],2)}const _=f._(E,[["render",O]]),b={name:"DtPopover",components:{SrOnlyCloseButton:u.S,DtLazyShow:C.DtLazyShow,PopoverHeaderFooter:_},mixins:[m.M,u.a],props:{open:{type:Boolean,default:null},openOnContext:{type:Boolean,default:!1},elementType:{type:String,default:"div"},transition:{type:String,default:"fade"},role:{type:String,default:"dialog",validator:e=>s.b.includes(e)},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null},closeButtonProps:{type:Object,default:()=>({})},padding:{type:String,default:"large",validator:e=>Object.keys(s.P).some(t=>t===e)},contentClass:{type:[String,Array,Object],default:""},contentWidth:{type:String,default:"",validator:e=>s.c.includes(e)},contentAppear:{type:Boolean,default:null},contentTabindex:{type:Number||null,default:-1},externalAnchor:{type:String,default:""},id:{type:String,default(){return d.getUniqueString()}},offset:{type:Array,default:()=>[0,4]},hideOnClick:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},fallbackPlacements:{type:Array,default:()=>["auto"]},placement:{type:String,default:"bottom-end"},tether:{type:Boolean,default:!0},sticky:{type:[Boolean,String],default:!1,validator:e=>s.f.includes(e)},maxHeight:{type:String,default:""},maxWidth:{type:String,default:""},showCloseButton:{type:Boolean,default:!1},headerClass:{type:[String,Array,Object],default:""},footerClass:{type:[String,Array,Object],default:""},dialogClass:{type:[String,Array,Object],default:""},initialFocusElement:{type:[String,HTMLElement],default:"first",validator:e=>s.d.includes(e)||e instanceof HTMLElement||e.startsWith("#")},openWithArrowKeys:{type:Boolean,default:!1},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>s.e.includes(e)||e instanceof HTMLElement},hovercard:{type:Boolean,default:!1},timer:{type:[Object,null],default:null,validator:e=>e===null||e.enter&&e.leave&&Object.keys(e).includes("current")}},emits:["keydown","update:open","opened"],data(){return{POPOVER_PADDING_CLASSES:s.P,POPOVER_HEADER_FOOTER_PADDING_CLASSES:s.a,intersectionObserver:null,isOutsideViewport:!1,isOpen:!1,toAppear:!1,anchorEl:null,popoverContentEl:null,hasSlotContent:d.hasSlotContent,inTimer:null,outTimer:null}},computed:{popoverListeners(){return{keydown:e=>{this.onKeydown(e)},"after-leave":e=>{this.onLeaveTransitionComplete()},"after-enter":e=>{this.onEnterTransitionComplete()}}},calculatedMaxHeight(){return this.isOutsideViewport&&this.modal?"calc(100vh - var(--dt-space-300))":this.maxHeight},labelledBy(){return this.ariaLabelledby||!this.ariaLabel&&d.getUniqueString("DtPopover__anchor")},currentHovercard(){var e;return(e=this.timer)==null?void 0:e.current}},watch:{$props:{immediate:!0,deep:!0,handler(){this.validateProps()}},modal(e){var t;(t=this.tip)==null||t.setProps({zIndex:e?650:this.calculateAnchorZindex()})},offset(e){var t;(t=this.tip)==null||t.setProps({offset:e})},sticky(e){var t;(t=this.tip)==null||t.setProps({sticky:e})},fallbackPlacements(){var e;(e=this.tip)==null||e.setProps({popperOptions:this.popperOptions()})},tether(){var e;(e=this.tip)==null||e.setProps({popperOptions:this.popperOptions()})},placement(e){var t;(t=this.tip)==null||t.setProps({placement:e})},open:{handler:function(e){e!==null&&(this.isOpen=e),e===!0&&(this.toAppear=!0)},immediate:!0},contentAppear:{handler:function(e){e!==null&&(this.toAppear=e)}},isOpen(e,t){e?(this.initTippyInstance(),this.tip.show()):!e&&t!==e&&(this.removeEventListeners(),this.tip.hide())},currentHovercard(){this.hovercard&&this.timer&&(this.currentHovercard===this.id?this.isOpen=!0:this.isOpen=!1)}},mounted(){var t;const e=this.externalAnchor?this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`):null;this.anchorEl=e??this.$refs.anchor.children[0],this.popoverContentEl=(t=this.$refs.content)==null?void 0:t.$el,this.isOpen&&(this.initTippyInstance(),this.tip.show()),this.intersectionObserver=new IntersectionObserver(this.hasIntersectedViewport),this.intersectionObserver.observe(this.popoverContentEl)},beforeUnmount(){var e;(e=this.tip)==null||e.destroy(),this.intersectionObserver.disconnect(),this.removeReferences(),this.removeEventListeners()},methods:{hasIntersectedViewport(e){var a;const t=(a=e==null?void 0:e[0])==null?void 0:a.target;if(!t)return;const n=d.isOutOfViewPort(t);this.isOutsideViewport=n.bottom||n.top},popperOptions(){return s.l({fallbackPlacements:this.fallbackPlacements,tether:this.tether,hasHideModifierEnabled:!0})},validateProps(){this.modal&&this.initialFocusElement==="none"&&console.error('If the popover is modal you must set the initialFocusElement prop. Possible values: "dialog", "first", HTMLElement')},calculateAnchorZindex(){var e;return this.$el.getRootNode().querySelector('.d-modal[aria-hidden="false"], .d-modal--transparent[aria-hidden="false"]')||(e=this.anchorEl)!=null&&e.closest(".d-zi-drawer")?650:300},defaultToggleOpen(e){var t,n,a;if(!this.hovercard&&!this.openOnContext&&(this.open===null||this.open===void 0)){if(!((t=this.anchorEl)!=null&&t.contains(e.target))&&!((n=this.anchorEl)!=null&&n.isEqualNode(e.target))||(a=this.anchorEl)!=null&&a.disabled)return;this.toggleOpen()}},async onContext(e){this.openOnContext&&(e.preventDefault(),this.isOpen=!0,await this.$nextTick(),this.tip.setProps({placement:"right-start",getReferenceClientRect:()=>({width:0,height:0,top:e.clientY,bottom:e.clientY,left:e.clientX,right:e.clientX})}))},toggleOpen(){this.isOpen=!this.isOpen},onArrowKeyPress(e){var t;this.open===null&&(this.openWithArrowKeys&&((t=this.anchorEl)!=null&&t.contains(e.target))&&(this.isOpen||(this.isOpen=!0)),this.$emit("keydown",e))},addEventListeners(){window.addEventListener("dt-popover-close",this.closePopover),this.contentWidth==="anchor"&&window.addEventListener("resize",this.onResize)},removeEventListeners(){window.removeEventListener("dt-popover-close",this.closePopover),this.contentWidth==="anchor"&&window.removeEventListener("resize",this.onResize)},closePopover(){this.isOpen=!1},preventScrolling(){var e,t;if(this.modal){const n=(e=this.anchorEl)==null?void 0:e.closest("body, .tippy-box");if(!n)return;((t=n.tagName)==null?void 0:t.toLowerCase())==="body"?(n.classList.add("d-of-hidden"),this.tip.setProps({offset:this.offset})):n.classList.add("d-zi-popover")}},enableScrolling(){var t,n;const e=(t=this.anchorEl)==null?void 0:t.closest("body, .tippy-box");e&&(((n=e.tagName)==null?void 0:n.toLowerCase())==="body"?(e.classList.remove("d-of-hidden"),this.tip.setProps({offset:this.offset})):e.classList.remove("d-zi-popover"))},removeReferences(){this.anchorEl=null,this.popoverContentEl=null,this.tip=null},async onShow(){this.contentWidth==="anchor"&&await this.setPopoverContentAnchorWidth(),this.contentWidth===null&&(this.popoverContentEl.style.width="auto"),this.addEventListeners()},async onLeaveTransitionComplete(){var e;this.modal&&(await this.focusFirstElement(this.$refs.anchor),await this.$nextTick(),this.enableScrolling()),(e=this.tip)==null||e.unmount(),this.$emit("opened",!1),this.open!==null&&this.$emit("update:open",!1)},async onEnterTransitionComplete(){this.focusInitialElement(),await this.$nextTick(),this.preventScrolling(),this.$emit("opened",!0,this.$refs.popover__content),this.open!==null&&this.$emit("update:open",!0)},focusInitialElement(){var e,t;this.initialFocusElement==="dialog"&&((t=(e=this.$refs.content)==null?void 0:e.$el)==null||t.focus()),this.initialFocusElement.startsWith("#")&&this.focusInitialElementById(),this.initialFocusElement==="first"&&this.focusFirstElementIfNeeded(this.$refs.popover__content),this.initialFocusElement instanceof HTMLElement&&this.initialFocusElement.focus()},focusInitialElementById(){var t,n,a;const e=(n=(t=this.$refs.content)==null?void 0:t.$el)==null?void 0:n.querySelector(this.initialFocusElement);e?e.focus():console.warn('Could not find the element specified in dt-popover prop "initialFocusElement". Defaulting to focusing the dialog.'),e?e.focus():(a=this.$refs.content)==null||a.$el.focus()},onResize(){this.closePopover()},onClickOutside(){if(!this.hideOnClick)return;this.popoverContentEl.querySelector(".d-popover__anchor--opened")||this.closePopover()},onKeydown(e){e.key==="Tab"&&this.modal&&this.focusTrappedTabPress(e,this.popoverContentEl),e.key==="Escape"&&this.closePopover(),this.$emit("keydown",e)},async setPopoverContentAnchorWidth(){var e;await this.$nextTick(),this.popoverContentEl.style.width=`${(e=this.anchorEl)==null?void 0:e.clientWidth}px`},focusFirstElementIfNeeded(e){var n,a;this._getFocusableElements(e,!0).length!==0?this.focusFirstElement(e):this.showCloseButton?(n=this.$refs.popover__header)==null||n.focusCloseButton():(a=this.$refs.content)==null||a.$el.focus()},initTippyInstance(){var e,t;this.tip=s.n(this.anchorEl,{popperOptions:this.popperOptions(),contentElement:this.popoverContentEl,placement:this.placement,offset:this.offset,sticky:this.sticky,appendTo:this.appendTo==="body"?(t=(e=this.anchorEl)==null?void 0:e.getRootNode())==null?void 0:t.querySelector("body"):this.appendTo,interactive:!0,trigger:"manual",hideOnClick:!1,zIndex:this.modal?650:this.calculateAnchorZindex(),onClickOutside:this.onClickOutside,onShow:this.onShow})},setInTimer(){this.inTimer=setTimeout(()=>{this.isOpen=!0},s.h)},setOutTimer(){this.outTimer=setTimeout(()=>{this.isOpen=!1},s.h)},onEnterAnchor(){this.hovercard&&(this.timer?this.timer.enter(this.id):(clearTimeout(this.outTimer),this.setInTimer()))},onLeaveAnchor(){this.hovercard&&(this.timer?this.timer.leave():(clearTimeout(this.inTimer),this.setOutTimer()))},onEnterContent(){this.hovercard&&(this.timer?this.timer.enter(this.id):clearTimeout(this.outTimer))},onLeaveContent(){this.hovercard&&(this.timer?this.timer.leave():this.setOutTimer())}}},P=["aria-hidden"],g=["id","data-qa","tabindex"],S=["data-qa"];function w(e,t,n,a,l,i){const c=o.resolveComponent("popover-header-footer"),h=o.resolveComponent("sr-only-close-button"),p=o.resolveComponent("dt-lazy-show");return o.openBlock(),o.createElementBlock("div",null,[n.modal&&l.isOpen?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"body"},[o.createElementVNode("div",{class:"d-modal--transparent","aria-hidden":n.modal&&l.isOpen?"false":"true",onClick:t[0]||(t[0]=o.withModifiers(()=>{},["prevent","stop"]))},null,8,P)])):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.elementType),{ref:"popover",class:o.normalizeClass(["d-popover",{"d-popover__anchor--opened":l.isOpen}]),"data-qa":"dt-popover-container"},{default:o.withCtx(()=>[o.createElementVNode("div",{id:!n.ariaLabelledby&&i.labelledBy,ref:"anchor","data-qa":e.$attrs["data-qa"]?`${e.$attrs["data-qa"]}-anchor`:"dt-popover-anchor",tabindex:n.openOnContext?0:void 0,onClickCapture:t[1]||(t[1]=(...r)=>i.defaultToggleOpen&&i.defaultToggleOpen(...r)),onContextmenu:t[2]||(t[2]=(...r)=>i.onContext&&i.onContext(...r)),onKeydown:[t[3]||(t[3]=o.withKeys(o.withModifiers((...r)=>i.onArrowKeyPress&&i.onArrowKeyPress(...r),["prevent"]),["up"])),t[4]||(t[4]=o.withKeys(o.withModifiers((...r)=>i.onArrowKeyPress&&i.onArrowKeyPress(...r),["prevent"]),["down"])),t[6]||(t[6]=o.withKeys(r=>e.$emit("keydown",r),["enter"])),t[7]||(t[7]=o.withKeys(r=>e.$emit("keydown",r),["space"]))],onKeydownCapture:t[5]||(t[5]=o.withKeys((...r)=>i.closePopover&&i.closePopover(...r),["escape"])),onMouseenter:t[8]||(t[8]=(...r)=>i.onEnterAnchor&&i.onEnterAnchor(...r)),onMouseleave:t[9]||(t[9]=(...r)=>i.onLeaveAnchor&&i.onLeaveAnchor(...r))},[o.renderSlot(e.$slots,"anchor",{attrs:{"aria-expanded":l.isOpen.toString(),"aria-controls":n.id,"aria-haspopup":n.role}})],40,g),o.createVNode(p,o.mergeProps({id:n.id,ref:"content",role:n.role,"data-qa":e.$attrs["data-qa"]?`${e.$attrs["data-qa"]}__dialog`:"dt-popover","aria-hidden":`${!l.isOpen}`,"aria-labelledby":i.labelledBy,"aria-label":n.ariaLabel,"aria-modal":`${!n.modal}`,transition:n.transition,show:l.isOpen,appear:l.toAppear,class:["d-popover__dialog",{"d-popover__dialog--modal":n.modal},n.dialogClass],style:{"max-height":i.calculatedMaxHeight,"max-width":n.maxWidth},css:e.$attrs.css,tabindex:n.contentTabindex},o.toHandlers(i.popoverListeners),{onMouseenter:i.onEnterContent,onMouseleave:i.onLeaveContent}),{default:o.withCtx(()=>[l.hasSlotContent(e.$slots.headerContent)||n.showCloseButton?(o.openBlock(),o.createBlock(c,{key:0,ref:"popover__header",class:o.normalizeClass(l.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding]),"content-class":n.headerClass,type:"header","show-close-button":n.showCloseButton,"close-button-props":n.closeButtonProps,onClose:i.closePopover},{content:o.withCtx(()=>[o.renderSlot(e.$slots,"headerContent",{close:i.closePopover})]),_:3},8,["class","content-class","show-close-button","close-button-props","onClose"])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref:"popover__content","data-qa":e.$attrs["data-qa"]?`${e.$attrs["data-qa"]}-content`:"dt-popover-content",class:o.normalizeClass(["d-popover__content",l.POPOVER_PADDING_CLASSES[n.padding],n.contentClass])},[o.renderSlot(e.$slots,"content",{close:i.closePopover})],10,S),l.hasSlotContent(e.$slots.footerContent)?(o.openBlock(),o.createBlock(c,{key:1,ref:"popover__footer",type:"footer",class:o.normalizeClass(l.POPOVER_HEADER_FOOTER_PADDING_CLASSES[n.padding]),"content-class":n.footerClass},{content:o.withCtx(()=>[o.renderSlot(e.$slots,"footerContent",{close:i.closePopover})]),_:3},8,["class","content-class"])):o.createCommentVNode("",!0),e.showVisuallyHiddenClose?(o.openBlock(),o.createBlock(h,{key:2,"visually-hidden-close-label":e.visuallyHiddenCloseLabel,onClose:i.closePopover},null,8,["visually-hidden-close-label","onClose"])):o.createCommentVNode("",!0)]),_:3},16,["id","role","data-qa","aria-hidden","aria-labelledby","aria-label","aria-modal","transition","show","appear","class","style","css","tabindex","onMouseenter","onMouseleave"])]),_:3},8,["class"]))])}const T=f._(b,[["render",w]]);exports.POPOVER_APPEND_TO_VALUES=s.e;exports.POPOVER_CONTENT_WIDTHS=s.c;exports.POPOVER_DIRECTIONS=s.g;exports.POPOVER_HEADER_FOOTER_PADDING_CLASSES=s.a;exports.POPOVER_INITIAL_FOCUS_STRINGS=s.d;exports.POPOVER_PADDING_CLASSES=s.P;exports.POPOVER_ROLES=s.b;exports.POPOVER_STICKY_VALUES=s.f;exports.DtPopover=T;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const popover_constants = require("../chunks/popover_constants-JwBF9h1Z.js");
4
+ const common_utils = require("../common/utils.cjs");
5
+ const modal = require("../chunks/modal-VgxXAQFP.js");
6
+ const vue = require("vue");
7
+ const _pluginVue_exportHelper = require("../chunks/_plugin-vue_export-helper-fhnQq0tA.js");
8
+ const lib_button = require("./button.cjs");
9
+ const lib_icon = require("./icon.cjs");
10
+ const sr_only_close_button = require("../chunks/sr_only_close_button-xGrHFjwA.js");
11
+ const lib_lazyShow = require("./lazy-show.cjs");
12
+ require("tippy.js");
13
+ require("../common/constants.cjs");
14
+ require("../chunks/link_constants-Huj7D_hm.js");
15
+ require("@dialpad/dialtone-icons/vue3");
16
+ require("../chunks/icon_constants-QYpmdE0R.js");
17
+ require("@dialpad/dialtone-icons/icons.json");
18
+ const _sfc_main$1 = {
19
+ name: "PopoverHeaderFooter",
20
+ components: {
21
+ DtButton: lib_button.DtButton,
22
+ DtIcon: lib_icon.DtIcon
23
+ },
24
+ props: {
25
+ // eslint-disable-next-line vue/require-default-prop
26
+ type: {
27
+ type: String,
28
+ validator: function(value) {
29
+ return ["header", "footer"].includes(value);
30
+ }
31
+ },
32
+ /**
33
+ * Additional class name for the content wrapper element.
34
+ */
35
+ contentClass: {
36
+ type: [String, Array, Object],
37
+ default: ""
38
+ },
39
+ /**
40
+ * Determines visibility for close button
41
+ * @values true, false
42
+ */
43
+ showCloseButton: {
44
+ type: Boolean,
45
+ default: false
46
+ },
47
+ /**
48
+ * A set of props to be passed into the popover's header close button.
49
+ * Requires an 'ariaLabel' property.
50
+ */
51
+ closeButtonProps: {
52
+ type: Object,
53
+ default: () => {
54
+ }
55
+ }
56
+ },
57
+ emits: [
58
+ /**
59
+ * Emitted when popover is closed
60
+ *
61
+ * @event close
62
+ * @type { Boolean }
63
+ */
64
+ "close"
65
+ ],
66
+ data() {
67
+ return {
68
+ hasSlotContent: common_utils.hasSlotContent
69
+ };
70
+ },
71
+ methods: {
72
+ focusCloseButton() {
73
+ var _a;
74
+ const closeButton = (_a = this.$refs["popover__close-button"]) == null ? void 0 : _a.$el;
75
+ closeButton == null ? void 0 : closeButton.focus();
76
+ }
77
+ }
78
+ };
79
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
80
+ const _component_dt_icon = vue.resolveComponent("dt-icon");
81
+ const _component_dt_button = vue.resolveComponent("dt-button");
82
+ return vue.openBlock(), vue.createElementBlock("div", {
83
+ "data-qa": "dt-popover-header-footer",
84
+ class: vue.normalizeClass({
85
+ "d-popover__header": $props.type === "header",
86
+ "d-popover__footer": $props.type === "footer"
87
+ })
88
+ }, [
89
+ $data.hasSlotContent(_ctx.$slots.content) ? (vue.openBlock(), vue.createElementBlock("div", {
90
+ key: 0,
91
+ "data-qa": "dt-popover-header-footer-content",
92
+ class: vue.normalizeClass([{
93
+ "d-popover__header__content": $props.type === "header",
94
+ "d-popover__footer__content": $props.type === "footer"
95
+ }, $props.contentClass])
96
+ }, [
97
+ vue.renderSlot(_ctx.$slots, "content")
98
+ ], 2)) : vue.createCommentVNode("", true),
99
+ $props.showCloseButton ? (vue.openBlock(), vue.createBlock(_component_dt_button, vue.mergeProps({
100
+ key: 1,
101
+ ref: "popover__close-button",
102
+ "data-qa": "dt-popover-close",
103
+ class: {
104
+ "d-popover__header__close-button": $props.type === "header",
105
+ "d-popover__footer__close-button": $props.type === "footer"
106
+ },
107
+ importance: "outlined",
108
+ kind: "muted",
109
+ circle: ""
110
+ }, $props.closeButtonProps, {
111
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
112
+ }), {
113
+ icon: vue.withCtx(() => [
114
+ vue.createVNode(_component_dt_icon, {
115
+ name: "close",
116
+ size: "300"
117
+ })
118
+ ]),
119
+ _: 1
120
+ }, 16, ["class"])) : vue.createCommentVNode("", true)
121
+ ], 2);
122
+ }
123
+ const PopoverHeaderFooter = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
124
+ const _sfc_main = {
125
+ name: "DtPopover",
126
+ /********************
127
+ * CHILD COMPONENTS *
128
+ ********************/
129
+ components: {
130
+ SrOnlyCloseButton: sr_only_close_button.SrOnlyCloseButton,
131
+ DtLazyShow: lib_lazyShow.DtLazyShow,
132
+ PopoverHeaderFooter
133
+ },
134
+ mixins: [modal.Modal, sr_only_close_button.SrOnlyCloseButtonMixin],
135
+ props: {
136
+ /**
137
+ * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.
138
+ * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.
139
+ * Supports v-model
140
+ * @values null, true, false
141
+ */
142
+ open: {
143
+ type: Boolean,
144
+ default: null
145
+ },
146
+ /**
147
+ * Opens the popover on right click (context menu). If you set this value to `true`,
148
+ * the default trigger behavior will be disabled.
149
+ * @values true, false
150
+ */
151
+ openOnContext: {
152
+ type: Boolean,
153
+ default: false
154
+ },
155
+ /**
156
+ * Element type (tag name) of the root element of the component.
157
+ */
158
+ elementType: {
159
+ type: String,
160
+ default: "div"
161
+ },
162
+ /**
163
+ * Named transition when the content display is toggled.
164
+ * @see DtLazyShow
165
+ */
166
+ transition: {
167
+ type: String,
168
+ default: "fade"
169
+ },
170
+ /**
171
+ * ARIA role for the content of the popover. Defaults to "dialog".
172
+ * <a class="d-link" href="https://www.w3.org/TR/wai-aria/#aria-haspopup" target="_blank">aria-haspopup</a>
173
+ */
174
+ role: {
175
+ type: String,
176
+ default: "dialog",
177
+ validator: (role) => {
178
+ return popover_constants.POPOVER_ROLES.includes(role);
179
+ }
180
+ },
181
+ /**
182
+ * ID of the element that serves as the label for the popover content.
183
+ * Defaults to the "anchor" element; this exists to provide a different
184
+ * ID of the label element if, for example, the anchor slot contains
185
+ * other items that do not serve as a label. You should provide this
186
+ * or ariaLabel, but not both.
187
+ */
188
+ ariaLabelledby: {
189
+ type: String,
190
+ default: null
191
+ },
192
+ /**
193
+ * Descriptive label for the popover content. You should provide this
194
+ * or ariaLabelledby, but not both.
195
+ */
196
+ ariaLabel: {
197
+ type: String,
198
+ default: null
199
+ },
200
+ /**
201
+ * A set of props to be passed into the popover's header close button.
202
+ * Requires an 'ariaLabel' property, when the header popover is visible
203
+ */
204
+ closeButtonProps: {
205
+ type: Object,
206
+ default: () => ({})
207
+ },
208
+ /**
209
+ * Padding size class for the popover content.
210
+ * @values none, small, medium, large
211
+ */
212
+ padding: {
213
+ type: String,
214
+ default: "large",
215
+ validator: (padding) => {
216
+ return Object.keys(popover_constants.POPOVER_PADDING_CLASSES).some((item) => item === padding);
217
+ }
218
+ },
219
+ /**
220
+ * Additional class name for the content wrapper element.
221
+ */
222
+ contentClass: {
223
+ type: [String, Array, Object],
224
+ default: ""
225
+ },
226
+ /**
227
+ * Width configuration for the popover content. When its value is 'anchor',
228
+ * the popover content will have the same width as the anchor.
229
+ * @values null, anchor
230
+ */
231
+ contentWidth: {
232
+ type: String,
233
+ default: "",
234
+ validator: (contentWidth) => popover_constants.POPOVER_CONTENT_WIDTHS.includes(contentWidth)
235
+ },
236
+ /**
237
+ * Whether to apply transition on initial render in the content lazy show component.
238
+ */
239
+ contentAppear: {
240
+ type: Boolean,
241
+ default: null
242
+ },
243
+ /**
244
+ * Tabindex value for the content. Passing null, no tabindex attribute will be set.
245
+ */
246
+ contentTabindex: {
247
+ type: Number || null,
248
+ default: -1
249
+ },
250
+ /**
251
+ * External anchor id to use in those cases the anchor can't be provided via the slot.
252
+ * For instance, using the combobox's input as the anchor for the popover.
253
+ */
254
+ externalAnchor: {
255
+ type: String,
256
+ default: ""
257
+ },
258
+ /**
259
+ * The id of the tooltip
260
+ */
261
+ id: {
262
+ type: String,
263
+ default() {
264
+ return common_utils.getUniqueString();
265
+ }
266
+ },
267
+ /**
268
+ * Displaces the content box from its anchor element
269
+ * by the specified number of pixels.
270
+ * <a
271
+ * class="d-link"
272
+ * href="https://atomiks.github.io/tippyjs/v6/all-props/#offset"
273
+ * target="_blank"
274
+ * >
275
+ * Tippy.js docs
276
+ * </a>
277
+ */
278
+ offset: {
279
+ type: Array,
280
+ default: () => [0, 4]
281
+ },
282
+ /**
283
+ * Determines if the popover hides upon clicking the
284
+ * anchor or outside the content box.
285
+ * @values true, false
286
+ */
287
+ hideOnClick: {
288
+ type: Boolean,
289
+ default: true
290
+ },
291
+ /**
292
+ * Determines modal state. If enabled popover has a modal overlay
293
+ * preventing interaction with elements below it, but it is invisible.
294
+ * @values true, false
295
+ */
296
+ modal: {
297
+ type: Boolean,
298
+ default: true
299
+ },
300
+ /**
301
+ * If the popover does not fit in the direction described by "placement",
302
+ * it will attempt to change its direction to the "fallbackPlacements".
303
+ * <a
304
+ * class="d-link"
305
+ * href="https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements"
306
+ * target="_blank"
307
+ * >
308
+ * Popper.js docs
309
+ * </a>
310
+ * */
311
+ fallbackPlacements: {
312
+ type: Array,
313
+ default: () => {
314
+ return ["auto"];
315
+ }
316
+ },
317
+ /**
318
+ * The direction the popover displays relative to the anchor.
319
+ * <a
320
+ * class="d-link"
321
+ * href="https://atomiks.github.io/tippyjs/v6/all-props/#placement"
322
+ * target="_blank"
323
+ * >
324
+ * Tippy.js docs
325
+ * </a>
326
+ * @values top, top-start, top-end,
327
+ * right, right-start, right-end,
328
+ * left, left-start, left-end,
329
+ * bottom, bottom-start, bottom-end,
330
+ * auto, auto-start, auto-end
331
+ */
332
+ placement: {
333
+ type: String,
334
+ default: "bottom-end"
335
+ },
336
+ /**
337
+ * If set to false the dialog will display over top of the anchor when there is insufficient space.
338
+ * If set to true it will never move from its position relative to the anchor and will clip instead.
339
+ * <a
340
+ * class="d-link"
341
+ * href="https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether"
342
+ * target="_blank"
343
+ * >
344
+ * Popper.js docs
345
+ * </a>
346
+ * @values true, false
347
+ */
348
+ tether: {
349
+ type: Boolean,
350
+ default: true
351
+ },
352
+ /**
353
+ * If the popover sticks to the anchor. This is usually not needed, but can be needed
354
+ * if the reference element's position is animating, or to automatically update the popover
355
+ * position in those cases the DOM layout changes the reference element's position.
356
+ * `true` enables it, `reference` only checks the "reference" rect for changes and `popper` only
357
+ * checks the "popper" rect for changes.
358
+ * <a
359
+ * class="d-link"
360
+ * href="https://atomiks.github.io/tippyjs/v6/all-props/#sticky"
361
+ * target="_blank"
362
+ * >
363
+ * Tippy.js docs
364
+ * </a>
365
+ * @values true, false, reference, popper
366
+ */
367
+ sticky: {
368
+ type: [Boolean, String],
369
+ default: false,
370
+ validator: (sticky) => {
371
+ return popover_constants.POPOVER_STICKY_VALUES.includes(sticky);
372
+ }
373
+ },
374
+ /**
375
+ * Determines maximum height for the popover before overflow.
376
+ * Possible units rem|px|em
377
+ */
378
+ maxHeight: {
379
+ type: String,
380
+ default: ""
381
+ },
382
+ /**
383
+ * Determines maximum width for the popover before overflow.
384
+ * Possible units rem|px|%|em
385
+ */
386
+ maxWidth: {
387
+ type: String,
388
+ default: ""
389
+ },
390
+ /**
391
+ * Determines visibility for close button
392
+ * @values true, false
393
+ */
394
+ showCloseButton: {
395
+ type: Boolean,
396
+ default: false
397
+ },
398
+ /**
399
+ * Additional class name for the header content wrapper element.
400
+ */
401
+ headerClass: {
402
+ type: [String, Array, Object],
403
+ default: ""
404
+ },
405
+ /**
406
+ * Additional class name for the footer content wrapper element.
407
+ */
408
+ footerClass: {
409
+ type: [String, Array, Object],
410
+ default: ""
411
+ },
412
+ /**
413
+ * Additional class name for the dialog element.
414
+ */
415
+ dialogClass: {
416
+ type: [String, Array, Object],
417
+ default: ""
418
+ },
419
+ /**
420
+ * The element that is focused when the popover is opened. This can be an
421
+ * HTMLElement within the popover, a string starting with '#' which will
422
+ * find the element by ID. 'first' which will automatically focus
423
+ * the first element, or 'dialog' which will focus the dialog window itself.
424
+ * If the dialog is modal this prop cannot be 'none'.
425
+ * @values none, dialog, first
426
+ */
427
+ initialFocusElement: {
428
+ type: [String, HTMLElement],
429
+ default: "first",
430
+ validator: (initialFocusElement) => {
431
+ return popover_constants.POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) || initialFocusElement instanceof HTMLElement || initialFocusElement.startsWith("#");
432
+ }
433
+ },
434
+ /**
435
+ * If the popover should open pressing up or down arrow key on the anchor element.
436
+ * This can be set when not passing open prop.
437
+ * @values true, false
438
+ */
439
+ openWithArrowKeys: {
440
+ type: Boolean,
441
+ default: false
442
+ },
443
+ /**
444
+ * Sets the element to which the popover is going to append to.
445
+ * 'body' will append to the nearest body (supports shadow DOM).
446
+ * @values 'body', 'parent', HTMLElement,
447
+ */
448
+ appendTo: {
449
+ type: [HTMLElement, String],
450
+ default: "body",
451
+ validator: (appendTo) => {
452
+ return popover_constants.POPOVER_APPEND_TO_VALUES.includes(appendTo) || appendTo instanceof HTMLElement;
453
+ }
454
+ },
455
+ /**
456
+ * Set this prop to true and popover component will support hovercard behaviour
457
+ * It will open on mouseenter and close on mouseleave with timer delay of 300ms
458
+ */
459
+ hovercard: {
460
+ type: Boolean,
461
+ default: false
462
+ },
463
+ /**
464
+ * The timer is used only when the hovercard prop is true.
465
+ * It defines the delays when opening several hovercards.
466
+ * It must have the keys: enter, leave and current.
467
+ * If null, the default delay of 300ms will be used.
468
+ */
469
+ timer: {
470
+ type: [Object, null],
471
+ default: null,
472
+ validator: (timer) => {
473
+ return timer === null || timer.enter && timer.leave && Object.keys(timer).includes("current");
474
+ }
475
+ }
476
+ },
477
+ emits: [
478
+ /**
479
+ * Native keydown event
480
+ *
481
+ * @event keydown
482
+ * @type {KeyboardEvent}
483
+ */
484
+ "keydown",
485
+ /**
486
+ * Event fired to sync the open prop with the parent component
487
+ * @event update:open
488
+ */
489
+ "update:open",
490
+ /**
491
+ * Emitted when popover is shown or hidden
492
+ *
493
+ * @event opened
494
+ * @type {Boolean | Array}
495
+ */
496
+ "opened"
497
+ ],
498
+ data() {
499
+ return {
500
+ POPOVER_PADDING_CLASSES: popover_constants.POPOVER_PADDING_CLASSES,
501
+ POPOVER_HEADER_FOOTER_PADDING_CLASSES: popover_constants.POPOVER_HEADER_FOOTER_PADDING_CLASSES,
502
+ intersectionObserver: null,
503
+ isOutsideViewport: false,
504
+ isOpen: false,
505
+ toAppear: false,
506
+ anchorEl: null,
507
+ popoverContentEl: null,
508
+ hasSlotContent: common_utils.hasSlotContent,
509
+ inTimer: null,
510
+ outTimer: null
511
+ };
512
+ },
513
+ computed: {
514
+ popoverListeners() {
515
+ return {
516
+ keydown: (event) => {
517
+ this.onKeydown(event);
518
+ },
519
+ "after-leave": (event) => {
520
+ this.onLeaveTransitionComplete();
521
+ },
522
+ "after-enter": (event) => {
523
+ this.onEnterTransitionComplete();
524
+ }
525
+ };
526
+ },
527
+ calculatedMaxHeight() {
528
+ if (this.isOutsideViewport && this.modal) {
529
+ return `calc(100vh - var(--dt-space-300))`;
530
+ }
531
+ return this.maxHeight;
532
+ },
533
+ labelledBy() {
534
+ return this.ariaLabelledby || !this.ariaLabel && common_utils.getUniqueString("DtPopover__anchor");
535
+ },
536
+ currentHovercard() {
537
+ var _a;
538
+ return (_a = this.timer) == null ? void 0 : _a.current;
539
+ }
540
+ },
541
+ watch: {
542
+ $props: {
543
+ immediate: true,
544
+ deep: true,
545
+ handler() {
546
+ this.validateProps();
547
+ }
548
+ },
549
+ modal(modal2) {
550
+ var _a;
551
+ (_a = this.tip) == null ? void 0 : _a.setProps({
552
+ zIndex: modal2 ? 650 : this.calculateAnchorZindex()
553
+ });
554
+ },
555
+ offset(offset) {
556
+ var _a;
557
+ (_a = this.tip) == null ? void 0 : _a.setProps({
558
+ offset
559
+ });
560
+ },
561
+ sticky(sticky) {
562
+ var _a;
563
+ (_a = this.tip) == null ? void 0 : _a.setProps({
564
+ sticky
565
+ });
566
+ },
567
+ fallbackPlacements() {
568
+ var _a;
569
+ (_a = this.tip) == null ? void 0 : _a.setProps({
570
+ popperOptions: this.popperOptions()
571
+ });
572
+ },
573
+ tether() {
574
+ var _a;
575
+ (_a = this.tip) == null ? void 0 : _a.setProps({
576
+ popperOptions: this.popperOptions()
577
+ });
578
+ },
579
+ placement(placement) {
580
+ var _a;
581
+ (_a = this.tip) == null ? void 0 : _a.setProps({
582
+ placement
583
+ });
584
+ },
585
+ open: {
586
+ handler: function(open) {
587
+ if (open !== null) {
588
+ this.isOpen = open;
589
+ }
590
+ if (open === true) {
591
+ this.toAppear = true;
592
+ }
593
+ },
594
+ immediate: true
595
+ },
596
+ contentAppear: {
597
+ handler: function(contentAppear) {
598
+ if (contentAppear !== null) {
599
+ this.toAppear = contentAppear;
600
+ }
601
+ }
602
+ },
603
+ isOpen(isOpen, isPrev) {
604
+ if (isOpen) {
605
+ this.initTippyInstance();
606
+ this.tip.show();
607
+ } else if (!isOpen && isPrev !== isOpen) {
608
+ this.removeEventListeners();
609
+ this.tip.hide();
610
+ }
611
+ },
612
+ currentHovercard() {
613
+ if (this.hovercard && this.timer) {
614
+ if (this.currentHovercard === this.id) {
615
+ this.isOpen = true;
616
+ } else {
617
+ this.isOpen = false;
618
+ }
619
+ }
620
+ }
621
+ },
622
+ mounted() {
623
+ var _a;
624
+ const externalAnchorEl = this.externalAnchor ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`) : null;
625
+ this.anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];
626
+ this.popoverContentEl = (_a = this.$refs.content) == null ? void 0 : _a.$el;
627
+ if (this.isOpen) {
628
+ this.initTippyInstance();
629
+ this.tip.show();
630
+ }
631
+ this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);
632
+ this.intersectionObserver.observe(this.popoverContentEl);
633
+ },
634
+ beforeUnmount() {
635
+ var _a;
636
+ (_a = this.tip) == null ? void 0 : _a.destroy();
637
+ this.intersectionObserver.disconnect();
638
+ this.removeReferences();
639
+ this.removeEventListeners();
640
+ },
641
+ /******************
642
+ * METHODS *
643
+ ******************/
644
+ methods: {
645
+ hasIntersectedViewport(entries) {
646
+ var _a;
647
+ const dialog = (_a = entries == null ? void 0 : entries[0]) == null ? void 0 : _a.target;
648
+ if (!dialog)
649
+ return;
650
+ const isOut = common_utils.isOutOfViewPort(dialog);
651
+ this.isOutsideViewport = isOut.bottom || isOut.top;
652
+ },
653
+ popperOptions() {
654
+ return popover_constants.getPopperOptions({
655
+ fallbackPlacements: this.fallbackPlacements,
656
+ tether: this.tether,
657
+ hasHideModifierEnabled: true
658
+ });
659
+ },
660
+ validateProps() {
661
+ if (this.modal && this.initialFocusElement === "none") {
662
+ console.error('If the popover is modal you must set the initialFocusElement prop. Possible values: "dialog", "first", HTMLElement');
663
+ }
664
+ },
665
+ calculateAnchorZindex() {
666
+ var _a;
667
+ if (this.$el.getRootNode().querySelector('.d-modal[aria-hidden="false"], .d-modal--transparent[aria-hidden="false"]') || // Special case because we don't have any dialtone drawer component yet. Render at 650 when
668
+ // anchor of popover is within a drawer.
669
+ ((_a = this.anchorEl) == null ? void 0 : _a.closest(".d-zi-drawer"))) {
670
+ return 650;
671
+ } else {
672
+ return 300;
673
+ }
674
+ },
675
+ defaultToggleOpen(e) {
676
+ var _a, _b, _c;
677
+ if (this.hovercard) {
678
+ return;
679
+ }
680
+ if (this.openOnContext) {
681
+ return;
682
+ }
683
+ if (this.open === null || this.open === void 0) {
684
+ if (!((_a = this.anchorEl) == null ? void 0 : _a.contains(e.target)) && !((_b = this.anchorEl) == null ? void 0 : _b.isEqualNode(e.target)) || ((_c = this.anchorEl) == null ? void 0 : _c.disabled)) {
685
+ return;
686
+ }
687
+ this.toggleOpen();
688
+ }
689
+ },
690
+ async onContext(event) {
691
+ if (!this.openOnContext) {
692
+ return;
693
+ }
694
+ event.preventDefault();
695
+ this.isOpen = true;
696
+ await this.$nextTick();
697
+ this.tip.setProps({
698
+ placement: "right-start",
699
+ getReferenceClientRect: () => ({
700
+ width: 0,
701
+ height: 0,
702
+ top: event.clientY,
703
+ bottom: event.clientY,
704
+ left: event.clientX,
705
+ right: event.clientX
706
+ })
707
+ });
708
+ },
709
+ toggleOpen() {
710
+ this.isOpen = !this.isOpen;
711
+ },
712
+ onArrowKeyPress(e) {
713
+ var _a;
714
+ if (this.open !== null) {
715
+ return;
716
+ }
717
+ if (this.openWithArrowKeys && ((_a = this.anchorEl) == null ? void 0 : _a.contains(e.target))) {
718
+ if (!this.isOpen) {
719
+ this.isOpen = true;
720
+ }
721
+ }
722
+ this.$emit("keydown", e);
723
+ },
724
+ addEventListeners() {
725
+ window.addEventListener("dt-popover-close", this.closePopover);
726
+ if (this.contentWidth === "anchor") {
727
+ window.addEventListener("resize", this.onResize);
728
+ }
729
+ },
730
+ removeEventListeners() {
731
+ window.removeEventListener("dt-popover-close", this.closePopover);
732
+ if (this.contentWidth === "anchor") {
733
+ window.removeEventListener("resize", this.onResize);
734
+ }
735
+ },
736
+ closePopover() {
737
+ this.isOpen = false;
738
+ },
739
+ /*
740
+ * Prevents scrolling outside of the currently opened modal popover by:
741
+ * - when anchor is not within another popover: setting the body to overflow: hidden
742
+ * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index
743
+ * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.
744
+ **/
745
+ preventScrolling() {
746
+ var _a, _b;
747
+ if (this.modal) {
748
+ const element = (_a = this.anchorEl) == null ? void 0 : _a.closest("body, .tippy-box");
749
+ if (!element)
750
+ return;
751
+ if (((_b = element.tagName) == null ? void 0 : _b.toLowerCase()) === "body") {
752
+ element.classList.add("d-of-hidden");
753
+ this.tip.setProps({ offset: this.offset });
754
+ } else {
755
+ element.classList.add("d-zi-popover");
756
+ }
757
+ }
758
+ },
759
+ /*
760
+ * Resets the prevent scrolling properties set in preventScrolling() back to normal.
761
+ **/
762
+ enableScrolling() {
763
+ var _a, _b;
764
+ const element = (_a = this.anchorEl) == null ? void 0 : _a.closest("body, .tippy-box");
765
+ if (!element)
766
+ return;
767
+ if (((_b = element.tagName) == null ? void 0 : _b.toLowerCase()) === "body") {
768
+ element.classList.remove("d-of-hidden");
769
+ this.tip.setProps({ offset: this.offset });
770
+ } else {
771
+ element.classList.remove("d-zi-popover");
772
+ }
773
+ },
774
+ removeReferences() {
775
+ this.anchorEl = null;
776
+ this.popoverContentEl = null;
777
+ this.tip = null;
778
+ },
779
+ async onShow() {
780
+ if (this.contentWidth === "anchor") {
781
+ await this.setPopoverContentAnchorWidth();
782
+ }
783
+ if (this.contentWidth === null) {
784
+ this.popoverContentEl.style.width = "auto";
785
+ }
786
+ this.addEventListeners();
787
+ },
788
+ async onLeaveTransitionComplete() {
789
+ var _a;
790
+ if (this.modal) {
791
+ await this.focusFirstElement(this.$refs.anchor);
792
+ await this.$nextTick();
793
+ this.enableScrolling();
794
+ }
795
+ (_a = this.tip) == null ? void 0 : _a.unmount();
796
+ this.$emit("opened", false);
797
+ if (this.open !== null) {
798
+ this.$emit("update:open", false);
799
+ }
800
+ },
801
+ async onEnterTransitionComplete() {
802
+ this.focusInitialElement();
803
+ await this.$nextTick();
804
+ this.preventScrolling();
805
+ this.$emit("opened", true, this.$refs.popover__content);
806
+ if (this.open !== null) {
807
+ this.$emit("update:open", true);
808
+ }
809
+ },
810
+ focusInitialElement() {
811
+ var _a, _b;
812
+ if (this.initialFocusElement === "dialog") {
813
+ (_b = (_a = this.$refs.content) == null ? void 0 : _a.$el) == null ? void 0 : _b.focus();
814
+ }
815
+ if (this.initialFocusElement.startsWith("#")) {
816
+ this.focusInitialElementById();
817
+ }
818
+ if (this.initialFocusElement === "first") {
819
+ this.focusFirstElementIfNeeded(this.$refs.popover__content);
820
+ }
821
+ if (this.initialFocusElement instanceof HTMLElement) {
822
+ this.initialFocusElement.focus();
823
+ }
824
+ },
825
+ focusInitialElementById() {
826
+ var _a, _b, _c;
827
+ const result = (_b = (_a = this.$refs.content) == null ? void 0 : _a.$el) == null ? void 0 : _b.querySelector(this.initialFocusElement);
828
+ if (result) {
829
+ result.focus();
830
+ } else {
831
+ console.warn('Could not find the element specified in dt-popover prop "initialFocusElement". Defaulting to focusing the dialog.');
832
+ }
833
+ result ? result.focus() : (_c = this.$refs.content) == null ? void 0 : _c.$el.focus();
834
+ },
835
+ onResize() {
836
+ this.closePopover();
837
+ },
838
+ onClickOutside() {
839
+ if (!this.hideOnClick)
840
+ return;
841
+ const innerModals = this.popoverContentEl.querySelector(".d-popover__anchor--opened");
842
+ if (!innerModals) {
843
+ this.closePopover();
844
+ }
845
+ },
846
+ onKeydown(e) {
847
+ if (e.key === "Tab") {
848
+ if (this.modal) {
849
+ this.focusTrappedTabPress(e, this.popoverContentEl);
850
+ }
851
+ }
852
+ if (e.key === "Escape") {
853
+ this.closePopover();
854
+ }
855
+ this.$emit("keydown", e);
856
+ },
857
+ async setPopoverContentAnchorWidth() {
858
+ var _a;
859
+ await this.$nextTick();
860
+ this.popoverContentEl.style.width = `${(_a = this.anchorEl) == null ? void 0 : _a.clientWidth}px`;
861
+ },
862
+ focusFirstElementIfNeeded(domEl) {
863
+ var _a, _b;
864
+ const focusableElements = this._getFocusableElements(domEl, true);
865
+ if (focusableElements.length !== 0) {
866
+ this.focusFirstElement(domEl);
867
+ } else if (this.showCloseButton) {
868
+ (_a = this.$refs.popover__header) == null ? void 0 : _a.focusCloseButton();
869
+ } else {
870
+ (_b = this.$refs.content) == null ? void 0 : _b.$el.focus();
871
+ }
872
+ },
873
+ initTippyInstance() {
874
+ var _a, _b;
875
+ this.tip = popover_constants.createTippy(this.anchorEl, {
876
+ popperOptions: this.popperOptions(),
877
+ contentElement: this.popoverContentEl,
878
+ placement: this.placement,
879
+ offset: this.offset,
880
+ sticky: this.sticky,
881
+ appendTo: this.appendTo === "body" ? (_b = (_a = this.anchorEl) == null ? void 0 : _a.getRootNode()) == null ? void 0 : _b.querySelector("body") : this.appendTo,
882
+ interactive: true,
883
+ trigger: "manual",
884
+ // We have to manage hideOnClick functionality manually to handle
885
+ // popover within popover situations.
886
+ hideOnClick: false,
887
+ zIndex: this.modal ? 650 : this.calculateAnchorZindex(),
888
+ onClickOutside: this.onClickOutside,
889
+ onShow: this.onShow
890
+ });
891
+ },
892
+ // ============================================================================
893
+ // $ HOVERCARD
894
+ // ----------------------------------------------------------------------------
895
+ setInTimer() {
896
+ this.inTimer = setTimeout(() => {
897
+ this.isOpen = true;
898
+ }, popover_constants.TOOLTIP_DELAY_MS);
899
+ },
900
+ setOutTimer() {
901
+ this.outTimer = setTimeout(() => {
902
+ this.isOpen = false;
903
+ }, popover_constants.TOOLTIP_DELAY_MS);
904
+ },
905
+ onEnterAnchor() {
906
+ if (!this.hovercard)
907
+ return;
908
+ if (this.timer)
909
+ this.timer.enter(this.id);
910
+ else {
911
+ clearTimeout(this.outTimer);
912
+ this.setInTimer();
913
+ }
914
+ },
915
+ onLeaveAnchor() {
916
+ if (!this.hovercard)
917
+ return;
918
+ if (this.timer)
919
+ this.timer.leave();
920
+ else {
921
+ clearTimeout(this.inTimer);
922
+ this.setOutTimer();
923
+ }
924
+ },
925
+ onEnterContent() {
926
+ if (!this.hovercard)
927
+ return;
928
+ if (this.timer)
929
+ this.timer.enter(this.id);
930
+ else
931
+ clearTimeout(this.outTimer);
932
+ },
933
+ onLeaveContent() {
934
+ if (!this.hovercard)
935
+ return;
936
+ if (this.timer)
937
+ this.timer.leave();
938
+ else
939
+ this.setOutTimer();
940
+ }
941
+ // ============================================================================
942
+ // $ HOVERCARD
943
+ // ----------------------------------------------------------------------------
944
+ }
945
+ };
946
+ const _hoisted_1 = ["aria-hidden"];
947
+ const _hoisted_2 = ["id", "data-qa", "tabindex"];
948
+ const _hoisted_3 = ["data-qa"];
949
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
950
+ const _component_popover_header_footer = vue.resolveComponent("popover-header-footer");
951
+ const _component_sr_only_close_button = vue.resolveComponent("sr-only-close-button");
952
+ const _component_dt_lazy_show = vue.resolveComponent("dt-lazy-show");
953
+ return vue.openBlock(), vue.createElementBlock("div", null, [
954
+ $props.modal && $data.isOpen ? (vue.openBlock(), vue.createBlock(vue.Teleport, {
955
+ key: 0,
956
+ to: "body"
957
+ }, [
958
+ vue.createElementVNode("div", {
959
+ class: "d-modal--transparent",
960
+ "aria-hidden": $props.modal && $data.isOpen ? "false" : "true",
961
+ onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
962
+ }, ["prevent", "stop"]))
963
+ }, null, 8, _hoisted_1)
964
+ ])) : vue.createCommentVNode("", true),
965
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.elementType), {
966
+ ref: "popover",
967
+ class: vue.normalizeClass(["d-popover", { "d-popover__anchor--opened": $data.isOpen }]),
968
+ "data-qa": "dt-popover-container"
969
+ }, {
970
+ default: vue.withCtx(() => [
971
+ vue.createElementVNode("div", {
972
+ id: !$props.ariaLabelledby && $options.labelledBy,
973
+ ref: "anchor",
974
+ "data-qa": _ctx.$attrs["data-qa"] ? `${_ctx.$attrs["data-qa"]}-anchor` : "dt-popover-anchor",
975
+ tabindex: $props.openOnContext ? 0 : void 0,
976
+ onClickCapture: _cache[1] || (_cache[1] = (...args) => $options.defaultToggleOpen && $options.defaultToggleOpen(...args)),
977
+ onContextmenu: _cache[2] || (_cache[2] = (...args) => $options.onContext && $options.onContext(...args)),
978
+ onKeydown: [
979
+ _cache[3] || (_cache[3] = vue.withKeys(vue.withModifiers((...args) => $options.onArrowKeyPress && $options.onArrowKeyPress(...args), ["prevent"]), ["up"])),
980
+ _cache[4] || (_cache[4] = vue.withKeys(vue.withModifiers((...args) => $options.onArrowKeyPress && $options.onArrowKeyPress(...args), ["prevent"]), ["down"])),
981
+ _cache[6] || (_cache[6] = vue.withKeys(($event) => _ctx.$emit("keydown", $event), ["enter"])),
982
+ _cache[7] || (_cache[7] = vue.withKeys(($event) => _ctx.$emit("keydown", $event), ["space"]))
983
+ ],
984
+ onKeydownCapture: _cache[5] || (_cache[5] = vue.withKeys((...args) => $options.closePopover && $options.closePopover(...args), ["escape"])),
985
+ onMouseenter: _cache[8] || (_cache[8] = (...args) => $options.onEnterAnchor && $options.onEnterAnchor(...args)),
986
+ onMouseleave: _cache[9] || (_cache[9] = (...args) => $options.onLeaveAnchor && $options.onLeaveAnchor(...args))
987
+ }, [
988
+ vue.renderSlot(_ctx.$slots, "anchor", {
989
+ attrs: {
990
+ "aria-expanded": $data.isOpen.toString(),
991
+ "aria-controls": $props.id,
992
+ "aria-haspopup": $props.role
993
+ }
994
+ })
995
+ ], 40, _hoisted_2),
996
+ vue.createVNode(_component_dt_lazy_show, vue.mergeProps({
997
+ id: $props.id,
998
+ ref: "content",
999
+ role: $props.role,
1000
+ "data-qa": _ctx.$attrs["data-qa"] ? `${_ctx.$attrs["data-qa"]}__dialog` : "dt-popover",
1001
+ "aria-hidden": `${!$data.isOpen}`,
1002
+ "aria-labelledby": $options.labelledBy,
1003
+ "aria-label": $props.ariaLabel,
1004
+ "aria-modal": `${!$props.modal}`,
1005
+ transition: $props.transition,
1006
+ show: $data.isOpen,
1007
+ appear: $data.toAppear,
1008
+ class: ["d-popover__dialog", { "d-popover__dialog--modal": $props.modal }, $props.dialogClass],
1009
+ style: {
1010
+ "max-height": $options.calculatedMaxHeight,
1011
+ "max-width": $props.maxWidth
1012
+ },
1013
+ css: _ctx.$attrs.css,
1014
+ tabindex: $props.contentTabindex
1015
+ }, vue.toHandlers($options.popoverListeners), {
1016
+ onMouseenter: $options.onEnterContent,
1017
+ onMouseleave: $options.onLeaveContent
1018
+ }), {
1019
+ default: vue.withCtx(() => [
1020
+ $data.hasSlotContent(_ctx.$slots.headerContent) || $props.showCloseButton ? (vue.openBlock(), vue.createBlock(_component_popover_header_footer, {
1021
+ key: 0,
1022
+ ref: "popover__header",
1023
+ class: vue.normalizeClass($data.POPOVER_HEADER_FOOTER_PADDING_CLASSES[$props.padding]),
1024
+ "content-class": $props.headerClass,
1025
+ type: "header",
1026
+ "show-close-button": $props.showCloseButton,
1027
+ "close-button-props": $props.closeButtonProps,
1028
+ onClose: $options.closePopover
1029
+ }, {
1030
+ content: vue.withCtx(() => [
1031
+ vue.renderSlot(_ctx.$slots, "headerContent", { close: $options.closePopover })
1032
+ ]),
1033
+ _: 3
1034
+ }, 8, ["class", "content-class", "show-close-button", "close-button-props", "onClose"])) : vue.createCommentVNode("", true),
1035
+ vue.createElementVNode("div", {
1036
+ ref: "popover__content",
1037
+ "data-qa": _ctx.$attrs["data-qa"] ? `${_ctx.$attrs["data-qa"]}-content` : "dt-popover-content",
1038
+ class: vue.normalizeClass([
1039
+ "d-popover__content",
1040
+ $data.POPOVER_PADDING_CLASSES[$props.padding],
1041
+ $props.contentClass
1042
+ ])
1043
+ }, [
1044
+ vue.renderSlot(_ctx.$slots, "content", { close: $options.closePopover })
1045
+ ], 10, _hoisted_3),
1046
+ $data.hasSlotContent(_ctx.$slots.footerContent) ? (vue.openBlock(), vue.createBlock(_component_popover_header_footer, {
1047
+ key: 1,
1048
+ ref: "popover__footer",
1049
+ type: "footer",
1050
+ class: vue.normalizeClass($data.POPOVER_HEADER_FOOTER_PADDING_CLASSES[$props.padding]),
1051
+ "content-class": $props.footerClass
1052
+ }, {
1053
+ content: vue.withCtx(() => [
1054
+ vue.renderSlot(_ctx.$slots, "footerContent", { close: $options.closePopover })
1055
+ ]),
1056
+ _: 3
1057
+ }, 8, ["class", "content-class"])) : vue.createCommentVNode("", true),
1058
+ _ctx.showVisuallyHiddenClose ? (vue.openBlock(), vue.createBlock(_component_sr_only_close_button, {
1059
+ key: 2,
1060
+ "visually-hidden-close-label": _ctx.visuallyHiddenCloseLabel,
1061
+ onClose: $options.closePopover
1062
+ }, null, 8, ["visually-hidden-close-label", "onClose"])) : vue.createCommentVNode("", true)
1063
+ ]),
1064
+ _: 3
1065
+ }, 16, ["id", "role", "data-qa", "aria-hidden", "aria-labelledby", "aria-label", "aria-modal", "transition", "show", "appear", "class", "style", "css", "tabindex", "onMouseenter", "onMouseleave"])
1066
+ ]),
1067
+ _: 3
1068
+ }, 8, ["class"]))
1069
+ ]);
1070
+ }
1071
+ const DtPopover = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
1072
+ exports.POPOVER_APPEND_TO_VALUES = popover_constants.POPOVER_APPEND_TO_VALUES;
1073
+ exports.POPOVER_CONTENT_WIDTHS = popover_constants.POPOVER_CONTENT_WIDTHS;
1074
+ exports.POPOVER_DIRECTIONS = popover_constants.POPOVER_DIRECTIONS;
1075
+ exports.POPOVER_HEADER_FOOTER_PADDING_CLASSES = popover_constants.POPOVER_HEADER_FOOTER_PADDING_CLASSES;
1076
+ exports.POPOVER_INITIAL_FOCUS_STRINGS = popover_constants.POPOVER_INITIAL_FOCUS_STRINGS;
1077
+ exports.POPOVER_PADDING_CLASSES = popover_constants.POPOVER_PADDING_CLASSES;
1078
+ exports.POPOVER_ROLES = popover_constants.POPOVER_ROLES;
1079
+ exports.POPOVER_STICKY_VALUES = popover_constants.POPOVER_STICKY_VALUES;
1080
+ exports.DtPopover = DtPopover;
2
1081
  //# sourceMappingURL=popover.cjs.map