@shtabapp/ui-kit 1.78.2 → 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.
@@ -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-cNmJ5Lrz.js";
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 ce, withCtx as P, withDirectives as le, withModifiers as ue } from "vue";
10
- import { SIcon as de, useUiKitI18n as fe } from "@shtabapp/ui-kit-primitives";
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 pe = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, itemIconLeft: i, listActiveKey: a, isOptionSelected: o }) => {
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
- }, me = (e) => typeof e == "string" || typeof e == "number", F = (e, t) => {
25
+ }, pe = (e) => typeof e == "string" || typeof e == "number", I = (e, t) => {
26
26
  let n = e[t];
27
- if (me(n)) return n;
28
- }, I = (e) => typeof e == "string" ? e : String(e), L = (e) => e == null ? !1 : typeof e == "string" ? e.length > 0 : !0, he = (e, t, n) => t.find((t) => I(F(t, n) ?? "") === e), ge = (e) => typeof e == "object" && !!e, R = (e, t, n) => {
29
- let r = he(e, t, n);
30
- if (r) return F(r, n);
31
- }, z = /* @__PURE__ */ function(e) {
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
- }({}), B = (e, t, n) => {
33
+ }({}), V = (e, t, n) => {
34
34
  if (!e) return !0;
35
- let r = e.toLocaleLowerCase(), i = f(t, n.itemTitle)?.toLocaleLowerCase() ?? "", a = I(F(t, n.itemValue) ?? "").toLocaleLowerCase();
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
- }, V = (e, t, n, r) => {
38
- let i = r ?? ((e, t) => B(e, t, n));
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
- }, H = (e) => typeof e == "string" && L(e), U = (e) => typeof e == "number" && L(e), W = (e, t, n) => {
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 (!ge(e)) return;
43
- let t = F(e, n);
44
- return H(t) || U(t) ? t : void 0;
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 (H(r) || U(r)) return r;
48
- }, G = (e, t, n) => e ? (Array.isArray(e) ? e : [e]).flatMap((e) => {
49
- let r = W(e, t, n);
50
- return L(r) ? [r] : [];
51
- }) : [], _e = (e, t) => {
52
- if (H(t)) {
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 (U(t)) {
56
+ if (W(t)) {
57
57
  e.value = t;
58
58
  return;
59
59
  }
60
60
  e.value = void 0;
61
- }, ve = (e, t, n) => t.flatMap((t) => {
62
- let r = I(t), i = e.find((e) => I(F(e, n) ?? "") === 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
- }), ye = ({ 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) === z.INPUT), m = h(() => M(o) === z.CONTENT), ee = h(() => !!M(o)), g = h(() => {
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 G(e.value, d.value, t.itemValue);
67
+ return K(e.value, d.value, t.itemValue);
68
68
  }), _ = h(() => {
69
69
  let e = M(t), r = M(n);
70
- return V(e, ee.value ? l.value : "", r, M(s));
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 = ve(n, t, r);
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 = he(t, n, r) ?? void 0;
83
+ e.value = me(t, n, r) ?? void 0;
84
84
  return;
85
85
  }
86
- _e(e, R(t, n, r));
86
+ ge(e, z(t, n, r));
87
87
  }, te = h({
88
88
  get: () => {
89
- if (u.value) return g.value.map((e) => I(e));
89
+ if (u.value) return g.value.map((e) => L(e));
90
90
  let e = g.value[0];
91
- if (L(e)) return I(e);
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) => R(e, r, i.itemValue)).filter((e) => L(e)), r, i.itemValue);
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 = I(t);
103
- return e.find((e) => I(F(e, n) ?? "") === r);
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 (!L(e)) return "";
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) ?? "" : I(e);
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) ?? "" : I(t);
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 ce(c, (e) => {
118
+ return P(c, (e) => {
119
119
  e || D();
120
- }), ce(() => M(o), () => {
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 = I(e);
144
- y(g.value.filter((e) => I(e) !== r), M(t), M(n).itemValue);
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: I,
148
- resolveValueFromListKey: (e) => R(e, M(t), M(n).itemValue)
147
+ formatSelectListKey: L,
148
+ resolveValueFromListKey: (e) => z(e, M(t), M(n).itemValue)
149
149
  };
150
- }, be = {
150
+ }, ye = {
151
151
  key: 1,
152
152
  class: "s-ui-select__empty s-ui-typography-body-14-regular"
153
- }, xe = [
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
- ], Se = {
161
+ ], xe = {
162
162
  key: 0,
163
163
  class: "s-ui-select__value"
164
- }, Ce = {
164
+ }, Se = {
165
165
  key: 1,
166
166
  class: "s-ui-select__placeholder"
167
- }, we = {
167
+ }, Ce = {
168
168
  key: 1,
169
169
  class: "s-ui-select__placeholder"
170
- }, Te = {
170
+ }, we = {
171
171
  key: 2,
172
172
  class: "s-ui-select__value"
173
- }, Ee = {
173
+ }, Te = {
174
174
  key: 3,
175
175
  class: "s-ui-select__value-suffix"
176
- }, De = [
176
+ }, Ee = [
177
177
  "name",
178
178
  "placeholder",
179
179
  "disabled",
180
180
  "readonly"
181
- ], Oe = 20, ke = "100%", Ae = 20, je = /* @__PURE__ */ S({
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 } = fe(), M = ae(), { getRootAttrs: me, getAriaAttrs: F, getAriaAttr: I } = a(), he = re(), ge = re(), R = oe("triggerInputRef"), z = k(""), B = oe("searchInputElementRef"), V = oe("panelSearchInputElementRef"), H = oe("listElementRef"), U = k(), W = k(!1), G = k(!1), _e = h(() => i.panelWidth === void 0), ve = h(() => i.panelWidth ?? ke), je = h(() => i.itemId ?? i.itemValue), Me = h(() => ({
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: je.value
268
- })), { selectedValues: K, filteredOptions: Ne, listSelectionMode: Pe, listSelectedModel: q, hasSelectedValues: Fe, singleDisplayLabel: Ie, multipleDisplayLabels: Le, multipleDisplayText: Re, showPlaceholder: J, showInputSearchField: Y, isSearchableMode: ze, isSearchableInputMode: Be, isSearchableContentMode: X, isMultipleMode: Z, clearSelection: Ve, removeSelectedValue: He, resolveValueFromListKey: Ue, formatSelectListKey: We } = ye({
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: () => Me.value,
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: W,
276
+ isDropdownOpen: G,
277
277
  searchQuery: m
278
278
  }), Ge = h(() => ({
279
279
  disabled: i.disabled,
280
- displayLabel: Ie.value
281
- })), Ke = h(() => Ne.value.length > Ae), qe = h(() => X.value || Ke.value ? i.listHeight : "auto"), Je = h(() => {
282
- if (!(X.value || Ke.value)) return i.listHeight;
283
- }), Ye = h(() => K.value.map((e) => We(e))), Xe = (e) => Ye.value.includes(e), Ze = () => ({ tiny: !0 }), Qe = (e) => pe({
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: U.value,
290
- isOptionSelected: Xe(e.key)
291
- }), $e = (e) => {
300
+ listActiveKey: W.value,
301
+ isOptionSelected: Ze(e.key)
302
+ }), et = (e) => {
292
303
  let t = Ue(e);
293
- if (L(t)) {
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
- }, et = h(() => i.id ?? he), tt = h(() => ge), nt = h(() => c(et.value)), rt = () => {
301
- let e = I("aria-label"), t = I("aria-labelledby");
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": nt.value } : i.placeholder ? { "aria-label": i.placeholder } : {};
306
- }, it = () => ({
307
- ...F(),
308
- ...rt()
309
- }), at = h(() => R.value?.fieldElementRef ?? null), ot = h(() => ({
310
- labels: Le.value,
311
- values: K.value,
312
- displayText: Re.value,
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
- })), st = h(() => {
326
+ })), ct = h(() => {
316
327
  if (!i.disabled && (i.readonly && !Be.value || !Be.value)) return 0;
317
- }), ct = h(() => ({
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": W.value
322
- })), lt = () => {
332
+ "s-ui-select--open": G.value
333
+ })), ut = () => {
323
334
  if (X.value) {
324
- V.value?.focus();
335
+ H.value?.focus();
325
336
  return;
326
337
  }
327
- B.value?.focus();
328
- }, ut = async () => {
329
- await E(), V.value?.focus();
338
+ V.value?.focus();
330
339
  }, dt = async () => {
331
- await E(), await H.value?.focusNavigation();
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) && !W.value) {
334
- if (W.value = !0, S("open"), X.value) {
335
- await ut();
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(), B.value?.focus();
350
+ await E(), V.value?.focus();
340
351
  return;
341
352
  }
342
- await dt();
353
+ await ft();
343
354
  }
344
- }, ft = async () => {
345
- i.disabled || i.readonly || W.value || await Q();
355
+ }, pt = async () => {
356
+ i.disabled || i.readonly || G.value || await Q();
346
357
  };
347
- ce(m, async (e) => {
348
- Be.value && (i.disabled || i.readonly || e && (W.value || await Q()));
358
+ P(m, async (e) => {
359
+ Be.value && (i.disabled || i.readonly || e && (G.value || await Q()));
349
360
  });
350
361
  let $ = () => {
351
- W.value && (W.value = !1, U.value = void 0, S("close"));
352
- }, pt = () => {
362
+ G.value && (G.value = !1, W.value = void 0, S("close"));
363
+ }, mt = () => {
353
364
  !i.closeOnSelect || Z.value || $();
354
365
  };
355
- ce(p, (e, t) => {
356
- !i.closeOnSelect || Z.value || !W.value || !e || e === t || $();
366
+ P(p, (e, t) => {
367
+ !i.closeOnSelect || Z.value || !G.value || !e || e === t || $();
357
368
  });
358
- let mt = (e) => {
359
- W.value && e.target instanceof Element && e.target.closest(".s-ui-list-item") && pt();
360
- }, ht = async (e) => {
361
- e.key !== "Enter" && e.key !== " " && e.key !== "Spacebar" || W.value && (await E(), pt());
362
- }, gt = async () => {
363
- if (W.value) {
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
- }, _t = async (e) => {
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
- W.value || await Q();
382
+ G.value || await Q();
372
383
  return;
373
384
  }
374
- await gt();
385
+ await _t();
375
386
  }
376
- }, vt = async () => {
377
- i.disabled || i.readonly || await gt();
378
- }, yt = async (e) => e.key !== "ArrowDown" && e.key !== "ArrowUp" ? !1 : (e.preventDefault(), e.stopPropagation(), W.value || await Q(), await dt(), await H.value?.handleKeyboardNavigation(e), !0), bt = (e) => {
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
- K.value.some((t) => We(t) === e) ? He(t) : q.value = [...K.value.map((e) => We(e)), e];
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
- q.value = e, pt();
396
+ J.value = e, mt();
386
397
  }
387
- }, xt = async (e) => {
388
- if (!(i.disabled || i.readonly) && !await yt(e)) {
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(), W.value && U.value) {
395
- bt(U.value);
405
+ if (e.preventDefault(), G.value && W.value) {
406
+ xt(W.value);
396
407
  return;
397
408
  }
398
- await gt();
409
+ await _t();
399
410
  }
400
411
  }
401
- }, St = async (e) => {
412
+ }, Ct = async (e) => {
402
413
  if (e.key === "Escape") {
403
414
  e.preventDefault(), $();
404
415
  return;
405
416
  }
406
- await yt(e);
407
- }, Ct = St, wt = (e) => {
408
- i.disabled || (G.value || S("focus", e), G.value = !0);
409
- }, Tt = (e) => {
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) || (G.value = !1, S("blur", e));
413
- }, Et = () => {
423
+ t instanceof Node && e.currentTarget.contains(t) || (K.value = !1, S("blur", e));
424
+ }, Dt = () => {
414
425
  Ve(), S("clear");
415
- }, Dt = (e) => {
426
+ }, Ot = (e) => {
416
427
  S("endReached", e);
417
428
  };
418
429
  return l({
419
430
  open: Q,
420
431
  close: $,
421
- toggle: gt,
422
- focusSearchInput: lt
423
- }), (a, c) => (O(), v("div", T({ class: ["s-ui-select", ct.value] }, N(me)()), [x(N(o), {
424
- modelValue: W.value,
425
- "onUpdate:modelValue": c[4] ||= (e) => W.value = e,
426
- reference: at.value,
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": _e.value,
439
+ "match-reference-width": ge.value,
429
440
  "fit-viewport": i.fitViewport,
430
441
  "surface-class": i.surfaceClass,
431
- "content-id": tt.value,
442
+ "content-id": nt.value,
432
443
  "dismiss-on-click-outside": !0,
433
444
  "dismiss-on-escape": !0
434
445
  }, {
435
- content: P(() => [x(N(s), {
446
+ content: F(() => [x(N(s), {
436
447
  class: "s-ui-select__menu",
437
- width: ve.value
448
+ width: _e.value
438
449
  }, b({
439
- default: P(() => [y("div", {
450
+ default: F(() => [y("div", {
440
451
  class: "s-ui-select__menu-body",
441
- onClick: mt,
442
- onKeydown: ht
443
- }, [N(Ne).length > 0 ? (O(), g(N(ee), T({
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: H,
447
- modelValue: U.value,
448
- "onUpdate:modelValue": c[2] ||= (e) => U.value = e,
449
- selected: N(q),
450
- "onUpdate:selected": c[3] ||= (e) => ne(q) ? q.value = e : null,
451
- items: N(Ne),
452
- "item-key": je.value,
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(Pe),
468
+ "selection-mode": N(Ne),
458
469
  mandatory: !i.multiple,
459
- height: qe.value,
460
- "max-height": Je.value,
470
+ height: Je.value,
471
+ "max-height": Ye.value,
461
472
  virtual: Ke.value,
462
- "item-props": Ze,
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
- }, rt(), { onEndReached: Dt }), b({ _: 2 }, [N(M).option || N(M)["option-icon"] || i.closableOptions || N(Z) ? {
477
+ }, it(), { onEndReached: Ot }), b({ _: 2 }, [N(M).option || N(M)["option-icon"] || i.closableOptions || N(Z) ? {
467
478
  name: "item",
468
- fn: P((o) => [N(M).option ? A(a.$slots, "option", D(T({ key: 0 }, o))) : i.closableOptions ? (O(), g(N(d), D(T({ key: 1 }, Qe(o))), b({ _: 2 }, [N(M)["option-icon"] ? {
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: P(() => [A(a.$slots, "option-icon", D(C(o)))]),
481
+ fn: F(() => [A(a.$slots, "option-icon", D(C(o)))]),
471
482
  key: "0"
472
- } : void 0, Xe(o.key) ? {
483
+ } : void 0, Ze(o.key) ? {
473
484
  name: "right",
474
- fn: P((i) => [x(N(r), {
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: ue((e) => $e(o.key), ["stop"])
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 }, Qe(o))), b({ _: 2 }, [N(M)["option-icon"] ? {
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: P(() => [A(a.$slots, "option-icon", D(C(o)))]),
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", be, [A(a.$slots, "empty", {}, () => [te(j(N(w)("select.noOptions")), 1)])]))], 32)]),
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: P(() => [A(a.$slots, "panel-header"), N(X) ? (O(), g(N(u), {
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: V,
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] ||= ue(() => {}, ["stop"]),
531
- onKeydown: N(Ct)
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: P(() => [A(a.$slots, "panel-footer")]),
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: R,
557
- modelValue: z.value,
558
- "onUpdate:modelValue": c[7] ||= (e) => z.value = 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(Fe),
569
- focused: G.value || W.value,
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: et.value,
574
- onClear: Et,
575
- onFocus: wt,
576
- onBlur: Tt
584
+ id: tt.value,
585
+ onClear: Dt,
586
+ onFocus: Tt,
587
+ onBlur: Et
577
588
  }, b({
578
- control: P(() => [y("div", T({
579
- id: et.value,
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(Fe) && !N(Y),
583
- "s-ui-select__control--with-value-suffix": N(M)["value-suffix"] && !N(Z) && !N(Y) && !N(J)
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": W.value,
587
- "aria-controls": tt.value,
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
- }, it(), {
593
- tabindex: st.value,
594
- onClick: _t,
595
- onKeydown: xt
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 }, ot.value)), () => [N(Re) ? (O(), v("span", Se, j(N(Re)), 1)) : N(J) && !N(Y) ? (O(), v("span", Ce, j(i.placeholder), 1)) : _("", !0)]) : N(J) && !N(Y) ? (O(), v("span", we, j(i.placeholder), 1)) : N(Y) ? _("", !0) : (O(), v("span", Te, j(N(Ie)), 1)),
598
- N(M)["value-suffix"] && !N(Z) && !N(Y) && !N(J) ? (O(), v("div", Ee, [A(a.$slots, "value-suffix", D(C(Ge.value)))])) : _("", !0),
599
- N(Y) ? le((O(), v("input", T({
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: B,
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
- }, rt(), {
612
- onClick: c[6] ||= ue(() => {}, ["stop"]),
613
- onFocus: ft,
614
- onKeydown: St
615
- }), null, 16, De)), [[se, m.value]]) : _("", !0)
616
- ], 16, xe)]),
617
- action: P(() => [x(N(de), {
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: Oe,
630
+ size: De,
620
631
  class: "s-ui-select__chevron",
621
- onClick: vt
632
+ onClick: yt
622
633
  })]),
623
634
  _: 2
624
635
  }, [
625
636
  N(M).label ? {
626
637
  name: "label",
627
- fn: P(() => [A(a.$slots, "label")]),
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: P((e) => [A(a.$slots, "prefix", D(C(e)))]),
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: P((e) => [A(a.$slots, "prepend", D(C(e)))]),
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: P(() => [A(a.$slots, "message")]),
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 { z as n, je as t };
677
+ export { B as n, Ae as t };