@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.
- package/.turbo/turbo-build.log +143 -143
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/base/BtnBase.vue.js +18 -18
- package/dist/base/BtnBase.vue.js.map +1 -1
- package/dist/components/ContextProvider.vue.js.map +1 -1
- package/dist/components/DataTable/BaseCellComponent.vue.js +20 -20
- package/dist/components/DataTable/BaseCellComponent.vue.js.map +1 -1
- package/dist/components/DataTable/ColumnCaret.vue.js +6 -6
- package/dist/components/DataTable/ColumnCaret.vue.js.map +1 -1
- package/dist/components/DataTable/ColumnsCommandMenu.vue.js.map +1 -1
- package/dist/components/DataTable/RowsCommandMenu.vue.js.map +1 -1
- package/dist/components/DataTable/TScroll.vue.js +12 -12
- package/dist/components/DataTable/TScroll.vue.js.map +1 -1
- package/dist/components/DataTable/TableComponent.vue.js +5 -3
- package/dist/components/DataTable/TableComponent.vue.js.map +1 -1
- package/dist/components/DataTable/TdCell.vue.js +36 -36
- package/dist/components/DataTable/TdCell.vue.js.map +1 -1
- package/dist/components/DataTable/ThCell.vue.js +27 -27
- package/dist/components/DataTable/ThCell.vue.js.map +1 -1
- package/dist/components/DataTable/TrBody.vue.js +12 -12
- package/dist/components/DataTable/TrBody.vue.js.map +1 -1
- package/dist/components/DataTable/TrHead.vue.js.map +1 -1
- package/dist/components/DataTable/assets/TableIcon.vue.js +2 -2
- package/dist/components/DataTable/assets/TableIcon.vue.js.map +1 -1
- package/dist/components/DropdownListItem.vue.js +18 -18
- package/dist/components/DropdownListItem.vue.js.map +1 -1
- package/dist/components/HScroll.vue.js.map +1 -1
- package/dist/components/InputRange.vue.js.map +1 -1
- package/dist/components/LongText.vue.js +1 -1
- package/dist/components/LongText.vue.js.map +1 -1
- package/dist/components/LongText.vue3.js +1 -1
- package/dist/components/PlAccordion/ExpandTransition.vue.js.map +1 -1
- package/dist/components/PlAccordion/ExpandTransition.vue2.js.map +1 -1
- package/dist/components/PlAccordion/ExpandTransition.vue3.js +1 -1
- package/dist/components/PlAccordion/PlAccordion.vue.js.map +1 -1
- package/dist/components/PlAccordion/PlAccordionSection.vue2.js +21 -21
- package/dist/components/PlAccordion/PlAccordionSection.vue2.js.map +1 -1
- package/dist/components/PlAlert/PlAlert.vue.js +23 -23
- package/dist/components/PlAlert/PlAlert.vue.js.map +1 -1
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.d.ts +4 -0
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +112 -106
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js.map +1 -1
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.d.ts +4 -0
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js +100 -94
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js.map +1 -1
- package/dist/components/PlBtnAccent/PlBtnAccent.vue.js.map +1 -1
- package/dist/components/PlBtnDanger/PlBtnDanger.vue.js.map +1 -1
- package/dist/components/PlBtnGhost/PlBtnGhost.vue.js +21 -21
- package/dist/components/PlBtnGhost/PlBtnGhost.vue.js.map +1 -1
- package/dist/components/PlBtnGroup/PlBtnGroup.vue.js +34 -34
- package/dist/components/PlBtnGroup/PlBtnGroup.vue.js.map +1 -1
- package/dist/components/PlBtnLink/PlBtnLink.vue.js +12 -12
- package/dist/components/PlBtnLink/PlBtnLink.vue.js.map +1 -1
- package/dist/components/PlBtnPrimary/PlBtnPrimary.vue.js.map +1 -1
- package/dist/components/PlBtnSecondary/PlBtnSecondary.vue.js.map +1 -1
- package/dist/components/PlBtnSplit/PlBtnSplit.vue.js +31 -31
- package/dist/components/PlBtnSplit/PlBtnSplit.vue.js.map +1 -1
- package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js +18 -18
- package/dist/components/PlChartHistogram/PlChartHistogram.vue2.js.map +1 -1
- package/dist/components/PlChartStackedBar/Legends.vue2.js.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js +15 -15
- package/dist/components/PlChartStackedBar/PlChartStackedBar.vue2.js.map +1 -1
- package/dist/components/PlChartStackedBar/PlChartStackedBarCompact.vue2.js.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRow.vue2.js.map +1 -1
- package/dist/components/PlChartStackedBar/StackedRowCompact.vue2.js.map +1 -1
- package/dist/components/PlCheckbox/PlCheckbox.vue.js +13 -13
- package/dist/components/PlCheckbox/PlCheckbox.vue.js.map +1 -1
- package/dist/components/PlCheckbox/PlCheckboxBase.vue.js +6 -6
- package/dist/components/PlCheckbox/PlCheckboxBase.vue.js.map +1 -1
- package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue.js +28 -28
- package/dist/components/PlCheckboxGroup/PlCheckboxGroup.vue.js.map +1 -1
- package/dist/components/PlChip/PlChip.vue.js +20 -20
- package/dist/components/PlChip/PlChip.vue.js.map +1 -1
- package/dist/components/PlClipboard/PlClipboard.vue2.js.map +1 -1
- package/dist/components/PlConfirmDialog.vue.js +14 -14
- package/dist/components/PlConfirmDialog.vue.js.map +1 -1
- package/dist/components/PlDialogModal/PlDialogModal.vue.js +30 -30
- package/dist/components/PlDialogModal/PlDialogModal.vue.js.map +1 -1
- package/dist/components/PlDropdown/OptionList.vue.js +40 -40
- package/dist/components/PlDropdown/OptionList.vue.js.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.d.ts +8 -0
- package/dist/components/PlDropdown/PlDropdown.vue.js +102 -95
- package/dist/components/PlDropdown/PlDropdown.vue.js.map +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +95 -93
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js.map +1 -1
- package/dist/components/PlDropdownLine/PlDropdownLine.vue.d.ts +1 -1
- package/dist/components/PlDropdownLine/PlDropdownLine.vue.js +4 -4
- package/dist/components/PlDropdownLine/PlDropdownLine.vue.js.map +1 -1
- package/dist/components/PlDropdownLine/ResizableInput.vue.js +12 -12
- package/dist/components/PlDropdownLine/ResizableInput.vue.js.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.d.ts +4 -0
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +88 -82
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js.map +1 -1
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.d.ts +1 -1
- package/dist/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.js.map +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.js +11 -11
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.js.map +1 -1
- package/dist/components/PlEditableTitle/PlEditableTitle.vue.d.ts +1 -1
- package/dist/components/PlEditableTitle/PlEditableTitle.vue.js +36 -36
- package/dist/components/PlEditableTitle/PlEditableTitle.vue.js.map +1 -1
- package/dist/components/PlElementList/PlElementList.vue.d.ts +20 -0
- package/dist/components/PlElementList/PlElementList.vue2.js +180 -135
- package/dist/components/PlElementList/PlElementList.vue2.js.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue.d.ts +20 -0
- package/dist/components/PlElementList/PlElementListItem.vue2.js +101 -76
- package/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
- package/dist/components/PlErrorAlert/PlErrorAlert.vue2.js.map +1 -1
- package/dist/components/PlErrorBoundary/PlErrorBoundary.vue.js.map +1 -1
- package/dist/components/PlFileDialog/Local.vue.js +24 -24
- package/dist/components/PlFileDialog/Local.vue.js.map +1 -1
- package/dist/components/PlFileDialog/PlFileDialog.vue.js +38 -38
- package/dist/components/PlFileDialog/PlFileDialog.vue.js.map +1 -1
- package/dist/components/PlFileDialog/Remote.vue.js +2 -2
- package/dist/components/PlFileDialog/Remote.vue.js.map +1 -1
- package/dist/components/PlFileDialog/Shortcuts.vue2.js +4 -4
- package/dist/components/PlFileDialog/Shortcuts.vue2.js.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.d.ts +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.js +78 -76
- package/dist/components/PlFileInput/PlFileInput.vue.js.map +1 -1
- package/dist/components/PlIcon16/PlIcon16.vue2.js.map +1 -1
- package/dist/components/PlIcon24/PlIcon24.vue2.js.map +1 -1
- package/dist/components/PlLoaderCircular/PlLoaderCircular.vue.js +11 -11
- package/dist/components/PlLoaderCircular/PlLoaderCircular.vue.js.map +1 -1
- package/dist/components/PlLogView/PlLogView.vue.js +62 -60
- package/dist/components/PlLogView/PlLogView.vue.js.map +1 -1
- package/dist/components/PlNotificationAlert/PlNotificationAlert.vue.js +22 -22
- package/dist/components/PlNotificationAlert/PlNotificationAlert.vue.js.map +1 -1
- package/dist/components/PlNumberField/PlNumberField.vue.d.ts +6 -1
- package/dist/components/PlNumberField/PlNumberField.vue.js +66 -60
- package/dist/components/PlNumberField/PlNumberField.vue.js.map +1 -1
- package/dist/components/PlProgressBar/PlProgressBar.vue.js +12 -12
- package/dist/components/PlProgressBar/PlProgressBar.vue.js.map +1 -1
- package/dist/components/PlProgressCell/PlProgressCell.vue.js +20 -20
- package/dist/components/PlProgressCell/PlProgressCell.vue.js.map +1 -1
- package/dist/components/PlRadio/PlRadio.vue2.js.map +1 -1
- package/dist/components/PlRadio/PlRadioGroup.vue2.js +8 -8
- package/dist/components/PlRadio/PlRadioGroup.vue2.js.map +1 -1
- package/dist/components/PlSearchField/PlSearchField.vue2.js +19 -19
- package/dist/components/PlSearchField/PlSearchField.vue2.js.map +1 -1
- package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js +8 -8
- package/dist/components/PlSectionSeparator/PlSectionSeparator.vue2.js.map +1 -1
- package/dist/components/PlSidebar/PlSidebarGroup.vue2.js.map +1 -1
- package/dist/components/PlSidebar/PlSidebarItem.vue2.js.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js +5 -3
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -1
- package/dist/components/PlSlideModal/PlSlideModal.vue2.js.map +1 -1
- package/dist/components/PlSplash/PlSplash.vue.js +16 -16
- package/dist/components/PlSplash/PlSplash.vue.js.map +1 -1
- package/dist/components/PlStatusTag/PlStatusTag.vue.js +7 -7
- package/dist/components/PlStatusTag/PlStatusTag.vue.js.map +1 -1
- package/dist/components/PlSvg/PlSvg.vue2.js.map +1 -1
- package/dist/components/PlTabs/PlTabs.vue.js +18 -18
- package/dist/components/PlTabs/PlTabs.vue.js.map +1 -1
- package/dist/components/PlTabs/Tab.vue.js +9 -9
- package/dist/components/PlTabs/Tab.vue.js.map +1 -1
- package/dist/components/PlTextArea/PlTextArea.vue.js +55 -53
- package/dist/components/PlTextArea/PlTextArea.vue.js.map +1 -1
- package/dist/components/PlTextField/PlTextField.vue.d.ts +4 -0
- package/dist/components/PlTextField/PlTextField.vue.js +66 -60
- package/dist/components/PlTextField/PlTextField.vue.js.map +1 -1
- package/dist/components/PlToggleSwitch/PlToggleSwitch.vue.js +14 -14
- package/dist/components/PlToggleSwitch/PlToggleSwitch.vue.js.map +1 -1
- package/dist/components/PlTooltip/Beak.vue.js +2 -2
- package/dist/components/PlTooltip/Beak.vue.js.map +1 -1
- package/dist/components/PlTooltip/PlTooltip.vue.js +50 -50
- package/dist/components/PlTooltip/PlTooltip.vue.js.map +1 -1
- package/dist/components/Scrollable.vue.js.map +1 -1
- package/dist/components/Slider.vue.js +35 -35
- package/dist/components/Slider.vue.js.map +1 -1
- package/dist/components/SliderRange.vue.js +47 -47
- package/dist/components/SliderRange.vue.js.map +1 -1
- package/dist/components/SliderRangeTriple.vue.js +47 -47
- package/dist/components/SliderRangeTriple.vue.js.map +1 -1
- package/dist/components/TabItem.vue.js.map +1 -1
- package/dist/components/ThemeSwitcher.vue.js +2 -2
- package/dist/components/ThemeSwitcher.vue.js.map +1 -1
- package/dist/components/TransitionSlidePanel.vue.js.map +1 -1
- package/dist/components/VScroll.vue.js.map +1 -1
- package/dist/components/contextMenu/Menu.vue2.js +12 -12
- package/dist/components/contextMenu/Menu.vue2.js.map +1 -1
- package/dist/composition/filters/metadata.d.ts +205 -0
- package/dist/composition/filters/metadata.js +129 -19
- package/dist/composition/filters/metadata.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/layout/PlBlockPage/PlBlockPage.vue.js +27 -27
- package/dist/layout/PlBlockPage/PlBlockPage.vue.js.map +1 -1
- package/dist/layout/PlContainer/PlContainer.vue.js +10 -10
- package/dist/layout/PlContainer/PlContainer.vue.js.map +1 -1
- package/dist/layout/PlGrid/PlGrid.vue.js.map +1 -1
- package/dist/layout/PlRow/PlRow.vue.js +8 -8
- package/dist/layout/PlRow/PlRow.vue.js.map +1 -1
- package/dist/layout/PlSpacer/PlSpacer.vue.js.map +1 -1
- package/dist/utils/DoubleContour.vue.d.ts +7 -1
- package/dist/utils/DoubleContour.vue.js +20 -13
- package/dist/utils/DoubleContour.vue.js.map +1 -1
- package/dist/utils/DoubleContour.vue3.js +7 -0
- package/dist/utils/DoubleContour.vue3.js.map +1 -0
- package/dist/utils/DropdownOverlay/DropdownOverlay.vue.js.map +1 -1
- package/dist/utils/PlCloseModalBtn.vue.js +2 -2
- package/dist/utils/PlCloseModalBtn.vue.js.map +1 -1
- package/dist/utils/TextLabel.vue.js.map +1 -1
- package/package.json +5 -5
- package/src/components/PlAutocomplete/PlAutocomplete.vue +6 -1
- package/src/components/PlAutocompleteMulti/PlAutocompleteMulti.vue +6 -1
- package/src/components/PlDropdown/PlDropdown.vue +12 -2
- package/src/components/PlDropdownMulti/PlDropdownMulti.vue +6 -1
- package/src/components/PlElementList/PlElementList.vue +40 -6
- package/src/components/PlElementList/PlElementListItem.vue +64 -47
- package/src/components/PlNumberField/PlNumberField.vue +4 -1
- package/src/components/PlTextField/PlTextField.vue +5 -1
- package/src/composition/filters/metadata.ts +105 -0
- package/src/utils/DoubleContour.vue +68 -2
- package/dist/utils/DoubleContour.vue2.js +0 -7
- 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(`.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
17
|
-
import
|
|
18
|
+
import Ie from "../PlTooltip/PlTooltip.vue.js";
|
|
19
|
+
import xe from "./OptionList.vue.js";
|
|
18
20
|
|
|
19
|
-
import { useGroupBy as
|
|
20
|
-
const Ve = ["tabindex"],
|
|
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
|
-
},
|
|
25
|
+
}, Re = { class: "pl-dropdown__controls" }, Oe = { key: 0 }, Se = {
|
|
24
26
|
key: 0,
|
|
25
27
|
class: "pl-dropdown__error"
|
|
26
|
-
},
|
|
28
|
+
}, Ae = {
|
|
27
29
|
key: 1,
|
|
28
30
|
class: "pl-dropdown__helper"
|
|
29
|
-
},
|
|
31
|
+
}, Be = {
|
|
30
32
|
key: 2,
|
|
31
33
|
class: "pl-dropdown__helper"
|
|
32
|
-
},
|
|
34
|
+
}, Pe = {
|
|
33
35
|
name: "PlDropdown"
|
|
34
|
-
},
|
|
35
|
-
...
|
|
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(
|
|
53
|
-
const
|
|
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) =>
|
|
63
|
+
R.value.findIndex((e) => x(e.value, r.modelValue)),
|
|
60
64
|
(e) => e < 0 ? 0 : e
|
|
61
|
-
), q = () => o.activeIndex = N(),
|
|
62
|
-
if (!
|
|
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 &&
|
|
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 ===
|
|
76
|
+
isSelected: t === b.value,
|
|
73
77
|
isActive: t === o.activeIndex
|
|
74
78
|
}))
|
|
75
79
|
), E = s(() => {
|
|
76
|
-
const t =
|
|
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
|
|
82
|
-
return t.label.toLowerCase().includes(
|
|
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 } =
|
|
88
|
+
}), { orderedRef: R, groupsRef: G, restRef: W } = _e(K, "group"), j = s(() => k.value ? void 0 : "0"), O = (e) => {
|
|
85
89
|
var t;
|
|
86
|
-
|
|
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 = () =>
|
|
93
|
+
}, Q = () => V("update:modelValue", void 0), X = () => {
|
|
90
94
|
var e;
|
|
91
|
-
return (e =
|
|
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
|
|
99
|
+
var a, p, m;
|
|
96
100
|
const t = e.relatedTarget;
|
|
97
|
-
!((
|
|
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
|
|
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:
|
|
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, (
|
|
110
|
-
const
|
|
111
|
-
if (!
|
|
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 =
|
|
114
|
-
const te =
|
|
115
|
-
o.activeIndex =
|
|
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
|
|
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 =
|
|
125
|
+
return e ? (t = g.value) == null ? void 0 : t.focus() : "";
|
|
122
126
|
}
|
|
123
|
-
),
|
|
127
|
+
), se(() => {
|
|
124
128
|
var e;
|
|
125
|
-
o.search, o.activeIndex >= 0 && o.open && ((e =
|
|
126
|
-
}), (e, t) => (
|
|
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
|
-
|
|
134
|
+
f("div", {
|
|
131
135
|
ref_key: "rootRef",
|
|
132
|
-
ref:
|
|
136
|
+
ref: d,
|
|
133
137
|
tabindex: j.value,
|
|
134
|
-
class: de(["pl-dropdown", { open: o.open, error:
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
f("div", be, [
|
|
143
|
+
f("div", Le, [
|
|
144
|
+
ce(f("input", {
|
|
141
145
|
ref_key: "input",
|
|
142
|
-
ref:
|
|
143
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
146
|
+
ref: g,
|
|
147
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => o.search = a),
|
|
144
148
|
type: "text",
|
|
145
149
|
tabindex: "-1",
|
|
146
|
-
disabled:
|
|
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,
|
|
152
|
-
[
|
|
155
|
+
}, null, 40, Ce), [
|
|
156
|
+
[ue, o.search]
|
|
153
157
|
]),
|
|
154
|
-
o.open ?
|
|
155
|
-
|
|
156
|
-
default:
|
|
157
|
-
pe(
|
|
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
|
-
|
|
163
|
-
|
|
166
|
+
f("div", Re, [
|
|
167
|
+
w.value ? (l(), u(i(T), {
|
|
164
168
|
key: 0,
|
|
165
169
|
name: "loading"
|
|
166
|
-
})) :
|
|
167
|
-
|
|
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:
|
|
172
|
-
})) :
|
|
173
|
-
|
|
174
|
-
|
|
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:
|
|
180
|
+
onClick: M(Y, ["stop"])
|
|
177
181
|
}, [
|
|
178
|
-
|
|
182
|
+
n.arrowIconLarge ? (l(), u(i(T), {
|
|
179
183
|
key: 0,
|
|
180
|
-
name:
|
|
184
|
+
name: n.arrowIconLarge,
|
|
181
185
|
class: "arrow-icon"
|
|
182
|
-
}, null, 8, ["name"])) :
|
|
186
|
+
}, null, 8, ["name"])) : n.arrowIcon ? (l(), u(i(_), {
|
|
183
187
|
key: 1,
|
|
184
|
-
name:
|
|
188
|
+
name: n.arrowIcon,
|
|
185
189
|
class: "arrow-icon"
|
|
186
|
-
}, null, 8, ["name"])) : (
|
|
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
|
-
|
|
195
|
-
|
|
198
|
+
n.label ? (l(), v("label", Oe, [
|
|
199
|
+
n.required ? (l(), u(i(ke), {
|
|
196
200
|
key: 0,
|
|
197
|
-
uri:
|
|
198
|
-
}, null, 8, ["uri"])) :
|
|
199
|
-
|
|
200
|
-
e.$slots.tooltip ? (
|
|
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:
|
|
206
|
-
|
|
209
|
+
tooltip: $(() => [
|
|
210
|
+
z(e.$slots, "tooltip")
|
|
207
211
|
]),
|
|
208
212
|
_: 3
|
|
209
|
-
})) :
|
|
210
|
-
])) :
|
|
211
|
-
o.open ? (
|
|
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":
|
|
216
|
-
groups:
|
|
217
|
-
rest:
|
|
218
|
-
"option-size":
|
|
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"])) :
|
|
221
|
-
|
|
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 ? (
|
|
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
|
-
|
|
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,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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AK,OAAO;AAEd;AAAA,MACF;AAEA,MAAI,EAAE,SAAS,aACbA,EAAK,OAAO,KACZgC,IAAArC,EAAQ,UAAR,QAAAqC,EAAe;AAGjB,YAAMc,IAAU1C,EAAW,OAErB,EAAE,QAAA2C,MAAWD;AAEnB,UAAI,CAACC;AACH;AAGF,MAAI,EAAE,SAAS,WACbhB,GAAaW,IAAAI,EAAQ,KAAK,CAACE,MAAOA,EAAG,UAAUH,CAAW,MAA7C,gBAAAH,EAAgD,KAAK;AAGpE,YAAMO,KAAaH,EAAQ,UAAU,CAACE,MAAOA,EAAG,UAAUH,CAAW,KAAK,IAEpEK,KAAQ,EAAE,SAAS,cAAc,IAAI,EAAE,SAAS,YAAY,KAAK,GAEjEC,KAAW,KAAK,IAAIF,KAAaC,KAAQH,CAAM,IAAIA;AAEzD,MAAA/C,EAAK,cAAc8C,EAAQK,EAAQ,EAAE,SAAS;AAAA,IAChD;AAEA,WAAAC,GAAczD,CAAO,GAErB0D,EAAM,MAAM5D,EAAM,YAAYe,GAAc,EAAE,WAAW,IAAM,GAE/D6C;AAAA,MACE,MAAMrD,EAAK;AAAA,MACX,CAAC4C,MAAA;;AAAU,eAAAA,KAAOZ,IAAAnC,EAAM,UAAN,gBAAAmC,EAAa,UAAU;AAAA;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,OACrBjB,EAAM,WAAW,CAAA,GAAI,UAAU,CAACY,MAAMC,EAAUD,EAAE,OAAOZ,EAAM,UAAU,CAAC,CACnF,GAEKoB,IAAgBH,EAAS,MAAM;AACnC,UAAI,CAAAD,EAAiB,OAIrB;AAAA,YAAIhB,EAAM;AACR,iBAAOqB,GAAgBrB,EAAM,KAAK;AAGpC,YAAIA,EAAM,eAAe,UAAamB,EAAc,UAAU;AAC5D,iBAAO;AAAA;AAAA,IAIX,CAAC,GAEKG,IAAaL;AAAA,MAAuB,MACxCM,GAAqBvB,EAAM,WAAW,CAAA,CAAE,EAAE,IAAI,CAACwB,GAAKC,OAAW;AAAA,QAC7D,GAAGD;AAAA,QACH,OAAAC;A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