@dialpad/dialtone-vue 2.127.0 → 2.127.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 (422) hide show
  1. package/dist/chunks/_plugin-vue2_normalizer-1aBeR4AK.js +59 -0
  2. package/dist/chunks/_plugin-vue2_normalizer-1aBeR4AK.js.map +1 -0
  3. package/dist/chunks/_plugin-vue2_normalizer-sOSkiPF3.js +60 -0
  4. package/dist/chunks/_plugin-vue2_normalizer-sOSkiPF3.js.map +1 -0
  5. package/dist/chunks/{dropdown-SMWaTWyF.js → dropdown-DTtcQEFC.js} +131 -84
  6. package/dist/chunks/{dropdown-SMWaTWyF.js.map → dropdown-DTtcQEFC.js.map} +1 -1
  7. package/dist/chunks/dropdown-IaLNHmVd.js +403 -0
  8. package/dist/chunks/{dropdown-zhMEz3bn.js.map → dropdown-IaLNHmVd.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-eJ-WWRdf.js +442 -0
  18. package/dist/chunks/{index-2jPosQBn.js.map → index-eJ-WWRdf.js.map} +1 -1
  19. package/dist/chunks/index-gj1jEXP4.js +441 -0
  20. package/dist/chunks/{index-nIyl_PL6.js.map → index-gj1jEXP4.js.map} +1 -1
  21. package/dist/chunks/{input-1tm09l_-.js → input-6kbd8Pju.js} +83 -60
  22. package/dist/chunks/{input-o-fc1X4b.js.map → input-6kbd8Pju.js.map} +1 -1
  23. package/dist/chunks/input-Axw-wFj2.js +295 -0
  24. package/dist/chunks/{input-1tm09l_-.js.map → input-Axw-wFj2.js.map} +1 -1
  25. package/dist/chunks/input_group-m3cWYUfI.js +143 -0
  26. package/dist/chunks/{input_group-zcAq3DQl.js.map → input_group-m3cWYUfI.js.map} +1 -1
  27. package/dist/chunks/{input_group-zcAq3DQl.js → input_group-qVZaS5Bb.js} +27 -24
  28. package/dist/chunks/{input_group-j2gTtc1C.js.map → input_group-qVZaS5Bb.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-IRUoLX2d.js +196 -0
  46. package/dist/chunks/{notice_action-u3ZKIhit.js.map → notice_action-IRUoLX2d.js.map} +1 -1
  47. package/dist/chunks/notice_action-P6uDyE9x.js +195 -0
  48. package/dist/chunks/{notice_action-9NmtQRai.js.map → notice_action-P6uDyE9x.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-81bHIpPu.js +95 -0
  58. package/dist/chunks/{sr_only_close_button-ErijKGYR.js.map → sr_only_close_button-81bHIpPu.js.map} +1 -1
  59. package/dist/chunks/sr_only_close_button-ZaGdAHz7.js +94 -0
  60. package/dist/chunks/{sr_only_close_button-JGole5Xi.js.map → sr_only_close_button-ZaGdAHz7.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-FcsV5VmK.js +386 -0
  66. package/dist/chunks/{tab-7hJQSLFx.js.map → tab-FcsV5VmK.js.map} +1 -1
  67. package/dist/chunks/tab-V4cb44Ry.js +387 -0
  68. package/dist/chunks/{tab-Qm9LVkYj.js.map → tab-V4cb44Ry.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 +237 -0
  85. package/dist/{lib → common}/utils.cjs.map +1 -1
  86. package/dist/common/utils.js +237 -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 +372 -1
  93. package/dist/dialtone-vue.cjs.map +1 -1
  94. package/dist/dialtone-vue.js +325 -324
  95. package/dist/dialtone-vue.js.map +1 -1
  96. package/dist/lib/attachment-carousel.cjs +260 -1
  97. package/dist/lib/attachment-carousel.cjs.map +1 -1
  98. package/dist/lib/attachment-carousel.js +96 -84
  99. package/dist/lib/attachment-carousel.js.map +1 -1
  100. package/dist/lib/avatar.cjs +399 -1
  101. package/dist/lib/avatar.cjs.map +1 -1
  102. package/dist/lib/avatar.js +111 -79
  103. package/dist/lib/avatar.js.map +1 -1
  104. package/dist/lib/badge.cjs +182 -1
  105. package/dist/lib/badge.cjs.map +1 -1
  106. package/dist/lib/badge.js +53 -38
  107. package/dist/lib/badge.js.map +1 -1
  108. package/dist/lib/banner.cjs +209 -2
  109. package/dist/lib/banner.cjs.map +1 -1
  110. package/dist/lib/banner.js +58 -47
  111. package/dist/lib/banner.js.map +1 -1
  112. package/dist/lib/breadcrumbs.cjs +146 -1
  113. package/dist/lib/breadcrumbs.cjs.map +1 -1
  114. package/dist/lib/breadcrumbs.js +57 -48
  115. package/dist/lib/breadcrumbs.js.map +1 -1
  116. package/dist/lib/button-group.cjs +47 -1
  117. package/dist/lib/button-group.cjs.map +1 -1
  118. package/dist/lib/button-group.js +21 -18
  119. package/dist/lib/button-group.js.map +1 -1
  120. package/dist/lib/button.cjs +349 -1
  121. package/dist/lib/button.cjs.map +1 -1
  122. package/dist/lib/button.js +98 -76
  123. package/dist/lib/button.js.map +1 -1
  124. package/dist/lib/callbar-button-with-popover.cjs +249 -1
  125. package/dist/lib/callbar-button-with-popover.cjs.map +1 -1
  126. package/dist/lib/callbar-button-with-popover.js +66 -50
  127. package/dist/lib/callbar-button-with-popover.js.map +1 -1
  128. package/dist/lib/callbar-button.cjs +182 -1
  129. package/dist/lib/callbar-button.cjs.map +1 -1
  130. package/dist/lib/callbar-button.js +42 -34
  131. package/dist/lib/callbar-button.js.map +1 -1
  132. package/dist/lib/callbox.cjs +146 -1
  133. package/dist/lib/callbox.cjs.map +1 -1
  134. package/dist/lib/callbox.js +38 -32
  135. package/dist/lib/callbox.js.map +1 -1
  136. package/dist/lib/card.cjs +73 -1
  137. package/dist/lib/card.cjs.map +1 -1
  138. package/dist/lib/card.js +22 -20
  139. package/dist/lib/card.js.map +1 -1
  140. package/dist/lib/checkbox-group.cjs +129 -1
  141. package/dist/lib/checkbox-group.cjs.map +1 -1
  142. package/dist/lib/checkbox-group.js +42 -29
  143. package/dist/lib/checkbox-group.js.map +1 -1
  144. package/dist/lib/checkbox.cjs +127 -1
  145. package/dist/lib/checkbox.cjs.map +1 -1
  146. package/dist/lib/checkbox.js +46 -35
  147. package/dist/lib/checkbox.js.map +1 -1
  148. package/dist/lib/chip.cjs +198 -1
  149. package/dist/lib/chip.cjs.map +1 -1
  150. package/dist/lib/chip.js +59 -45
  151. package/dist/lib/chip.js.map +1 -1
  152. package/dist/lib/codeblock.cjs +29 -2
  153. package/dist/lib/codeblock.cjs.map +1 -1
  154. package/dist/lib/codeblock.js +15 -14
  155. package/dist/lib/codeblock.js.map +1 -1
  156. package/dist/lib/collapsible.cjs +334 -1
  157. package/dist/lib/collapsible.cjs.map +1 -1
  158. package/dist/lib/collapsible.js +91 -68
  159. package/dist/lib/collapsible.js.map +1 -1
  160. package/dist/lib/combobox-multi-select.cjs +519 -1
  161. package/dist/lib/combobox-multi-select.cjs.map +1 -1
  162. package/dist/lib/combobox-multi-select.js +223 -136
  163. package/dist/lib/combobox-multi-select.js.map +1 -1
  164. package/dist/lib/combobox-with-popover.cjs +384 -1
  165. package/dist/lib/combobox-with-popover.cjs.map +1 -1
  166. package/dist/lib/combobox-with-popover.js +130 -86
  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 +145 -1
  172. package/dist/lib/contact-info.cjs.map +1 -1
  173. package/dist/lib/contact-info.js +34 -32
  174. package/dist/lib/contact-info.js.map +1 -1
  175. package/dist/lib/contact-row.cjs +205 -1
  176. package/dist/lib/contact-row.cjs.map +1 -1
  177. package/dist/lib/contact-row.js +42 -39
  178. package/dist/lib/contact-row.js.map +1 -1
  179. package/dist/lib/datepicker.cjs +662 -1
  180. package/dist/lib/datepicker.cjs.map +1 -1
  181. package/dist/lib/datepicker.js +330 -218
  182. package/dist/lib/datepicker.js.map +1 -1
  183. package/dist/lib/description-list.cjs +114 -1
  184. package/dist/lib/description-list.cjs.map +1 -1
  185. package/dist/lib/description-list.js +51 -19
  186. package/dist/lib/description-list.js.map +1 -1
  187. package/dist/lib/dropdown.cjs +45 -1
  188. package/dist/lib/dropdown.cjs.map +1 -1
  189. package/dist/lib/dropdown.js +27 -25
  190. package/dist/lib/dropdown.js.map +1 -1
  191. package/dist/lib/editor.cjs +555 -1
  192. package/dist/lib/editor.cjs.map +1 -1
  193. package/dist/lib/editor.js +191 -162
  194. package/dist/lib/editor.js.map +1 -1
  195. package/dist/lib/emoji-picker.cjs +1063 -1
  196. package/dist/lib/emoji-picker.cjs.map +1 -1
  197. package/dist/lib/emoji-picker.js +638 -374
  198. package/dist/lib/emoji-picker.js.map +1 -1
  199. package/dist/lib/emoji-row.cjs +88 -1
  200. package/dist/lib/emoji-row.cjs.map +1 -1
  201. package/dist/lib/emoji-row.js +46 -40
  202. package/dist/lib/emoji-row.js.map +1 -1
  203. package/dist/lib/emoji-text-wrapper.cjs +109 -1
  204. package/dist/lib/emoji-text-wrapper.cjs.map +1 -1
  205. package/dist/lib/emoji-text-wrapper.js +49 -35
  206. package/dist/lib/emoji-text-wrapper.js.map +1 -1
  207. package/dist/lib/emoji.cjs +145 -1
  208. package/dist/lib/emoji.cjs.map +1 -1
  209. package/dist/lib/emoji.js +140 -5
  210. package/dist/lib/emoji.js.map +1 -1
  211. package/dist/lib/feed-item-row.cjs +213 -1
  212. package/dist/lib/feed-item-row.cjs.map +1 -1
  213. package/dist/lib/feed-item-row.js +71 -63
  214. package/dist/lib/feed-item-row.js.map +1 -1
  215. package/dist/lib/feed-pill.cjs +149 -1
  216. package/dist/lib/feed-pill.cjs.map +1 -1
  217. package/dist/lib/feed-pill.js +60 -51
  218. package/dist/lib/feed-pill.js.map +1 -1
  219. package/dist/lib/general-row.cjs +405 -1
  220. package/dist/lib/general-row.cjs.map +1 -1
  221. package/dist/lib/general-row.js +133 -106
  222. package/dist/lib/general-row.js.map +1 -1
  223. package/dist/lib/group-row.cjs +117 -1
  224. package/dist/lib/group-row.cjs.map +1 -1
  225. package/dist/lib/group-row.js +33 -30
  226. package/dist/lib/group-row.js.map +1 -1
  227. package/dist/lib/grouped-chip.cjs +45 -1
  228. package/dist/lib/grouped-chip.cjs.map +1 -1
  229. package/dist/lib/grouped-chip.js +28 -26
  230. package/dist/lib/grouped-chip.js.map +1 -1
  231. package/dist/lib/hovercard.cjs +227 -1
  232. package/dist/lib/hovercard.cjs.map +1 -1
  233. package/dist/lib/hovercard.js +98 -63
  234. package/dist/lib/hovercard.js.map +1 -1
  235. package/dist/lib/icon.cjs +59 -1
  236. package/dist/lib/icon.cjs.map +1 -1
  237. package/dist/lib/icon.js +22 -20
  238. package/dist/lib/icon.js.map +1 -1
  239. package/dist/lib/image-viewer.cjs +190 -1
  240. package/dist/lib/image-viewer.cjs.map +1 -1
  241. package/dist/lib/image-viewer.js +83 -62
  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 +29 -27
  246. package/dist/lib/input-group.js.map +1 -1
  247. package/dist/lib/input.cjs +492 -1
  248. package/dist/lib/input.cjs.map +1 -1
  249. package/dist/lib/input.js +127 -89
  250. package/dist/lib/input.js.map +1 -1
  251. package/dist/lib/item-layout.cjs +40 -1
  252. package/dist/lib/item-layout.cjs.map +1 -1
  253. package/dist/lib/item-layout.js +15 -13
  254. package/dist/lib/item-layout.js.map +1 -1
  255. package/dist/lib/ivr-node.cjs +209 -1
  256. package/dist/lib/ivr-node.cjs.map +1 -1
  257. package/dist/lib/ivr-node.js +115 -99
  258. package/dist/lib/ivr-node.js.map +1 -1
  259. package/dist/lib/keyboard-shortcut.cjs +106 -1
  260. package/dist/lib/keyboard-shortcut.cjs.map +1 -1
  261. package/dist/lib/keyboard-shortcut.js +42 -34
  262. package/dist/lib/keyboard-shortcut.js.map +1 -1
  263. package/dist/lib/lazy-show.cjs +80 -1
  264. package/dist/lib/lazy-show.cjs.map +1 -1
  265. package/dist/lib/lazy-show.js +20 -16
  266. package/dist/lib/lazy-show.js.map +1 -1
  267. package/dist/lib/link.cjs +70 -1
  268. package/dist/lib/link.cjs.map +1 -1
  269. package/dist/lib/link.js +22 -20
  270. package/dist/lib/link.js.map +1 -1
  271. package/dist/lib/list-item-group.cjs +60 -1
  272. package/dist/lib/list-item-group.cjs.map +1 -1
  273. package/dist/lib/list-item-group.js +19 -17
  274. package/dist/lib/list-item-group.js.map +1 -1
  275. package/dist/lib/list-item.cjs +204 -1
  276. package/dist/lib/list-item.cjs.map +1 -1
  277. package/dist/lib/list-item.js +67 -56
  278. package/dist/lib/list-item.js.map +1 -1
  279. package/dist/lib/message-input.cjs +554 -1
  280. package/dist/lib/message-input.cjs.map +1 -1
  281. package/dist/lib/message-input.js +174 -152
  282. package/dist/lib/message-input.js.map +1 -1
  283. package/dist/lib/modal.cjs +350 -2
  284. package/dist/lib/modal.cjs.map +1 -1
  285. package/dist/lib/modal.js +118 -90
  286. package/dist/lib/modal.js.map +1 -1
  287. package/dist/lib/notice.cjs +159 -1
  288. package/dist/lib/notice.cjs.map +1 -1
  289. package/dist/lib/notice.js +46 -43
  290. package/dist/lib/notice.js.map +1 -1
  291. package/dist/lib/pagination.cjs +152 -1
  292. package/dist/lib/pagination.cjs.map +1 -1
  293. package/dist/lib/pagination.js +60 -48
  294. package/dist/lib/pagination.js.map +1 -1
  295. package/dist/lib/popover.cjs +956 -1
  296. package/dist/lib/popover.cjs.map +1 -1
  297. package/dist/lib/popover.js +401 -221
  298. package/dist/lib/popover.js.map +1 -1
  299. package/dist/lib/presence.cjs +65 -1
  300. package/dist/lib/presence.cjs.map +1 -1
  301. package/dist/lib/presence.js +32 -26
  302. package/dist/lib/presence.js.map +1 -1
  303. package/dist/lib/radio-group.cjs +98 -1
  304. package/dist/lib/radio-group.cjs.map +1 -1
  305. package/dist/lib/radio-group.js +24 -22
  306. package/dist/lib/radio-group.js.map +1 -1
  307. package/dist/lib/radio.cjs +118 -1
  308. package/dist/lib/radio.cjs.map +1 -1
  309. package/dist/lib/radio.js +43 -35
  310. package/dist/lib/radio.js.map +1 -1
  311. package/dist/lib/rich-text-editor.cjs +1138 -1
  312. package/dist/lib/rich-text-editor.cjs.map +1 -1
  313. package/dist/lib/rich-text-editor.js +574 -387
  314. package/dist/lib/rich-text-editor.js.map +1 -1
  315. package/dist/lib/root-layout.cjs +130 -1
  316. package/dist/lib/root-layout.cjs.map +1 -1
  317. package/dist/lib/root-layout.js +28 -24
  318. package/dist/lib/root-layout.js.map +1 -1
  319. package/dist/lib/select-menu.cjs +282 -1
  320. package/dist/lib/select-menu.cjs.map +1 -1
  321. package/dist/lib/select-menu.js +101 -61
  322. package/dist/lib/select-menu.js.map +1 -1
  323. package/dist/lib/settings-menu-button.cjs +65 -1
  324. package/dist/lib/settings-menu-button.cjs.map +1 -1
  325. package/dist/lib/settings-menu-button.js +26 -24
  326. package/dist/lib/settings-menu-button.js.map +1 -1
  327. package/dist/lib/skeleton.cjs +612 -1
  328. package/dist/lib/skeleton.cjs.map +1 -1
  329. package/dist/lib/skeleton.js +174 -135
  330. package/dist/lib/skeleton.js.map +1 -1
  331. package/dist/lib/stack.cjs +127 -1
  332. package/dist/lib/stack.cjs.map +1 -1
  333. package/dist/lib/stack.js +66 -56
  334. package/dist/lib/stack.js.map +1 -1
  335. package/dist/lib/tabs.cjs +99 -1
  336. package/dist/lib/tabs.cjs.map +1 -1
  337. package/dist/lib/tabs.js +42 -35
  338. package/dist/lib/tabs.js.map +1 -1
  339. package/dist/lib/time-pill.cjs +47 -1
  340. package/dist/lib/time-pill.cjs.map +1 -1
  341. package/dist/lib/time-pill.js +21 -16
  342. package/dist/lib/time-pill.js.map +1 -1
  343. package/dist/lib/toast.cjs +247 -1
  344. package/dist/lib/toast.cjs.map +1 -1
  345. package/dist/lib/toast.js +78 -55
  346. package/dist/lib/toast.js.map +1 -1
  347. package/dist/lib/toggle.cjs +177 -1
  348. package/dist/lib/toggle.cjs.map +1 -1
  349. package/dist/lib/toggle.js +46 -37
  350. package/dist/lib/toggle.js.map +1 -1
  351. package/dist/lib/tooltip-directive.cjs +87 -1
  352. package/dist/lib/tooltip-directive.cjs.map +1 -1
  353. package/dist/lib/tooltip-directive.js +55 -41
  354. package/dist/lib/tooltip-directive.js.map +1 -1
  355. package/dist/lib/tooltip.cjs +436 -1
  356. package/dist/lib/tooltip.cjs.map +1 -1
  357. package/dist/lib/tooltip.js +152 -90
  358. package/dist/lib/tooltip.js.map +1 -1
  359. package/dist/lib/top-banner-info.cjs +63 -1
  360. package/dist/lib/top-banner-info.cjs.map +1 -1
  361. package/dist/lib/top-banner-info.js +22 -18
  362. package/dist/lib/top-banner-info.js.map +1 -1
  363. package/dist/lib/unread-pill.cjs +63 -1
  364. package/dist/lib/unread-pill.cjs.map +1 -1
  365. package/dist/lib/unread-pill.js +25 -21
  366. package/dist/lib/unread-pill.js.map +1 -1
  367. package/dist/lib/validation-messages.cjs +85 -1
  368. package/dist/lib/validation-messages.cjs.map +1 -1
  369. package/dist/lib/validation-messages.js +32 -29
  370. package/dist/lib/validation-messages.js.map +1 -1
  371. package/dist/style.css +1214 -1
  372. package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +2 -2
  373. package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +2 -2
  374. package/package.json +31 -30
  375. package/dist/chunks/_plugin-vue2_normalizer-ZK80B3OL.js +0 -2
  376. package/dist/chunks/_plugin-vue2_normalizer-ZK80B3OL.js.map +0 -1
  377. package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js +0 -33
  378. package/dist/chunks/_plugin-vue2_normalizer-u6G_3nkj.js.map +0 -1
  379. package/dist/chunks/dropdown-zhMEz3bn.js +0 -2
  380. package/dist/chunks/dropdown_constants-EUcDxBrX.js +0 -9
  381. package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +0 -1
  382. package/dist/chunks/dropdown_constants-KHFvVI2L.js +0 -2
  383. package/dist/chunks/dropdown_constants-KHFvVI2L.js.map +0 -1
  384. package/dist/chunks/icon_constants-2S_OSQ1t.js +0 -2
  385. package/dist/chunks/index-2jPosQBn.js +0 -3
  386. package/dist/chunks/index-YkSDT8-g.js +0 -244
  387. package/dist/chunks/index-YkSDT8-g.js.map +0 -1
  388. package/dist/chunks/index-nIyl_PL6.js +0 -372
  389. package/dist/chunks/index-sdfB7Aok.js +0 -2
  390. package/dist/chunks/index-sdfB7Aok.js.map +0 -1
  391. package/dist/chunks/input-o-fc1X4b.js +0 -2
  392. package/dist/chunks/input_group-j2gTtc1C.js +0 -2
  393. package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +0 -197
  394. package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js +0 -2
  395. package/dist/chunks/link_constants-Kn6kP4i1.js +0 -2
  396. package/dist/chunks/link_constants-vIUB92L4.js +0 -16
  397. package/dist/chunks/list_item_constants-LTUc74pD.js +0 -13
  398. package/dist/chunks/list_item_constants-Tsz5CO1m.js +0 -2
  399. package/dist/chunks/modal-VuMFkZFH.js +0 -82
  400. package/dist/chunks/modal-qEzlo0Sj.js +0 -2
  401. package/dist/chunks/notice_action-9NmtQRai.js +0 -182
  402. package/dist/chunks/notice_action-u3ZKIhit.js +0 -2
  403. package/dist/chunks/notice_constants-c--hBFQw.js +0 -6
  404. package/dist/chunks/notice_constants-mC6al2Dm.js +0 -2
  405. package/dist/chunks/popover_constants-hOEhklvr.js +0 -2
  406. package/dist/chunks/popover_constants-qjlEkroB.js +0 -114
  407. package/dist/chunks/sr_only_close_button-ErijKGYR.js +0 -3
  408. package/dist/chunks/sr_only_close_button-JGole5Xi.js +0 -86
  409. package/dist/chunks/stack_constants-m9Ickqw0.js +0 -2
  410. package/dist/chunks/stack_constants-u7tNqGtc.js +0 -13
  411. package/dist/chunks/tab-7hJQSLFx.js +0 -2
  412. package/dist/chunks/tab-Qm9LVkYj.js +0 -346
  413. package/dist/lib/constants.cjs +0 -2
  414. package/dist/lib/dates.cjs +0 -2
  415. package/dist/lib/dates.js +0 -57
  416. package/dist/lib/mixins.cjs +0 -2
  417. package/dist/lib/mixins.js +0 -17
  418. package/dist/lib/utils.cjs +0 -2
  419. package/dist/lib/utils.js +0 -175
  420. package/dist/lib/validators.cjs +0 -2
  421. package/dist/lib/validators.js +0 -12
  422. /package/dist/{lib → common}/mixins.js.map +0 -0
@@ -1,2 +1,520 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./combobox-with-popover.cjs"),u=require("./input.cjs"),h=require("./chip.cjs"),c=require("./validation-messages.cjs"),d=require("./validators.cjs"),f=require("../chunks/popover_constants-hOEhklvr.js"),g=require("../chunks/sr_only_close_button-ErijKGYR.js"),m=require("../chunks/_plugin-vue2_normalizer-ZK80B3OL.js");require("../chunks/index-2jPosQBn.js");require("../chunks/keyboard_list_navigation-N74Bpdq7.js");require("./utils.cjs");require("./constants.cjs");require("vue");require("./list-item.cjs");require("../chunks/list_item_constants-Tsz5CO1m.js");require("./item-layout.cjs");require("./icon.cjs");require("@dialpad/dialtone-icons/vue2");require("../chunks/icon_constants-2S_OSQ1t.js");require("@dialpad/dialtone-icons/icons.json");require("./skeleton.cjs");require("./popover.cjs");require("@linusborg/vue-simple-portal");require("../chunks/modal-qEzlo0Sj.js");require("./button.cjs");require("../chunks/link_constants-Kn6kP4i1.js");require("./lazy-show.cjs");require("tippy.js");require("../chunks/dropdown_constants-KHFvVI2L.js");require("../chunks/input-o-fc1X4b.js");const r={EXTRA_SMALL:"xs",SMALL:"sm",DEFAULT:"md"},a={xs:"xs",sm:"xs",md:"sm"},l={xs:1.4,sm:.4,md:.2},b={name:"DtRecipeComboboxMultiSelect",components:{DtRecipeComboboxWithPopover:p.DtRecipeComboboxWithPopover,DtInput:u.DtInput,DtChip:h.DtChip,DtValidationMessages:c.DtValidationMessages},mixins:[g.a],props:{label:{type:String,required:!0},labelVisible:{type:Boolean,default:!0},description:{type:String,default:""},placeholder:{type:String,default:"Select one or start typing"},inputMessages:{type:Array,default:()=>[],validator:e=>d.validationMessageValidator(e)},showInputMessages:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingMessage:{type:String,default:"loading..."},showList:{type:Boolean,default:null},listMaxHeight:{type:String,default:"300px"},selectedItems:{type:Array,default:function(){return[]}},maxSelected:{type:Number,default:0},maxSelectedMessage:{type:Array,default:function(){return[]}},hasSuggestionList:{type:Boolean,default:!0},size:{type:String,default:"md",validator:e=>Object.values(r).includes(e)},appendTo:{type:[HTMLElement,String],default:"body",validator:e=>f.e.includes(e)||e instanceof HTMLElement},transition:{type:String,default:"fade"}},emits:["input","select","remove","max-selected","keyup"],data(){return{value:"",popoverOffset:[0,4],showValidationMessages:!1,initialInputPadding:{},resizeWindowObserver:null,originalInputSize:null,CHIP_SIZES:a}},computed:{inputPlaceHolder(){var e;return((e=this.selectedItems)==null?void 0:e.length)>0?"":this.placeholder},chipListeners(){return{...this.$listeners,keyup:e=>{this.onChipKeyup(e),this.$emit("keyup",e)}}},inputListeners(){return{...this.$listeners,input:e=>{this.$emit("input",e),this.hasSuggestionList&&this.showComboboxList()},keyup:e=>{this.onInputKeyup(e),this.$emit("keyup",e)},click:e=>{this.hasSuggestionList&&this.showComboboxList()}}}},watch:{selectedItems:{async handler(){this.initSelectedItems()}},async label(){await this.$nextTick(),this.setChipsTopPosition()},async description(){await this.$nextTick(),this.setChipsTopPosition()},size:{async handler(){await this.$nextTick();const e=this.getInput();this.revertInputPadding(e),this.originalInputSize=e.getBoundingClientRect().height,this.setInputPadding(),this.setChipsTopPosition()}}},mounted(){this.resizeWindowObserver=new ResizeObserver(async()=>{this.setChipsTopPosition(),this.setInputPadding()}),this.resizeWindowObserver.observe(document.body),this.initSelectedItems()},beforeDestroy(){var e;(e=this.resizeWindowObserver)==null||e.unobserve(document.body)},methods:{async initSelectedItems(){await this.$nextTick(),this.setInputPadding(),this.setChipsTopPosition(),this.setInputMinWidth(),this.checkMaxSelected()},onChipRemove(e){var t;this.$emit("remove",e),(t=this.$refs.input)==null||t.focus()},onComboboxSelect(e){this.value="",this.$emit("select",e)},showComboboxList(){var e;this.showList==null&&((e=this.$refs.comboboxWithPopover)==null||e.showComboboxList())},closeComboboxList(){var e;this.showList==null&&((e=this.$refs.comboboxWithPopover)==null||e.closeComboboxList())},getChipButtons(){return this.$refs.chips&&this.$refs.chips.map(e=>e.$el.querySelector("button"))},getChips(){return this.$refs.chips&&this.$refs.chips.map(e=>e.$el)},getLastChipButton(){return this.$refs.chips&&this.getChipButtons()[this.getChipButtons().length-1]},getLastChip(){return this.$refs.chips&&this.getChips()[this.getChips().length-1]},getFirstChip(){return this.$refs.chips&&this.getChips()[0]},getInput(){var e;return(e=this.$refs.input)==null?void 0:e.$refs.input},onChipKeyup(e){var i;const t=(i=e.code)==null?void 0:i.toLowerCase();t==="arrowleft"?this.navigateBetweenChips(e.target,!0):t==="arrowright"&&(e.target.id===this.getLastChipButton().id?this.moveFromChipToInput():this.navigateBetweenChips(e.target,!1))},onInputKeyup(e){var i;const t=(i=e.code)==null?void 0:i.toLowerCase();this.selectedItems.length>0&&e.target.selectionStart===0&&(t==="backspace"||t==="arrowleft")&&this.moveFromInputToChip()},moveFromInputToChip(){var e;this.getLastChipButton().focus(),(e=this.$refs.input)==null||e.blur(),this.closeComboboxList()},moveFromChipToInput(){var e;this.getLastChipButton().blur(),(e=this.$refs.input)==null||e.focus(),this.showComboboxList()},navigateBetweenChips(e,t){var o;const i=this.getChipButtons().indexOf(e),s=t?i-1:i+1;s<0||s>=((o=this.$refs.chips)==null?void 0:o.length)||(this.getChipButtons()[i].blur(),this.getChipButtons()[s].focus(),this.closeComboboxList())},setChipsTopPosition(){const e=this.getInput();if(!e)return;const t=this.$refs.inputSlotWrapper,i=e.getBoundingClientRect().top-t.getBoundingClientRect().top,s=this.$refs.chipsWrapper;s.style.top=i-l[this.size]+"px"},setInputPadding(){const e=this.getLastChip(),t=this.getInput(),i=this.$refs.chipsWrapper;if(!t||(this.revertInputPadding(t),this.popoverOffset=[0,4],!e))return;const s=e.offsetLeft+this.getFullWidth(e);t.style.paddingLeft=s+"px";const o=i.getBoundingClientRect().height-4,n=e.offsetTop+2;o>this.originalInputSize&&(t.style.paddingTop=`${n}px`)},revertInputPadding(e){e.style.paddingLeft="",e.style.paddingTop="",e.style.paddingBottom=""},getFullWidth(e){const t=window.getComputedStyle(e);return e.offsetWidth+parseInt(t.marginLeft)+parseInt(t.marginRight)},setInputMinWidth(){const e=this.getFirstChip(),t=this.getInput();t&&(e?t.style.minWidth=this.getFullWidth(e)+4+"px":t.style.minWidth="")},checkMaxSelected(){this.maxSelected!==0&&(this.selectedItems.length>this.maxSelected?(this.showValidationMessages=!0,this.$emit("max-selected")):this.showValidationMessages=!1)}}};var C=function(){var t=this,i=t._self._c;return i("dt-recipe-combobox-with-popover",{ref:"comboboxWithPopover",attrs:{label:t.label,"show-list":t.showList,"max-height":t.listMaxHeight,"popover-offset":t.popoverOffset,"has-suggestion-list":t.hasSuggestionList,"visually-hidden-close-label":t.visuallyHiddenCloseLabel,"visually-hidden-close":t.visuallyHiddenClose,"content-width":"anchor","append-to":t.appendTo,transition:t.transition},on:{select:t.onComboboxSelect},scopedSlots:t._u([{key:"input",fn:function({onInput:s}){return[i("span",{ref:"inputSlotWrapper",staticClass:"combobox__input-wrapper"},[i("span",{ref:"chipsWrapper",staticClass:"combobox__chip-wrapper"},t._l(t.selectedItems,function(o){return i("dt-chip",t._g({key:o,ref:"chips",refInFor:!0,staticClass:"combobox__chip",attrs:{"label-class":["d-chip__label"],"close-button-props":{ariaLabel:"close"},size:t.CHIP_SIZES[t.size]},on:{keyup:function(n){return!n.type.indexOf("key")&&t._k(n.keyCode,"backspace",void 0,n.key,void 0)?null:t.onChipRemove(o)},close:function(n){return t.onChipRemove(o)}}},t.chipListeners),[t._v(" "+t._s(o)+" ")])}),1),i("dt-input",t._g({ref:"input",staticClass:"combobox__input",attrs:{"aria-label":t.label,label:t.labelVisible?t.label:"",description:t.description,placeholder:t.inputPlaceHolder,"show-messages":t.showInputMessages,messages:t.inputMessages,size:t.size},on:{input:s},model:{value:t.value,callback:function(o){t.value=o},expression:"value"}},t.inputListeners)),i("dt-validation-messages",{attrs:{"validation-messages":t.maxSelectedMessage,"show-messages":t.showValidationMessages}})],1)]}},t.$slots.header?{key:"header",fn:function(){return[i("div",{ref:"header"},[t._t("header")],2)]},proxy:!0}:null,{key:"list",fn:function(){return[i("div",{ref:"list",on:{mousedown:function(s){s.preventDefault()}}},[t.loading?i("div",{staticClass:"combobox__list--loading"},[t._v(" "+t._s(t.loadingMessage)+" ")]):t._t("list")],2)]},proxy:!0},t.$slots.footer?{key:"footer",fn:function(){return[i("div",{ref:"footer"},[t._t("footer")],2)]},proxy:!0}:null],null,!0)})},y=[],_=m.n(b,C,y,!1,null,"e8b2c5a4",null,null);const v=_.exports;exports.CHIP_SIZES=a;exports.CHIP_TOP_POSITION=l;exports.DtRecipeComboboxMultiSelect=v;exports.MULTI_SELECT_SIZES=r;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const lib_comboboxWithPopover = require("./combobox-with-popover.cjs");
4
+ const lib_input = require("./input.cjs");
5
+ const lib_chip = require("./chip.cjs");
6
+ const lib_validationMessages = require("./validation-messages.cjs");
7
+ const common_validators = require("../common/validators.cjs");
8
+ const popover_constants = require("../chunks/popover_constants-JwBF9h1Z.js");
9
+ const sr_only_close_button = require("../chunks/sr_only_close_button-ZaGdAHz7.js");
10
+ const _pluginVue2_normalizer = require("../chunks/_plugin-vue2_normalizer-1aBeR4AK.js");
11
+ require("../chunks/index-gj1jEXP4.js");
12
+ require("../chunks/keyboard_list_navigation-fJnl_Iox.js");
13
+ require("../common/utils.cjs");
14
+ require("../common/constants.cjs");
15
+ require("vue");
16
+ require("./list-item.cjs");
17
+ require("../chunks/list_item_constants-EiqkqZvP.js");
18
+ require("./item-layout.cjs");
19
+ require("./icon.cjs");
20
+ require("@dialpad/dialtone-icons/vue2");
21
+ require("../chunks/icon_constants-QYpmdE0R.js");
22
+ require("@dialpad/dialtone-icons/icons.json");
23
+ require("./skeleton.cjs");
24
+ require("./popover.cjs");
25
+ require("@linusborg/vue-simple-portal");
26
+ require("../chunks/modal-VgxXAQFP.js");
27
+ require("./button.cjs");
28
+ require("../chunks/link_constants-Huj7D_hm.js");
29
+ require("./lazy-show.cjs");
30
+ require("tippy.js");
31
+ require("../chunks/dropdown_constants-2pGCXy7m.js");
32
+ require("../chunks/input-Axw-wFj2.js");
33
+ const MULTI_SELECT_SIZES = {
34
+ // Chip has no 'lg' and 'xl' size. So we don't support that in multi-select.
35
+ EXTRA_SMALL: "xs",
36
+ SMALL: "sm",
37
+ DEFAULT: "md"
38
+ };
39
+ const CHIP_SIZES = {
40
+ xs: "xs",
41
+ sm: "xs",
42
+ md: "sm"
43
+ };
44
+ const CHIP_TOP_POSITION = {
45
+ xs: 1.4,
46
+ sm: 0.4,
47
+ md: 0.2
48
+ };
49
+ const _sfc_main = {
50
+ name: "DtRecipeComboboxMultiSelect",
51
+ components: {
52
+ DtRecipeComboboxWithPopover: lib_comboboxWithPopover.DtRecipeComboboxWithPopover,
53
+ DtInput: lib_input.DtInput,
54
+ DtChip: lib_chip.DtChip,
55
+ DtValidationMessages: lib_validationMessages.DtValidationMessages
56
+ },
57
+ mixins: [sr_only_close_button.SrOnlyCloseButtonMixin],
58
+ props: {
59
+ /**
60
+ * String to use for the input label.
61
+ */
62
+ label: {
63
+ type: String,
64
+ required: true
65
+ },
66
+ /**
67
+ * Determines visibility of input label.
68
+ * @values true, false
69
+ */
70
+ labelVisible: {
71
+ type: Boolean,
72
+ default: true
73
+ },
74
+ /**
75
+ * Description for the input
76
+ */
77
+ description: {
78
+ type: String,
79
+ default: ""
80
+ },
81
+ /**
82
+ * Input placeholder
83
+ */
84
+ placeholder: {
85
+ type: String,
86
+ default: "Select one or start typing"
87
+ },
88
+ /**
89
+ * Input validation messages
90
+ */
91
+ inputMessages: {
92
+ type: Array,
93
+ default: () => [],
94
+ validator: (inputMessages) => {
95
+ return common_validators.validationMessageValidator(inputMessages);
96
+ }
97
+ },
98
+ /**
99
+ * Show input validation message
100
+ */
101
+ showInputMessages: {
102
+ type: Boolean,
103
+ default: true
104
+ },
105
+ // @TODO: https://dialpad.atlassian.net/browse/DP-52324
106
+ // type: {
107
+ // type: String,
108
+ // values: ['input', 'select'],
109
+ // default: 'select',
110
+ // },
111
+ /**
112
+ * Determines if the list is loading
113
+ */
114
+ loading: {
115
+ type: Boolean,
116
+ default: false
117
+ },
118
+ /**
119
+ * The message when the list is loading
120
+ */
121
+ loadingMessage: {
122
+ type: String,
123
+ default: "loading..."
124
+ },
125
+ /**
126
+ * Determines when to show the list element and also controls the aria-expanded attribute.
127
+ * Leaving this null will have the combobox trigger on input focus by default.
128
+ * If you set this value, the default trigger behavior will be disabled and you can
129
+ * control it as you need.
130
+ */
131
+ showList: {
132
+ type: Boolean,
133
+ default: null
134
+ },
135
+ /**
136
+ * Determines maximum height for the popover before overflow.
137
+ * Possible units rem|px|em
138
+ */
139
+ listMaxHeight: {
140
+ type: String,
141
+ default: "300px"
142
+ },
143
+ /**
144
+ * The selected items
145
+ */
146
+ selectedItems: {
147
+ type: Array,
148
+ default: function() {
149
+ return [];
150
+ }
151
+ },
152
+ /**
153
+ * Would be the maximum number of selections you can make. 0 is unlimited
154
+ */
155
+ maxSelected: {
156
+ type: Number,
157
+ default: 0
158
+ },
159
+ /**
160
+ * Max select message when the max selections is exceeded with the structure:
161
+ * `[{"message": string, "type": VALIDATION_MESSAGE_TYPES }]`
162
+ */
163
+ maxSelectedMessage: {
164
+ type: Array,
165
+ default: function() {
166
+ return [];
167
+ }
168
+ },
169
+ /**
170
+ * Displays the list when the combobox is focused, before the user has typed anything.
171
+ * When this is enabled the list will not close after selection.
172
+ */
173
+ hasSuggestionList: {
174
+ type: Boolean,
175
+ default: true
176
+ },
177
+ /**
178
+ * Size of the chip, one of `xs`, `sm`, `md`
179
+ */
180
+ size: {
181
+ type: String,
182
+ default: "md",
183
+ validator: (t) => Object.values(MULTI_SELECT_SIZES).includes(t)
184
+ },
185
+ /**
186
+ * Sets the element to which the popover is going to append to.
187
+ * 'body' will append to the nearest body (supports shadow DOM).
188
+ * @values 'body', 'parent', HTMLElement,
189
+ */
190
+ appendTo: {
191
+ type: [HTMLElement, String],
192
+ default: "body",
193
+ validator: (appendTo) => {
194
+ return popover_constants.POPOVER_APPEND_TO_VALUES.includes(appendTo) || appendTo instanceof HTMLElement;
195
+ }
196
+ },
197
+ /**
198
+ * Named transition when the content display is toggled.
199
+ * @see DtLazyShow
200
+ */
201
+ transition: {
202
+ type: String,
203
+ default: "fade"
204
+ }
205
+ },
206
+ emits: [
207
+ /**
208
+ * Native input event
209
+ *
210
+ * @event input
211
+ * @type {String }
212
+ */
213
+ "input",
214
+ /**
215
+ * Event fired when item selected
216
+ *
217
+ * @event select
218
+ * @type {Number}
219
+ */
220
+ "select",
221
+ /**
222
+ * Event fired when item removed
223
+ *
224
+ * @event remove
225
+ * @type {String}
226
+ */
227
+ "remove",
228
+ /**
229
+ * Event fired when max selected items limit is reached
230
+ *
231
+ * @event max-selected
232
+ * @type {Object}
233
+ */
234
+ "max-selected",
235
+ /**
236
+ * Native keyup event
237
+ *
238
+ * @event keyup
239
+ * @type {KeyboardEvent}
240
+ */
241
+ "keyup"
242
+ ],
243
+ data() {
244
+ return {
245
+ value: "",
246
+ popoverOffset: [0, 4],
247
+ showValidationMessages: false,
248
+ initialInputPadding: {},
249
+ resizeWindowObserver: null,
250
+ originalInputSize: null,
251
+ CHIP_SIZES
252
+ };
253
+ },
254
+ computed: {
255
+ inputPlaceHolder() {
256
+ var _a;
257
+ return ((_a = this.selectedItems) == null ? void 0 : _a.length) > 0 ? "" : this.placeholder;
258
+ },
259
+ chipListeners() {
260
+ return {
261
+ ...this.$listeners,
262
+ keyup: (event) => {
263
+ this.onChipKeyup(event);
264
+ this.$emit("keyup", event);
265
+ }
266
+ };
267
+ },
268
+ inputListeners() {
269
+ return {
270
+ ...this.$listeners,
271
+ input: (event) => {
272
+ this.$emit("input", event);
273
+ if (this.hasSuggestionList) {
274
+ this.showComboboxList();
275
+ }
276
+ },
277
+ keyup: (event) => {
278
+ this.onInputKeyup(event);
279
+ this.$emit("keyup", event);
280
+ },
281
+ click: (event) => {
282
+ if (this.hasSuggestionList) {
283
+ this.showComboboxList();
284
+ }
285
+ }
286
+ };
287
+ }
288
+ },
289
+ watch: {
290
+ selectedItems: {
291
+ async handler() {
292
+ this.initSelectedItems();
293
+ }
294
+ },
295
+ async label() {
296
+ await this.$nextTick();
297
+ this.setChipsTopPosition();
298
+ },
299
+ async description() {
300
+ await this.$nextTick();
301
+ this.setChipsTopPosition();
302
+ },
303
+ size: {
304
+ async handler() {
305
+ await this.$nextTick();
306
+ const input = this.getInput();
307
+ this.revertInputPadding(input);
308
+ this.originalInputSize = input.getBoundingClientRect().height;
309
+ this.setInputPadding();
310
+ this.setChipsTopPosition();
311
+ }
312
+ }
313
+ },
314
+ mounted() {
315
+ this.resizeWindowObserver = new ResizeObserver(async () => {
316
+ this.setChipsTopPosition();
317
+ this.setInputPadding();
318
+ });
319
+ this.resizeWindowObserver.observe(document.body);
320
+ this.initSelectedItems();
321
+ },
322
+ beforeDestroy() {
323
+ var _a;
324
+ (_a = this.resizeWindowObserver) == null ? void 0 : _a.unobserve(document.body);
325
+ },
326
+ methods: {
327
+ async initSelectedItems() {
328
+ await this.$nextTick();
329
+ this.setInputPadding();
330
+ this.setChipsTopPosition();
331
+ this.setInputMinWidth();
332
+ this.checkMaxSelected();
333
+ },
334
+ onChipRemove(item) {
335
+ var _a;
336
+ this.$emit("remove", item);
337
+ (_a = this.$refs.input) == null ? void 0 : _a.focus();
338
+ },
339
+ onComboboxSelect(i) {
340
+ this.value = "";
341
+ this.$emit("select", i);
342
+ },
343
+ showComboboxList() {
344
+ var _a;
345
+ if (this.showList != null) {
346
+ return;
347
+ }
348
+ (_a = this.$refs.comboboxWithPopover) == null ? void 0 : _a.showComboboxList();
349
+ },
350
+ closeComboboxList() {
351
+ var _a;
352
+ if (this.showList != null) {
353
+ return;
354
+ }
355
+ (_a = this.$refs.comboboxWithPopover) == null ? void 0 : _a.closeComboboxList();
356
+ },
357
+ getChipButtons() {
358
+ return this.$refs.chips && this.$refs.chips.map((chip) => chip.$el.querySelector("button"));
359
+ },
360
+ getChips() {
361
+ return this.$refs.chips && this.$refs.chips.map((chip) => chip.$el);
362
+ },
363
+ getLastChipButton() {
364
+ return this.$refs.chips && this.getChipButtons()[this.getChipButtons().length - 1];
365
+ },
366
+ getLastChip() {
367
+ return this.$refs.chips && this.getChips()[this.getChips().length - 1];
368
+ },
369
+ getFirstChip() {
370
+ return this.$refs.chips && this.getChips()[0];
371
+ },
372
+ getInput() {
373
+ var _a;
374
+ return (_a = this.$refs.input) == null ? void 0 : _a.$refs.input;
375
+ },
376
+ onChipKeyup(event) {
377
+ var _a;
378
+ const key = (_a = event.code) == null ? void 0 : _a.toLowerCase();
379
+ if (key === "arrowleft") {
380
+ this.navigateBetweenChips(event.target, true);
381
+ } else if (key === "arrowright") {
382
+ if (event.target.id === this.getLastChipButton().id) {
383
+ this.moveFromChipToInput();
384
+ } else {
385
+ this.navigateBetweenChips(event.target, false);
386
+ }
387
+ }
388
+ },
389
+ onInputKeyup(event) {
390
+ var _a;
391
+ const key = (_a = event.code) == null ? void 0 : _a.toLowerCase();
392
+ if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {
393
+ if (key === "backspace" || key === "arrowleft") {
394
+ this.moveFromInputToChip();
395
+ }
396
+ }
397
+ },
398
+ moveFromInputToChip() {
399
+ var _a;
400
+ this.getLastChipButton().focus();
401
+ (_a = this.$refs.input) == null ? void 0 : _a.blur();
402
+ this.closeComboboxList();
403
+ },
404
+ moveFromChipToInput() {
405
+ var _a;
406
+ this.getLastChipButton().blur();
407
+ (_a = this.$refs.input) == null ? void 0 : _a.focus();
408
+ this.showComboboxList();
409
+ },
410
+ navigateBetweenChips(target, toLeft) {
411
+ var _a;
412
+ const from = this.getChipButtons().indexOf(target);
413
+ const to = toLeft ? from - 1 : from + 1;
414
+ if (to < 0 || to >= ((_a = this.$refs.chips) == null ? void 0 : _a.length)) {
415
+ return;
416
+ }
417
+ this.getChipButtons()[from].blur();
418
+ this.getChipButtons()[to].focus();
419
+ this.closeComboboxList();
420
+ },
421
+ setChipsTopPosition() {
422
+ const input = this.getInput();
423
+ if (!input)
424
+ return;
425
+ const inputSlotWrapper = this.$refs.inputSlotWrapper;
426
+ const top = input.getBoundingClientRect().top - inputSlotWrapper.getBoundingClientRect().top;
427
+ const chipsWrapper = this.$refs.chipsWrapper;
428
+ chipsWrapper.style.top = top - CHIP_TOP_POSITION[this.size] + "px";
429
+ },
430
+ setInputPadding() {
431
+ const lastChip = this.getLastChip();
432
+ const input = this.getInput();
433
+ const chipsWrapper = this.$refs.chipsWrapper;
434
+ if (!input)
435
+ return;
436
+ this.revertInputPadding(input);
437
+ this.popoverOffset = [0, 4];
438
+ if (!lastChip)
439
+ return;
440
+ const left = lastChip.offsetLeft + this.getFullWidth(lastChip);
441
+ input.style.paddingLeft = left + "px";
442
+ const chipsSize = chipsWrapper.getBoundingClientRect().height - 4;
443
+ const top = lastChip.offsetTop + 2;
444
+ if (chipsSize > this.originalInputSize) {
445
+ input.style.paddingTop = `${top}px`;
446
+ }
447
+ },
448
+ revertInputPadding(input) {
449
+ input.style.paddingLeft = "";
450
+ input.style.paddingTop = "";
451
+ input.style.paddingBottom = "";
452
+ },
453
+ getFullWidth(el) {
454
+ const styles = window.getComputedStyle(el);
455
+ return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);
456
+ },
457
+ setInputMinWidth() {
458
+ const firstChip = this.getFirstChip();
459
+ const input = this.getInput();
460
+ if (!input)
461
+ return;
462
+ if (firstChip) {
463
+ input.style.minWidth = this.getFullWidth(firstChip) + 4 + "px";
464
+ } else {
465
+ input.style.minWidth = "";
466
+ }
467
+ },
468
+ checkMaxSelected() {
469
+ if (this.maxSelected === 0)
470
+ return;
471
+ if (this.selectedItems.length > this.maxSelected) {
472
+ this.showValidationMessages = true;
473
+ this.$emit("max-selected");
474
+ } else {
475
+ this.showValidationMessages = false;
476
+ }
477
+ }
478
+ }
479
+ };
480
+ var _sfc_render = function render() {
481
+ var _vm = this, _c = _vm._self._c;
482
+ return _c("dt-recipe-combobox-with-popover", { ref: "comboboxWithPopover", attrs: { "label": _vm.label, "show-list": _vm.showList, "max-height": _vm.listMaxHeight, "popover-offset": _vm.popoverOffset, "has-suggestion-list": _vm.hasSuggestionList, "visually-hidden-close-label": _vm.visuallyHiddenCloseLabel, "visually-hidden-close": _vm.visuallyHiddenClose, "content-width": "anchor", "append-to": _vm.appendTo, "transition": _vm.transition }, on: { "select": _vm.onComboboxSelect }, scopedSlots: _vm._u([{ key: "input", fn: function({ onInput }) {
483
+ return [_c("span", { ref: "inputSlotWrapper", staticClass: "combobox__input-wrapper" }, [_c("span", { ref: "chipsWrapper", staticClass: "combobox__chip-wrapper" }, _vm._l(_vm.selectedItems, function(item) {
484
+ return _c("dt-chip", _vm._g({ key: item, ref: "chips", refInFor: true, staticClass: "combobox__chip", attrs: { "label-class": ["d-chip__label"], "close-button-props": { ariaLabel: "close" }, "size": _vm.CHIP_SIZES[_vm.size] }, on: { "keyup": function($event) {
485
+ if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "backspace", void 0, $event.key, void 0))
486
+ return null;
487
+ return _vm.onChipRemove(item);
488
+ }, "close": function($event) {
489
+ return _vm.onChipRemove(item);
490
+ } } }, _vm.chipListeners), [_vm._v(" " + _vm._s(item) + " ")]);
491
+ }), 1), _c("dt-input", _vm._g({ ref: "input", staticClass: "combobox__input", attrs: { "aria-label": _vm.label, "label": _vm.labelVisible ? _vm.label : "", "description": _vm.description, "placeholder": _vm.inputPlaceHolder, "show-messages": _vm.showInputMessages, "messages": _vm.inputMessages, "size": _vm.size }, on: { "input": onInput }, model: { value: _vm.value, callback: function($$v) {
492
+ _vm.value = $$v;
493
+ }, expression: "value" } }, _vm.inputListeners)), _c("dt-validation-messages", { attrs: { "validation-messages": _vm.maxSelectedMessage, "show-messages": _vm.showValidationMessages } })], 1)];
494
+ } }, _vm.$slots.header ? { key: "header", fn: function() {
495
+ return [_c("div", { ref: "header" }, [_vm._t("header")], 2)];
496
+ }, proxy: true } : null, { key: "list", fn: function() {
497
+ return [_c("div", { ref: "list", on: { "mousedown": function($event) {
498
+ $event.preventDefault();
499
+ } } }, [!_vm.loading ? _vm._t("list") : _c("div", { staticClass: "combobox__list--loading" }, [_vm._v(" " + _vm._s(_vm.loadingMessage) + " ")])], 2)];
500
+ }, proxy: true }, _vm.$slots.footer ? { key: "footer", fn: function() {
501
+ return [_c("div", { ref: "footer" }, [_vm._t("footer")], 2)];
502
+ }, proxy: true } : null], null, true) });
503
+ };
504
+ var _sfc_staticRenderFns = [];
505
+ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
506
+ _sfc_main,
507
+ _sfc_render,
508
+ _sfc_staticRenderFns,
509
+ false,
510
+ null,
511
+ "e8b2c5a4",
512
+ null,
513
+ null
514
+ );
515
+ const combobox_multi_select = __component__.exports;
516
+ exports.CHIP_SIZES = CHIP_SIZES;
517
+ exports.CHIP_TOP_POSITION = CHIP_TOP_POSITION;
518
+ exports.DtRecipeComboboxMultiSelect = combobox_multi_select;
519
+ exports.MULTI_SELECT_SIZES = MULTI_SELECT_SIZES;
2
520
  //# sourceMappingURL=combobox-multi-select.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-multi-select.cjs","sources":["../../recipes/comboboxes/combobox_multi_select/combobox_multi_select_constants.js","../../recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue"],"sourcesContent":["export const MULTI_SELECT_SIZES = {\n // Chip has no 'lg' and 'xl' size. So we don't support that in multi-select.\n EXTRA_SMALL: 'xs',\n SMALL: 'sm',\n DEFAULT: 'md',\n};\n\nexport const CHIP_SIZES = {\n xs: 'xs',\n sm: 'xs',\n md: 'sm',\n};\n\nexport const CHIP_TOP_POSITION = {\n xs: 1.4,\n sm: 0.4,\n md: 0.2,\n};\n\nexport default {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n};\n","<template>\n <dt-recipe-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :visually-hidden-close=\"visuallyHiddenClose\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :transition=\"transition\"\n @select=\"onComboboxSelect\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"combobox__input-wrapper\"\n >\n <span\n ref=\"chipsWrapper\"\n class=\"combobox__chip-wrapper\"\n >\n <dt-chip\n v-for=\"item in selectedItems\"\n ref=\"chips\"\n :key=\"item\"\n :label-class=\"['d-chip__label']\"\n class=\"combobox__chip\"\n :close-button-props=\"{ ariaLabel: 'close' }\"\n :size=\"CHIP_SIZES[size]\"\n v-on=\"chipListeners\"\n @keyup.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"combobox__input\"\n :aria-label=\"label\"\n :label=\"labelVisible ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-on=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"$slots.header\"\n #header\n >\n <div ref=\"header\">\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"combobox__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"$slots.footer\"\n #footer\n >\n <div ref=\"footer\">\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-recipe-combobox-with-popover>\n</template>\n\n<script>\nimport DtRecipeComboboxWithPopover from '@/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue';\nimport DtInput from '@/components/input/input.vue';\nimport DtChip from '@/components/chip/chip.vue';\nimport DtValidationMessages from '@/components/validation_messages/validation_messages.vue';\nimport { validationMessageValidator } from '@/common/validators';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/popover/popover_constants';\nimport {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './combobox_multi_select_constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\n\nexport default {\n name: 'DtRecipeComboboxMultiSelect',\n\n components: {\n DtRecipeComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip, one of `xs`, `sm`, `md`\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(MULTI_SELECT_SIZES).includes(t),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String }\n */\n 'input',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keyup event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n initialInputPadding: {},\n resizeWindowObserver: null,\n originalInputSize: null,\n CHIP_SIZES,\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n ...this.$listeners,\n keyup: event => {\n this.onChipKeyup(event);\n this.$emit('keyup', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...this.$listeners,\n input: event => {\n this.$emit('input', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n keyup: event => {\n this.onInputKeyup(event);\n this.$emit('keyup', event);\n },\n\n click: event => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n },\n\n watch: {\n selectedItems: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.originalInputSize = input.getBoundingClientRect().height;\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n mounted () {\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n this.initSelectedItems();\n },\n\n beforeDestroy () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChipButtons () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el.querySelector('button'));\n },\n\n getChips () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el);\n },\n\n getLastChipButton () {\n return this.$refs.chips && this.getChipButtons()[this.getChipButtons().length - 1];\n },\n\n getLastChip () {\n return this.$refs.chips && this.getChips()[this.getChips().length - 1];\n },\n\n getFirstChip () {\n return this.$refs.chips && this.getChips()[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyup (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyup (event) {\n const key = event.code?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // To place the chips in the input box\n // The chip \"top\" position should be the same line as the input box\n const input = this.getInput();\n if (!input) return;\n const inputSlotWrapper = this.$refs.inputSlotWrapper;\n const top = input.getBoundingClientRect().top -\n inputSlotWrapper.getBoundingClientRect().top;\n const chipsWrapper = this.$refs.chipsWrapper;\n chipsWrapper.style.top = (top - CHIP_TOP_POSITION[this.size]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n input.style.paddingLeft = left + 'px';\n\n // Get the chip size minus the 4px padding\n const chipsSize = chipsWrapper.getBoundingClientRect().height - 4;\n\n // Get lastChip offsetTop plus 2px of the input padding.\n const top = lastChip.offsetTop + 2;\n\n // Add padding to Top only if the chips need more space\n if (chipsSize > this.originalInputSize) {\n input.style.paddingTop = `${top}px`;\n }\n },\n\n revertInputPadding (input) {\n input.style.paddingLeft = '';\n input.style.paddingTop = '';\n input.style.paddingBottom = '';\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n },\n};\n</script>\n\n<style scoped lang=\"less\">\n.combobox__input-wrapper {\n position: relative;\n display: block;\n}\n\n.combobox__chip-wrapper {\n position: absolute;\n margin-left: var(--dt-space-200);\n margin-right: var(--dt-space-200);\n padding-left: var(--dt-space-100);\n max-width: calc(var(--dt-size-100-percent) - var(--dt-space-400));\n}\n\n.combobox__chip {\n margin-top: var(--dt-space-300);\n margin-left: var(--dt-space-200);\n margin-right: var(--dt-space-200);\n z-index: var(--zi-base1);\n max-width: var(--dt-size-100-percent);\n}\n\n.combobox__input {\n flex-grow: 1;\n}\n\n.combobox__list--loading {\n text-align: center;\n padding-top: var(--dt-space-500);\n padding-bottom: var(--dt-space-500);\n}\n</style>\n"],"names":["MULTI_SELECT_SIZES","CHIP_SIZES","CHIP_TOP_POSITION","_sfc_main","DtRecipeComboboxWithPopover","DtInput","DtChip","DtValidationMessages","SrOnlyCloseButtonMixin","inputMessages","validationMessageValidator","t","appendTo","POPOVER_APPEND_TO_VALUES","_a","event","input","item","i","chip","key","target","toLeft","from","to","inputSlotWrapper","top","chipsWrapper","lastChip","left","chipsSize","el","styles","firstChip"],"mappings":"4pCAAY,MAACA,EAAqB,CAEhC,YAAa,KACb,MAAO,KACP,QAAS,IACX,EAEaC,EAAa,CACxB,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,EAEaC,EAAoB,CAC/B,GAAI,IACJ,GAAI,GACJ,GAAI,EACN,ECsGAC,EAAA,CACA,KAAA,8BAEA,WAAA,CACA,4BAAAC,EAAA,4BACA,QAAAC,EAAA,QACA,OAAAC,EAAA,OACA,qBAAAC,EAAA,oBACA,EAEA,OAAA,CAAAC,EAAAA,CAAA,EAEA,MAAA,CAIA,MAAA,CACA,KAAA,OACA,SAAA,EACA,EAMA,aAAA,CACA,KAAA,QACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,EACA,EAKA,YAAA,CACA,KAAA,OACA,QAAA,4BACA,EAKA,cAAA,CACA,KAAA,MACA,QAAA,IAAA,CAAA,EACA,UAAAC,GACAC,EAAAA,2BAAAD,CAAA,CAEA,EAKA,kBAAA,CAC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AAA,uBAAA,GAEA,CACA,CACA"}
1
+ {"version":3,"file":"combobox-multi-select.cjs","sources":["../../recipes/comboboxes/combobox_multi_select/combobox_multi_select_constants.js","../../recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue"],"sourcesContent":["export const MULTI_SELECT_SIZES = {\n // Chip has no 'lg' and 'xl' size. So we don't support that in multi-select.\n EXTRA_SMALL: 'xs',\n SMALL: 'sm',\n DEFAULT: 'md',\n};\n\nexport const CHIP_SIZES = {\n xs: 'xs',\n sm: 'xs',\n md: 'sm',\n};\n\nexport const CHIP_TOP_POSITION = {\n xs: 1.4,\n sm: 0.4,\n md: 0.2,\n};\n\nexport default {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n};\n","<template>\n <dt-recipe-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n :visually-hidden-close=\"visuallyHiddenClose\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :transition=\"transition\"\n @select=\"onComboboxSelect\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"combobox__input-wrapper\"\n >\n <span\n ref=\"chipsWrapper\"\n class=\"combobox__chip-wrapper\"\n >\n <dt-chip\n v-for=\"item in selectedItems\"\n ref=\"chips\"\n :key=\"item\"\n :label-class=\"['d-chip__label']\"\n class=\"combobox__chip\"\n :close-button-props=\"{ ariaLabel: 'close' }\"\n :size=\"CHIP_SIZES[size]\"\n v-on=\"chipListeners\"\n @keyup.backspace=\"onChipRemove(item)\"\n @close=\"onChipRemove(item)\"\n >\n {{ item }}\n </dt-chip>\n </span>\n\n <dt-input\n ref=\"input\"\n v-model=\"value\"\n class=\"combobox__input\"\n :aria-label=\"label\"\n :label=\"labelVisible ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-on=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\n :validation-messages=\"maxSelectedMessage\"\n :show-messages=\"showValidationMessages\"\n />\n </span>\n </template>\n\n <!-- @slot slot for popover header -->\n <template\n v-if=\"$slots.header\"\n #header\n >\n <div ref=\"header\">\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"combobox__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"$slots.footer\"\n #footer\n >\n <div ref=\"footer\">\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-recipe-combobox-with-popover>\n</template>\n\n<script>\nimport DtRecipeComboboxWithPopover from '@/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue';\nimport DtInput from '@/components/input/input.vue';\nimport DtChip from '@/components/chip/chip.vue';\nimport DtValidationMessages from '@/components/validation_messages/validation_messages.vue';\nimport { validationMessageValidator } from '@/common/validators';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/popover/popover_constants';\nimport {\n MULTI_SELECT_SIZES,\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './combobox_multi_select_constants';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\n\nexport default {\n name: 'DtRecipeComboboxMultiSelect',\n\n components: {\n DtRecipeComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n mixins: [SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n labelVisible: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Input placeholder\n */\n placeholder: {\n type: String,\n default: 'Select one or start typing',\n },\n\n /**\n * Input validation messages\n */\n inputMessages: {\n type: Array,\n default: () => [],\n validator: inputMessages => {\n return validationMessageValidator(inputMessages);\n },\n },\n\n /**\n * Show input validation message\n */\n showInputMessages: {\n type: Boolean,\n default: true,\n },\n\n // @TODO: https://dialpad.atlassian.net/browse/DP-52324\n // type: {\n // type: String,\n // values: ['input', 'select'],\n // default: 'select',\n // },\n\n /**\n * Determines if the list is loading\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The message when the list is loading\n */\n loadingMessage: {\n type: String,\n default: 'loading...',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxHeight: {\n type: String,\n default: '300px',\n },\n\n /**\n * The selected items\n */\n selectedItems: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Would be the maximum number of selections you can make. 0 is unlimited\n */\n maxSelected: {\n type: Number,\n default: 0,\n },\n\n /**\n * Max select message when the max selections is exceeded with the structure:\n * `[{\"message\": string, \"type\": VALIDATION_MESSAGE_TYPES }]`\n */\n maxSelectedMessage: {\n type: Array,\n default: function () { return []; },\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the chip, one of `xs`, `sm`, `md`\n */\n size: {\n type: String,\n default: 'md',\n validator: (t) => Object.values(MULTI_SELECT_SIZES).includes(t),\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Native input event\n *\n * @event input\n * @type {String }\n */\n 'input',\n\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when item removed\n *\n * @event remove\n * @type {String}\n */\n 'remove',\n\n /**\n * Event fired when max selected items limit is reached\n *\n * @event max-selected\n * @type {Object}\n */\n 'max-selected',\n\n /**\n * Native keyup event\n *\n * @event keyup\n * @type {KeyboardEvent}\n */\n 'keyup',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n initialInputPadding: {},\n resizeWindowObserver: null,\n originalInputSize: null,\n CHIP_SIZES,\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n ...this.$listeners,\n keyup: event => {\n this.onChipKeyup(event);\n this.$emit('keyup', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...this.$listeners,\n input: event => {\n this.$emit('input', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n keyup: event => {\n this.onInputKeyup(event);\n this.$emit('keyup', event);\n },\n\n click: event => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n },\n\n watch: {\n selectedItems: {\n async handler () {\n this.initSelectedItems();\n },\n },\n\n async label () {\n await this.$nextTick();\n // Adjust the chips position if label changed\n this.setChipsTopPosition();\n },\n\n async description () {\n await this.$nextTick();\n // Adjust the chips position if description changed\n this.setChipsTopPosition();\n },\n\n size: {\n async handler () {\n await this.$nextTick();\n const input = this.getInput();\n this.revertInputPadding(input);\n this.originalInputSize = input.getBoundingClientRect().height;\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n mounted () {\n // Recalculate chip position and input padding when resizing window\n this.resizeWindowObserver = new ResizeObserver(async () => {\n this.setChipsTopPosition();\n this.setInputPadding();\n });\n this.resizeWindowObserver.observe(document.body);\n\n this.initSelectedItems();\n },\n\n beforeDestroy () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n async initSelectedItems () {\n await this.$nextTick();\n this.setInputPadding();\n this.setChipsTopPosition();\n this.setInputMinWidth();\n this.checkMaxSelected();\n },\n\n onChipRemove (item) {\n this.$emit('remove', item);\n this.$refs.input?.focus();\n },\n\n onComboboxSelect (i) {\n this.value = '';\n this.$emit('select', i);\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.showComboboxList();\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.$refs.comboboxWithPopover?.closeComboboxList();\n },\n\n getChipButtons () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el.querySelector('button'));\n },\n\n getChips () {\n return this.$refs.chips && this.$refs.chips.map(chip => chip.$el);\n },\n\n getLastChipButton () {\n return this.$refs.chips && this.getChipButtons()[this.getChipButtons().length - 1];\n },\n\n getLastChip () {\n return this.$refs.chips && this.getChips()[this.getChips().length - 1];\n },\n\n getFirstChip () {\n return this.$refs.chips && this.getChips()[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyup (event) {\n const key = event.code?.toLowerCase();\n if (key === 'arrowleft') {\n // Move to the previous chip\n this.navigateBetweenChips(event.target, true);\n } else if (key === 'arrowright') {\n if (event.target.id === this.getLastChipButton().id) {\n // Move to the input if it's the last chip\n this.moveFromChipToInput();\n } else {\n // Move to the next chip\n this.navigateBetweenChips(event.target, false);\n }\n }\n },\n\n onInputKeyup (event) {\n const key = event.code?.toLowerCase();\n // If the cursor is at the start of the text,\n // press 'backspace' or 'left' focuses the last chip\n if (this.selectedItems.length > 0 && event.target.selectionStart === 0) {\n if (key === 'backspace' || key === 'arrowleft') {\n this.moveFromInputToChip();\n }\n }\n },\n\n moveFromInputToChip () {\n this.getLastChipButton().focus();\n this.$refs.input?.blur();\n this.closeComboboxList();\n },\n\n moveFromChipToInput () {\n this.getLastChipButton().blur();\n this.$refs.input?.focus();\n this.showComboboxList();\n },\n\n navigateBetweenChips (target, toLeft) {\n const from = this.getChipButtons().indexOf(target);\n const to = toLeft ? from - 1 : from + 1;\n if (to < 0 || to >= this.$refs.chips?.length) {\n return;\n }\n this.getChipButtons()[from].blur();\n this.getChipButtons()[to].focus();\n this.closeComboboxList();\n },\n\n setChipsTopPosition () {\n // To place the chips in the input box\n // The chip \"top\" position should be the same line as the input box\n const input = this.getInput();\n if (!input) return;\n const inputSlotWrapper = this.$refs.inputSlotWrapper;\n const top = input.getBoundingClientRect().top -\n inputSlotWrapper.getBoundingClientRect().top;\n const chipsWrapper = this.$refs.chipsWrapper;\n chipsWrapper.style.top = (top - CHIP_TOP_POSITION[this.size]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n const chipsWrapper = this.$refs.chipsWrapper;\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n\n // Get the position of the last chip\n // The input cursor should be the same \"top\" as that chip and next besides it\n const left = lastChip.offsetLeft + this.getFullWidth(lastChip);\n input.style.paddingLeft = left + 'px';\n\n // Get the chip size minus the 4px padding\n const chipsSize = chipsWrapper.getBoundingClientRect().height - 4;\n\n // Get lastChip offsetTop plus 2px of the input padding.\n const top = lastChip.offsetTop + 2;\n\n // Add padding to Top only if the chips need more space\n if (chipsSize > this.originalInputSize) {\n input.style.paddingTop = `${top}px`;\n }\n },\n\n revertInputPadding (input) {\n input.style.paddingLeft = '';\n input.style.paddingTop = '';\n input.style.paddingBottom = '';\n },\n\n getFullWidth (el) {\n const styles = window.getComputedStyle(el);\n return el.offsetWidth + parseInt(styles.marginLeft) + parseInt(styles.marginRight);\n },\n\n setInputMinWidth () {\n // Ensure the width of the input is \"slightly bigger\" than the width of a single chip\n const firstChip = this.getFirstChip();\n const input = this.getInput();\n if (!input) return;\n if (firstChip) {\n // Add 4px buffer for typing room\n input.style.minWidth = (this.getFullWidth(firstChip) + 4) + 'px';\n } else {\n input.style.minWidth = '';\n }\n },\n\n checkMaxSelected () {\n if (this.maxSelected === 0) return;\n if (this.selectedItems.length > this.maxSelected) {\n this.showValidationMessages = true;\n this.$emit('max-selected');\n } else {\n this.showValidationMessages = false;\n }\n },\n },\n};\n</script>\n\n<style scoped lang=\"less\">\n.combobox__input-wrapper {\n position: relative;\n display: block;\n}\n\n.combobox__chip-wrapper {\n position: absolute;\n margin-left: var(--dt-space-200);\n margin-right: var(--dt-space-200);\n padding-left: var(--dt-space-100);\n max-width: calc(var(--dt-size-100-percent) - var(--dt-space-400));\n}\n\n.combobox__chip {\n margin-top: var(--dt-space-300);\n margin-left: var(--dt-space-200);\n margin-right: var(--dt-space-200);\n z-index: var(--zi-base1);\n max-width: var(--dt-size-100-percent);\n}\n\n.combobox__input {\n flex-grow: 1;\n}\n\n.combobox__list--loading {\n text-align: center;\n padding-top: var(--dt-space-500);\n padding-bottom: var(--dt-space-500);\n}\n</style>\n"],"names":["DtRecipeComboboxWithPopover","DtInput","DtChip","DtValidationMessages","SrOnlyCloseButtonMixin","validationMessageValidator","POPOVER_APPEND_TO_VALUES"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAY,MAAC,qBAAqB;AAAA;AAAA,EAEhC,aAAa;AAAA,EACb,OAAO;AAAA,EACP,SAAS;AACX;AAEY,MAAC,aAAa;AAAA,EACxB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEY,MAAC,oBAAoB;AAAA,EAC/B,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;ACsGA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,6BAAAA,wBAAA;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