@dialpad/dialtone-vue 3.224.0-next.1 → 3.224.0-next.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 (380) hide show
  1. package/dist/{RichTextEditor-CQ94k5Ld.cjs → RichTextEditor-DQMPmLEs.cjs} +2 -2
  2. package/dist/{RichTextEditor-CQ94k5Ld.cjs.map → RichTextEditor-DQMPmLEs.cjs.map} +1 -1
  3. package/dist/{RichTextEditor-DAU69vIK.js → RichTextEditor-jmf39No_.js} +7 -7
  4. package/dist/{RichTextEditor-DAU69vIK.js.map → RichTextEditor-jmf39No_.js.map} +1 -1
  5. package/dist/component-documentation.json +1 -1
  6. package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +1 -1
  7. package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +1 -1
  8. package/dist/components/ComboboxMultiSelect/index.d.ts +1 -1
  9. package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts.map +1 -1
  10. package/dist/components/ComboboxWithPopover/index.d.ts +1 -1
  11. package/dist/components/MotionText/index.d.ts +1 -1
  12. package/dist/dialtone-vue.cjs +1 -1
  13. package/dist/dialtone-vue.css +1 -1
  14. package/dist/dialtone-vue.js +153 -193
  15. package/dist/index.d.ts +0 -21
  16. package/dist/lib/breadcrumbs/breadcrumb-item.cjs +1 -1
  17. package/dist/lib/breadcrumbs/breadcrumb-item.cjs.map +1 -1
  18. package/dist/lib/breadcrumbs/breadcrumb-item.js +3 -3
  19. package/dist/lib/breadcrumbs/breadcrumb-item.js.map +1 -1
  20. package/dist/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
  21. package/dist/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
  22. package/dist/lib/combobox-multi-select/combobox-multi-select.js +10 -10
  23. package/dist/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
  24. package/dist/lib/combobox-multi-select/index.cjs +1 -1
  25. package/dist/lib/combobox-multi-select/index.js +1 -1
  26. package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
  27. package/dist/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
  28. package/dist/lib/combobox-with-popover/combobox-with-popover.js +1 -1
  29. package/dist/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
  30. package/dist/lib/combobox-with-popover/index.cjs +1 -1
  31. package/dist/lib/combobox-with-popover/index.js +1 -1
  32. package/dist/lib/motion-text/index.cjs +1 -1
  33. package/dist/lib/motion-text/index.js +1 -1
  34. package/dist/lib/rich-text-editor/index.cjs +1 -1
  35. package/dist/lib/rich-text-editor/index.js +1 -1
  36. package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
  37. package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
  38. package/package.json +3 -3
  39. package/dist/attachment_carousel-CyiexPBk.js +0 -191
  40. package/dist/attachment_carousel-CyiexPBk.js.map +0 -1
  41. package/dist/attachment_carousel-DJqILY7f.cjs +0 -2
  42. package/dist/attachment_carousel-DJqILY7f.cjs.map +0 -1
  43. package/dist/lib/attachment-carousel/attachment-carousel.cjs +0 -1
  44. package/dist/lib/attachment-carousel/attachment-carousel.js +0 -2
  45. package/dist/lib/attachment-carousel/index.cjs +0 -1
  46. package/dist/lib/attachment-carousel/index.js +0 -2
  47. package/dist/lib/callbar-button/callbar-button-constants.cjs +0 -2
  48. package/dist/lib/callbar-button/callbar-button-constants.cjs.map +0 -1
  49. package/dist/lib/callbar-button/callbar-button-constants.js +0 -11
  50. package/dist/lib/callbar-button/callbar-button-constants.js.map +0 -1
  51. package/dist/lib/callbar-button/callbar-button.cjs +0 -2
  52. package/dist/lib/callbar-button/callbar-button.cjs.map +0 -1
  53. package/dist/lib/callbar-button/callbar-button.js +0 -168
  54. package/dist/lib/callbar-button/callbar-button.js.map +0 -1
  55. package/dist/lib/callbar-button/index.cjs +0 -1
  56. package/dist/lib/callbar-button/index.js +0 -3
  57. package/dist/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +0 -2
  58. package/dist/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs.map +0 -1
  59. package/dist/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +0 -233
  60. package/dist/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +0 -1
  61. package/dist/lib/callbar-button-with-dropdown/index.cjs +0 -1
  62. package/dist/lib/callbar-button-with-dropdown/index.js +0 -2
  63. package/dist/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +0 -2
  64. package/dist/lib/callbar-button-with-popover/callbar-button-with-popover.cjs.map +0 -1
  65. package/dist/lib/callbar-button-with-popover/callbar-button-with-popover.js +0 -269
  66. package/dist/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +0 -1
  67. package/dist/lib/callbar-button-with-popover/index.cjs +0 -1
  68. package/dist/lib/callbar-button-with-popover/index.js +0 -2
  69. package/dist/lib/callbox/callbox-constants.cjs +0 -2
  70. package/dist/lib/callbox/callbox-constants.cjs.map +0 -1
  71. package/dist/lib/callbox/callbox-constants.js +0 -13
  72. package/dist/lib/callbox/callbox-constants.js.map +0 -1
  73. package/dist/lib/callbox/callbox.cjs +0 -2
  74. package/dist/lib/callbox/callbox.cjs.map +0 -1
  75. package/dist/lib/callbox/callbox.js +0 -151
  76. package/dist/lib/callbox/callbox.js.map +0 -1
  77. package/dist/lib/callbox/index.cjs +0 -1
  78. package/dist/lib/callbox/index.js +0 -3
  79. package/dist/lib/contact-centers-row/contact-centers-row.cjs +0 -2
  80. package/dist/lib/contact-centers-row/contact-centers-row.cjs.map +0 -1
  81. package/dist/lib/contact-centers-row/contact-centers-row.js +0 -163
  82. package/dist/lib/contact-centers-row/contact-centers-row.js.map +0 -1
  83. package/dist/lib/contact-centers-row/index.cjs +0 -1
  84. package/dist/lib/contact-centers-row/index.js +0 -2
  85. package/dist/lib/contact-info/contact-info.cjs +0 -2
  86. package/dist/lib/contact-info/contact-info.cjs.map +0 -1
  87. package/dist/lib/contact-info/contact-info.js +0 -157
  88. package/dist/lib/contact-info/contact-info.js.map +0 -1
  89. package/dist/lib/contact-info/index.cjs +0 -1
  90. package/dist/lib/contact-info/index.js +0 -2
  91. package/dist/lib/contact-row/contact-row.cjs +0 -2
  92. package/dist/lib/contact-row/contact-row.cjs.map +0 -1
  93. package/dist/lib/contact-row/contact-row.js +0 -164
  94. package/dist/lib/contact-row/contact-row.js.map +0 -1
  95. package/dist/lib/contact-row/index.cjs +0 -1
  96. package/dist/lib/contact-row/index.js +0 -2
  97. package/dist/lib/editor/editor-constants.cjs +0 -2
  98. package/dist/lib/editor/editor-constants.cjs.map +0 -1
  99. package/dist/lib/editor/editor-constants.js +0 -17
  100. package/dist/lib/editor/editor-constants.js.map +0 -1
  101. package/dist/lib/editor/editor-toolbar-button.cjs +0 -2
  102. package/dist/lib/editor/editor-toolbar-button.cjs.map +0 -1
  103. package/dist/lib/editor/editor-toolbar-button.js +0 -73
  104. package/dist/lib/editor/editor-toolbar-button.js.map +0 -1
  105. package/dist/lib/editor/editor-toolbar-dropdown-button.cjs +0 -2
  106. package/dist/lib/editor/editor-toolbar-dropdown-button.cjs.map +0 -1
  107. package/dist/lib/editor/editor-toolbar-dropdown-button.js +0 -87
  108. package/dist/lib/editor/editor-toolbar-dropdown-button.js.map +0 -1
  109. package/dist/lib/editor/editor-toolbar-popover-button.cjs +0 -2
  110. package/dist/lib/editor/editor-toolbar-popover-button.cjs.map +0 -1
  111. package/dist/lib/editor/editor-toolbar-popover-button.js +0 -88
  112. package/dist/lib/editor/editor-toolbar-popover-button.js.map +0 -1
  113. package/dist/lib/editor/editor.cjs +0 -2
  114. package/dist/lib/editor/editor.cjs.map +0 -1
  115. package/dist/lib/editor/editor.js +0 -1098
  116. package/dist/lib/editor/editor.js.map +0 -1
  117. package/dist/lib/editor/index.cjs +0 -1
  118. package/dist/lib/editor/index.js +0 -2
  119. package/dist/lib/emoji-row/emoji-row-constants.cjs +0 -2
  120. package/dist/lib/emoji-row/emoji-row-constants.cjs.map +0 -1
  121. package/dist/lib/emoji-row/emoji-row-constants.js +0 -11
  122. package/dist/lib/emoji-row/emoji-row-constants.js.map +0 -1
  123. package/dist/lib/emoji-row/emoji-row.cjs +0 -2
  124. package/dist/lib/emoji-row/emoji-row.cjs.map +0 -1
  125. package/dist/lib/emoji-row/emoji-row.js +0 -99
  126. package/dist/lib/emoji-row/emoji-row.js.map +0 -1
  127. package/dist/lib/emoji-row/index.cjs +0 -1
  128. package/dist/lib/emoji-row/index.js +0 -3
  129. package/dist/lib/feed-item-pill/feed-item-pill-constants.cjs +0 -2
  130. package/dist/lib/feed-item-pill/feed-item-pill-constants.cjs.map +0 -1
  131. package/dist/lib/feed-item-pill/feed-item-pill-constants.js +0 -10
  132. package/dist/lib/feed-item-pill/feed-item-pill-constants.js.map +0 -1
  133. package/dist/lib/feed-item-pill/feed-item-pill.cjs +0 -2
  134. package/dist/lib/feed-item-pill/feed-item-pill.cjs.map +0 -1
  135. package/dist/lib/feed-item-pill/feed-item-pill.js +0 -142
  136. package/dist/lib/feed-item-pill/feed-item-pill.js.map +0 -1
  137. package/dist/lib/feed-item-pill/index.cjs +0 -1
  138. package/dist/lib/feed-item-pill/index.js +0 -3
  139. package/dist/lib/feed-item-row/feed-item-row-constants.cjs +0 -2
  140. package/dist/lib/feed-item-row/feed-item-row-constants.cjs.map +0 -1
  141. package/dist/lib/feed-item-row/feed-item-row-constants.js +0 -13
  142. package/dist/lib/feed-item-row/feed-item-row-constants.js.map +0 -1
  143. package/dist/lib/feed-item-row/feed-item-row.cjs +0 -2
  144. package/dist/lib/feed-item-row/feed-item-row.cjs.map +0 -1
  145. package/dist/lib/feed-item-row/feed-item-row.js +0 -205
  146. package/dist/lib/feed-item-row/feed-item-row.js.map +0 -1
  147. package/dist/lib/feed-item-row/index.cjs +0 -1
  148. package/dist/lib/feed-item-row/index.js +0 -3
  149. package/dist/lib/general-row/general-row-constants.cjs +0 -2
  150. package/dist/lib/general-row/general-row-constants.cjs.map +0 -1
  151. package/dist/lib/general-row/general-row-constants.js +0 -38
  152. package/dist/lib/general-row/general-row-constants.js.map +0 -1
  153. package/dist/lib/general-row/general-row.cjs +0 -2
  154. package/dist/lib/general-row/general-row.cjs.map +0 -1
  155. package/dist/lib/general-row/general-row.js +0 -362
  156. package/dist/lib/general-row/general-row.js.map +0 -1
  157. package/dist/lib/general-row/index.cjs +0 -1
  158. package/dist/lib/general-row/index.js +0 -4
  159. package/dist/lib/general-row/leftbar-general-row-icon.cjs +0 -2
  160. package/dist/lib/general-row/leftbar-general-row-icon.cjs.map +0 -1
  161. package/dist/lib/general-row/leftbar-general-row-icon.js +0 -91
  162. package/dist/lib/general-row/leftbar-general-row-icon.js.map +0 -1
  163. package/dist/lib/group-row/group-row.cjs +0 -2
  164. package/dist/lib/group-row/group-row.cjs.map +0 -1
  165. package/dist/lib/group-row/group-row.js +0 -103
  166. package/dist/lib/group-row/group-row.js.map +0 -1
  167. package/dist/lib/group-row/index.cjs +0 -1
  168. package/dist/lib/group-row/index.js +0 -2
  169. package/dist/lib/grouped-chip/grouped-chip.cjs +0 -2
  170. package/dist/lib/grouped-chip/grouped-chip.cjs.map +0 -1
  171. package/dist/lib/grouped-chip/grouped-chip.js +0 -60
  172. package/dist/lib/grouped-chip/grouped-chip.js.map +0 -1
  173. package/dist/lib/grouped-chip/index.cjs +0 -1
  174. package/dist/lib/grouped-chip/index.js +0 -2
  175. package/dist/lib/ivr-node/index.cjs +0 -1
  176. package/dist/lib/ivr-node/index.js +0 -3
  177. package/dist/lib/ivr-node/ivr-node-constants.cjs +0 -2
  178. package/dist/lib/ivr-node/ivr-node-constants.cjs.map +0 -1
  179. package/dist/lib/ivr-node/ivr-node-constants.js +0 -52
  180. package/dist/lib/ivr-node/ivr-node-constants.js.map +0 -1
  181. package/dist/lib/ivr-node/ivr-node.cjs +0 -2
  182. package/dist/lib/ivr-node/ivr-node.cjs.map +0 -1
  183. package/dist/lib/ivr-node/ivr-node.js +0 -152
  184. package/dist/lib/ivr-node/ivr-node.js.map +0 -1
  185. package/dist/lib/message-input/index.cjs +0 -1
  186. package/dist/lib/message-input/index.js +0 -2
  187. package/dist/lib/message-input/last-active-nodes.cjs +0 -2
  188. package/dist/lib/message-input/last-active-nodes.cjs.map +0 -1
  189. package/dist/lib/message-input/last-active-nodes.js +0 -33
  190. package/dist/lib/message-input/last-active-nodes.js.map +0 -1
  191. package/dist/lib/message-input/message-input-button.cjs +0 -2
  192. package/dist/lib/message-input/message-input-button.cjs.map +0 -1
  193. package/dist/lib/message-input/message-input-button.js +0 -75
  194. package/dist/lib/message-input/message-input-button.js.map +0 -1
  195. package/dist/lib/message-input/message-input-constants.cjs +0 -2
  196. package/dist/lib/message-input/message-input-constants.cjs.map +0 -1
  197. package/dist/lib/message-input/message-input-constants.js +0 -6
  198. package/dist/lib/message-input/message-input-constants.js.map +0 -1
  199. package/dist/lib/message-input/message-input-link.cjs +0 -2
  200. package/dist/lib/message-input/message-input-link.cjs.map +0 -1
  201. package/dist/lib/message-input/message-input-link.js +0 -202
  202. package/dist/lib/message-input/message-input-link.js.map +0 -1
  203. package/dist/lib/message-input/message-input-topbar.cjs +0 -2
  204. package/dist/lib/message-input/message-input-topbar.cjs.map +0 -1
  205. package/dist/lib/message-input/message-input-topbar.js +0 -265
  206. package/dist/lib/message-input/message-input-topbar.js.map +0 -1
  207. package/dist/lib/message-input/message-input.cjs +0 -1
  208. package/dist/lib/message-input/message-input.js +0 -2
  209. package/dist/lib/recipes/eslint.config.cjs +0 -2
  210. package/dist/lib/recipes/eslint.config.cjs.map +0 -1
  211. package/dist/lib/recipes/eslint.config.js +0 -9
  212. package/dist/lib/recipes/eslint.config.js.map +0 -1
  213. package/dist/lib/settings-menu-button/index.cjs +0 -1
  214. package/dist/lib/settings-menu-button/index.js +0 -2
  215. package/dist/lib/settings-menu-button/settings-menu-button.cjs +0 -2
  216. package/dist/lib/settings-menu-button/settings-menu-button.cjs.map +0 -1
  217. package/dist/lib/settings-menu-button/settings-menu-button.js +0 -53
  218. package/dist/lib/settings-menu-button/settings-menu-button.js.map +0 -1
  219. package/dist/lib/time-pill/index.cjs +0 -1
  220. package/dist/lib/time-pill/index.js +0 -2
  221. package/dist/lib/time-pill/time-pill.cjs +0 -2
  222. package/dist/lib/time-pill/time-pill.cjs.map +0 -1
  223. package/dist/lib/time-pill/time-pill.js +0 -33
  224. package/dist/lib/time-pill/time-pill.js.map +0 -1
  225. package/dist/lib/top-banner-info/index.cjs +0 -1
  226. package/dist/lib/top-banner-info/index.js +0 -3
  227. package/dist/lib/top-banner-info/top-banner-info-constants.cjs +0 -2
  228. package/dist/lib/top-banner-info/top-banner-info-constants.cjs.map +0 -1
  229. package/dist/lib/top-banner-info/top-banner-info-constants.js +0 -15
  230. package/dist/lib/top-banner-info/top-banner-info-constants.js.map +0 -1
  231. package/dist/lib/top-banner-info/top-banner-info.cjs +0 -2
  232. package/dist/lib/top-banner-info/top-banner-info.cjs.map +0 -1
  233. package/dist/lib/top-banner-info/top-banner-info.js +0 -45
  234. package/dist/lib/top-banner-info/top-banner-info.js.map +0 -1
  235. package/dist/lib/unread-pill/index.cjs +0 -1
  236. package/dist/lib/unread-pill/index.js +0 -3
  237. package/dist/lib/unread-pill/unread-pill-constants.cjs +0 -2
  238. package/dist/lib/unread-pill/unread-pill-constants.cjs.map +0 -1
  239. package/dist/lib/unread-pill/unread-pill-constants.js +0 -9
  240. package/dist/lib/unread-pill/unread-pill-constants.js.map +0 -1
  241. package/dist/lib/unread-pill/unread-pill.cjs +0 -2
  242. package/dist/lib/unread-pill/unread-pill.cjs.map +0 -1
  243. package/dist/lib/unread-pill/unread-pill.js +0 -57
  244. package/dist/lib/unread-pill/unread-pill.js.map +0 -1
  245. package/dist/message_input-BM3SLo78.js +0 -667
  246. package/dist/message_input-BM3SLo78.js.map +0 -1
  247. package/dist/message_input-DwVLrXDB.cjs +0 -2
  248. package/dist/message_input-DwVLrXDB.cjs.map +0 -1
  249. package/dist/recipes/buttons/callbar_button/callbar_button.vue.d.ts +0 -825
  250. package/dist/recipes/buttons/callbar_button/callbar_button.vue.d.ts.map +0 -1
  251. package/dist/recipes/buttons/callbar_button/callbar_button_constants.d.ts +0 -6
  252. package/dist/recipes/buttons/callbar_button/callbar_button_constants.d.ts.map +0 -1
  253. package/dist/recipes/buttons/callbar_button/index.d.ts +0 -3
  254. package/dist/recipes/buttons/callbar_button/index.d.ts.map +0 -1
  255. package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +0 -3052
  256. package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +0 -1
  257. package/dist/recipes/buttons/callbar_button_with_dropdown/index.d.ts +0 -2
  258. package/dist/recipes/buttons/callbar_button_with_dropdown/index.d.ts.map +0 -1
  259. package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +0 -2795
  260. package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +0 -1
  261. package/dist/recipes/buttons/callbar_button_with_popover/index.d.ts +0 -2
  262. package/dist/recipes/buttons/callbar_button_with_popover/index.d.ts.map +0 -1
  263. package/dist/recipes/cards/ivr_node/index.d.ts +0 -3
  264. package/dist/recipes/cards/ivr_node/index.d.ts.map +0 -1
  265. package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts +0 -2484
  266. package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +0 -1
  267. package/dist/recipes/cards/ivr_node/ivr_node_constants.d.ts +0 -86
  268. package/dist/recipes/cards/ivr_node/ivr_node_constants.d.ts.map +0 -1
  269. package/dist/recipes/chips/grouped_chip/grouped_chip.vue.d.ts +0 -516
  270. package/dist/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +0 -1
  271. package/dist/recipes/chips/grouped_chip/index.d.ts +0 -2
  272. package/dist/recipes/chips/grouped_chip/index.d.ts.map +0 -1
  273. package/dist/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +0 -1826
  274. package/dist/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +0 -1
  275. package/dist/recipes/conversation_view/attachment_carousel/index.d.ts +0 -2
  276. package/dist/recipes/conversation_view/attachment_carousel/index.d.ts.map +0 -1
  277. package/dist/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +0 -1381
  278. package/dist/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +0 -1
  279. package/dist/recipes/conversation_view/editor/EditorToolbarButton.vue.d.ts +0 -431
  280. package/dist/recipes/conversation_view/editor/EditorToolbarButton.vue.d.ts.map +0 -1
  281. package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts +0 -2092
  282. package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts.map +0 -1
  283. package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts +0 -1798
  284. package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts.map +0 -1
  285. package/dist/recipes/conversation_view/editor/editor.vue.d.ts +0 -10388
  286. package/dist/recipes/conversation_view/editor/editor.vue.d.ts.map +0 -1
  287. package/dist/recipes/conversation_view/editor/editor_constants.d.ts +0 -10
  288. package/dist/recipes/conversation_view/editor/editor_constants.d.ts.map +0 -1
  289. package/dist/recipes/conversation_view/editor/index.d.ts +0 -2
  290. package/dist/recipes/conversation_view/editor/index.d.ts.map +0 -1
  291. package/dist/recipes/conversation_view/emoji_row/composables/useMockReactions.d.ts +0 -2
  292. package/dist/recipes/conversation_view/emoji_row/composables/useMockReactions.d.ts.map +0 -1
  293. package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +0 -2477
  294. package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +0 -1
  295. package/dist/recipes/conversation_view/emoji_row/emoji_row_constants.d.ts +0 -6
  296. package/dist/recipes/conversation_view/emoji_row/emoji_row_constants.d.ts.map +0 -1
  297. package/dist/recipes/conversation_view/emoji_row/index.d.ts +0 -3
  298. package/dist/recipes/conversation_view/emoji_row/index.d.ts.map +0 -1
  299. package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +0 -795
  300. package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +0 -1
  301. package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill_constants.d.ts +0 -11
  302. package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill_constants.d.ts.map +0 -1
  303. package/dist/recipes/conversation_view/feed_item_pill/index.d.ts +0 -3
  304. package/dist/recipes/conversation_view/feed_item_pill/index.d.ts.map +0 -1
  305. package/dist/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +0 -909
  306. package/dist/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +0 -1
  307. package/dist/recipes/conversation_view/feed_item_row/feed_item_row_constants.d.ts +0 -12
  308. package/dist/recipes/conversation_view/feed_item_row/feed_item_row_constants.d.ts.map +0 -1
  309. package/dist/recipes/conversation_view/feed_item_row/index.d.ts +0 -3
  310. package/dist/recipes/conversation_view/feed_item_row/index.d.ts.map +0 -1
  311. package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +0 -655
  312. package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +0 -1
  313. package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/meeting_pill.d.ts +0 -4
  314. package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/meeting_pill.d.ts.map +0 -1
  315. package/dist/recipes/conversation_view/message_input/index.d.ts +0 -2
  316. package/dist/recipes/conversation_view/message_input/index.d.ts.map +0 -1
  317. package/dist/recipes/conversation_view/message_input/last_active_nodes.d.ts +0 -3
  318. package/dist/recipes/conversation_view/message_input/last_active_nodes.d.ts.map +0 -1
  319. package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts +0 -10002
  320. package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts.map +0 -1
  321. package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts +0 -1484
  322. package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +0 -1
  323. package/dist/recipes/conversation_view/message_input/message_input_constants.d.ts +0 -6
  324. package/dist/recipes/conversation_view/message_input/message_input_constants.d.ts.map +0 -1
  325. package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts +0 -4004
  326. package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +0 -1
  327. package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +0 -1891
  328. package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +0 -1
  329. package/dist/recipes/conversation_view/time_pill/index.d.ts +0 -2
  330. package/dist/recipes/conversation_view/time_pill/index.d.ts.map +0 -1
  331. package/dist/recipes/conversation_view/time_pill/time_pill.vue.d.ts +0 -23
  332. package/dist/recipes/conversation_view/time_pill/time_pill.vue.d.ts.map +0 -1
  333. package/dist/recipes/eslint.config.d.ts +0 -8
  334. package/dist/recipes/eslint.config.d.ts.map +0 -1
  335. package/dist/recipes/header/settings_menu_button/index.d.ts +0 -2
  336. package/dist/recipes/header/settings_menu_button/index.d.ts.map +0 -1
  337. package/dist/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts +0 -415
  338. package/dist/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts.map +0 -1
  339. package/dist/recipes/item_layout/contact_info/contact_info.vue.d.ts +0 -539
  340. package/dist/recipes/item_layout/contact_info/contact_info.vue.d.ts.map +0 -1
  341. package/dist/recipes/item_layout/contact_info/index.d.ts +0 -2
  342. package/dist/recipes/item_layout/contact_info/index.d.ts.map +0 -1
  343. package/dist/recipes/leftbar/callbox/callbox.vue.d.ts +0 -597
  344. package/dist/recipes/leftbar/callbox/callbox.vue.d.ts.map +0 -1
  345. package/dist/recipes/leftbar/callbox/callbox_constants.d.ts +0 -15
  346. package/dist/recipes/leftbar/callbox/callbox_constants.d.ts.map +0 -1
  347. package/dist/recipes/leftbar/callbox/index.d.ts +0 -3
  348. package/dist/recipes/leftbar/callbox/index.d.ts.map +0 -1
  349. package/dist/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +0 -1548
  350. package/dist/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +0 -1
  351. package/dist/recipes/leftbar/contact_centers_row/index.d.ts +0 -2
  352. package/dist/recipes/leftbar/contact_centers_row/index.d.ts.map +0 -1
  353. package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts +0 -4258
  354. package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +0 -1
  355. package/dist/recipes/leftbar/contact_row/index.d.ts +0 -2
  356. package/dist/recipes/leftbar/contact_row/index.d.ts.map +0 -1
  357. package/dist/recipes/leftbar/general_row/general_row.vue.d.ts +0 -2867
  358. package/dist/recipes/leftbar/general_row/general_row.vue.d.ts.map +0 -1
  359. package/dist/recipes/leftbar/general_row/general_row_constants.d.ts +0 -39
  360. package/dist/recipes/leftbar/general_row/general_row_constants.d.ts.map +0 -1
  361. package/dist/recipes/leftbar/general_row/index.d.ts +0 -4
  362. package/dist/recipes/leftbar/general_row/index.d.ts.map +0 -1
  363. package/dist/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +0 -519
  364. package/dist/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts.map +0 -1
  365. package/dist/recipes/leftbar/group_row/group_row.vue.d.ts +0 -2964
  366. package/dist/recipes/leftbar/group_row/group_row.vue.d.ts.map +0 -1
  367. package/dist/recipes/leftbar/group_row/index.d.ts +0 -2
  368. package/dist/recipes/leftbar/group_row/index.d.ts.map +0 -1
  369. package/dist/recipes/leftbar/unread_pill/index.d.ts +0 -3
  370. package/dist/recipes/leftbar/unread_pill/index.d.ts.map +0 -1
  371. package/dist/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +0 -95
  372. package/dist/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +0 -1
  373. package/dist/recipes/leftbar/unread_pill/unread_pill_constants.d.ts +0 -8
  374. package/dist/recipes/leftbar/unread_pill/unread_pill_constants.d.ts.map +0 -1
  375. package/dist/recipes/notices/top_banner_info/index.d.ts +0 -3
  376. package/dist/recipes/notices/top_banner_info/index.d.ts.map +0 -1
  377. package/dist/recipes/notices/top_banner_info/top_banner_info.vue.d.ts +0 -19
  378. package/dist/recipes/notices/top_banner_info/top_banner_info.vue.d.ts.map +0 -1
  379. package/dist/recipes/notices/top_banner_info/top_banner_info_constants.d.ts +0 -6
  380. package/dist/recipes/notices/top_banner_info/top_banner_info_constants.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/sizes.cjs`),t=require(`../../common/constants/index.cjs`),n=require(`../../common/validators/index.cjs`),r=require(`../../common/utils/index.cjs`),i=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),a=require(`../validation-messages/validation-messages.cjs`),o=require(`../chip/chip.cjs`),s=require(`../popover/popover-constants.cjs`),c=require(`../input/input.cjs`),l=require(`../combobox-with-popover/combobox-with-popover.cjs`),u=require(`./combobox-multi-select-constants.cjs`);let d=require(`vue`);var f={name:`DtComboboxMultiSelect`,components:{DtComboboxWithPopover:l.default,DtInput:c.default,DtChip:o.default,DtValidationMessages:a.default},inheritAttrs:!1,props:{label:{type:String,required:!0},showLabel:{type:Boolean,default:!0},description:{type:String,default:``},placeholder:{type:String,default:`Select one or start typing`},inputMessages:{type:Array,default:()=>[],validator:e=>n.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,Number],default:300,validator:n.ordinalSizeValidator(u.CHIP_SIZES)},appendTo:{type:[t.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>s.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},transition:{type:String,default:`fade`},collapseOnFocusOut:{type:Boolean,default:!1},listMaxWidth:{type:String,default:``},reservedRightSpace:{type:Number,default:64},chipMaxWidth:{type:String,default:``},inputClass:{type:[String,Object,Array],default:``},inputWrapperClass:{type:[String,Object,Array],default:``},disabled:{type:Boolean,default:!1},headerClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},listClass:{type:[String,Array,Object],default:``},dialogClass:{type:[String,Object,Array],default:``}},emits:[`update:modelValue`,`select`,`remove`,`max-selected`,`keydown`,`chip-keydown`,`escape`,`enter`,`combobox-highlight`],data(){return{value:``,popoverOffset:[0,4],showValidationMessages:!1,resizeWindowObserver:null,initialInputHeight:null,CHIP_SIZES:u.CHIP_SIZES,hasSlotContent:r.hasSlotContent,inputFocused:!1,hideInputText:!1,messagesId:r.getUniqueString()}},computed:{inputPlaceHolder(){return this.selectedItems?.length>0?``:this.placeholder},chipListeners(){return{keydown:e=>{this.disabled||(this.onChipKeyDown(e),this.$emit(`chip-keydown`,e))}}},inputListeners(){return{...r.extractVueListeners(this.$attrs),onInput:e=>{this.$emit(`update:modelValue`,e),this.hasSuggestionList&&this.showComboboxList()},onKeydown:e=>{if(this.disabled)return;this.onInputKeyDown(e),this.$emit(`keydown`,e);let t=e.key?.toLowerCase();t===`escape`?this.$emit(`escape`,e):t===`enter`&&this.$emit(`enter`,e)},onClick:()=>{this.hasSuggestionList&&this.showComboboxList()}}},ariaInvalid(){return r.getValidationState(this.maxSelectedMessage)===t.VALIDATION_MESSAGE_TYPES.CRITICAL?`true`:void 0},ariaDescribedBy(){return this.showValidationMessages&&this.maxSelectedMessage.length>0?this.messagesId:void 0},chipWrapperClass(){return{[`d-recipe-combobox-multi-select__chip-wrapper-${e.COMPONENT_SIZES[String(this.size)]||this.size}--collapsed`]:!this.inputFocused&&this.collapseOnFocusOut}}},watch:{selectedItems:{deep:!0,handler:async function(){await this.initSelectedItems()}},chipMaxWidth:{async handler(){await this.initSelectedItems()}},async label(){await this.$nextTick(),this.setChipsTopPosition()},async description(){await this.$nextTick(),this.setChipsTopPosition()},size:{async handler(){await this.$nextTick();let e=this.getInput();this.revertInputPadding(e),this.setInitialInputHeight(),this.setInputPadding(),this.setChipsTopPosition()}}},async mounted(){this.setInitialInputHeight(),this.resizeWindowObserver=new ResizeObserver(async()=>{this.setChipsTopPosition(),this.setInputPadding()}),this.resizeWindowObserver.observe(document.body),await this.initSelectedItems()},beforeUnmount(){this.resizeWindowObserver?.unobserve(document.body)},methods:{extractNonListeners:r.extractNonListeners,comboboxHighlight(e){this.$emit(`combobox-highlight`,e)},async initSelectedItems(){await this.$nextTick(),this.setInputPadding(),this.setChipsTopPosition(),this.setInputMinWidth(),this.checkMaxSelected()},onChipRemove(e){this.$emit(`remove`,e),this.$refs.input?.focus()},onComboboxSelect(e){this.loading||(this.value=``,this.$emit(`select`,e))},showComboboxList(){this.showList??this.$refs.comboboxWithPopover?.showComboboxList()},closeComboboxList(){this.showList??this.$refs.comboboxWithPopover?.closeComboboxList()},getChips(){if(!this.selectedItems.length||!this.$refs.chips)return null;let e=new Set;return this.selectedItems.map(t=>this.$refs.chips.find((n,i)=>e.has(i)?!1:r.returnFirstEl(n.$el)?.querySelector(`.d-chip__label`)?.textContent?.trim()===t?(e.add(i),!0):!1)).filter(Boolean).map(e=>r.returnFirstEl(e.$el))},getChipButtons(){let e=this.getChips();return e&&e.map(e=>r.returnFirstEl(e).querySelector(`button`))},getLastChipButton(){let e=this.getChipButtons();return e&&e[e.length-1]},getLastChip(){let e=this.getChips();return e&&e[e.length-1]},getFirstChip(){let e=this.getChips();return e&&e[0]},getInput(){return this.$refs.input?.$refs.input},onChipKeyDown(e){let t=e.code?.toLowerCase();t===`arrowleft`?this.navigateBetweenChips(e.target,!0):t===`arrowright`&&(e.target.id===this.getLastChipButton().id?this.moveFromChipToInput():this.navigateBetweenChips(e.target,!1))},onInputKeyDown(e){let t=e.key?.toLowerCase();if(this.selectedItems.length>0&&e.target.selectionStart===0){if(e.target.selectionEnd!==e.target.selectionStart)return;(t===`backspace`||t===`arrowleft`)&&this.moveFromInputToChip()}},moveFromInputToChip(){this.getLastChipButton().focus(),this.$refs.input?.blur(),this.closeComboboxList()},moveFromChipToInput(){this.getLastChipButton().blur(),this.$refs.input?.focus(),this.showComboboxList()},navigateBetweenChips(e,t){let n=this.getChipButtons().indexOf(e),r=t?n-1:n+1;r<0||r>=this.$refs.chips?.length||(this.getChipButtons()[n].blur(),this.getChipButtons()[r].focus(),this.closeComboboxList())},setChipsTopPosition(){let e=this.getInput();if(!e)return;let t=this.$refs.inputSlotWrapper,n=e.getBoundingClientRect().top-t.getBoundingClientRect().top,r=this.$refs.chipsWrapper;r.style.top=n-u.CHIP_TOP_POSITION[String(this.size)]+`px`},setInputPadding(){let e=this.getLastChip(),t=this.getInput();if(!t||(this.revertInputPadding(t),this.popoverOffset=[0,4],!e)||this.collapseOnFocusOut&&!this.inputFocused)return;let n=e.offsetLeft+this.getFullWidth(e),r=t.getBoundingClientRect().width-n,i=this.getFirstChip(),a=i&&e.offsetTop>i.offsetTop;r>this.reservedRightSpace?t.style.paddingInlineStart=n+`px`:t.style.paddingInlineStart=`4px`;let o=this.getInputPaddingTop(e,r>this.reservedRightSpace,a);o!=null&&(t.style.paddingTop=`${o}px`)},getInputPaddingTop(e,t,n){if(t&&!n)return null;if(t)return e.offsetTop+2;let r=parseFloat(getComputedStyle(e).marginTop)||0,i=e.getBoundingClientRect().height;return e.offsetTop+i+r+2},revertInputPadding(e){e.style.paddingInlineStart=``,e.style.paddingBlockStart=``,e.style.paddingBlockEnd=``},getFullWidth(e){let t=window.getComputedStyle(e);return e.offsetWidth+parseInt(t.marginLeft)+parseInt(t.marginRight)},setInputMinWidth(){let 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)},setInitialInputHeight(){let e=this.getInput();e&&(e.style.minHeight=``,e.style.height=``,this.initialInputHeight=e.getBoundingClientRect().height,this.size!==`xs`&&(e.style.minHeight=`${this.initialInputHeight}px`,e.style.height=`auto`))},async handleInputFocusIn(){this.inputFocused=!0,this.collapseOnFocusOut&&(this.hideInputText=!1,await this.$nextTick(),this.setInputPadding())},async handleInputFocusOut(){if(this.inputFocused=!1,this.collapseOnFocusOut){this.hideInputText=!0;let e=this.getInput();if(!e||!e.style.paddingTop)return;this.revertInputPadding(e)}}}},p={key:1,class:`d-recipe-combobox-multi-select__list--loading`};function m(e,t,n,r,i,a){let o=(0,d.resolveComponent)(`dt-chip`),s=(0,d.resolveComponent)(`dt-input`),c=(0,d.resolveComponent)(`dt-validation-messages`),l=(0,d.resolveComponent)(`dt-combobox-with-popover`);return(0,d.openBlock)(),(0,d.createBlock)(l,(0,d.mergeProps)({ref:`comboboxWithPopover`,label:n.label,"show-list":n.showList,"max-height":n.listMaxHeight,"max-width":n.listMaxWidth,"popover-offset":i.popoverOffset,"has-suggestion-list":n.hasSuggestionList,"content-width":`anchor`,"append-to":n.appendTo,"dialog-class":n.dialogClass,transition:n.transition},a.extractNonListeners(e.$attrs),{onSelect:a.onComboboxSelect,onHighlight:a.comboboxHighlight}),(0,d.createSlots)({input:(0,d.withCtx)(({onInput:e})=>[(0,d.createElementVNode)(`span`,{ref:`inputSlotWrapper`,class:`d-recipe-combobox-multi-select__input-wrapper`,onFocusin:t[1]||(t[1]=(...e)=>a.handleInputFocusIn&&a.handleInputFocusIn(...e)),onFocusout:t[2]||(t[2]=(...e)=>a.handleInputFocusOut&&a.handleInputFocusOut(...e))},[(0,d.createElementVNode)(`span`,{ref:`chipsWrapper`,class:(0,d.normalizeClass)([`d-recipe-combobox-multi-select__chip-wrapper`,a.chipWrapperClass])},[((0,d.openBlock)(!0),(0,d.createElementBlock)(d.Fragment,null,(0,d.renderList)(n.selectedItems,(e,t)=>((0,d.openBlock)(),(0,d.createBlock)(o,(0,d.mergeProps)({ref_for:!0,ref:`chips`,key:`${t}-${e}`,interactive:!0,"label-class":[`d-chip__label`],class:[`d-recipe-combobox-multi-select__chip`,{"d-recipe-combobox-multi-select__chip--truncate":!!n.chipMaxWidth}],style:{maxWidth:n.chipMaxWidth},size:i.CHIP_SIZES[String(n.size)],disabled:n.disabled},(0,d.toHandlers)(a.chipListeners),{onKeydown:(0,d.withKeys)(t=>a.onChipRemove(e),[`backspace`]),onClose:t=>a.onChipRemove(e)}),{default:(0,d.withCtx)(()=>[(0,d.createTextVNode)((0,d.toDisplayString)(e),1)]),_:2},1040,[`class`,`style`,`size`,`disabled`,`onKeydown`,`onClose`]))),128))],2),(0,d.createVNode)(s,(0,d.mergeProps)({ref:`input`,modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e),class:`d-recipe-combobox-multi-select__input`,"input-class":[n.inputClass,{"d-recipe-combobox-multi-select__input--hidden":i.hideInputText}],"input-wrapper-class":n.inputWrapperClass,disabled:n.disabled,"aria-label":n.label,"aria-invalid":a.ariaInvalid,"aria-describedby":a.ariaDescribedBy,label:n.showLabel?n.label:``,description:n.description,placeholder:a.inputPlaceHolder,"show-messages":n.showInputMessages,messages:n.inputMessages,size:n.size},a.inputListeners,{onInput:e}),null,16,[`modelValue`,`input-class`,`input-wrapper-class`,`disabled`,`aria-label`,`aria-invalid`,`aria-describedby`,`label`,`description`,`placeholder`,`show-messages`,`messages`,`size`,`onInput`]),(0,d.createVNode)(c,{id:i.messagesId,"validation-messages":n.maxSelectedMessage,"show-messages":i.showValidationMessages},null,8,[`id`,`validation-messages`,`show-messages`])],544)]),list:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`list`,class:(0,d.normalizeClass)([`d-recipe-combobox-multi-select__list`,n.listClass]),onMousedown:t[3]||(t[3]=(0,d.withModifiers)(()=>{},[`prevent`]))},[n.loading?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,p,(0,d.toDisplayString)(n.loadingMessage),1)):(0,d.renderSlot)(e.$slots,`list`,{key:0})],34)]),_:2},[i.hasSlotContent(e.$slots.header)?{name:`header`,fn:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`header`,class:(0,d.normalizeClass)(n.headerClass)},[(0,d.renderSlot)(e.$slots,`header`)],2)]),key:`0`}:void 0,i.hasSlotContent(e.$slots.footer)?{name:`footer`,fn:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`footer`,class:(0,d.normalizeClass)(n.footerClass)},[(0,d.renderSlot)(e.$slots,`footer`)],2)]),key:`1`}:void 0]),1040,[`label`,`show-list`,`max-height`,`max-width`,`popover-offset`,`has-suggestion-list`,`append-to`,`dialog-class`,`transition`,`onSelect`,`onHighlight`])}var h=i.t(f,[[`render`,m]]);exports.default=h;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/sizes.cjs`),t=require(`../../common/constants/index.cjs`),n=require(`../../common/validators/index.cjs`),r=require(`../../common/utils/index.cjs`),i=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),a=require(`../validation-messages/validation-messages.cjs`),o=require(`../chip/chip.cjs`),s=require(`../popover/popover-constants.cjs`),c=require(`../input/input.cjs`),l=require(`../combobox-with-popover/combobox-with-popover.cjs`),u=require(`./combobox-multi-select-constants.cjs`);let d=require(`vue`);var f={name:`DtComboboxMultiSelect`,components:{DtComboboxWithPopover:l.default,DtInput:c.default,DtChip:o.default,DtValidationMessages:a.default},inheritAttrs:!1,props:{label:{type:String,required:!0},showLabel:{type:Boolean,default:!0},description:{type:String,default:``},placeholder:{type:String,default:`Select one or start typing`},inputMessages:{type:Array,default:()=>[],validator:e=>n.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,Number],default:300,validator:n.ordinalSizeValidator(u.CHIP_SIZES)},appendTo:{type:[t.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>s.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},transition:{type:String,default:`fade`},collapseOnFocusOut:{type:Boolean,default:!1},listMaxWidth:{type:String,default:``},reservedRightSpace:{type:Number,default:64},chipMaxWidth:{type:String,default:``},inputClass:{type:[String,Object,Array],default:``},inputWrapperClass:{type:[String,Object,Array],default:``},disabled:{type:Boolean,default:!1},headerClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},listClass:{type:[String,Array,Object],default:``},dialogClass:{type:[String,Object,Array],default:``}},emits:[`update:modelValue`,`select`,`remove`,`max-selected`,`keydown`,`chip-keydown`,`escape`,`enter`,`combobox-highlight`],data(){return{value:``,popoverOffset:[0,4],showValidationMessages:!1,resizeWindowObserver:null,initialInputHeight:null,CHIP_SIZES:u.CHIP_SIZES,hasSlotContent:r.hasSlotContent,inputFocused:!1,hideInputText:!1,messagesId:r.getUniqueString()}},computed:{inputPlaceHolder(){return this.selectedItems?.length>0?``:this.placeholder},chipListeners(){return{keydown:e=>{this.disabled||(this.onChipKeyDown(e),this.$emit(`chip-keydown`,e))}}},inputListeners(){return{...r.extractVueListeners(this.$attrs),onInput:e=>{this.$emit(`update:modelValue`,e),this.hasSuggestionList&&this.showComboboxList()},onKeydown:e=>{if(this.disabled)return;this.onInputKeyDown(e),this.$emit(`keydown`,e);let t=e.key?.toLowerCase();t===`escape`?this.$emit(`escape`,e):t===`enter`&&this.$emit(`enter`,e)},onClick:()=>{this.hasSuggestionList&&this.showComboboxList()}}},ariaInvalid(){return r.getValidationState(this.maxSelectedMessage)===t.VALIDATION_MESSAGE_TYPES.CRITICAL?`true`:void 0},ariaDescribedBy(){return this.showValidationMessages&&this.maxSelectedMessage.length>0?this.messagesId:void 0},chipWrapperClass(){return{[`d-combobox-multi-select__chip-wrapper-${e.COMPONENT_SIZES[String(this.size)]||this.size}--collapsed`]:!this.inputFocused&&this.collapseOnFocusOut}}},watch:{selectedItems:{deep:!0,handler:async function(){await this.initSelectedItems()}},chipMaxWidth:{async handler(){await this.initSelectedItems()}},async label(){await this.$nextTick(),this.setChipsTopPosition()},async description(){await this.$nextTick(),this.setChipsTopPosition()},size:{async handler(){await this.$nextTick();let e=this.getInput();this.revertInputPadding(e),this.setInitialInputHeight(),this.setInputPadding(),this.setChipsTopPosition()}}},async mounted(){this.setInitialInputHeight(),this.resizeWindowObserver=new ResizeObserver(async()=>{this.setChipsTopPosition(),this.setInputPadding()}),this.resizeWindowObserver.observe(document.body),await this.initSelectedItems()},beforeUnmount(){this.resizeWindowObserver?.unobserve(document.body)},methods:{extractNonListeners:r.extractNonListeners,comboboxHighlight(e){this.$emit(`combobox-highlight`,e)},async initSelectedItems(){await this.$nextTick(),this.setInputPadding(),this.setChipsTopPosition(),this.setInputMinWidth(),this.checkMaxSelected()},onChipRemove(e){this.$emit(`remove`,e),this.$refs.input?.focus()},onComboboxSelect(e){this.loading||(this.value=``,this.$emit(`select`,e))},showComboboxList(){this.showList??this.$refs.comboboxWithPopover?.showComboboxList()},closeComboboxList(){this.showList??this.$refs.comboboxWithPopover?.closeComboboxList()},getChips(){if(!this.selectedItems.length||!this.$refs.chips)return null;let e=new Set;return this.selectedItems.map(t=>this.$refs.chips.find((n,i)=>e.has(i)?!1:r.returnFirstEl(n.$el)?.querySelector(`.d-chip__label`)?.textContent?.trim()===t?(e.add(i),!0):!1)).filter(Boolean).map(e=>r.returnFirstEl(e.$el))},getChipButtons(){let e=this.getChips();return e&&e.map(e=>r.returnFirstEl(e).querySelector(`button`))},getLastChipButton(){let e=this.getChipButtons();return e&&e[e.length-1]},getLastChip(){let e=this.getChips();return e&&e[e.length-1]},getFirstChip(){let e=this.getChips();return e&&e[0]},getInput(){return this.$refs.input?.$refs.input},onChipKeyDown(e){let t=e.code?.toLowerCase();t===`arrowleft`?this.navigateBetweenChips(e.target,!0):t===`arrowright`&&(e.target.id===this.getLastChipButton().id?this.moveFromChipToInput():this.navigateBetweenChips(e.target,!1))},onInputKeyDown(e){let t=e.key?.toLowerCase();if(this.selectedItems.length>0&&e.target.selectionStart===0){if(e.target.selectionEnd!==e.target.selectionStart)return;(t===`backspace`||t===`arrowleft`)&&this.moveFromInputToChip()}},moveFromInputToChip(){this.getLastChipButton().focus(),this.$refs.input?.blur(),this.closeComboboxList()},moveFromChipToInput(){this.getLastChipButton().blur(),this.$refs.input?.focus(),this.showComboboxList()},navigateBetweenChips(e,t){let n=this.getChipButtons().indexOf(e),r=t?n-1:n+1;r<0||r>=this.$refs.chips?.length||(this.getChipButtons()[n].blur(),this.getChipButtons()[r].focus(),this.closeComboboxList())},setChipsTopPosition(){let e=this.getInput();if(!e)return;let t=this.$refs.inputSlotWrapper,n=e.getBoundingClientRect().top-t.getBoundingClientRect().top,r=this.$refs.chipsWrapper;r.style.top=n-u.CHIP_TOP_POSITION[String(this.size)]+`px`},setInputPadding(){let e=this.getLastChip(),t=this.getInput();if(!t||(this.revertInputPadding(t),this.popoverOffset=[0,4],!e)||this.collapseOnFocusOut&&!this.inputFocused)return;let n=e.offsetLeft+this.getFullWidth(e),r=t.getBoundingClientRect().width-n,i=this.getFirstChip(),a=i&&e.offsetTop>i.offsetTop;r>this.reservedRightSpace?t.style.paddingInlineStart=n+`px`:t.style.paddingInlineStart=`4px`;let o=this.getInputPaddingTop(e,r>this.reservedRightSpace,a);o!=null&&(t.style.paddingTop=`${o}px`)},getInputPaddingTop(e,t,n){if(t&&!n)return null;if(t)return e.offsetTop+2;let r=parseFloat(getComputedStyle(e).marginTop)||0,i=e.getBoundingClientRect().height;return e.offsetTop+i+r+2},revertInputPadding(e){e.style.paddingInlineStart=``,e.style.paddingBlockStart=``,e.style.paddingBlockEnd=``},getFullWidth(e){let t=window.getComputedStyle(e);return e.offsetWidth+parseInt(t.marginLeft)+parseInt(t.marginRight)},setInputMinWidth(){let 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)},setInitialInputHeight(){let e=this.getInput();e&&(e.style.minHeight=``,e.style.height=``,this.initialInputHeight=e.getBoundingClientRect().height,this.size!==`xs`&&(e.style.minHeight=`${this.initialInputHeight}px`,e.style.height=`auto`))},async handleInputFocusIn(){this.inputFocused=!0,this.collapseOnFocusOut&&(this.hideInputText=!1,await this.$nextTick(),this.setInputPadding())},async handleInputFocusOut(){if(this.inputFocused=!1,this.collapseOnFocusOut){this.hideInputText=!0;let e=this.getInput();if(!e||!e.style.paddingTop)return;this.revertInputPadding(e)}}}},p={key:1,class:`d-combobox-multi-select__list--loading`};function m(e,t,n,r,i,a){let o=(0,d.resolveComponent)(`dt-chip`),s=(0,d.resolveComponent)(`dt-input`),c=(0,d.resolveComponent)(`dt-validation-messages`),l=(0,d.resolveComponent)(`dt-combobox-with-popover`);return(0,d.openBlock)(),(0,d.createBlock)(l,(0,d.mergeProps)({ref:`comboboxWithPopover`,label:n.label,"show-list":n.showList,"max-height":n.listMaxHeight,"max-width":n.listMaxWidth,"popover-offset":i.popoverOffset,"has-suggestion-list":n.hasSuggestionList,"content-width":`anchor`,"append-to":n.appendTo,"dialog-class":n.dialogClass,transition:n.transition},a.extractNonListeners(e.$attrs),{onSelect:a.onComboboxSelect,onHighlight:a.comboboxHighlight}),(0,d.createSlots)({input:(0,d.withCtx)(({onInput:e})=>[(0,d.createElementVNode)(`span`,{ref:`inputSlotWrapper`,class:`d-combobox-multi-select__input-wrapper`,onFocusin:t[1]||(t[1]=(...e)=>a.handleInputFocusIn&&a.handleInputFocusIn(...e)),onFocusout:t[2]||(t[2]=(...e)=>a.handleInputFocusOut&&a.handleInputFocusOut(...e))},[(0,d.createElementVNode)(`span`,{ref:`chipsWrapper`,class:(0,d.normalizeClass)([`d-combobox-multi-select__chip-wrapper`,a.chipWrapperClass])},[((0,d.openBlock)(!0),(0,d.createElementBlock)(d.Fragment,null,(0,d.renderList)(n.selectedItems,(e,t)=>((0,d.openBlock)(),(0,d.createBlock)(o,(0,d.mergeProps)({ref_for:!0,ref:`chips`,key:`${t}-${e}`,interactive:!0,"label-class":[`d-chip__label`],class:[`d-combobox-multi-select__chip`,{"d-combobox-multi-select__chip--truncate":!!n.chipMaxWidth}],style:{maxWidth:n.chipMaxWidth},size:i.CHIP_SIZES[String(n.size)],disabled:n.disabled},(0,d.toHandlers)(a.chipListeners),{onKeydown:(0,d.withKeys)(t=>a.onChipRemove(e),[`backspace`]),onClose:t=>a.onChipRemove(e)}),{default:(0,d.withCtx)(()=>[(0,d.createTextVNode)((0,d.toDisplayString)(e),1)]),_:2},1040,[`class`,`style`,`size`,`disabled`,`onKeydown`,`onClose`]))),128))],2),(0,d.createVNode)(s,(0,d.mergeProps)({ref:`input`,modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e),class:`d-combobox-multi-select__input`,"input-class":[n.inputClass,{"d-combobox-multi-select__input--hidden":i.hideInputText}],"input-wrapper-class":n.inputWrapperClass,disabled:n.disabled,"aria-label":n.label,"aria-invalid":a.ariaInvalid,"aria-describedby":a.ariaDescribedBy,label:n.showLabel?n.label:``,description:n.description,placeholder:a.inputPlaceHolder,"show-messages":n.showInputMessages,messages:n.inputMessages,size:n.size},a.inputListeners,{"onUpdate:modelValue":e}),null,16,[`modelValue`,`input-class`,`input-wrapper-class`,`disabled`,`aria-label`,`aria-invalid`,`aria-describedby`,`label`,`description`,`placeholder`,`show-messages`,`messages`,`size`,`onUpdate:modelValue`]),(0,d.createVNode)(c,{id:i.messagesId,"validation-messages":n.maxSelectedMessage,"show-messages":i.showValidationMessages},null,8,[`id`,`validation-messages`,`show-messages`])],544)]),list:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`list`,class:(0,d.normalizeClass)([`d-combobox-multi-select__list`,n.listClass]),onMousedown:t[3]||(t[3]=(0,d.withModifiers)(()=>{},[`prevent`]))},[n.loading?((0,d.openBlock)(),(0,d.createElementBlock)(`div`,p,(0,d.toDisplayString)(n.loadingMessage),1)):(0,d.renderSlot)(e.$slots,`list`,{key:0})],34)]),_:2},[i.hasSlotContent(e.$slots.header)?{name:`header`,fn:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`header`,class:(0,d.normalizeClass)(n.headerClass)},[(0,d.renderSlot)(e.$slots,`header`)],2)]),key:`0`}:void 0,i.hasSlotContent(e.$slots.footer)?{name:`footer`,fn:(0,d.withCtx)(()=>[(0,d.createElementVNode)(`div`,{ref:`footer`,class:(0,d.normalizeClass)(n.footerClass)},[(0,d.renderSlot)(e.$slots,`footer`)],2)]),key:`1`}:void 0]),1040,[`label`,`show-list`,`max-height`,`max-width`,`popover-offset`,`has-suggestion-list`,`append-to`,`dialog-class`,`transition`,`onSelect`,`onHighlight`])}var h=i.t(f,[[`render`,m]]);exports.default=h;
2
2
  //# sourceMappingURL=combobox-multi-select.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-multi-select.cjs","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelect.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n v-bind=\"extractNonListeners($attrs)\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-recipe-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-recipe-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"(item, index) in selectedItems\"\n ref=\"chips\"\n :key=\"`${index}-${item}`\"\n :interactive=\"true\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-recipe-combobox-multi-select__chip',\n { 'd-recipe-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[String(size)]\"\n :disabled=\"disabled\"\n v-on=\"chipListeners\"\n @keydown.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=\"d-recipe-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-recipe-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n :label=\"showLabel ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\n :id=\"messagesId\"\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=\"hasSlotContent($slots.header)\"\n #header\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n :class=\"['d-recipe-combobox-multi-select__list', listClass]\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-recipe-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footer\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtComboboxWithPopover from '@/components/ComboboxWithPopover/ComboboxWithPopover.vue';\nimport DtInput from '@/components/Input/Input.vue';\nimport DtChip from '@/components/Chip/Chip.vue';\nimport DtValidationMessages from '@/components/ValidationMessages/ValidationMessages.vue';\nimport { validationMessageValidator, ordinalSizeValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl, getUniqueString, getValidationState } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/Popover/PopoverConstants';\nimport {\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './ComboboxMultiSelectConstants';\nimport { COMPONENT_SIZES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\n\nexport default {\n name: 'DtComboboxMultiSelect',\n\n components: {\n DtComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n inheritAttrs: false,\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 showLabel: {\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.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZES),\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: [HTML_ELEMENT_TYPE, 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 * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * When true, disables the underlying input.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the list wrapper element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {String}\n */\n 'update:modelValue',\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 keydown event fired when a key is pressed in the text input.\n * For the common Escape and Enter cases, listen to `escape` / `enter` instead.\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native keydown event fired when a key is pressed while a chip is focused.\n *\n * @event chip-keydown\n * @type {KeyboardEvent}\n */\n 'chip-keydown',\n\n /**\n * Fired when Escape is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event escape\n * @type {KeyboardEvent}\n */\n 'escape',\n\n /**\n * Fired when Enter is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event enter\n * @type {KeyboardEvent}\n */\n 'enter',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n hasSlotContent,\n inputFocused: false,\n hideInputText: false,\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n if (this.disabled) return;\n this.onChipKeyDown(event);\n this.$emit('chip-keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('update:modelValue', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n if (this.disabled) return;\n this.onInputKeyDown(event);\n this.$emit('keydown', event);\n // Use event.key (not event.code) so NumpadEnter normalizes to 'Enter'\n // and consumers don't have to special-case the numpad.\n const key = event.key?.toLowerCase();\n if (key === 'escape') {\n this.$emit('escape', event);\n } else if (key === 'enter') {\n this.$emit('enter', event);\n }\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n ariaInvalid () {\n return getValidationState(this.maxSelectedMessage) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : undefined;\n },\n\n chipWrapperClass () {\n return {\n [`d-recipe-combobox-multi-select__chip-wrapper-${COMPONENT_SIZES[String(this.size)] || this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n deep: true,\n handler: async function () {\n await this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n await 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.setInitialInputHeight();\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n async mounted () {\n this.setInitialInputHeight();\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 await this.initSelectedItems();\n },\n\n beforeUnmount () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n extractNonListeners,\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\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 if (this.loading) return;\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 getChips () {\n if (!this.selectedItems.length || !this.$refs.chips) return null;\n\n // Use the order from selectedItems to not rely on DOM order which may be stale.\n // Track matched indices to handle duplicate item names correctly.\n const matched = new Set();\n const chips = this.selectedItems.map(item => {\n return this.$refs.chips.find((chip, index) => {\n if (matched.has(index)) return false;\n const chipLabel = returnFirstEl(chip.$el)?.querySelector('.d-chip__label')?.textContent?.trim();\n if (chipLabel === item) {\n matched.add(index);\n return true;\n }\n return false;\n });\n });\n return chips.filter(Boolean).map(chip => returnFirstEl(chip.$el));\n },\n\n getChipButtons () {\n const chips = this.getChips();\n return chips && chips.map(chip => returnFirstEl(chip).querySelector('button'));\n },\n\n getLastChipButton () {\n const chipButtons = this.getChipButtons();\n return chipButtons && chipButtons[chipButtons.length - 1];\n },\n\n getLastChip () {\n const chips = this.getChips();\n return chips && chips[chips.length - 1];\n },\n\n getFirstChip () {\n const chips = this.getChips();\n return chips && chips[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyDown (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 onInputKeyDown (event) {\n const key = event.key?.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 there is selected text, do not focus the last chip\n if (event.target.selectionEnd !== event.target.selectionStart) {\n return;\n }\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[String(this.size)]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) 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 const spaceLeft = input.getBoundingClientRect().width - left;\n const firstChip = this.getFirstChip();\n const isWrapped = firstChip && lastChip.offsetTop > firstChip.offsetTop;\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingInlineStart = left + 'px';\n } else {\n input.style.paddingInlineStart = '4px';\n }\n\n const paddingTop = this.getInputPaddingTop(lastChip, spaceLeft > this.reservedRightSpace, isWrapped);\n if (paddingTop != null) input.style.paddingTop = `${paddingTop}px`;\n },\n\n getInputPaddingTop (lastChip, hasSpace, isWrapped) {\n // Chip fits beside the cursor on its row; CSS handles vertical centering.\n if (hasSpace && !isWrapped) return null;\n // Chip wrapped onto a new row with space remaining; align cursor to it.\n if (hasSpace) return lastChip.offsetTop + 2;\n // No space on the chip's row — predict next-row offsetTop so paddingTop\n // stays stable when a chip lands there.\n const chipMarginTop = parseFloat(getComputedStyle(lastChip).marginTop) || 0;\n const lastChipHeight = lastChip.getBoundingClientRect().height;\n return lastChip.offsetTop + lastChipHeight + chipMarginTop + 2;\n },\n\n revertInputPadding (input) {\n input.style.paddingInlineStart = '';\n input.style.paddingBlockStart = '';\n input.style.paddingBlockEnd = '';\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 setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n input.style.minHeight = '';\n input.style.height = '';\n this.initialInputHeight = input.getBoundingClientRect().height;\n // xs renders correctly without a min-height floor; other sizes need it to grow when chips wrap.\n if (this.size !== 'xs') {\n input.style.minHeight = `${this.initialInputHeight}px`;\n input.style.height = 'auto';\n }\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n this.hideInputText = false;\n await this.$nextTick();\n this.setInputPadding();\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n this.hideInputText = true;\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"mappings":"wqBAmJA,IAAK,EAAU,CACb,KAAM,wBAEN,WAAY,CACV,sBAAA,EAAA,QACA,QAAA,EAAA,QACA,OAAA,EAAA,QACA,qBAAA,EAAA,QACD,CAED,aAAc,GAEd,MAAO,CAIL,MAAO,CACL,KAAM,OACN,SAAU,GACX,CAMD,UAAW,CACT,KAAM,QACN,QAAS,GACV,CAKD,YAAa,CACX,KAAM,OACN,QAAS,GACV,CAKD,YAAa,CACX,KAAM,OACN,QAAS,6BACV,CAKD,cAAe,CACb,KAAM,MACN,YAAe,EAAE,CACjB,UAAW,GACF,EAAA,2BAA2B,EAAc,CAEnD,CAKD,kBAAmB,CACjB,KAAM,QACN,QAAS,GACV,CAYD,QAAS,CACP,KAAM,QACN,QAAS,GACV,CAKD,eAAgB,CACd,KAAM,OACN,QAAS,aACV,CAQD,SAAU,CACR,KAAM,QACN,QAAS,KACV,CAMD,cAAe,CACb,KAAM,OACN,QAAS,QACV,CAKD,cAAe,CACb,KAAM,MACN,QAAS,UAAY,CAAE,MAAO,EAAE,EACjC,CAKD,YAAa,CACX,KAAM,OACN,QAAS,EACV,CAMD,mBAAoB,CAClB,KAAM,MACN,QAAS,UAAY,CAAE,MAAO,EAAE,EACjC,CAMD,kBAAmB,CACjB,KAAM,QACN,QAAS,GACV,CAMD,KAAM,CACJ,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,IACT,UAAW,EAAA,qBAAqB,EAAA,WAAW,CAC5C,CAOD,SAAU,CACR,KAAM,CAAC,EAAA,kBAAmB,OAAO,CACjC,QAAS,OACT,UAAW,GACF,EAAA,yBAAyB,SAAS,EAAQ,EAC5C,aAAoB,YAE5B,CAMD,WAAY,CACV,KAAM,OACN,QAAS,OACV,CAMD,mBAAoB,CAClB,KAAM,QACN,QAAS,GACV,CAMD,aAAc,CACZ,KAAM,OACN,QAAS,GACV,CAOD,mBAAoB,CAClB,KAAM,OACN,QAAS,GACV,C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AAI,OACH,OAAA,EAAA,EAAA,gBAAK,CAAA,uCAA2C,EAAA,UAAS,CAAA,CACzD,YAAS,EAAA,KAAA,EAAA,IAAA,EAAA,EAAA,mBAAV,GAAkB,CAAA,UAAA,CAAA,IAGT,EAAA,UAEP,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAMI,MALN,GAAA,EAAA,EAAA,iBAIK,EAAA,eAAc,CAAA,EAAA,GAPV,EAAA,EAAA,YAEP,EAAA,OAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAKiB,CAAA,GAAA,CAAA,CAAA,OA1Bf,EAAA,eAAe,EAAA,OAAO,OAAM,CAAA,MACjC,8BAOK,EAAA,EAAA,EAAA,oBAAA,MAAA,CAJJ,IAAI,SACH,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,oBAEG,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,CAAA,CAAA,iBA0BlB,EAAA,eAAe,EAAA,OAAO,OAAM,CAAA,MACjC,8BAOK,EAAA,EAAA,EAAA,oBAAA,MAAA,CAJJ,IAAI,SACH,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,oBAEG,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"combobox-multi-select.cjs","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelect.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n v-bind=\"extractNonListeners($attrs)\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"(item, index) in selectedItems\"\n ref=\"chips\"\n :key=\"`${index}-${item}`\"\n :interactive=\"true\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-combobox-multi-select__chip',\n { 'd-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[String(size)]\"\n :disabled=\"disabled\"\n v-on=\"chipListeners\"\n @keydown.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=\"d-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n :label=\"showLabel ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @update:model-value=\"onInput\"\n />\n\n <dt-validation-messages\n :id=\"messagesId\"\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=\"hasSlotContent($slots.header)\"\n #header\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n :class=\"['d-combobox-multi-select__list', listClass]\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footer\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtComboboxWithPopover from '@/components/ComboboxWithPopover/ComboboxWithPopover.vue';\nimport DtInput from '@/components/Input/Input.vue';\nimport DtChip from '@/components/Chip/Chip.vue';\nimport DtValidationMessages from '@/components/ValidationMessages/ValidationMessages.vue';\nimport { validationMessageValidator, ordinalSizeValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl, getUniqueString, getValidationState } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/Popover/PopoverConstants';\nimport {\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './ComboboxMultiSelectConstants';\nimport { COMPONENT_SIZES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\n\nexport default {\n name: 'DtComboboxMultiSelect',\n\n components: {\n DtComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n inheritAttrs: false,\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 showLabel: {\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.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZES),\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: [HTML_ELEMENT_TYPE, 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 * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * When true, disables the underlying input.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the list wrapper element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {String}\n */\n 'update:modelValue',\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 keydown event fired when a key is pressed in the text input.\n * For the common Escape and Enter cases, listen to `escape` / `enter` instead.\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native keydown event fired when a key is pressed while a chip is focused.\n *\n * @event chip-keydown\n * @type {KeyboardEvent}\n */\n 'chip-keydown',\n\n /**\n * Fired when Escape is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event escape\n * @type {KeyboardEvent}\n */\n 'escape',\n\n /**\n * Fired when Enter is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event enter\n * @type {KeyboardEvent}\n */\n 'enter',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n hasSlotContent,\n inputFocused: false,\n hideInputText: false,\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n if (this.disabled) return;\n this.onChipKeyDown(event);\n this.$emit('chip-keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('update:modelValue', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n if (this.disabled) return;\n this.onInputKeyDown(event);\n this.$emit('keydown', event);\n // Use event.key (not event.code) so NumpadEnter normalizes to 'Enter'\n // and consumers don't have to special-case the numpad.\n const key = event.key?.toLowerCase();\n if (key === 'escape') {\n this.$emit('escape', event);\n } else if (key === 'enter') {\n this.$emit('enter', event);\n }\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n ariaInvalid () {\n return getValidationState(this.maxSelectedMessage) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : undefined;\n },\n\n chipWrapperClass () {\n return {\n [`d-combobox-multi-select__chip-wrapper-${COMPONENT_SIZES[String(this.size)] || this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n deep: true,\n handler: async function () {\n await this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n await 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.setInitialInputHeight();\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n async mounted () {\n this.setInitialInputHeight();\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 await this.initSelectedItems();\n },\n\n beforeUnmount () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n extractNonListeners,\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\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 if (this.loading) return;\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 getChips () {\n if (!this.selectedItems.length || !this.$refs.chips) return null;\n\n // Use the order from selectedItems to not rely on DOM order which may be stale.\n // Track matched indices to handle duplicate item names correctly.\n const matched = new Set();\n const chips = this.selectedItems.map(item => {\n return this.$refs.chips.find((chip, index) => {\n if (matched.has(index)) return false;\n const chipLabel = returnFirstEl(chip.$el)?.querySelector('.d-chip__label')?.textContent?.trim();\n if (chipLabel === item) {\n matched.add(index);\n return true;\n }\n return false;\n });\n });\n return chips.filter(Boolean).map(chip => returnFirstEl(chip.$el));\n },\n\n getChipButtons () {\n const chips = this.getChips();\n return chips && chips.map(chip => returnFirstEl(chip).querySelector('button'));\n },\n\n getLastChipButton () {\n const chipButtons = this.getChipButtons();\n return chipButtons && chipButtons[chipButtons.length - 1];\n },\n\n getLastChip () {\n const chips = this.getChips();\n return chips && chips[chips.length - 1];\n },\n\n getFirstChip () {\n const chips = this.getChips();\n return chips && chips[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyDown (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 onInputKeyDown (event) {\n const key = event.key?.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 there is selected text, do not focus the last chip\n if (event.target.selectionEnd !== event.target.selectionStart) {\n return;\n }\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[String(this.size)]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) 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 const spaceLeft = input.getBoundingClientRect().width - left;\n const firstChip = this.getFirstChip();\n const isWrapped = firstChip && lastChip.offsetTop > firstChip.offsetTop;\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingInlineStart = left + 'px';\n } else {\n input.style.paddingInlineStart = '4px';\n }\n\n const paddingTop = this.getInputPaddingTop(lastChip, spaceLeft > this.reservedRightSpace, isWrapped);\n if (paddingTop != null) input.style.paddingTop = `${paddingTop}px`;\n },\n\n getInputPaddingTop (lastChip, hasSpace, isWrapped) {\n // Chip fits beside the cursor on its row; CSS handles vertical centering.\n if (hasSpace && !isWrapped) return null;\n // Chip wrapped onto a new row with space remaining; align cursor to it.\n if (hasSpace) return lastChip.offsetTop + 2;\n // No space on the chip's row — predict next-row offsetTop so paddingTop\n // stays stable when a chip lands there.\n const chipMarginTop = parseFloat(getComputedStyle(lastChip).marginTop) || 0;\n const lastChipHeight = lastChip.getBoundingClientRect().height;\n return lastChip.offsetTop + lastChipHeight + chipMarginTop + 2;\n },\n\n revertInputPadding (input) {\n input.style.paddingInlineStart = '';\n input.style.paddingBlockStart = '';\n input.style.paddingBlockEnd = '';\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 setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n input.style.minHeight = '';\n input.style.height = '';\n this.initialInputHeight = input.getBoundingClientRect().height;\n // xs renders correctly without a min-height floor; other sizes need it to grow when chips wrap.\n if (this.size !== 'xs') {\n input.style.minHeight = `${this.initialInputHeight}px`;\n input.style.height = 'auto';\n }\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n this.hideInputText = false;\n await this.$nextTick();\n this.setInputPadding();\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n this.hideInputText = true;\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"mappings":"wqBAmJA,IAAK,EAAU,CACb,KAAM,wBAEN,WAAY,CACV,sBAAA,EAAA,QACA,QAAA,EAAA,QACA,OAAA,EAAA,QACA,qBAAA,EAAA,QACD,CAED,aAAc,GAEd,MAAO,CAIL,MAAO,CACL,KAAM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AMI,MALN,GAAA,EAAA,EAAA,iBAIK,EAAA,eAAc,CAAA,EAAA,GAPV,EAAA,EAAA,YAEP,EAAA,OAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAKiB,CAAA,GAAA,CAAA,CAAA,OA1Bf,EAAA,eAAe,EAAA,OAAO,OAAM,CAAA,MACjC,8BAOK,EAAA,EAAA,EAAA,oBAAA,MAAA,CAJJ,IAAI,SACH,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,oBAEG,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,CAAA,CAAA,iBA0BlB,EAAA,eAAe,EAAA,OAAO,OAAM,CAAA,MACjC,8BAOK,EAAA,EAAA,EAAA,oBAAA,MAAA,CAJJ,IAAI,SACH,OAAA,EAAA,EAAA,gBAAO,EAAA,YAAW,oBAEG,EAAA,OAAA,SAAA,CAAA,CAAA,EAAA,CAAA,CAAA"}
@@ -223,7 +223,7 @@ var L = {
223
223
  return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : void 0;
224
224
  },
225
225
  chipWrapperClass() {
226
- return { [`d-recipe-combobox-multi-select__chip-wrapper-${e[String(this.size)] || this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut };
226
+ return { [`d-combobox-multi-select__chip-wrapper-${e[String(this.size)] || this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut };
227
227
  }
228
228
  },
229
229
  watch: {
@@ -373,7 +373,7 @@ var L = {
373
373
  }
374
374
  }, R = {
375
375
  key: 1,
376
- class: "d-recipe-combobox-multi-select__list--loading"
376
+ class: "d-combobox-multi-select__list--loading"
377
377
  };
378
378
  function z(e, t, n, r, i, a) {
379
379
  let o = j("dt-chip"), s = j("dt-input"), c = j("dt-validation-messages"), l = j("dt-combobox-with-popover");
@@ -395,20 +395,20 @@ function z(e, t, n, r, i, a) {
395
395
  }), C({
396
396
  input: P(({ onInput: e }) => [S("span", {
397
397
  ref: "inputSlotWrapper",
398
- class: "d-recipe-combobox-multi-select__input-wrapper",
398
+ class: "d-combobox-multi-select__input-wrapper",
399
399
  onFocusin: t[1] || (t[1] = (...e) => a.handleInputFocusIn && a.handleInputFocusIn(...e)),
400
400
  onFocusout: t[2] || (t[2] = (...e) => a.handleInputFocusOut && a.handleInputFocusOut(...e))
401
401
  }, [
402
402
  S("span", {
403
403
  ref: "chipsWrapper",
404
- class: D(["d-recipe-combobox-multi-select__chip-wrapper", a.chipWrapperClass])
404
+ class: D(["d-combobox-multi-select__chip-wrapper", a.chipWrapperClass])
405
405
  }, [(O(!0), x(y, null, k(n.selectedItems, (e, t) => (O(), b(o, E({
406
406
  ref_for: !0,
407
407
  ref: "chips",
408
408
  key: `${t}-${e}`,
409
409
  interactive: !0,
410
410
  "label-class": ["d-chip__label"],
411
- class: ["d-recipe-combobox-multi-select__chip", { "d-recipe-combobox-multi-select__chip--truncate": !!n.chipMaxWidth }],
411
+ class: ["d-combobox-multi-select__chip", { "d-combobox-multi-select__chip--truncate": !!n.chipMaxWidth }],
412
412
  style: { maxWidth: n.chipMaxWidth },
413
413
  size: i.CHIP_SIZES[String(n.size)],
414
414
  disabled: n.disabled
@@ -430,8 +430,8 @@ function z(e, t, n, r, i, a) {
430
430
  ref: "input",
431
431
  modelValue: i.value,
432
432
  "onUpdate:modelValue": t[0] || (t[0] = (e) => i.value = e),
433
- class: "d-recipe-combobox-multi-select__input",
434
- "input-class": [n.inputClass, { "d-recipe-combobox-multi-select__input--hidden": i.hideInputText }],
433
+ class: "d-combobox-multi-select__input",
434
+ "input-class": [n.inputClass, { "d-combobox-multi-select__input--hidden": i.hideInputText }],
435
435
  "input-wrapper-class": n.inputWrapperClass,
436
436
  disabled: n.disabled,
437
437
  "aria-label": n.label,
@@ -443,7 +443,7 @@ function z(e, t, n, r, i, a) {
443
443
  "show-messages": n.showInputMessages,
444
444
  messages: n.inputMessages,
445
445
  size: n.size
446
- }, a.inputListeners, { onInput: e }), null, 16, [
446
+ }, a.inputListeners, { "onUpdate:modelValue": e }), null, 16, [
447
447
  "modelValue",
448
448
  "input-class",
449
449
  "input-wrapper-class",
@@ -457,7 +457,7 @@ function z(e, t, n, r, i, a) {
457
457
  "show-messages",
458
458
  "messages",
459
459
  "size",
460
- "onInput"
460
+ "onUpdate:modelValue"
461
461
  ]),
462
462
  T(c, {
463
463
  id: i.messagesId,
@@ -471,7 +471,7 @@ function z(e, t, n, r, i, a) {
471
471
  ], 544)]),
472
472
  list: P(() => [S("div", {
473
473
  ref: "list",
474
- class: D(["d-recipe-combobox-multi-select__list", n.listClass]),
474
+ class: D(["d-combobox-multi-select__list", n.listClass]),
475
475
  onMousedown: t[3] || (t[3] = I(() => {}, ["prevent"]))
476
476
  }, [n.loading ? (O(), x("div", R, M(n.loadingMessage), 1)) : A(e.$slots, "list", { key: 0 })], 34)]),
477
477
  _: 2
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-multi-select.js","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelect.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n v-bind=\"extractNonListeners($attrs)\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-recipe-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-recipe-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"(item, index) in selectedItems\"\n ref=\"chips\"\n :key=\"`${index}-${item}`\"\n :interactive=\"true\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-recipe-combobox-multi-select__chip',\n { 'd-recipe-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[String(size)]\"\n :disabled=\"disabled\"\n v-on=\"chipListeners\"\n @keydown.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=\"d-recipe-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-recipe-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n :label=\"showLabel ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @input=\"onInput\"\n />\n\n <dt-validation-messages\n :id=\"messagesId\"\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=\"hasSlotContent($slots.header)\"\n #header\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n :class=\"['d-recipe-combobox-multi-select__list', listClass]\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-recipe-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footer\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtComboboxWithPopover from '@/components/ComboboxWithPopover/ComboboxWithPopover.vue';\nimport DtInput from '@/components/Input/Input.vue';\nimport DtChip from '@/components/Chip/Chip.vue';\nimport DtValidationMessages from '@/components/ValidationMessages/ValidationMessages.vue';\nimport { validationMessageValidator, ordinalSizeValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl, getUniqueString, getValidationState } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/Popover/PopoverConstants';\nimport {\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './ComboboxMultiSelectConstants';\nimport { COMPONENT_SIZES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\n\nexport default {\n name: 'DtComboboxMultiSelect',\n\n components: {\n DtComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n inheritAttrs: false,\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 showLabel: {\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.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZES),\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: [HTML_ELEMENT_TYPE, 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 * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * When true, disables the underlying input.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the list wrapper element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {String}\n */\n 'update:modelValue',\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 keydown event fired when a key is pressed in the text input.\n * For the common Escape and Enter cases, listen to `escape` / `enter` instead.\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native keydown event fired when a key is pressed while a chip is focused.\n *\n * @event chip-keydown\n * @type {KeyboardEvent}\n */\n 'chip-keydown',\n\n /**\n * Fired when Escape is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event escape\n * @type {KeyboardEvent}\n */\n 'escape',\n\n /**\n * Fired when Enter is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event enter\n * @type {KeyboardEvent}\n */\n 'enter',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n hasSlotContent,\n inputFocused: false,\n hideInputText: false,\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n if (this.disabled) return;\n this.onChipKeyDown(event);\n this.$emit('chip-keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('update:modelValue', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n if (this.disabled) return;\n this.onInputKeyDown(event);\n this.$emit('keydown', event);\n // Use event.key (not event.code) so NumpadEnter normalizes to 'Enter'\n // and consumers don't have to special-case the numpad.\n const key = event.key?.toLowerCase();\n if (key === 'escape') {\n this.$emit('escape', event);\n } else if (key === 'enter') {\n this.$emit('enter', event);\n }\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n ariaInvalid () {\n return getValidationState(this.maxSelectedMessage) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : undefined;\n },\n\n chipWrapperClass () {\n return {\n [`d-recipe-combobox-multi-select__chip-wrapper-${COMPONENT_SIZES[String(this.size)] || this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n deep: true,\n handler: async function () {\n await this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n await 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.setInitialInputHeight();\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n async mounted () {\n this.setInitialInputHeight();\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 await this.initSelectedItems();\n },\n\n beforeUnmount () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n extractNonListeners,\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\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 if (this.loading) return;\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 getChips () {\n if (!this.selectedItems.length || !this.$refs.chips) return null;\n\n // Use the order from selectedItems to not rely on DOM order which may be stale.\n // Track matched indices to handle duplicate item names correctly.\n const matched = new Set();\n const chips = this.selectedItems.map(item => {\n return this.$refs.chips.find((chip, index) => {\n if (matched.has(index)) return false;\n const chipLabel = returnFirstEl(chip.$el)?.querySelector('.d-chip__label')?.textContent?.trim();\n if (chipLabel === item) {\n matched.add(index);\n return true;\n }\n return false;\n });\n });\n return chips.filter(Boolean).map(chip => returnFirstEl(chip.$el));\n },\n\n getChipButtons () {\n const chips = this.getChips();\n return chips && chips.map(chip => returnFirstEl(chip).querySelector('button'));\n },\n\n getLastChipButton () {\n const chipButtons = this.getChipButtons();\n return chipButtons && chipButtons[chipButtons.length - 1];\n },\n\n getLastChip () {\n const chips = this.getChips();\n return chips && chips[chips.length - 1];\n },\n\n getFirstChip () {\n const chips = this.getChips();\n return chips && chips[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyDown (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 onInputKeyDown (event) {\n const key = event.key?.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 there is selected text, do not focus the last chip\n if (event.target.selectionEnd !== event.target.selectionStart) {\n return;\n }\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[String(this.size)]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) 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 const spaceLeft = input.getBoundingClientRect().width - left;\n const firstChip = this.getFirstChip();\n const isWrapped = firstChip && lastChip.offsetTop > firstChip.offsetTop;\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingInlineStart = left + 'px';\n } else {\n input.style.paddingInlineStart = '4px';\n }\n\n const paddingTop = this.getInputPaddingTop(lastChip, spaceLeft > this.reservedRightSpace, isWrapped);\n if (paddingTop != null) input.style.paddingTop = `${paddingTop}px`;\n },\n\n getInputPaddingTop (lastChip, hasSpace, isWrapped) {\n // Chip fits beside the cursor on its row; CSS handles vertical centering.\n if (hasSpace && !isWrapped) return null;\n // Chip wrapped onto a new row with space remaining; align cursor to it.\n if (hasSpace) return lastChip.offsetTop + 2;\n // No space on the chip's row — predict next-row offsetTop so paddingTop\n // stays stable when a chip lands there.\n const chipMarginTop = parseFloat(getComputedStyle(lastChip).marginTop) || 0;\n const lastChipHeight = lastChip.getBoundingClientRect().height;\n return lastChip.offsetTop + lastChipHeight + chipMarginTop + 2;\n },\n\n revertInputPadding (input) {\n input.style.paddingInlineStart = '';\n input.style.paddingBlockStart = '';\n input.style.paddingBlockEnd = '';\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 setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n input.style.minHeight = '';\n input.style.height = '';\n this.initialInputHeight = input.getBoundingClientRect().height;\n // xs renders correctly without a min-height floor; other sizes need it to grow when chips wrap.\n if (this.size !== 'xs') {\n input.style.minHeight = `${this.initialInputHeight}px`;\n input.style.height = 'auto';\n }\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n this.hideInputText = false;\n await this.$nextTick();\n this.setInputPadding();\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n this.hideInputText = true;\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;AAmJA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,uBAAA;EACA,SAAA;EACA,QAAA;EACA,sBAAA;EACD;CAED,cAAc;CAEd,OAAO;EAIL,OAAO;GACL,MAAM;GACN,UAAU;GACX;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAKD,eAAe;GACb,MAAM;GACN,eAAe,EAAE;GACjB,YAAW,MACF,EAA2B,EAAc;GAEnD;EAKD,mBAAm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eAAe,EAAA,OAAO,OAAM,GAAA;QACjC;cAOK,CALN,EAKM,OAAA;GAJJ,KAAI;GACH,OAAK,EAAE,EAAA,YAAW;MAEnB,EAAsB,EAAA,QAAA,SAAA,CAAA,EAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"combobox-multi-select.js","names":[],"sources":["../../../components/ComboboxMultiSelect/ComboboxMultiSelect.vue"],"sourcesContent":["<!-- eslint-disable vue/no-static-inline-styles -->\n<template>\n <dt-combobox-with-popover\n ref=\"comboboxWithPopover\"\n :label=\"label\"\n :show-list=\"showList\"\n :max-height=\"listMaxHeight\"\n :max-width=\"listMaxWidth\"\n :popover-offset=\"popoverOffset\"\n :has-suggestion-list=\"hasSuggestionList\"\n content-width=\"anchor\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n v-bind=\"extractNonListeners($attrs)\"\n @select=\"onComboboxSelect\"\n @highlight=\"comboboxHighlight\"\n >\n <template #input=\"{ onInput }\">\n <span\n ref=\"inputSlotWrapper\"\n class=\"d-combobox-multi-select__input-wrapper\"\n @focusin=\"handleInputFocusIn\"\n @focusout=\"handleInputFocusOut\"\n >\n <span\n ref=\"chipsWrapper\"\n :class=\"['d-combobox-multi-select__chip-wrapper', chipWrapperClass]\"\n >\n <dt-chip\n v-for=\"(item, index) in selectedItems\"\n ref=\"chips\"\n :key=\"`${index}-${item}`\"\n :interactive=\"true\"\n :label-class=\"['d-chip__label']\"\n :class=\"[\n 'd-combobox-multi-select__chip',\n { 'd-combobox-multi-select__chip--truncate': !!chipMaxWidth },\n ]\"\n :style=\"{ maxWidth: chipMaxWidth }\"\n :size=\"CHIP_SIZES[String(size)]\"\n :disabled=\"disabled\"\n v-on=\"chipListeners\"\n @keydown.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=\"d-combobox-multi-select__input\"\n :input-class=\"[\n inputClass, {\n 'd-combobox-multi-select__input--hidden': hideInputText,\n }]\"\n :input-wrapper-class=\"inputWrapperClass\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedBy\"\n :label=\"showLabel ? label : ''\"\n :description=\"description\"\n :placeholder=\"inputPlaceHolder\"\n :show-messages=\"showInputMessages\"\n :messages=\"inputMessages\"\n :size=\"size\"\n v-bind=\"inputListeners\"\n @update:model-value=\"onInput\"\n />\n\n <dt-validation-messages\n :id=\"messagesId\"\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=\"hasSlotContent($slots.header)\"\n #header\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <!-- @slot slot for popover list -->\n <template #list>\n <div\n ref=\"list\"\n :class=\"['d-combobox-multi-select__list', listClass]\"\n @mousedown.prevent\n >\n <slot\n v-if=\"!loading\"\n name=\"list\"\n />\n <div\n v-else\n class=\"d-combobox-multi-select__list--loading\"\n >\n {{ loadingMessage }}\n </div>\n </div>\n </template>\n\n <!-- @slot slot for popover footer -->\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footer\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-combobox-with-popover>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport DtComboboxWithPopover from '@/components/ComboboxWithPopover/ComboboxWithPopover.vue';\nimport DtInput from '@/components/Input/Input.vue';\nimport DtChip from '@/components/Chip/Chip.vue';\nimport DtValidationMessages from '@/components/ValidationMessages/ValidationMessages.vue';\nimport { validationMessageValidator, ordinalSizeValidator } from '@/common/validators';\nimport { extractVueListeners, extractNonListeners, hasSlotContent, returnFirstEl, getUniqueString, getValidationState } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport {\n POPOVER_APPEND_TO_VALUES,\n} from '@/components/Popover/PopoverConstants';\nimport {\n CHIP_SIZES,\n CHIP_TOP_POSITION,\n} from './ComboboxMultiSelectConstants';\nimport { COMPONENT_SIZES, VALIDATION_MESSAGE_TYPES } from '@/common/constants';\n\nexport default {\n name: 'DtComboboxMultiSelect',\n\n components: {\n DtComboboxWithPopover,\n DtInput,\n DtChip,\n DtValidationMessages,\n },\n\n inheritAttrs: false,\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 showLabel: {\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.\n * @values 100, 200, 300\n */\n size: {\n type: [String, Number],\n default: 300,\n validator: ordinalSizeValidator(CHIP_SIZES),\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: [HTML_ELEMENT_TYPE, 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 * Determines whether the combobox should collapse to a single when losing focus.\n * @type {boolean}\n */\n collapseOnFocusOut: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|em\n */\n listMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Amount of reserved space (in px) on the right side of the input\n * before the chips and the input caret jump to the next line.\n * default is 64\n */\n reservedRightSpace: {\n type: Number,\n default: 64,\n },\n\n /**\n * Determines the maximum width of a single chip. If the text within this chip exceeds the value\n * it will be truncated with ellipses.\n * Possible units rem|px|em\n */\n chipMaxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Additional class name for the input element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n inputClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Additional class name for the input wrapper element.\n * Can accept all of String, Object, and Array, i.e. has the\n * same api as Vue's built-in handling of the class attribute.\n */\n inputWrapperClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * When true, disables the underlying input.\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the list wrapper element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n emits: [\n /**\n * Event fired to sync the modelValue prop with the parent component\n *\n * @event update:modelValue\n * @type {String}\n */\n 'update:modelValue',\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 keydown event fired when a key is pressed in the text input.\n * For the common Escape and Enter cases, listen to `escape` / `enter` instead.\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Native keydown event fired when a key is pressed while a chip is focused.\n *\n * @event chip-keydown\n * @type {KeyboardEvent}\n */\n 'chip-keydown',\n\n /**\n * Fired when Escape is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event escape\n * @type {KeyboardEvent}\n */\n 'escape',\n\n /**\n * Fired when Enter is pressed in the text input.\n * Not fired when a chip is focused.\n *\n * @event enter\n * @type {KeyboardEvent}\n */\n 'enter',\n\n /**\n * Event fired when combobox item is highlighted\n *\n * @event combobox-highlight\n * @type {Object}\n */\n 'combobox-highlight',\n ],\n\n data () {\n return {\n value: '',\n popoverOffset: [0, 4],\n showValidationMessages: false,\n resizeWindowObserver: null,\n initialInputHeight: null,\n CHIP_SIZES,\n hasSlotContent,\n inputFocused: false,\n hideInputText: false,\n messagesId: getUniqueString(),\n };\n },\n\n computed: {\n inputPlaceHolder () {\n return this.selectedItems?.length > 0 ? '' : this.placeholder;\n },\n\n chipListeners () {\n return {\n keydown: event => {\n if (this.disabled) return;\n this.onChipKeyDown(event);\n this.$emit('chip-keydown', event);\n },\n };\n },\n\n inputListeners () {\n return {\n ...extractVueListeners(this.$attrs),\n onInput: event => {\n this.$emit('update:modelValue', event);\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n\n onKeydown: event => {\n if (this.disabled) return;\n this.onInputKeyDown(event);\n this.$emit('keydown', event);\n // Use event.key (not event.code) so NumpadEnter normalizes to 'Enter'\n // and consumers don't have to special-case the numpad.\n const key = event.key?.toLowerCase();\n if (key === 'escape') {\n this.$emit('escape', event);\n } else if (key === 'enter') {\n this.$emit('enter', event);\n }\n },\n\n onClick: () => {\n if (this.hasSuggestionList) {\n this.showComboboxList();\n }\n },\n };\n },\n\n ariaInvalid () {\n return getValidationState(this.maxSelectedMessage) === VALIDATION_MESSAGE_TYPES.CRITICAL ? 'true' : undefined;\n },\n\n ariaDescribedBy () {\n return this.showValidationMessages && this.maxSelectedMessage.length > 0 ? this.messagesId : undefined;\n },\n\n chipWrapperClass () {\n return {\n [`d-combobox-multi-select__chip-wrapper-${COMPONENT_SIZES[String(this.size)] || this.size}--collapsed`]: !this.inputFocused && this.collapseOnFocusOut,\n };\n },\n },\n\n watch: {\n selectedItems: {\n deep: true,\n handler: async function () {\n await this.initSelectedItems();\n },\n },\n\n chipMaxWidth: {\n async handler () {\n await 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.setInitialInputHeight();\n this.setInputPadding();\n this.setChipsTopPosition();\n },\n },\n },\n\n async mounted () {\n this.setInitialInputHeight();\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 await this.initSelectedItems();\n },\n\n beforeUnmount () {\n this.resizeWindowObserver?.unobserve(document.body);\n },\n\n methods: {\n extractNonListeners,\n comboboxHighlight (highlightIndex) {\n this.$emit('combobox-highlight', highlightIndex);\n },\n\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 if (this.loading) return;\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 getChips () {\n if (!this.selectedItems.length || !this.$refs.chips) return null;\n\n // Use the order from selectedItems to not rely on DOM order which may be stale.\n // Track matched indices to handle duplicate item names correctly.\n const matched = new Set();\n const chips = this.selectedItems.map(item => {\n return this.$refs.chips.find((chip, index) => {\n if (matched.has(index)) return false;\n const chipLabel = returnFirstEl(chip.$el)?.querySelector('.d-chip__label')?.textContent?.trim();\n if (chipLabel === item) {\n matched.add(index);\n return true;\n }\n return false;\n });\n });\n return chips.filter(Boolean).map(chip => returnFirstEl(chip.$el));\n },\n\n getChipButtons () {\n const chips = this.getChips();\n return chips && chips.map(chip => returnFirstEl(chip).querySelector('button'));\n },\n\n getLastChipButton () {\n const chipButtons = this.getChipButtons();\n return chipButtons && chipButtons[chipButtons.length - 1];\n },\n\n getLastChip () {\n const chips = this.getChips();\n return chips && chips[chips.length - 1];\n },\n\n getFirstChip () {\n const chips = this.getChips();\n return chips && chips[0];\n },\n\n getInput () {\n return this.$refs.input?.$refs.input;\n },\n\n onChipKeyDown (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 onInputKeyDown (event) {\n const key = event.key?.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 there is selected text, do not focus the last chip\n if (event.target.selectionEnd !== event.target.selectionStart) {\n return;\n }\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[String(this.size)]) + 'px';\n },\n\n setInputPadding () {\n const lastChip = this.getLastChip();\n const input = this.getInput();\n if (!input) return;\n this.revertInputPadding(input);\n this.popoverOffset = [0, 4];\n if (!lastChip) return;\n // Avoid adding extra padding when the input is not focused if collapseOnFocusOut is true\n // This ensures the input returns to its original state when resizing\n if (this.collapseOnFocusOut && !this.inputFocused) 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 const spaceLeft = input.getBoundingClientRect().width - left;\n const firstChip = this.getFirstChip();\n const isWrapped = firstChip && lastChip.offsetTop > firstChip.offsetTop;\n\n if (spaceLeft > this.reservedRightSpace) {\n input.style.paddingInlineStart = left + 'px';\n } else {\n input.style.paddingInlineStart = '4px';\n }\n\n const paddingTop = this.getInputPaddingTop(lastChip, spaceLeft > this.reservedRightSpace, isWrapped);\n if (paddingTop != null) input.style.paddingTop = `${paddingTop}px`;\n },\n\n getInputPaddingTop (lastChip, hasSpace, isWrapped) {\n // Chip fits beside the cursor on its row; CSS handles vertical centering.\n if (hasSpace && !isWrapped) return null;\n // Chip wrapped onto a new row with space remaining; align cursor to it.\n if (hasSpace) return lastChip.offsetTop + 2;\n // No space on the chip's row — predict next-row offsetTop so paddingTop\n // stays stable when a chip lands there.\n const chipMarginTop = parseFloat(getComputedStyle(lastChip).marginTop) || 0;\n const lastChipHeight = lastChip.getBoundingClientRect().height;\n return lastChip.offsetTop + lastChipHeight + chipMarginTop + 2;\n },\n\n revertInputPadding (input) {\n input.style.paddingInlineStart = '';\n input.style.paddingBlockStart = '';\n input.style.paddingBlockEnd = '';\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 setInitialInputHeight () {\n const input = this.getInput();\n if (!input) return;\n input.style.minHeight = '';\n input.style.height = '';\n this.initialInputHeight = input.getBoundingClientRect().height;\n // xs renders correctly without a min-height floor; other sizes need it to grow when chips wrap.\n if (this.size !== 'xs') {\n input.style.minHeight = `${this.initialInputHeight}px`;\n input.style.height = 'auto';\n }\n },\n\n async handleInputFocusIn () {\n this.inputFocused = true;\n if (this.collapseOnFocusOut) {\n this.hideInputText = false;\n await this.$nextTick();\n this.setInputPadding();\n }\n },\n\n async handleInputFocusOut () {\n this.inputFocused = false;\n if (this.collapseOnFocusOut) {\n this.hideInputText = true;\n const input = this.getInput();\n if (!input) return;\n // Hide the input text when is not on first line\n if (!input.style.paddingTop) {\n return;\n }\n this.revertInputPadding(input);\n }\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;;;AAmJA,IAAK,IAAU;CACb,MAAM;CAEN,YAAY;EACV,uBAAA;EACA,SAAA;EACA,QAAA;EACA,sBAAA;EACD;CAED,cAAc;CAEd,OAAO;EAIL,OAAO;GACL,MAAM;GACN,UAAU;GACX;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAKD,eAAe;GACb,MAAM;GACN,eAAe,EAAE;GACjB,YAAW,MACF,EAA2B,EAAc;GAEnD;EAKD,mBAAmB;GACjB,MAAM;GACN,SAAS;GACV;EAYD,SAAS;GACP,MAAM;GACN,SAAS;GACV;EAKD,gBAAgB;GACd,MAAM;GACN,SAAS;GACV;EAQD,UAAU;GACR,MAAM;GACN,SAAS;GACV;EAMD,eAAe;GACb,MAAM;GACN,SAAS;GACV;EAKD,eAAe;GACb,MAAM;GACN,SAAS,WAAY;AAAE,WAAO,EAAE;;GACjC;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAMD,oBAAoB;GAClB,MAAM;GACN,SAAS,WAAY;AAAE,WAAO,EAAE;;GACjC;EAMD,mBAAmB;GACjB,MAAM;GACN,SA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aAAa,EAAA;IACb,aAAa,EAAA;IACb,iBAAe,EAAA;IACf,UAAU,EAAA;IACV,MAAM,EAAA;MACC,EAAA,gBAAc,EACrB,uBAAoB,GAAO,CAAA,EAAA,MAAA,IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,CAAA;GAG9B,EAIE,GAAA;IAHC,IAAI,EAAA;IACJ,uBAAqB,EAAA;IACrB,iBAAe,EAAA;;;;;;;EAmBX,MAAI,QAgBP,CAfN,EAeM,OAAA;GAdJ,KAAI;GACH,OAAK,EAAA,CAAA,iCAAoC,EAAA,UAAS,CAAA;GAClD,aAAS,EAAA,OAAA,EAAA,KAAA,QAAV,IAAkB,CAAA,UAAA,CAAA;MAGT,EAAA,WAEP,GAAA,EACF,EAKM,OALN,GAKM,EADD,EAAA,eAAc,EAAA,EAAA,IARnB,EAGE,EAAA,QAAA,QAAA,EAAA,KAAA,GAAA,CAAA,CAKiB,EAAA,GAAA,CAAA,CAAA;;KA1Bf,EAAA,eAAe,EAAA,OAAO,OAAM,GAAA;QACjC;cAOK,CALN,EAKM,OAAA;GAJJ,KAAI;GACH,OAAK,EAAE,EAAA,YAAW;MAEnB,EAAsB,EAAA,QAAA,SAAA,CAAA,EAAA,EAAA,CAAA,CAAA;;aA0BlB,EAAA,eAAe,EAAA,OAAO,OAAM,GAAA;QACjC;cAOK,CALN,EAKM,OAAA;GAJJ,KAAI;GACH,OAAK,EAAE,EAAA,YAAW;MAEnB,EAAsB,EAAA,QAAA,SAAA,CAAA,EAAA,EAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./combobox-multi-select-constants.cjs`),t=require(`./combobox-multi-select.cjs`);exports.CHIP_SIZES=e.CHIP_SIZES,exports.CHIP_TOP_POSITION=e.CHIP_TOP_POSITION,exports.DtComboboxMultiSelect=t.default,exports.DtRecipeComboboxMultiSelect=t.default,exports.MULTI_SELECT_SIZES=e.MULTI_SELECT_SIZES;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./combobox-multi-select-constants.cjs`),t=require(`./combobox-multi-select.cjs`);exports.CHIP_SIZES=e.CHIP_SIZES,exports.CHIP_TOP_POSITION=e.CHIP_TOP_POSITION,exports.DtComboboxMultiSelect=t.default,exports.MULTI_SELECT_SIZES=e.MULTI_SELECT_SIZES;
@@ -1,3 +1,3 @@
1
1
  import { CHIP_SIZES as e, CHIP_TOP_POSITION as t, MULTI_SELECT_SIZES as n } from "./combobox-multi-select-constants.js";
2
2
  import r from "./combobox-multi-select.js";
3
- export { e as CHIP_SIZES, t as CHIP_TOP_POSITION, r as DtComboboxMultiSelect, r as DtRecipeComboboxMultiSelect, n as MULTI_SELECT_SIZES };
3
+ export { e as CHIP_SIZES, t as CHIP_TOP_POSITION, r as DtComboboxMultiSelect, n as MULTI_SELECT_SIZES };
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/sizes.cjs`),t=require(`../../common/constants/index.cjs`),n=require(`../../common/validators/index.cjs`),r=require(`../../common/utils/index.cjs`),i=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),a=require(`../../mode_constants-CzYJW9ua.cjs`),o=require(`../combobox/combobox-loading-list.cjs`),s=require(`../combobox/combobox-empty-list.cjs`),c=require(`../../Combobox-96zAPv6d.cjs`),l=require(`../combobox/combobox-constants.cjs`),u=require(`../popover/popover-constants.cjs`),d=require(`../popover/popover.cjs`),f=require(`../dropdown/dropdown-constants.cjs`);let p=require(`vue`);var m={name:`DtComboboxWithPopover`,components:{DtCombobox:c.t,DtPopover:d.default,ComboboxLoadingList:o.default,ComboboxEmptyList:s.default},props:{contentMode:a.t,label:{type:String,required:!0},showLabel:{type:Boolean,default:!0},size:{type:[String,Number],default:null,validator:t=>t===null||Object.values(l.COMBOBOX_LABEL_SIZES).includes(t)||n.ordinalSizeValidator(e.COMPONENT_SIZES)(t)},description:{type:String,default:``},showList:{type:Boolean,default:null},listId:{type:String,default(){return r.getUniqueString()}},listClass:{type:[String,Array,Object],default:``},headerClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},dialogClass:{type:[String,Array,Object],default:``},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},maxHeight:{type:String,default:``},maxWidth:{type:String,default:``},padding:{type:String,default:`small`,validator:e=>Object.keys(f.DROPDOWN_PADDING_CLASSES).some(t=>t===e)},contentWidth:{type:String,default:null,validator:e=>u.POPOVER_CONTENT_WIDTHS.includes(e)},openWithArrowKeys:{type:Boolean,default:!1},popoverOffset:{type:Array,default:()=>[0,4]},popoverSticky:{type:[Boolean,String],default:!1},hasSuggestionList:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},emptyList:{type:Boolean,default:!1},emptyStateMessage:{type:String,default:``},appendTo:{type:[t.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>u.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},transition:{type:String,default:`fade`}},emits:[`select`,`escape`,`highlight`,`opened`],data(){return{DROPDOWN_PADDING_CLASSES:f.DROPDOWN_PADDING_CLASSES,isListShown:!1,isInputFocused:!1,isListFocused:!1,externalAnchor:r.getUniqueString(),hasSlotContent:r.hasSlotContent}},computed:{comboboxListeners(){return{...this.$attrs,onSelect:this.onSelect,onEscape:this.onEscape,onHighlight:this.onHighlight}}},watch:{showList:{handler:function(e){e!==null&&(this.isListShown=e)},immediate:!0},isListShown(e){e?window.addEventListener(`mousedown`,this.onFocusOut):window.removeEventListener(`mousedown`,this.onFocusOut),this.onOpened(e)}},methods:{handleDisplayList(e){!this.hasSuggestionList&&e&&this.showComboboxList(),!this.hasSuggestionList&&!e&&this.closeComboboxList()},showComboboxList(){this.showList??(this.isListShown=!0)},closeComboboxList(){this.showList??(this.isListShown=!1)},onSelect(e){this.loading||(this.$emit(`select`,e),this.hasSuggestionList||this.closeComboboxList())},onEscape(){this.$emit(`escape`),this.closeComboboxList()},onHighlight(e){this.loading||this.$emit(`highlight`,e)},onOpened(e){this.$emit(`opened`,e)},onFocusIn(e){this.hasSuggestionList&&e&&this.$refs.input?.querySelector(`input`)===e.target&&this.showComboboxList()},onFocusOut(e){let t=this.$refs.popover?.tip?.popper,n=this.$refs.input;e.composedPath()?.some(e=>[t,n].includes(e))||this.closeComboboxList()},openOnArrowKeyPress(){this.showList!==null||this.isListShown||!this.openWithArrowKeys||this.showComboboxList()}}},h=[`id`],g=[`onMouseleave`,`onFocusout`];function _(e,t,n,r,i,a){let o=(0,p.resolveComponent)(`combobox-loading-list`),s=(0,p.resolveComponent)(`combobox-empty-list`),c=(0,p.resolveComponent)(`dt-popover`),l=(0,p.resolveComponent)(`dt-combobox`);return(0,p.openBlock)(),(0,p.createBlock)(l,(0,p.mergeProps)({ref:`combobox`,loading:n.loading,label:n.label,"show-label":n.showLabel,size:n.size,description:n.description,"empty-list":n.emptyList,"empty-state-message":n.emptyStateMessage,"show-list":i.isListShown,"on-beginning-of-list":n.onBeginningOfList,"on-end-of-list":n.onEndOfList,"list-rendered-outside":!0,"list-id":n.listId,"data-qa":`dt-combobox`},a.comboboxListeners),{input:(0,p.withCtx)(({inputProps:n})=>[(0,p.createElementVNode)(`div`,{id:i.externalAnchor,ref:`input`,onFocusin:t[0]||(t[0]=(...e)=>a.onFocusIn&&a.onFocusIn(...e)),onKeydown:[t[1]||(t[1]=(0,p.withKeys)(e=>a.openOnArrowKeyPress(e),[`up`])),t[2]||(t[2]=(0,p.withKeys)(e=>a.openOnArrowKeyPress(e),[`down`]))]},[(0,p.renderSlot)(e.$slots,`input`,{inputProps:n,onInput:a.handleDisplayList})],40,h)]),list:(0,p.withCtx)(({opened:r,listProps:a,clearHighlightIndex:l})=>[(0,p.createVNode)(c,{ref:`popover`,open:i.isListShown,"onUpdate:open":t[3]||(t[3]=e=>i.isListShown=e),"close-on-click":!1,"max-height":n.maxHeight,"max-width":n.maxWidth,offset:n.popoverOffset,sticky:n.popoverSticky,"content-mode":n.contentMode,placement:`bottom-start`,"initial-focus-element":`none`,padding:`none`,role:`listbox`,"external-anchor":i.externalAnchor,"content-width":n.contentWidth,"content-appear":!0,"content-tabindex":null,modal:!1,"auto-focus":!1,"append-to":n.appendTo,"dialog-class":n.dialogClass,transition:n.transition,onOpened:r},(0,p.createSlots)({content:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`div`,{ref:`listWrapper`,class:(0,p.normalizeClass)([`d-recipe-combobox-with-popover__list`,i.DROPDOWN_PADDING_CLASSES[n.padding],n.listClass]),onMouseleave:l,onFocusout:l},[n.loading?((0,p.openBlock)(),(0,p.createBlock)(o,(0,p.normalizeProps)((0,p.mergeProps)({key:0},a)),null,16)):n.emptyList&&n.emptyStateMessage?((0,p.openBlock)(),(0,p.createBlock)(s,(0,p.mergeProps)({key:1},a,{message:n.emptyStateMessage}),null,16,[`message`])):(0,p.renderSlot)(e.$slots,`list`,{key:2,listProps:a})],42,g)]),_:2},[i.hasSlotContent(e.$slots.header)?{name:`headerContent`,fn:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`div`,{ref:`header`,class:(0,p.normalizeClass)(n.headerClass)},[(0,p.renderSlot)(e.$slots,`header`)],2)]),key:`0`}:void 0,i.hasSlotContent(e.$slots.footer)?{name:`footerContent`,fn:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`div`,{ref:`footer`,class:(0,p.normalizeClass)(n.footerClass)},[(0,p.renderSlot)(e.$slots,`footer`)],2)]),key:`1`}:void 0]),1032,[`open`,`max-height`,`max-width`,`offset`,`sticky`,`content-mode`,`external-anchor`,`content-width`,`append-to`,`dialog-class`,`transition`,`onOpened`])]),_:3},16,[`loading`,`label`,`show-label`,`size`,`description`,`empty-list`,`empty-state-message`,`show-list`,`on-beginning-of-list`,`on-end-of-list`,`list-id`])}var v=i.t(m,[[`render`,_]]);exports.default=v;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/constants/sizes.cjs`),t=require(`../../common/constants/index.cjs`),n=require(`../../common/validators/index.cjs`),r=require(`../../common/utils/index.cjs`),i=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),a=require(`../../mode_constants-CzYJW9ua.cjs`),o=require(`../combobox/combobox-loading-list.cjs`),s=require(`../combobox/combobox-empty-list.cjs`),c=require(`../../Combobox-96zAPv6d.cjs`),l=require(`../combobox/combobox-constants.cjs`),u=require(`../popover/popover-constants.cjs`),d=require(`../popover/popover.cjs`),f=require(`../dropdown/dropdown-constants.cjs`);let p=require(`vue`);var m={name:`DtComboboxWithPopover`,components:{DtCombobox:c.t,DtPopover:d.default,ComboboxLoadingList:o.default,ComboboxEmptyList:s.default},props:{contentMode:a.t,label:{type:String,required:!0},showLabel:{type:Boolean,default:!0},size:{type:[String,Number],default:null,validator:t=>t===null||Object.values(l.COMBOBOX_LABEL_SIZES).includes(t)||n.ordinalSizeValidator(e.COMPONENT_SIZES)(t)},description:{type:String,default:``},showList:{type:Boolean,default:null},listId:{type:String,default(){return r.getUniqueString()}},listClass:{type:[String,Array,Object],default:``},headerClass:{type:[String,Array,Object],default:``},footerClass:{type:[String,Array,Object],default:``},dialogClass:{type:[String,Array,Object],default:``},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},maxHeight:{type:String,default:``},maxWidth:{type:String,default:``},padding:{type:String,default:`small`,validator:e=>Object.keys(f.DROPDOWN_PADDING_CLASSES).some(t=>t===e)},contentWidth:{type:String,default:null,validator:e=>u.POPOVER_CONTENT_WIDTHS.includes(e)},openWithArrowKeys:{type:Boolean,default:!1},popoverOffset:{type:Array,default:()=>[0,4]},popoverSticky:{type:[Boolean,String],default:!1},hasSuggestionList:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},emptyList:{type:Boolean,default:!1},emptyStateMessage:{type:String,default:``},appendTo:{type:[t.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>u.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},transition:{type:String,default:`fade`}},emits:[`select`,`escape`,`highlight`,`opened`],data(){return{DROPDOWN_PADDING_CLASSES:f.DROPDOWN_PADDING_CLASSES,isListShown:!1,isInputFocused:!1,isListFocused:!1,externalAnchor:r.getUniqueString(),hasSlotContent:r.hasSlotContent}},computed:{comboboxListeners(){return{...this.$attrs,onSelect:this.onSelect,onEscape:this.onEscape,onHighlight:this.onHighlight}}},watch:{showList:{handler:function(e){e!==null&&(this.isListShown=e)},immediate:!0},isListShown(e){e?window.addEventListener(`mousedown`,this.onFocusOut):window.removeEventListener(`mousedown`,this.onFocusOut),this.onOpened(e)}},methods:{handleDisplayList(e){!this.hasSuggestionList&&e&&this.showComboboxList(),!this.hasSuggestionList&&!e&&this.closeComboboxList()},showComboboxList(){this.showList??(this.isListShown=!0)},closeComboboxList(){this.showList??(this.isListShown=!1)},onSelect(e){this.loading||(this.$emit(`select`,e),this.hasSuggestionList||this.closeComboboxList())},onEscape(){this.$emit(`escape`),this.closeComboboxList()},onHighlight(e){this.loading||this.$emit(`highlight`,e)},onOpened(e){this.$emit(`opened`,e)},onFocusIn(e){this.hasSuggestionList&&e&&this.$refs.input?.querySelector(`input`)===e.target&&this.showComboboxList()},onFocusOut(e){let t=this.$refs.popover?.tip?.popper,n=this.$refs.input;e.composedPath()?.some(e=>[t,n].includes(e))||this.closeComboboxList()},openOnArrowKeyPress(){this.showList!==null||this.isListShown||!this.openWithArrowKeys||this.showComboboxList()}}},h=[`id`],g=[`onMouseleave`,`onFocusout`];function _(e,t,n,r,i,a){let o=(0,p.resolveComponent)(`combobox-loading-list`),s=(0,p.resolveComponent)(`combobox-empty-list`),c=(0,p.resolveComponent)(`dt-popover`),l=(0,p.resolveComponent)(`dt-combobox`);return(0,p.openBlock)(),(0,p.createBlock)(l,(0,p.mergeProps)({ref:`combobox`,loading:n.loading,label:n.label,"show-label":n.showLabel,size:n.size,description:n.description,"empty-list":n.emptyList,"empty-state-message":n.emptyStateMessage,"show-list":i.isListShown,"on-beginning-of-list":n.onBeginningOfList,"on-end-of-list":n.onEndOfList,"list-rendered-outside":!0,"list-id":n.listId,"data-qa":`dt-combobox`},a.comboboxListeners),{input:(0,p.withCtx)(({inputProps:n})=>[(0,p.createElementVNode)(`div`,{id:i.externalAnchor,ref:`input`,onFocusin:t[0]||(t[0]=(...e)=>a.onFocusIn&&a.onFocusIn(...e)),onKeydown:[t[1]||(t[1]=(0,p.withKeys)(e=>a.openOnArrowKeyPress(e),[`up`])),t[2]||(t[2]=(0,p.withKeys)(e=>a.openOnArrowKeyPress(e),[`down`]))]},[(0,p.renderSlot)(e.$slots,`input`,{inputProps:n,onInput:a.handleDisplayList})],40,h)]),list:(0,p.withCtx)(({opened:r,listProps:a,clearHighlightIndex:l})=>[(0,p.createVNode)(c,{ref:`popover`,open:i.isListShown,"onUpdate:open":t[3]||(t[3]=e=>i.isListShown=e),"close-on-click":!1,"max-height":n.maxHeight,"max-width":n.maxWidth,offset:n.popoverOffset,sticky:n.popoverSticky,"content-mode":n.contentMode,placement:`bottom-start`,"initial-focus-element":`none`,padding:`none`,role:`listbox`,"external-anchor":i.externalAnchor,"content-width":n.contentWidth,"content-appear":!0,"content-tabindex":null,modal:!1,"auto-focus":!1,"append-to":n.appendTo,"dialog-class":n.dialogClass,transition:n.transition,onOpened:r},(0,p.createSlots)({content:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`div`,{ref:`listWrapper`,class:(0,p.normalizeClass)([`d-combobox-with-popover__list`,i.DROPDOWN_PADDING_CLASSES[n.padding],n.listClass]),onMouseleave:l,onFocusout:l},[n.loading?((0,p.openBlock)(),(0,p.createBlock)(o,(0,p.normalizeProps)((0,p.mergeProps)({key:0},a)),null,16)):n.emptyList&&n.emptyStateMessage?((0,p.openBlock)(),(0,p.createBlock)(s,(0,p.mergeProps)({key:1},a,{message:n.emptyStateMessage}),null,16,[`message`])):(0,p.renderSlot)(e.$slots,`list`,{key:2,listProps:a})],42,g)]),_:2},[i.hasSlotContent(e.$slots.header)?{name:`headerContent`,fn:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`div`,{ref:`header`,class:(0,p.normalizeClass)(n.headerClass)},[(0,p.renderSlot)(e.$slots,`header`)],2)]),key:`0`}:void 0,i.hasSlotContent(e.$slots.footer)?{name:`footerContent`,fn:(0,p.withCtx)(()=>[(0,p.createElementVNode)(`div`,{ref:`footer`,class:(0,p.normalizeClass)(n.footerClass)},[(0,p.renderSlot)(e.$slots,`footer`)],2)]),key:`1`}:void 0]),1032,[`open`,`max-height`,`max-width`,`offset`,`sticky`,`content-mode`,`external-anchor`,`content-width`,`append-to`,`dialog-class`,`transition`,`onOpened`])]),_:3},16,[`loading`,`label`,`show-label`,`size`,`description`,`empty-list`,`empty-state-message`,`show-list`,`on-beginning-of-list`,`on-end-of-list`,`list-id`])}var v=i.t(m,[[`render`,_]]);exports.default=v;
2
2
  //# sourceMappingURL=combobox-with-popover.cjs.map