@milaboratories/uikit 2.6.1 → 2.6.3

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 (215) hide show
  1. package/.turbo/turbo-build.log +143 -143
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +14 -0
  4. package/dist/base/BtnBase.vue.js +18 -18
  5. package/dist/base/BtnBase.vue.js.map +1 -1
  6. package/dist/components/ContextProvider.vue.js.map +1 -1
  7. package/dist/components/DataTable/BaseCellComponent.vue.js +20 -20
  8. package/dist/components/DataTable/BaseCellComponent.vue.js.map +1 -1
  9. package/dist/components/DataTable/ColumnCaret.vue.js +6 -6
  10. package/dist/components/DataTable/ColumnCaret.vue.js.map +1 -1
  11. package/dist/components/DataTable/ColumnsCommandMenu.vue.js.map +1 -1
  12. package/dist/components/DataTable/RowsCommandMenu.vue.js.map +1 -1
  13. package/dist/components/DataTable/TScroll.vue.js +12 -12
  14. package/dist/components/DataTable/TScroll.vue.js.map +1 -1
  15. package/dist/components/DataTable/TableComponent.vue.js +5 -3
  16. package/dist/components/DataTable/TableComponent.vue.js.map +1 -1
  17. package/dist/components/DataTable/TdCell.vue.js +36 -36
  18. package/dist/components/DataTable/TdCell.vue.js.map +1 -1
  19. package/dist/components/DataTable/ThCell.vue.js +27 -27
  20. package/dist/components/DataTable/ThCell.vue.js.map +1 -1
  21. package/dist/components/DataTable/TrBody.vue.js +12 -12
  22. package/dist/components/DataTable/TrBody.vue.js.map +1 -1
  23. package/dist/components/DataTable/TrHead.vue.js.map +1 -1
  24. package/dist/components/DataTable/assets/TableIcon.vue.js +2 -2
  25. package/dist/components/DataTable/assets/TableIcon.vue.js.map +1 -1
  26. package/dist/components/DropdownListItem.vue.js +18 -18
  27. package/dist/components/DropdownListItem.vue.js.map +1 -1
  28. package/dist/components/HScroll.vue.js.map +1 -1
  29. package/dist/components/InputRange.vue.js.map +1 -1
  30. package/dist/components/LongText.vue.js +1 -1
  31. package/dist/components/LongText.vue.js.map +1 -1
  32. package/dist/components/LongText.vue3.js +1 -1
  33. package/dist/components/PlAccordion/ExpandTransition.vue.js.map +1 -1
  34. package/dist/components/PlAccordion/ExpandTransition.vue2.js.map +1 -1
  35. package/dist/components/PlAccordion/ExpandTransition.vue3.js +1 -1
  36. package/dist/components/PlAccordion/PlAccordion.vue.js.map +1 -1
  37. package/dist/components/PlAccordion/PlAccordionSection.vue2.js +21 -21
  38. package/dist/components/PlAccordion/PlAccordionSection.vue2.js.map +1 -1
  39. package/dist/components/PlAlert/PlAlert.vue.js +23 -23
  40. package/dist/components/PlAlert/PlAlert.vue.js.map +1 -1
  41. package/dist/components/PlAutocomplete/PlAutocomplete.vue.d.ts +4 -0
  42. package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +112 -106
  43. package/dist/components/PlAutocomplete/PlAutocomplete.vue.js.map +1 -1
  44. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.d.ts +4 -0
  45. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js +100 -94
  46. package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js.map +1 -1
  47. package/dist/components/PlBtnAccent/PlBtnAccent.vue.js.map +1 -1
  48. package/dist/components/PlBtnDanger/PlBtnDanger.vue.js.map +1 -1
  49. package/dist/components/PlBtnGhost/PlBtnGhost.vue.js +21 -21
  50. package/dist/components/PlBtnGhost/PlBtnGhost.vue.js.map +1 -1
  51. package/dist/components/PlBtnGroup/PlBtnGroup.vue.js +34 -34
  52. package/dist/components/PlBtnGroup/PlBtnGroup.vue.js.map +1 -1
  53. package/dist/components/PlBtnLink/PlBtnLink.vue.js +12 -12
  54. package/dist/components/PlBtnLink/PlBtnLink.vue.js.map +1 -1
  55. package/dist/components/PlBtnPrimary/PlBtnPrimary.vue.js.map +1 -1
  56. package/dist/components/PlBtnSecondary/PlBtnSecondary.vue.js.map +1 -1
  57. package/dist/components/PlBtnSplit/PlBtnSplit.vue.js +31 -31
  58. package/dist/components/PlBtnSplit/PlBtnSplit.vue.js.map +1 -1
  59. package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js +18 -18
  60. package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js.map +1 -1
  61. package/dist/components/PlChartStackedBar/Legends.vue2.js.map +1 -1
  62. package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js +15 -15
  63. package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js.map +1 -1
  64. package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.vue2.js.map +1 -1
  65. package/dist/components/PlChartStackedBar/StackedRow.vue2.js.map +1 -1
  66. package/dist/components/PlChartStackedBar/StackedRowCompact.vue2.js.map +1 -1
  67. package/dist/components/PlCheckbox/PlCheckbox.vue.js +13 -13
  68. package/dist/components/PlCheckbox/PlCheckbox.vue.js.map +1 -1
  69. package/dist/components/PlCheckbox/PlCheckboxBase.vue.js +6 -6
  70. package/dist/components/PlCheckbox/PlCheckboxBase.vue.js.map +1 -1
  71. package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue.js +28 -28
  72. package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue.js.map +1 -1
  73. package/dist/components/PlChip/PlChip.vue.js +20 -20
  74. package/dist/components/PlChip/PlChip.vue.js.map +1 -1
  75. package/dist/components/PlClipboard/PlClipboard.vue2.js.map +1 -1
  76. package/dist/components/PlConfirmDialog.vue.js +14 -14
  77. package/dist/components/PlConfirmDialog.vue.js.map +1 -1
  78. package/dist/components/PlDialogModal/PlDialogModal.vue.js +30 -30
  79. package/dist/components/PlDialogModal/PlDialogModal.vue.js.map +1 -1
  80. package/dist/components/PlDropdown/OptionList.vue.js +40 -40
  81. package/dist/components/PlDropdown/OptionList.vue.js.map +1 -1
  82. package/dist/components/PlDropdown/PlDropdown.vue.d.ts +8 -0
  83. package/dist/components/PlDropdown/PlDropdown.vue.js +102 -95
  84. package/dist/components/PlDropdown/PlDropdown.vue.js.map +1 -1
  85. package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +95 -93
  86. package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js.map +1 -1
  87. package/dist/components/PlDropdownLine/PlDropdownLine.vue.d.ts +1 -1
  88. package/dist/components/PlDropdownLine/PlDropdownLine.vue.js +4 -4
  89. package/dist/components/PlDropdownLine/PlDropdownLine.vue.js.map +1 -1
  90. package/dist/components/PlDropdownLine/ResizableInput.vue.js +12 -12
  91. package/dist/components/PlDropdownLine/ResizableInput.vue.js.map +1 -1
  92. package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.d.ts +4 -0
  93. package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +88 -82
  94. package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js.map +1 -1
  95. package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.d.ts +1 -1
  96. package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.js.map +1 -1
  97. package/dist/components/PlDropdownRef/PlDropdownRef.vue.js +11 -11
  98. package/dist/components/PlDropdownRef/PlDropdownRef.vue.js.map +1 -1
  99. package/dist/components/PlEditableTitle/PlEditableTitle.vue.d.ts +1 -1
  100. package/dist/components/PlEditableTitle/PlEditableTitle.vue.js +36 -36
  101. package/dist/components/PlEditableTitle/PlEditableTitle.vue.js.map +1 -1
  102. package/dist/components/PlElementList/PlElementList.vue.d.ts +20 -0
  103. package/dist/components/PlElementList/PlElementList.vue2.js +180 -135
  104. package/dist/components/PlElementList/PlElementList.vue2.js.map +1 -1
  105. package/dist/components/PlElementList/PlElementListItem.vue.d.ts +20 -0
  106. package/dist/components/PlElementList/PlElementListItem.vue2.js +101 -76
  107. package/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
  108. package/dist/components/PlErrorAlert/PlErrorAlert.vue2.js.map +1 -1
  109. package/dist/components/PlErrorBoundary/PlErrorBoundary.vue.js.map +1 -1
  110. package/dist/components/PlFileDialog/Local.vue.js +24 -24
  111. package/dist/components/PlFileDialog/Local.vue.js.map +1 -1
  112. package/dist/components/PlFileDialog/PlFileDialog.vue.js +38 -38
  113. package/dist/components/PlFileDialog/PlFileDialog.vue.js.map +1 -1
  114. package/dist/components/PlFileDialog/Remote.vue.js +2 -2
  115. package/dist/components/PlFileDialog/Remote.vue.js.map +1 -1
  116. package/dist/components/PlFileDialog/Shortcuts.vue2.js +4 -4
  117. package/dist/components/PlFileDialog/Shortcuts.vue2.js.map +1 -1
  118. package/dist/components/PlFileInput/PlFileInput.vue.d.ts +1 -1
  119. package/dist/components/PlFileInput/PlFileInput.vue.js +78 -76
  120. package/dist/components/PlFileInput/PlFileInput.vue.js.map +1 -1
  121. package/dist/components/PlIcon16/PlIcon16.vue2.js.map +1 -1
  122. package/dist/components/PlIcon24/PlIcon24.vue2.js.map +1 -1
  123. package/dist/components/PlLoaderCircular/PlLoaderCircular.vue.js +11 -11
  124. package/dist/components/PlLoaderCircular/PlLoaderCircular.vue.js.map +1 -1
  125. package/dist/components/PlLogView/PlLogView.vue.js +62 -60
  126. package/dist/components/PlLogView/PlLogView.vue.js.map +1 -1
  127. package/dist/components/PlNotificationAlert/PlNotificationAlert.vue.js +22 -22
  128. package/dist/components/PlNotificationAlert/PlNotificationAlert.vue.js.map +1 -1
  129. package/dist/components/PlNumberField/PlNumberField.vue.d.ts +6 -1
  130. package/dist/components/PlNumberField/PlNumberField.vue.js +66 -60
  131. package/dist/components/PlNumberField/PlNumberField.vue.js.map +1 -1
  132. package/dist/components/PlProgressBar/PlProgressBar.vue.js +12 -12
  133. package/dist/components/PlProgressBar/PlProgressBar.vue.js.map +1 -1
  134. package/dist/components/PlProgressCell/PlProgressCell.vue.js +20 -20
  135. package/dist/components/PlProgressCell/PlProgressCell.vue.js.map +1 -1
  136. package/dist/components/PlRadio/PlRadio.vue2.js.map +1 -1
  137. package/dist/components/PlRadio/PlRadioGroup.vue2.js +8 -8
  138. package/dist/components/PlRadio/PlRadioGroup.vue2.js.map +1 -1
  139. package/dist/components/PlSearchField/PlSearchField.vue2.js +19 -19
  140. package/dist/components/PlSearchField/PlSearchField.vue2.js.map +1 -1
  141. package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js +8 -8
  142. package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js.map +1 -1
  143. package/dist/components/PlSidebar/PlSidebarGroup.vue2.js.map +1 -1
  144. package/dist/components/PlSidebar/PlSidebarItem.vue2.js.map +1 -1
  145. package/dist/components/PlSlideModal/PlPureSlideModal.vue.js +5 -3
  146. package/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -1
  147. package/dist/components/PlSlideModal/PlSlideModal.vue2.js.map +1 -1
  148. package/dist/components/PlSplash/PlSplash.vue.js +16 -16
  149. package/dist/components/PlSplash/PlSplash.vue.js.map +1 -1
  150. package/dist/components/PlStatusTag/PlStatusTag.vue.js +7 -7
  151. package/dist/components/PlStatusTag/PlStatusTag.vue.js.map +1 -1
  152. package/dist/components/PlSvg/PlSvg.vue2.js.map +1 -1
  153. package/dist/components/PlTabs/PlTabs.vue.js +18 -18
  154. package/dist/components/PlTabs/PlTabs.vue.js.map +1 -1
  155. package/dist/components/PlTabs/Tab.vue.js +9 -9
  156. package/dist/components/PlTabs/Tab.vue.js.map +1 -1
  157. package/dist/components/PlTextArea/PlTextArea.vue.js +55 -53
  158. package/dist/components/PlTextArea/PlTextArea.vue.js.map +1 -1
  159. package/dist/components/PlTextField/PlTextField.vue.d.ts +4 -0
  160. package/dist/components/PlTextField/PlTextField.vue.js +66 -60
  161. package/dist/components/PlTextField/PlTextField.vue.js.map +1 -1
  162. package/dist/components/PlToggleSwitch/PlToggleSwitch.vue.js +14 -14
  163. package/dist/components/PlToggleSwitch/PlToggleSwitch.vue.js.map +1 -1
  164. package/dist/components/PlTooltip/Beak.vue.js +2 -2
  165. package/dist/components/PlTooltip/Beak.vue.js.map +1 -1
  166. package/dist/components/PlTooltip/PlTooltip.vue.js +50 -50
  167. package/dist/components/PlTooltip/PlTooltip.vue.js.map +1 -1
  168. package/dist/components/Scrollable.vue.js.map +1 -1
  169. package/dist/components/Slider.vue.js +35 -35
  170. package/dist/components/Slider.vue.js.map +1 -1
  171. package/dist/components/SliderRange.vue.js +47 -47
  172. package/dist/components/SliderRange.vue.js.map +1 -1
  173. package/dist/components/SliderRangeTriple.vue.js +47 -47
  174. package/dist/components/SliderRangeTriple.vue.js.map +1 -1
  175. package/dist/components/TabItem.vue.js.map +1 -1
  176. package/dist/components/ThemeSwitcher.vue.js +2 -2
  177. package/dist/components/ThemeSwitcher.vue.js.map +1 -1
  178. package/dist/components/TransitionSlidePanel.vue.js.map +1 -1
  179. package/dist/components/VScroll.vue.js.map +1 -1
  180. package/dist/components/contextMenu/Menu.vue2.js +12 -12
  181. package/dist/components/contextMenu/Menu.vue2.js.map +1 -1
  182. package/dist/composition/filters/metadata.d.ts +205 -0
  183. package/dist/composition/filters/metadata.js +129 -19
  184. package/dist/composition/filters/metadata.js.map +1 -1
  185. package/dist/index.js +1 -1
  186. package/dist/layout/PlBlockPage/PlBlockPage.vue.js +27 -27
  187. package/dist/layout/PlBlockPage/PlBlockPage.vue.js.map +1 -1
  188. package/dist/layout/PlContainer/PlContainer.vue.js +10 -10
  189. package/dist/layout/PlContainer/PlContainer.vue.js.map +1 -1
  190. package/dist/layout/PlGrid/PlGrid.vue.js.map +1 -1
  191. package/dist/layout/PlRow/PlRow.vue.js +8 -8
  192. package/dist/layout/PlRow/PlRow.vue.js.map +1 -1
  193. package/dist/layout/PlSpacer/PlSpacer.vue.js.map +1 -1
  194. package/dist/utils/DoubleContour.vue.d.ts +7 -1
  195. package/dist/utils/DoubleContour.vue.js +20 -13
  196. package/dist/utils/DoubleContour.vue.js.map +1 -1
  197. package/dist/utils/DoubleContour.vue3.js +7 -0
  198. package/dist/utils/DoubleContour.vue3.js.map +1 -0
  199. package/dist/utils/DropdownOverlay/DropdownOverlay.vue.js.map +1 -1
  200. package/dist/utils/PlCloseModalBtn.vue.js +2 -2
  201. package/dist/utils/PlCloseModalBtn.vue.js.map +1 -1
  202. package/dist/utils/TextLabel.vue.js.map +1 -1
  203. package/package.json +5 -5
  204. package/src/components/PlAutocomplete/PlAutocomplete.vue +6 -1
  205. package/src/components/PlAutocompleteMulti/PlAutocompleteMulti.vue +6 -1
  206. package/src/components/PlDropdown/PlDropdown.vue +12 -2
  207. package/src/components/PlDropdownMulti/PlDropdownMulti.vue +6 -1
  208. package/src/components/PlElementList/PlElementList.vue +40 -6
  209. package/src/components/PlElementList/PlElementListItem.vue +64 -47
  210. package/src/components/PlNumberField/PlNumberField.vue +4 -1
  211. package/src/components/PlTextField/PlTextField.vue +5 -1
  212. package/src/composition/filters/metadata.ts +105 -0
  213. package/src/utils/DoubleContour.vue +68 -2
  214. package/dist/utils/DoubleContour.vue2.js +0 -7
  215. package/dist/utils/DoubleContour.vue2.js.map +0 -1
@@ -1,38 +1,40 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(`.ui-lt-container{min-width:0;white-space:nowrap;overflow:hidden;position:relative;border-radius:5px}.ui-lt-container span{display:inline-block;overflow:hidden;text-overflow:ellipsis;width:100%;vertical-align:bottom;pointer-events:all!important}.ui-lt-container .ui-lt-animate{position:relative;animation:left-to-right var(--5deba9de) infinite alternate linear;overflow:unset!important;text-overflow:unset!important;width:fit-content!important}@keyframes left-to-right{0%{transform:translate(0);left:0%}to{transform:translate(-101%);left:101%}}
1
+ (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(`.double-contour.top>div{border-bottom-right-radius:0;border-bottom-left-radius:0}.double-contour.bottom>div{border-top-right-radius:0;border-top-left-radius:0}.double-contour.left>div{border-top-right-radius:0;border-bottom-right-radius:0}.double-contour.right>div{border-top-left-radius:0;border-bottom-left-radius:0}.double-contour.top-left>div{border-top-right-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.double-contour.top-right>div{border-bottom-right-radius:0;border-top-left-radius:0;border-top-right-radius:0}.double-contour.bottom-left>div{border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}.double-contour.bottom-right>div{border-top-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:0}.double-contour.middle>div{border-radius:0}
2
+ .ui-lt-container{min-width:0;white-space:nowrap;overflow:hidden;position:relative;border-radius:5px}.ui-lt-container span{display:inline-block;overflow:hidden;text-overflow:ellipsis;width:100%;vertical-align:bottom;pointer-events:all!important}.ui-lt-container .ui-lt-animate{position:relative;animation:left-to-right var(--v5deba9de) infinite alternate linear;overflow:unset!important;text-overflow:unset!important;width:fit-content!important}@keyframes left-to-right{0%{transform:translate(0);left:0%}to{transform:translate(-101%);left:101%}}
2
3
  .pl-dropdown__options{--option-hover-bg: var(--btn-sec-hover-grey);z-index:var(--z-dropdown-options);border:1px solid var(--border-color-div-grey);position:absolute;background-color:var(--pl-dropdown-options-bg);border-radius:6px;max-height:244px;box-shadow:0 4px 12px -2px #0f244d14,0 6px 24px -2px #0f244d14;--thumb-color: var(--ic-02);overflow-y:auto}.pl-dropdown__options::-webkit-scrollbar{width:var(--scrollbar-width, 6px);height:5px;background-color:transparent;display:block}.pl-dropdown__options::-webkit-scrollbar-thumb{background:var(--thumb-color);border-radius:5px}.pl-dropdown__options::-webkit-scrollbar-thumb:hover{--thumb-color: var(--border-color-focus)}.pl-dropdown__options .nothing-found{padding:0 10px;height:var(--control-height);line-height:var(--control-height);background-color:#fff;opacity:.5;font-style:italic}.pl-dropdown__options .group-container{padding:4px 0}.pl-dropdown{--contour-color: var(--txt-01);--contour-border-width: 1px;--label-offset-left-x: 8px;--label-offset-right-x: 8px;--label-color: var(--txt-01);position:relative;outline:none;min-height:var(--control-height);border-radius:6px;font-family:var(--font-family-base);font-size:var(--font-size-base);font-weight:var(--font-weigh-base)}.pl-dropdown__envelope{font-family:var(--control-font-family);min-width:160px}.pl-dropdown label{display:flex;align-items:center;gap:4px;position:absolute;top:0;transform:translateY(-60%);left:var(--label-offset-left-x);padding:0 4px;max-width:calc(100% - 16px);overflow:hidden;white-space:pre;text-overflow:ellipsis;cursor:inherit;color:var(--label-color);font-size:12px;font-weight:500;border-bottom-right-radius:4px;border-bottom-left-radius:4px;background:var(--bg-elevated-01)}.pl-dropdown label>span{overflow:hidden;white-space:pre;text-overflow:ellipsis}.pl-dropdown__container{position:absolute;top:0;left:0;right:0;border-radius:6px;min-height:var(--control-height);color:var(--txt-01)}.pl-dropdown__contour{border-radius:var(--border-radius-control);border:var(--contour-border-width) solid var(--contour-color);box-shadow:var(--contour-box-shadow);z-index:0;pointer-events:none}.pl-dropdown__field{position:relative;border-radius:6px;overflow:hidden;background:transparent;padding-left:11px;min-height:var(--control-height);line-height:var(--control-height);display:flex;flex-direction:row;align-items:center;cursor:pointer}.pl-dropdown__field .input-value{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;flex-direction:row;align-items:center;padding:0 60px 0 11px;pointer-events:none;line-height:20px;color:var(--txt-01);overflow:hidden;white-space:pre;text-overflow:ellipsis;cursor:inherit}.pl-dropdown__field input{min-height:calc(var(--control-height) - 2px);line-height:20px;font-family:inherit;font-size:inherit;background-color:transparent;border:none;padding:0;width:calc(100% - 40px);color:var(--txt-01);caret-color:var(--border-color-focus)}.pl-dropdown__field input:focus{outline:none}.pl-dropdown__field input:placeholder-shown{text-overflow:ellipsis}.pl-dropdown__field input::placeholder{color:var(--color-placeholder)}.pl-dropdown__helper{font-size:12px;color:var(--txt-03);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.pl-dropdown__error{font-size:12px;color:var(--txt-error);padding:2px 0 0;white-space:pre-wrap;text-overflow:ellipsis;font-weight:500;line-height:16px;margin-top:6px}.pl-dropdown__controls{display:flex;flex-direction:row;align-items:center;gap:6px;margin-left:auto}.pl-dropdown__controls .mask-16,.pl-dropdown__controls .mask-24{cursor:pointer}.pl-dropdown__controls .clear{--icon-color: var(--ic-02)}.pl-dropdown__controls .mask-loading{--icon-color: var(--ic-accent);animation:spin 2.5s linear infinite}.pl-dropdown__arrow-wrapper{display:flex;align-items:center;min-height:var(--control-height);padding-right:11px}.pl-dropdown .arrow-icon{cursor:pointer}.pl-dropdown .arrow-icon.arrow-icon-default{transition:transform .2s}.pl-dropdown.open,.pl-dropdown:focus-within{z-index:1;--label-color: var(--txt-focus)}.pl-dropdown.open .pl-dropdown__container{z-index:1000}.pl-dropdown.open .pl-dropdown__field{border-radius:6px 6px 0 0}.pl-dropdown.open .arrow-icon.arrow-icon-default{transform:rotate(-180deg)}.pl-dropdown:hover{--contour-color: var(--control-hover-color)}.pl-dropdown:focus-within:not(.error){--label-color: var(--txt-focus);--contour-color: var(--border-color-focus);--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--border-color-focus-shadow)}.pl-dropdown:focus-within.error{--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--color-error-shadow)}.pl-dropdown.error{--contour-color: var(--txt-error);--label-color: var(--txt-error)}.pl-dropdown.disabled{--contour-color: var(--color-dis-01);--icon-color: var(--color-dis-01);--label-color: var(--color-dis-01);cursor:not-allowed;pointer-events:none;-webkit-user-select:none;user-select:none}.pl-dropdown.disabled .input-value{color:var(--dis-01)}`)),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
3
- import { defineComponent as le, ref as D, useTemplateRef as ae, reactive as se, computed as s, unref as a, watch as S, watchPostEffect as ie, createElementBlock as m, openBlock as n, createElementVNode as p, createCommentVNode as d, normalizeClass as de, createBlock as u, createVNode as B, withDirectives as ue, vModelText as ce, withCtx as z, createTextVNode as pe, toDisplayString as v, renderSlot as M, withModifiers as P } from "vue";
4
+ import { defineComponent as le, ref as B, useTemplateRef as ae, reactive as ie, computed as s, unref as i, watch as P, watchPostEffect as se, createElementBlock as v, openBlock as l, createElementVNode as f, createCommentVNode as c, normalizeClass as de, createBlock as u, createVNode as D, withDirectives as ce, vModelText as ue, withCtx as $, createTextVNode as pe, toDisplayString as h, renderSlot as z, withModifiers as M } from "vue";
4
5
  import fe from "../../assets/images/required.svg.js";
5
6
  import { getErrorMessage as me } from "../../helpers/error.js";
6
7
  import { tap as ve } from "../../helpers/functions.js";
7
- import { deepEqual as y } from "../../helpers/objects.js";
8
+ import { deepEqual as x } from "../../helpers/objects.js";
8
9
  import { normalizeListOptions as he } from "../../helpers/utils.js";
9
10
  import we from "../../utils/DoubleContour.vue.js";
10
- import { useLabelNotch as _e } from "../../utils/useLabelNotch.js";
11
- import ge from "../LongText.vue.js";
12
11
 
13
- import I from "../PlIcon16/PlIcon16.vue.js";
12
+ import { useLabelNotch as ge } from "../../utils/useLabelNotch.js";
13
+ import ye from "../LongText.vue.js";
14
+
15
+ import _ from "../PlIcon16/PlIcon16.vue.js";
14
16
  import T from "../PlIcon24/PlIcon24.vue.js";
15
17
  import ke from "../PlSvg/PlSvg.vue.js";
16
- import ye from "../PlTooltip/PlTooltip.vue.js";
17
- import Ie from "./OptionList.vue.js";
18
+ import Ie from "../PlTooltip/PlTooltip.vue.js";
19
+ import xe from "./OptionList.vue.js";
18
20
 
19
- import { useGroupBy as be } from "./useGroupBy.js";
20
- const Ve = ["tabindex"], Le = { class: "pl-dropdown__container" }, Ce = { class: "pl-dropdown__field" }, Ee = ["disabled", "placeholder"], Re = {
21
+ import { useGroupBy as _e } from "./useGroupBy.js";
22
+ const Ve = ["tabindex"], be = { class: "pl-dropdown__container" }, Le = { class: "pl-dropdown__field" }, Ce = ["disabled", "placeholder"], Ee = {
21
23
  key: 0,
22
24
  class: "input-value"
23
- }, Oe = { class: "pl-dropdown__controls" }, xe = { key: 0 }, Ae = {
25
+ }, Re = { class: "pl-dropdown__controls" }, Oe = { key: 0 }, Se = {
24
26
  key: 0,
25
27
  class: "pl-dropdown__error"
26
- }, De = {
28
+ }, Ae = {
27
29
  key: 1,
28
30
  class: "pl-dropdown__helper"
29
- }, Se = {
31
+ }, Be = {
30
32
  key: 2,
31
33
  class: "pl-dropdown__helper"
32
- }, Be = {
34
+ }, Pe = {
33
35
  name: "PlDropdown"
34
- }, Ye = /* @__PURE__ */ le({
35
- ...Be,
36
+ }, Ze = /* @__PURE__ */ le({
37
+ ...Pe,
36
38
  props: {
37
39
  modelValue: {},
38
40
  label: { default: "" },
@@ -40,150 +42,152 @@ const Ve = ["tabindex"], Le = { class: "pl-dropdown__container" }, Ce = { class:
40
42
  helper: { default: void 0 },
41
43
  loadingOptionsHelper: { default: void 0 },
42
44
  error: { default: void 0 },
45
+ errorStatus: { type: Boolean },
43
46
  placeholder: { default: "..." },
44
47
  clearable: { type: Boolean, default: !1 },
45
48
  required: { type: Boolean, default: !1 },
46
49
  disabled: { type: Boolean, default: !1 },
47
50
  arrowIcon: { default: void 0 },
48
51
  arrowIconLarge: { default: void 0 },
49
- optionSize: { default: "small" }
52
+ optionSize: { default: "small" },
53
+ groupPosition: { default: void 0 }
50
54
  },
51
55
  emits: ["update:modelValue"],
52
- setup($, { emit: F }) {
53
- const b = F, r = $, i = D(), w = D(), _ = ae("optionListRef"), o = se({
56
+ setup(n, { emit: F }) {
57
+ const V = F, r = n, d = B(), g = B(), y = ae("optionListRef"), o = ie({
54
58
  search: "",
55
59
  activeIndex: -1,
56
60
  open: !1,
57
61
  optionsHeight: 0
58
62
  }), N = () => ve(
59
- R.value.findIndex((e) => y(e.value, r.modelValue)),
63
+ R.value.findIndex((e) => x(e.value, r.modelValue)),
60
64
  (e) => e < 0 ? 0 : e
61
- ), q = () => o.activeIndex = N(), h = s(() => r.options === void 0), g = s(() => h.value ? !0 : r.disabled), V = s(() => (r.options ?? []).findIndex((e) => y(e.value, r.modelValue))), L = s(() => {
62
- if (!h.value) {
65
+ ), q = () => o.activeIndex = N(), w = s(() => r.options === void 0), k = s(() => w.value ? !0 : r.disabled), b = s(() => (r.options ?? []).findIndex((e) => x(e.value, r.modelValue))), L = s(() => {
66
+ if (!w.value) {
63
67
  if (r.error)
64
68
  return me(r.error);
65
- if (r.modelValue !== void 0 && V.value === -1)
69
+ if (r.modelValue !== void 0 && b.value === -1)
66
70
  return "The selected value is not one of the options";
67
71
  }
68
72
  }), C = s(
69
73
  () => he(r.options ?? []).map((e, t) => ({
70
74
  ...e,
71
75
  index: t,
72
- isSelected: t === V.value,
76
+ isSelected: t === b.value,
73
77
  isActive: t === o.activeIndex
74
78
  }))
75
79
  ), E = s(() => {
76
- const t = a(C).find((l) => y(l.value, r.modelValue));
80
+ const t = i(C).find((a) => x(a.value, r.modelValue));
77
81
  return (t == null ? void 0 : t.label) || r.modelValue;
78
82
  }), H = s(() => !o.open && r.modelValue !== void 0 ? "" : r.modelValue ? String(E.value) : r.placeholder), U = s(() => r.modelValue !== void 0 && r.modelValue !== null), K = s(() => {
79
83
  const e = C.value;
80
84
  return o.search ? e.filter((t) => {
81
- const l = o.search.toLowerCase();
82
- return t.label.toLowerCase().includes(l) || t.description && t.description.toLowerCase().includes(l) ? !0 : typeof t.value == "string" ? t.value.toLowerCase().includes(l) : t.value === o.search;
85
+ const a = o.search.toLowerCase();
86
+ return t.label.toLowerCase().includes(a) || t.description && t.description.toLowerCase().includes(a) ? !0 : typeof t.value == "string" ? t.value.toLowerCase().includes(a) : t.value === o.search;
83
87
  }) : e;
84
- }), { orderedRef: R, groupsRef: G, restRef: W } = be(K, "group"), j = s(() => g.value ? void 0 : "0"), O = (e) => {
88
+ }), { orderedRef: R, groupsRef: G, restRef: W } = _e(K, "group"), j = s(() => k.value ? void 0 : "0"), O = (e) => {
85
89
  var t;
86
- b("update:modelValue", e), o.search = "", o.open = !1, (t = i == null ? void 0 : i.value) == null || t.focus();
90
+ V("update:modelValue", e), o.search = "", o.open = !1, (t = d == null ? void 0 : d.value) == null || t.focus();
87
91
  }, J = (e) => {
88
92
  O(e);
89
- }, Q = () => b("update:modelValue", void 0), X = () => {
93
+ }, Q = () => V("update:modelValue", void 0), X = () => {
90
94
  var e;
91
- return (e = w.value) == null ? void 0 : e.focus();
95
+ return (e = g.value) == null ? void 0 : e.focus();
92
96
  }, Y = () => {
93
97
  o.open = !o.open, o.open || (o.search = "");
94
98
  }, Z = () => o.open = !0, ee = (e) => {
95
- var l, c, f;
99
+ var a, p, m;
96
100
  const t = e.relatedTarget;
97
- !((l = i.value) != null && l.contains(t)) && !((f = (c = _.value) == null ? void 0 : c.listRef) != null && f.contains(t)) && (o.search = "", o.open = !1);
101
+ !((a = d.value) != null && a.contains(t)) && !((m = (p = y.value) == null ? void 0 : p.listRef) != null && m.contains(t)) && (o.search = "", o.open = !1);
98
102
  }, oe = (e) => {
99
- var x, A;
103
+ var S, A;
100
104
  if (["ArrowDown", "ArrowUp", "Enter", "Escape"].includes(e.code))
101
105
  e.preventDefault();
102
106
  else
103
107
  return;
104
- const { open: t, activeIndex: l } = o;
108
+ const { open: t, activeIndex: a } = o;
105
109
  if (!t) {
106
110
  e.code === "Enter" && (o.open = !0);
107
111
  return;
108
112
  }
109
- e.code === "Escape" && (o.open = !1, (x = i.value) == null || x.focus());
110
- const c = R.value, { length: f } = c;
111
- if (!f)
113
+ e.code === "Escape" && (o.open = !1, (S = d.value) == null || S.focus());
114
+ const p = R.value, { length: m } = p;
115
+ if (!m)
112
116
  return;
113
- e.code === "Enter" && O((A = c.find((k) => k.index === l)) == null ? void 0 : A.value);
114
- const te = c.findIndex((k) => k.index === l) ?? -1, re = e.code === "ArrowDown" ? 1 : e.code === "ArrowUp" ? -1 : 0, ne = Math.abs(te + re + f) % f;
115
- o.activeIndex = c[ne].index ?? -1;
117
+ e.code === "Enter" && O((A = p.find((I) => I.index === a)) == null ? void 0 : A.value);
118
+ const te = p.findIndex((I) => I.index === a) ?? -1, ne = e.code === "ArrowDown" ? 1 : e.code === "ArrowUp" ? -1 : 0, re = Math.abs(te + ne + m) % m;
119
+ o.activeIndex = p[re].index ?? -1;
116
120
  };
117
- return _e(i), S(() => r.modelValue, q, { immediate: !0 }), S(
121
+ return ge(d), P(() => r.modelValue, q, { immediate: !0 }), P(
118
122
  () => o.open,
119
123
  (e) => {
120
124
  var t;
121
- return e ? (t = w.value) == null ? void 0 : t.focus() : "";
125
+ return e ? (t = g.value) == null ? void 0 : t.focus() : "";
122
126
  }
123
- ), ie(() => {
127
+ ), se(() => {
124
128
  var e;
125
- o.search, o.activeIndex >= 0 && o.open && ((e = _.value) == null || e.scrollIntoActive());
126
- }), (e, t) => (n(), m("div", {
129
+ o.search, o.activeIndex >= 0 && o.open && ((e = y.value) == null || e.scrollIntoActive());
130
+ }), (e, t) => (l(), v("div", {
127
131
  class: "pl-dropdown__envelope",
128
132
  onClick: X
129
133
  }, [
130
- p("div", {
134
+ f("div", {
131
135
  ref_key: "rootRef",
132
- ref: i,
136
+ ref: d,
133
137
  tabindex: j.value,
134
- class: de(["pl-dropdown", { open: o.open, error: e.error, disabled: g.value }]),
138
+ class: de(["pl-dropdown", { open: o.open, error: n.error || n.errorStatus, disabled: k.value }]),
135
139
  onKeydown: oe,
136
140
  onFocusout: ee
137
141
  }, [
138
- p("div", Le, [
139
- p("div", Ce, [
140
- ue(p("input", {
142
+ f("div", be, [
143
+ f("div", Le, [
144
+ ce(f("input", {
141
145
  ref_key: "input",
142
- ref: w,
143
- "onUpdate:modelValue": t[0] || (t[0] = (l) => o.search = l),
146
+ ref: g,
147
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => o.search = a),
144
148
  type: "text",
145
149
  tabindex: "-1",
146
- disabled: g.value,
150
+ disabled: k.value,
147
151
  placeholder: H.value,
148
152
  spellcheck: "false",
149
153
  autocomplete: "chrome-off",
150
154
  onFocus: Z
151
- }, null, 40, Ee), [
152
- [ce, o.search]
155
+ }, null, 40, Ce), [
156
+ [ue, o.search]
153
157
  ]),
154
- o.open ? d("", !0) : (n(), m("div", Re, [
155
- B(ge, null, {
156
- default: z(() => [
157
- pe(v(E.value), 1)
158
+ o.open ? c("", !0) : (l(), v("div", Ee, [
159
+ D(ye, null, {
160
+ default: $(() => [
161
+ pe(h(E.value), 1)
158
162
  ]),
159
163
  _: 1
160
164
  })
161
165
  ])),
162
- p("div", Oe, [
163
- h.value ? (n(), u(a(T), {
166
+ f("div", Re, [
167
+ w.value ? (l(), u(i(T), {
164
168
  key: 0,
165
169
  name: "loading"
166
- })) : d("", !0),
167
- e.clearable && U.value ? (n(), u(a(I), {
170
+ })) : c("", !0),
171
+ n.clearable && U.value ? (l(), u(i(_), {
168
172
  key: 1,
169
173
  class: "clear",
170
174
  name: "delete-clear",
171
- onClick: P(Q, ["stop"])
172
- })) : d("", !0),
173
- M(e.$slots, "append"),
174
- p("div", {
175
+ onClick: M(Q, ["stop"])
176
+ })) : c("", !0),
177
+ z(e.$slots, "append"),
178
+ f("div", {
175
179
  class: "pl-dropdown__arrow-wrapper",
176
- onClick: P(Y, ["stop"])
180
+ onClick: M(Y, ["stop"])
177
181
  }, [
178
- e.arrowIconLarge ? (n(), u(a(T), {
182
+ n.arrowIconLarge ? (l(), u(i(T), {
179
183
  key: 0,
180
- name: e.arrowIconLarge,
184
+ name: n.arrowIconLarge,
181
185
  class: "arrow-icon"
182
- }, null, 8, ["name"])) : e.arrowIcon ? (n(), u(a(I), {
186
+ }, null, 8, ["name"])) : n.arrowIcon ? (l(), u(i(_), {
183
187
  key: 1,
184
- name: e.arrowIcon,
188
+ name: n.arrowIcon,
185
189
  class: "arrow-icon"
186
- }, null, 8, ["name"])) : (n(), u(a(I), {
190
+ }, null, 8, ["name"])) : (l(), u(i(_), {
187
191
  key: 2,
188
192
  name: "chevron-down",
189
193
  class: "arrow-icon arrow-icon-default"
@@ -191,41 +195,44 @@ const Ve = ["tabindex"], Le = { class: "pl-dropdown__container" }, Ce = { class:
191
195
  ])
192
196
  ])
193
197
  ]),
194
- e.label ? (n(), m("label", xe, [
195
- e.required ? (n(), u(a(ke), {
198
+ n.label ? (l(), v("label", Oe, [
199
+ n.required ? (l(), u(i(ke), {
196
200
  key: 0,
197
- uri: a(fe)
198
- }, null, 8, ["uri"])) : d("", !0),
199
- p("span", null, v(e.label), 1),
200
- e.$slots.tooltip ? (n(), u(a(ye), {
201
+ uri: i(fe)
202
+ }, null, 8, ["uri"])) : c("", !0),
203
+ f("span", null, h(n.label), 1),
204
+ e.$slots.tooltip ? (l(), u(i(Ie), {
201
205
  key: 1,
202
206
  class: "info",
203
207
  position: "top"
204
208
  }, {
205
- tooltip: z(() => [
206
- M(e.$slots, "tooltip")
209
+ tooltip: $(() => [
210
+ z(e.$slots, "tooltip")
207
211
  ]),
208
212
  _: 3
209
- })) : d("", !0)
210
- ])) : d("", !0),
211
- o.open ? (n(), u(Ie, {
213
+ })) : c("", !0)
214
+ ])) : c("", !0),
215
+ o.open ? (l(), u(xe, {
212
216
  key: 1,
213
217
  ref_key: "optionListRef",
214
- ref: _,
215
- "root-ref": i.value,
216
- groups: a(G),
217
- rest: a(W),
218
- "option-size": e.optionSize,
218
+ ref: y,
219
+ "root-ref": d.value,
220
+ groups: i(G),
221
+ rest: i(W),
222
+ "option-size": n.optionSize,
219
223
  "select-option": J
220
- }, null, 8, ["root-ref", "groups", "rest", "option-size"])) : d("", !0),
221
- B(we, { class: "pl-dropdown__contour" })
224
+ }, null, 8, ["root-ref", "groups", "rest", "option-size"])) : c("", !0),
225
+ D(we, {
226
+ class: "pl-dropdown__contour",
227
+ "group-position": n.groupPosition
228
+ }, null, 8, ["group-position"])
222
229
  ])
223
230
  ], 42, Ve),
224
- L.value ? (n(), m("div", Ae, v(L.value), 1)) : h.value && e.loadingOptionsHelper ? (n(), m("div", De, v(e.loadingOptionsHelper), 1)) : e.helper ? (n(), m("div", Se, v(e.helper), 1)) : d("", !0)
231
+ L.value ? (l(), v("div", Se, h(L.value), 1)) : w.value && n.loadingOptionsHelper ? (l(), v("div", Ae, h(n.loadingOptionsHelper), 1)) : n.helper ? (l(), v("div", Be, h(n.helper), 1)) : c("", !0)
225
232
  ]));
226
233
  }
227
234
  });
228
235
  export {
229
- Ye as default
236
+ Ze as default
230
237
  };
231
238
  //# sourceMappingURL=PlDropdown.vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlDropdown.vue.js","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 * 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?: 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 {\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 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\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<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\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\nconst computedPlaceholder = computed(() => {\n if (!data.open && props.modelValue !== undefined) {\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 { 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 (!rootRef.value?.contains(relatedTarget) && !optionListRef.value?.listRef?.contains(relatedTarget)) {\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, disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"pl-dropdown__container\">\n <div class=\"pl-dropdown__field\">\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> {{ textValue }} </LongText>\n </div>\n\n <div class=\"pl-dropdown__controls\">\n <PlIcon24 v-if=\"isLoadingOptions\" name=\"loading\" />\n <PlIcon16 v-if=\"clearable && hasValue\" class=\"clear\" name=\"delete-clear\" @click.stop=\"clear\" />\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\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"pl-dropdown__error\">{{ computedError }}</div>\n <div v-else-if=\"isLoadingOptions && loadingOptionsHelper\" class=\"pl-dropdown__helper\">{{ loadingOptionsHelper }}</div>\n <div v-else-if=\"helper\" class=\"pl-dropdown__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"names":["__default__","emit","__emit","props","__props","rootRef","ref","input","optionListRef","useTemplateRef","data","reactive","findActiveIndex","tap","orderedRef","o","deepEqual","v","updateActive","isLoadingOptions","computed","isDisabled","selectedIndex","computedError","getErrorMessage","optionsRef","normalizeListOptions","opt","index","textValue","item","unref","computedPlaceholder","hasValue","filteredRef","options","search","groupsRef","restRef","useGroupBy","tabindex","selectOption","_a","selectOptionWrapper","clear","setFocusOnInput","toggleOpen","onInputFocus","onFocusOut","event","relatedTarget","_c","_b","handleKeydown","open","activeIndex","ordered","length","it","localIndex","delta","newIndex","useLabelNotch","watch","watchPostEffect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIAA,KAAe;AAAA,EACb,MAAM;AACR;;;;;;;;;;;;;;;;;;;AAuBA,UAAMC,IAAOC,GAOPC,IAAQC,GAuERC,IAAUC,EAAA,GACVC,IAAQD,EAAA,GAERE,IAAgBC,GAAgD,eAAe,GAE/EC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A;AAAA,IAAA,GAG3CsB,GAAgB,MAAM;;AAEpB,MAAAtD,EAAK,QAEDA,EAAK,eAAe,KAAKA,EAAK,UAChCgC,IAAAlC,EAAc,UAAd,QAAAkC,EAAqB;AAAA,IAEzB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"PlDropdown.vue.js","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 * 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?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle';\n }>(),\n {\n label: '',\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n showErrorMessage: true,\n placeholder: '...',\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\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<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\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\nconst computedPlaceholder = computed(() => {\n if (!data.open && props.modelValue !== undefined) {\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 { 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 (!rootRef.value?.contains(relatedTarget) && !optionListRef.value?.listRef?.contains(relatedTarget)) {\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\">\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> {{ textValue }} </LongText>\n </div>\n\n <div class=\"pl-dropdown__controls\">\n <PlIcon24 v-if=\"isLoadingOptions\" name=\"loading\" />\n <PlIcon16 v-if=\"clearable && hasValue\" class=\"clear\" name=\"delete-clear\" @click.stop=\"clear\" />\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=\"isLoadingOptions && loadingOptionsHelper\" class=\"pl-dropdown__helper\">{{ loadingOptionsHelper }}</div>\n <div v-else-if=\"helper\" class=\"pl-dropdown__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"names":["__default__","emit","__emit","props","__props","rootRef","ref","input","optionListRef","useTemplateRef","data","reactive","findActiveIndex","tap","orderedRef","o","deepEqual","v","updateActive","isLoadingOptions","computed","isDisabled","selectedIndex","computedError","getErrorMessage","optionsRef","normalizeListOptions","opt","index","textValue","item","unref","computedPlaceholder","hasValue","filteredRef","options","search","groupsRef","restRef","useGroupBy","tabindex","selectOption","_a","selectOptionWrapper","clear","setFocusOnInput","toggleOpen","onInputFocus","onFocusOut","event","relatedTarget","_c","_b","handleKeydown","open","activeIndex","ordered","length","it","localIndex","delta","newIndex","useLabelNotch","watch","watchPostEffect","_createElementBlock","_createElementVNode","_normalizeClass","_hoisted_2","_hoisted_3","_cache","$event","_vModelText","_openBlock","_hoisted_5","_createVNode","LongText","_hoisted_6","_createBlock","_unref","PlIcon24","PlIcon16","_renderSlot","_ctx","_hoisted_7","PlSvg","SvgRequired","$slots","PlTooltip","OptionList","DoubleContour","_hoisted_8","_toDisplayString","_hoisted_9","_hoisted_10"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIAA,KAAe;AAAA,EACb,MAAM;AACR;;;;;;;;;;;;;;;;;;;;;AAuBA,UAAMC,IAAOC,GAOPC,IAAQC,GAiFRC,IAAUC,EAAA,GACVC,IAAQD,EAAA,GAERE,IAAgBC,GAAgD,eAAe,GAE/EC,IAAOC,GAAS;AAAA,MACpB,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,MAAM;AAAA,MACN,eAAe;AAAA,IAAA,CAChB,GAEKC,IAAkB,MACtBC;AAAA,MACEC,EAAW,MAAM,UAAU,CAACC,MAAMC,EAAUD,EAAE,OAAOZ,EAAM,UAAU,CAAC;AAAA,MACtE,CAACc,MAAOA,IAAI,IAAI,IAAIA;AAAA,IAAA,GAGlBC,IAAe,MAAOR,EAAK,cAAcE,EAAA,GAEzCO,IAAmBC,EAAS,MACzBjB,EAAM,YAAY,MAC1B,GAEKkB,IAAaD,EAAS,MACtBD,EAAiB,QACZ,KAGFhB,EAAM,QACd,GAEKmB,IAAgBF,EAAS,OACrB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