@shtabapp/ui-kit 1.78.1 → 1.78.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/CHANGELOG.md +12 -0
- package/dist/{SColorPicker-XXyDOuDg.js → SColorPicker-CIAkM4kx.js} +2 -2
- package/dist/{SColorPicker-CcPnyXE0.cjs → SColorPicker-Dac8mDye.cjs} +1 -1
- package/dist/{SDropdown-B8Z4oNMk.cjs → SDropdown-CPfoNHbg.cjs} +1 -1
- package/dist/{SDropdown-cNmJ5Lrz.js → SDropdown-DvPW3_WP.js} +1 -1
- package/dist/{SSelect-Bn4kifqp.js → SSelect-BznJn8Q8.js} +216 -205
- package/dist/SSelect-CB2XQ4dU.cjs +1 -0
- package/dist/{STable-CUh1kgNm.js → STable-CZit5zNX.js} +1 -1
- package/dist/{STable-BwKAn_4M.cjs → STable-D8lU4Xu-.cjs} +1 -1
- package/dist/components/SDropdown/SDropdown.types.d.ts +1 -1
- package/dist/components/SDropdown/SDropdown.types.d.ts.map +1 -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/dropdown.cjs +1 -1
- package/dist/entries/dropdown.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/entries/table.cjs +1 -1
- package/dist/entries/table.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/uikit-components.css +1 -1
- package/package.json +1 -1
- package/dist/SSelect-DyngcoP9.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { i as e, n as t, r as n, t as r } from "./SButton-DIWMMCSc.js";
|
|
2
2
|
import { n as i } from "./useSelectionGroup-BCAmPf3R.js";
|
|
3
3
|
import { t as a } from "./useAriaAttrs-CxGRTeye.js";
|
|
4
|
-
import { t as o } from "./SDropdown-
|
|
4
|
+
import { t as o } from "./SDropdown-DvPW3_WP.js";
|
|
5
5
|
import { t as s } from "./SDropdownMenu-2koPU6IG.js";
|
|
6
6
|
import { n as c, r as l, t as u } from "./SInput-CGlUBCkW.js";
|
|
7
7
|
import { t as d } from "./SListItem-CDlsjhA3.js";
|
|
8
8
|
import { i as f, n as p, r as m, t as ee } from "./SList-BuuCfuHg.js";
|
|
9
|
-
import { computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createSlots as b, createTextVNode as te, createVNode as x, defineComponent as S, guardReactiveProps as C, isRef as ne, mergeModels as w, mergeProps as T, nextTick as E, normalizeProps as D, openBlock as O, ref as k, renderSlot as A, toDisplayString as j, toValue as M, unref as N, useId as re, useModel as ie, useSlots as ae, useTemplateRef as oe, vModelText as se, watch as
|
|
10
|
-
import { SIcon as
|
|
9
|
+
import { computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createSlots as b, createTextVNode as te, createVNode as x, defineComponent as S, guardReactiveProps as C, isRef as ne, mergeModels as w, mergeProps as T, nextTick as E, normalizeProps as D, openBlock as O, ref as k, renderSlot as A, toDisplayString as j, toValue as M, unref as N, useId as re, useModel as ie, useSlots as ae, useTemplateRef as oe, vModelText as se, watch as P, withCtx as F, withDirectives as ce, withModifiers as le } from "vue";
|
|
10
|
+
import { SIcon as ue, useUiKitI18n as de } from "@shtabapp/ui-kit-primitives";
|
|
11
11
|
//#region src/components/SSelect/utils/buildSelectListItemProps.ts
|
|
12
|
-
var
|
|
12
|
+
var fe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, itemIconLeft: i, listActiveKey: a, isOptionSelected: o }) => {
|
|
13
13
|
let s = e.item;
|
|
14
14
|
return {
|
|
15
15
|
rowKey: e.key,
|
|
@@ -22,55 +22,55 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
22
22
|
revealRight: e.revealRight,
|
|
23
23
|
tiny: !0
|
|
24
24
|
};
|
|
25
|
-
},
|
|
25
|
+
}, pe = (e) => typeof e == "string" || typeof e == "number", I = (e, t) => {
|
|
26
26
|
let n = e[t];
|
|
27
|
-
if (
|
|
28
|
-
},
|
|
29
|
-
let r =
|
|
30
|
-
if (r) return
|
|
31
|
-
},
|
|
27
|
+
if (pe(n)) return n;
|
|
28
|
+
}, L = (e) => typeof e == "string" ? e : String(e), R = (e) => e == null ? !1 : typeof e == "string" ? e.length > 0 : !0, me = (e, t, n) => t.find((t) => L(I(t, n) ?? "") === e), he = (e) => typeof e == "object" && !!e, z = (e, t, n) => {
|
|
29
|
+
let r = me(e, t, n);
|
|
30
|
+
if (r) return I(r, n);
|
|
31
|
+
}, B = /* @__PURE__ */ function(e) {
|
|
32
32
|
return e.INPUT = "input", e.CONTENT = "content", e;
|
|
33
|
-
}({}),
|
|
33
|
+
}({}), V = (e, t, n) => {
|
|
34
34
|
if (!e) return !0;
|
|
35
|
-
let r = e.toLocaleLowerCase(), i = f(t, n.itemTitle)?.toLocaleLowerCase() ?? "", a = I(
|
|
35
|
+
let r = e.toLocaleLowerCase(), i = f(t, n.itemTitle)?.toLocaleLowerCase() ?? "", a = L(I(t, n.itemValue) ?? "").toLocaleLowerCase();
|
|
36
36
|
return i.includes(r) || a.includes(r);
|
|
37
|
-
},
|
|
38
|
-
let i = r ?? ((e, t) =>
|
|
37
|
+
}, H = (e, t, n, r) => {
|
|
38
|
+
let i = r ?? ((e, t) => V(e, t, n));
|
|
39
39
|
return t ? e.filter((e) => i(t, e)) : [...e];
|
|
40
|
-
},
|
|
40
|
+
}, U = (e) => typeof e == "string" && R(e), W = (e) => typeof e == "number" && R(e), G = (e, t, n) => {
|
|
41
41
|
if (t) {
|
|
42
|
-
if (!
|
|
43
|
-
let t =
|
|
44
|
-
return
|
|
42
|
+
if (!he(e)) return;
|
|
43
|
+
let t = I(e, n);
|
|
44
|
+
return U(t) || W(t) ? t : void 0;
|
|
45
45
|
}
|
|
46
46
|
let r = typeof e == "string" || typeof e == "number" ? e : void 0;
|
|
47
|
-
if (
|
|
48
|
-
},
|
|
49
|
-
let r =
|
|
50
|
-
return
|
|
51
|
-
}) : [],
|
|
52
|
-
if (
|
|
47
|
+
if (U(r) || W(r)) return r;
|
|
48
|
+
}, K = (e, t, n) => e ? (Array.isArray(e) ? e : [e]).flatMap((e) => {
|
|
49
|
+
let r = G(e, t, n);
|
|
50
|
+
return R(r) ? [r] : [];
|
|
51
|
+
}) : [], ge = (e, t) => {
|
|
52
|
+
if (U(t)) {
|
|
53
53
|
e.value = t;
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
if (
|
|
56
|
+
if (W(t)) {
|
|
57
57
|
e.value = t;
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
e.value = void 0;
|
|
61
|
-
},
|
|
62
|
-
let r =
|
|
61
|
+
}, _e = (e, t, n) => t.flatMap((t) => {
|
|
62
|
+
let r = L(t), i = e.find((e) => L(I(e, n) ?? "") === r);
|
|
63
63
|
return i ? [i] : [];
|
|
64
|
-
}),
|
|
65
|
-
let u = h(() => M(r)), d = h(() => M(a)), p = h(() => M(o) ===
|
|
64
|
+
}), ve = ({ modelValue: e, options: t, itemFields: n, multiple: r, returnObject: a, searchable: o, filterOption: s, isDropdownOpen: c, searchQuery: l }) => {
|
|
65
|
+
let u = h(() => M(r)), d = h(() => M(a)), p = h(() => M(o) === B.INPUT), m = h(() => M(o) === B.CONTENT), ee = h(() => !!M(o)), g = h(() => {
|
|
66
66
|
let t = M(n);
|
|
67
|
-
return
|
|
67
|
+
return K(e.value, d.value, t.itemValue);
|
|
68
68
|
}), _ = h(() => {
|
|
69
69
|
let e = M(t), r = M(n);
|
|
70
|
-
return
|
|
70
|
+
return H(e, ee.value ? l.value : "", r, M(s));
|
|
71
71
|
}), v = h(() => u.value ? i.MULTIPLE : i.SINGLE), y = (t, n, r) => {
|
|
72
72
|
if (d.value) {
|
|
73
|
-
e.value =
|
|
73
|
+
e.value = _e(n, t, r);
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
e.value = t;
|
|
@@ -80,44 +80,44 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
if (d.value) {
|
|
83
|
-
e.value =
|
|
83
|
+
e.value = me(t, n, r) ?? void 0;
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
ge(e, z(t, n, r));
|
|
87
87
|
}, te = h({
|
|
88
88
|
get: () => {
|
|
89
|
-
if (u.value) return g.value.map((e) =>
|
|
89
|
+
if (u.value) return g.value.map((e) => L(e));
|
|
90
90
|
let e = g.value[0];
|
|
91
|
-
if (
|
|
91
|
+
if (R(e)) return L(e);
|
|
92
92
|
},
|
|
93
93
|
set: (e) => {
|
|
94
94
|
let r = M(t), i = M(n);
|
|
95
95
|
if (u.value) {
|
|
96
|
-
y((Array.isArray(e) ? e : []).map((e) =>
|
|
96
|
+
y((Array.isArray(e) ? e : []).map((e) => z(e, r, i.itemValue)).filter((e) => R(e)), r, i.itemValue);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
b(typeof e == "string" ? e : void 0, r, i.itemValue);
|
|
100
100
|
}
|
|
101
101
|
}), x = h(() => g.value.length > 0), S = (e, t, n) => {
|
|
102
|
-
let r =
|
|
103
|
-
return e.find((e) => I(
|
|
102
|
+
let r = L(t);
|
|
103
|
+
return e.find((e) => L(I(e, n) ?? "") === r);
|
|
104
104
|
}, C = h(() => {
|
|
105
105
|
let e = g.value[0];
|
|
106
|
-
if (!
|
|
106
|
+
if (!R(e)) return "";
|
|
107
107
|
let r = M(n), i = S(M(t), e, r.itemValue);
|
|
108
|
-
return i ? f(i, r.itemTitle) ?? "" :
|
|
108
|
+
return i ? f(i, r.itemTitle) ?? "" : L(e);
|
|
109
109
|
}), ne = h(() => {
|
|
110
110
|
let e = M(t), r = M(n);
|
|
111
111
|
return g.value.map((t) => {
|
|
112
112
|
let n = S(e, t, r.itemValue);
|
|
113
|
-
return n ? f(n, r.itemTitle) ?? "" :
|
|
113
|
+
return n ? f(n, r.itemTitle) ?? "" : L(t);
|
|
114
114
|
});
|
|
115
115
|
}), w = h(() => ne.value.join(", ")), T = h(() => u.value ? g.value.length === 0 : !C.value), E = h(() => p.value && (c.value || u.value)), D = () => {
|
|
116
116
|
l.value = "";
|
|
117
117
|
};
|
|
118
|
-
return
|
|
118
|
+
return P(c, (e) => {
|
|
119
119
|
e || D();
|
|
120
|
-
}),
|
|
120
|
+
}), P(() => M(o), () => {
|
|
121
121
|
D();
|
|
122
122
|
}), {
|
|
123
123
|
searchQuery: l,
|
|
@@ -140,17 +140,17 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
140
140
|
e.value = void 0, D();
|
|
141
141
|
},
|
|
142
142
|
removeSelectedValue: (e) => {
|
|
143
|
-
let r =
|
|
144
|
-
y(g.value.filter((e) =>
|
|
143
|
+
let r = L(e);
|
|
144
|
+
y(g.value.filter((e) => L(e) !== r), M(t), M(n).itemValue);
|
|
145
145
|
},
|
|
146
146
|
resetSearchQuery: D,
|
|
147
|
-
formatSelectListKey:
|
|
148
|
-
resolveValueFromListKey: (e) =>
|
|
147
|
+
formatSelectListKey: L,
|
|
148
|
+
resolveValueFromListKey: (e) => z(e, M(t), M(n).itemValue)
|
|
149
149
|
};
|
|
150
|
-
},
|
|
150
|
+
}, ye = {
|
|
151
151
|
key: 1,
|
|
152
152
|
class: "s-ui-select__empty s-ui-typography-body-14-regular"
|
|
153
|
-
},
|
|
153
|
+
}, be = [
|
|
154
154
|
"id",
|
|
155
155
|
"aria-expanded",
|
|
156
156
|
"aria-controls",
|
|
@@ -158,27 +158,27 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
158
158
|
"aria-readonly",
|
|
159
159
|
"aria-autocomplete",
|
|
160
160
|
"tabindex"
|
|
161
|
-
],
|
|
161
|
+
], xe = {
|
|
162
162
|
key: 0,
|
|
163
163
|
class: "s-ui-select__value"
|
|
164
|
-
},
|
|
164
|
+
}, Se = {
|
|
165
165
|
key: 1,
|
|
166
166
|
class: "s-ui-select__placeholder"
|
|
167
|
-
},
|
|
167
|
+
}, Ce = {
|
|
168
168
|
key: 1,
|
|
169
169
|
class: "s-ui-select__placeholder"
|
|
170
|
-
},
|
|
170
|
+
}, we = {
|
|
171
171
|
key: 2,
|
|
172
172
|
class: "s-ui-select__value"
|
|
173
|
-
},
|
|
173
|
+
}, Te = {
|
|
174
174
|
key: 3,
|
|
175
175
|
class: "s-ui-select__value-suffix"
|
|
176
|
-
},
|
|
176
|
+
}, Ee = [
|
|
177
177
|
"name",
|
|
178
178
|
"placeholder",
|
|
179
179
|
"disabled",
|
|
180
180
|
"readonly"
|
|
181
|
-
],
|
|
181
|
+
], De = 20, Oe = "100%", ke = 20, Ae = /* @__PURE__ */ S({
|
|
182
182
|
inheritAttrs: !1,
|
|
183
183
|
__name: "SSelect",
|
|
184
184
|
props: /*@__PURE__*/ w({
|
|
@@ -260,218 +260,229 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
260
260
|
"endReached"
|
|
261
261
|
], ["update:modelValue", "update:searchQuery"]),
|
|
262
262
|
setup(i, { expose: l, emit: f }) {
|
|
263
|
-
let p = ie(i, "modelValue"), m = ie(i, "searchQuery"), S = f, { t: w } =
|
|
263
|
+
let p = ie(i, "modelValue"), m = ie(i, "searchQuery"), S = f, { t: w } = de(), M = ae(), { getRootAttrs: pe, getAriaAttrs: I, getAriaAttr: L } = a(), me = re(), he = re(), z = oe("triggerInputRef"), B = k(""), V = oe("searchInputElementRef"), H = oe("panelSearchInputElementRef"), U = oe("listElementRef"), W = k(), G = k(!1), K = k(!1), ge = h(() => i.panelWidth === void 0), _e = h(() => i.panelWidth ?? Oe), Ae = h(() => i.itemId ?? i.itemValue), je = h(() => ({
|
|
264
264
|
itemValue: i.itemValue,
|
|
265
265
|
itemTitle: i.itemTitle,
|
|
266
266
|
itemSubtitle: i.itemSubtitle,
|
|
267
|
-
itemId:
|
|
268
|
-
})), { selectedValues:
|
|
267
|
+
itemId: Ae.value
|
|
268
|
+
})), { selectedValues: q, filteredOptions: Me, listSelectionMode: Ne, listSelectedModel: J, hasSelectedValues: Pe, singleDisplayLabel: Fe, multipleDisplayLabels: Ie, multipleDisplayText: Le, showPlaceholder: Re, showInputSearchField: Y, isSearchableMode: ze, isSearchableInputMode: Be, isSearchableContentMode: X, isMultipleMode: Z, clearSelection: Ve, removeSelectedValue: He, resolveValueFromListKey: Ue, formatSelectListKey: We } = ve({
|
|
269
269
|
modelValue: p,
|
|
270
270
|
options: () => i.options,
|
|
271
|
-
itemFields: () =>
|
|
271
|
+
itemFields: () => je.value,
|
|
272
272
|
multiple: () => i.multiple,
|
|
273
273
|
returnObject: () => i.returnObject,
|
|
274
274
|
searchable: () => i.searchable,
|
|
275
275
|
filterOption: () => i.filterOption,
|
|
276
|
-
isDropdownOpen:
|
|
276
|
+
isDropdownOpen: G,
|
|
277
277
|
searchQuery: m
|
|
278
278
|
}), Ge = h(() => ({
|
|
279
279
|
disabled: i.disabled,
|
|
280
|
-
displayLabel:
|
|
281
|
-
})), Ke = h(() =>
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
displayLabel: Fe.value
|
|
281
|
+
})), Ke = h(() => Me.value.length > ke), qe = k();
|
|
282
|
+
P(m, (e, t) => {
|
|
283
|
+
if (!e) {
|
|
284
|
+
qe.value = void 0;
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if (!t && X.value && !Ke.value) {
|
|
288
|
+
let e = U.value?.$el;
|
|
289
|
+
qe.value = e instanceof HTMLElement ? e.offsetHeight : void 0;
|
|
290
|
+
}
|
|
291
|
+
}, { flush: "pre" });
|
|
292
|
+
let Je = h(() => Ke.value ? i.listHeight : qe.value ?? "auto"), Ye = h(() => {
|
|
293
|
+
if (!Ke.value) return i.listHeight;
|
|
294
|
+
}), Xe = h(() => q.value.map((e) => We(e))), Ze = (e) => Xe.value.includes(e), Qe = () => ({ tiny: !0 }), $e = (e) => fe({
|
|
284
295
|
listItemScope: e,
|
|
285
296
|
itemTitle: i.itemTitle,
|
|
286
297
|
itemSubtitle: i.itemSubtitle,
|
|
287
298
|
itemDisabled: i.itemDisabled,
|
|
288
299
|
itemIconLeft: i.itemIconLeft,
|
|
289
|
-
listActiveKey:
|
|
290
|
-
isOptionSelected:
|
|
291
|
-
}),
|
|
300
|
+
listActiveKey: W.value,
|
|
301
|
+
isOptionSelected: Ze(e.key)
|
|
302
|
+
}), et = (e) => {
|
|
292
303
|
let t = Ue(e);
|
|
293
|
-
if (
|
|
304
|
+
if (R(t)) {
|
|
294
305
|
if (Z.value) {
|
|
295
306
|
He(t);
|
|
296
307
|
return;
|
|
297
308
|
}
|
|
298
309
|
p.value = void 0;
|
|
299
310
|
}
|
|
300
|
-
},
|
|
301
|
-
let e =
|
|
311
|
+
}, tt = h(() => i.id ?? me), nt = h(() => he), rt = h(() => c(tt.value)), it = () => {
|
|
312
|
+
let e = L("aria-label"), t = L("aria-labelledby");
|
|
302
313
|
return e || t ? {
|
|
303
314
|
"aria-label": e,
|
|
304
315
|
"aria-labelledby": t
|
|
305
|
-
} : i.label || M.label ? { "aria-labelledby":
|
|
306
|
-
},
|
|
307
|
-
...
|
|
308
|
-
...
|
|
309
|
-
}),
|
|
310
|
-
labels:
|
|
311
|
-
values:
|
|
312
|
-
displayText:
|
|
316
|
+
} : i.label || M.label ? { "aria-labelledby": rt.value } : i.placeholder ? { "aria-label": i.placeholder } : {};
|
|
317
|
+
}, at = () => ({
|
|
318
|
+
...I(),
|
|
319
|
+
...it()
|
|
320
|
+
}), ot = h(() => z.value?.fieldElementRef ?? null), st = h(() => ({
|
|
321
|
+
labels: Ie.value,
|
|
322
|
+
values: q.value,
|
|
323
|
+
displayText: Le.value,
|
|
313
324
|
disabled: i.disabled || i.readonly,
|
|
314
325
|
removeValue: He
|
|
315
|
-
})),
|
|
326
|
+
})), ct = h(() => {
|
|
316
327
|
if (!i.disabled && (i.readonly && !Be.value || !Be.value)) return 0;
|
|
317
|
-
}),
|
|
328
|
+
}), lt = h(() => ({
|
|
318
329
|
"s-ui-select--disabled": i.disabled,
|
|
319
330
|
"s-ui-select--readonly": i.readonly,
|
|
320
331
|
"s-ui-select--multiple": Z.value,
|
|
321
|
-
"s-ui-select--open":
|
|
322
|
-
})),
|
|
332
|
+
"s-ui-select--open": G.value
|
|
333
|
+
})), ut = () => {
|
|
323
334
|
if (X.value) {
|
|
324
|
-
|
|
335
|
+
H.value?.focus();
|
|
325
336
|
return;
|
|
326
337
|
}
|
|
327
|
-
|
|
328
|
-
}, ut = async () => {
|
|
329
|
-
await E(), V.value?.focus();
|
|
338
|
+
V.value?.focus();
|
|
330
339
|
}, dt = async () => {
|
|
331
|
-
await E(),
|
|
340
|
+
await E(), H.value?.focus();
|
|
341
|
+
}, ft = async () => {
|
|
342
|
+
await E(), await U.value?.focusNavigation();
|
|
332
343
|
}, Q = async () => {
|
|
333
|
-
if (!(i.disabled || i.readonly) && !
|
|
334
|
-
if (
|
|
335
|
-
await
|
|
344
|
+
if (!(i.disabled || i.readonly) && !G.value) {
|
|
345
|
+
if (G.value = !0, S("open"), X.value) {
|
|
346
|
+
await dt();
|
|
336
347
|
return;
|
|
337
348
|
}
|
|
338
349
|
if (Be.value) {
|
|
339
|
-
await E(),
|
|
350
|
+
await E(), V.value?.focus();
|
|
340
351
|
return;
|
|
341
352
|
}
|
|
342
|
-
await
|
|
353
|
+
await ft();
|
|
343
354
|
}
|
|
344
|
-
},
|
|
345
|
-
i.disabled || i.readonly ||
|
|
355
|
+
}, pt = async () => {
|
|
356
|
+
i.disabled || i.readonly || G.value || await Q();
|
|
346
357
|
};
|
|
347
|
-
|
|
348
|
-
Be.value && (i.disabled || i.readonly || e && (
|
|
358
|
+
P(m, async (e) => {
|
|
359
|
+
Be.value && (i.disabled || i.readonly || e && (G.value || await Q()));
|
|
349
360
|
});
|
|
350
361
|
let $ = () => {
|
|
351
|
-
|
|
352
|
-
},
|
|
362
|
+
G.value && (G.value = !1, W.value = void 0, S("close"));
|
|
363
|
+
}, mt = () => {
|
|
353
364
|
!i.closeOnSelect || Z.value || $();
|
|
354
365
|
};
|
|
355
|
-
|
|
356
|
-
!i.closeOnSelect || Z.value || !
|
|
366
|
+
P(p, (e, t) => {
|
|
367
|
+
!i.closeOnSelect || Z.value || !G.value || !e || e === t || $();
|
|
357
368
|
});
|
|
358
|
-
let
|
|
359
|
-
|
|
360
|
-
},
|
|
361
|
-
e.key !== "Enter" && e.key !== " " && e.key !== "Spacebar" ||
|
|
362
|
-
},
|
|
363
|
-
if (
|
|
369
|
+
let ht = (e) => {
|
|
370
|
+
G.value && e.target instanceof Element && e.target.closest(".s-ui-list-item") && mt();
|
|
371
|
+
}, gt = async (e) => {
|
|
372
|
+
e.key !== "Enter" && e.key !== " " && e.key !== "Spacebar" || G.value && (await E(), mt());
|
|
373
|
+
}, _t = async () => {
|
|
374
|
+
if (G.value) {
|
|
364
375
|
$();
|
|
365
376
|
return;
|
|
366
377
|
}
|
|
367
378
|
await Q();
|
|
368
|
-
},
|
|
379
|
+
}, vt = async (e) => {
|
|
369
380
|
if (!(i.disabled || i.readonly) && e.target instanceof HTMLElement) {
|
|
370
381
|
if (e.target.closest(".s-ui-select__search-input")) {
|
|
371
|
-
|
|
382
|
+
G.value || await Q();
|
|
372
383
|
return;
|
|
373
384
|
}
|
|
374
|
-
await
|
|
385
|
+
await _t();
|
|
375
386
|
}
|
|
376
|
-
},
|
|
377
|
-
i.disabled || i.readonly || await
|
|
378
|
-
},
|
|
387
|
+
}, yt = async () => {
|
|
388
|
+
i.disabled || i.readonly || await _t();
|
|
389
|
+
}, bt = async (e) => e.key !== "ArrowDown" && e.key !== "ArrowUp" ? !1 : (e.preventDefault(), e.stopPropagation(), G.value || await Q(), await ft(), await U.value?.handleKeyboardNavigation(e), !0), xt = (e) => {
|
|
379
390
|
let t = Ue(e);
|
|
380
391
|
if (t) {
|
|
381
392
|
if (Z.value) {
|
|
382
|
-
|
|
393
|
+
q.value.some((t) => We(t) === e) ? He(t) : J.value = [...q.value.map((e) => We(e)), e];
|
|
383
394
|
return;
|
|
384
395
|
}
|
|
385
|
-
|
|
396
|
+
J.value = e, mt();
|
|
386
397
|
}
|
|
387
|
-
},
|
|
388
|
-
if (!(i.disabled || i.readonly) && !await
|
|
398
|
+
}, St = async (e) => {
|
|
399
|
+
if (!(i.disabled || i.readonly) && !await bt(e)) {
|
|
389
400
|
if (e.key === "Escape") {
|
|
390
401
|
e.preventDefault(), $();
|
|
391
402
|
return;
|
|
392
403
|
}
|
|
393
404
|
if (e.key === "Enter" || e.key === " ") {
|
|
394
|
-
if (e.preventDefault(),
|
|
395
|
-
|
|
405
|
+
if (e.preventDefault(), G.value && W.value) {
|
|
406
|
+
xt(W.value);
|
|
396
407
|
return;
|
|
397
408
|
}
|
|
398
|
-
await
|
|
409
|
+
await _t();
|
|
399
410
|
}
|
|
400
411
|
}
|
|
401
|
-
},
|
|
412
|
+
}, Ct = async (e) => {
|
|
402
413
|
if (e.key === "Escape") {
|
|
403
414
|
e.preventDefault(), $();
|
|
404
415
|
return;
|
|
405
416
|
}
|
|
406
|
-
await
|
|
407
|
-
},
|
|
408
|
-
i.disabled || (
|
|
409
|
-
},
|
|
417
|
+
await bt(e);
|
|
418
|
+
}, wt = Ct, Tt = (e) => {
|
|
419
|
+
i.disabled || (K.value || S("focus", e), K.value = !0);
|
|
420
|
+
}, Et = (e) => {
|
|
410
421
|
if (!(e.currentTarget instanceof HTMLElement)) return;
|
|
411
422
|
let t = e.relatedTarget;
|
|
412
|
-
t instanceof Node && e.currentTarget.contains(t) || (
|
|
413
|
-
},
|
|
423
|
+
t instanceof Node && e.currentTarget.contains(t) || (K.value = !1, S("blur", e));
|
|
424
|
+
}, Dt = () => {
|
|
414
425
|
Ve(), S("clear");
|
|
415
|
-
},
|
|
426
|
+
}, Ot = (e) => {
|
|
416
427
|
S("endReached", e);
|
|
417
428
|
};
|
|
418
429
|
return l({
|
|
419
430
|
open: Q,
|
|
420
431
|
close: $,
|
|
421
|
-
toggle:
|
|
422
|
-
focusSearchInput:
|
|
423
|
-
}), (a, c) => (O(), v("div", T({ class: ["s-ui-select",
|
|
424
|
-
modelValue:
|
|
425
|
-
"onUpdate:modelValue": c[4] ||= (e) =>
|
|
426
|
-
reference:
|
|
432
|
+
toggle: _t,
|
|
433
|
+
focusSearchInput: ut
|
|
434
|
+
}), (a, c) => (O(), v("div", T({ class: ["s-ui-select", lt.value] }, N(pe)()), [x(N(o), {
|
|
435
|
+
modelValue: G.value,
|
|
436
|
+
"onUpdate:modelValue": c[4] ||= (e) => G.value = e,
|
|
437
|
+
reference: ot.value,
|
|
427
438
|
disabled: i.disabled,
|
|
428
|
-
"match-reference-width":
|
|
439
|
+
"match-reference-width": ge.value,
|
|
429
440
|
"fit-viewport": i.fitViewport,
|
|
430
441
|
"surface-class": i.surfaceClass,
|
|
431
|
-
"content-id":
|
|
442
|
+
"content-id": nt.value,
|
|
432
443
|
"dismiss-on-click-outside": !0,
|
|
433
444
|
"dismiss-on-escape": !0
|
|
434
445
|
}, {
|
|
435
|
-
content:
|
|
446
|
+
content: F(() => [x(N(s), {
|
|
436
447
|
class: "s-ui-select__menu",
|
|
437
|
-
width:
|
|
448
|
+
width: _e.value
|
|
438
449
|
}, b({
|
|
439
|
-
default:
|
|
450
|
+
default: F(() => [y("div", {
|
|
440
451
|
class: "s-ui-select__menu-body",
|
|
441
|
-
onClick:
|
|
442
|
-
onKeydown:
|
|
443
|
-
}, [N(
|
|
452
|
+
onClick: ht,
|
|
453
|
+
onKeydown: gt
|
|
454
|
+
}, [N(Me).length > 0 ? (O(), g(N(ee), T({
|
|
444
455
|
key: 0,
|
|
445
456
|
ref_key: "listElementRef",
|
|
446
|
-
ref:
|
|
447
|
-
modelValue:
|
|
448
|
-
"onUpdate:modelValue": c[2] ||= (e) =>
|
|
449
|
-
selected: N(
|
|
450
|
-
"onUpdate:selected": c[3] ||= (e) => ne(
|
|
451
|
-
items: N(
|
|
452
|
-
"item-key":
|
|
457
|
+
ref: U,
|
|
458
|
+
modelValue: W.value,
|
|
459
|
+
"onUpdate:modelValue": c[2] ||= (e) => W.value = e,
|
|
460
|
+
selected: N(J),
|
|
461
|
+
"onUpdate:selected": c[3] ||= (e) => ne(J) ? J.value = e : null,
|
|
462
|
+
items: N(Me),
|
|
463
|
+
"item-key": Ae.value,
|
|
453
464
|
"title-key": i.itemTitle,
|
|
454
465
|
"subtitle-key": i.itemSubtitle,
|
|
455
466
|
"icon-left-key": i.itemIconLeft,
|
|
456
467
|
"disabled-key": i.itemDisabled,
|
|
457
|
-
"selection-mode": N(
|
|
468
|
+
"selection-mode": N(Ne),
|
|
458
469
|
mandatory: !i.multiple,
|
|
459
|
-
height:
|
|
460
|
-
"max-height":
|
|
470
|
+
height: Je.value,
|
|
471
|
+
"max-height": Ye.value,
|
|
461
472
|
virtual: Ke.value,
|
|
462
|
-
"item-props":
|
|
473
|
+
"item-props": Qe,
|
|
463
474
|
"selected-on-top": N(Z),
|
|
464
475
|
"can-load-more": i.canLoadMore,
|
|
465
476
|
"end-reached-distance": i.endReachedDistance
|
|
466
|
-
},
|
|
477
|
+
}, it(), { onEndReached: Ot }), b({ _: 2 }, [N(M).option || N(M)["option-icon"] || i.closableOptions || N(Z) ? {
|
|
467
478
|
name: "item",
|
|
468
|
-
fn:
|
|
479
|
+
fn: F((o) => [N(M).option ? A(a.$slots, "option", D(T({ key: 0 }, o))) : i.closableOptions ? (O(), g(N(d), D(T({ key: 1 }, $e(o))), b({ _: 2 }, [N(M)["option-icon"] ? {
|
|
469
480
|
name: "icon-left",
|
|
470
|
-
fn:
|
|
481
|
+
fn: F(() => [A(a.$slots, "option-icon", D(C(o)))]),
|
|
471
482
|
key: "0"
|
|
472
|
-
} : void 0,
|
|
483
|
+
} : void 0, Ze(o.key) ? {
|
|
473
484
|
name: "right",
|
|
474
|
-
fn:
|
|
485
|
+
fn: F((i) => [x(N(r), {
|
|
475
486
|
appearance: N(t).BARE,
|
|
476
487
|
variant: N(e).NEUTRAL,
|
|
477
488
|
size: N(n).SMALL,
|
|
@@ -479,7 +490,7 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
479
490
|
"aria-label": N(w)("select.removeOption"),
|
|
480
491
|
disabled: i.disabled || i.readonly,
|
|
481
492
|
tabindex: -1,
|
|
482
|
-
onClick:
|
|
493
|
+
onClick: le((e) => et(o.key), ["stop"])
|
|
483
494
|
}, null, 8, [
|
|
484
495
|
"appearance",
|
|
485
496
|
"variant",
|
|
@@ -489,9 +500,9 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
489
500
|
"onClick"
|
|
490
501
|
])]),
|
|
491
502
|
key: "1"
|
|
492
|
-
} : void 0]), 1040)) : (O(), g(N(d), D(T({ key: 2 },
|
|
503
|
+
} : void 0]), 1040)) : (O(), g(N(d), D(T({ key: 2 }, $e(o))), b({ _: 2 }, [N(M)["option-icon"] ? {
|
|
493
504
|
name: "icon-left",
|
|
494
|
-
fn:
|
|
505
|
+
fn: F(() => [A(a.$slots, "option-icon", D(C(o)))]),
|
|
495
506
|
key: "0"
|
|
496
507
|
} : void 0]), 1040))]),
|
|
497
508
|
key: "0"
|
|
@@ -512,14 +523,14 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
512
523
|
"selected-on-top",
|
|
513
524
|
"can-load-more",
|
|
514
525
|
"end-reached-distance"
|
|
515
|
-
])) : (O(), v("div",
|
|
526
|
+
])) : (O(), v("div", ye, [A(a.$slots, "empty", {}, () => [te(j(N(w)("select.noOptions")), 1)])]))], 32)]),
|
|
516
527
|
_: 2
|
|
517
528
|
}, [N(X) || N(M)["panel-header"] ? {
|
|
518
529
|
name: "header",
|
|
519
|
-
fn:
|
|
530
|
+
fn: F(() => [A(a.$slots, "panel-header"), N(X) ? (O(), g(N(u), {
|
|
520
531
|
key: 0,
|
|
521
532
|
ref_key: "panelSearchInputElementRef",
|
|
522
|
-
ref:
|
|
533
|
+
ref: H,
|
|
523
534
|
modelValue: m.value,
|
|
524
535
|
"onUpdate:modelValue": c[0] ||= (e) => m.value = e,
|
|
525
536
|
placeholder: i.searchPlaceholder,
|
|
@@ -527,8 +538,8 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
527
538
|
clearable: !1,
|
|
528
539
|
"aria-label": i.searchPlaceholder,
|
|
529
540
|
"icon-left": "search",
|
|
530
|
-
onClick: c[1] ||=
|
|
531
|
-
onKeydown: N(
|
|
541
|
+
onClick: c[1] ||= le(() => {}, ["stop"]),
|
|
542
|
+
onKeydown: N(wt)
|
|
532
543
|
}, null, 8, [
|
|
533
544
|
"modelValue",
|
|
534
545
|
"placeholder",
|
|
@@ -539,7 +550,7 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
539
550
|
key: "0"
|
|
540
551
|
} : void 0, N(M)["panel-footer"] ? {
|
|
541
552
|
name: "footer",
|
|
542
|
-
fn:
|
|
553
|
+
fn: F(() => [A(a.$slots, "panel-footer")]),
|
|
543
554
|
key: "1"
|
|
544
555
|
} : void 0]), 1032, ["width"])]),
|
|
545
556
|
_: 3
|
|
@@ -553,9 +564,9 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
553
564
|
"content-id"
|
|
554
565
|
]), x(N(u), {
|
|
555
566
|
ref_key: "triggerInputRef",
|
|
556
|
-
ref:
|
|
557
|
-
modelValue:
|
|
558
|
-
"onUpdate:modelValue": c[7] ||= (e) =>
|
|
567
|
+
ref: z,
|
|
568
|
+
modelValue: B.value,
|
|
569
|
+
"onUpdate:modelValue": c[7] ||= (e) => B.value = e,
|
|
559
570
|
label: i.label,
|
|
560
571
|
"label-props": i.labelProps,
|
|
561
572
|
placeholder: i.placeholder,
|
|
@@ -565,41 +576,41 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
565
576
|
disabled: i.disabled,
|
|
566
577
|
readonly: i.readonly,
|
|
567
578
|
clearable: i.clearable,
|
|
568
|
-
"has-value": N(
|
|
569
|
-
focused:
|
|
579
|
+
"has-value": N(Pe),
|
|
580
|
+
focused: K.value || G.value,
|
|
570
581
|
"icon-left": i.iconLeft,
|
|
571
582
|
customize: i.customize,
|
|
572
583
|
name: i.name,
|
|
573
|
-
id:
|
|
574
|
-
onClear:
|
|
575
|
-
onFocus:
|
|
576
|
-
onBlur:
|
|
584
|
+
id: tt.value,
|
|
585
|
+
onClear: Dt,
|
|
586
|
+
onFocus: Tt,
|
|
587
|
+
onBlur: Et
|
|
577
588
|
}, b({
|
|
578
|
-
control:
|
|
579
|
-
id:
|
|
589
|
+
control: F(() => [y("div", T({
|
|
590
|
+
id: tt.value,
|
|
580
591
|
class: ["s-ui-select__control s-ui-typography-body-14-regular", {
|
|
581
592
|
"s-ui-select__control--multiple": N(Z),
|
|
582
|
-
"s-ui-select__control--empty": N(Z) && !N(
|
|
583
|
-
"s-ui-select__control--with-value-suffix": N(M)["value-suffix"] && !N(Z) && !N(Y) && !N(
|
|
593
|
+
"s-ui-select__control--empty": N(Z) && !N(Pe) && !N(Y),
|
|
594
|
+
"s-ui-select__control--with-value-suffix": N(M)["value-suffix"] && !N(Z) && !N(Y) && !N(Re)
|
|
584
595
|
}],
|
|
585
596
|
role: "combobox",
|
|
586
|
-
"aria-expanded":
|
|
587
|
-
"aria-controls":
|
|
597
|
+
"aria-expanded": G.value,
|
|
598
|
+
"aria-controls": nt.value,
|
|
588
599
|
"aria-haspopup": "listbox",
|
|
589
600
|
"aria-disabled": i.disabled ? !0 : void 0,
|
|
590
601
|
"aria-readonly": i.readonly ? !0 : void 0,
|
|
591
602
|
"aria-autocomplete": N(ze) ? "list" : void 0
|
|
592
|
-
},
|
|
593
|
-
tabindex:
|
|
594
|
-
onClick:
|
|
595
|
-
onKeydown:
|
|
603
|
+
}, at(), {
|
|
604
|
+
tabindex: ct.value,
|
|
605
|
+
onClick: vt,
|
|
606
|
+
onKeydown: St
|
|
596
607
|
}), [
|
|
597
|
-
N(Z) ? A(a.$slots, "selection", D(T({ key: 0 },
|
|
598
|
-
N(M)["value-suffix"] && !N(Z) && !N(Y) && !N(
|
|
599
|
-
N(Y) ?
|
|
608
|
+
N(Z) ? A(a.$slots, "selection", D(T({ key: 0 }, st.value)), () => [N(Le) ? (O(), v("span", xe, j(N(Le)), 1)) : N(Re) && !N(Y) ? (O(), v("span", Se, j(i.placeholder), 1)) : _("", !0)]) : N(Re) && !N(Y) ? (O(), v("span", Ce, j(i.placeholder), 1)) : N(Y) ? _("", !0) : (O(), v("span", we, j(N(Fe)), 1)),
|
|
609
|
+
N(M)["value-suffix"] && !N(Z) && !N(Y) && !N(Re) ? (O(), v("div", Te, [A(a.$slots, "value-suffix", D(C(Ge.value)))])) : _("", !0),
|
|
610
|
+
N(Y) ? ce((O(), v("input", T({
|
|
600
611
|
key: 4,
|
|
601
612
|
ref_key: "searchInputElementRef",
|
|
602
|
-
ref:
|
|
613
|
+
ref: V,
|
|
603
614
|
"onUpdate:modelValue": c[5] ||= (e) => m.value = e,
|
|
604
615
|
class: "s-ui-select__search-input",
|
|
605
616
|
type: "text",
|
|
@@ -608,38 +619,38 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
608
619
|
disabled: i.disabled,
|
|
609
620
|
readonly: i.readonly,
|
|
610
621
|
autocomplete: "off"
|
|
611
|
-
},
|
|
612
|
-
onClick: c[6] ||=
|
|
613
|
-
onFocus:
|
|
614
|
-
onKeydown:
|
|
615
|
-
}), null, 16,
|
|
616
|
-
], 16,
|
|
617
|
-
action:
|
|
622
|
+
}, it(), {
|
|
623
|
+
onClick: c[6] ||= le(() => {}, ["stop"]),
|
|
624
|
+
onFocus: pt,
|
|
625
|
+
onKeydown: Ct
|
|
626
|
+
}), null, 16, Ee)), [[se, m.value]]) : _("", !0)
|
|
627
|
+
], 16, be)]),
|
|
628
|
+
action: F(() => [x(N(ue), {
|
|
618
629
|
name: "chevronMiniDown",
|
|
619
|
-
size:
|
|
630
|
+
size: De,
|
|
620
631
|
class: "s-ui-select__chevron",
|
|
621
|
-
onClick:
|
|
632
|
+
onClick: yt
|
|
622
633
|
})]),
|
|
623
634
|
_: 2
|
|
624
635
|
}, [
|
|
625
636
|
N(M).label ? {
|
|
626
637
|
name: "label",
|
|
627
|
-
fn:
|
|
638
|
+
fn: F(() => [A(a.$slots, "label")]),
|
|
628
639
|
key: "0"
|
|
629
640
|
} : void 0,
|
|
630
641
|
N(M).prefix ? {
|
|
631
642
|
name: "prefix",
|
|
632
|
-
fn:
|
|
643
|
+
fn: F((e) => [A(a.$slots, "prefix", D(C(e)))]),
|
|
633
644
|
key: "1"
|
|
634
645
|
} : void 0,
|
|
635
646
|
N(M).prepend ? {
|
|
636
647
|
name: "prepend",
|
|
637
|
-
fn:
|
|
648
|
+
fn: F((e) => [A(a.$slots, "prepend", D(C(e)))]),
|
|
638
649
|
key: "2"
|
|
639
650
|
} : void 0,
|
|
640
651
|
N(M).message ? {
|
|
641
652
|
name: "message",
|
|
642
|
-
fn:
|
|
653
|
+
fn: F(() => [A(a.$slots, "message")]),
|
|
643
654
|
key: "3"
|
|
644
655
|
} : void 0
|
|
645
656
|
]), 1032, [
|
|
@@ -663,4 +674,4 @@ var pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, it
|
|
|
663
674
|
}
|
|
664
675
|
});
|
|
665
676
|
//#endregion
|
|
666
|
-
export {
|
|
677
|
+
export { B as n, Ae as t };
|