@shtabapp/ui-kit 1.49.0 → 1.51.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 +26 -0
- package/dist/{SAvatarGroup-CaqcKGIq.cjs → SAvatarGroup-CTC_esUv.cjs} +1 -1
- package/dist/{SAvatarGroup-MuTqzfYS.js → SAvatarGroup-F5w88NGf.js} +1 -1
- package/dist/{SCard-CrU67ok0.js → SCard-BkmIQd2s.js} +4 -4
- package/dist/SCard-BzIQoACi.cjs +1 -0
- package/dist/SCheckbox-BXV4bPOv.js +76 -0
- package/dist/SCheckbox-D_YLWg6a.cjs +1 -0
- package/dist/SChip-DRz5BA4Z.cjs +1 -0
- package/dist/{SChip-TxpPE0VS.js → SChip-DvPazz7Y.js} +0 -1
- package/dist/{SColorPicker-CeKB3QS1.cjs → SColorPicker-CuuiFxI0.cjs} +1 -1
- package/dist/{SColorPicker-BqsD-5xA.js → SColorPicker-Dl5H4iwH.js} +1 -1
- package/dist/SInput-DJL9QOIG.cjs +1 -0
- package/dist/{SInput-CkanJfLx.js → SInput-ug89CYt3.js} +45 -45
- package/dist/{SList-DAzztC-7.js → SList-BESqVnlh.js} +1 -1
- package/dist/{SList-S18K8mlH.cjs → SList-qQ7B5u8o.cjs} +1 -1
- package/dist/SListItem-DBGDVeoJ.cjs +1 -0
- package/dist/{SListItem-BRXZEePg.js → SListItem-DJ8uSadf.js} +46 -45
- package/dist/SOverflowGroup-CyksOav7.js +79 -0
- package/dist/{SOverflowGroup-DyVUzkNu.cjs → SOverflowGroup-rmU10_7L.cjs} +1 -1
- package/dist/SRadio-BZKPhGwO.js +58 -0
- package/dist/SRadio-CcmuHaKk.cjs +1 -0
- package/dist/SSelect-CMR4dxSn.cjs +1 -0
- package/dist/SSelect-pXiw_NyB.js +680 -0
- package/dist/{STagGroup-BMIwBk-O.cjs → STagGroup-CF2TFkb3.cjs} +1 -1
- package/dist/{STagGroup-wSpc3guU.js → STagGroup-GzZhto7-.js} +1 -1
- package/dist/SToggle-B5EdI-rG.cjs +1 -0
- package/dist/SToggle-BgCgar2U.js +59 -0
- package/dist/components/SCard/SCard.vue.d.ts.map +1 -1
- package/dist/components/SCheckbox/SCheckbox.vue.d.ts.map +1 -1
- package/dist/components/SChip/SChip.vue.d.ts.map +1 -1
- package/dist/components/SList/utils/resolveListItemFields.d.ts +1 -1
- package/dist/components/SList/utils/resolveListItemFields.d.ts.map +1 -1
- package/dist/components/SListItem/SListItem.types.d.ts +2 -1
- package/dist/components/SListItem/SListItem.types.d.ts.map +1 -1
- package/dist/components/SListItem/SListItem.vue.d.ts.map +1 -1
- package/dist/components/SOverflowGroup/SOverflowGroup.vue.d.ts.map +1 -1
- package/dist/components/SRadio/SRadio.vue.d.ts.map +1 -1
- package/dist/components/SSelect/SSelect.types.d.ts +18 -12
- package/dist/components/SSelect/SSelect.types.d.ts.map +1 -1
- package/dist/components/SSelect/SSelect.vue.d.ts +5 -5
- package/dist/components/SSelect/SSelect.vue.d.ts.map +1 -1
- package/dist/components/SToggle/SToggle.types.d.ts +6 -0
- package/dist/components/SToggle/SToggle.types.d.ts.map +1 -1
- package/dist/components/SToggle/SToggle.vue.d.ts +11 -1
- package/dist/components/SToggle/SToggle.vue.d.ts.map +1 -1
- package/dist/components/SToggle/index.d.ts +1 -1
- package/dist/components/SToggle/index.d.ts.map +1 -1
- package/dist/entries/avatar-group.cjs +1 -1
- package/dist/entries/avatar-group.js +1 -1
- package/dist/entries/card.cjs +1 -1
- package/dist/entries/card.js +1 -1
- package/dist/entries/checkbox.cjs +1 -1
- package/dist/entries/checkbox.js +1 -1
- package/dist/entries/chip.cjs +1 -1
- package/dist/entries/chip.js +1 -1
- package/dist/entries/color-picker.cjs +1 -1
- package/dist/entries/color-picker.js +1 -1
- package/dist/entries/input.cjs +1 -1
- package/dist/entries/input.js +1 -1
- package/dist/entries/list-item.cjs +1 -1
- package/dist/entries/list-item.js +1 -1
- package/dist/entries/list.cjs +1 -1
- package/dist/entries/list.js +1 -1
- package/dist/entries/radio.cjs +1 -1
- package/dist/entries/radio.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/entries/tag-group.cjs +1 -1
- package/dist/entries/tag-group.js +1 -1
- package/dist/entries/toggle.cjs +1 -1
- package/dist/entries/toggle.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +12 -12
- package/dist/uikit-components.css +1 -1
- package/package.json +2 -2
- package/dist/SCard-BR2R5VQd.cjs +0 -1
- package/dist/SCheckbox-BMKYFfrB.js +0 -76
- package/dist/SCheckbox-CYy7tfoS.cjs +0 -1
- package/dist/SChip-DoFL5c6-.cjs +0 -1
- package/dist/SInput-C07kFnj_.cjs +0 -1
- package/dist/SListItem-CdveotJe.cjs +0 -1
- package/dist/SOverflowGroup-CVSon6Eg.js +0 -80
- package/dist/SRadio-Ca-1D4q6.cjs +0 -1
- package/dist/SRadio-Db_YLcne.js +0 -57
- package/dist/SSelect-Bntb-dgY.js +0 -661
- package/dist/SSelect-DcTEwHx6.cjs +0 -1
- package/dist/SToggle-DxSm1RNz.cjs +0 -1
- package/dist/SToggle-T7FKzMSo.js +0 -44
|
@@ -0,0 +1,680 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./SButton.types-CpdHQtyx.js";
|
|
2
|
+
import { t as r } from "./SButton-DnU_XZ1C.js";
|
|
3
|
+
import { n as i } from "./useSelectionGroup-cKj38lEN.js";
|
|
4
|
+
import { t as a } from "./SDropdown-CTQ5Qlez.js";
|
|
5
|
+
import { n as o, t as s } from "./SInput-ug89CYt3.js";
|
|
6
|
+
import { i as c, n as l, r as u, t as d } from "./SList-BESqVnlh.js";
|
|
7
|
+
import { t as f } from "./SListItem-DJ8uSadf.js";
|
|
8
|
+
import { computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as ee, createVNode as y, defineComponent as b, guardReactiveProps as x, isRef as te, mergeModels as S, mergeProps as C, nextTick as w, normalizeClass as T, normalizeProps as E, normalizeStyle as D, openBlock as O, ref as ne, renderSlot as k, toDisplayString as A, toValue as j, unref as M, useId as re, useModel as ie, useSlots as ae, useTemplateRef as N, vModelText as oe, watch as se, withCtx as P, withDirectives as ce, withModifiers as le } from "vue";
|
|
9
|
+
import { SIcon as ue, useUiKitI18n 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__ */ b({
|
|
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 = ae(), 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) => (O(), g("div", {
|
|
36
|
+
class: T(["s-ui-dropdown-menu", r.value]),
|
|
37
|
+
style: D(a.value)
|
|
38
|
+
}, [
|
|
39
|
+
M(t).header ? (O(), g("div", fe, [k(e.$slots, "header")])) : h("", !0),
|
|
40
|
+
_("div", { class: T(["s-ui-dropdown-menu__body", i.value]) }, [k(e.$slots, "default")], 2),
|
|
41
|
+
M(t).footer ? (O(), g("div", pe, [k(e.$slots, "footer")])) : h("", !0)
|
|
42
|
+
], 6));
|
|
43
|
+
}
|
|
44
|
+
}), he = ({ listItemScope: e, itemTitle: t, itemSubtitle: n, itemDisabled: r, itemIconLeft: i, listActiveKey: a, isOptionSelected: o }) => {
|
|
45
|
+
let s = e.item;
|
|
46
|
+
return {
|
|
47
|
+
rowKey: e.key,
|
|
48
|
+
title: c(s, t),
|
|
49
|
+
subtitle: c(s, n),
|
|
50
|
+
disabled: l(s, r),
|
|
51
|
+
iconLeft: u(s, i),
|
|
52
|
+
selected: o,
|
|
53
|
+
active: a === e.key,
|
|
54
|
+
revealRight: e.revealRight,
|
|
55
|
+
tiny: !0
|
|
56
|
+
};
|
|
57
|
+
}, ge = (e) => typeof e == "string" || typeof e == "number", F = (e, t) => {
|
|
58
|
+
let n = e[t];
|
|
59
|
+
if (ge(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) {
|
|
64
|
+
return e.INPUT = "input", e.CONTENT = "content", e;
|
|
65
|
+
}({}), H = (e, t, n) => {
|
|
66
|
+
if (!e) return !0;
|
|
67
|
+
let r = e.toLocaleLowerCase(), i = c(t, n.itemTitle)?.toLocaleLowerCase() ?? "", a = I(F(t, n.itemValue) ?? "").toLocaleLowerCase();
|
|
68
|
+
return i.includes(r) || a.includes(r);
|
|
69
|
+
}, U = (e, t, n, r) => {
|
|
70
|
+
let i = r ?? ((e, t) => H(e, t, n));
|
|
71
|
+
return t ? e.filter((e) => i(t, e)) : [...e];
|
|
72
|
+
}, W = (e) => typeof e == "string" && L(e), G = (e) => typeof e == "number" && L(e), K = (e, t, n) => {
|
|
73
|
+
if (t) {
|
|
74
|
+
if (!z(e)) return;
|
|
75
|
+
let t = F(e, n);
|
|
76
|
+
return W(t) || G(t) ? t : void 0;
|
|
77
|
+
}
|
|
78
|
+
let r = typeof e == "string" || typeof e == "number" ? e : void 0;
|
|
79
|
+
if (W(r) || G(r)) return r;
|
|
80
|
+
}, _e = (e, t, n) => e ? (Array.isArray(e) ? e : [e]).flatMap((e) => {
|
|
81
|
+
let r = K(e, t, n);
|
|
82
|
+
return L(r) ? [r] : [];
|
|
83
|
+
}) : [], q = (e, t) => {
|
|
84
|
+
if (W(t)) {
|
|
85
|
+
e.value = t;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (G(t)) {
|
|
89
|
+
e.value = t;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
e.value = void 0;
|
|
93
|
+
}, ve = (e, t, n) => t.flatMap((t) => {
|
|
94
|
+
let r = I(t), i = e.find((e) => I(F(e, n) ?? "") === r);
|
|
95
|
+
return i ? [i] : [];
|
|
96
|
+
}), ye = ({ modelValue: e, options: t, itemFields: n, multiple: r, returnObject: a, searchable: o, filterOption: s, isDropdownOpen: l, searchQuery: u }) => {
|
|
97
|
+
let d = p(() => j(r)), f = p(() => j(a)), m = p(() => j(o) === V.INPUT), h = p(() => j(o) === V.CONTENT), g = p(() => !!j(o)), _ = p(() => {
|
|
98
|
+
let t = j(n);
|
|
99
|
+
return _e(e.value, f.value, t.itemValue);
|
|
100
|
+
}), v = p(() => {
|
|
101
|
+
let e = j(t), r = j(n);
|
|
102
|
+
return U(e, g.value ? u.value : "", r, j(s));
|
|
103
|
+
}), ee = p(() => d.value ? i.MULTIPLE : i.SINGLE), y = (t, n, r) => {
|
|
104
|
+
if (f.value) {
|
|
105
|
+
e.value = ve(n, t, r);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
e.value = t;
|
|
109
|
+
}, b = (t, n, r) => {
|
|
110
|
+
if (!t) {
|
|
111
|
+
e.value = void 0;
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (f.value) {
|
|
115
|
+
e.value = R(t, n, r) ?? void 0;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
q(e, B(t, n, r));
|
|
119
|
+
}, x = p({
|
|
120
|
+
get: () => {
|
|
121
|
+
if (d.value) return _.value.map((e) => I(e));
|
|
122
|
+
let e = _.value[0];
|
|
123
|
+
if (L(e)) return I(e);
|
|
124
|
+
},
|
|
125
|
+
set: (e) => {
|
|
126
|
+
let r = j(t), i = j(n);
|
|
127
|
+
if (d.value) {
|
|
128
|
+
y((Array.isArray(e) ? e : []).map((e) => B(e, r, i.itemValue)).filter((e) => L(e)), r, i.itemValue);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
b(typeof e == "string" ? e : void 0, r, i.itemValue);
|
|
132
|
+
}
|
|
133
|
+
}), te = p(() => _.value.length > 0), S = (e, t, n) => {
|
|
134
|
+
let r = I(t);
|
|
135
|
+
return e.find((e) => I(F(e, n) ?? "") === r);
|
|
136
|
+
}, C = p(() => {
|
|
137
|
+
let e = _.value[0];
|
|
138
|
+
if (!L(e)) return "";
|
|
139
|
+
let r = j(n), i = S(j(t), e, r.itemValue);
|
|
140
|
+
return i ? c(i, r.itemTitle) ?? "" : I(e);
|
|
141
|
+
}), w = p(() => {
|
|
142
|
+
let e = j(t), r = j(n);
|
|
143
|
+
return _.value.map((t) => {
|
|
144
|
+
let n = S(e, t, r.itemValue);
|
|
145
|
+
return n ? c(n, r.itemTitle) ?? "" : I(t);
|
|
146
|
+
});
|
|
147
|
+
}), T = p(() => w.value.join(", ")), E = p(() => d.value ? _.value.length === 0 : !C.value), D = p(() => m.value && (l.value || d.value)), O = () => {
|
|
148
|
+
u.value = "";
|
|
149
|
+
};
|
|
150
|
+
return se(l, (e) => {
|
|
151
|
+
e || O();
|
|
152
|
+
}), se(() => j(o), () => {
|
|
153
|
+
O();
|
|
154
|
+
}), {
|
|
155
|
+
searchQuery: u,
|
|
156
|
+
selectedValues: _,
|
|
157
|
+
filteredOptions: v,
|
|
158
|
+
listSelectionMode: ee,
|
|
159
|
+
listSelectedModel: x,
|
|
160
|
+
hasSelectedValues: te,
|
|
161
|
+
singleDisplayLabel: C,
|
|
162
|
+
multipleDisplayLabels: w,
|
|
163
|
+
multipleDisplayText: T,
|
|
164
|
+
showPlaceholder: E,
|
|
165
|
+
showInputSearchField: D,
|
|
166
|
+
isSearchableMode: g,
|
|
167
|
+
isSearchableInputMode: m,
|
|
168
|
+
isSearchableContentMode: h,
|
|
169
|
+
isMultipleMode: d,
|
|
170
|
+
isReturnObjectMode: f,
|
|
171
|
+
clearSelection: () => {
|
|
172
|
+
e.value = void 0, O();
|
|
173
|
+
},
|
|
174
|
+
removeSelectedValue: (e) => {
|
|
175
|
+
let r = I(e);
|
|
176
|
+
y(_.value.filter((e) => I(e) !== r), j(t), j(n).itemValue);
|
|
177
|
+
},
|
|
178
|
+
resetSearchQuery: O,
|
|
179
|
+
formatSelectListKey: I,
|
|
180
|
+
resolveValueFromListKey: (e) => B(e, j(t), j(n).itemValue)
|
|
181
|
+
};
|
|
182
|
+
}, be = {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: "s-ui-select__options-divider",
|
|
185
|
+
role: "separator"
|
|
186
|
+
}, xe = {
|
|
187
|
+
key: 1,
|
|
188
|
+
class: "s-ui-select__empty s-ui-typography-body-14-regular"
|
|
189
|
+
}, Se = [
|
|
190
|
+
"id",
|
|
191
|
+
"aria-expanded",
|
|
192
|
+
"aria-controls",
|
|
193
|
+
"aria-disabled",
|
|
194
|
+
"aria-readonly",
|
|
195
|
+
"aria-autocomplete",
|
|
196
|
+
"tabindex"
|
|
197
|
+
], Ce = {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: "s-ui-select__value"
|
|
200
|
+
}, we = {
|
|
201
|
+
key: 1,
|
|
202
|
+
class: "s-ui-select__placeholder"
|
|
203
|
+
}, Te = {
|
|
204
|
+
key: 1,
|
|
205
|
+
class: "s-ui-select__placeholder"
|
|
206
|
+
}, Ee = {
|
|
207
|
+
key: 2,
|
|
208
|
+
class: "s-ui-select__value"
|
|
209
|
+
}, De = {
|
|
210
|
+
key: 3,
|
|
211
|
+
class: "s-ui-select__value-suffix"
|
|
212
|
+
}, Oe = [
|
|
213
|
+
"name",
|
|
214
|
+
"placeholder",
|
|
215
|
+
"disabled",
|
|
216
|
+
"readonly"
|
|
217
|
+
], ke = 20, Ae = 20, je = "__s-ui-select-options-divider__", Me = /* @__PURE__ */ b({
|
|
218
|
+
__name: "SSelect",
|
|
219
|
+
props: /*@__PURE__*/ S({
|
|
220
|
+
options: {},
|
|
221
|
+
itemValue: { default: "value" },
|
|
222
|
+
itemTitle: { default: "label" },
|
|
223
|
+
itemSubtitle: { default: "subtitle" },
|
|
224
|
+
itemId: {},
|
|
225
|
+
itemDisabled: { default: "disabled" },
|
|
226
|
+
itemIconLeft: { default: "iconLeft" },
|
|
227
|
+
multiple: {
|
|
228
|
+
type: Boolean,
|
|
229
|
+
default: !1
|
|
230
|
+
},
|
|
231
|
+
returnObject: {
|
|
232
|
+
type: Boolean,
|
|
233
|
+
default: !1
|
|
234
|
+
},
|
|
235
|
+
clearable: {
|
|
236
|
+
type: Boolean,
|
|
237
|
+
default: !1
|
|
238
|
+
},
|
|
239
|
+
closableOptions: {
|
|
240
|
+
type: Boolean,
|
|
241
|
+
default: !1
|
|
242
|
+
},
|
|
243
|
+
searchable: {
|
|
244
|
+
type: [String, Boolean],
|
|
245
|
+
default: !1
|
|
246
|
+
},
|
|
247
|
+
closeOnSelect: {
|
|
248
|
+
type: Boolean,
|
|
249
|
+
default: !0
|
|
250
|
+
},
|
|
251
|
+
listHeight: { default: 320 },
|
|
252
|
+
searchPlaceholder: { default: "Search" },
|
|
253
|
+
filterOption: { type: Function },
|
|
254
|
+
fitViewport: {
|
|
255
|
+
type: Boolean,
|
|
256
|
+
default: !0
|
|
257
|
+
},
|
|
258
|
+
label: {},
|
|
259
|
+
labelProps: {},
|
|
260
|
+
placeholder: {},
|
|
261
|
+
helpMessages: {},
|
|
262
|
+
errorMessages: {},
|
|
263
|
+
bordered: {
|
|
264
|
+
type: Boolean,
|
|
265
|
+
default: !0
|
|
266
|
+
},
|
|
267
|
+
disabled: {
|
|
268
|
+
type: Boolean,
|
|
269
|
+
default: !1
|
|
270
|
+
},
|
|
271
|
+
readonly: {
|
|
272
|
+
type: Boolean,
|
|
273
|
+
default: !1
|
|
274
|
+
},
|
|
275
|
+
iconLeft: {},
|
|
276
|
+
customize: { default: () => o.NONE },
|
|
277
|
+
name: {},
|
|
278
|
+
id: {}
|
|
279
|
+
}, {
|
|
280
|
+
modelValue: {},
|
|
281
|
+
modelModifiers: {},
|
|
282
|
+
searchQuery: { default: "" },
|
|
283
|
+
searchQueryModifiers: {}
|
|
284
|
+
}),
|
|
285
|
+
emits: /*@__PURE__*/ S([
|
|
286
|
+
"clear",
|
|
287
|
+
"focus",
|
|
288
|
+
"blur",
|
|
289
|
+
"open",
|
|
290
|
+
"close"
|
|
291
|
+
], ["update:modelValue", "update:searchQuery"]),
|
|
292
|
+
setup(i, { expose: o, emit: c }) {
|
|
293
|
+
let l = ie(i, "modelValue"), u = ie(i, "searchQuery"), b = c, { t: S } = de(), D = ae(), j = re(), fe = re(), pe = N("triggerInputRef"), ge = ne(""), I = N("searchInputElementRef"), R = N("panelSearchInputElementRef"), z = N("listElementRef"), B = ne(), V = ne(!1), H = ne(!1), U = p(() => i.itemId ?? i.itemValue), W = p(() => ({
|
|
294
|
+
itemValue: i.itemValue,
|
|
295
|
+
itemTitle: i.itemTitle,
|
|
296
|
+
itemSubtitle: i.itemSubtitle,
|
|
297
|
+
itemId: U.value
|
|
298
|
+
})), { selectedValues: G, filteredOptions: K, listSelectionMode: _e, listSelectedModel: q, hasSelectedValues: ve, singleDisplayLabel: Me, multipleDisplayLabels: Ne, multipleDisplayText: Pe, showPlaceholder: Fe, showInputSearchField: J, isSearchableMode: Ie, isSearchableInputMode: Le, isSearchableContentMode: Y, isMultipleMode: X, clearSelection: Re, removeSelectedValue: ze, resolveValueFromListKey: Be, formatSelectListKey: Z } = ye({
|
|
299
|
+
modelValue: l,
|
|
300
|
+
options: () => i.options,
|
|
301
|
+
itemFields: () => W.value,
|
|
302
|
+
multiple: () => i.multiple,
|
|
303
|
+
returnObject: () => i.returnObject,
|
|
304
|
+
searchable: () => i.searchable,
|
|
305
|
+
filterOption: () => i.filterOption,
|
|
306
|
+
isDropdownOpen: V,
|
|
307
|
+
searchQuery: u
|
|
308
|
+
}), Ve = p(() => !!D["value-suffix"]), He = p(() => ({
|
|
309
|
+
disabled: i.disabled,
|
|
310
|
+
displayLabel: Me.value
|
|
311
|
+
})), Ue = p(() => K.value.length > Ae), We = p(() => Y.value || Ue.value ? i.listHeight : "auto"), Ge = p(() => {
|
|
312
|
+
if (!(Y.value || Ue.value)) return i.listHeight;
|
|
313
|
+
}), Ke = p(() => G.value.map((e) => Z(e))), qe = (e) => Ke.value.includes(e), Je = p(() => ({
|
|
314
|
+
[U.value]: je,
|
|
315
|
+
[i.itemDisabled]: !0
|
|
316
|
+
})), Ye = (e) => Z(F(e, U.value) ?? ""), Xe = p(() => {
|
|
317
|
+
if (!X.value) return K.value;
|
|
318
|
+
let e = [], t = [];
|
|
319
|
+
for (let n of K.value) qe(Ye(n)) ? e.push(n) : t.push(n);
|
|
320
|
+
return e.length === 0 || t.length === 0 ? K.value : [
|
|
321
|
+
...e,
|
|
322
|
+
Je.value,
|
|
323
|
+
...t
|
|
324
|
+
];
|
|
325
|
+
}), Ze = () => ({ tiny: !0 }), Qe = (e) => he({
|
|
326
|
+
listItemScope: e,
|
|
327
|
+
itemTitle: i.itemTitle,
|
|
328
|
+
itemSubtitle: i.itemSubtitle,
|
|
329
|
+
itemDisabled: i.itemDisabled,
|
|
330
|
+
itemIconLeft: i.itemIconLeft,
|
|
331
|
+
listActiveKey: B.value,
|
|
332
|
+
isOptionSelected: qe(e.key)
|
|
333
|
+
}), $e = (e) => {
|
|
334
|
+
let t = Be(e);
|
|
335
|
+
if (L(t)) {
|
|
336
|
+
if (X.value) {
|
|
337
|
+
ze(t);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
l.value = void 0;
|
|
341
|
+
}
|
|
342
|
+
}, et = p(() => i.id ?? j), tt = p(() => fe), nt = p(() => pe.value?.fieldElementRef ?? null), rt = p(() => ({
|
|
343
|
+
labels: Ne.value,
|
|
344
|
+
values: G.value,
|
|
345
|
+
displayText: Pe.value,
|
|
346
|
+
disabled: i.disabled || i.readonly,
|
|
347
|
+
removeValue: ze
|
|
348
|
+
})), it = p(() => {
|
|
349
|
+
if (!i.disabled && (i.readonly && !Le.value || !Le.value)) return 0;
|
|
350
|
+
}), at = p(() => ({
|
|
351
|
+
"s-ui-select--disabled": i.disabled,
|
|
352
|
+
"s-ui-select--readonly": i.readonly,
|
|
353
|
+
"s-ui-select--multiple": X.value,
|
|
354
|
+
"s-ui-select--open": V.value
|
|
355
|
+
})), ot = () => {
|
|
356
|
+
if (Y.value) {
|
|
357
|
+
R.value?.focus();
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
I.value?.focus();
|
|
361
|
+
}, st = async () => {
|
|
362
|
+
await w(), R.value?.focus();
|
|
363
|
+
}, ct = async () => {
|
|
364
|
+
await w(), await z.value?.focusNavigation();
|
|
365
|
+
}, Q = async () => {
|
|
366
|
+
if (!(i.disabled || i.readonly) && !V.value) {
|
|
367
|
+
if (V.value = !0, b("open"), Y.value) {
|
|
368
|
+
await st();
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
if (Le.value) {
|
|
372
|
+
await w(), I.value?.focus();
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
await ct();
|
|
376
|
+
}
|
|
377
|
+
}, lt = async () => {
|
|
378
|
+
i.disabled || i.readonly || V.value || await Q();
|
|
379
|
+
};
|
|
380
|
+
se(u, async (e) => {
|
|
381
|
+
Le.value && (i.disabled || i.readonly || e && (V.value || await Q()));
|
|
382
|
+
});
|
|
383
|
+
let $ = () => {
|
|
384
|
+
V.value && (V.value = !1, B.value = void 0, b("close"));
|
|
385
|
+
}, ut = () => {
|
|
386
|
+
!i.closeOnSelect || X.value || $();
|
|
387
|
+
};
|
|
388
|
+
se(l, (e, t) => {
|
|
389
|
+
!i.closeOnSelect || X.value || !V.value || !e || e === t || $();
|
|
390
|
+
});
|
|
391
|
+
let dt = (e) => {
|
|
392
|
+
V.value && e.target instanceof Element && e.target.closest(".s-ui-list-item") && ut();
|
|
393
|
+
}, ft = async (e) => {
|
|
394
|
+
e.key !== "Enter" && e.key !== " " && e.key !== "Spacebar" || V.value && (await w(), ut());
|
|
395
|
+
}, pt = async () => {
|
|
396
|
+
if (V.value) {
|
|
397
|
+
$();
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
await Q();
|
|
401
|
+
}, mt = async (e) => {
|
|
402
|
+
if (!(i.disabled || i.readonly) && e.target instanceof HTMLElement) {
|
|
403
|
+
if (e.target.closest(".s-ui-select__search-input")) {
|
|
404
|
+
V.value || await Q();
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
await pt();
|
|
408
|
+
}
|
|
409
|
+
}, ht = async (e) => e.key !== "ArrowDown" && e.key !== "ArrowUp" ? !1 : (e.preventDefault(), e.stopPropagation(), V.value || await Q(), await ct(), await z.value?.handleKeyboardNavigation(e), !0), gt = (e) => {
|
|
410
|
+
let t = Be(e);
|
|
411
|
+
if (t) {
|
|
412
|
+
if (X.value) {
|
|
413
|
+
G.value.some((t) => Z(t) === e) ? ze(t) : q.value = [...G.value.map((e) => Z(e)), e];
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
q.value = e, ut();
|
|
417
|
+
}
|
|
418
|
+
}, _t = async (e) => {
|
|
419
|
+
if (!(i.disabled || i.readonly) && !await ht(e)) {
|
|
420
|
+
if (e.key === "Escape") {
|
|
421
|
+
e.preventDefault(), $();
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
425
|
+
if (e.preventDefault(), V.value && B.value) {
|
|
426
|
+
gt(B.value);
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
await pt();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}, vt = async (e) => {
|
|
433
|
+
if (e.key === "Escape") {
|
|
434
|
+
e.preventDefault(), $();
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
await ht(e);
|
|
438
|
+
}, yt = vt, bt = (e) => {
|
|
439
|
+
i.disabled || (H.value || b("focus", e), H.value = !0);
|
|
440
|
+
}, xt = (e) => {
|
|
441
|
+
if (!(e.currentTarget instanceof HTMLElement)) return;
|
|
442
|
+
let t = e.relatedTarget;
|
|
443
|
+
t instanceof Node && e.currentTarget.contains(t) || (H.value = !1, b("blur", e));
|
|
444
|
+
}, St = () => {
|
|
445
|
+
Re(), b("clear");
|
|
446
|
+
};
|
|
447
|
+
return o({
|
|
448
|
+
open: Q,
|
|
449
|
+
close: $,
|
|
450
|
+
toggle: pt,
|
|
451
|
+
focusSearchInput: ot
|
|
452
|
+
}), (o, c) => (O(), g("div", { class: T(["s-ui-select", at.value]) }, [y(M(a), {
|
|
453
|
+
modelValue: V.value,
|
|
454
|
+
"onUpdate:modelValue": c[4] ||= (e) => V.value = e,
|
|
455
|
+
reference: nt.value,
|
|
456
|
+
disabled: i.disabled,
|
|
457
|
+
"match-reference-width": !0,
|
|
458
|
+
"fit-viewport": i.fitViewport,
|
|
459
|
+
"content-id": tt.value,
|
|
460
|
+
"dismiss-on-click-outside": !0,
|
|
461
|
+
"dismiss-on-escape": !0
|
|
462
|
+
}, {
|
|
463
|
+
content: P(() => [y(M(me), {
|
|
464
|
+
class: "s-ui-select__menu",
|
|
465
|
+
width: "100%"
|
|
466
|
+
}, v({
|
|
467
|
+
default: P(() => [_("div", {
|
|
468
|
+
class: "s-ui-select__menu-body",
|
|
469
|
+
onClick: dt,
|
|
470
|
+
onKeydown: ft
|
|
471
|
+
}, [M(K).length > 0 ? (O(), m(M(d), {
|
|
472
|
+
key: 0,
|
|
473
|
+
ref_key: "listElementRef",
|
|
474
|
+
ref: z,
|
|
475
|
+
modelValue: B.value,
|
|
476
|
+
"onUpdate:modelValue": c[2] ||= (e) => B.value = e,
|
|
477
|
+
selected: M(q),
|
|
478
|
+
"onUpdate:selected": c[3] ||= (e) => te(q) ? q.value = e : null,
|
|
479
|
+
items: Xe.value,
|
|
480
|
+
"item-key": U.value,
|
|
481
|
+
"title-key": i.itemTitle,
|
|
482
|
+
"subtitle-key": i.itemSubtitle,
|
|
483
|
+
"icon-left-key": i.itemIconLeft,
|
|
484
|
+
"disabled-key": i.itemDisabled,
|
|
485
|
+
"selection-mode": M(_e),
|
|
486
|
+
mandatory: !i.multiple,
|
|
487
|
+
height: We.value,
|
|
488
|
+
"max-height": Ge.value,
|
|
489
|
+
virtual: Ue.value,
|
|
490
|
+
"item-props": Ze
|
|
491
|
+
}, v({ _: 2 }, [M(D).option || M(D)["option-icon"] || i.closableOptions || M(X) ? {
|
|
492
|
+
name: "item",
|
|
493
|
+
fn: P((a) => [a.key === je ? (O(), g("div", be)) : M(D).option ? k(o.$slots, "option", E(C({ key: 1 }, a))) : i.closableOptions ? (O(), m(M(f), E(C({ key: 2 }, Qe(a))), v({ _: 2 }, [M(D)["option-icon"] ? {
|
|
494
|
+
name: "icon-left",
|
|
495
|
+
fn: P(() => [k(o.$slots, "option-icon", E(x(a)))]),
|
|
496
|
+
key: "0"
|
|
497
|
+
} : void 0, qe(a.key) ? {
|
|
498
|
+
name: "right",
|
|
499
|
+
fn: P((i) => [y(M(r), {
|
|
500
|
+
appearance: M(n).BARE,
|
|
501
|
+
variant: M(t).NEUTRAL,
|
|
502
|
+
size: M(e).SMALL,
|
|
503
|
+
icon: "closeMini",
|
|
504
|
+
"aria-label": M(S)("select.removeOption"),
|
|
505
|
+
disabled: i.disabled || i.readonly,
|
|
506
|
+
tabindex: -1,
|
|
507
|
+
onClick: le((e) => $e(a.key), ["stop"])
|
|
508
|
+
}, null, 8, [
|
|
509
|
+
"appearance",
|
|
510
|
+
"variant",
|
|
511
|
+
"size",
|
|
512
|
+
"aria-label",
|
|
513
|
+
"disabled",
|
|
514
|
+
"onClick"
|
|
515
|
+
])]),
|
|
516
|
+
key: "1"
|
|
517
|
+
} : void 0]), 1040)) : (O(), m(M(f), E(C({ key: 3 }, Qe(a))), v({ _: 2 }, [M(D)["option-icon"] ? {
|
|
518
|
+
name: "icon-left",
|
|
519
|
+
fn: P(() => [k(o.$slots, "option-icon", E(x(a)))]),
|
|
520
|
+
key: "0"
|
|
521
|
+
} : void 0]), 1040))]),
|
|
522
|
+
key: "0"
|
|
523
|
+
} : void 0]), 1032, [
|
|
524
|
+
"modelValue",
|
|
525
|
+
"selected",
|
|
526
|
+
"items",
|
|
527
|
+
"item-key",
|
|
528
|
+
"title-key",
|
|
529
|
+
"subtitle-key",
|
|
530
|
+
"icon-left-key",
|
|
531
|
+
"disabled-key",
|
|
532
|
+
"selection-mode",
|
|
533
|
+
"mandatory",
|
|
534
|
+
"height",
|
|
535
|
+
"max-height",
|
|
536
|
+
"virtual"
|
|
537
|
+
])) : (O(), g("div", xe, [k(o.$slots, "empty", {}, () => [ee(A(M(S)("select.noOptions")), 1)])]))], 32)]),
|
|
538
|
+
_: 2
|
|
539
|
+
}, [M(Y) ? {
|
|
540
|
+
name: "header",
|
|
541
|
+
fn: P(() => [y(M(s), {
|
|
542
|
+
ref_key: "panelSearchInputElementRef",
|
|
543
|
+
ref: R,
|
|
544
|
+
modelValue: u.value,
|
|
545
|
+
"onUpdate:modelValue": c[0] ||= (e) => u.value = e,
|
|
546
|
+
placeholder: i.searchPlaceholder,
|
|
547
|
+
disabled: i.disabled,
|
|
548
|
+
clearable: !1,
|
|
549
|
+
"icon-left": "search",
|
|
550
|
+
onClick: c[1] ||= le(() => {}, ["stop"]),
|
|
551
|
+
onKeydown: M(yt)
|
|
552
|
+
}, null, 8, [
|
|
553
|
+
"modelValue",
|
|
554
|
+
"placeholder",
|
|
555
|
+
"disabled",
|
|
556
|
+
"onKeydown"
|
|
557
|
+
])]),
|
|
558
|
+
key: "0"
|
|
559
|
+
} : void 0, M(D)["panel-footer"] ? {
|
|
560
|
+
name: "footer",
|
|
561
|
+
fn: P(() => [k(o.$slots, "panel-footer")]),
|
|
562
|
+
key: "1"
|
|
563
|
+
} : void 0]), 1024)]),
|
|
564
|
+
_: 3
|
|
565
|
+
}, 8, [
|
|
566
|
+
"modelValue",
|
|
567
|
+
"reference",
|
|
568
|
+
"disabled",
|
|
569
|
+
"fit-viewport",
|
|
570
|
+
"content-id"
|
|
571
|
+
]), y(M(s), {
|
|
572
|
+
ref_key: "triggerInputRef",
|
|
573
|
+
ref: pe,
|
|
574
|
+
modelValue: ge.value,
|
|
575
|
+
"onUpdate:modelValue": c[7] ||= (e) => ge.value = e,
|
|
576
|
+
label: i.label,
|
|
577
|
+
"label-props": i.labelProps,
|
|
578
|
+
placeholder: i.placeholder,
|
|
579
|
+
"help-messages": i.helpMessages,
|
|
580
|
+
"error-messages": i.errorMessages,
|
|
581
|
+
bordered: i.bordered,
|
|
582
|
+
disabled: i.disabled,
|
|
583
|
+
readonly: i.readonly,
|
|
584
|
+
clearable: i.clearable,
|
|
585
|
+
"has-value": M(ve),
|
|
586
|
+
focused: H.value || V.value,
|
|
587
|
+
"icon-left": i.iconLeft,
|
|
588
|
+
customize: i.customize,
|
|
589
|
+
name: i.name,
|
|
590
|
+
id: et.value,
|
|
591
|
+
onClear: St,
|
|
592
|
+
onFocus: bt,
|
|
593
|
+
onBlur: xt
|
|
594
|
+
}, v({
|
|
595
|
+
control: P(() => [_("div", {
|
|
596
|
+
id: et.value,
|
|
597
|
+
class: T(["s-ui-select__control s-ui-typography-body-14-regular", {
|
|
598
|
+
"s-ui-select__control--multiple": M(X),
|
|
599
|
+
"s-ui-select__control--empty": M(X) && !M(ve) && !M(J),
|
|
600
|
+
"s-ui-select__control--with-value-suffix": Ve.value && !M(X) && !M(J) && !M(Fe)
|
|
601
|
+
}]),
|
|
602
|
+
role: "combobox",
|
|
603
|
+
"aria-expanded": V.value,
|
|
604
|
+
"aria-controls": tt.value,
|
|
605
|
+
"aria-haspopup": "listbox",
|
|
606
|
+
"aria-disabled": i.disabled ? !0 : void 0,
|
|
607
|
+
"aria-readonly": i.readonly ? !0 : void 0,
|
|
608
|
+
"aria-autocomplete": M(Ie) ? "list" : void 0,
|
|
609
|
+
tabindex: it.value,
|
|
610
|
+
onClick: mt,
|
|
611
|
+
onKeydown: _t
|
|
612
|
+
}, [
|
|
613
|
+
M(X) ? k(o.$slots, "selection", E(C({ key: 0 }, rt.value)), () => [M(Pe) ? (O(), g("span", Ce, A(M(Pe)), 1)) : M(Fe) && !M(J) ? (O(), g("span", we, A(i.placeholder), 1)) : h("", !0)]) : M(Fe) && !M(J) ? (O(), g("span", Te, A(i.placeholder), 1)) : M(J) ? h("", !0) : (O(), g("span", Ee, A(M(Me)), 1)),
|
|
614
|
+
Ve.value && !M(X) && !M(J) && !M(Fe) ? (O(), g("div", De, [k(o.$slots, "value-suffix", E(x(He.value)))])) : h("", !0),
|
|
615
|
+
M(J) ? ce((O(), g("input", {
|
|
616
|
+
key: 4,
|
|
617
|
+
ref_key: "searchInputElementRef",
|
|
618
|
+
ref: I,
|
|
619
|
+
"onUpdate:modelValue": c[5] ||= (e) => u.value = e,
|
|
620
|
+
class: "s-ui-select__search-input",
|
|
621
|
+
type: "text",
|
|
622
|
+
name: i.name,
|
|
623
|
+
placeholder: i.placeholder,
|
|
624
|
+
disabled: i.disabled,
|
|
625
|
+
readonly: i.readonly,
|
|
626
|
+
autocomplete: "off",
|
|
627
|
+
onClick: c[6] ||= le(() => {}, ["stop"]),
|
|
628
|
+
onFocus: lt,
|
|
629
|
+
onKeydown: vt
|
|
630
|
+
}, null, 40, Oe)), [[oe, u.value]]) : h("", !0)
|
|
631
|
+
], 42, Se)]),
|
|
632
|
+
action: P(() => [y(M(ue), {
|
|
633
|
+
name: "chevronMiniDown",
|
|
634
|
+
size: ke,
|
|
635
|
+
class: "s-ui-select__chevron"
|
|
636
|
+
})]),
|
|
637
|
+
_: 2
|
|
638
|
+
}, [
|
|
639
|
+
M(D).label ? {
|
|
640
|
+
name: "label",
|
|
641
|
+
fn: P(() => [k(o.$slots, "label")]),
|
|
642
|
+
key: "0"
|
|
643
|
+
} : void 0,
|
|
644
|
+
M(D).prefix ? {
|
|
645
|
+
name: "prefix",
|
|
646
|
+
fn: P((e) => [k(o.$slots, "prefix", E(x(e)))]),
|
|
647
|
+
key: "1"
|
|
648
|
+
} : void 0,
|
|
649
|
+
M(D).prepend ? {
|
|
650
|
+
name: "prepend",
|
|
651
|
+
fn: P((e) => [k(o.$slots, "prepend", E(x(e)))]),
|
|
652
|
+
key: "2"
|
|
653
|
+
} : void 0,
|
|
654
|
+
M(D).message ? {
|
|
655
|
+
name: "message",
|
|
656
|
+
fn: P(() => [k(o.$slots, "message")]),
|
|
657
|
+
key: "3"
|
|
658
|
+
} : void 0
|
|
659
|
+
]), 1032, [
|
|
660
|
+
"modelValue",
|
|
661
|
+
"label",
|
|
662
|
+
"label-props",
|
|
663
|
+
"placeholder",
|
|
664
|
+
"help-messages",
|
|
665
|
+
"error-messages",
|
|
666
|
+
"bordered",
|
|
667
|
+
"disabled",
|
|
668
|
+
"readonly",
|
|
669
|
+
"clearable",
|
|
670
|
+
"has-value",
|
|
671
|
+
"focused",
|
|
672
|
+
"icon-left",
|
|
673
|
+
"customize",
|
|
674
|
+
"name",
|
|
675
|
+
"id"
|
|
676
|
+
])], 2));
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
//#endregion
|
|
680
|
+
export { V as n, me as r, Me as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./SOverflowGroup-
|
|
1
|
+
const e=require("./SOverflowGroup-rmU10_7L.cjs"),t=require("./STag-D1mmp1kd.cjs");let n=require("vue");var r=(e,{size:r,short:i})=>e.type===t.t?(0,n.cloneVNode)(e,{size:r,short:i,...i?{closable:!1}:{}}):e,i=(0,n.defineComponent)({__name:`STagGroup`,props:{maxVisible:{},size:{default:()=>t.r.SMALL},short:{type:Boolean,default:!0}},setup(i){let a=e=>r(e,{size:i.size,short:i.short});return(r,o)=>((0,n.openBlock)(),(0,n.createBlock)(e.t,{class:`s-ui-tag-group`,role:`group`,"cluster-class":`s-ui-tag-group__cluster`,"max-visible":i.maxVisible,"map-vnode":a},{overflow:(0,n.withCtx)(({overflowLabel:e})=>[(0,n.createVNode)((0,n.unref)(t.t),{color:(0,n.unref)(t.n).WHITE_BORDER,size:i.size,short:!1,"model-value":e},null,8,[`color`,`size`,`model-value`])]),default:(0,n.withCtx)(()=>[(0,n.renderSlot)(r.$slots,`default`)]),_:3},8,[`max-visible`]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./SOverflowGroup-
|
|
1
|
+
import { t as e } from "./SOverflowGroup-CyksOav7.js";
|
|
2
2
|
import { n as t, r as n, t as r } from "./STag-CluIVRKi.js";
|
|
3
3
|
import { cloneVNode as i, createBlock as a, createVNode as o, defineComponent as s, openBlock as c, renderSlot as l, unref as u, withCtx as d } from "vue";
|
|
4
4
|
//#region src/components/STagGroup/utils/applyTagGroupItemProps.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("vue");var t=function(e){return e.SMALL=`small`,e.MEDIUM=`medium`,e.LARGE=`large`,e}({}),n=function(e){return e.LEFT=`left`,e.RIGHT=`right`,e}({}),r=[`disabled`,`name`],i={key:0,class:`s-ui-toggle__content`},a={key:0,class:`s-ui-toggle__label s-ui-typography-label-14-medium`},o={key:1,class:`s-ui-toggle__description s-ui-typography-body-12-regular`},s=(0,e.defineComponent)({__name:`SToggle`,props:(0,e.mergeModels)({disabled:{type:Boolean,default:!1},labelPlacement:{default:()=>n.LEFT},name:{},size:{default:()=>t.LARGE}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:(0,e.mergeModels)([`change`],[`update:modelValue`]),setup(t,{emit:s}){let c=(0,e.useModel)(t,`modelValue`),l=s,u=(0,e.useSlots)(),d=(0,e.computed)(()=>!!(u.default||u.description)),f=(0,e.computed)(()=>[`s-ui-toggle--size-${t.size}`,{"s-ui-toggle--checked":c.value,"s-ui-toggle--disabled":t.disabled,"s-ui-toggle--label-right":t.labelPlacement===n.RIGHT,"s-ui-toggle--control-only":!d.value}]),p=e=>{e.target instanceof HTMLInputElement&&l(`change`,e.target.checked)};return(n,s)=>((0,e.openBlock)(),(0,e.createElementBlock)(`label`,{class:(0,e.normalizeClass)([`s-ui-toggle`,f.value])},[(0,e.withDirectives)((0,e.createElementVNode)(`input`,{"onUpdate:modelValue":s[0]||=e=>c.value=e,type:`checkbox`,role:`switch`,class:`s-ui-toggle__input`,disabled:t.disabled,name:t.name,onChange:p},null,40,r),[[e.vModelCheckbox,c.value]]),s[1]||=(0,e.createElementVNode)(`span`,{class:`s-ui-toggle__track`},[(0,e.createElementVNode)(`span`,{class:`s-ui-toggle__thumb-shell`},[(0,e.createElementVNode)(`span`,{class:`s-ui-toggle__thumb`})])],-1),d.value?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,i,[(0,e.unref)(u).default?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,a,[(0,e.renderSlot)(n.$slots,`default`)])):(0,e.createCommentVNode)(``,!0),(0,e.unref)(u).description?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,o,[(0,e.renderSlot)(n.$slots,`description`)])):(0,e.createCommentVNode)(``,!0)])):(0,e.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|