@shtabapp/ui-kit 1.51.1 → 1.52.0
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/CHANGELOG.md +6 -0
- package/dist/{SColorPicker-Dl5H4iwH.js → SColorPicker-C1wT4fRa.js} +1 -1
- package/dist/{SColorPicker-CuuiFxI0.cjs → SColorPicker-hCvgFpwK.cjs} +1 -1
- package/dist/{SSelect-pXiw_NyB.js → SSelect-Bf1lDJ0M.js} +184 -173
- package/dist/SSelect-CPm2SRpw.cjs +1 -0
- package/dist/components/SSelect/SSelect.types.d.ts +16 -0
- package/dist/components/SSelect/SSelect.types.d.ts.map +1 -1
- package/dist/components/SSelect/SSelect.vue.d.ts +6 -1
- package/dist/components/SSelect/SSelect.vue.d.ts.map +1 -1
- package/dist/entries/color-picker.cjs +1 -1
- package/dist/entries/color-picker.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/uikit-components.css +1 -1
- package/package.json +1 -1
- package/dist/SSelect-CMR4dxSn.cjs +0 -1
|
@@ -5,16 +5,16 @@ import { t as a } from "./SDropdown-CTQ5Qlez.js";
|
|
|
5
5
|
import { n as o, t as s } from "./SInput-ug89CYt3.js";
|
|
6
6
|
import { i as c, n as l, r as u, t as d } from "./SList-BESqVnlh.js";
|
|
7
7
|
import { t as f } from "./SListItem-DJ8uSadf.js";
|
|
8
|
-
import { computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as ee, createVNode as y, defineComponent as b, guardReactiveProps as x, isRef as te, mergeModels as S, mergeProps as C, nextTick as w, normalizeClass as T, normalizeProps as E, normalizeStyle as D, openBlock as O, ref as ne, renderSlot as k, toDisplayString as A, toValue as j, unref as M, useId as re, useModel as ie, useSlots as ae, useTemplateRef as N, vModelText as oe, watch as
|
|
9
|
-
import { SIcon as
|
|
8
|
+
import { computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as ee, createVNode as y, defineComponent as b, guardReactiveProps as x, isRef as te, mergeModels as S, mergeProps as C, nextTick as w, normalizeClass as T, normalizeProps as E, normalizeStyle as D, openBlock as O, ref as ne, renderSlot as k, toDisplayString as A, toValue as j, unref as M, useId as re, useModel as ie, useSlots as ae, useTemplateRef as N, vModelText as oe, watch as P, withCtx as F, withDirectives as se, withModifiers as ce } from "vue";
|
|
9
|
+
import { SIcon as le, useUiKitI18n as ue } from "@shtabapp/ui-kit-primitives";
|
|
10
10
|
//#region src/components/SDropdownMenu/SDropdownMenu.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var
|
|
11
|
+
var de = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "s-ui-dropdown-menu__header"
|
|
14
|
-
},
|
|
14
|
+
}, fe = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "s-ui-dropdown-menu__footer"
|
|
17
|
-
},
|
|
17
|
+
}, pe = /* @__PURE__ */ b({
|
|
18
18
|
__name: "SDropdownMenu",
|
|
19
19
|
props: {
|
|
20
20
|
width: {},
|
|
@@ -36,12 +36,12 @@ var fe = {
|
|
|
36
36
|
class: T(["s-ui-dropdown-menu", r.value]),
|
|
37
37
|
style: D(a.value)
|
|
38
38
|
}, [
|
|
39
|
-
M(t).header ? (O(), g("div",
|
|
39
|
+
M(t).header ? (O(), g("div", de, [k(e.$slots, "header")])) : h("", !0),
|
|
40
40
|
_("div", { class: T(["s-ui-dropdown-menu__body", i.value]) }, [k(e.$slots, "default")], 2),
|
|
41
|
-
M(t).footer ? (O(), g("div",
|
|
41
|
+
M(t).footer ? (O(), g("div", fe, [k(e.$slots, "footer")])) : h("", !0)
|
|
42
42
|
], 6));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
44
|
+
}), me = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, itemIconLeft: i, listActiveKey: a, isOptionSelected: o }) => {
|
|
45
45
|
let s = e.item;
|
|
46
46
|
return {
|
|
47
47
|
rowKey: e.key,
|
|
@@ -54,55 +54,55 @@ var fe = {
|
|
|
54
54
|
revealRight: e.revealRight,
|
|
55
55
|
tiny: !0
|
|
56
56
|
};
|
|
57
|
-
},
|
|
57
|
+
}, he = (e) => typeof e == "string" || typeof e == "number", I = (e, t) => {
|
|
58
58
|
let n = e[t];
|
|
59
|
-
if (
|
|
60
|
-
},
|
|
61
|
-
let r =
|
|
62
|
-
if (r) return
|
|
63
|
-
},
|
|
59
|
+
if (he(n)) return n;
|
|
60
|
+
}, L = (e) => typeof e == "string" ? e : String(e), R = (e) => e == null ? !1 : typeof e == "string" ? e.length > 0 : !0, z = (e, t, n) => t.find((t) => L(I(t, n) ?? "") === e), B = (e) => typeof e == "object" && !!e, V = (e, t, n) => {
|
|
61
|
+
let r = z(e, t, n);
|
|
62
|
+
if (r) return I(r, n);
|
|
63
|
+
}, H = /* @__PURE__ */ function(e) {
|
|
64
64
|
return e.INPUT = "input", e.CONTENT = "content", e;
|
|
65
|
-
}({}),
|
|
65
|
+
}({}), U = (e, t, n) => {
|
|
66
66
|
if (!e) return !0;
|
|
67
|
-
let r = e.toLocaleLowerCase(), i = c(t, n.itemTitle)?.toLocaleLowerCase() ?? "", a = I(
|
|
67
|
+
let r = e.toLocaleLowerCase(), i = c(t, n.itemTitle)?.toLocaleLowerCase() ?? "", a = L(I(t, n.itemValue) ?? "").toLocaleLowerCase();
|
|
68
68
|
return i.includes(r) || a.includes(r);
|
|
69
|
-
},
|
|
70
|
-
let i = r ?? ((e, t) =>
|
|
69
|
+
}, W = (e, t, n, r) => {
|
|
70
|
+
let i = r ?? ((e, t) => U(e, t, n));
|
|
71
71
|
return t ? e.filter((e) => i(t, e)) : [...e];
|
|
72
|
-
},
|
|
72
|
+
}, G = (e) => typeof e == "string" && R(e), K = (e) => typeof e == "number" && R(e), q = (e, t, n) => {
|
|
73
73
|
if (t) {
|
|
74
|
-
if (!
|
|
75
|
-
let t =
|
|
76
|
-
return
|
|
74
|
+
if (!B(e)) return;
|
|
75
|
+
let t = I(e, n);
|
|
76
|
+
return G(t) || K(t) ? t : void 0;
|
|
77
77
|
}
|
|
78
78
|
let r = typeof e == "string" || typeof e == "number" ? e : void 0;
|
|
79
|
-
if (
|
|
80
|
-
},
|
|
81
|
-
let r =
|
|
82
|
-
return
|
|
83
|
-
}) : [],
|
|
84
|
-
if (
|
|
79
|
+
if (G(r) || K(r)) return r;
|
|
80
|
+
}, ge = (e, t, n) => e ? (Array.isArray(e) ? e : [e]).flatMap((e) => {
|
|
81
|
+
let r = q(e, t, n);
|
|
82
|
+
return R(r) ? [r] : [];
|
|
83
|
+
}) : [], J = (e, t) => {
|
|
84
|
+
if (G(t)) {
|
|
85
85
|
e.value = t;
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
if (
|
|
88
|
+
if (K(t)) {
|
|
89
89
|
e.value = t;
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
e.value = void 0;
|
|
93
|
-
},
|
|
94
|
-
let r =
|
|
93
|
+
}, _e = (e, t, n) => t.flatMap((t) => {
|
|
94
|
+
let r = L(t), i = e.find((e) => L(I(e, n) ?? "") === r);
|
|
95
95
|
return i ? [i] : [];
|
|
96
|
-
}),
|
|
97
|
-
let d = p(() => j(r)), f = p(() => j(a)), m = p(() => j(o) ===
|
|
96
|
+
}), ve = ({ modelValue: e, options: t, itemFields: n, multiple: r, returnObject: a, searchable: o, filterOption: s, isDropdownOpen: l, searchQuery: u }) => {
|
|
97
|
+
let d = p(() => j(r)), f = p(() => j(a)), m = p(() => j(o) === H.INPUT), h = p(() => j(o) === H.CONTENT), g = p(() => !!j(o)), _ = p(() => {
|
|
98
98
|
let t = j(n);
|
|
99
|
-
return
|
|
99
|
+
return ge(e.value, f.value, t.itemValue);
|
|
100
100
|
}), v = p(() => {
|
|
101
101
|
let e = j(t), r = j(n);
|
|
102
|
-
return
|
|
102
|
+
return W(e, g.value ? u.value : "", r, j(s));
|
|
103
103
|
}), ee = p(() => d.value ? i.MULTIPLE : i.SINGLE), y = (t, n, r) => {
|
|
104
104
|
if (f.value) {
|
|
105
|
-
e.value =
|
|
105
|
+
e.value = _e(n, t, r);
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
e.value = t;
|
|
@@ -112,44 +112,44 @@ var fe = {
|
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
if (f.value) {
|
|
115
|
-
e.value =
|
|
115
|
+
e.value = z(t, n, r) ?? void 0;
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
J(e, V(t, n, r));
|
|
119
119
|
}, x = p({
|
|
120
120
|
get: () => {
|
|
121
|
-
if (d.value) return _.value.map((e) =>
|
|
121
|
+
if (d.value) return _.value.map((e) => L(e));
|
|
122
122
|
let e = _.value[0];
|
|
123
|
-
if (
|
|
123
|
+
if (R(e)) return L(e);
|
|
124
124
|
},
|
|
125
125
|
set: (e) => {
|
|
126
126
|
let r = j(t), i = j(n);
|
|
127
127
|
if (d.value) {
|
|
128
|
-
y((Array.isArray(e) ? e : []).map((e) =>
|
|
128
|
+
y((Array.isArray(e) ? e : []).map((e) => V(e, r, i.itemValue)).filter((e) => R(e)), r, i.itemValue);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
b(typeof e == "string" ? e : void 0, r, i.itemValue);
|
|
132
132
|
}
|
|
133
133
|
}), te = p(() => _.value.length > 0), S = (e, t, n) => {
|
|
134
|
-
let r =
|
|
135
|
-
return e.find((e) => I(
|
|
134
|
+
let r = L(t);
|
|
135
|
+
return e.find((e) => L(I(e, n) ?? "") === r);
|
|
136
136
|
}, C = p(() => {
|
|
137
137
|
let e = _.value[0];
|
|
138
|
-
if (!
|
|
138
|
+
if (!R(e)) return "";
|
|
139
139
|
let r = j(n), i = S(j(t), e, r.itemValue);
|
|
140
|
-
return i ? c(i, r.itemTitle) ?? "" :
|
|
140
|
+
return i ? c(i, r.itemTitle) ?? "" : L(e);
|
|
141
141
|
}), w = p(() => {
|
|
142
142
|
let e = j(t), r = j(n);
|
|
143
143
|
return _.value.map((t) => {
|
|
144
144
|
let n = S(e, t, r.itemValue);
|
|
145
|
-
return n ? c(n, r.itemTitle) ?? "" :
|
|
145
|
+
return n ? c(n, r.itemTitle) ?? "" : L(t);
|
|
146
146
|
});
|
|
147
147
|
}), T = p(() => w.value.join(", ")), E = p(() => d.value ? _.value.length === 0 : !C.value), D = p(() => m.value && (l.value || d.value)), O = () => {
|
|
148
148
|
u.value = "";
|
|
149
149
|
};
|
|
150
|
-
return
|
|
150
|
+
return P(l, (e) => {
|
|
151
151
|
e || O();
|
|
152
|
-
}),
|
|
152
|
+
}), P(() => j(o), () => {
|
|
153
153
|
O();
|
|
154
154
|
}), {
|
|
155
155
|
searchQuery: u,
|
|
@@ -172,21 +172,21 @@ var fe = {
|
|
|
172
172
|
e.value = void 0, O();
|
|
173
173
|
},
|
|
174
174
|
removeSelectedValue: (e) => {
|
|
175
|
-
let r =
|
|
176
|
-
y(_.value.filter((e) =>
|
|
175
|
+
let r = L(e);
|
|
176
|
+
y(_.value.filter((e) => L(e) !== r), j(t), j(n).itemValue);
|
|
177
177
|
},
|
|
178
178
|
resetSearchQuery: O,
|
|
179
|
-
formatSelectListKey:
|
|
180
|
-
resolveValueFromListKey: (e) =>
|
|
179
|
+
formatSelectListKey: L,
|
|
180
|
+
resolveValueFromListKey: (e) => V(e, j(t), j(n).itemValue)
|
|
181
181
|
};
|
|
182
|
-
},
|
|
182
|
+
}, ye = {
|
|
183
183
|
key: 0,
|
|
184
184
|
class: "s-ui-select__options-divider",
|
|
185
185
|
role: "separator"
|
|
186
|
-
},
|
|
186
|
+
}, be = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "s-ui-select__empty s-ui-typography-body-14-regular"
|
|
189
|
-
},
|
|
189
|
+
}, xe = [
|
|
190
190
|
"id",
|
|
191
191
|
"aria-expanded",
|
|
192
192
|
"aria-controls",
|
|
@@ -194,27 +194,27 @@ var fe = {
|
|
|
194
194
|
"aria-readonly",
|
|
195
195
|
"aria-autocomplete",
|
|
196
196
|
"tabindex"
|
|
197
|
-
],
|
|
197
|
+
], Se = {
|
|
198
198
|
key: 0,
|
|
199
199
|
class: "s-ui-select__value"
|
|
200
|
-
},
|
|
200
|
+
}, Ce = {
|
|
201
201
|
key: 1,
|
|
202
202
|
class: "s-ui-select__placeholder"
|
|
203
|
-
},
|
|
203
|
+
}, we = {
|
|
204
204
|
key: 1,
|
|
205
205
|
class: "s-ui-select__placeholder"
|
|
206
|
-
},
|
|
206
|
+
}, Te = {
|
|
207
207
|
key: 2,
|
|
208
208
|
class: "s-ui-select__value"
|
|
209
|
-
},
|
|
209
|
+
}, Ee = {
|
|
210
210
|
key: 3,
|
|
211
211
|
class: "s-ui-select__value-suffix"
|
|
212
|
-
},
|
|
212
|
+
}, De = [
|
|
213
213
|
"name",
|
|
214
214
|
"placeholder",
|
|
215
215
|
"disabled",
|
|
216
216
|
"readonly"
|
|
217
|
-
],
|
|
217
|
+
], Oe = 20, ke = 20, Ae = "__s-ui-select-options-divider__", je = /* @__PURE__ */ b({
|
|
218
218
|
__name: "SSelect",
|
|
219
219
|
props: /*@__PURE__*/ S({
|
|
220
220
|
options: {},
|
|
@@ -255,6 +255,8 @@ var fe = {
|
|
|
255
255
|
type: Boolean,
|
|
256
256
|
default: !0
|
|
257
257
|
},
|
|
258
|
+
canLoadMore: { type: Function },
|
|
259
|
+
endReachedDistance: { default: 0 },
|
|
258
260
|
label: {},
|
|
259
261
|
labelProps: {},
|
|
260
262
|
placeholder: {},
|
|
@@ -287,113 +289,114 @@ var fe = {
|
|
|
287
289
|
"focus",
|
|
288
290
|
"blur",
|
|
289
291
|
"open",
|
|
290
|
-
"close"
|
|
292
|
+
"close",
|
|
293
|
+
"endReached"
|
|
291
294
|
], ["update:modelValue", "update:searchQuery"]),
|
|
292
295
|
setup(i, { expose: o, emit: c }) {
|
|
293
|
-
let l = ie(i, "modelValue"), u = ie(i, "searchQuery"), b = c, { t: S } =
|
|
296
|
+
let l = ie(i, "modelValue"), u = ie(i, "searchQuery"), b = c, { t: S } = ue(), D = ae(), j = re(), de = re(), fe = N("triggerInputRef"), he = ne(""), L = N("searchInputElementRef"), z = N("panelSearchInputElementRef"), B = N("listElementRef"), V = ne(), H = ne(!1), U = ne(!1), W = p(() => i.itemId ?? i.itemValue), G = p(() => ({
|
|
294
297
|
itemValue: i.itemValue,
|
|
295
298
|
itemTitle: i.itemTitle,
|
|
296
299
|
itemSubtitle: i.itemSubtitle,
|
|
297
|
-
itemId:
|
|
298
|
-
})), { selectedValues:
|
|
300
|
+
itemId: W.value
|
|
301
|
+
})), { selectedValues: K, filteredOptions: q, listSelectionMode: ge, listSelectedModel: J, hasSelectedValues: _e, singleDisplayLabel: je, multipleDisplayLabels: Me, multipleDisplayText: Ne, showPlaceholder: Pe, showInputSearchField: Y, isSearchableMode: Fe, isSearchableInputMode: Ie, isSearchableContentMode: X, isMultipleMode: Z, clearSelection: Le, removeSelectedValue: Re, resolveValueFromListKey: ze, formatSelectListKey: Be } = ve({
|
|
299
302
|
modelValue: l,
|
|
300
303
|
options: () => i.options,
|
|
301
|
-
itemFields: () =>
|
|
304
|
+
itemFields: () => G.value,
|
|
302
305
|
multiple: () => i.multiple,
|
|
303
306
|
returnObject: () => i.returnObject,
|
|
304
307
|
searchable: () => i.searchable,
|
|
305
308
|
filterOption: () => i.filterOption,
|
|
306
|
-
isDropdownOpen:
|
|
309
|
+
isDropdownOpen: H,
|
|
307
310
|
searchQuery: u
|
|
308
311
|
}), Ve = p(() => !!D["value-suffix"]), He = p(() => ({
|
|
309
312
|
disabled: i.disabled,
|
|
310
|
-
displayLabel:
|
|
311
|
-
})), Ue = p(() =>
|
|
312
|
-
if (!(
|
|
313
|
-
}), Ke = p(() =>
|
|
314
|
-
[
|
|
313
|
+
displayLabel: je.value
|
|
314
|
+
})), Ue = p(() => q.value.length > ke), We = p(() => X.value || Ue.value ? i.listHeight : "auto"), Ge = p(() => {
|
|
315
|
+
if (!(X.value || Ue.value)) return i.listHeight;
|
|
316
|
+
}), Ke = p(() => K.value.map((e) => Be(e))), qe = (e) => Ke.value.includes(e), Je = p(() => ({
|
|
317
|
+
[W.value]: Ae,
|
|
315
318
|
[i.itemDisabled]: !0
|
|
316
|
-
})), Ye = (e) =>
|
|
317
|
-
if (!
|
|
319
|
+
})), Ye = (e) => Be(I(e, W.value) ?? ""), Xe = p(() => {
|
|
320
|
+
if (!Z.value) return q.value;
|
|
318
321
|
let e = [], t = [];
|
|
319
|
-
for (let n of
|
|
320
|
-
return e.length === 0 || t.length === 0 ?
|
|
322
|
+
for (let n of q.value) qe(Ye(n)) ? e.push(n) : t.push(n);
|
|
323
|
+
return e.length === 0 || t.length === 0 ? q.value : [
|
|
321
324
|
...e,
|
|
322
325
|
Je.value,
|
|
323
326
|
...t
|
|
324
327
|
];
|
|
325
|
-
}), Ze = () => ({ tiny: !0 }), Qe = (e) =>
|
|
328
|
+
}), Ze = () => ({ tiny: !0 }), Qe = (e) => me({
|
|
326
329
|
listItemScope: e,
|
|
327
330
|
itemTitle: i.itemTitle,
|
|
328
331
|
itemSubtitle: i.itemSubtitle,
|
|
329
332
|
itemDisabled: i.itemDisabled,
|
|
330
333
|
itemIconLeft: i.itemIconLeft,
|
|
331
|
-
listActiveKey:
|
|
334
|
+
listActiveKey: V.value,
|
|
332
335
|
isOptionSelected: qe(e.key)
|
|
333
336
|
}), $e = (e) => {
|
|
334
|
-
let t =
|
|
335
|
-
if (
|
|
336
|
-
if (
|
|
337
|
-
|
|
337
|
+
let t = ze(e);
|
|
338
|
+
if (R(t)) {
|
|
339
|
+
if (Z.value) {
|
|
340
|
+
Re(t);
|
|
338
341
|
return;
|
|
339
342
|
}
|
|
340
343
|
l.value = void 0;
|
|
341
344
|
}
|
|
342
|
-
}, et = p(() => i.id ?? j), tt = p(() =>
|
|
343
|
-
labels:
|
|
344
|
-
values:
|
|
345
|
-
displayText:
|
|
345
|
+
}, et = p(() => i.id ?? j), tt = p(() => de), nt = p(() => fe.value?.fieldElementRef ?? null), rt = p(() => ({
|
|
346
|
+
labels: Me.value,
|
|
347
|
+
values: K.value,
|
|
348
|
+
displayText: Ne.value,
|
|
346
349
|
disabled: i.disabled || i.readonly,
|
|
347
|
-
removeValue:
|
|
350
|
+
removeValue: Re
|
|
348
351
|
})), it = p(() => {
|
|
349
|
-
if (!i.disabled && (i.readonly && !
|
|
352
|
+
if (!i.disabled && (i.readonly && !Ie.value || !Ie.value)) return 0;
|
|
350
353
|
}), at = p(() => ({
|
|
351
354
|
"s-ui-select--disabled": i.disabled,
|
|
352
355
|
"s-ui-select--readonly": i.readonly,
|
|
353
|
-
"s-ui-select--multiple":
|
|
354
|
-
"s-ui-select--open":
|
|
356
|
+
"s-ui-select--multiple": Z.value,
|
|
357
|
+
"s-ui-select--open": H.value
|
|
355
358
|
})), ot = () => {
|
|
356
|
-
if (
|
|
357
|
-
|
|
359
|
+
if (X.value) {
|
|
360
|
+
z.value?.focus();
|
|
358
361
|
return;
|
|
359
362
|
}
|
|
360
|
-
|
|
363
|
+
L.value?.focus();
|
|
361
364
|
}, st = async () => {
|
|
362
|
-
await w(),
|
|
365
|
+
await w(), z.value?.focus();
|
|
363
366
|
}, ct = async () => {
|
|
364
|
-
await w(), await
|
|
367
|
+
await w(), await B.value?.focusNavigation();
|
|
365
368
|
}, Q = async () => {
|
|
366
|
-
if (!(i.disabled || i.readonly) && !
|
|
367
|
-
if (
|
|
369
|
+
if (!(i.disabled || i.readonly) && !H.value) {
|
|
370
|
+
if (H.value = !0, b("open"), X.value) {
|
|
368
371
|
await st();
|
|
369
372
|
return;
|
|
370
373
|
}
|
|
371
|
-
if (
|
|
372
|
-
await w(),
|
|
374
|
+
if (Ie.value) {
|
|
375
|
+
await w(), L.value?.focus();
|
|
373
376
|
return;
|
|
374
377
|
}
|
|
375
378
|
await ct();
|
|
376
379
|
}
|
|
377
380
|
}, lt = async () => {
|
|
378
|
-
i.disabled || i.readonly ||
|
|
381
|
+
i.disabled || i.readonly || H.value || await Q();
|
|
379
382
|
};
|
|
380
|
-
|
|
381
|
-
|
|
383
|
+
P(u, async (e) => {
|
|
384
|
+
Ie.value && (i.disabled || i.readonly || e && (H.value || await Q()));
|
|
382
385
|
});
|
|
383
386
|
let $ = () => {
|
|
384
|
-
|
|
387
|
+
H.value && (H.value = !1, V.value = void 0, b("close"));
|
|
385
388
|
}, ut = () => {
|
|
386
|
-
!i.closeOnSelect ||
|
|
389
|
+
!i.closeOnSelect || Z.value || $();
|
|
387
390
|
};
|
|
388
|
-
|
|
389
|
-
!i.closeOnSelect ||
|
|
391
|
+
P(l, (e, t) => {
|
|
392
|
+
!i.closeOnSelect || Z.value || !H.value || !e || e === t || $();
|
|
390
393
|
});
|
|
391
394
|
let dt = (e) => {
|
|
392
|
-
|
|
395
|
+
H.value && e.target instanceof Element && e.target.closest(".s-ui-list-item") && ut();
|
|
393
396
|
}, ft = async (e) => {
|
|
394
|
-
e.key !== "Enter" && e.key !== " " && e.key !== "Spacebar" ||
|
|
397
|
+
e.key !== "Enter" && e.key !== " " && e.key !== "Spacebar" || H.value && (await w(), ut());
|
|
395
398
|
}, pt = async () => {
|
|
396
|
-
if (
|
|
399
|
+
if (H.value) {
|
|
397
400
|
$();
|
|
398
401
|
return;
|
|
399
402
|
}
|
|
@@ -401,19 +404,19 @@ var fe = {
|
|
|
401
404
|
}, mt = async (e) => {
|
|
402
405
|
if (!(i.disabled || i.readonly) && e.target instanceof HTMLElement) {
|
|
403
406
|
if (e.target.closest(".s-ui-select__search-input")) {
|
|
404
|
-
|
|
407
|
+
H.value || await Q();
|
|
405
408
|
return;
|
|
406
409
|
}
|
|
407
410
|
await pt();
|
|
408
411
|
}
|
|
409
|
-
}, ht = async (e) => e.key !== "ArrowDown" && e.key !== "ArrowUp" ? !1 : (e.preventDefault(), e.stopPropagation(),
|
|
410
|
-
let t =
|
|
412
|
+
}, ht = async (e) => e.key !== "ArrowDown" && e.key !== "ArrowUp" ? !1 : (e.preventDefault(), e.stopPropagation(), H.value || await Q(), await ct(), await B.value?.handleKeyboardNavigation(e), !0), gt = (e) => {
|
|
413
|
+
let t = ze(e);
|
|
411
414
|
if (t) {
|
|
412
|
-
if (
|
|
413
|
-
|
|
415
|
+
if (Z.value) {
|
|
416
|
+
K.value.some((t) => Be(t) === e) ? Re(t) : J.value = [...K.value.map((e) => Be(e)), e];
|
|
414
417
|
return;
|
|
415
418
|
}
|
|
416
|
-
|
|
419
|
+
J.value = e, ut();
|
|
417
420
|
}
|
|
418
421
|
}, _t = async (e) => {
|
|
419
422
|
if (!(i.disabled || i.readonly) && !await ht(e)) {
|
|
@@ -422,8 +425,8 @@ var fe = {
|
|
|
422
425
|
return;
|
|
423
426
|
}
|
|
424
427
|
if (e.key === "Enter" || e.key === " ") {
|
|
425
|
-
if (e.preventDefault(),
|
|
426
|
-
gt(
|
|
428
|
+
if (e.preventDefault(), H.value && V.value) {
|
|
429
|
+
gt(V.value);
|
|
427
430
|
return;
|
|
428
431
|
}
|
|
429
432
|
await pt();
|
|
@@ -436,13 +439,15 @@ var fe = {
|
|
|
436
439
|
}
|
|
437
440
|
await ht(e);
|
|
438
441
|
}, yt = vt, bt = (e) => {
|
|
439
|
-
i.disabled || (
|
|
442
|
+
i.disabled || (U.value || b("focus", e), U.value = !0);
|
|
440
443
|
}, xt = (e) => {
|
|
441
444
|
if (!(e.currentTarget instanceof HTMLElement)) return;
|
|
442
445
|
let t = e.relatedTarget;
|
|
443
|
-
t instanceof Node && e.currentTarget.contains(t) || (
|
|
446
|
+
t instanceof Node && e.currentTarget.contains(t) || (U.value = !1, b("blur", e));
|
|
444
447
|
}, St = () => {
|
|
445
|
-
|
|
448
|
+
Le(), b("clear");
|
|
449
|
+
}, Ct = (e) => {
|
|
450
|
+
b("endReached", e);
|
|
446
451
|
};
|
|
447
452
|
return o({
|
|
448
453
|
open: Q,
|
|
@@ -450,8 +455,8 @@ var fe = {
|
|
|
450
455
|
toggle: pt,
|
|
451
456
|
focusSearchInput: ot
|
|
452
457
|
}), (o, c) => (O(), g("div", { class: T(["s-ui-select", at.value]) }, [y(M(a), {
|
|
453
|
-
modelValue:
|
|
454
|
-
"onUpdate:modelValue": c[4] ||= (e) =>
|
|
458
|
+
modelValue: H.value,
|
|
459
|
+
"onUpdate:modelValue": c[4] ||= (e) => H.value = e,
|
|
455
460
|
reference: nt.value,
|
|
456
461
|
disabled: i.disabled,
|
|
457
462
|
"match-reference-width": !0,
|
|
@@ -460,43 +465,46 @@ var fe = {
|
|
|
460
465
|
"dismiss-on-click-outside": !0,
|
|
461
466
|
"dismiss-on-escape": !0
|
|
462
467
|
}, {
|
|
463
|
-
content:
|
|
468
|
+
content: F(() => [y(M(pe), {
|
|
464
469
|
class: "s-ui-select__menu",
|
|
465
470
|
width: "100%"
|
|
466
471
|
}, v({
|
|
467
|
-
default:
|
|
472
|
+
default: F(() => [_("div", {
|
|
468
473
|
class: "s-ui-select__menu-body",
|
|
469
474
|
onClick: dt,
|
|
470
475
|
onKeydown: ft
|
|
471
|
-
}, [M(
|
|
476
|
+
}, [M(q).length > 0 ? (O(), m(M(d), {
|
|
472
477
|
key: 0,
|
|
473
478
|
ref_key: "listElementRef",
|
|
474
|
-
ref:
|
|
475
|
-
modelValue:
|
|
476
|
-
"onUpdate:modelValue": c[2] ||= (e) =>
|
|
477
|
-
selected: M(
|
|
478
|
-
"onUpdate:selected": c[3] ||= (e) => te(
|
|
479
|
+
ref: B,
|
|
480
|
+
modelValue: V.value,
|
|
481
|
+
"onUpdate:modelValue": c[2] ||= (e) => V.value = e,
|
|
482
|
+
selected: M(J),
|
|
483
|
+
"onUpdate:selected": c[3] ||= (e) => te(J) ? J.value = e : null,
|
|
479
484
|
items: Xe.value,
|
|
480
|
-
"item-key":
|
|
485
|
+
"item-key": W.value,
|
|
481
486
|
"title-key": i.itemTitle,
|
|
482
487
|
"subtitle-key": i.itemSubtitle,
|
|
483
488
|
"icon-left-key": i.itemIconLeft,
|
|
484
489
|
"disabled-key": i.itemDisabled,
|
|
485
|
-
"selection-mode": M(
|
|
490
|
+
"selection-mode": M(ge),
|
|
486
491
|
mandatory: !i.multiple,
|
|
487
492
|
height: We.value,
|
|
488
493
|
"max-height": Ge.value,
|
|
489
494
|
virtual: Ue.value,
|
|
490
|
-
"item-props": Ze
|
|
491
|
-
|
|
495
|
+
"item-props": Ze,
|
|
496
|
+
"can-load-more": i.canLoadMore,
|
|
497
|
+
"end-reached-distance": i.endReachedDistance,
|
|
498
|
+
onEndReached: Ct
|
|
499
|
+
}, v({ _: 2 }, [M(D).option || M(D)["option-icon"] || i.closableOptions || M(Z) ? {
|
|
492
500
|
name: "item",
|
|
493
|
-
fn:
|
|
501
|
+
fn: F((a) => [a.key === Ae ? (O(), g("div", ye)) : M(D).option ? k(o.$slots, "option", E(C({ key: 1 }, a))) : i.closableOptions ? (O(), m(M(f), E(C({ key: 2 }, Qe(a))), v({ _: 2 }, [M(D)["option-icon"] ? {
|
|
494
502
|
name: "icon-left",
|
|
495
|
-
fn:
|
|
503
|
+
fn: F(() => [k(o.$slots, "option-icon", E(x(a)))]),
|
|
496
504
|
key: "0"
|
|
497
505
|
} : void 0, qe(a.key) ? {
|
|
498
506
|
name: "right",
|
|
499
|
-
fn:
|
|
507
|
+
fn: F((i) => [y(M(r), {
|
|
500
508
|
appearance: M(n).BARE,
|
|
501
509
|
variant: M(t).NEUTRAL,
|
|
502
510
|
size: M(e).SMALL,
|
|
@@ -504,7 +512,7 @@ var fe = {
|
|
|
504
512
|
"aria-label": M(S)("select.removeOption"),
|
|
505
513
|
disabled: i.disabled || i.readonly,
|
|
506
514
|
tabindex: -1,
|
|
507
|
-
onClick:
|
|
515
|
+
onClick: ce((e) => $e(a.key), ["stop"])
|
|
508
516
|
}, null, 8, [
|
|
509
517
|
"appearance",
|
|
510
518
|
"variant",
|
|
@@ -516,7 +524,7 @@ var fe = {
|
|
|
516
524
|
key: "1"
|
|
517
525
|
} : void 0]), 1040)) : (O(), m(M(f), E(C({ key: 3 }, Qe(a))), v({ _: 2 }, [M(D)["option-icon"] ? {
|
|
518
526
|
name: "icon-left",
|
|
519
|
-
fn:
|
|
527
|
+
fn: F(() => [k(o.$slots, "option-icon", E(x(a)))]),
|
|
520
528
|
key: "0"
|
|
521
529
|
} : void 0]), 1040))]),
|
|
522
530
|
key: "0"
|
|
@@ -533,32 +541,35 @@ var fe = {
|
|
|
533
541
|
"mandatory",
|
|
534
542
|
"height",
|
|
535
543
|
"max-height",
|
|
536
|
-
"virtual"
|
|
537
|
-
|
|
544
|
+
"virtual",
|
|
545
|
+
"can-load-more",
|
|
546
|
+
"end-reached-distance"
|
|
547
|
+
])) : (O(), g("div", be, [k(o.$slots, "empty", {}, () => [ee(A(M(S)("select.noOptions")), 1)])]))], 32)]),
|
|
538
548
|
_: 2
|
|
539
|
-
}, [M(
|
|
549
|
+
}, [M(X) || M(D)["panel-header"] ? {
|
|
540
550
|
name: "header",
|
|
541
|
-
fn:
|
|
551
|
+
fn: F(() => [k(o.$slots, "panel-header"), M(X) ? (O(), m(M(s), {
|
|
552
|
+
key: 0,
|
|
542
553
|
ref_key: "panelSearchInputElementRef",
|
|
543
|
-
ref:
|
|
554
|
+
ref: z,
|
|
544
555
|
modelValue: u.value,
|
|
545
556
|
"onUpdate:modelValue": c[0] ||= (e) => u.value = e,
|
|
546
557
|
placeholder: i.searchPlaceholder,
|
|
547
558
|
disabled: i.disabled,
|
|
548
559
|
clearable: !1,
|
|
549
560
|
"icon-left": "search",
|
|
550
|
-
onClick: c[1] ||=
|
|
561
|
+
onClick: c[1] ||= ce(() => {}, ["stop"]),
|
|
551
562
|
onKeydown: M(yt)
|
|
552
563
|
}, null, 8, [
|
|
553
564
|
"modelValue",
|
|
554
565
|
"placeholder",
|
|
555
566
|
"disabled",
|
|
556
567
|
"onKeydown"
|
|
557
|
-
])]),
|
|
568
|
+
])) : h("", !0)]),
|
|
558
569
|
key: "0"
|
|
559
570
|
} : void 0, M(D)["panel-footer"] ? {
|
|
560
571
|
name: "footer",
|
|
561
|
-
fn:
|
|
572
|
+
fn: F(() => [k(o.$slots, "panel-footer")]),
|
|
562
573
|
key: "1"
|
|
563
574
|
} : void 0]), 1024)]),
|
|
564
575
|
_: 3
|
|
@@ -570,9 +581,9 @@ var fe = {
|
|
|
570
581
|
"content-id"
|
|
571
582
|
]), y(M(s), {
|
|
572
583
|
ref_key: "triggerInputRef",
|
|
573
|
-
ref:
|
|
574
|
-
modelValue:
|
|
575
|
-
"onUpdate:modelValue": c[7] ||= (e) =>
|
|
584
|
+
ref: fe,
|
|
585
|
+
modelValue: he.value,
|
|
586
|
+
"onUpdate:modelValue": c[7] ||= (e) => he.value = e,
|
|
576
587
|
label: i.label,
|
|
577
588
|
"label-props": i.labelProps,
|
|
578
589
|
placeholder: i.placeholder,
|
|
@@ -582,8 +593,8 @@ var fe = {
|
|
|
582
593
|
disabled: i.disabled,
|
|
583
594
|
readonly: i.readonly,
|
|
584
595
|
clearable: i.clearable,
|
|
585
|
-
"has-value": M(
|
|
586
|
-
focused:
|
|
596
|
+
"has-value": M(_e),
|
|
597
|
+
focused: U.value || H.value,
|
|
587
598
|
"icon-left": i.iconLeft,
|
|
588
599
|
customize: i.customize,
|
|
589
600
|
name: i.name,
|
|
@@ -592,30 +603,30 @@ var fe = {
|
|
|
592
603
|
onFocus: bt,
|
|
593
604
|
onBlur: xt
|
|
594
605
|
}, v({
|
|
595
|
-
control:
|
|
606
|
+
control: F(() => [_("div", {
|
|
596
607
|
id: et.value,
|
|
597
608
|
class: T(["s-ui-select__control s-ui-typography-body-14-regular", {
|
|
598
|
-
"s-ui-select__control--multiple": M(
|
|
599
|
-
"s-ui-select__control--empty": M(
|
|
600
|
-
"s-ui-select__control--with-value-suffix": Ve.value && !M(
|
|
609
|
+
"s-ui-select__control--multiple": M(Z),
|
|
610
|
+
"s-ui-select__control--empty": M(Z) && !M(_e) && !M(Y),
|
|
611
|
+
"s-ui-select__control--with-value-suffix": Ve.value && !M(Z) && !M(Y) && !M(Pe)
|
|
601
612
|
}]),
|
|
602
613
|
role: "combobox",
|
|
603
|
-
"aria-expanded":
|
|
614
|
+
"aria-expanded": H.value,
|
|
604
615
|
"aria-controls": tt.value,
|
|
605
616
|
"aria-haspopup": "listbox",
|
|
606
617
|
"aria-disabled": i.disabled ? !0 : void 0,
|
|
607
618
|
"aria-readonly": i.readonly ? !0 : void 0,
|
|
608
|
-
"aria-autocomplete": M(
|
|
619
|
+
"aria-autocomplete": M(Fe) ? "list" : void 0,
|
|
609
620
|
tabindex: it.value,
|
|
610
621
|
onClick: mt,
|
|
611
622
|
onKeydown: _t
|
|
612
623
|
}, [
|
|
613
|
-
M(
|
|
614
|
-
Ve.value && !M(
|
|
615
|
-
M(
|
|
624
|
+
M(Z) ? k(o.$slots, "selection", E(C({ key: 0 }, rt.value)), () => [M(Ne) ? (O(), g("span", Se, A(M(Ne)), 1)) : M(Pe) && !M(Y) ? (O(), g("span", Ce, A(i.placeholder), 1)) : h("", !0)]) : M(Pe) && !M(Y) ? (O(), g("span", we, A(i.placeholder), 1)) : M(Y) ? h("", !0) : (O(), g("span", Te, A(M(je)), 1)),
|
|
625
|
+
Ve.value && !M(Z) && !M(Y) && !M(Pe) ? (O(), g("div", Ee, [k(o.$slots, "value-suffix", E(x(He.value)))])) : h("", !0),
|
|
626
|
+
M(Y) ? se((O(), g("input", {
|
|
616
627
|
key: 4,
|
|
617
628
|
ref_key: "searchInputElementRef",
|
|
618
|
-
ref:
|
|
629
|
+
ref: L,
|
|
619
630
|
"onUpdate:modelValue": c[5] ||= (e) => u.value = e,
|
|
620
631
|
class: "s-ui-select__search-input",
|
|
621
632
|
type: "text",
|
|
@@ -624,36 +635,36 @@ var fe = {
|
|
|
624
635
|
disabled: i.disabled,
|
|
625
636
|
readonly: i.readonly,
|
|
626
637
|
autocomplete: "off",
|
|
627
|
-
onClick: c[6] ||=
|
|
638
|
+
onClick: c[6] ||= ce(() => {}, ["stop"]),
|
|
628
639
|
onFocus: lt,
|
|
629
640
|
onKeydown: vt
|
|
630
|
-
}, null, 40,
|
|
631
|
-
], 42,
|
|
632
|
-
action:
|
|
641
|
+
}, null, 40, De)), [[oe, u.value]]) : h("", !0)
|
|
642
|
+
], 42, xe)]),
|
|
643
|
+
action: F(() => [y(M(le), {
|
|
633
644
|
name: "chevronMiniDown",
|
|
634
|
-
size:
|
|
645
|
+
size: Oe,
|
|
635
646
|
class: "s-ui-select__chevron"
|
|
636
647
|
})]),
|
|
637
648
|
_: 2
|
|
638
649
|
}, [
|
|
639
650
|
M(D).label ? {
|
|
640
651
|
name: "label",
|
|
641
|
-
fn:
|
|
652
|
+
fn: F(() => [k(o.$slots, "label")]),
|
|
642
653
|
key: "0"
|
|
643
654
|
} : void 0,
|
|
644
655
|
M(D).prefix ? {
|
|
645
656
|
name: "prefix",
|
|
646
|
-
fn:
|
|
657
|
+
fn: F((e) => [k(o.$slots, "prefix", E(x(e)))]),
|
|
647
658
|
key: "1"
|
|
648
659
|
} : void 0,
|
|
649
660
|
M(D).prepend ? {
|
|
650
661
|
name: "prepend",
|
|
651
|
-
fn:
|
|
662
|
+
fn: F((e) => [k(o.$slots, "prepend", E(x(e)))]),
|
|
652
663
|
key: "2"
|
|
653
664
|
} : void 0,
|
|
654
665
|
M(D).message ? {
|
|
655
666
|
name: "message",
|
|
656
|
-
fn:
|
|
667
|
+
fn: F(() => [k(o.$slots, "message")]),
|
|
657
668
|
key: "3"
|
|
658
669
|
} : void 0
|
|
659
670
|
]), 1032, [
|
|
@@ -677,4 +688,4 @@ var fe = {
|
|
|
677
688
|
}
|
|
678
689
|
});
|
|
679
690
|
//#endregion
|
|
680
|
-
export {
|
|
691
|
+
export { H as n, pe as r, je as t };
|