@milaboratories/uikit 2.6.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +48 -48
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/components/DataTable/TableComponent.vue.js +4 -2
- package/dist/components/DataTable/TableComponent.vue.js.map +1 -1
- package/dist/components/PlAccordion/ExpandTransition.vue3.js +1 -1
- package/dist/components/PlAccordion/PlAccordionSection.vue2.js +1 -1
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.d.ts +4 -0
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +74 -68
- 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 +52 -46
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.d.ts +8 -0
- package/dist/components/PlDropdown/PlDropdown.vue.js +67 -60
- package/dist/components/PlDropdown/PlDropdown.vue.js.map +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +21 -19
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.d.ts +4 -0
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +47 -41
- package/dist/components/PlDropdownMulti/PlDropdownMulti.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 +99 -74
- package/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.js +24 -22
- package/dist/components/PlFileInput/PlFileInput.vue.js.map +1 -1
- package/dist/components/PlLogView/PlLogView.vue.js +24 -22
- package/dist/components/PlLogView/PlLogView.vue.js.map +1 -1
- package/dist/components/PlNumberField/PlNumberField.vue.d.ts +5 -0
- package/dist/components/PlNumberField/PlNumberField.vue.js +60 -54
- package/dist/components/PlNumberField/PlNumberField.vue.js.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js +4 -2
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -1
- package/dist/components/PlTextArea/PlTextArea.vue.js +15 -13
- 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 +45 -39
- package/dist/components/PlTextField/PlTextField.vue.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/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.vue2.js +19 -3
- package/dist/utils/DoubleContour.vue2.js.map +1 -1
- package/dist/utils/DoubleContour.vue3.js +7 -0
- package/dist/utils/DoubleContour.vue3.js.map +1 -0
- package/package.json +4 -4
- 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/components/PlAccordion/ExpandTransition.vue.js +0 -27
- package/dist/components/PlAccordion/ExpandTransition.vue.js.map +0 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(`.pl-autocomplete__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-autocomplete__options::-webkit-scrollbar{width:var(--scrollbar-width, 6px);height:5px;background-color:transparent;display:block}.pl-autocomplete__options::-webkit-scrollbar-thumb{background:var(--thumb-color);border-radius:5px}.pl-autocomplete__options::-webkit-scrollbar-thumb:hover{--thumb-color: var(--border-color-focus)}.pl-autocomplete__options .nothing-found{padding:0 10px;height:var(--control-height);line-height:var(--control-height);background-color:#fff;opacity:.5;font-style:italic}.pl-autocomplete__options .option{position:relative;padding:0 30px 0 10px;height:var(--control-height);line-height:var(--control-height);cursor:pointer;-webkit-user-select:none;user-select:none}.pl-autocomplete__options .option .checkmark{position:absolute;display:none;right:10px;top:50%;transform:translateY(-50%)}.pl-autocomplete__options .option>span{display:block;overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis}.pl-autocomplete__options .option.selected{background-color:var(--color-active-select)}.pl-autocomplete__options .option.selected .checkmark{display:block}.pl-autocomplete__options .option.active:not(.selected){background-color:var(--option-hover-bg)}.pl-autocomplete__options .option:hover{background-color:var(--option-hover-bg)}.pl-autocomplete{--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-autocomplete__envelope{font-family:var(--control-font-family);min-width:160px}.pl-autocomplete 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-autocomplete label>span{overflow:hidden;white-space:pre;text-overflow:ellipsis}.pl-autocomplete__container{position:absolute;top:0;left:0;right:0;border-radius:6px;min-height:var(--control-height);color:var(--txt-01)}.pl-autocomplete__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-autocomplete__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-autocomplete__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-autocomplete__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-autocomplete__field input:focus{outline:none}.pl-autocomplete__field input:placeholder-shown{text-overflow:ellipsis}.pl-autocomplete__field input::placeholder{color:var(--color-placeholder)}.pl-autocomplete__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-autocomplete__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-autocomplete__controls{display:flex;flex-direction:row;align-items:center;min-height:var(--control-height);gap:6px;margin-left:auto}.pl-autocomplete__controls .mask-16,.pl-autocomplete__controls .mask-24{--icon-color: var(--control-mask-fill);cursor:pointer}.pl-autocomplete__controls .clear{--icon-color: var(--ic-02)}.pl-autocomplete__controls .mask-loading{--icon-color: var(#07AD3E);animation:spin 2.5s linear infinite}.pl-autocomplete__arrow-wrapper{display:flex;align-items:center;min-height:var(--control-height);padding-right:11px}.pl-autocomplete .arrow-icon{cursor:pointer}.pl-autocomplete .arrow-icon.arrow-icon-default{transition:transform .2s;background-color:var(--control-mask-fill);mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.46967%206.53033L3.53033%205.46967L8%209.93934L12.4697%205.46967L13.5303%206.53033L8%2012.0607L2.46967%206.53033Z'%20fill='%23110529'/%3e%3c/svg%3e");-webkit-mask-image:url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.46967%206.53033L3.53033%205.46967L8%209.93934L12.4697%205.46967L13.5303%206.53033L8%2012.0607L2.46967%206.53033Z'%20fill='%23110529'/%3e%3c/svg%3e");mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-position:center;-webkit-mask-position:center;mask-size:16px;-webkit-mask-size:16px;width:16px;height:16px}.pl-autocomplete.open,.pl-autocomplete:focus-within{z-index:1;--label-color: var(--txt-focus)}.pl-autocomplete.open .pl-autocomplete__container{z-index:1000}.pl-autocomplete.open .pl-autocomplete__field{border-radius:6px 6px 0 0}.pl-autocomplete.open .arrow-icon.arrow-icon-default{background-color:var(--control-mask-fill);transform:rotate(-180deg)}.pl-autocomplete:hover{--contour-color: var(--control-hover-color)}.pl-autocomplete: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-autocomplete:focus-within.error{--contour-border-width: 2px;--contour-box-shadow: 0 0 0 4px var(--color-error-shadow)}.pl-autocomplete.error{--contour-color: var(--txt-error);--label-color: var(--txt-error)}.pl-autocomplete.disabled{--contour-color: var(--color-dis-01);--control-mask-fill: var(--color-dis-01);--label-color: var(--color-dis-01);cursor:not-allowed;pointer-events:none;-webkit-user-select:none;user-select:none}.pl-autocomplete.disabled .input-value{color:var(--dis-01)}
|
|
2
|
-
.
|
|
3
|
-
|
|
2
|
+
.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}
|
|
3
|
+
.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%}}`)),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
4
|
+
import { defineComponent as ie, mergeModels as se, useModel as ue, useSlots as ce, ref as m, useTemplateRef as de, reactive as pe, computed as v, unref as c, watch as h, watchPostEffect as ve, createElementBlock as i, openBlock as a, withModifiers as O, createElementVNode as _, createCommentVNode as d, normalizeClass as F, createBlock as k, createVNode as z, withDirectives as fe, vModelText as me, withCtx as M, createTextVNode as he, toDisplayString as w, renderSlot as N, Fragment as _e, renderList as ge } from "vue";
|
|
4
5
|
|
|
5
6
|
import { tap as ye } from "../../helpers/functions.js";
|
|
6
7
|
import ke from "../PlTooltip/PlTooltip.vue.js";
|
|
7
8
|
import we from "../../utils/DoubleContour.vue.js";
|
|
9
|
+
|
|
8
10
|
import { useLabelNotch as Ie } from "../../utils/useLabelNotch.js";
|
|
9
11
|
import { deepEqual as I } from "../../helpers/objects.js";
|
|
10
12
|
import be from "../DropdownListItem.vue.js";
|
|
@@ -12,23 +14,23 @@ import Se from "../LongText.vue.js";
|
|
|
12
14
|
|
|
13
15
|
import { normalizeListOptions as T } from "../../helpers/utils.js";
|
|
14
16
|
import Oe from "../PlIcon16/PlIcon16.vue.js";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { refDebounced as
|
|
17
|
+
import Ee from "../PlIcon24/PlIcon24.vue.js";
|
|
18
|
+
import Ve from "../../utils/DropdownOverlay/DropdownOverlay.vue.js";
|
|
19
|
+
import { refDebounced as xe } from "@vueuse/core";
|
|
18
20
|
import { useWatchFetch as H } from "../../composition/useWatchFetch.js";
|
|
19
21
|
import { getErrorMessage as Ae } from "../../helpers/error.js";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
const
|
|
22
|
+
import $e from "../PlSvg/PlSvg.vue.js";
|
|
23
|
+
import Ce from "../../assets/images/required.svg.js";
|
|
24
|
+
const De = ["tabindex"], Fe = { class: "pl-autocomplete__container" }, Me = { class: "pl-autocomplete__field" }, Re = ["disabled", "placeholder"], Be = {
|
|
23
25
|
key: 0,
|
|
24
26
|
class: "input-value"
|
|
25
|
-
}, Le = { class: "pl-autocomplete__controls" },
|
|
27
|
+
}, Le = { class: "pl-autocomplete__controls" }, Pe = {
|
|
26
28
|
key: 2,
|
|
27
29
|
class: "arrow-icon arrow-icon-default"
|
|
28
|
-
},
|
|
30
|
+
}, qe = { key: 0 }, ze = {
|
|
29
31
|
key: 0,
|
|
30
32
|
class: "nothing-found"
|
|
31
|
-
},
|
|
33
|
+
}, Ne = {
|
|
32
34
|
key: 0,
|
|
33
35
|
class: "pl-autocomplete__error"
|
|
34
36
|
}, Te = {
|
|
@@ -39,9 +41,9 @@ const Fe = ["tabindex"], Me = { class: "pl-autocomplete__container" }, Re = { cl
|
|
|
39
41
|
class: "pl-autocomplete__helper"
|
|
40
42
|
}, Ue = {
|
|
41
43
|
name: "PlAutocomplete"
|
|
42
|
-
},
|
|
44
|
+
}, po = /* @__PURE__ */ ie({
|
|
43
45
|
...Ue,
|
|
44
|
-
props: /* @__PURE__ */
|
|
46
|
+
props: /* @__PURE__ */ se({
|
|
45
47
|
optionsSearch: {},
|
|
46
48
|
modelSearch: { type: Function, default: void 0 },
|
|
47
49
|
label: { default: "" },
|
|
@@ -55,29 +57,30 @@ const Fe = ["tabindex"], Me = { class: "pl-autocomplete__container" }, Re = { cl
|
|
|
55
57
|
arrowIcon: { default: void 0 },
|
|
56
58
|
arrowIconLarge: { default: void 0 },
|
|
57
59
|
optionSize: { default: "small" },
|
|
58
|
-
formatValue: { type: Function, default: (b) => String(b) }
|
|
60
|
+
formatValue: { type: Function, default: (b) => String(b) },
|
|
61
|
+
groupPosition: { default: void 0 }
|
|
59
62
|
}, {
|
|
60
63
|
modelValue: { required: !0 },
|
|
61
64
|
modelModifiers: {}
|
|
62
65
|
}),
|
|
63
66
|
emits: ["update:modelValue"],
|
|
64
67
|
setup(b) {
|
|
65
|
-
const n = ue(b, "modelValue"), u = b, U = ce(), p = m(),
|
|
68
|
+
const n = ue(b, "modelValue"), u = b, U = ce(), p = m(), E = m(), R = de("overlay"), s = m(null), t = pe({
|
|
66
69
|
activeIndex: -1,
|
|
67
70
|
open: !1
|
|
68
71
|
}), K = () => ye(
|
|
69
72
|
y.value.findIndex((e) => I(e.value, n.value)),
|
|
70
73
|
(e) => e < 0 ? 0 : e
|
|
71
|
-
), W = () => t.activeIndex = K(),
|
|
74
|
+
), W = () => t.activeIndex = K(), V = m([]), g = m(), y = v(() => T(V.value).map((e, o) => ({
|
|
72
75
|
...e,
|
|
73
76
|
index: o,
|
|
74
77
|
isSelected: o === j.value,
|
|
75
78
|
isActive: o === t.activeIndex
|
|
76
|
-
}))), S = m(!0),
|
|
79
|
+
}))), S = m(!0), x = m(!1), A = v(() => u.disabled), j = v(() => V.value.findIndex((e) => I(e.value, n.value))), $ = v(() => {
|
|
77
80
|
if (!S.value) {
|
|
78
81
|
if (u.error)
|
|
79
82
|
return Ae(u.error);
|
|
80
|
-
if (
|
|
83
|
+
if (x.value)
|
|
81
84
|
return "Data loading error";
|
|
82
85
|
}
|
|
83
86
|
}), B = v(() => {
|
|
@@ -85,69 +88,69 @@ const Fe = ["tabindex"], Me = { class: "pl-autocomplete__container" }, Re = { cl
|
|
|
85
88
|
return (l == null ? void 0 : l.label) || (n.value ? u.formatValue(n.value) : "");
|
|
86
89
|
}), G = v(() => !t.open && n.value ? "" : n.value ? String(B.value) : u.placeholder), J = v(() => n.value !== void 0 && n.value !== null), Q = v(() => A.value ? void 0 : "0"), L = (e) => {
|
|
87
90
|
var o;
|
|
88
|
-
n.value = e == null ? void 0 : e.value, g.value = e,
|
|
91
|
+
n.value = e == null ? void 0 : e.value, g.value = e, s.value = null, t.open = !1, (o = p == null ? void 0 : p.value) == null || o.focus();
|
|
89
92
|
}, X = () => {
|
|
90
93
|
n.value = void 0, g.value = void 0;
|
|
91
94
|
}, Y = () => {
|
|
92
95
|
var e;
|
|
93
|
-
return (e =
|
|
96
|
+
return (e = E.value) == null ? void 0 : e.focus();
|
|
94
97
|
}, Z = () => {
|
|
95
98
|
t.open = !t.open;
|
|
96
99
|
};
|
|
97
100
|
h(() => t.open, (e) => {
|
|
98
|
-
|
|
101
|
+
s.value = e ? "" : null;
|
|
99
102
|
});
|
|
100
103
|
const ee = () => {
|
|
101
104
|
t.open = !0;
|
|
102
105
|
}, oe = (e) => {
|
|
103
106
|
var l, r, f;
|
|
104
107
|
const o = e.relatedTarget;
|
|
105
|
-
!((l = p.value) != null && l.contains(o)) && !((f = (r =
|
|
108
|
+
!((l = p.value) != null && l.contains(o)) && !((f = (r = R.value) == null ? void 0 : r.listRef) != null && f.contains(o)) && (s.value = null, t.open = !1);
|
|
106
109
|
}, te = (e) => {
|
|
107
|
-
var
|
|
110
|
+
var q;
|
|
108
111
|
if (["ArrowDown", "ArrowUp", "Enter", "Escape"].includes(e.code))
|
|
109
112
|
e.preventDefault();
|
|
110
113
|
else
|
|
111
114
|
return;
|
|
112
115
|
const { open: o, activeIndex: l } = t;
|
|
113
116
|
if (!o) {
|
|
114
|
-
e.code === "Enter" && (t.open = !0,
|
|
117
|
+
e.code === "Enter" && (t.open = !0, s.value = "");
|
|
115
118
|
return;
|
|
116
119
|
}
|
|
117
|
-
e.code === "Escape" && (t.open = !1,
|
|
120
|
+
e.code === "Escape" && (t.open = !1, s.value = null, (q = p.value) == null || q.focus());
|
|
118
121
|
const r = c(y), { length: f } = r;
|
|
119
122
|
if (!f)
|
|
120
123
|
return;
|
|
121
|
-
e.code === "Enter" && L(r.find((
|
|
122
|
-
const ae = r.findIndex((
|
|
124
|
+
e.code === "Enter" && L(r.find((D) => D.index === l));
|
|
125
|
+
const ae = r.findIndex((D) => D.index === l) ?? -1, ne = e.code === "ArrowDown" ? 1 : e.code === "ArrowUp" ? -1 : 0, re = Math.abs(ae + ne + f) % f;
|
|
123
126
|
t.activeIndex = y.value[re].index ?? -1;
|
|
124
127
|
};
|
|
125
128
|
Ie(p), h(() => n.value, W, { immediate: !0 }), h(
|
|
126
129
|
() => t.open,
|
|
127
130
|
(e) => {
|
|
128
131
|
var o;
|
|
129
|
-
return e ? (o =
|
|
132
|
+
return e ? (o = E.value) == null ? void 0 : o.focus() : "";
|
|
130
133
|
}
|
|
131
134
|
), ve(() => {
|
|
132
135
|
var e;
|
|
133
|
-
|
|
136
|
+
s.value, t.activeIndex >= 0 && t.open && ((e = R.value) == null || e.scrollIntoActive());
|
|
134
137
|
});
|
|
135
|
-
const le =
|
|
138
|
+
const le = xe(s, 300, { maxWait: 1e3 }), C = H(() => le.value, async (e) => {
|
|
136
139
|
if (e !== null)
|
|
137
140
|
return u.optionsSearch(e);
|
|
138
|
-
}),
|
|
141
|
+
}), P = H(() => n.value, async (e) => {
|
|
139
142
|
var o, l;
|
|
140
143
|
return e && !I((o = g.value) == null ? void 0 : o.value, e) ? u.modelSearch ? u.modelSearch(e) : (l = await u.optionsSearch(String(e))) == null ? void 0 : l[0] : g.value;
|
|
141
144
|
});
|
|
142
|
-
return h(() =>
|
|
143
|
-
e && (
|
|
144
|
-
}), h(() =>
|
|
145
|
+
return h(() => C.value, (e) => {
|
|
146
|
+
e && (V.value = e, s.value !== null && (x.value = !1));
|
|
147
|
+
}), h(() => P.value, (e) => {
|
|
145
148
|
e && (g.value = T([e])[0]);
|
|
146
|
-
}), h(() =>
|
|
147
|
-
e && (
|
|
148
|
-
}), h(() =>
|
|
149
|
+
}), h(() => C.error, (e) => {
|
|
150
|
+
e && (x.value = !!e);
|
|
151
|
+
}), h(() => C.loading || P.loading, (e) => {
|
|
149
152
|
S.value = e;
|
|
150
|
-
}), (e, o) => (a(),
|
|
153
|
+
}), (e, o) => (a(), i("div", {
|
|
151
154
|
class: "pl-autocomplete__envelope",
|
|
152
155
|
onClick: O(Y, ["stop"])
|
|
153
156
|
}, [
|
|
@@ -155,16 +158,16 @@ const Fe = ["tabindex"], Me = { class: "pl-autocomplete__container" }, Re = { cl
|
|
|
155
158
|
ref_key: "rootRef",
|
|
156
159
|
ref: p,
|
|
157
160
|
tabindex: Q.value,
|
|
158
|
-
class:
|
|
161
|
+
class: F(["pl-autocomplete", { open: t.open, error: !!$.value, disabled: A.value }]),
|
|
159
162
|
onKeydown: te,
|
|
160
163
|
onFocusout: oe
|
|
161
164
|
}, [
|
|
162
|
-
_("div",
|
|
163
|
-
_("div",
|
|
165
|
+
_("div", Fe, [
|
|
166
|
+
_("div", Me, [
|
|
164
167
|
fe(_("input", {
|
|
165
168
|
ref_key: "input",
|
|
166
|
-
ref:
|
|
167
|
-
"onUpdate:modelValue": o[0] || (o[0] = (l) =>
|
|
169
|
+
ref: E,
|
|
170
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => s.value = l),
|
|
168
171
|
type: "text",
|
|
169
172
|
tabindex: "-1",
|
|
170
173
|
disabled: A.value,
|
|
@@ -172,19 +175,19 @@ const Fe = ["tabindex"], Me = { class: "pl-autocomplete__container" }, Re = { cl
|
|
|
172
175
|
spellcheck: "false",
|
|
173
176
|
autocomplete: "chrome-off",
|
|
174
177
|
onFocus: ee
|
|
175
|
-
}, null, 40,
|
|
176
|
-
[me,
|
|
178
|
+
}, null, 40, Re), [
|
|
179
|
+
[me, s.value]
|
|
177
180
|
]),
|
|
178
|
-
t.open ? d("", !0) : (a(),
|
|
179
|
-
|
|
180
|
-
default:
|
|
181
|
+
t.open ? d("", !0) : (a(), i("div", Be, [
|
|
182
|
+
z(Se, null, {
|
|
183
|
+
default: M(() => [
|
|
181
184
|
he(w(B.value), 1)
|
|
182
185
|
]),
|
|
183
186
|
_: 1
|
|
184
187
|
})
|
|
185
188
|
])),
|
|
186
189
|
_("div", Le, [
|
|
187
|
-
S.value ? (a(), k(c(
|
|
190
|
+
S.value ? (a(), k(c(Ee), {
|
|
188
191
|
key: 0,
|
|
189
192
|
name: "loading"
|
|
190
193
|
})) : d("", !0),
|
|
@@ -194,25 +197,25 @@ const Fe = ["tabindex"], Me = { class: "pl-autocomplete__container" }, Re = { cl
|
|
|
194
197
|
name: "delete-clear",
|
|
195
198
|
onClick: O(X, ["stop"])
|
|
196
199
|
})) : d("", !0),
|
|
197
|
-
|
|
200
|
+
N(e.$slots, "append"),
|
|
198
201
|
_("div", {
|
|
199
202
|
class: "pl-autocomplete__arrow-wrapper",
|
|
200
203
|
onClick: O(Z, ["stop"])
|
|
201
204
|
}, [
|
|
202
|
-
e.arrowIconLarge ? (a(),
|
|
205
|
+
e.arrowIconLarge ? (a(), i("div", {
|
|
203
206
|
key: 0,
|
|
204
|
-
class:
|
|
205
|
-
}, null, 2)) : e.arrowIcon ? (a(),
|
|
207
|
+
class: F(["arrow-icon", [`icon-24 ${e.arrowIconLarge}`]])
|
|
208
|
+
}, null, 2)) : e.arrowIcon ? (a(), i("div", {
|
|
206
209
|
key: 1,
|
|
207
|
-
class:
|
|
208
|
-
}, null, 2)) : (a(),
|
|
210
|
+
class: F(["arrow-icon", [`icon-16 ${e.arrowIcon}`]])
|
|
211
|
+
}, null, 2)) : (a(), i("div", Pe))
|
|
209
212
|
])
|
|
210
213
|
])
|
|
211
214
|
]),
|
|
212
|
-
e.label ? (a(),
|
|
213
|
-
e.required ? (a(), k(c(
|
|
215
|
+
e.label ? (a(), i("label", qe, [
|
|
216
|
+
e.required ? (a(), k(c($e), {
|
|
214
217
|
key: 0,
|
|
215
|
-
uri: c(
|
|
218
|
+
uri: c(Ce)
|
|
216
219
|
}, null, 8, ["uri"])) : d("", !0),
|
|
217
220
|
_("span", null, w(e.label), 1),
|
|
218
221
|
U.tooltip ? (a(), k(c(ke), {
|
|
@@ -220,13 +223,13 @@ const Fe = ["tabindex"], Me = { class: "pl-autocomplete__container" }, Re = { cl
|
|
|
220
223
|
class: "info",
|
|
221
224
|
position: "top"
|
|
222
225
|
}, {
|
|
223
|
-
tooltip:
|
|
224
|
-
|
|
226
|
+
tooltip: M(() => [
|
|
227
|
+
N(e.$slots, "tooltip")
|
|
225
228
|
]),
|
|
226
229
|
_: 3
|
|
227
230
|
})) : d("", !0)
|
|
228
231
|
])) : d("", !0),
|
|
229
|
-
t.open ? (a(), k(c(
|
|
232
|
+
t.open ? (a(), k(c(Ve), {
|
|
230
233
|
key: 1,
|
|
231
234
|
ref: "overlay",
|
|
232
235
|
root: p.value,
|
|
@@ -234,8 +237,8 @@ const Fe = ["tabindex"], Me = { class: "pl-autocomplete__container" }, Re = { cl
|
|
|
234
237
|
tabindex: "-1",
|
|
235
238
|
gap: 3
|
|
236
239
|
}, {
|
|
237
|
-
default:
|
|
238
|
-
(a(!0),
|
|
240
|
+
default: M(() => [
|
|
241
|
+
(a(!0), i(_e, null, ge(y.value, (l, r) => (a(), k(be, {
|
|
239
242
|
key: r,
|
|
240
243
|
option: l,
|
|
241
244
|
"is-selected": l.isSelected,
|
|
@@ -243,18 +246,21 @@ const Fe = ["tabindex"], Me = { class: "pl-autocomplete__container" }, Re = { cl
|
|
|
243
246
|
size: e.optionSize,
|
|
244
247
|
onClick: O((f) => L(l), ["stop"])
|
|
245
248
|
}, null, 8, ["option", "is-selected", "is-hovered", "size", "onClick"]))), 128)),
|
|
246
|
-
y.value.length ? d("", !0) : (a(),
|
|
249
|
+
y.value.length ? d("", !0) : (a(), i("div", ze, "Nothing found"))
|
|
247
250
|
]),
|
|
248
251
|
_: 1
|
|
249
252
|
}, 8, ["root"])) : d("", !0),
|
|
250
|
-
|
|
253
|
+
z(we, {
|
|
254
|
+
class: "pl-autocomplete__contour",
|
|
255
|
+
"group-position": e.groupPosition
|
|
256
|
+
}, null, 8, ["group-position"])
|
|
251
257
|
])
|
|
252
|
-
], 42,
|
|
253
|
-
|
|
258
|
+
], 42, De),
|
|
259
|
+
$.value ? (a(), i("div", Ne, w($.value), 1)) : S.value && e.loadingOptionsHelper ? (a(), i("div", Te, w(e.loadingOptionsHelper), 1)) : e.helper ? (a(), i("div", He, w(e.helper), 1)) : d("", !0)
|
|
254
260
|
]));
|
|
255
261
|
}
|
|
256
262
|
});
|
|
257
263
|
export {
|
|
258
|
-
|
|
264
|
+
po as default
|
|
259
265
|
};
|
|
260
266
|
//# sourceMappingURL=PlAutocomplete.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAutocomplete.vue.js","sources":["../../../src/components/PlAutocomplete/PlAutocomplete.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a big list of options using string search request\n */\nexport default {\n name: 'PlAutocomplete',\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport './pl-autocomplete.scss';\nimport { computed, reactive, ref, unref, useTemplateRef, watch, watchPostEffect } from 'vue';\nimport { tap } from '../../helpers/functions';\nimport { PlTooltip } from '../PlTooltip';\nimport DoubleContour from '../../utils/DoubleContour.vue';\nimport { useLabelNotch } from '../../utils/useLabelNotch';\nimport type { ListOption, ListOptionNormalized } from '../../types';\nimport { deepEqual } from '../../helpers/objects';\nimport DropdownListItem from '../DropdownListItem.vue';\nimport LongText from '../LongText.vue';\nimport { normalizeListOptions } from '../../helpers/utils';\nimport { PlIcon16 } from '../PlIcon16';\nimport { PlMaskIcon24 } from '../PlMaskIcon24';\nimport { DropdownOverlay } from '../../utils/DropdownOverlay';\nimport { refDebounced } from '@vueuse/core';\nimport { useWatchFetch } from '../../composition/useWatchFetch.ts';\nimport { getErrorMessage } from '../../helpers/error.ts';\nimport type { ListOptionBase } from '@platforma-sdk/model';\nimport { PlSvg } from '../PlSvg';\nimport SvgRequired from '../../assets/images/required.svg?raw';\n\n/**\n * The current selected value.\n */\nconst model = defineModel<M>({ required: true });\n\nconst props = withDefaults(\n defineProps<{\n /**\n * Lambda for requesting of available options for the dropdown by search string.\n */\n optionsSearch: (s: string) => Promise<ListOption<M>[]>;\n /**\n * Lambda for requesting of corresponding option for current model value. If empty, optionsSearch is used for this.\n */\n modelSearch?: (v: M) => Promise<ListOption<M>>;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: string;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: string;\n /**\n * Option list item size\n */\n optionSize?: 'small' | 'medium';\n /**\n * Formatter for the selected value if its label is absent\n */\n formatValue?: (value: M) => string;\n }>(),\n {\n modelSearch: undefined,\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 formatValue: (v: M) => String(v),\n },\n);\n\nconst slots = defineSlots<{\n [key: string]: unknown;\n}>();\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst overlayRef = useTemplateRef('overlay');\n\nconst search = ref<string | null>(null);\nconst data = reactive({\n activeIndex: -1,\n open: false,\n});\n\nconst findActiveIndex = () =>\n tap(\n renderedOptionsRef.value.findIndex((o) => deepEqual(o.value, model.value)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst loadedOptionsRef = ref<ListOption<M>[]>([]);\nconst modelOptionRef = ref<ListOptionNormalized<M> | undefined>(); // list of 1 option that is selected or empty, to keep selected label\n\nconst renderedOptionsRef = computed(() => {\n return normalizeListOptions(loadedOptionsRef.value).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })) as (ListOptionBase<M> & { index: number; isSelected: boolean; isActive: boolean })[];\n});\nconst isLoadingOptions = ref<boolean>(true);\nconst isLoadingError = ref<boolean>(false);\n\nconst isDisabled = computed(() => {\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return loadedOptionsRef.value.findIndex((o) => deepEqual(o.value, model.value));\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n if (isLoadingError.value) {\n return 'Data loading error';\n }\n\n return undefined;\n});\n\nconst textValue = computed(() => {\n const modelOption = unref(modelOptionRef);\n const options = unref(renderedOptionsRef);\n\n const item: ListOptionNormalized | undefined = modelOption ?? options.find((o) => deepEqual(o.value, model.value)) ?? options.find((o) => deepEqual(o.value, model.value));\n\n return item?.label || (model.value ? props.formatValue(model.value) : '');\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && model.value) {\n return '';\n }\n\n return model.value ? String(textValue.value) : props.placeholder;\n});\n\nconst hasValue = computed(() => {\n return model.value !== undefined && model.value !== null;\n});\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : '0'));\n\nconst selectOption = (v: ListOptionBase<M> & { index: number } | undefined) => {\n model.value = v?.value as M;\n modelOptionRef.value = v;\n search.value = null;\n data.open = false;\n rootRef?.value?.focus();\n};\n\nconst clear = () => {\n model.value = undefined as M;\n modelOptionRef.value = undefined;\n};\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => {\n data.open = !data.open;\n};\n\nwatch(() => data.open, (v) => {\n search.value = v ? '' : null;\n});\n\nconst onInputFocus = () => {\n data.open = true;\n};\n\nconst onFocusOut = (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!rootRef.value?.contains(relatedTarget) && !overlayRef.value?.listRef?.contains(relatedTarget)) {\n search.value = null;\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 search.value = '';\n }\n return;\n }\n\n if (e.code === 'Escape') {\n data.open = false;\n search.value = null;\n rootRef.value?.focus();\n }\n\n const options = unref(renderedOptionsRef);\n\n const { length } = options;\n\n if (!length) {\n return;\n }\n\n if (e.code === 'Enter') {\n selectOption(options.find((it) => it.index === activeIndex));\n }\n\n const localIndex = options.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 = renderedOptionsRef.value[newIndex].index ?? -1;\n};\n\nuseLabelNotch(rootRef);\n\nwatch(() => model.value, 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 search.value; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n overlayRef.value?.scrollIntoActive();\n }\n});\n\nconst searchDebounced = refDebounced(search, 300, { maxWait: 1000 });\n\nconst optionsRequest = useWatchFetch(() => searchDebounced.value, async (v) => {\n if (v !== null) { // search is null when dropdown is closed;\n return props.optionsSearch(v);\n }\n return undefined;\n});\n\nconst modelOptionRequest = useWatchFetch(() => model.value, async (v) => {\n if (v && !deepEqual(modelOptionRef.value?.value, v)) { // load label for selected value if it was updated from outside the component\n if (props.modelSearch) {\n return props.modelSearch(v);\n }\n return (await props.optionsSearch(String(v)))?.[0];\n }\n return modelOptionRef.value;\n});\n\nwatch(() => optionsRequest.value, (result) => {\n if (result) {\n loadedOptionsRef.value = result;\n if (search.value !== null) {\n isLoadingError.value = false;\n }\n }\n});\n\nwatch(() => modelOptionRequest.value, (result) => {\n if (result) {\n modelOptionRef.value = normalizeListOptions([result])[0];\n }\n});\n\nwatch(() => optionsRequest.error, (err) => {\n if (err) {\n isLoadingError.value = Boolean(err);\n }\n});\n\nwatch(() => optionsRequest.loading || modelOptionRequest.loading, (loading) => {\n isLoadingOptions.value = loading;\n});\n</script>\n\n<template>\n <div class=\"pl-autocomplete__envelope\" @click.stop=\"setFocusOnInput\">\n <div\n ref=\"rootRef\"\n :tabindex=\"tabindex\"\n class=\"pl-autocomplete\"\n :class=\"{ open: data.open, error: Boolean(computedError), disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"pl-autocomplete__container\">\n <div class=\"pl-autocomplete__field\">\n <input\n ref=\"input\"\n v-model=\"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-autocomplete__controls\">\n <PlMaskIcon24 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-autocomplete__arrow-wrapper\" @click.stop=\"toggleOpen\">\n <div v-if=\"arrowIconLarge\" class=\"arrow-icon\" :class=\"[`icon-24 ${arrowIconLarge}`]\" />\n <div v-else-if=\"arrowIcon\" class=\"arrow-icon\" :class=\"[`icon-16 ${arrowIcon}`]\" />\n <div v-else 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 <DropdownOverlay v-if=\"data.open\" ref=\"overlay\" :root=\"rootRef\" class=\"pl-autocomplete__options\" tabindex=\"-1\" :gap=\"3\">\n <DropdownListItem\n v-for=\"(item, index) in renderedOptionsRef\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n @click.stop=\"selectOption(item)\"\n />\n <div v-if=\"!renderedOptionsRef.length\" class=\"nothing-found\">Nothing found</div>\n </DropdownOverlay>\n <DoubleContour class=\"pl-autocomplete__contour\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"pl-autocomplete__error\">{{ computedError }}</div>\n <div v-else-if=\"isLoadingOptions && loadingOptionsHelper\" class=\"pl-autocomplete__helper\">{{ loadingOptionsHelper }}</div>\n <div v-else-if=\"helper\" class=\"pl-autocomplete__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"names":["__default__","model","_useModel","props","__props","slots","_useSlots","rootRef","ref","input","overlayRef","useTemplateRef","search","data","reactive","findActiveIndex","tap","renderedOptionsRef","o","deepEqual","v","updateActive","loadedOptionsRef","modelOptionRef","computed","normalizeListOptions","opt","index","selectedIndex","isLoadingOptions","isLoadingError","isDisabled","computedError","getErrorMessage","textValue","modelOption","unref","options","item","computedPlaceholder","hasValue","tabindex","selectOption","_a","clear","setFocusOnInput","toggleOpen","watch","onInputFocus","onFocusOut","event","relatedTarget","_c","_b","handleKeydown","open","activeIndex","length","it","localIndex","delta","newIndex","useLabelNotch","watchPostEffect","searchDebounced","refDebounced","optionsRequest","useWatchFetch","modelOptionRequest","result","err","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIAA,KAAe;AAAA,EACb,MAAM;AACR;;;;;;;;;;;;;;;;;;;;;;;AA4BA,UAAMC,IAAQC,kBAAiC,GAEzCC,IAAQC,GA4ERC,IAAQC,GAAA,GAIRC,IAAUC,EAAA,GACVC,IAAQD,EAAA,GAERE,IAAaC,GAAe,SAAS,GAErCC,IAASJ,EAAmB,IAAI,GAChCK,IAAOC,GAAS;AAAA,MACpB,aAAa;AAAA,MACb,MAAM;AAAA,IAAA,CACP,GAEKC,IAAkB,MACtBC;AAAA,MACEC,EAAmB,MAAM,UAAU,CAACC,MAAMC,EAAUD,EAAE,OAAOjB,EAAM,KAAK,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AOmB,MAAM;;AACvE,aAAIA,KAAK,CAACD,GAAUwB,IAAApB,EAAe,UAAf,gBAAAoB,EAAsB,OAAOvB,CAAC,IAC5CjB,EAAM,cACDA,EAAM,YAAYiB,CAAC,KAEpBiC,IAAA,MAAMlD,EAAM,cAAc,OAAOiB,CAAC,CAAC,MAAnC,gBAAAiC,EAAwC,KAE3C9B,EAAe;AAAA,IACxB,CAAC;AAED,WAAAwB,EAAM,MAAMmB,EAAe,OAAO,CAACG,MAAW;AAC5C,MAAIA,MACF/C,EAAiB,QAAQ+C,GACrBzD,EAAO,UAAU,SACnBkB,EAAe,QAAQ;AAAA,IAG7B,CAAC,GAEDiB,EAAM,MAAMqB,EAAmB,OAAO,CAACC,MAAW;AAChD,MAAIA,MACF9C,EAAe,QAAQE,EAAqB,CAAC4C,CAAM,CAAC,EAAE,CAAC;AAAA,IAE3D,CAAC,GAEDtB,EAAM,MAAMmB,EAAe,OAAO,CAACI,MAAQ;AACzC,MAAIA,MACFxC,EAAe,QAAQ,EAAQwC;AAAA,IAEnC,CAAC,GAEDvB,EAAM,MAAMmB,EAAe,WAAWE,EAAmB,SAAS,CAACG,MAAY;AAC7E,MAAA1C,EAAiB,QAAQ0C;AAAA,IAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"PlAutocomplete.vue.js","sources":["../../../src/components/PlAutocomplete/PlAutocomplete.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * A component for selecting one value from a big list of options using string search request\n */\nexport default {\n name: 'PlAutocomplete',\n};\n</script>\n\n<script lang=\"ts\" setup generic=\"M = unknown\">\nimport './pl-autocomplete.scss';\nimport { computed, reactive, ref, unref, useTemplateRef, watch, watchPostEffect } from 'vue';\nimport { tap } from '../../helpers/functions';\nimport { PlTooltip } from '../PlTooltip';\nimport DoubleContour from '../../utils/DoubleContour.vue';\nimport { useLabelNotch } from '../../utils/useLabelNotch';\nimport type { ListOption, ListOptionNormalized } from '../../types';\nimport { deepEqual } from '../../helpers/objects';\nimport DropdownListItem from '../DropdownListItem.vue';\nimport LongText from '../LongText.vue';\nimport { normalizeListOptions } from '../../helpers/utils';\nimport { PlIcon16 } from '../PlIcon16';\nimport { PlMaskIcon24 } from '../PlMaskIcon24';\nimport { DropdownOverlay } from '../../utils/DropdownOverlay';\nimport { refDebounced } from '@vueuse/core';\nimport { useWatchFetch } from '../../composition/useWatchFetch.ts';\nimport { getErrorMessage } from '../../helpers/error.ts';\nimport type { ListOptionBase } from '@platforma-sdk/model';\nimport { PlSvg } from '../PlSvg';\nimport SvgRequired from '../../assets/images/required.svg?raw';\n\n/**\n * The current selected value.\n */\nconst model = defineModel<M>({ required: true });\n\nconst props = withDefaults(\n defineProps<{\n /**\n * Lambda for requesting of available options for the dropdown by search string.\n */\n optionsSearch: (s: string) => Promise<ListOption<M>[]>;\n /**\n * Lambda for requesting of corresponding option for current model value. If empty, optionsSearch is used for this.\n */\n modelSearch?: (v: M) => Promise<ListOption<M>>;\n /**\n * The label text for the dropdown field (optional)\n */\n label?: string;\n /**\n * A helper text displayed below the dropdown when there are no errors (optional).\n */\n helper?: string;\n /**\n * A helper text displayed below the dropdown when there are no options yet or options is undefined (optional).\n */\n loadingOptionsHelper?: string;\n /**\n * Error message displayed below the dropdown (optional)\n */\n error?: unknown;\n /**\n * Placeholder text shown when no value is selected.\n */\n placeholder?: string;\n /**\n * Enables a button to clear the selected value (default: false)\n */\n clearable?: boolean;\n /**\n * If `true`, the dropdown component is marked as required.\n */\n required?: boolean;\n /**\n * If `true`, the dropdown component is disabled and cannot be interacted with.\n */\n disabled?: boolean;\n /**\n * Custom icon (16px) class for the dropdown arrow (optional)\n */\n arrowIcon?: string;\n /**\n * Custom icon (24px) class for the dropdown arrow (optional)\n */\n arrowIconLarge?: string;\n /**\n * Option list item size\n */\n optionSize?: 'small' | 'medium';\n /**\n * Formatter for the selected value if its label is absent\n */\n formatValue?: (value: M) => string;\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 modelSearch: undefined,\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 formatValue: (v: M) => String(v),\n groupPosition: undefined,\n },\n);\n\nconst slots = defineSlots<{\n [key: string]: unknown;\n}>();\n\nconst rootRef = ref<HTMLElement | undefined>();\nconst input = ref<HTMLInputElement | undefined>();\n\nconst overlayRef = useTemplateRef('overlay');\n\nconst search = ref<string | null>(null);\nconst data = reactive({\n activeIndex: -1,\n open: false,\n});\n\nconst findActiveIndex = () =>\n tap(\n renderedOptionsRef.value.findIndex((o) => deepEqual(o.value, model.value)),\n (v) => (v < 0 ? 0 : v),\n );\n\nconst updateActive = () => (data.activeIndex = findActiveIndex());\n\nconst loadedOptionsRef = ref<ListOption<M>[]>([]);\nconst modelOptionRef = ref<ListOptionNormalized<M> | undefined>(); // list of 1 option that is selected or empty, to keep selected label\n\nconst renderedOptionsRef = computed(() => {\n return normalizeListOptions(loadedOptionsRef.value).map((opt, index) => ({\n ...opt,\n index,\n isSelected: index === selectedIndex.value,\n isActive: index === data.activeIndex,\n })) as (ListOptionBase<M> & { index: number; isSelected: boolean; isActive: boolean })[];\n});\nconst isLoadingOptions = ref<boolean>(true);\nconst isLoadingError = ref<boolean>(false);\n\nconst isDisabled = computed(() => {\n return props.disabled;\n});\n\nconst selectedIndex = computed(() => {\n return loadedOptionsRef.value.findIndex((o) => deepEqual(o.value, model.value));\n});\n\nconst computedError = computed(() => {\n if (isLoadingOptions.value) {\n return undefined;\n }\n\n if (props.error) {\n return getErrorMessage(props.error);\n }\n\n if (isLoadingError.value) {\n return 'Data loading error';\n }\n\n return undefined;\n});\n\nconst textValue = computed(() => {\n const modelOption = unref(modelOptionRef);\n const options = unref(renderedOptionsRef);\n\n const item: ListOptionNormalized | undefined = modelOption ?? options.find((o) => deepEqual(o.value, model.value)) ?? options.find((o) => deepEqual(o.value, model.value));\n\n return item?.label || (model.value ? props.formatValue(model.value) : '');\n});\n\nconst computedPlaceholder = computed(() => {\n if (!data.open && model.value) {\n return '';\n }\n\n return model.value ? String(textValue.value) : props.placeholder;\n});\n\nconst hasValue = computed(() => {\n return model.value !== undefined && model.value !== null;\n});\n\nconst tabindex = computed(() => (isDisabled.value ? undefined : '0'));\n\nconst selectOption = (v: ListOptionBase<M> & { index: number } | undefined) => {\n model.value = v?.value as M;\n modelOptionRef.value = v;\n search.value = null;\n data.open = false;\n rootRef?.value?.focus();\n};\n\nconst clear = () => {\n model.value = undefined as M;\n modelOptionRef.value = undefined;\n};\n\nconst setFocusOnInput = () => input.value?.focus();\n\nconst toggleOpen = () => {\n data.open = !data.open;\n};\n\nwatch(() => data.open, (v) => {\n search.value = v ? '' : null;\n});\n\nconst onInputFocus = () => {\n data.open = true;\n};\n\nconst onFocusOut = (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as Node | null;\n\n if (!rootRef.value?.contains(relatedTarget) && !overlayRef.value?.listRef?.contains(relatedTarget)) {\n search.value = null;\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 search.value = '';\n }\n return;\n }\n\n if (e.code === 'Escape') {\n data.open = false;\n search.value = null;\n rootRef.value?.focus();\n }\n\n const options = unref(renderedOptionsRef);\n\n const { length } = options;\n\n if (!length) {\n return;\n }\n\n if (e.code === 'Enter') {\n selectOption(options.find((it) => it.index === activeIndex));\n }\n\n const localIndex = options.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 = renderedOptionsRef.value[newIndex].index ?? -1;\n};\n\nuseLabelNotch(rootRef);\n\nwatch(() => model.value, 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 search.value; // to watch\n\n if (data.activeIndex >= 0 && data.open) {\n overlayRef.value?.scrollIntoActive();\n }\n});\n\nconst searchDebounced = refDebounced(search, 300, { maxWait: 1000 });\n\nconst optionsRequest = useWatchFetch(() => searchDebounced.value, async (v) => {\n if (v !== null) { // search is null when dropdown is closed;\n return props.optionsSearch(v);\n }\n return undefined;\n});\n\nconst modelOptionRequest = useWatchFetch(() => model.value, async (v) => {\n if (v && !deepEqual(modelOptionRef.value?.value, v)) { // load label for selected value if it was updated from outside the component\n if (props.modelSearch) {\n return props.modelSearch(v);\n }\n return (await props.optionsSearch(String(v)))?.[0];\n }\n return modelOptionRef.value;\n});\n\nwatch(() => optionsRequest.value, (result) => {\n if (result) {\n loadedOptionsRef.value = result;\n if (search.value !== null) {\n isLoadingError.value = false;\n }\n }\n});\n\nwatch(() => modelOptionRequest.value, (result) => {\n if (result) {\n modelOptionRef.value = normalizeListOptions([result])[0];\n }\n});\n\nwatch(() => optionsRequest.error, (err) => {\n if (err) {\n isLoadingError.value = Boolean(err);\n }\n});\n\nwatch(() => optionsRequest.loading || modelOptionRequest.loading, (loading) => {\n isLoadingOptions.value = loading;\n});\n</script>\n\n<template>\n <div class=\"pl-autocomplete__envelope\" @click.stop=\"setFocusOnInput\">\n <div\n ref=\"rootRef\"\n :tabindex=\"tabindex\"\n class=\"pl-autocomplete\"\n :class=\"{ open: data.open, error: Boolean(computedError), disabled: isDisabled }\"\n @keydown=\"handleKeydown\"\n @focusout=\"onFocusOut\"\n >\n <div class=\"pl-autocomplete__container\">\n <div class=\"pl-autocomplete__field\">\n <input\n ref=\"input\"\n v-model=\"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-autocomplete__controls\">\n <PlMaskIcon24 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-autocomplete__arrow-wrapper\" @click.stop=\"toggleOpen\">\n <div v-if=\"arrowIconLarge\" class=\"arrow-icon\" :class=\"[`icon-24 ${arrowIconLarge}`]\" />\n <div v-else-if=\"arrowIcon\" class=\"arrow-icon\" :class=\"[`icon-16 ${arrowIcon}`]\" />\n <div v-else 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 <DropdownOverlay v-if=\"data.open\" ref=\"overlay\" :root=\"rootRef\" class=\"pl-autocomplete__options\" tabindex=\"-1\" :gap=\"3\">\n <DropdownListItem\n v-for=\"(item, index) in renderedOptionsRef\"\n :key=\"index\"\n :option=\"item\"\n :is-selected=\"item.isSelected\"\n :is-hovered=\"item.isActive\"\n :size=\"optionSize\"\n @click.stop=\"selectOption(item)\"\n />\n <div v-if=\"!renderedOptionsRef.length\" class=\"nothing-found\">Nothing found</div>\n </DropdownOverlay>\n <DoubleContour class=\"pl-autocomplete__contour\" :group-position=\"groupPosition\" />\n </div>\n </div>\n <div v-if=\"computedError\" class=\"pl-autocomplete__error\">{{ computedError }}</div>\n <div v-else-if=\"isLoadingOptions && loadingOptionsHelper\" class=\"pl-autocomplete__helper\">{{ loadingOptionsHelper }}</div>\n <div v-else-if=\"helper\" class=\"pl-autocomplete__helper\">{{ helper }}</div>\n </div>\n</template>\n"],"names":["__default__","model","_useModel","props","__props","slots","_useSlots","rootRef","ref","input","overlayRef","useTemplateRef","search","data","reactive","findActiveIndex","tap","renderedOptionsRef","o","deepEqual","v","updateActive","loadedOptionsRef","modelOptionRef","computed","normalizeListOptions","opt","index","selectedIndex","isLoadingOptions","isLoadingError","isDisabled","computedError","getErrorMessage","textValue","modelOption","unref","options","item","computedPlaceholder","hasValue","tabindex","selectOption","_a","clear","setFocusOnInput","toggleOpen","watch","onInputFocus","onFocusOut","event","relatedTarget","_c","_b","handleKeydown","open","activeIndex","length","it","localIndex","delta","newIndex","useLabelNotch","watchPostEffect","searchDebounced","refDebounced","optionsRequest","useWatchFetch","modelOptionRequest","result","err","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIAA,KAAe;AAAA,EACb,MAAM;AACR;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,UAAMC,IAAQC,kBAAiC,GAEzCC,IAAQC,GAiFRC,IAAQC,GAAA,GAIRC,IAAUC,EAAA,GACVC,IAAQD,EAAA,GAERE,IAAaC,GAAe,SAAS,GAErCC,IAASJ,EAAmB,IAAI,GAChCK,IAAOC,GAAS;AAAA,MACpB,aAAa;AAAA,MACb,MAAM;AAAA,IAAA,CACP,GAEKC,IAAkB,MACtBC;AAAA,MACEC,EAAmB,MAAM,UAAU,CAACC,MAAMC,EAAUD,EAAE,OAAOjB,EAAM,KAAK,CAAC;AAAA,MACzE,CAACmB,MAAOA,IAAI,IAAI,IAAIA;AAAA,IAAA,GAGlBC,IAAe,MAAOR,EAAK,cAAcE,EAAA,GAEzCO,IAAmBd,E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M,YAAYiB,CAAC,KAEpBiC,IAAA,MAAMlD,EAAM,cAAc,OAAOiB,CAAC,CAAC,MAAnC,gBAAAiC,EAAwC,KAE3C9B,EAAe;AAAA,IACxB,CAAC;AAED,WAAAwB,EAAM,MAAMmB,EAAe,OAAO,CAACG,MAAW;AAC5C,MAAIA,MACF/C,EAAiB,QAAQ+C,GACrBzD,EAAO,UAAU,SACnBkB,EAAe,QAAQ;AAAA,IAG7B,CAAC,GAEDiB,EAAM,MAAMqB,EAAmB,OAAO,CAACC,MAAW;AAChD,MAAIA,MACF9C,EAAe,QAAQE,EAAqB,CAAC4C,CAAM,CAAC,EAAE,CAAC;AAAA,IAE3D,CAAC,GAEDtB,EAAM,MAAMmB,EAAe,OAAO,CAACI,MAAQ;AACzC,MAAIA,MACFxC,EAAe,QAAQ,EAAQwC;AAAA,IAEnC,CAAC,GAEDvB,EAAM,MAAMmB,EAAe,WAAWE,EAAmB,SAAS,CAACG,MAAY;AAC7E,MAAA1C,EAAiB,QAAQ0C;AAAA,IAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -88,6 +88,10 @@ declare const _default: <M = unknown>(__VLS_props: NonNullable<Awaited<typeof __
|
|
|
88
88
|
* The text to display when no options are found.
|
|
89
89
|
*/
|
|
90
90
|
emptyOptionsText?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Makes some of corners not rounded
|
|
93
|
+
* */
|
|
94
|
+
groupPosition?: "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "middle";
|
|
91
95
|
} & Partial<{}>> & import('vue').PublicProps;
|
|
92
96
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
93
97
|
attrs: any;
|