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