@milaboratories/uikit 2.15.37 → 2.15.39

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 (457) hide show
  1. package/.turbo/turbo-build.log +175 -175
  2. package/.turbo/turbo-formatter$colon$check.log +2 -2
  3. package/.turbo/turbo-linter$colon$check.log +2 -2
  4. package/.turbo/turbo-types$colon$check.log +1 -1
  5. package/CHANGELOG.md +12 -0
  6. package/dist/__tests__/default-testid.test.d.ts +2 -0
  7. package/dist/__tests__/default-testid.test.d.ts.map +1 -0
  8. package/dist/base/BtnBase.js.map +1 -1
  9. package/dist/base/BtnBase.vue.d.ts.map +1 -1
  10. package/dist/base/BtnBase.vue2.js +6 -1
  11. package/dist/base/BtnBase.vue2.js.map +1 -1
  12. package/dist/components/DropdownListItem.js.map +1 -1
  13. package/dist/components/DropdownListItem.vue.d.ts.map +1 -1
  14. package/dist/components/DropdownListItem.vue2.js +13 -4
  15. package/dist/components/DropdownListItem.vue2.js.map +1 -1
  16. package/dist/components/InputRange.js.map +1 -1
  17. package/dist/components/InputRange.vue.d.ts.map +1 -1
  18. package/dist/components/InputRange.vue2.js +10 -2
  19. package/dist/components/InputRange.vue2.js.map +1 -1
  20. package/dist/components/PlAccordion/PlAccordionSection.js.map +1 -1
  21. package/dist/components/PlAccordion/PlAccordionSection.style.js.map +1 -1
  22. package/dist/components/PlAccordion/PlAccordionSection.vue.d.ts.map +1 -1
  23. package/dist/components/PlAccordion/PlAccordionSection.vue2.js +7 -1
  24. package/dist/components/PlAccordion/PlAccordionSection.vue2.js.map +1 -1
  25. package/dist/components/PlAlert/PlAlert.js.map +1 -1
  26. package/dist/components/PlAlert/PlAlert.vue.d.ts.map +1 -1
  27. package/dist/components/PlAlert/PlAlert.vue2.js +10 -1
  28. package/dist/components/PlAlert/PlAlert.vue2.js.map +1 -1
  29. package/dist/components/PlAutocomplete/PlAutocomplete.js.map +1 -1
  30. package/dist/components/PlAutocomplete/PlAutocomplete.vue.d.ts.map +1 -1
  31. package/dist/components/PlAutocomplete/PlAutocomplete.vue2.js +29 -11
  32. package/dist/components/PlAutocomplete/PlAutocomplete.vue2.js.map +1 -1
  33. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.js.map +1 -1
  34. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.d.ts.map +1 -1
  35. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue2.js +30 -9
  36. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue2.js.map +1 -1
  37. package/dist/components/PlBtnAccent/PlBtnAccent.js.map +1 -1
  38. package/dist/components/PlBtnAccent/PlBtnAccent.vue.d.ts.map +1 -1
  39. package/dist/components/PlBtnAccent/PlBtnAccent.vue2.js +4 -1
  40. package/dist/components/PlBtnAccent/PlBtnAccent.vue2.js.map +1 -1
  41. package/dist/components/PlBtnDanger/PlBtnDanger.js.map +1 -1
  42. package/dist/components/PlBtnDanger/PlBtnDanger.vue.d.ts.map +1 -1
  43. package/dist/components/PlBtnDanger/PlBtnDanger.vue2.js +4 -1
  44. package/dist/components/PlBtnDanger/PlBtnDanger.vue2.js.map +1 -1
  45. package/dist/components/PlBtnGhost/PlBtnGhost.js.map +1 -1
  46. package/dist/components/PlBtnGhost/PlBtnGhost.vue.d.ts.map +1 -1
  47. package/dist/components/PlBtnGhost/PlBtnGhost.vue2.js +7 -1
  48. package/dist/components/PlBtnGhost/PlBtnGhost.vue2.js.map +1 -1
  49. package/dist/components/PlBtnGroup/PlBtnGroup.js.map +1 -1
  50. package/dist/components/PlBtnGroup/PlBtnGroup.vue.d.ts.map +1 -1
  51. package/dist/components/PlBtnGroup/PlBtnGroup.vue2.js +19 -6
  52. package/dist/components/PlBtnGroup/PlBtnGroup.vue2.js.map +1 -1
  53. package/dist/components/PlBtnLink/PlBtnLink.js.map +1 -1
  54. package/dist/components/PlBtnLink/PlBtnLink.vue.d.ts.map +1 -1
  55. package/dist/components/PlBtnLink/PlBtnLink.vue2.js +2 -0
  56. package/dist/components/PlBtnLink/PlBtnLink.vue2.js.map +1 -1
  57. package/dist/components/PlBtnPrimary/PlBtnPrimary.js.map +1 -1
  58. package/dist/components/PlBtnPrimary/PlBtnPrimary.vue.d.ts.map +1 -1
  59. package/dist/components/PlBtnPrimary/PlBtnPrimary.vue2.js +4 -1
  60. package/dist/components/PlBtnPrimary/PlBtnPrimary.vue2.js.map +1 -1
  61. package/dist/components/PlBtnSecondary/PlBtnSecondary.js.map +1 -1
  62. package/dist/components/PlBtnSecondary/PlBtnSecondary.vue.d.ts.map +1 -1
  63. package/dist/components/PlBtnSecondary/PlBtnSecondary.vue2.js +1 -1
  64. package/dist/components/PlBtnSecondary/PlBtnSecondary.vue2.js.map +1 -1
  65. package/dist/components/PlBtnSplit/PlBtnSplit.js.map +1 -1
  66. package/dist/components/PlBtnSplit/PlBtnSplit.vue.d.ts.map +1 -1
  67. package/dist/components/PlBtnSplit/PlBtnSplit.vue2.js +6 -0
  68. package/dist/components/PlBtnSplit/PlBtnSplit.vue2.js.map +1 -1
  69. package/dist/components/PlChartHistogram/PlChartHistogram.js.map +1 -1
  70. package/dist/components/PlChartHistogram/PlChartHistogram.style.js.map +1 -1
  71. package/dist/components/PlChartHistogram/PlChartHistogram.vue.d.ts.map +1 -1
  72. package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js +7 -2
  73. package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js.map +1 -1
  74. package/dist/components/PlChartHistogram/createGridlines.d.ts.map +1 -1
  75. package/dist/components/PlChartHistogram/createGridlines.js +1 -1
  76. package/dist/components/PlChartHistogram/createGridlines.js.map +1 -1
  77. package/dist/components/PlChartHistogram/createLabels.d.ts.map +1 -1
  78. package/dist/components/PlChartHistogram/createLabels.js +1 -1
  79. package/dist/components/PlChartHistogram/createLabels.js.map +1 -1
  80. package/dist/components/PlChartHistogram/createSvgContainer.d.ts.map +1 -1
  81. package/dist/components/PlChartHistogram/createSvgContainer.js +1 -1
  82. package/dist/components/PlChartHistogram/createSvgContainer.js.map +1 -1
  83. package/dist/components/PlChartHistogram/drawBins.d.ts.map +1 -1
  84. package/dist/components/PlChartHistogram/drawBins.js +2 -2
  85. package/dist/components/PlChartHistogram/drawBins.js.map +1 -1
  86. package/dist/components/PlChartHistogram/drawThreshold.d.ts.map +1 -1
  87. package/dist/components/PlChartHistogram/drawThreshold.js +1 -1
  88. package/dist/components/PlChartHistogram/drawThreshold.js.map +1 -1
  89. package/dist/components/PlChartHistogram/histogram.d.ts.map +1 -1
  90. package/dist/components/PlChartHistogram/histogram.js +1 -1
  91. package/dist/components/PlChartHistogram/histogram.js.map +1 -1
  92. package/dist/components/PlChartStackedBar/Legends.js.map +1 -1
  93. package/dist/components/PlChartStackedBar/Legends.style.js.map +1 -1
  94. package/dist/components/PlChartStackedBar/Legends.vue.d.ts.map +1 -1
  95. package/dist/components/PlChartStackedBar/Legends.vue2.js +7 -1
  96. package/dist/components/PlChartStackedBar/Legends.vue2.js.map +1 -1
  97. package/dist/components/PlChartStackedBar/PlChartStackedBar.js.map +1 -1
  98. package/dist/components/PlChartStackedBar/PlChartStackedBar.style.js.map +1 -1
  99. package/dist/components/PlChartStackedBar/PlChartStackedBar.vue.d.ts.map +1 -1
  100. package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js +5 -1
  101. package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js.map +1 -1
  102. package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.js.map +1 -1
  103. package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.style.js.map +1 -1
  104. package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.vue.d.ts.map +1 -1
  105. package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.vue2.js +4 -1
  106. package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.vue2.js.map +1 -1
  107. package/dist/components/PlChartStackedBar/StackedRow.js.map +1 -1
  108. package/dist/components/PlChartStackedBar/StackedRow.style.js.map +1 -1
  109. package/dist/components/PlChartStackedBar/StackedRow.vue.d.ts.map +1 -1
  110. package/dist/components/PlChartStackedBar/StackedRow.vue2.js +13 -3
  111. package/dist/components/PlChartStackedBar/StackedRow.vue2.js.map +1 -1
  112. package/dist/components/PlChartStackedBar/StackedRowCompact.js.map +1 -1
  113. package/dist/components/PlChartStackedBar/StackedRowCompact.style.js.map +1 -1
  114. package/dist/components/PlChartStackedBar/StackedRowCompact.vue.d.ts.map +1 -1
  115. package/dist/components/PlChartStackedBar/StackedRowCompact.vue2.js +8 -2
  116. package/dist/components/PlChartStackedBar/StackedRowCompact.vue2.js.map +1 -1
  117. package/dist/components/PlCheckbox/PlCheckbox.js.map +1 -1
  118. package/dist/components/PlCheckbox/PlCheckbox.vue.d.ts.map +1 -1
  119. package/dist/components/PlCheckbox/PlCheckbox.vue2.js +9 -2
  120. package/dist/components/PlCheckbox/PlCheckbox.vue2.js.map +1 -1
  121. package/dist/components/PlCheckbox/PlCheckboxBase.js.map +1 -1
  122. package/dist/components/PlCheckbox/PlCheckboxBase.vue.d.ts.map +1 -1
  123. package/dist/components/PlCheckbox/PlCheckboxBase.vue2.js +1 -0
  124. package/dist/components/PlCheckbox/PlCheckboxBase.vue2.js.map +1 -1
  125. package/dist/components/PlCheckboxGroup/PlCheckboxGroup.js.map +1 -1
  126. package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue.d.ts.map +1 -1
  127. package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue2.js +19 -5
  128. package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue2.js.map +1 -1
  129. package/dist/components/PlChip/PlChip.js.map +1 -1
  130. package/dist/components/PlChip/PlChip.vue.d.ts.map +1 -1
  131. package/dist/components/PlChip/PlChip.vue2.js +7 -1
  132. package/dist/components/PlChip/PlChip.vue2.js.map +1 -1
  133. package/dist/components/PlClipboard/PlClipboard.js.map +1 -1
  134. package/dist/components/PlClipboard/PlClipboard.style.js.map +1 -1
  135. package/dist/components/PlClipboard/PlClipboard.vue.d.ts.map +1 -1
  136. package/dist/components/PlClipboard/PlClipboard.vue2.js +1 -0
  137. package/dist/components/PlClipboard/PlClipboard.vue2.js.map +1 -1
  138. package/dist/components/PlConfirmDialog.js.map +1 -1
  139. package/dist/components/PlConfirmDialog.vue.d.ts.map +1 -1
  140. package/dist/components/PlConfirmDialog.vue2.js +9 -2
  141. package/dist/components/PlConfirmDialog.vue2.js.map +1 -1
  142. package/dist/components/PlDialogModal/PlDialogModal.js.map +1 -1
  143. package/dist/components/PlDialogModal/PlDialogModal.vue.d.ts.map +1 -1
  144. package/dist/components/PlDialogModal/PlDialogModal.vue2.js +12 -5
  145. package/dist/components/PlDialogModal/PlDialogModal.vue2.js.map +1 -1
  146. package/dist/components/PlDropdown/OptionList.js.map +1 -1
  147. package/dist/components/PlDropdown/OptionList.vue.d.ts.map +1 -1
  148. package/dist/components/PlDropdown/OptionList.vue2.js +11 -5
  149. package/dist/components/PlDropdown/OptionList.vue2.js.map +1 -1
  150. package/dist/components/PlDropdown/PlDropdown.js.map +1 -1
  151. package/dist/components/PlDropdown/PlDropdown.vue.d.ts.map +1 -1
  152. package/dist/components/PlDropdown/PlDropdown.vue2.js +26 -10
  153. package/dist/components/PlDropdown/PlDropdown.vue2.js.map +1 -1
  154. package/dist/components/PlDropdownLegacy/PlDropdownLegacy.js.map +1 -1
  155. package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.d.ts.map +1 -1
  156. package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue2.js +32 -10
  157. package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue2.js.map +1 -1
  158. package/dist/components/PlDropdownLine/PlDropdownLine.js.map +1 -1
  159. package/dist/components/PlDropdownLine/PlDropdownLine.vue.d.ts.map +1 -1
  160. package/dist/components/PlDropdownLine/PlDropdownLine.vue2.js +17 -3
  161. package/dist/components/PlDropdownLine/PlDropdownLine.vue2.js.map +1 -1
  162. package/dist/components/PlDropdownLine/ResizableInput.js.map +1 -1
  163. package/dist/components/PlDropdownLine/ResizableInput.vue.d.ts.map +1 -1
  164. package/dist/components/PlDropdownLine/ResizableInput.vue2.js +5 -2
  165. package/dist/components/PlDropdownLine/ResizableInput.vue2.js.map +1 -1
  166. package/dist/components/PlDropdownMulti/PlDropdownMulti.js.map +1 -1
  167. package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.d.ts.map +1 -1
  168. package/dist/components/PlDropdownMulti/PlDropdownMulti.vue2.js +31 -10
  169. package/dist/components/PlDropdownMulti/PlDropdownMulti.vue2.js.map +1 -1
  170. package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.js.map +1 -1
  171. package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.d.ts.map +1 -1
  172. package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue2.js +1 -1
  173. package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue2.js.map +1 -1
  174. package/dist/components/PlDropdownRef/PlDropdownRef.js.map +1 -1
  175. package/dist/components/PlDropdownRef/PlDropdownRef.vue.d.ts.map +1 -1
  176. package/dist/components/PlDropdownRef/PlDropdownRef.vue2.js +1 -1
  177. package/dist/components/PlDropdownRef/PlDropdownRef.vue2.js.map +1 -1
  178. package/dist/components/PlEditableTitle/PlEditableTitle.js.map +1 -1
  179. package/dist/components/PlEditableTitle/PlEditableTitle.vue.d.ts.map +1 -1
  180. package/dist/components/PlEditableTitle/PlEditableTitle.vue2.js +9 -3
  181. package/dist/components/PlEditableTitle/PlEditableTitle.vue2.js.map +1 -1
  182. package/dist/components/PlElementList/PlElementList.js.map +1 -1
  183. package/dist/components/PlElementList/PlElementList.style.js.map +1 -1
  184. package/dist/components/PlElementList/PlElementList.vue.d.ts.map +1 -1
  185. package/dist/components/PlElementList/PlElementList.vue2.js +6 -1
  186. package/dist/components/PlElementList/PlElementList.vue2.js.map +1 -1
  187. package/dist/components/PlElementList/PlElementListItem.js.map +1 -1
  188. package/dist/components/PlElementList/PlElementListItem.style.js.map +1 -1
  189. package/dist/components/PlElementList/PlElementListItem.vue.d.ts.map +1 -1
  190. package/dist/components/PlElementList/PlElementListItem.vue2.js +34 -13
  191. package/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
  192. package/dist/components/PlErrorAlert/PlErrorAlert.js.map +1 -1
  193. package/dist/components/PlErrorAlert/PlErrorAlert.style.js.map +1 -1
  194. package/dist/components/PlErrorAlert/PlErrorAlert.vue.d.ts.map +1 -1
  195. package/dist/components/PlErrorAlert/PlErrorAlert.vue2.js +15 -3
  196. package/dist/components/PlErrorAlert/PlErrorAlert.vue2.js.map +1 -1
  197. package/dist/components/PlErrorBoundary/PlErrorBoundary.js.map +1 -1
  198. package/dist/components/PlErrorBoundary/PlErrorBoundary.vue.d.ts.map +1 -1
  199. package/dist/components/PlErrorBoundary/PlErrorBoundary.vue2.js +1 -0
  200. package/dist/components/PlErrorBoundary/PlErrorBoundary.vue2.js.map +1 -1
  201. package/dist/components/PlFileDialog/Local.js.map +1 -1
  202. package/dist/components/PlFileDialog/Local.vue.d.ts.map +1 -1
  203. package/dist/components/PlFileDialog/Local.vue2.js +23 -20
  204. package/dist/components/PlFileDialog/Local.vue2.js.map +1 -1
  205. package/dist/components/PlFileDialog/PlFileDialog.js.map +1 -1
  206. package/dist/components/PlFileDialog/PlFileDialog.vue.d.ts.map +1 -1
  207. package/dist/components/PlFileDialog/PlFileDialog.vue2.js +5 -1
  208. package/dist/components/PlFileDialog/PlFileDialog.vue2.js.map +1 -1
  209. package/dist/components/PlFileDialog/Remote.js.map +1 -1
  210. package/dist/components/PlFileDialog/Remote.vue.d.ts.map +1 -1
  211. package/dist/components/PlFileDialog/Remote.vue2.js +108 -94
  212. package/dist/components/PlFileDialog/Remote.vue2.js.map +1 -1
  213. package/dist/components/PlFileDialog/Shortcuts.js.map +1 -1
  214. package/dist/components/PlFileDialog/Shortcuts.style.js.map +1 -1
  215. package/dist/components/PlFileDialog/Shortcuts.vue.d.ts.map +1 -1
  216. package/dist/components/PlFileDialog/Shortcuts.vue2.js +2 -1
  217. package/dist/components/PlFileDialog/Shortcuts.vue2.js.map +1 -1
  218. package/dist/components/PlFileInput/PlFileInput.js.map +1 -1
  219. package/dist/components/PlFileInput/PlFileInput.vue.d.ts.map +1 -1
  220. package/dist/components/PlFileInput/PlFileInput.vue2.js +92 -71
  221. package/dist/components/PlFileInput/PlFileInput.vue2.js.map +1 -1
  222. package/dist/components/PlLoaderCircular/PlLoaderCircular.js.map +1 -1
  223. package/dist/components/PlLoaderCircular/PlLoaderCircular.vue.d.ts.map +1 -1
  224. package/dist/components/PlLoaderCircular/PlLoaderCircular.vue2.js +4 -1
  225. package/dist/components/PlLoaderCircular/PlLoaderCircular.vue2.js.map +1 -1
  226. package/dist/components/PlLoaderLogo.js.map +1 -1
  227. package/dist/components/PlLoaderLogo.style.js.map +1 -1
  228. package/dist/components/PlLoaderLogo.vue.css +1 -1
  229. package/dist/components/PlLoaderLogo.vue.d.ts.map +1 -1
  230. package/dist/components/PlLoaderLogo.vue2.js +4 -3
  231. package/dist/components/PlLoaderLogo.vue2.js.map +1 -1
  232. package/dist/components/PlLogView/PlLogView.js.map +1 -1
  233. package/dist/components/PlLogView/PlLogView.vue.d.ts.map +1 -1
  234. package/dist/components/PlLogView/PlLogView.vue2.js +13 -1
  235. package/dist/components/PlLogView/PlLogView.vue2.js.map +1 -1
  236. package/dist/components/PlNotificationAlert/PlNotificationAlert.js.map +1 -1
  237. package/dist/components/PlNotificationAlert/PlNotificationAlert.vue.d.ts.map +1 -1
  238. package/dist/components/PlNotificationAlert/PlNotificationAlert.vue2.js +8 -2
  239. package/dist/components/PlNotificationAlert/PlNotificationAlert.vue2.js.map +1 -1
  240. package/dist/components/PlNumberField/PlNumberField.js.map +1 -1
  241. package/dist/components/PlNumberField/PlNumberField.vue.d.ts.map +1 -1
  242. package/dist/components/PlNumberField/PlNumberField.vue2.js +12 -3
  243. package/dist/components/PlNumberField/PlNumberField.vue2.js.map +1 -1
  244. package/dist/components/PlProgressBar/PlProgressBar.js.map +1 -1
  245. package/dist/components/PlProgressBar/PlProgressBar.vue.d.ts.map +1 -1
  246. package/dist/components/PlProgressBar/PlProgressBar.vue2.js +9 -1
  247. package/dist/components/PlProgressBar/PlProgressBar.vue2.js.map +1 -1
  248. package/dist/components/PlProgressCell/PlProgressCell.js.map +1 -1
  249. package/dist/components/PlProgressCell/PlProgressCell.vue.d.ts.map +1 -1
  250. package/dist/components/PlProgressCell/PlProgressCell.vue2.js +19 -7
  251. package/dist/components/PlProgressCell/PlProgressCell.vue2.js.map +1 -1
  252. package/dist/components/PlRadio/PlRadio.js.map +1 -1
  253. package/dist/components/PlRadio/PlRadio.style.js.map +1 -1
  254. package/dist/components/PlRadio/PlRadio.vue.d.ts.map +1 -1
  255. package/dist/components/PlRadio/PlRadio.vue2.js +10 -3
  256. package/dist/components/PlRadio/PlRadio.vue2.js.map +1 -1
  257. package/dist/components/PlRadio/PlRadioGroup.js.map +1 -1
  258. package/dist/components/PlRadio/PlRadioGroup.style.js.map +1 -1
  259. package/dist/components/PlRadio/PlRadioGroup.vue.d.ts.map +1 -1
  260. package/dist/components/PlRadio/PlRadioGroup.vue2.js +10 -3
  261. package/dist/components/PlRadio/PlRadioGroup.vue2.js.map +1 -1
  262. package/dist/components/PlSearchField/PlSearchField.js.map +1 -1
  263. package/dist/components/PlSearchField/PlSearchField.style.js.map +1 -1
  264. package/dist/components/PlSearchField/PlSearchField.vue.d.ts.map +1 -1
  265. package/dist/components/PlSearchField/PlSearchField.vue2.js +11 -4
  266. package/dist/components/PlSearchField/PlSearchField.vue2.js.map +1 -1
  267. package/dist/components/PlSectionSeparator/PlSectionSeparator.js.map +1 -1
  268. package/dist/components/PlSectionSeparator/PlSectionSeparator.style.js.map +1 -1
  269. package/dist/components/PlSectionSeparator/PlSectionSeparator.vue.d.ts.map +1 -1
  270. package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js +7 -1
  271. package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js.map +1 -1
  272. package/dist/components/PlSidebar/PlSidebarGroup.js.map +1 -1
  273. package/dist/components/PlSidebar/PlSidebarGroup.style.js.map +1 -1
  274. package/dist/components/PlSidebar/PlSidebarGroup.vue.d.ts.map +1 -1
  275. package/dist/components/PlSidebar/PlSidebarGroup.vue2.js +5 -1
  276. package/dist/components/PlSidebar/PlSidebarGroup.vue2.js.map +1 -1
  277. package/dist/components/PlSidebar/PlSidebarItem.js.map +1 -1
  278. package/dist/components/PlSidebar/PlSidebarItem.style.js.map +1 -1
  279. package/dist/components/PlSidebar/PlSidebarItem.vue.d.ts.map +1 -1
  280. package/dist/components/PlSidebar/PlSidebarItem.vue2.js +7 -1
  281. package/dist/components/PlSidebar/PlSidebarItem.vue2.js.map +1 -1
  282. package/dist/components/PlSlideModal/PlPureSlideModal.js.map +1 -1
  283. package/dist/components/PlSlideModal/PlPureSlideModal.vue.d.ts.map +1 -1
  284. package/dist/components/PlSlideModal/PlPureSlideModal.vue2.js +4 -1
  285. package/dist/components/PlSlideModal/PlPureSlideModal.vue2.js.map +1 -1
  286. package/dist/components/PlSlideModal/PlSlideModal.js.map +1 -1
  287. package/dist/components/PlSlideModal/PlSlideModal.style.js.map +1 -1
  288. package/dist/components/PlSlideModal/PlSlideModal.vue.d.ts.map +1 -1
  289. package/dist/components/PlSlideModal/PlSlideModal.vue2.js +7 -2
  290. package/dist/components/PlSlideModal/PlSlideModal.vue2.js.map +1 -1
  291. package/dist/components/PlSpacer/PlSpacer.vue.d.ts.map +1 -1
  292. package/dist/components/PlSplash/PlSplash.js.map +1 -1
  293. package/dist/components/PlSplash/PlSplash.vue.d.ts.map +1 -1
  294. package/dist/components/PlSplash/PlSplash.vue2.js +13 -5
  295. package/dist/components/PlSplash/PlSplash.vue2.js.map +1 -1
  296. package/dist/components/PlStatusTag/PlStatusTag.js.map +1 -1
  297. package/dist/components/PlStatusTag/PlStatusTag.vue.d.ts.map +1 -1
  298. package/dist/components/PlStatusTag/PlStatusTag.vue2.js +4 -1
  299. package/dist/components/PlStatusTag/PlStatusTag.vue2.js.map +1 -1
  300. package/dist/components/PlTabs/PlTabs.js.map +1 -1
  301. package/dist/components/PlTabs/PlTabs.vue.d.ts.map +1 -1
  302. package/dist/components/PlTabs/PlTabs.vue2.js +16 -11
  303. package/dist/components/PlTabs/PlTabs.vue2.js.map +1 -1
  304. package/dist/components/PlTextArea/PlTextArea.js.map +1 -1
  305. package/dist/components/PlTextArea/PlTextArea.vue.d.ts.map +1 -1
  306. package/dist/components/PlTextArea/PlTextArea.vue2.js +21 -8
  307. package/dist/components/PlTextArea/PlTextArea.vue2.js.map +1 -1
  308. package/dist/components/PlTextField/PlTextField.js.map +1 -1
  309. package/dist/components/PlTextField/PlTextField.vue.d.ts.map +1 -1
  310. package/dist/components/PlTextField/PlTextField.vue2.js +23 -9
  311. package/dist/components/PlTextField/PlTextField.vue2.js.map +1 -1
  312. package/dist/components/PlToggleSwitch/PlToggleSwitch.js.map +1 -1
  313. package/dist/components/PlToggleSwitch/PlToggleSwitch.vue.d.ts.map +1 -1
  314. package/dist/components/PlToggleSwitch/PlToggleSwitch.vue2.js +10 -2
  315. package/dist/components/PlToggleSwitch/PlToggleSwitch.vue2.js.map +1 -1
  316. package/dist/components/PlTooltip/PlTooltip.js.map +1 -1
  317. package/dist/components/PlTooltip/PlTooltip.style.js.map +1 -1
  318. package/dist/components/PlTooltip/PlTooltip.vue.css +1 -1
  319. package/dist/components/PlTooltip/PlTooltip.vue.d.ts.map +1 -1
  320. package/dist/components/PlTooltip/PlTooltip.vue2.js +7 -2
  321. package/dist/components/PlTooltip/PlTooltip.vue2.js.map +1 -1
  322. package/dist/components/Slider.js.map +1 -1
  323. package/dist/components/Slider.vue.d.ts.map +1 -1
  324. package/dist/components/Slider.vue2.js +13 -1
  325. package/dist/components/Slider.vue2.js.map +1 -1
  326. package/dist/components/SliderRange.js.map +1 -1
  327. package/dist/components/SliderRange.vue.d.ts.map +1 -1
  328. package/dist/components/SliderRange.vue2.js +14 -1
  329. package/dist/components/SliderRange.vue2.js.map +1 -1
  330. package/dist/components/SliderRangeTriple.js.map +1 -1
  331. package/dist/components/SliderRangeTriple.vue.d.ts.map +1 -1
  332. package/dist/components/SliderRangeTriple.vue2.js +13 -1
  333. package/dist/components/SliderRangeTriple.vue2.js.map +1 -1
  334. package/dist/components/TabItem.js.map +1 -1
  335. package/dist/components/TabItem.vue.d.ts.map +1 -1
  336. package/dist/components/TabItem.vue2.js +8 -2
  337. package/dist/components/TabItem.vue2.js.map +1 -1
  338. package/dist/components/contextMenu/Menu.js +1 -1
  339. package/dist/components/contextMenu/Menu.js.map +1 -1
  340. package/dist/components/contextMenu/Menu.style.css +1 -1
  341. package/dist/components/contextMenu/Menu.vue.d.ts.map +1 -1
  342. package/dist/components/contextMenu/Menu.vue2.js +12 -8
  343. package/dist/components/contextMenu/Menu.vue2.js.map +1 -1
  344. package/dist/layout/PlBlockPage/PlBlockPage.js.map +1 -1
  345. package/dist/layout/PlBlockPage/PlBlockPage.style.js.map +1 -1
  346. package/dist/layout/PlBlockPage/PlBlockPage.vue.d.ts.map +1 -1
  347. package/dist/layout/PlBlockPage/PlBlockPage.vue2.js +45 -25
  348. package/dist/layout/PlBlockPage/PlBlockPage.vue2.js.map +1 -1
  349. package/dist/layout/PlContainer/PlContainer.js.map +1 -1
  350. package/dist/layout/PlContainer/PlContainer.vue.d.ts.map +1 -1
  351. package/dist/layout/PlContainer/PlContainer.vue2.js +1 -0
  352. package/dist/layout/PlContainer/PlContainer.vue2.js.map +1 -1
  353. package/dist/layout/PlGrid/PlGrid.js.map +1 -1
  354. package/dist/layout/PlGrid/PlGrid.vue.d.ts.map +1 -1
  355. package/dist/layout/PlGrid/PlGrid.vue2.js +1 -0
  356. package/dist/layout/PlGrid/PlGrid.vue2.js.map +1 -1
  357. package/dist/layout/PlPlaceholder/PlPlaceholder.js.map +1 -1
  358. package/dist/layout/PlPlaceholder/PlPlaceholder.style.js.map +1 -1
  359. package/dist/layout/PlPlaceholder/PlPlaceholder.vue.d.ts.map +1 -1
  360. package/dist/layout/PlPlaceholder/PlPlaceholder.vue2.js +25 -6
  361. package/dist/layout/PlPlaceholder/PlPlaceholder.vue2.js.map +1 -1
  362. package/dist/layout/PlRow/PlRow.js.map +1 -1
  363. package/dist/layout/PlRow/PlRow.vue.d.ts.map +1 -1
  364. package/dist/layout/PlRow/PlRow.vue2.js +7 -4
  365. package/dist/layout/PlRow/PlRow.vue2.js.map +1 -1
  366. package/dist/layout/PlSpacer/PlSpacer.js.map +1 -1
  367. package/dist/layout/PlSpacer/PlSpacer.vue.d.ts.map +1 -1
  368. package/dist/layout/PlSpacer/PlSpacer.vue2.js +1 -0
  369. package/dist/layout/PlSpacer/PlSpacer.vue2.js.map +1 -1
  370. package/package.json +2 -2
  371. package/src/__tests__/default-testid.test.ts +95 -0
  372. package/src/base/BtnBase.vue +3 -3
  373. package/src/components/DropdownListItem.vue +14 -4
  374. package/src/components/InputRange.vue +6 -2
  375. package/src/components/PlAccordion/PlAccordionSection.vue +13 -4
  376. package/src/components/PlAlert/PlAlert.vue +5 -3
  377. package/src/components/PlAutocomplete/PlAutocomplete.vue +47 -11
  378. package/src/components/PlAutocompleteMulti/PlAutocompleteMulti.vue +53 -11
  379. package/src/components/PlBtnAccent/PlBtnAccent.vue +1 -1
  380. package/src/components/PlBtnDanger/PlBtnDanger.vue +1 -1
  381. package/src/components/PlBtnGhost/PlBtnGhost.vue +4 -3
  382. package/src/components/PlBtnGroup/PlBtnGroup.vue +16 -6
  383. package/src/components/PlBtnLink/PlBtnLink.vue +2 -1
  384. package/src/components/PlBtnPrimary/PlBtnPrimary.vue +1 -1
  385. package/src/components/PlBtnSecondary/PlBtnSecondary.vue +1 -1
  386. package/src/components/PlBtnSplit/PlBtnSplit.vue +12 -2
  387. package/src/components/PlChartHistogram/PlChartHistogram.vue +9 -3
  388. package/src/components/PlChartHistogram/createGridlines.ts +2 -0
  389. package/src/components/PlChartHistogram/createLabels.ts +2 -0
  390. package/src/components/PlChartHistogram/createSvgContainer.ts +2 -0
  391. package/src/components/PlChartHistogram/drawBins.ts +2 -0
  392. package/src/components/PlChartHistogram/drawThreshold.ts +1 -0
  393. package/src/components/PlChartHistogram/histogram.ts +6 -1
  394. package/src/components/PlChartStackedBar/Legends.vue +18 -4
  395. package/src/components/PlChartStackedBar/PlChartStackedBar.vue +4 -2
  396. package/src/components/PlChartStackedBar/PlChartStackedBarCompact.vue +1 -1
  397. package/src/components/PlChartStackedBar/StackedRow.vue +12 -4
  398. package/src/components/PlChartStackedBar/StackedRowCompact.vue +10 -3
  399. package/src/components/PlCheckbox/PlCheckbox.vue +15 -4
  400. package/src/components/PlCheckbox/PlCheckboxBase.vue +1 -0
  401. package/src/components/PlCheckboxGroup/PlCheckboxGroup.vue +15 -4
  402. package/src/components/PlChip/PlChip.vue +4 -3
  403. package/src/components/PlClipboard/PlClipboard.vue +7 -1
  404. package/src/components/PlConfirmDialog.vue +8 -3
  405. package/src/components/PlDialogModal/PlDialogModal.vue +15 -2
  406. package/src/components/PlDropdown/OptionList.vue +13 -3
  407. package/src/components/PlDropdown/PlDropdown.vue +35 -11
  408. package/src/components/PlDropdownLegacy/PlDropdownLegacy.vue +51 -12
  409. package/src/components/PlDropdownLine/PlDropdownLine.vue +29 -5
  410. package/src/components/PlDropdownLine/ResizableInput.vue +2 -1
  411. package/src/components/PlDropdownMulti/PlDropdownMulti.vue +47 -11
  412. package/src/components/PlDropdownMultiRef/PlDropdownMultiRef.vue +1 -0
  413. package/src/components/PlDropdownRef/PlDropdownRef.vue +1 -0
  414. package/src/components/PlEditableTitle/PlEditableTitle.vue +11 -3
  415. package/src/components/PlElementList/PlElementList.vue +8 -3
  416. package/src/components/PlElementList/PlElementListItem.vue +16 -5
  417. package/src/components/PlErrorAlert/PlErrorAlert.vue +8 -6
  418. package/src/components/PlErrorBoundary/PlErrorBoundary.vue +7 -1
  419. package/src/components/PlFileDialog/Local.vue +12 -4
  420. package/src/components/PlFileDialog/PlFileDialog.vue +13 -3
  421. package/src/components/PlFileDialog/Remote.vue +39 -11
  422. package/src/components/PlFileDialog/Shortcuts.vue +7 -1
  423. package/src/components/PlFileInput/PlFileInput.vue +44 -19
  424. package/src/components/PlLoaderCircular/PlLoaderCircular.vue +1 -1
  425. package/src/components/PlLoaderLogo.vue +6 -1
  426. package/src/components/PlLogView/PlLogView.vue +30 -8
  427. package/src/components/PlNotificationAlert/PlNotificationAlert.vue +15 -3
  428. package/src/components/PlNumberField/PlNumberField.vue +14 -3
  429. package/src/components/PlProgressBar/PlProgressBar.vue +12 -4
  430. package/src/components/PlProgressCell/PlProgressCell.vue +13 -4
  431. package/src/components/PlRadio/PlRadio.vue +10 -3
  432. package/src/components/PlRadio/PlRadioGroup.vue +3 -2
  433. package/src/components/PlSearchField/PlSearchField.vue +5 -3
  434. package/src/components/PlSectionSeparator/PlSectionSeparator.vue +6 -2
  435. package/src/components/PlSidebar/PlSidebarGroup.vue +2 -2
  436. package/src/components/PlSidebar/PlSidebarItem.vue +12 -4
  437. package/src/components/PlSlideModal/PlPureSlideModal.vue +7 -1
  438. package/src/components/PlSlideModal/PlSlideModal.vue +4 -3
  439. package/src/components/PlSpacer/PlSpacer.vue +1 -1
  440. package/src/components/PlSplash/PlSplash.vue +6 -3
  441. package/src/components/PlStatusTag/PlStatusTag.vue +1 -0
  442. package/src/components/PlTabs/PlTabs.vue +6 -2
  443. package/src/components/PlTextArea/PlTextArea.vue +21 -8
  444. package/src/components/PlTextField/PlTextField.vue +23 -8
  445. package/src/components/PlToggleSwitch/PlToggleSwitch.vue +4 -3
  446. package/src/components/PlTooltip/PlTooltip.vue +3 -0
  447. package/src/components/Slider.vue +27 -7
  448. package/src/components/SliderRange.vue +28 -7
  449. package/src/components/SliderRangeTriple.vue +19 -5
  450. package/src/components/TabItem.vue +2 -2
  451. package/src/components/contextMenu/Menu.vue +8 -3
  452. package/src/layout/PlBlockPage/PlBlockPage.vue +40 -11
  453. package/src/layout/PlContainer/PlContainer.vue +1 -0
  454. package/src/layout/PlGrid/PlGrid.vue +1 -1
  455. package/src/layout/PlPlaceholder/PlPlaceholder.vue +20 -8
  456. package/src/layout/PlRow/PlRow.vue +5 -1
  457. package/src/layout/PlSpacer/PlSpacer.vue +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"OptionList.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlDropdown/OptionList.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport DropdownListItem from \"../DropdownListItem.vue\";\nimport { DropdownOverlay } from \"../../utils/DropdownOverlay\";\nimport TextLabel from \"../../utils/TextLabel.vue\";\nimport { computed, useTemplateRef } from \"vue\";\nimport type { LOption } from \"./types\";\n\nconst props = defineProps<{\n rootRef: HTMLElement;\n groups: Map<string, LOption[]>;\n rest: LOption[];\n optionSize: \"small\" | \"medium\";\n selectOption: (v: unknown) => void;\n}>();\n\nconst overlay = useTemplateRef(\"overlay\");\n\nconst listRef = computed(() => overlay.value?.listRef);\n\nconst hasGroups = computed(() => props.groups.size > 0);\n\nconst optionsLength = computed(() => {\n let totalGroupItems = 0;\n for (const items of props.groups.values()) {\n totalGroupItems += items.length;\n }\n return totalGroupItems + props.rest.length;\n});\n\nconst scrollIntoActive = () => {\n overlay.value?.scrollIntoActive();\n};\n\ndefineExpose({\n scrollIntoActive,\n listRef,\n});\n</script>\n\n<template>\n <DropdownOverlay\n ref=\"overlay\"\n :root=\"rootRef\"\n class=\"pl-dropdown__options\"\n tabindex=\"-1\"\n :gap=\"3\"\n >\n <div\n v-for=\"[group, items] in groups.entries()\"\n :key=\"group\"\n :class=\"{ 'group-container': hasGroups }\"\n >\n <TextLabel>{{ group }}</TextLabel>\n <div>\n <DropdownListItem\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n @click.stop=\"selectOption(item.value)\"\n />\n </div>\n </div>\n <div v-if=\"rest.length\" :class=\"{ 'group-container': hasGroups }\">\n <TextLabel />\n <div>\n <DropdownListItem\n v-for=\"(item, index) in rest\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n @click.stop=\"selectOption(item.value)\"\n />\n </div>\n </div>\n <div v-if=\"!optionsLength\" class=\"nothing-found\">Nothing found</div>\n </DropdownOverlay>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAOA,IAAM,IAAQ,GAQR,IAAU,EAAe,UAAU,EAEnC,IAAU,QAAe,EAAQ,OAAO,QAAQ,EAEhD,IAAY,QAAe,EAAM,OAAO,OAAO,EAAE,EAEjD,IAAgB,QAAe;GACnC,IAAI,IAAkB;AACtB,QAAK,IAAM,KAAS,EAAM,OAAO,QAAQ,CACvC,MAAmB,EAAM;AAE3B,UAAO,IAAkB,EAAM,KAAK;IACpC;SAMF,EAAa;GACX,wBAL6B;AAC7B,MAAQ,OAAO,kBAAkB;;GAKjC;GACD,CAAC,kBAIA,EAwCkB,EAAA,EAAA,EAAA;YAvCZ;GAAJ,KAAI;GACH,MAAM,EAAA;GACP,OAAM;GACN,UAAS;GACR,KAAK;;oBAGsC;YAD5C,EAiBM,GAAA,MAAA,EAhBqB,EAAA,OAAO,SAAO,GAAA,CAA/B,GAAO,aADjB,EAiBM,OAAA;KAfH,KAAK;KACL,OAAK,EAAA,EAAA,mBAAuB,EAAA,OAAS,CAAA;QAEtC,EAAkC,GAAA,MAAA;sBAAZ,CAAA,EAAA,EAAR,EAAK,EAAA,EAAA,CAAA,CAAA;;cACnB,EAUM,OAAA,MAAA,EAAA,EAAA,GAAA,EATJ,EAQE,GAAA,MAAA,EAPwB,IAAhB,GAAM,YADhB,EAQE,GAAA;KANC,KAAK;KACL,QAAQ;KACR,eAAa,EAAK;KAClB,cAAY,EAAK;KACjB,MAAM,EAAA;KACN,SAAK,GAAA,MAAO,EAAA,aAAa,EAAK,MAAK,EAAA,CAAA,OAAA,CAAA;;;;;;;;IAI/B,EAAA,KAAK,UAAA,GAAA,EAAhB,EAaM,OAAA;;KAbmB,OAAK,EAAA,EAAA,mBAAuB,EAAA,OAAS,CAAA;QAC5D,EAAa,EAAA,EACb,EAUM,OAAA,MAAA,EAAA,EAAA,GAAA,EATJ,EAQE,GAAA,MAAA,EAPwB,EAAA,OAAhB,GAAM,YADhB,EAQE,GAAA;KANC,KAAK;KACL,QAAQ;KACR,eAAa,EAAK;KAClB,cAAY,EAAK;KACjB,MAAM,EAAA;KACN,SAAK,GAAA,MAAO,EAAA,aAAa,EAAK,MAAK,EAAA,CAAA,OAAA,CAAA;;;;;;;;IAI9B,EAAA,QAAkD,EAAA,IAAA,GAAA,IAAlD,GAAA,EAAZ,EAAoE,OAApE,GAAiD,gBAAa"}
1
+ {"version":3,"file":"OptionList.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlDropdown/OptionList.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport DropdownListItem from \"../DropdownListItem.vue\";\nimport { DropdownOverlay } from \"../../utils/DropdownOverlay\";\nimport TextLabel from \"../../utils/TextLabel.vue\";\nimport { computed, useTemplateRef } from \"vue\";\nimport type { LOption } from \"./types\";\n\nconst props = defineProps<{\n rootRef: HTMLElement;\n groups: Map<string, LOption[]>;\n rest: LOption[];\n optionSize: \"small\" | \"medium\";\n selectOption: (v: unknown) => void;\n}>();\n\nconst overlay = useTemplateRef(\"overlay\");\n\nconst listRef = computed(() => overlay.value?.listRef);\n\nconst hasGroups = computed(() => props.groups.size > 0);\n\nconst optionsLength = computed(() => {\n let totalGroupItems = 0;\n for (const items of props.groups.values()) {\n totalGroupItems += items.length;\n }\n return totalGroupItems + props.rest.length;\n});\n\nconst scrollIntoActive = () => {\n overlay.value?.scrollIntoActive();\n};\n\ndefineExpose({\n scrollIntoActive,\n listRef,\n});\n</script>\n\n<template>\n <DropdownOverlay\n ref=\"overlay\"\n :root=\"rootRef\"\n class=\"pl-dropdown__options\"\n data-testid=\"pl-dropdown-options\"\n tabindex=\"-1\"\n :gap=\"3\"\n >\n <div\n v-for=\"[group, items] in groups.entries()\"\n :key=\"group\"\n :class=\"{ 'group-container': hasGroups }\"\n data-testid=\"pl-dropdown-option-group\"\n >\n <TextLabel data-testid=\"pl-dropdown-option-group-label\">{{ group }}</TextLabel>\n <div>\n <DropdownListItem\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n data-testid=\"pl-dropdown-option\"\n @click.stop=\"selectOption(item.value)\"\n />\n </div>\n </div>\n <div\n v-if=\"rest.length\"\n :class=\"{ 'group-container': hasGroups }\"\n data-testid=\"pl-dropdown-option-group\"\n >\n <TextLabel />\n <div>\n <DropdownListItem\n v-for=\"(item, index) in rest\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n data-testid=\"pl-dropdown-option\"\n @click.stop=\"selectOption(item.value)\"\n />\n </div>\n </div>\n <div v-if=\"!optionsLength\" class=\"nothing-found\" data-testid=\"pl-dropdown-options-empty\">\n Nothing found\n </div>\n </DropdownOverlay>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAOA,IAAM,IAAQ,GAQR,IAAU,EAAe,UAAU,EAEnC,IAAU,QAAe,EAAQ,OAAO,QAAQ,EAEhD,IAAY,QAAe,EAAM,OAAO,OAAO,EAAE,EAEjD,IAAgB,QAAe;GACnC,IAAI,IAAkB;AACtB,QAAK,IAAM,KAAS,EAAM,OAAO,QAAQ,CACvC,MAAmB,EAAM;AAE3B,UAAO,IAAkB,EAAM,KAAK;IACpC;SAMF,EAAa;GACX,wBAL6B;AAC7B,MAAQ,OAAO,kBAAkB;;GAKjC;GACD,CAAC,kBAIA,EAkDkB,EAAA,EAAA,EAAA;YAjDZ;GAAJ,KAAI;GACH,MAAM,EAAA;GACP,OAAM;GACN,eAAY;GACZ,UAAS;GACR,KAAK;;oBAGsC;YAD5C,EAmBM,GAAA,MAAA,EAlBqB,EAAA,OAAO,SAAO,GAAA,CAA/B,GAAO,aADjB,EAmBM,OAAA;KAjBH,KAAK;KACL,OAAK,EAAA,EAAA,mBAAuB,EAAA,OAAS,CAAA;KACtC,eAAY;QAEZ,EAA+E,GAAA,EAApE,eAAY,kCAAgC,EAAA;sBAAY,CAAA,EAAA,EAAR,EAAK,EAAA,EAAA,CAAA,CAAA;;cAChE,EAWM,OAAA,MAAA,EAAA,EAAA,GAAA,EAVJ,EASE,GAAA,MAAA,EARwB,IAAhB,GAAM,YADhB,EASE,GAAA;KAPC,KAAK;KACL,QAAQ;KACR,eAAa,EAAK;KAClB,cAAY,EAAK;KACjB,MAAM,EAAA;KACP,eAAY;KACX,SAAK,GAAA,MAAO,EAAA,aAAa,EAAK,MAAK,EAAA,CAAA,OAAA,CAAA;;;;;;;;IAKlC,EAAA,KAAK,UAAA,GAAA,EADb,EAkBM,OAAA;;KAhBH,OAAK,EAAA,EAAA,mBAAuB,EAAA,OAAS,CAAA;KACtC,eAAY;QAEZ,EAAa,EAAA,EACb,EAWM,OAAA,MAAA,EAAA,EAAA,GAAA,EAVJ,EASE,GAAA,MAAA,EARwB,EAAA,OAAhB,GAAM,YADhB,EASE,GAAA;KAPC,KAAK;KACL,QAAQ;KACR,eAAa,EAAK;KAClB,cAAY,EAAK;KACjB,MAAM,EAAA;KACP,eAAY;KACX,SAAK,GAAA,MAAO,EAAA,aAAa,EAAK,MAAK,EAAA,CAAA,OAAA,CAAA;;;;;;;;IAI9B,EAAA,QAEZ,EAAA,IAAA,GAAA,IAFY,GAAA,EAAZ,EAEM,OAFN,GAAyF,kBAEzF"}
@@ -1 +1 @@
1
- {"version":3,"file":"PlDropdown.js","names":[],"sources":["../../../src/components/PlDropdown/PlDropdown.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlDropdown\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport { computed, reactive, ref, unref, useTemplateRef, watch, watchPostEffect } from \"vue\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { tap } from \"../../helpers/functions\";\nimport { deepEqual } from \"../../helpers/objects\";\nimport { normalizeListOptions } from \"../../helpers/utils\";\nimport type { ListOption, ListOptionNormalized, MaskIconName16, MaskIconName24 } from \"../../types\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport LongText from \"../LongText.vue\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { PlSvg } from \"../PlSvg\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport OptionList from \"./OptionList.vue\";\nimport \"./pl-dropdown.scss\";\nimport type { LOption } from \"./types\";\nimport { useGroupBy } from \"./useGroupBy\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M | undefined): void;\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The current selected value of the dropdown.\n */\n modelValue: M;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * List of available options for the dropdown\n */\n options?: Readonly<ListOption<M>[]>;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Shows red border even without an error message\n */\n errorStatus?: boolean;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Text shown in the field when `modelValue` has no matching option — e.g. its\n * upstream block was deleted. Rendered italic in error color.\n */\n missingValueLabel?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: MaskIconName16;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: MaskIconName24;\n /**\n * Option list item size\n */\n optionSize?: \"small\" | \"medium\";\n /**\n * Makes some of corners not rounded\n * */\n groupPosition?:\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"middle\";\n }>(),\n {\n label: \"\",\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n showErrorMessage: true,\n placeholder: \"...\",\n missingValueLabel: \"Value not available\",\n clearable: false,\n required: false,\n disabled: false,\n arrowIcon: undefined,\n arrowIconLarge: undefined,\n optionSize: \"small\",\n options: undefined,\n groupPosition: undefined,\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst optionListRef = useTemplateRef<InstanceType<typeof OptionList>>(\"optionListRef\");\n\nconst data = reactive({\n search: \"\",\n activeIndex: -1,\n open: false,\n optionsHeight: 0,\n});\n\nconst findActiveIndex = () =>\n tap(\n orderedRef.value.findIndex((o) => deepEqual(o.value, props.modelValue)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst isLoadingOptions = computed(() => {\n return props.options === undefined;\n});\n\n/**\n * Loading spinner should not be shown when the dropdown is explicitly disabled,\n * even if options are undefined. The disabled state takes precedence.\n */\nconst showLoadingSpinner = computed(() => {\n return !props.disabled && isLoadingOptions.value;\n});\n\nconst isDisabled = computed(() => {\n if (isLoadingOptions.value) {\n return true;\n }\n\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, props.modelValue));\n});\n\nconst hasValue = computed(() => {\n return props.modelValue !== undefined && props.modelValue !== null;\n});\n\nconst isMissing = computed(() => {\n return hasValue.value && selectedIndex.value === -1 && !isLoadingOptions.value;\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n // The field renders the missing state via `missingValueLabel`; no need to\n // duplicate it as a helper error.\n return undefined;\n});\n\nconst optionsRef = computed<LOption<M>[]>(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst textValue = computed(() => {\n const options = unref(optionsRef);\n const item: ListOption | undefined = options.find((o) => deepEqual(o.value, props.modelValue));\n return item?.label;\n});\n\n// Native tooltip with the full selected value. The `.input-value` layer has\n// `pointer-events: none`, so the title must sit on the field wrapper, which is\n// what actually receives the hover.\nconst fieldTitle = computed(() => {\n if (data.open) return undefined;\n if (isMissing.value) return props.missingValueLabel;\n return textValue.value !== undefined ? String(textValue.value) : undefined;\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && hasValue.value) {\n return \"\";\n }\n\n return textValue.value ? String(textValue.value) : props.placeholder;\n});\n\nconst filteredRef = computed(() => {\n const options = optionsRef.value;\n\n if (data.search) {\n return options.filter((o: ListOptionNormalized) => {\n const search = data.search.toLowerCase();\n\n if (o.label.toLowerCase().includes(search)) {\n return true;\n }\n\n if (o.description && o.description.toLowerCase().includes(search)) {\n return true;\n }\n\n if (typeof o.value === \"string\") {\n return o.value.toLowerCase().includes(search);\n }\n\n return o.value === data.search;\n });\n }\n\n return options;\n});\n\nconst { orderedRef, groupsRef, restRef } = useGroupBy(filteredRef, \"group\");\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : \"0\"));\n\nconst selectOption = (v: M | undefined) => {\n emit(\"update:modelValue\", v);\n data.search = \"\";\n data.open = false;\n rootRef?.value?.focus();\n};\n\nconst selectOptionWrapper = (v: unknown) => {\n selectOption(v as M | undefined);\n};\n\nconst clear = () => emit(\"update:modelValue\", undefined);\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => {\n data.open = !data.open;\n if (!data.open) {\n data.search = \"\";\n }\n};\n\nconst onInputFocus = () => (data.open = true);\n\nconst onFocusOut = (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (\n !rootRef.value?.contains(relatedTarget) &&\n !optionListRef.value?.listRef?.contains(relatedTarget)\n ) {\n data.search = \"\";\n data.open = false;\n }\n};\n\nconst handleKeydown = (e: { code: string; preventDefault(): void }) => {\n if (![\"ArrowDown\", \"ArrowUp\", \"Enter\", \"Escape\"].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n const { open, activeIndex } = data;\n\n if (!open) {\n if (e.code === \"Enter\") {\n data.open = true;\n }\n return;\n }\n\n if (e.code === \"Escape\") {\n data.open = false;\n rootRef.value?.focus();\n }\n\n const ordered = orderedRef.value;\n\n const { length } = ordered;\n\n if (!length) {\n return;\n }\n\n if (e.code === \"Enter\") {\n selectOption(ordered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = ordered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === \"ArrowDown\" ? 1 : e.code === \"ArrowUp\" ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = ordered[newIndex].index ?? -1;\n};\n\nuseLabelNotch(rootRef);\n\nwatch(() => props.modelValue, updateActive, { immediate: true });\n\nwatch(\n () => data.open,\n (open) => (open ? input.value?.focus() : \"\"),\n);\n\nwatchPostEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n data.search; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n optionListRef.value?.scrollIntoActive();\n }\n});\n</script>\n\n<template>\n <div class=\"pl-dropdown__envelope\" @click=\"setFocusOnInput\">\n <div\n ref=\"rootRef\"\n :tabindex=\"tabindex\"\n class=\"pl-dropdown\"\n :class=\"{ open: data.open, error: error || errorStatus, disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"pl-dropdown__container\">\n <div class=\"pl-dropdown__field\" :title=\"fieldTitle\">\n <input\n ref=\"input\"\n v-model=\"data.search\"\n type=\"text\"\n tabindex=\"-1\"\n :disabled=\"isDisabled\"\n :placeholder=\"computedPlaceholder\"\n spellcheck=\"false\"\n autocomplete=\"chrome-off\"\n @focus=\"onInputFocus\"\n />\n\n <div v-if=\"!data.open\" class=\"input-value\">\n <LongText v-if=\"isMissing\" class=\"input-value--missing\">\n {{ missingValueLabel }}\n </LongText>\n <LongText v-else-if=\"textValue !== undefined\">\n {{ textValue }}\n </LongText>\n </div>\n\n <div class=\"pl-dropdown__controls\">\n <PlIcon24 v-if=\"showLoadingSpinner\" name=\"loading\" />\n <PlIcon16\n v-if=\"clearable && hasValue\"\n class=\"clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <slot name=\"append\" />\n <div class=\"pl-dropdown__arrow-wrapper\" @click.stop=\"toggleOpen\">\n <PlIcon24 v-if=\"arrowIconLarge\" :name=\"arrowIconLarge\" class=\"arrow-icon\" />\n <PlIcon16 v-else-if=\"arrowIcon\" :name=\"arrowIcon\" class=\"arrow-icon\" />\n <PlIcon16 v-else name=\"chevron-down\" class=\"arrow-icon arrow-icon-default\" />\n </div>\n </div>\n </div>\n <label v-if=\"label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" />\n <span>{{ label }}</span>\n <PlTooltip v-if=\"$slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <OptionList\n v-if=\"data.open\"\n ref=\"optionListRef\"\n :root-ref=\"rootRef!\"\n :groups=\"groupsRef\"\n :rest=\"restRef\"\n :option-size=\"optionSize\"\n :select-option=\"selectOptionWrapper\"\n />\n <DoubleContour class=\"pl-dropdown__contour\" :group-position=\"groupPosition\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"pl-dropdown__error\">{{ computedError }}</div>\n <div v-else-if=\"showLoadingSpinner && loadingOptionsHelper\" class=\"pl-dropdown__helper\">\n {{ loadingOptionsHelper }}\n </div>\n <div v-else-if=\"helper\" class=\"pl-dropdown__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PlDropdown.js","names":[],"sources":["../../../src/components/PlDropdown/PlDropdown.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlDropdown\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport { computed, reactive, ref, unref, useTemplateRef, watch, watchPostEffect } from \"vue\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { tap } from \"../../helpers/functions\";\nimport { deepEqual } from \"../../helpers/objects\";\nimport { normalizeListOptions } from \"../../helpers/utils\";\nimport type { ListOption, ListOptionNormalized, MaskIconName16, MaskIconName24 } from \"../../types\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport LongText from \"../LongText.vue\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { PlSvg } from \"../PlSvg\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport OptionList from \"./OptionList.vue\";\nimport \"./pl-dropdown.scss\";\nimport type { LOption } from \"./types\";\nimport { useGroupBy } from \"./useGroupBy\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M | undefined): void;\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The current selected value of the dropdown.\n */\n modelValue: M;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * List of available options for the dropdown\n */\n options?: Readonly<ListOption<M>[]>;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Shows red border even without an error message\n */\n errorStatus?: boolean;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Text shown in the field when `modelValue` has no matching option — e.g. its\n * upstream block was deleted. Rendered italic in error color.\n */\n missingValueLabel?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: MaskIconName16;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: MaskIconName24;\n /**\n * Option list item size\n */\n optionSize?: \"small\" | \"medium\";\n /**\n * Makes some of corners not rounded\n * */\n groupPosition?:\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"middle\";\n }>(),\n {\n label: \"\",\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n showErrorMessage: true,\n placeholder: \"...\",\n missingValueLabel: \"Value not available\",\n clearable: false,\n required: false,\n disabled: false,\n arrowIcon: undefined,\n arrowIconLarge: undefined,\n optionSize: \"small\",\n options: undefined,\n groupPosition: undefined,\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst optionListRef = useTemplateRef<InstanceType<typeof OptionList>>(\"optionListRef\");\n\nconst data = reactive({\n search: \"\",\n activeIndex: -1,\n open: false,\n optionsHeight: 0,\n});\n\nconst findActiveIndex = () =>\n tap(\n orderedRef.value.findIndex((o) => deepEqual(o.value, props.modelValue)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst isLoadingOptions = computed(() => {\n return props.options === undefined;\n});\n\n/**\n * Loading spinner should not be shown when the dropdown is explicitly disabled,\n * even if options are undefined. The disabled state takes precedence.\n */\nconst showLoadingSpinner = computed(() => {\n return !props.disabled && isLoadingOptions.value;\n});\n\nconst isDisabled = computed(() => {\n if (isLoadingOptions.value) {\n return true;\n }\n\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, props.modelValue));\n});\n\nconst hasValue = computed(() => {\n return props.modelValue !== undefined && props.modelValue !== null;\n});\n\nconst isMissing = computed(() => {\n return hasValue.value && selectedIndex.value === -1 && !isLoadingOptions.value;\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n // The field renders the missing state via `missingValueLabel`; no need to\n // duplicate it as a helper error.\n return undefined;\n});\n\nconst optionsRef = computed<LOption<M>[]>(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst textValue = computed(() => {\n const options = unref(optionsRef);\n const item: ListOption | undefined = options.find((o) => deepEqual(o.value, props.modelValue));\n return item?.label;\n});\n\n// Native tooltip with the full selected value. The `.input-value` layer has\n// `pointer-events: none`, so the title must sit on the field wrapper, which is\n// what actually receives the hover.\nconst fieldTitle = computed(() => {\n if (data.open) return undefined;\n if (isMissing.value) return props.missingValueLabel;\n return textValue.value !== undefined ? String(textValue.value) : undefined;\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && hasValue.value) {\n return \"\";\n }\n\n return textValue.value ? String(textValue.value) : props.placeholder;\n});\n\nconst filteredRef = computed(() => {\n const options = optionsRef.value;\n\n if (data.search) {\n return options.filter((o: ListOptionNormalized) => {\n const search = data.search.toLowerCase();\n\n if (o.label.toLowerCase().includes(search)) {\n return true;\n }\n\n if (o.description && o.description.toLowerCase().includes(search)) {\n return true;\n }\n\n if (typeof o.value === \"string\") {\n return o.value.toLowerCase().includes(search);\n }\n\n return o.value === data.search;\n });\n }\n\n return options;\n});\n\nconst { orderedRef, groupsRef, restRef } = useGroupBy(filteredRef, \"group\");\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : \"0\"));\n\nconst selectOption = (v: M | undefined) => {\n emit(\"update:modelValue\", v);\n data.search = \"\";\n data.open = false;\n rootRef?.value?.focus();\n};\n\nconst selectOptionWrapper = (v: unknown) => {\n selectOption(v as M | undefined);\n};\n\nconst clear = () => emit(\"update:modelValue\", undefined);\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => {\n data.open = !data.open;\n if (!data.open) {\n data.search = \"\";\n }\n};\n\nconst onInputFocus = () => (data.open = true);\n\nconst onFocusOut = (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (\n !rootRef.value?.contains(relatedTarget) &&\n !optionListRef.value?.listRef?.contains(relatedTarget)\n ) {\n data.search = \"\";\n data.open = false;\n }\n};\n\nconst handleKeydown = (e: { code: string; preventDefault(): void }) => {\n if (![\"ArrowDown\", \"ArrowUp\", \"Enter\", \"Escape\"].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n const { open, activeIndex } = data;\n\n if (!open) {\n if (e.code === \"Enter\") {\n data.open = true;\n }\n return;\n }\n\n if (e.code === \"Escape\") {\n data.open = false;\n rootRef.value?.focus();\n }\n\n const ordered = orderedRef.value;\n\n const { length } = ordered;\n\n if (!length) {\n return;\n }\n\n if (e.code === \"Enter\") {\n selectOption(ordered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = ordered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === \"ArrowDown\" ? 1 : e.code === \"ArrowUp\" ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = ordered[newIndex].index ?? -1;\n};\n\nuseLabelNotch(rootRef);\n\nwatch(() => props.modelValue, updateActive, { immediate: true });\n\nwatch(\n () => data.open,\n (open) => (open ? input.value?.focus() : \"\"),\n);\n\nwatchPostEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n data.search; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n optionListRef.value?.scrollIntoActive();\n }\n});\n</script>\n\n<template>\n <div class=\"pl-dropdown__envelope\" @click=\"setFocusOnInput\" data-testid=\"pl-dropdown\">\n <div\n ref=\"rootRef\"\n :tabindex=\"tabindex\"\n class=\"pl-dropdown\"\n data-testid=\"pl-dropdown-control\"\n :class=\"{ open: data.open, error: error || errorStatus, disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"pl-dropdown__container\">\n <div class=\"pl-dropdown__field\" :title=\"fieldTitle\">\n <input\n ref=\"input\"\n v-model=\"data.search\"\n type=\"text\"\n tabindex=\"-1\"\n :disabled=\"isDisabled\"\n :placeholder=\"computedPlaceholder\"\n spellcheck=\"false\"\n autocomplete=\"chrome-off\"\n data-testid=\"pl-dropdown-input\"\n @focus=\"onInputFocus\"\n />\n\n <div v-if=\"!data.open\" class=\"input-value\" data-testid=\"pl-dropdown-value\">\n <LongText\n v-if=\"isMissing\"\n class=\"input-value--missing\"\n data-testid=\"pl-dropdown-value-missing\"\n >\n {{ missingValueLabel }}\n </LongText>\n <LongText v-else-if=\"textValue !== undefined\">\n {{ textValue }}\n </LongText>\n </div>\n\n <div class=\"pl-dropdown__controls\">\n <PlIcon24 v-if=\"showLoadingSpinner\" name=\"loading\" data-testid=\"pl-dropdown-loading\" />\n <PlIcon16\n v-if=\"clearable && hasValue\"\n class=\"clear\"\n data-testid=\"pl-dropdown-clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <slot name=\"append\" />\n <div\n class=\"pl-dropdown__arrow-wrapper\"\n data-testid=\"pl-dropdown-arrow\"\n @click.stop=\"toggleOpen\"\n >\n <PlIcon24 v-if=\"arrowIconLarge\" :name=\"arrowIconLarge\" class=\"arrow-icon\" />\n <PlIcon16 v-else-if=\"arrowIcon\" :name=\"arrowIcon\" class=\"arrow-icon\" />\n <PlIcon16 v-else name=\"chevron-down\" class=\"arrow-icon arrow-icon-default\" />\n </div>\n </div>\n </div>\n <label v-if=\"label\" data-testid=\"pl-dropdown-label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" data-testid=\"pl-dropdown-required\" />\n <span>{{ label }}</span>\n <PlTooltip\n v-if=\"$slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-dropdown-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <OptionList\n v-if=\"data.open\"\n ref=\"optionListRef\"\n :root-ref=\"rootRef!\"\n :groups=\"groupsRef\"\n :rest=\"restRef\"\n :option-size=\"optionSize\"\n :select-option=\"selectOptionWrapper\"\n />\n <DoubleContour class=\"pl-dropdown__contour\" :group-position=\"groupPosition\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"pl-dropdown__error\" data-testid=\"pl-dropdown-error\">\n {{ computedError }}\n </div>\n <div\n v-else-if=\"showLoadingSpinner && loadingOptionsHelper\"\n class=\"pl-dropdown__helper\"\n data-testid=\"pl-dropdown-helper\"\n >\n {{ loadingOptionsHelper }}\n </div>\n <div v-else-if=\"helper\" class=\"pl-dropdown__helper\" data-testid=\"pl-dropdown-helper\">\n {{ helper }}\n </div>\n </div>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PlDropdown.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlDropdown/PlDropdown.vue"],"names":[],"mappings":"AA2bA,OAAO,KAAK,EAAE,UAAU,EAAwB,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AASpG,OAAO,oBAAoB,CAAC;AAK5B;;GAEG;wBACkB,OAAO,YAA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G;iBACM,MAAM;QACf;;WAEG;+BACoB,MAAM;QAC7B;;WAEG;gBACK,OAAO;QACf;;WAEG;sBACW,OAAO;QACrB;;WAEG;sBACW,MAAM;QACpB;;;WAGG;4BACiB,MAAM;QAC1B;;WAEG;oBACS,OAAO;QACnB;;WAEG;mBACQ,OAAO;QAClB;;WAEG;mBACQ,OAAO;QAClB;;WAEG;oBACS,cAAc;QAC1B;;WAEG;yBACc,cAAc;QAC/B;;WAEG;qBACU,OAAO,GAAG,QAAQ;QAC/B;;aAEK;wBAED,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,QAAQ;;;KA4lB2E,CAAC,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;iBAbE,CAAC,KAAK,IAAiB,KAAK,GAAG;;kBAC9B,CAAC,KAAK,IAAiB,KAAK,GAAG;;cAhqBvC,mBAAmB,SAAS,CAAC,GAAG,SAAS,KAAG,IAAI;EAgrBlD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;CAAI,CAAC;AACzF,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
@@ -21,16 +21,23 @@ import { computed as p, createBlock as m, createCommentVNode as h, createElement
21
21
  //#region src/components/PlDropdown/PlDropdown.vue?vue&type=script&setup=true&lang.ts
22
22
  var ie = ["tabindex"], ae = { class: "pl-dropdown__container" }, oe = ["title"], se = ["disabled", "placeholder"], ce = {
23
23
  key: 0,
24
- class: "input-value"
25
- }, le = { class: "pl-dropdown__controls" }, ue = { key: 0 }, de = {
24
+ class: "input-value",
25
+ "data-testid": "pl-dropdown-value"
26
+ }, le = { class: "pl-dropdown__controls" }, ue = {
26
27
  key: 0,
27
- class: "pl-dropdown__error"
28
+ "data-testid": "pl-dropdown-label"
29
+ }, de = {
30
+ key: 0,
31
+ class: "pl-dropdown__error",
32
+ "data-testid": "pl-dropdown-error"
28
33
  }, M = {
29
34
  key: 1,
30
- class: "pl-dropdown__helper"
35
+ class: "pl-dropdown__helper",
36
+ "data-testid": "pl-dropdown-helper"
31
37
  }, N = {
32
38
  key: 2,
33
- class: "pl-dropdown__helper"
39
+ class: "pl-dropdown__helper",
40
+ "data-testid": "pl-dropdown-helper"
34
41
  }, P = /* @__PURE__ */ b({
35
42
  name: "PlDropdown",
36
43
  props: {
@@ -115,7 +122,8 @@ var ie = ["tabindex"], ae = { class: "pl-dropdown__container" }, oe = ["title"],
115
122
  B.search, B.activeIndex >= 0 && B.open && z.value?.scrollIntoActive();
116
123
  }), (e, t) => (S(), g("div", {
117
124
  class: "pl-dropdown__envelope",
118
- onClick: ye
125
+ onClick: ye,
126
+ "data-testid": "pl-dropdown"
119
127
  }, [_("div", {
120
128
  ref_key: "rootRef",
121
129
  ref: L,
@@ -125,6 +133,7 @@ var ie = ["tabindex"], ae = { class: "pl-dropdown__container" }, oe = ["title"],
125
133
  error: b.error || b.errorStatus,
126
134
  disabled: G.value
127
135
  }]),
136
+ "data-testid": "pl-dropdown-control",
128
137
  onKeydown: Ce,
129
138
  onFocusout: Se
130
139
  }, [_("div", ae, [
@@ -142,11 +151,13 @@ var ie = ["tabindex"], ae = { class: "pl-dropdown__container" }, oe = ["title"],
142
151
  placeholder: pe.value,
143
152
  spellcheck: "false",
144
153
  autocomplete: "chrome-off",
154
+ "data-testid": "pl-dropdown-input",
145
155
  onFocus: xe
146
156
  }, null, 40, se), [[re, B.search]]),
147
157
  B.open ? h("", !0) : (S(), g("div", ce, [J.value ? (S(), m(i, {
148
158
  key: 0,
149
- class: "input-value--missing"
159
+ class: "input-value--missing",
160
+ "data-testid": "pl-dropdown-value-missing"
150
161
  }, {
151
162
  default: k(() => [v(T(b.missingValueLabel), 1)]),
152
163
  _: 1
@@ -157,17 +168,20 @@ var ie = ["tabindex"], ae = { class: "pl-dropdown__container" }, oe = ["title"],
157
168
  _("div", le, [
158
169
  W.value ? (S(), m(E(o), {
159
170
  key: 0,
160
- name: "loading"
171
+ name: "loading",
172
+ "data-testid": "pl-dropdown-loading"
161
173
  })) : h("", !0),
162
174
  b.clearable && q.value ? (S(), m(E(s), {
163
175
  key: 1,
164
176
  class: "clear",
177
+ "data-testid": "pl-dropdown-clear",
165
178
  name: "delete-clear",
166
179
  onClick: j(ve, ["stop"])
167
180
  })) : h("", !0),
168
181
  w(e.$slots, "append"),
169
182
  _("div", {
170
183
  class: "pl-dropdown__arrow-wrapper",
184
+ "data-testid": "pl-dropdown-arrow",
171
185
  onClick: j(be, ["stop"])
172
186
  }, [b.arrowIconLarge ? (S(), m(E(o), {
173
187
  key: 0,
@@ -187,13 +201,15 @@ var ie = ["tabindex"], ae = { class: "pl-dropdown__container" }, oe = ["title"],
187
201
  b.label ? (S(), g("label", ue, [
188
202
  b.required ? (S(), m(E(a), {
189
203
  key: 0,
190
- uri: E(u)
204
+ uri: E(u),
205
+ "data-testid": "pl-dropdown-required"
191
206
  }, null, 8, ["uri"])) : h("", !0),
192
207
  _("span", null, T(b.label), 1),
193
208
  e.$slots.tooltip ? (S(), m(E(n), {
194
209
  key: 1,
195
210
  class: "info",
196
- position: "top"
211
+ position: "top",
212
+ "data-testid": "pl-dropdown-tooltip"
197
213
  }, {
198
214
  tooltip: k(() => [w(e.$slots, "tooltip")]),
199
215
  _: 3
@@ -1 +1 @@
1
- {"version":3,"file":"PlDropdown.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/PlDropdown/PlDropdown.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlDropdown\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport { computed, reactive, ref, unref, useTemplateRef, watch, watchPostEffect } from \"vue\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { tap } from \"../../helpers/functions\";\nimport { deepEqual } from \"../../helpers/objects\";\nimport { normalizeListOptions } from \"../../helpers/utils\";\nimport type { ListOption, ListOptionNormalized, MaskIconName16, MaskIconName24 } from \"../../types\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport LongText from \"../LongText.vue\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { PlSvg } from \"../PlSvg\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport OptionList from \"./OptionList.vue\";\nimport \"./pl-dropdown.scss\";\nimport type { LOption } from \"./types\";\nimport { useGroupBy } from \"./useGroupBy\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M | undefined): void;\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The current selected value of the dropdown.\n */\n modelValue: M;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * List of available options for the dropdown\n */\n options?: Readonly<ListOption<M>[]>;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Shows red border even without an error message\n */\n errorStatus?: boolean;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Text shown in the field when `modelValue` has no matching option — e.g. its\n * upstream block was deleted. Rendered italic in error color.\n */\n missingValueLabel?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: MaskIconName16;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: MaskIconName24;\n /**\n * Option list item size\n */\n optionSize?: \"small\" | \"medium\";\n /**\n * Makes some of corners not rounded\n * */\n groupPosition?:\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"middle\";\n }>(),\n {\n label: \"\",\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n showErrorMessage: true,\n placeholder: \"...\",\n missingValueLabel: \"Value not available\",\n clearable: false,\n required: false,\n disabled: false,\n arrowIcon: undefined,\n arrowIconLarge: undefined,\n optionSize: \"small\",\n options: undefined,\n groupPosition: undefined,\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst optionListRef = useTemplateRef<InstanceType<typeof OptionList>>(\"optionListRef\");\n\nconst data = reactive({\n search: \"\",\n activeIndex: -1,\n open: false,\n optionsHeight: 0,\n});\n\nconst findActiveIndex = () =>\n tap(\n orderedRef.value.findIndex((o) => deepEqual(o.value, props.modelValue)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst isLoadingOptions = computed(() => {\n return props.options === undefined;\n});\n\n/**\n * Loading spinner should not be shown when the dropdown is explicitly disabled,\n * even if options are undefined. The disabled state takes precedence.\n */\nconst showLoadingSpinner = computed(() => {\n return !props.disabled && isLoadingOptions.value;\n});\n\nconst isDisabled = computed(() => {\n if (isLoadingOptions.value) {\n return true;\n }\n\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, props.modelValue));\n});\n\nconst hasValue = computed(() => {\n return props.modelValue !== undefined && props.modelValue !== null;\n});\n\nconst isMissing = computed(() => {\n return hasValue.value && selectedIndex.value === -1 && !isLoadingOptions.value;\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n // The field renders the missing state via `missingValueLabel`; no need to\n // duplicate it as a helper error.\n return undefined;\n});\n\nconst optionsRef = computed<LOption<M>[]>(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst textValue = computed(() => {\n const options = unref(optionsRef);\n const item: ListOption | undefined = options.find((o) => deepEqual(o.value, props.modelValue));\n return item?.label;\n});\n\n// Native tooltip with the full selected value. The `.input-value` layer has\n// `pointer-events: none`, so the title must sit on the field wrapper, which is\n// what actually receives the hover.\nconst fieldTitle = computed(() => {\n if (data.open) return undefined;\n if (isMissing.value) return props.missingValueLabel;\n return textValue.value !== undefined ? String(textValue.value) : undefined;\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && hasValue.value) {\n return \"\";\n }\n\n return textValue.value ? String(textValue.value) : props.placeholder;\n});\n\nconst filteredRef = computed(() => {\n const options = optionsRef.value;\n\n if (data.search) {\n return options.filter((o: ListOptionNormalized) => {\n const search = data.search.toLowerCase();\n\n if (o.label.toLowerCase().includes(search)) {\n return true;\n }\n\n if (o.description && o.description.toLowerCase().includes(search)) {\n return true;\n }\n\n if (typeof o.value === \"string\") {\n return o.value.toLowerCase().includes(search);\n }\n\n return o.value === data.search;\n });\n }\n\n return options;\n});\n\nconst { orderedRef, groupsRef, restRef } = useGroupBy(filteredRef, \"group\");\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : \"0\"));\n\nconst selectOption = (v: M | undefined) => {\n emit(\"update:modelValue\", v);\n data.search = \"\";\n data.open = false;\n rootRef?.value?.focus();\n};\n\nconst selectOptionWrapper = (v: unknown) => {\n selectOption(v as M | undefined);\n};\n\nconst clear = () => emit(\"update:modelValue\", undefined);\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => {\n data.open = !data.open;\n if (!data.open) {\n data.search = \"\";\n }\n};\n\nconst onInputFocus = () => (data.open = true);\n\nconst onFocusOut = (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (\n !rootRef.value?.contains(relatedTarget) &&\n !optionListRef.value?.listRef?.contains(relatedTarget)\n ) {\n data.search = \"\";\n data.open = false;\n }\n};\n\nconst handleKeydown = (e: { code: string; preventDefault(): void }) => {\n if (![\"ArrowDown\", \"ArrowUp\", \"Enter\", \"Escape\"].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n const { open, activeIndex } = data;\n\n if (!open) {\n if (e.code === \"Enter\") {\n data.open = true;\n }\n return;\n }\n\n if (e.code === \"Escape\") {\n data.open = false;\n rootRef.value?.focus();\n }\n\n const ordered = orderedRef.value;\n\n const { length } = ordered;\n\n if (!length) {\n return;\n }\n\n if (e.code === \"Enter\") {\n selectOption(ordered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = ordered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === \"ArrowDown\" ? 1 : e.code === \"ArrowUp\" ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = ordered[newIndex].index ?? -1;\n};\n\nuseLabelNotch(rootRef);\n\nwatch(() => props.modelValue, updateActive, { immediate: true });\n\nwatch(\n () => data.open,\n (open) => (open ? input.value?.focus() : \"\"),\n);\n\nwatchPostEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n data.search; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n optionListRef.value?.scrollIntoActive();\n }\n});\n</script>\n\n<template>\n <div class=\"pl-dropdown__envelope\" @click=\"setFocusOnInput\">\n <div\n ref=\"rootRef\"\n :tabindex=\"tabindex\"\n class=\"pl-dropdown\"\n :class=\"{ open: data.open, error: error || errorStatus, disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"pl-dropdown__container\">\n <div class=\"pl-dropdown__field\" :title=\"fieldTitle\">\n <input\n ref=\"input\"\n v-model=\"data.search\"\n type=\"text\"\n tabindex=\"-1\"\n :disabled=\"isDisabled\"\n :placeholder=\"computedPlaceholder\"\n spellcheck=\"false\"\n autocomplete=\"chrome-off\"\n @focus=\"onInputFocus\"\n />\n\n <div v-if=\"!data.open\" class=\"input-value\">\n <LongText v-if=\"isMissing\" class=\"input-value--missing\">\n {{ missingValueLabel }}\n </LongText>\n <LongText v-else-if=\"textValue !== undefined\">\n {{ textValue }}\n </LongText>\n </div>\n\n <div class=\"pl-dropdown__controls\">\n <PlIcon24 v-if=\"showLoadingSpinner\" name=\"loading\" />\n <PlIcon16\n v-if=\"clearable && hasValue\"\n class=\"clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <slot name=\"append\" />\n <div class=\"pl-dropdown__arrow-wrapper\" @click.stop=\"toggleOpen\">\n <PlIcon24 v-if=\"arrowIconLarge\" :name=\"arrowIconLarge\" class=\"arrow-icon\" />\n <PlIcon16 v-else-if=\"arrowIcon\" :name=\"arrowIcon\" class=\"arrow-icon\" />\n <PlIcon16 v-else name=\"chevron-down\" class=\"arrow-icon arrow-icon-default\" />\n </div>\n </div>\n </div>\n <label v-if=\"label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" />\n <span>{{ label }}</span>\n <PlTooltip v-if=\"$slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <OptionList\n v-if=\"data.open\"\n ref=\"optionListRef\"\n :root-ref=\"rootRef!\"\n :groups=\"groupsRef\"\n :rest=\"restRef\"\n :option-size=\"optionSize\"\n :select-option=\"selectOptionWrapper\"\n />\n <DoubleContour class=\"pl-dropdown__contour\" :group-position=\"groupPosition\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"pl-dropdown__error\">{{ computedError }}</div>\n <div v-else-if=\"showLoadingSpinner && loadingOptionsHelper\" class=\"pl-dropdown__helper\">\n {{ loadingOptionsHelper }}\n </div>\n <div v-else-if=\"helper\" class=\"pl-dropdown__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBR,IAAM,IAAO,GAOP,IAAQ,GAgGR,IAAU,GAA8B,EACxC,IAAQ,GAAmC,EAE3C,IAAgB,GAAgD,gBAAgB,EAEhF,IAAO,GAAS;GACpB,QAAQ;GACR,aAAa;GACb,MAAM;GACN,eAAe;GAChB,CAAC,EAEI,UACJ,EACE,EAAW,MAAM,WAAW,MAAM,EAAU,EAAE,OAAO,EAAM,WAAW,CAAC,GACtE,MAAO,IAAI,IAAI,IAAI,EACrB,EAEG,UAAsB,EAAK,cAAc,GAAiB,EAE1D,IAAmB,QAChB,EAAM,YAAY,KAAA,EACzB,EAMI,IAAqB,QAClB,CAAC,EAAM,YAAY,EAAiB,MAC3C,EAEI,IAAa,QACb,EAAiB,QACZ,KAGF,EAAM,SACb,EAEI,IAAgB,SACZ,EAAM,WAAW,EAAE,EAAE,WAAW,MAAM,EAAU,EAAE,OAAO,EAAM,WAAW,CAAC,CACnF,EAEI,IAAW,QACR,EAAM,eAAe,KAAA,KAAa,EAAM,eAAe,KAC9D,EAEI,IAAY,QACT,EAAS,SAAS,EAAc,UAAU,MAAM,CAAC,EAAiB,MACzE,EAEI,IAAgB,QAAe;AAC/B,UAAiB,SAIjB,EAAM,MACR,QAAO,EAAgB,EAAM,MA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GAIpC,EAAA,SAAA,GAAA,EAAb,EAQQ,SAAA,IAAA;IAPO,EAAA,YAAA,GAAA,EAAb,EAA4C,EAAA,EAAA,EAAA;;KAApB,KAAK,EAAA,EAAW;;IACxC,EAAwB,QAAA,MAAA,EAAf,EAAA,MAAK,EAAA,EAAA;IACGA,EAAAA,OAAO,WAAA,GAAA,EAAxB,EAIY,EAAA,EAAA,EAAA;;KAJqB,OAAM;KAAO,UAAS;;KAC1C,SAAO,QACO,CAAvB,EAAuB,EAAA,QAAA,UAAA,CAAA,CAAA;;;;GAKrB,EAAK,QAAA,GAAA,EADb,EAQE,GAAA;;aANI;IAAJ,KAAI;IACH,YAAU,EAAA;IACV,QAAQ,EAAA,GAAS;IACjB,MAAM,EAAA,GAAO;IACb,eAAa,EAAA;IACb,iBAAe;;;;;;;GAElB,EAA8E,IAAA;IAA/D,OAAM;IAAwB,kBAAgB,EAAA;;gBAGtD,EAAA,SAAA,GAAA,EAAX,EAA8E,OAA9E,IAA8E,EAAtB,EAAA,MAAa,EAAA,EAAA,IACrD,EAAA,SAAsB,EAAA,wBAAA,GAAA,EAAtC,EAEM,OAFN,GAEM,EADD,EAAA,qBAAoB,EAAA,EAAA,IAET,EAAA,UAAA,GAAA,EAAhB,EAAsE,OAAtE,GAAsE,EAAf,EAAA,OAAM,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"PlDropdown.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/PlDropdown/PlDropdown.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlDropdown\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport { computed, reactive, ref, unref, useTemplateRef, watch, watchPostEffect } from \"vue\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { tap } from \"../../helpers/functions\";\nimport { deepEqual } from \"../../helpers/objects\";\nimport { normalizeListOptions } from \"../../helpers/utils\";\nimport type { ListOption, ListOptionNormalized, MaskIconName16, MaskIconName24 } from \"../../types\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport LongText from \"../LongText.vue\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlIcon24 } from \"../PlIcon24\";\nimport { PlSvg } from \"../PlSvg\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport OptionList from \"./OptionList.vue\";\nimport \"./pl-dropdown.scss\";\nimport type { LOption } from \"./types\";\nimport { useGroupBy } from \"./useGroupBy\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M | undefined): void;\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The current selected value of the dropdown.\n */\n modelValue: M;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * List of available options for the dropdown\n */\n options?: Readonly<ListOption<M>[]>;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Shows red border even without an error message\n */\n errorStatus?: boolean;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Text shown in the field when `modelValue` has no matching option — e.g. its\n * upstream block was deleted. Rendered italic in error color.\n */\n missingValueLabel?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: MaskIconName16;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: MaskIconName24;\n /**\n * Option list item size\n */\n optionSize?: \"small\" | \"medium\";\n /**\n * Makes some of corners not rounded\n * */\n groupPosition?:\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\"\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"middle\";\n }>(),\n {\n label: \"\",\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n showErrorMessage: true,\n placeholder: \"...\",\n missingValueLabel: \"Value not available\",\n clearable: false,\n required: false,\n disabled: false,\n arrowIcon: undefined,\n arrowIconLarge: undefined,\n optionSize: \"small\",\n options: undefined,\n groupPosition: undefined,\n },\n);\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst optionListRef = useTemplateRef<InstanceType<typeof OptionList>>(\"optionListRef\");\n\nconst data = reactive({\n search: \"\",\n activeIndex: -1,\n open: false,\n optionsHeight: 0,\n});\n\nconst findActiveIndex = () =>\n tap(\n orderedRef.value.findIndex((o) => deepEqual(o.value, props.modelValue)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst isLoadingOptions = computed(() => {\n return props.options === undefined;\n});\n\n/**\n * Loading spinner should not be shown when the dropdown is explicitly disabled,\n * even if options are undefined. The disabled state takes precedence.\n */\nconst showLoadingSpinner = computed(() => {\n return !props.disabled && isLoadingOptions.value;\n});\n\nconst isDisabled = computed(() => {\n if (isLoadingOptions.value) {\n return true;\n }\n\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, props.modelValue));\n});\n\nconst hasValue = computed(() => {\n return props.modelValue !== undefined && props.modelValue !== null;\n});\n\nconst isMissing = computed(() => {\n return hasValue.value && selectedIndex.value === -1 && !isLoadingOptions.value;\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n // The field renders the missing state via `missingValueLabel`; no need to\n // duplicate it as a helper error.\n return undefined;\n});\n\nconst optionsRef = computed<LOption<M>[]>(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst textValue = computed(() => {\n const options = unref(optionsRef);\n const item: ListOption | undefined = options.find((o) => deepEqual(o.value, props.modelValue));\n return item?.label;\n});\n\n// Native tooltip with the full selected value. The `.input-value` layer has\n// `pointer-events: none`, so the title must sit on the field wrapper, which is\n// what actually receives the hover.\nconst fieldTitle = computed(() => {\n if (data.open) return undefined;\n if (isMissing.value) return props.missingValueLabel;\n return textValue.value !== undefined ? String(textValue.value) : undefined;\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && hasValue.value) {\n return \"\";\n }\n\n return textValue.value ? String(textValue.value) : props.placeholder;\n});\n\nconst filteredRef = computed(() => {\n const options = optionsRef.value;\n\n if (data.search) {\n return options.filter((o: ListOptionNormalized) => {\n const search = data.search.toLowerCase();\n\n if (o.label.toLowerCase().includes(search)) {\n return true;\n }\n\n if (o.description && o.description.toLowerCase().includes(search)) {\n return true;\n }\n\n if (typeof o.value === \"string\") {\n return o.value.toLowerCase().includes(search);\n }\n\n return o.value === data.search;\n });\n }\n\n return options;\n});\n\nconst { orderedRef, groupsRef, restRef } = useGroupBy(filteredRef, \"group\");\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : \"0\"));\n\nconst selectOption = (v: M | undefined) => {\n emit(\"update:modelValue\", v);\n data.search = \"\";\n data.open = false;\n rootRef?.value?.focus();\n};\n\nconst selectOptionWrapper = (v: unknown) => {\n selectOption(v as M | undefined);\n};\n\nconst clear = () => emit(\"update:modelValue\", undefined);\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => {\n data.open = !data.open;\n if (!data.open) {\n data.search = \"\";\n }\n};\n\nconst onInputFocus = () => (data.open = true);\n\nconst onFocusOut = (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (\n !rootRef.value?.contains(relatedTarget) &&\n !optionListRef.value?.listRef?.contains(relatedTarget)\n ) {\n data.search = \"\";\n data.open = false;\n }\n};\n\nconst handleKeydown = (e: { code: string; preventDefault(): void }) => {\n if (![\"ArrowDown\", \"ArrowUp\", \"Enter\", \"Escape\"].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n const { open, activeIndex } = data;\n\n if (!open) {\n if (e.code === \"Enter\") {\n data.open = true;\n }\n return;\n }\n\n if (e.code === \"Escape\") {\n data.open = false;\n rootRef.value?.focus();\n }\n\n const ordered = orderedRef.value;\n\n const { length } = ordered;\n\n if (!length) {\n return;\n }\n\n if (e.code === \"Enter\") {\n selectOption(ordered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = ordered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === \"ArrowDown\" ? 1 : e.code === \"ArrowUp\" ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = ordered[newIndex].index ?? -1;\n};\n\nuseLabelNotch(rootRef);\n\nwatch(() => props.modelValue, updateActive, { immediate: true });\n\nwatch(\n () => data.open,\n (open) => (open ? input.value?.focus() : \"\"),\n);\n\nwatchPostEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n data.search; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n optionListRef.value?.scrollIntoActive();\n }\n});\n</script>\n\n<template>\n <div class=\"pl-dropdown__envelope\" @click=\"setFocusOnInput\" data-testid=\"pl-dropdown\">\n <div\n ref=\"rootRef\"\n :tabindex=\"tabindex\"\n class=\"pl-dropdown\"\n data-testid=\"pl-dropdown-control\"\n :class=\"{ open: data.open, error: error || errorStatus, disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"pl-dropdown__container\">\n <div class=\"pl-dropdown__field\" :title=\"fieldTitle\">\n <input\n ref=\"input\"\n v-model=\"data.search\"\n type=\"text\"\n tabindex=\"-1\"\n :disabled=\"isDisabled\"\n :placeholder=\"computedPlaceholder\"\n spellcheck=\"false\"\n autocomplete=\"chrome-off\"\n data-testid=\"pl-dropdown-input\"\n @focus=\"onInputFocus\"\n />\n\n <div v-if=\"!data.open\" class=\"input-value\" data-testid=\"pl-dropdown-value\">\n <LongText\n v-if=\"isMissing\"\n class=\"input-value--missing\"\n data-testid=\"pl-dropdown-value-missing\"\n >\n {{ missingValueLabel }}\n </LongText>\n <LongText v-else-if=\"textValue !== undefined\">\n {{ textValue }}\n </LongText>\n </div>\n\n <div class=\"pl-dropdown__controls\">\n <PlIcon24 v-if=\"showLoadingSpinner\" name=\"loading\" data-testid=\"pl-dropdown-loading\" />\n <PlIcon16\n v-if=\"clearable && hasValue\"\n class=\"clear\"\n data-testid=\"pl-dropdown-clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <slot name=\"append\" />\n <div\n class=\"pl-dropdown__arrow-wrapper\"\n data-testid=\"pl-dropdown-arrow\"\n @click.stop=\"toggleOpen\"\n >\n <PlIcon24 v-if=\"arrowIconLarge\" :name=\"arrowIconLarge\" class=\"arrow-icon\" />\n <PlIcon16 v-else-if=\"arrowIcon\" :name=\"arrowIcon\" class=\"arrow-icon\" />\n <PlIcon16 v-else name=\"chevron-down\" class=\"arrow-icon arrow-icon-default\" />\n </div>\n </div>\n </div>\n <label v-if=\"label\" data-testid=\"pl-dropdown-label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" data-testid=\"pl-dropdown-required\" />\n <span>{{ label }}</span>\n <PlTooltip\n v-if=\"$slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-dropdown-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <OptionList\n v-if=\"data.open\"\n ref=\"optionListRef\"\n :root-ref=\"rootRef!\"\n :groups=\"groupsRef\"\n :rest=\"restRef\"\n :option-size=\"optionSize\"\n :select-option=\"selectOptionWrapper\"\n />\n <DoubleContour class=\"pl-dropdown__contour\" :group-position=\"groupPosition\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"pl-dropdown__error\" data-testid=\"pl-dropdown-error\">\n {{ computedError }}\n </div>\n <div\n v-else-if=\"showLoadingSpinner && loadingOptionsHelper\"\n class=\"pl-dropdown__helper\"\n data-testid=\"pl-dropdown-helper\"\n >\n {{ loadingOptionsHelper }}\n </div>\n <div v-else-if=\"helper\" class=\"pl-dropdown__helper\" data-testid=\"pl-dropdown-helper\">\n {{ helper }}\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBR,IAAM,IAAO,GAOP,IAAQ,GAgGR,IAAU,GAA8B,EACxC,IAAQ,GAAmC,EAE3C,IAAgB,GAAgD,gBAAgB,EAEhF,IAAO,GAAS;GACpB,QAAQ;GACR,aAAa;GACb,MAAM;GACN,eAAe;GAChB,CAAC,EAEI,UACJ,EACE,EAAW,MAAM,WAAW,MAAM,EAAU,EAAE,OAAO,EAAM,WAAW,CAAC,GACtE,MAAO,IAAI,IAAI,IAAI,EACrB,EAEG,UAAsB,EAAK,cAAc,GAAiB,EAE1D,IAAmB,QAChB,EAAM,YAAY,KAAA,EACzB,EAMI,IAAqB,QAClB,CAAC,EAAM,YAAY,EAAiB,MAC3C,EAEI,IAAa,QACb,EAAiB,QACZ,KAGF,EAAM,SACb,EAEI,IAAgB,SACZ,EAAM,WAAW,EAAE,EAAE,WAAW,MAAM,EAAU,EAAE,OAAO,EAAM,WAAW,CAAC,CACnF,EAEI,IAAW,QACR,EAAM,eAAe,KAAA,KAAa,EAAM,eAAe,KAC9D,EAEI,IAAY,QACT,EAAS,SAAS,EAAc,UAAU,MAAM,CAAC,EAAiB,MACzE,EAEI,IAAgB,QAAe;AAC/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AAA,EAArB,EAAuE,EAAA,EAAA,EAAA;;MAAtC,MAAM,EAAA;MAAW,OAAM;oCACxD,EAA6E,EAAA,EAAA,EAAA;;MAA5D,MAAK;MAAe,OAAM;;;;GAIpC,EAAA,SAAA,GAAA,EAAb,EAaQ,SAbR,IAaQ;IAZO,EAAA,YAAA,GAAA,EAAb,EAA+E,EAAA,EAAA,EAAA;;KAAvD,KAAK,EAAA,EAAW;KAAE,eAAY;;IACtD,EAAwB,QAAA,MAAA,EAAf,EAAA,MAAK,EAAA,EAAA;IAENA,EAAAA,OAAO,WAAA,GAAA,EADf,EASY,EAAA,EAAA,EAAA;;KAPV,OAAM;KACN,UAAS;KACT,eAAY;;KAED,SAAO,QACO,CAAvB,EAAuB,EAAA,QAAA,UAAA,CAAA,CAAA;;;;GAKrB,EAAK,QAAA,GAAA,EADb,EAQE,GAAA;;aANI;IAAJ,KAAI;IACH,YAAU,EAAA;IACV,QAAQ,EAAA,GAAS;IACjB,MAAM,EAAA,GAAO;IACb,eAAa,EAAA;IACb,iBAAe;;;;;;;GAElB,EAA8E,IAAA;IAA/D,OAAM;IAAwB,kBAAgB,EAAA;;gBAGtD,EAAA,SAAA,GAAA,EAAX,EAEM,OAFN,IAEM,EADD,EAAA,MAAa,EAAA,EAAA,IAGL,EAAA,SAAsB,EAAA,wBAAA,GAAA,EADnC,EAMM,OANN,GAMM,EADD,EAAA,qBAAoB,EAAA,EAAA,IAET,EAAA,UAAA,GAAA,EAAhB,EAEM,OAFN,GAEM,EADD,EAAA,OAAM,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"PlDropdownLegacy.js","names":[],"sources":["../../../src/components/PlDropdownLegacy/PlDropdownLegacy.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlDropdown\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport \"./pl-dropdown-legacy.scss\";\nimport { computed, reactive, ref, unref, useSlots, watch, watchPostEffect } from \"vue\";\nimport { tap, tapIf } from \"../../helpers/functions\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport type { ListOption, ListOptionNormalized } from \"../../types\";\nimport { scrollIntoView } from \"../../helpers/dom\";\nimport { deepEqual } from \"../../helpers/objects\";\nimport DropdownListItem from \"../DropdownListItem.vue\";\nimport LongText from \"../LongText.vue\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlMaskIcon24 } from \"../PlMaskIcon24\";\nimport { normalizeListOptions } from \"../../helpers/utils\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { PlSvg } from \"../PlSvg\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M | undefined): void;\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The current selected value of the dropdown.\n */\n modelValue: M;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * List of available options for the dropdown\n */\n options?: Readonly<ListOption<M>[]>;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: string;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: string;\n /**\n * Option list item size\n */\n optionSize?: \"small\" | \"medium\";\n }>(),\n {\n label: \"\",\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n placeholder: \"...\",\n clearable: false,\n required: false,\n disabled: false,\n arrowIcon: undefined,\n arrowIconLarge: undefined,\n optionSize: \"small\",\n options: undefined,\n },\n);\n\nconst slots = useSlots();\n\nconst root = ref<HTMLElement | undefined>();\nconst list = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst data = reactive({\n search: \"\",\n activeIndex: -1,\n open: false,\n});\n\nconst findActiveIndex = () =>\n tap(\n filteredRef.value.findIndex((o) => deepEqual(o.value, props.modelValue)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst isLoadingOptions = computed(() => {\n return props.options === undefined;\n});\n\nconst isDisabled = computed(() => {\n if (isLoadingOptions.value) {\n return true;\n }\n\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, props.modelValue));\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n if (props.modelValue !== undefined && selectedIndex.value === -1) {\n return \"The selected value is not one of the options\";\n }\n\n return undefined;\n});\n\nconst optionsRef = computed(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst textValue = computed(() => {\n const options = unref(optionsRef);\n\n const item: ListOption | undefined = options.find((o) => deepEqual(o.value, props.modelValue));\n\n return item?.label || props.modelValue; // @todo show inner value?\n});\n\n// Native tooltip with the full selected value; the value layer itself has\n// `pointer-events: none`, so the title goes on the field wrapper.\nconst fieldTitle = computed(() => {\n if (data.open) return undefined;\n const v = textValue.value;\n return v !== undefined && v !== null && v !== \"\" ? String(v) : undefined;\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && props.modelValue) {\n return \"\";\n }\n\n return props.modelValue ? String(textValue.value) : props.placeholder;\n});\n\nconst hasValue = computed(() => {\n return props.modelValue !== undefined && props.modelValue !== null;\n});\n\nconst filteredRef = computed(() => {\n const options = optionsRef.value;\n\n if (data.search) {\n return options.filter((o: ListOptionNormalized) => {\n const search = data.search.toLowerCase();\n\n if (o.label.toLowerCase().includes(search)) {\n return true;\n }\n\n if (o.description && o.description.toLowerCase().includes(search)) {\n return true;\n }\n\n if (typeof o.value === \"string\") {\n return o.value.toLowerCase().includes(search);\n }\n\n return o.value === data.search;\n });\n }\n\n return options;\n});\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : \"0\"));\n\nconst selectOption = (v: M | undefined) => {\n emit(\"update:modelValue\", v);\n data.search = \"\";\n data.open = false;\n root?.value?.focus();\n};\n\nconst clear = () => emit(\"update:modelValue\", undefined);\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => (data.open = !data.open);\n\nconst onInputFocus = () => (data.open = true);\n\nconst onFocusOut = (event: FocusEvent) => {\n if (!root?.value?.contains(event.relatedTarget as Node | null)) {\n data.search = \"\";\n data.open = false;\n }\n};\n\nconst scrollIntoActive = () => {\n const $list = list.value;\n\n if (!$list) {\n return;\n }\n\n tapIf($list.querySelector(\".hovered-item\") as HTMLElement, (opt) => {\n scrollIntoView($list, opt);\n });\n};\n\nconst handleKeydown = (e: { code: string; preventDefault(): void }) => {\n if (![\"ArrowDown\", \"ArrowUp\", \"Enter\", \"Escape\"].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n const { open, activeIndex } = data;\n\n if (!open) {\n if (e.code === \"Enter\") {\n data.open = true;\n }\n return;\n }\n\n if (e.code === \"Escape\") {\n data.open = false;\n root.value?.focus();\n }\n\n const filtered = unref(filteredRef);\n\n const { length } = filtered;\n\n if (!length) {\n return;\n }\n\n if (e.code === \"Enter\") {\n selectOption(filtered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = filtered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === \"ArrowDown\" ? 1 : e.code === \"ArrowUp\" ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = filteredRef.value[newIndex].index ?? -1;\n};\n\nuseLabelNotch(root);\n\nwatch(() => props.modelValue, updateActive, { immediate: true });\n\nwatch(\n () => data.open,\n (open) => (open ? input.value?.focus() : \"\"),\n);\n\nwatchPostEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n data.search; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n scrollIntoActive();\n }\n});\n</script>\n\n<template>\n <div class=\"ui-dropdown__envelope\">\n <div\n ref=\"root\"\n :tabindex=\"tabindex\"\n class=\"ui-dropdown\"\n :class=\"{ open: data.open, error, disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"ui-dropdown__container\">\n <div class=\"ui-dropdown__field\" :title=\"fieldTitle\">\n <input\n ref=\"input\"\n v-model=\"data.search\"\n type=\"text\"\n tabindex=\"-1\"\n :disabled=\"isDisabled\"\n :placeholder=\"computedPlaceholder\"\n spellcheck=\"false\"\n autocomplete=\"chrome-off\"\n @focus=\"onInputFocus\"\n />\n\n <div v-if=\"!data.open\" @click=\"setFocusOnInput\">\n <LongText class=\"input-value\"> {{ textValue }} </LongText>\n </div>\n\n <div class=\"ui-dropdown__controls\">\n <PlMaskIcon24 v-if=\"isLoadingOptions\" name=\"loading\" />\n <PlIcon16\n v-if=\"clearable && hasValue\"\n class=\"clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <slot name=\"append\" />\n <div\n v-if=\"arrowIconLarge\"\n class=\"arrow-icon\"\n :class=\"[`icon-24 ${arrowIconLarge}`]\"\n @click.stop=\"toggleOpen\"\n />\n <div\n v-else-if=\"arrowIcon\"\n class=\"arrow-icon\"\n :class=\"[`icon-16 ${arrowIcon}`]\"\n @click.stop=\"toggleOpen\"\n />\n <div v-else class=\"arrow-icon arrow-icon-default\" @click.stop=\"toggleOpen\" />\n </div>\n </div>\n <label v-if=\"label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" />\n <span>{{ label }}</span>\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div v-if=\"data.open\" ref=\"list\" class=\"ui-dropdown__options\">\n <DropdownListItem\n v-for=\"(item, index) in filteredRef\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n @click.stop=\"selectOption(item.value)\"\n />\n <div v-if=\"!filteredRef.length\" class=\"nothing-found\">Nothing found</div>\n </div>\n <DoubleContour class=\"ui-dropdown__contour\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"ui-dropdown__error\">{{ computedError }}</div>\n <div v-else-if=\"isLoadingOptions && loadingOptionsHelper\" class=\"ui-dropdown__helper\">\n {{ loadingOptionsHelper }}\n </div>\n <div v-else-if=\"helper\" class=\"ui-dropdown__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PlDropdownLegacy.js","names":[],"sources":["../../../src/components/PlDropdownLegacy/PlDropdownLegacy.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlDropdown\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport \"./pl-dropdown-legacy.scss\";\nimport { computed, reactive, ref, unref, useSlots, watch, watchPostEffect } from \"vue\";\nimport { tap, tapIf } from \"../../helpers/functions\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport type { ListOption, ListOptionNormalized } from \"../../types\";\nimport { scrollIntoView } from \"../../helpers/dom\";\nimport { deepEqual } from \"../../helpers/objects\";\nimport DropdownListItem from \"../DropdownListItem.vue\";\nimport LongText from \"../LongText.vue\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlMaskIcon24 } from \"../PlMaskIcon24\";\nimport { normalizeListOptions } from \"../../helpers/utils\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { PlSvg } from \"../PlSvg\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M | undefined): void;\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The current selected value of the dropdown.\n */\n modelValue: M;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * List of available options for the dropdown\n */\n options?: Readonly<ListOption<M>[]>;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: string;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: string;\n /**\n * Option list item size\n */\n optionSize?: \"small\" | \"medium\";\n }>(),\n {\n label: \"\",\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n placeholder: \"...\",\n clearable: false,\n required: false,\n disabled: false,\n arrowIcon: undefined,\n arrowIconLarge: undefined,\n optionSize: \"small\",\n options: undefined,\n },\n);\n\nconst slots = useSlots();\n\nconst root = ref<HTMLElement | undefined>();\nconst list = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst data = reactive({\n search: \"\",\n activeIndex: -1,\n open: false,\n});\n\nconst findActiveIndex = () =>\n tap(\n filteredRef.value.findIndex((o) => deepEqual(o.value, props.modelValue)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst isLoadingOptions = computed(() => {\n return props.options === undefined;\n});\n\nconst isDisabled = computed(() => {\n if (isLoadingOptions.value) {\n return true;\n }\n\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, props.modelValue));\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n if (props.modelValue !== undefined && selectedIndex.value === -1) {\n return \"The selected value is not one of the options\";\n }\n\n return undefined;\n});\n\nconst optionsRef = computed(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst textValue = computed(() => {\n const options = unref(optionsRef);\n\n const item: ListOption | undefined = options.find((o) => deepEqual(o.value, props.modelValue));\n\n return item?.label || props.modelValue; // @todo show inner value?\n});\n\n// Native tooltip with the full selected value; the value layer itself has\n// `pointer-events: none`, so the title goes on the field wrapper.\nconst fieldTitle = computed(() => {\n if (data.open) return undefined;\n const v = textValue.value;\n return v !== undefined && v !== null && v !== \"\" ? String(v) : undefined;\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && props.modelValue) {\n return \"\";\n }\n\n return props.modelValue ? String(textValue.value) : props.placeholder;\n});\n\nconst hasValue = computed(() => {\n return props.modelValue !== undefined && props.modelValue !== null;\n});\n\nconst filteredRef = computed(() => {\n const options = optionsRef.value;\n\n if (data.search) {\n return options.filter((o: ListOptionNormalized) => {\n const search = data.search.toLowerCase();\n\n if (o.label.toLowerCase().includes(search)) {\n return true;\n }\n\n if (o.description && o.description.toLowerCase().includes(search)) {\n return true;\n }\n\n if (typeof o.value === \"string\") {\n return o.value.toLowerCase().includes(search);\n }\n\n return o.value === data.search;\n });\n }\n\n return options;\n});\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : \"0\"));\n\nconst selectOption = (v: M | undefined) => {\n emit(\"update:modelValue\", v);\n data.search = \"\";\n data.open = false;\n root?.value?.focus();\n};\n\nconst clear = () => emit(\"update:modelValue\", undefined);\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => (data.open = !data.open);\n\nconst onInputFocus = () => (data.open = true);\n\nconst onFocusOut = (event: FocusEvent) => {\n if (!root?.value?.contains(event.relatedTarget as Node | null)) {\n data.search = \"\";\n data.open = false;\n }\n};\n\nconst scrollIntoActive = () => {\n const $list = list.value;\n\n if (!$list) {\n return;\n }\n\n tapIf($list.querySelector(\".hovered-item\") as HTMLElement, (opt) => {\n scrollIntoView($list, opt);\n });\n};\n\nconst handleKeydown = (e: { code: string; preventDefault(): void }) => {\n if (![\"ArrowDown\", \"ArrowUp\", \"Enter\", \"Escape\"].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n const { open, activeIndex } = data;\n\n if (!open) {\n if (e.code === \"Enter\") {\n data.open = true;\n }\n return;\n }\n\n if (e.code === \"Escape\") {\n data.open = false;\n root.value?.focus();\n }\n\n const filtered = unref(filteredRef);\n\n const { length } = filtered;\n\n if (!length) {\n return;\n }\n\n if (e.code === \"Enter\") {\n selectOption(filtered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = filtered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === \"ArrowDown\" ? 1 : e.code === \"ArrowUp\" ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = filteredRef.value[newIndex].index ?? -1;\n};\n\nuseLabelNotch(root);\n\nwatch(() => props.modelValue, updateActive, { immediate: true });\n\nwatch(\n () => data.open,\n (open) => (open ? input.value?.focus() : \"\"),\n);\n\nwatchPostEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n data.search; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n scrollIntoActive();\n }\n});\n</script>\n\n<template>\n <div class=\"ui-dropdown__envelope\" data-testid=\"pl-dropdown-legacy\">\n <div\n ref=\"root\"\n :tabindex=\"tabindex\"\n class=\"ui-dropdown\"\n data-testid=\"pl-dropdown-legacy-control\"\n :class=\"{ open: data.open, error, disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"ui-dropdown__container\">\n <div class=\"ui-dropdown__field\" :title=\"fieldTitle\">\n <input\n ref=\"input\"\n v-model=\"data.search\"\n type=\"text\"\n tabindex=\"-1\"\n :disabled=\"isDisabled\"\n :placeholder=\"computedPlaceholder\"\n spellcheck=\"false\"\n autocomplete=\"chrome-off\"\n data-testid=\"pl-dropdown-legacy-input\"\n @focus=\"onInputFocus\"\n />\n\n <div v-if=\"!data.open\" data-testid=\"pl-dropdown-legacy-value\" @click=\"setFocusOnInput\">\n <LongText class=\"input-value\"> {{ textValue }} </LongText>\n </div>\n\n <div class=\"ui-dropdown__controls\">\n <PlMaskIcon24\n v-if=\"isLoadingOptions\"\n name=\"loading\"\n data-testid=\"pl-dropdown-legacy-loading\"\n />\n <PlIcon16\n v-if=\"clearable && hasValue\"\n class=\"clear\"\n data-testid=\"pl-dropdown-legacy-clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <slot name=\"append\" />\n <div\n v-if=\"arrowIconLarge\"\n class=\"arrow-icon\"\n data-testid=\"pl-dropdown-legacy-arrow\"\n :class=\"[`icon-24 ${arrowIconLarge}`]\"\n @click.stop=\"toggleOpen\"\n />\n <div\n v-else-if=\"arrowIcon\"\n class=\"arrow-icon\"\n data-testid=\"pl-dropdown-legacy-arrow\"\n :class=\"[`icon-16 ${arrowIcon}`]\"\n @click.stop=\"toggleOpen\"\n />\n <div\n v-else\n class=\"arrow-icon arrow-icon-default\"\n data-testid=\"pl-dropdown-legacy-arrow\"\n @click.stop=\"toggleOpen\"\n />\n </div>\n </div>\n <label v-if=\"label\" data-testid=\"pl-dropdown-legacy-label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" data-testid=\"pl-dropdown-legacy-required\" />\n <span>{{ label }}</span>\n <PlTooltip\n v-if=\"slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-dropdown-legacy-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div\n v-if=\"data.open\"\n ref=\"list\"\n class=\"ui-dropdown__options\"\n data-testid=\"pl-dropdown-legacy-options\"\n >\n <DropdownListItem\n v-for=\"(item, index) in filteredRef\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n data-testid=\"pl-dropdown-legacy-option\"\n @click.stop=\"selectOption(item.value)\"\n />\n <div\n v-if=\"!filteredRef.length\"\n class=\"nothing-found\"\n data-testid=\"pl-dropdown-legacy-options-empty\"\n >\n Nothing found\n </div>\n </div>\n <DoubleContour class=\"ui-dropdown__contour\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"ui-dropdown__error\" data-testid=\"pl-dropdown-legacy-error\">\n {{ computedError }}\n </div>\n <div\n v-else-if=\"isLoadingOptions && loadingOptionsHelper\"\n class=\"ui-dropdown__helper\"\n data-testid=\"pl-dropdown-legacy-helper\"\n >\n {{ loadingOptionsHelper }}\n </div>\n <div v-else-if=\"helper\" class=\"ui-dropdown__helper\" data-testid=\"pl-dropdown-legacy-helper\">\n {{ helper }}\n </div>\n </div>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PlDropdownLegacy.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlDropdownLegacy/PlDropdownLegacy.vue"],"names":[],"mappings":"AAoZA,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AEG;sBACW,MAAM;QACpB;;WAEG;oBACS,OAAO;QACnB;;WAEG;mBACQ,OAAO;QAClB;;WAEG;mBACQ,OAAO;QAClB;;WAEG;oBACS,MAAM;QAClB;;WAEG;yBACc,MAAM;QACvB;;WAEG;qBACU,OAAO,GAAG,QAAQ;;;KAsjBwD,CAAC,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;iBAbE,CAAC,KAAK,IAAiB,KAAK,GAAG;;kBAC9B,CAAC,KAAK,IAAiB,KAAK,GAAG;;cApmBvC,mBAAmB,SAAS,CAAC,GAAG,SAAS,KAAG,IAAI;EAonBlD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;CAAI,CAAC;AACzF,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
@@ -19,18 +19,28 @@ import re from "../../assets/images/required.js";
19
19
  /* empty css */
20
20
  import { Fragment as ie, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as ae, createVNode as g, defineComponent as _, normalizeClass as v, openBlock as y, reactive as b, ref as x, renderList as S, renderSlot as C, toDisplayString as w, unref as T, useSlots as oe, vModelText as se, watch as E, watchPostEffect as ce, withCtx as D, withDirectives as le, withModifiers as O } from "vue";
21
21
  //#region src/components/PlDropdownLegacy/PlDropdownLegacy.vue?vue&type=script&setup=true&lang.ts
22
- var ue = { class: "ui-dropdown__envelope" }, de = ["tabindex"], fe = { class: "ui-dropdown__container" }, pe = ["title"], k = ["disabled", "placeholder"], A = { class: "ui-dropdown__controls" }, j = { key: 0 }, M = {
22
+ var ue = {
23
+ class: "ui-dropdown__envelope",
24
+ "data-testid": "pl-dropdown-legacy"
25
+ }, de = ["tabindex"], fe = { class: "ui-dropdown__container" }, pe = ["title"], k = ["disabled", "placeholder"], A = { class: "ui-dropdown__controls" }, j = {
23
26
  key: 0,
24
- class: "nothing-found"
27
+ "data-testid": "pl-dropdown-legacy-label"
28
+ }, M = {
29
+ key: 0,
30
+ class: "nothing-found",
31
+ "data-testid": "pl-dropdown-legacy-options-empty"
25
32
  }, N = {
26
33
  key: 0,
27
- class: "ui-dropdown__error"
34
+ class: "ui-dropdown__error",
35
+ "data-testid": "pl-dropdown-legacy-error"
28
36
  }, P = {
29
37
  key: 1,
30
- class: "ui-dropdown__helper"
38
+ class: "ui-dropdown__helper",
39
+ "data-testid": "pl-dropdown-legacy-helper"
31
40
  }, F = {
32
41
  key: 2,
33
- class: "ui-dropdown__helper"
42
+ class: "ui-dropdown__helper",
43
+ "data-testid": "pl-dropdown-legacy-helper"
34
44
  }, I = /* @__PURE__ */ _({
35
45
  name: "PlDropdown",
36
46
  props: {
@@ -123,6 +133,7 @@ var ue = { class: "ui-dropdown__envelope" }, de = ["tabindex"], fe = { class: "u
123
133
  error: _.error,
124
134
  disabled: G.value
125
135
  }]),
136
+ "data-testid": "pl-dropdown-legacy-control",
126
137
  onKeydown: we,
127
138
  onFocusout: Se
128
139
  }, [h("div", fe, [
@@ -140,10 +151,12 @@ var ue = { class: "ui-dropdown__envelope" }, de = ["tabindex"], fe = { class: "u
140
151
  placeholder: _e.value,
141
152
  spellcheck: "false",
142
153
  autocomplete: "chrome-off",
154
+ "data-testid": "pl-dropdown-legacy-input",
143
155
  onFocus: xe
144
156
  }, null, 40, k), [[se, U.search]]),
145
157
  U.open ? p("", !0) : (y(), m("div", {
146
158
  key: 0,
159
+ "data-testid": "pl-dropdown-legacy-value",
147
160
  onClick: be
148
161
  }, [g(o, { class: "input-value" }, {
149
162
  default: D(() => [ae(w(Y.value), 1)]),
@@ -152,11 +165,13 @@ var ue = { class: "ui-dropdown__envelope" }, de = ["tabindex"], fe = { class: "u
152
165
  h("div", A, [
153
166
  W.value ? (y(), f(T(te), {
154
167
  key: 0,
155
- name: "loading"
168
+ name: "loading",
169
+ "data-testid": "pl-dropdown-legacy-loading"
156
170
  })) : p("", !0),
157
171
  _.clearable && ve.value ? (y(), f(T(c), {
158
172
  key: 1,
159
173
  class: "clear",
174
+ "data-testid": "pl-dropdown-legacy-clear",
160
175
  name: "delete-clear",
161
176
  onClick: O(ye, ["stop"])
162
177
  })) : p("", !0),
@@ -164,14 +179,17 @@ var ue = { class: "ui-dropdown__envelope" }, de = ["tabindex"], fe = { class: "u
164
179
  _.arrowIconLarge ? (y(), m("div", {
165
180
  key: 2,
166
181
  class: v(["arrow-icon", [`icon-24 ${_.arrowIconLarge}`]]),
182
+ "data-testid": "pl-dropdown-legacy-arrow",
167
183
  onClick: O($, ["stop"])
168
184
  }, null, 2)) : _.arrowIcon ? (y(), m("div", {
169
185
  key: 3,
170
186
  class: v(["arrow-icon", [`icon-16 ${_.arrowIcon}`]]),
187
+ "data-testid": "pl-dropdown-legacy-arrow",
171
188
  onClick: O($, ["stop"])
172
189
  }, null, 2)) : (y(), m("div", {
173
190
  key: 4,
174
191
  class: "arrow-icon arrow-icon-default",
192
+ "data-testid": "pl-dropdown-legacy-arrow",
175
193
  onClick: O($, ["stop"])
176
194
  }))
177
195
  ])
@@ -179,13 +197,15 @@ var ue = { class: "ui-dropdown__envelope" }, de = ["tabindex"], fe = { class: "u
179
197
  _.label ? (y(), m("label", j, [
180
198
  _.required ? (y(), f(T(ee), {
181
199
  key: 0,
182
- uri: T(re)
200
+ uri: T(re),
201
+ "data-testid": "pl-dropdown-legacy-required"
183
202
  }, null, 8, ["uri"])) : p("", !0),
184
203
  h("span", null, w(_.label), 1),
185
204
  T(z).tooltip ? (y(), f(T(i), {
186
205
  key: 1,
187
206
  class: "info",
188
- position: "top"
207
+ position: "top",
208
+ "data-testid": "pl-dropdown-legacy-tooltip"
189
209
  }, {
190
210
  tooltip: D(() => [C(t.$slots, "tooltip")]),
191
211
  _: 3
@@ -195,13 +215,15 @@ var ue = { class: "ui-dropdown__envelope" }, de = ["tabindex"], fe = { class: "u
195
215
  key: 1,
196
216
  ref_key: "list",
197
217
  ref: V,
198
- class: "ui-dropdown__options"
218
+ class: "ui-dropdown__options",
219
+ "data-testid": "pl-dropdown-legacy-options"
199
220
  }, [(y(!0), m(ie, null, S(X.value, (t, n) => (y(), f(e, {
200
221
  key: n,
201
222
  option: t,
202
223
  "is-selected": t.isSelected,
203
224
  "is-hovered": t.isActive,
204
225
  size: _.optionSize,
226
+ "data-testid": "pl-dropdown-legacy-option",
205
227
  onClick: O((e) => Q(t.value), ["stop"])
206
228
  }, null, 8, [
207
229
  "option",
@@ -209,7 +231,7 @@ var ue = { class: "ui-dropdown__envelope" }, de = ["tabindex"], fe = { class: "u
209
231
  "is-hovered",
210
232
  "size",
211
233
  "onClick"
212
- ]))), 128)), X.value.length ? p("", !0) : (y(), m("div", M, "Nothing found"))], 512)) : p("", !0),
234
+ ]))), 128)), X.value.length ? p("", !0) : (y(), m("div", M, " Nothing found "))], 512)) : p("", !0),
213
235
  g(l, { class: "ui-dropdown__contour" })
214
236
  ])], 42, de), q.value ? (y(), m("div", N, w(q.value), 1)) : W.value && _.loadingOptionsHelper ? (y(), m("div", P, w(_.loadingOptionsHelper), 1)) : _.helper ? (y(), m("div", F, w(_.helper), 1)) : p("", !0)]));
215
237
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PlDropdownLegacy.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlDropdownLegacy/PlDropdownLegacy.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlDropdown\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport \"./pl-dropdown-legacy.scss\";\nimport { computed, reactive, ref, unref, useSlots, watch, watchPostEffect } from \"vue\";\nimport { tap, tapIf } from \"../../helpers/functions\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport type { ListOption, ListOptionNormalized } from \"../../types\";\nimport { scrollIntoView } from \"../../helpers/dom\";\nimport { deepEqual } from \"../../helpers/objects\";\nimport DropdownListItem from \"../DropdownListItem.vue\";\nimport LongText from \"../LongText.vue\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlMaskIcon24 } from \"../PlMaskIcon24\";\nimport { normalizeListOptions } from \"../../helpers/utils\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { PlSvg } from \"../PlSvg\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M | undefined): void;\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The current selected value of the dropdown.\n */\n modelValue: M;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * List of available options for the dropdown\n */\n options?: Readonly<ListOption<M>[]>;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: string;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: string;\n /**\n * Option list item size\n */\n optionSize?: \"small\" | \"medium\";\n }>(),\n {\n label: \"\",\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n placeholder: \"...\",\n clearable: false,\n required: false,\n disabled: false,\n arrowIcon: undefined,\n arrowIconLarge: undefined,\n optionSize: \"small\",\n options: undefined,\n },\n);\n\nconst slots = useSlots();\n\nconst root = ref<HTMLElement | undefined>();\nconst list = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst data = reactive({\n search: \"\",\n activeIndex: -1,\n open: false,\n});\n\nconst findActiveIndex = () =>\n tap(\n filteredRef.value.findIndex((o) => deepEqual(o.value, props.modelValue)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst isLoadingOptions = computed(() => {\n return props.options === undefined;\n});\n\nconst isDisabled = computed(() => {\n if (isLoadingOptions.value) {\n return true;\n }\n\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, props.modelValue));\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n if (props.modelValue !== undefined && selectedIndex.value === -1) {\n return \"The selected value is not one of the options\";\n }\n\n return undefined;\n});\n\nconst optionsRef = computed(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst textValue = computed(() => {\n const options = unref(optionsRef);\n\n const item: ListOption | undefined = options.find((o) => deepEqual(o.value, props.modelValue));\n\n return item?.label || props.modelValue; // @todo show inner value?\n});\n\n// Native tooltip with the full selected value; the value layer itself has\n// `pointer-events: none`, so the title goes on the field wrapper.\nconst fieldTitle = computed(() => {\n if (data.open) return undefined;\n const v = textValue.value;\n return v !== undefined && v !== null && v !== \"\" ? String(v) : undefined;\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && props.modelValue) {\n return \"\";\n }\n\n return props.modelValue ? String(textValue.value) : props.placeholder;\n});\n\nconst hasValue = computed(() => {\n return props.modelValue !== undefined && props.modelValue !== null;\n});\n\nconst filteredRef = computed(() => {\n const options = optionsRef.value;\n\n if (data.search) {\n return options.filter((o: ListOptionNormalized) => {\n const search = data.search.toLowerCase();\n\n if (o.label.toLowerCase().includes(search)) {\n return true;\n }\n\n if (o.description && o.description.toLowerCase().includes(search)) {\n return true;\n }\n\n if (typeof o.value === \"string\") {\n return o.value.toLowerCase().includes(search);\n }\n\n return o.value === data.search;\n });\n }\n\n return options;\n});\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : \"0\"));\n\nconst selectOption = (v: M | undefined) => {\n emit(\"update:modelValue\", v);\n data.search = \"\";\n data.open = false;\n root?.value?.focus();\n};\n\nconst clear = () => emit(\"update:modelValue\", undefined);\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => (data.open = !data.open);\n\nconst onInputFocus = () => (data.open = true);\n\nconst onFocusOut = (event: FocusEvent) => {\n if (!root?.value?.contains(event.relatedTarget as Node | null)) {\n data.search = \"\";\n data.open = false;\n }\n};\n\nconst scrollIntoActive = () => {\n const $list = list.value;\n\n if (!$list) {\n return;\n }\n\n tapIf($list.querySelector(\".hovered-item\") as HTMLElement, (opt) => {\n scrollIntoView($list, opt);\n });\n};\n\nconst handleKeydown = (e: { code: string; preventDefault(): void }) => {\n if (![\"ArrowDown\", \"ArrowUp\", \"Enter\", \"Escape\"].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n const { open, activeIndex } = data;\n\n if (!open) {\n if (e.code === \"Enter\") {\n data.open = true;\n }\n return;\n }\n\n if (e.code === \"Escape\") {\n data.open = false;\n root.value?.focus();\n }\n\n const filtered = unref(filteredRef);\n\n const { length } = filtered;\n\n if (!length) {\n return;\n }\n\n if (e.code === \"Enter\") {\n selectOption(filtered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = filtered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === \"ArrowDown\" ? 1 : e.code === \"ArrowUp\" ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = filteredRef.value[newIndex].index ?? -1;\n};\n\nuseLabelNotch(root);\n\nwatch(() => props.modelValue, updateActive, { immediate: true });\n\nwatch(\n () => data.open,\n (open) => (open ? input.value?.focus() : \"\"),\n);\n\nwatchPostEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n data.search; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n scrollIntoActive();\n }\n});\n</script>\n\n<template>\n <div class=\"ui-dropdown__envelope\">\n <div\n ref=\"root\"\n :tabindex=\"tabindex\"\n class=\"ui-dropdown\"\n :class=\"{ open: data.open, error, disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"ui-dropdown__container\">\n <div class=\"ui-dropdown__field\" :title=\"fieldTitle\">\n <input\n ref=\"input\"\n v-model=\"data.search\"\n type=\"text\"\n tabindex=\"-1\"\n :disabled=\"isDisabled\"\n :placeholder=\"computedPlaceholder\"\n spellcheck=\"false\"\n autocomplete=\"chrome-off\"\n @focus=\"onInputFocus\"\n />\n\n <div v-if=\"!data.open\" @click=\"setFocusOnInput\">\n <LongText class=\"input-value\"> {{ textValue }} </LongText>\n </div>\n\n <div class=\"ui-dropdown__controls\">\n <PlMaskIcon24 v-if=\"isLoadingOptions\" name=\"loading\" />\n <PlIcon16\n v-if=\"clearable && hasValue\"\n class=\"clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <slot name=\"append\" />\n <div\n v-if=\"arrowIconLarge\"\n class=\"arrow-icon\"\n :class=\"[`icon-24 ${arrowIconLarge}`]\"\n @click.stop=\"toggleOpen\"\n />\n <div\n v-else-if=\"arrowIcon\"\n class=\"arrow-icon\"\n :class=\"[`icon-16 ${arrowIcon}`]\"\n @click.stop=\"toggleOpen\"\n />\n <div v-else class=\"arrow-icon arrow-icon-default\" @click.stop=\"toggleOpen\" />\n </div>\n </div>\n <label v-if=\"label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" />\n <span>{{ label }}</span>\n <PlTooltip v-if=\"slots.tooltip\" class=\"info\" position=\"top\">\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div v-if=\"data.open\" ref=\"list\" class=\"ui-dropdown__options\">\n <DropdownListItem\n v-for=\"(item, index) in filteredRef\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n @click.stop=\"selectOption(item.value)\"\n />\n <div v-if=\"!filteredRef.length\" class=\"nothing-found\">Nothing found</div>\n </div>\n <DoubleContour class=\"ui-dropdown__contour\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"ui-dropdown__error\">{{ computedError }}</div>\n <div v-else-if=\"isLoadingOptions && loadingOptionsHelper\" class=\"ui-dropdown__helper\">\n {{ loadingOptionsHelper }}\n </div>\n <div v-else-if=\"helper\" class=\"ui-dropdown__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBR,IAAM,IAAO,GAOP,IAAQ,GAuER,IAAQ,IAAU,EAElB,IAAO,GAA8B,EACrC,IAAO,GAA8B,EACrC,IAAQ,GAAmC,EAE3C,IAAO,EAAS;GACpB,QAAQ;GACR,aAAa;GACb,MAAM;GACP,CAAC,EAEI,WACJ,EACE,EAAY,MAAM,WAAW,MAAM,EAAU,EAAE,OAAO,EAAM,WAAW,CAAC,GACvE,MAAO,IAAI,IAAI,IAAI,EACrB,EAEG,WAAsB,EAAK,cAAc,IAA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EAAA,qBAAoB,EAAA,EAAA,IAET,EAAA,UAAA,GAAA,EAAhB,EAAsE,OAAtE,GAAsE,EAAf,EAAA,OAAM,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"PlDropdownLegacy.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlDropdownLegacy/PlDropdownLegacy.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a list of options\n */\nexport default {\n name: \"PlDropdown\",\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport \"./pl-dropdown-legacy.scss\";\nimport { computed, reactive, ref, unref, useSlots, watch, watchPostEffect } from \"vue\";\nimport { tap, tapIf } from \"../../helpers/functions\";\nimport { PlTooltip } from \"../PlTooltip\";\nimport DoubleContour from \"../../utils/DoubleContour.vue\";\nimport { useLabelNotch } from \"../../utils/useLabelNotch\";\nimport type { ListOption, ListOptionNormalized } from \"../../types\";\nimport { scrollIntoView } from \"../../helpers/dom\";\nimport { deepEqual } from \"../../helpers/objects\";\nimport DropdownListItem from \"../DropdownListItem.vue\";\nimport LongText from \"../LongText.vue\";\nimport { PlIcon16 } from \"../PlIcon16\";\nimport { PlMaskIcon24 } from \"../PlMaskIcon24\";\nimport { normalizeListOptions } from \"../../helpers/utils\";\nimport { getErrorMessage } from \"../../helpers/error.ts\";\nimport { PlSvg } from \"../PlSvg\";\nimport SvgRequired from \"../../assets/images/required.svg?raw\";\n\nconst emit = defineEmits<{\n /**\n * Emitted when the model value is updated.\n */\n (e: \"update:modelValue\", value: M | undefined): void;\n}>();\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The current selected value of the dropdown.\n */\n modelValue: M;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * List of available options for the dropdown\n */\n options?: Readonly<ListOption<M>[]>;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: string;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: string;\n /**\n * Option list item size\n */\n optionSize?: \"small\" | \"medium\";\n }>(),\n {\n label: \"\",\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n placeholder: \"...\",\n clearable: false,\n required: false,\n disabled: false,\n arrowIcon: undefined,\n arrowIconLarge: undefined,\n optionSize: \"small\",\n options: undefined,\n },\n);\n\nconst slots = useSlots();\n\nconst root = ref<HTMLElement | undefined>();\nconst list = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst data = reactive({\n search: \"\",\n activeIndex: -1,\n open: false,\n});\n\nconst findActiveIndex = () =>\n tap(\n filteredRef.value.findIndex((o) => deepEqual(o.value, props.modelValue)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst isLoadingOptions = computed(() => {\n return props.options === undefined;\n});\n\nconst isDisabled = computed(() => {\n if (isLoadingOptions.value) {\n return true;\n }\n\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return (props.options ?? []).findIndex((o) => deepEqual(o.value, props.modelValue));\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n if (props.modelValue !== undefined && selectedIndex.value === -1) {\n return \"The selected value is not one of the options\";\n }\n\n return undefined;\n});\n\nconst optionsRef = computed(() =>\n normalizeListOptions(props.options ?? []).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })),\n);\n\nconst textValue = computed(() => {\n const options = unref(optionsRef);\n\n const item: ListOption | undefined = options.find((o) => deepEqual(o.value, props.modelValue));\n\n return item?.label || props.modelValue; // @todo show inner value?\n});\n\n// Native tooltip with the full selected value; the value layer itself has\n// `pointer-events: none`, so the title goes on the field wrapper.\nconst fieldTitle = computed(() => {\n if (data.open) return undefined;\n const v = textValue.value;\n return v !== undefined && v !== null && v !== \"\" ? String(v) : undefined;\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && props.modelValue) {\n return \"\";\n }\n\n return props.modelValue ? String(textValue.value) : props.placeholder;\n});\n\nconst hasValue = computed(() => {\n return props.modelValue !== undefined && props.modelValue !== null;\n});\n\nconst filteredRef = computed(() => {\n const options = optionsRef.value;\n\n if (data.search) {\n return options.filter((o: ListOptionNormalized) => {\n const search = data.search.toLowerCase();\n\n if (o.label.toLowerCase().includes(search)) {\n return true;\n }\n\n if (o.description && o.description.toLowerCase().includes(search)) {\n return true;\n }\n\n if (typeof o.value === \"string\") {\n return o.value.toLowerCase().includes(search);\n }\n\n return o.value === data.search;\n });\n }\n\n return options;\n});\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : \"0\"));\n\nconst selectOption = (v: M | undefined) => {\n emit(\"update:modelValue\", v);\n data.search = \"\";\n data.open = false;\n root?.value?.focus();\n};\n\nconst clear = () => emit(\"update:modelValue\", undefined);\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => (data.open = !data.open);\n\nconst onInputFocus = () => (data.open = true);\n\nconst onFocusOut = (event: FocusEvent) => {\n if (!root?.value?.contains(event.relatedTarget as Node | null)) {\n data.search = \"\";\n data.open = false;\n }\n};\n\nconst scrollIntoActive = () => {\n const $list = list.value;\n\n if (!$list) {\n return;\n }\n\n tapIf($list.querySelector(\".hovered-item\") as HTMLElement, (opt) => {\n scrollIntoView($list, opt);\n });\n};\n\nconst handleKeydown = (e: { code: string; preventDefault(): void }) => {\n if (![\"ArrowDown\", \"ArrowUp\", \"Enter\", \"Escape\"].includes(e.code)) {\n return;\n } else {\n e.preventDefault();\n }\n\n const { open, activeIndex } = data;\n\n if (!open) {\n if (e.code === \"Enter\") {\n data.open = true;\n }\n return;\n }\n\n if (e.code === \"Escape\") {\n data.open = false;\n root.value?.focus();\n }\n\n const filtered = unref(filteredRef);\n\n const { length } = filtered;\n\n if (!length) {\n return;\n }\n\n if (e.code === \"Enter\") {\n selectOption(filtered.find((it) => it.index === activeIndex)?.value);\n }\n\n const localIndex = filtered.findIndex((it) => it.index === activeIndex) ?? -1;\n\n const delta = e.code === \"ArrowDown\" ? 1 : e.code === \"ArrowUp\" ? -1 : 0;\n\n const newIndex = Math.abs(localIndex + delta + length) % length;\n\n data.activeIndex = filteredRef.value[newIndex].index ?? -1;\n};\n\nuseLabelNotch(root);\n\nwatch(() => props.modelValue, updateActive, { immediate: true });\n\nwatch(\n () => data.open,\n (open) => (open ? input.value?.focus() : \"\"),\n);\n\nwatchPostEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n data.search; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n scrollIntoActive();\n }\n});\n</script>\n\n<template>\n <div class=\"ui-dropdown__envelope\" data-testid=\"pl-dropdown-legacy\">\n <div\n ref=\"root\"\n :tabindex=\"tabindex\"\n class=\"ui-dropdown\"\n data-testid=\"pl-dropdown-legacy-control\"\n :class=\"{ open: data.open, error, disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"ui-dropdown__container\">\n <div class=\"ui-dropdown__field\" :title=\"fieldTitle\">\n <input\n ref=\"input\"\n v-model=\"data.search\"\n type=\"text\"\n tabindex=\"-1\"\n :disabled=\"isDisabled\"\n :placeholder=\"computedPlaceholder\"\n spellcheck=\"false\"\n autocomplete=\"chrome-off\"\n data-testid=\"pl-dropdown-legacy-input\"\n @focus=\"onInputFocus\"\n />\n\n <div v-if=\"!data.open\" data-testid=\"pl-dropdown-legacy-value\" @click=\"setFocusOnInput\">\n <LongText class=\"input-value\"> {{ textValue }} </LongText>\n </div>\n\n <div class=\"ui-dropdown__controls\">\n <PlMaskIcon24\n v-if=\"isLoadingOptions\"\n name=\"loading\"\n data-testid=\"pl-dropdown-legacy-loading\"\n />\n <PlIcon16\n v-if=\"clearable && hasValue\"\n class=\"clear\"\n data-testid=\"pl-dropdown-legacy-clear\"\n name=\"delete-clear\"\n @click.stop=\"clear\"\n />\n <slot name=\"append\" />\n <div\n v-if=\"arrowIconLarge\"\n class=\"arrow-icon\"\n data-testid=\"pl-dropdown-legacy-arrow\"\n :class=\"[`icon-24 ${arrowIconLarge}`]\"\n @click.stop=\"toggleOpen\"\n />\n <div\n v-else-if=\"arrowIcon\"\n class=\"arrow-icon\"\n data-testid=\"pl-dropdown-legacy-arrow\"\n :class=\"[`icon-16 ${arrowIcon}`]\"\n @click.stop=\"toggleOpen\"\n />\n <div\n v-else\n class=\"arrow-icon arrow-icon-default\"\n data-testid=\"pl-dropdown-legacy-arrow\"\n @click.stop=\"toggleOpen\"\n />\n </div>\n </div>\n <label v-if=\"label\" data-testid=\"pl-dropdown-legacy-label\">\n <PlSvg v-if=\"required\" :uri=\"SvgRequired\" data-testid=\"pl-dropdown-legacy-required\" />\n <span>{{ label }}</span>\n <PlTooltip\n v-if=\"slots.tooltip\"\n class=\"info\"\n position=\"top\"\n data-testid=\"pl-dropdown-legacy-tooltip\"\n >\n <template #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlTooltip>\n </label>\n <div\n v-if=\"data.open\"\n ref=\"list\"\n class=\"ui-dropdown__options\"\n data-testid=\"pl-dropdown-legacy-options\"\n >\n <DropdownListItem\n v-for=\"(item, index) in filteredRef\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n data-testid=\"pl-dropdown-legacy-option\"\n @click.stop=\"selectOption(item.value)\"\n />\n <div\n v-if=\"!filteredRef.length\"\n class=\"nothing-found\"\n data-testid=\"pl-dropdown-legacy-options-empty\"\n >\n Nothing found\n </div>\n </div>\n <DoubleContour class=\"ui-dropdown__contour\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"ui-dropdown__error\" data-testid=\"pl-dropdown-legacy-error\">\n {{ computedError }}\n </div>\n <div\n v-else-if=\"isLoadingOptions && loadingOptionsHelper\"\n class=\"ui-dropdown__helper\"\n data-testid=\"pl-dropdown-legacy-helper\"\n >\n {{ loadingOptionsHelper }}\n </div>\n <div v-else-if=\"helper\" class=\"ui-dropdown__helper\" data-testid=\"pl-dropdown-legacy-helper\">\n {{ helper }}\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBR,IAAM,IAAO,GAOP,IAAQ,GAuER,IAAQ,IAAU,EAElB,IAAO,GAA8B,EACrC,IAAO,GAA8B,EACrC,IAAQ,GAAmC,EAE3C,IAAO,EAAS;GACpB,QAAQ;GACR,aAAa;GACb,MAAM;GACP,CAAC,EAEI,WACJ,EACE,EAAY,MAAM,WAAW,MAAM,EAAU,EAAE,OAAO,EAAM,WAAW,CAAC,GACvE,MAAO,IAAI,IAAI,IAAI,EACrB,EAEG,WAAsB,EAAK,cAAc,IAAiB,EAE1D,IAAmB,QAChB,EAAM,YAAY,KAAA,EACzB,EAEI,IAAa,QACb,EAAiB,QACZ,KAGF,EAAM,SACb,EAEI,IAAgB,SACZ,EAAM,WAAW,EAAE,EAAE,WAAW,MAAM,EAAU,EAAE,OAAO,EAAM,WAAW,CAAC,CACnF,EAEI,IAAgB,QAAe;AAC/B,UAAiB,OAIrB;QAAI,EAAM,MACR,QAAO,EAAgB,EAAM,MAAM;AAGrC,QAAI,EAAM,eAAe,KAAA,KAAa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