@shtabapp/ui-kit 1.52.0 → 1.54.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 +16 -0
- package/dist/{SCard-BkmIQd2s.js → SCard-BPYqNqDs.js} +1 -1
- package/dist/{SCard-BzIQoACi.cjs → SCard-BZ2TUqpd.cjs} +1 -1
- package/dist/SCheckbox-BAPXAjnl.cjs +1 -0
- package/dist/SCheckbox-CU6nzXrI.js +103 -0
- package/dist/{SColorPicker-C1wT4fRa.js → SColorPicker-BhJiFjkD.js} +1 -1
- package/dist/{SColorPicker-hCvgFpwK.cjs → SColorPicker-DUTOeRA_.cjs} +1 -1
- package/dist/{SRadio-BZKPhGwO.js → SRadio-C1CfSeb_.js} +2 -2
- package/dist/SRadio-xfAIUC2I.cjs +1 -0
- package/dist/SSelect-BEvgscGV.cjs +1 -0
- package/dist/{SSelect-Bf1lDJ0M.js → SSelect-Cwlr2ruO.js} +164 -159
- package/dist/{SToggle-BgCgar2U.js → SToggle-CSz9gHYO.js} +3 -3
- package/dist/SToggle-CXl6RWi1.cjs +1 -0
- package/dist/components/SCheckbox/SCheckbox.types.d.ts +6 -0
- package/dist/components/SCheckbox/SCheckbox.types.d.ts.map +1 -1
- package/dist/components/SCheckbox/SCheckbox.vue.d.ts +11 -1
- package/dist/components/SCheckbox/SCheckbox.vue.d.ts.map +1 -1
- package/dist/components/SCheckbox/index.d.ts +1 -1
- package/dist/components/SCheckbox/index.d.ts.map +1 -1
- package/dist/components/SSelect/SSelect.types.d.ts +7 -0
- package/dist/components/SSelect/SSelect.types.d.ts.map +1 -1
- package/dist/components/SSelect/SSelect.vue.d.ts.map +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.d.ts +1 -1
- package/dist/entries/checkbox.d.ts.map +1 -1
- package/dist/entries/checkbox.js +2 -2
- package/dist/entries/color-picker.cjs +1 -1
- package/dist/entries/color-picker.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/toggle.cjs +1 -1
- package/dist/entries/toggle.d.ts +1 -1
- package/dist/entries/toggle.d.ts.map +1 -1
- package/dist/entries/toggle.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +245 -245
- package/dist/uikit-components.css +1 -1
- package/package.json +3 -3
- package/dist/SCheckbox-BXV4bPOv.js +0 -76
- package/dist/SCheckbox-D_YLWg6a.cjs +0 -1
- package/dist/SRadio-CcmuHaKk.cjs +0 -1
- package/dist/SSelect-CPm2SRpw.cjs +0 -1
- package/dist/SToggle-B5EdI-rG.cjs +0 -1
|
@@ -57,52 +57,52 @@ var de = {
|
|
|
57
57
|
}, he = (e) => typeof e == "string" || typeof e == "number", I = (e, t) => {
|
|
58
58
|
let n = e[t];
|
|
59
59
|
if (he(n)) return n;
|
|
60
|
-
}, L = (e) => typeof e == "string" ? e : String(e), R = (e) => e == null ? !1 : typeof e == "string" ? e.length > 0 : !0, z = (e, t, n) => t.find((t) => L(I(t, n) ?? "") === e),
|
|
60
|
+
}, L = (e) => typeof e == "string" ? e : String(e), R = (e) => e == null ? !1 : typeof e == "string" ? e.length > 0 : !0, z = (e, t, n) => t.find((t) => L(I(t, n) ?? "") === e), ge = (e) => typeof e == "object" && !!e, B = (e, t, n) => {
|
|
61
61
|
let r = z(e, t, n);
|
|
62
62
|
if (r) return I(r, n);
|
|
63
|
-
},
|
|
63
|
+
}, V = /* @__PURE__ */ function(e) {
|
|
64
64
|
return e.INPUT = "input", e.CONTENT = "content", e;
|
|
65
|
-
}({}),
|
|
65
|
+
}({}), H = (e, t, n) => {
|
|
66
66
|
if (!e) return !0;
|
|
67
67
|
let r = e.toLocaleLowerCase(), i = c(t, n.itemTitle)?.toLocaleLowerCase() ?? "", a = L(I(t, n.itemValue) ?? "").toLocaleLowerCase();
|
|
68
68
|
return i.includes(r) || a.includes(r);
|
|
69
|
-
},
|
|
70
|
-
let i = r ?? ((e, t) =>
|
|
69
|
+
}, _e = (e, t, n, r) => {
|
|
70
|
+
let i = r ?? ((e, t) => H(e, t, n));
|
|
71
71
|
return t ? e.filter((e) => i(t, e)) : [...e];
|
|
72
|
-
},
|
|
72
|
+
}, U = (e) => typeof e == "string" && R(e), W = (e) => typeof e == "number" && R(e), ve = (e, t, n) => {
|
|
73
73
|
if (t) {
|
|
74
|
-
if (!
|
|
74
|
+
if (!ge(e)) return;
|
|
75
75
|
let t = I(e, n);
|
|
76
|
-
return
|
|
76
|
+
return U(t) || W(t) ? t : void 0;
|
|
77
77
|
}
|
|
78
78
|
let r = typeof e == "string" || typeof e == "number" ? e : void 0;
|
|
79
|
-
if (
|
|
80
|
-
},
|
|
81
|
-
let r =
|
|
79
|
+
if (U(r) || W(r)) return r;
|
|
80
|
+
}, G = (e, t, n) => e ? (Array.isArray(e) ? e : [e]).flatMap((e) => {
|
|
81
|
+
let r = ve(e, t, n);
|
|
82
82
|
return R(r) ? [r] : [];
|
|
83
|
-
}) : [],
|
|
84
|
-
if (
|
|
83
|
+
}) : [], K = (e, t) => {
|
|
84
|
+
if (U(t)) {
|
|
85
85
|
e.value = t;
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
if (
|
|
88
|
+
if (W(t)) {
|
|
89
89
|
e.value = t;
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
e.value = void 0;
|
|
93
|
-
},
|
|
93
|
+
}, ye = (e, t, n) => t.flatMap((t) => {
|
|
94
94
|
let r = L(t), i = e.find((e) => L(I(e, n) ?? "") === r);
|
|
95
95
|
return i ? [i] : [];
|
|
96
|
-
}),
|
|
97
|
-
let d = p(() => j(r)), f = p(() => j(a)), m = p(() => j(o) ===
|
|
96
|
+
}), be = ({ 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
98
|
let t = j(n);
|
|
99
|
-
return
|
|
99
|
+
return G(e.value, f.value, t.itemValue);
|
|
100
100
|
}), v = p(() => {
|
|
101
101
|
let e = j(t), r = j(n);
|
|
102
|
-
return
|
|
102
|
+
return _e(e, g.value ? u.value : "", r, j(s));
|
|
103
103
|
}), ee = p(() => d.value ? i.MULTIPLE : i.SINGLE), y = (t, n, r) => {
|
|
104
104
|
if (f.value) {
|
|
105
|
-
e.value =
|
|
105
|
+
e.value = ye(n, t, r);
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
e.value = t;
|
|
@@ -115,7 +115,7 @@ var de = {
|
|
|
115
115
|
e.value = z(t, n, r) ?? void 0;
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
K(e, B(t, n, r));
|
|
119
119
|
}, x = p({
|
|
120
120
|
get: () => {
|
|
121
121
|
if (d.value) return _.value.map((e) => L(e));
|
|
@@ -125,7 +125,7 @@ var de = {
|
|
|
125
125
|
set: (e) => {
|
|
126
126
|
let r = j(t), i = j(n);
|
|
127
127
|
if (d.value) {
|
|
128
|
-
y((Array.isArray(e) ? e : []).map((e) =>
|
|
128
|
+
y((Array.isArray(e) ? e : []).map((e) => B(e, r, i.itemValue)).filter((e) => R(e)), r, i.itemValue);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
b(typeof e == "string" ? e : void 0, r, i.itemValue);
|
|
@@ -177,16 +177,16 @@ var de = {
|
|
|
177
177
|
},
|
|
178
178
|
resetSearchQuery: O,
|
|
179
179
|
formatSelectListKey: L,
|
|
180
|
-
resolveValueFromListKey: (e) =>
|
|
180
|
+
resolveValueFromListKey: (e) => B(e, j(t), j(n).itemValue)
|
|
181
181
|
};
|
|
182
|
-
},
|
|
182
|
+
}, xe = {
|
|
183
183
|
key: 0,
|
|
184
184
|
class: "s-ui-select__options-divider",
|
|
185
185
|
role: "separator"
|
|
186
|
-
},
|
|
186
|
+
}, Se = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "s-ui-select__empty s-ui-typography-body-14-regular"
|
|
189
|
-
},
|
|
189
|
+
}, Ce = [
|
|
190
190
|
"id",
|
|
191
191
|
"aria-expanded",
|
|
192
192
|
"aria-controls",
|
|
@@ -194,27 +194,27 @@ var de = {
|
|
|
194
194
|
"aria-readonly",
|
|
195
195
|
"aria-autocomplete",
|
|
196
196
|
"tabindex"
|
|
197
|
-
],
|
|
197
|
+
], we = {
|
|
198
198
|
key: 0,
|
|
199
199
|
class: "s-ui-select__value"
|
|
200
|
-
},
|
|
200
|
+
}, Te = {
|
|
201
201
|
key: 1,
|
|
202
202
|
class: "s-ui-select__placeholder"
|
|
203
|
-
},
|
|
203
|
+
}, Ee = {
|
|
204
204
|
key: 1,
|
|
205
205
|
class: "s-ui-select__placeholder"
|
|
206
|
-
},
|
|
206
|
+
}, De = {
|
|
207
207
|
key: 2,
|
|
208
208
|
class: "s-ui-select__value"
|
|
209
|
-
},
|
|
209
|
+
}, Oe = {
|
|
210
210
|
key: 3,
|
|
211
211
|
class: "s-ui-select__value-suffix"
|
|
212
|
-
},
|
|
212
|
+
}, ke = [
|
|
213
213
|
"name",
|
|
214
214
|
"placeholder",
|
|
215
215
|
"disabled",
|
|
216
216
|
"readonly"
|
|
217
|
-
],
|
|
217
|
+
], Ae = 20, je = "100%", Me = 20, Ne = "__s-ui-select-options-divider__", q = /* @__PURE__ */ b({
|
|
218
218
|
__name: "SSelect",
|
|
219
219
|
props: /*@__PURE__*/ S({
|
|
220
220
|
options: {},
|
|
@@ -255,6 +255,8 @@ var de = {
|
|
|
255
255
|
type: Boolean,
|
|
256
256
|
default: !0
|
|
257
257
|
},
|
|
258
|
+
panelWidth: {},
|
|
259
|
+
surfaceClass: {},
|
|
258
260
|
canLoadMore: { type: Function },
|
|
259
261
|
endReachedDistance: { default: 0 },
|
|
260
262
|
label: {},
|
|
@@ -293,216 +295,217 @@ var de = {
|
|
|
293
295
|
"endReached"
|
|
294
296
|
], ["update:modelValue", "update:searchQuery"]),
|
|
295
297
|
setup(i, { expose: o, emit: c }) {
|
|
296
|
-
let l = ie(i, "modelValue"), u = ie(i, "searchQuery"), b = c, { t: S } = ue(), D = ae(), j = re(), de = re(), fe = N("triggerInputRef"), he = ne(""), L = N("searchInputElementRef"), z = N("panelSearchInputElementRef"),
|
|
298
|
+
let l = ie(i, "modelValue"), u = ie(i, "searchQuery"), b = c, { t: S } = ue(), D = ae(), j = re(), de = re(), fe = N("triggerInputRef"), he = ne(""), L = N("searchInputElementRef"), z = N("panelSearchInputElementRef"), ge = N("listElementRef"), B = ne(), V = ne(!1), H = ne(!1), _e = p(() => i.panelWidth === void 0), U = p(() => i.panelWidth ?? je), W = p(() => i.itemId ?? i.itemValue), ve = p(() => ({
|
|
297
299
|
itemValue: i.itemValue,
|
|
298
300
|
itemTitle: i.itemTitle,
|
|
299
301
|
itemSubtitle: i.itemSubtitle,
|
|
300
302
|
itemId: W.value
|
|
301
|
-
})), { selectedValues:
|
|
303
|
+
})), { selectedValues: G, filteredOptions: K, listSelectionMode: ye, listSelectedModel: q, hasSelectedValues: Pe, singleDisplayLabel: Fe, multipleDisplayLabels: Ie, multipleDisplayText: Le, showPlaceholder: J, showInputSearchField: Y, isSearchableMode: Re, isSearchableInputMode: ze, isSearchableContentMode: X, isMultipleMode: Z, clearSelection: Be, removeSelectedValue: Ve, resolveValueFromListKey: He, formatSelectListKey: Ue } = be({
|
|
302
304
|
modelValue: l,
|
|
303
305
|
options: () => i.options,
|
|
304
|
-
itemFields: () =>
|
|
306
|
+
itemFields: () => ve.value,
|
|
305
307
|
multiple: () => i.multiple,
|
|
306
308
|
returnObject: () => i.returnObject,
|
|
307
309
|
searchable: () => i.searchable,
|
|
308
310
|
filterOption: () => i.filterOption,
|
|
309
|
-
isDropdownOpen:
|
|
311
|
+
isDropdownOpen: V,
|
|
310
312
|
searchQuery: u
|
|
311
|
-
}),
|
|
313
|
+
}), We = p(() => !!D["value-suffix"]), Ge = p(() => ({
|
|
312
314
|
disabled: i.disabled,
|
|
313
|
-
displayLabel:
|
|
314
|
-
})),
|
|
315
|
-
if (!(X.value ||
|
|
316
|
-
}),
|
|
317
|
-
[W.value]:
|
|
315
|
+
displayLabel: Fe.value
|
|
316
|
+
})), Ke = p(() => K.value.length > Me), qe = p(() => X.value || Ke.value ? i.listHeight : "auto"), Je = p(() => {
|
|
317
|
+
if (!(X.value || Ke.value)) return i.listHeight;
|
|
318
|
+
}), Ye = p(() => G.value.map((e) => Ue(e))), Xe = (e) => Ye.value.includes(e), Ze = p(() => ({
|
|
319
|
+
[W.value]: Ne,
|
|
318
320
|
[i.itemDisabled]: !0
|
|
319
|
-
})),
|
|
320
|
-
if (!Z.value) return
|
|
321
|
+
})), Qe = (e) => Ue(I(e, W.value) ?? ""), $e = p(() => {
|
|
322
|
+
if (!Z.value) return K.value;
|
|
321
323
|
let e = [], t = [];
|
|
322
|
-
for (let n of
|
|
323
|
-
return e.length === 0 || t.length === 0 ?
|
|
324
|
+
for (let n of K.value) Xe(Qe(n)) ? e.push(n) : t.push(n);
|
|
325
|
+
return e.length === 0 || t.length === 0 ? K.value : [
|
|
324
326
|
...e,
|
|
325
|
-
|
|
327
|
+
Ze.value,
|
|
326
328
|
...t
|
|
327
329
|
];
|
|
328
|
-
}),
|
|
330
|
+
}), et = () => ({ tiny: !0 }), tt = (e) => me({
|
|
329
331
|
listItemScope: e,
|
|
330
332
|
itemTitle: i.itemTitle,
|
|
331
333
|
itemSubtitle: i.itemSubtitle,
|
|
332
334
|
itemDisabled: i.itemDisabled,
|
|
333
335
|
itemIconLeft: i.itemIconLeft,
|
|
334
|
-
listActiveKey:
|
|
335
|
-
isOptionSelected:
|
|
336
|
-
}),
|
|
337
|
-
let t =
|
|
336
|
+
listActiveKey: B.value,
|
|
337
|
+
isOptionSelected: Xe(e.key)
|
|
338
|
+
}), nt = (e) => {
|
|
339
|
+
let t = He(e);
|
|
338
340
|
if (R(t)) {
|
|
339
341
|
if (Z.value) {
|
|
340
|
-
|
|
342
|
+
Ve(t);
|
|
341
343
|
return;
|
|
342
344
|
}
|
|
343
345
|
l.value = void 0;
|
|
344
346
|
}
|
|
345
|
-
},
|
|
346
|
-
labels:
|
|
347
|
-
values:
|
|
348
|
-
displayText:
|
|
347
|
+
}, rt = p(() => i.id ?? j), it = p(() => de), at = p(() => fe.value?.fieldElementRef ?? null), ot = p(() => ({
|
|
348
|
+
labels: Ie.value,
|
|
349
|
+
values: G.value,
|
|
350
|
+
displayText: Le.value,
|
|
349
351
|
disabled: i.disabled || i.readonly,
|
|
350
|
-
removeValue:
|
|
351
|
-
})),
|
|
352
|
-
if (!i.disabled && (i.readonly && !
|
|
353
|
-
}),
|
|
352
|
+
removeValue: Ve
|
|
353
|
+
})), st = p(() => {
|
|
354
|
+
if (!i.disabled && (i.readonly && !ze.value || !ze.value)) return 0;
|
|
355
|
+
}), ct = p(() => ({
|
|
354
356
|
"s-ui-select--disabled": i.disabled,
|
|
355
357
|
"s-ui-select--readonly": i.readonly,
|
|
356
358
|
"s-ui-select--multiple": Z.value,
|
|
357
|
-
"s-ui-select--open":
|
|
358
|
-
})),
|
|
359
|
+
"s-ui-select--open": V.value
|
|
360
|
+
})), lt = () => {
|
|
359
361
|
if (X.value) {
|
|
360
362
|
z.value?.focus();
|
|
361
363
|
return;
|
|
362
364
|
}
|
|
363
365
|
L.value?.focus();
|
|
364
|
-
},
|
|
366
|
+
}, ut = async () => {
|
|
365
367
|
await w(), z.value?.focus();
|
|
366
|
-
},
|
|
367
|
-
await w(), await
|
|
368
|
+
}, dt = async () => {
|
|
369
|
+
await w(), await ge.value?.focusNavigation();
|
|
368
370
|
}, Q = async () => {
|
|
369
|
-
if (!(i.disabled || i.readonly) && !
|
|
370
|
-
if (
|
|
371
|
-
await
|
|
371
|
+
if (!(i.disabled || i.readonly) && !V.value) {
|
|
372
|
+
if (V.value = !0, b("open"), X.value) {
|
|
373
|
+
await ut();
|
|
372
374
|
return;
|
|
373
375
|
}
|
|
374
|
-
if (
|
|
376
|
+
if (ze.value) {
|
|
375
377
|
await w(), L.value?.focus();
|
|
376
378
|
return;
|
|
377
379
|
}
|
|
378
|
-
await
|
|
380
|
+
await dt();
|
|
379
381
|
}
|
|
380
|
-
},
|
|
381
|
-
i.disabled || i.readonly ||
|
|
382
|
+
}, ft = async () => {
|
|
383
|
+
i.disabled || i.readonly || V.value || await Q();
|
|
382
384
|
};
|
|
383
385
|
P(u, async (e) => {
|
|
384
|
-
|
|
386
|
+
ze.value && (i.disabled || i.readonly || e && (V.value || await Q()));
|
|
385
387
|
});
|
|
386
388
|
let $ = () => {
|
|
387
|
-
|
|
388
|
-
},
|
|
389
|
+
V.value && (V.value = !1, B.value = void 0, b("close"));
|
|
390
|
+
}, pt = () => {
|
|
389
391
|
!i.closeOnSelect || Z.value || $();
|
|
390
392
|
};
|
|
391
393
|
P(l, (e, t) => {
|
|
392
|
-
!i.closeOnSelect || Z.value || !
|
|
394
|
+
!i.closeOnSelect || Z.value || !V.value || !e || e === t || $();
|
|
393
395
|
});
|
|
394
|
-
let
|
|
395
|
-
|
|
396
|
-
},
|
|
397
|
-
e.key !== "Enter" && e.key !== " " && e.key !== "Spacebar" ||
|
|
398
|
-
},
|
|
399
|
-
if (
|
|
396
|
+
let mt = (e) => {
|
|
397
|
+
V.value && e.target instanceof Element && e.target.closest(".s-ui-list-item") && pt();
|
|
398
|
+
}, ht = async (e) => {
|
|
399
|
+
e.key !== "Enter" && e.key !== " " && e.key !== "Spacebar" || V.value && (await w(), pt());
|
|
400
|
+
}, gt = async () => {
|
|
401
|
+
if (V.value) {
|
|
400
402
|
$();
|
|
401
403
|
return;
|
|
402
404
|
}
|
|
403
405
|
await Q();
|
|
404
|
-
},
|
|
406
|
+
}, _t = async (e) => {
|
|
405
407
|
if (!(i.disabled || i.readonly) && e.target instanceof HTMLElement) {
|
|
406
408
|
if (e.target.closest(".s-ui-select__search-input")) {
|
|
407
|
-
|
|
409
|
+
V.value || await Q();
|
|
408
410
|
return;
|
|
409
411
|
}
|
|
410
|
-
await
|
|
412
|
+
await gt();
|
|
411
413
|
}
|
|
412
|
-
},
|
|
413
|
-
let t =
|
|
414
|
+
}, vt = async (e) => e.key !== "ArrowDown" && e.key !== "ArrowUp" ? !1 : (e.preventDefault(), e.stopPropagation(), V.value || await Q(), await dt(), await ge.value?.handleKeyboardNavigation(e), !0), yt = (e) => {
|
|
415
|
+
let t = He(e);
|
|
414
416
|
if (t) {
|
|
415
417
|
if (Z.value) {
|
|
416
|
-
|
|
418
|
+
G.value.some((t) => Ue(t) === e) ? Ve(t) : q.value = [...G.value.map((e) => Ue(e)), e];
|
|
417
419
|
return;
|
|
418
420
|
}
|
|
419
|
-
|
|
421
|
+
q.value = e, pt();
|
|
420
422
|
}
|
|
421
|
-
},
|
|
422
|
-
if (!(i.disabled || i.readonly) && !await
|
|
423
|
+
}, bt = async (e) => {
|
|
424
|
+
if (!(i.disabled || i.readonly) && !await vt(e)) {
|
|
423
425
|
if (e.key === "Escape") {
|
|
424
426
|
e.preventDefault(), $();
|
|
425
427
|
return;
|
|
426
428
|
}
|
|
427
429
|
if (e.key === "Enter" || e.key === " ") {
|
|
428
|
-
if (e.preventDefault(),
|
|
429
|
-
|
|
430
|
+
if (e.preventDefault(), V.value && B.value) {
|
|
431
|
+
yt(B.value);
|
|
430
432
|
return;
|
|
431
433
|
}
|
|
432
|
-
await
|
|
434
|
+
await gt();
|
|
433
435
|
}
|
|
434
436
|
}
|
|
435
|
-
},
|
|
437
|
+
}, xt = async (e) => {
|
|
436
438
|
if (e.key === "Escape") {
|
|
437
439
|
e.preventDefault(), $();
|
|
438
440
|
return;
|
|
439
441
|
}
|
|
440
|
-
await
|
|
441
|
-
},
|
|
442
|
-
i.disabled || (
|
|
443
|
-
},
|
|
442
|
+
await vt(e);
|
|
443
|
+
}, St = xt, Ct = (e) => {
|
|
444
|
+
i.disabled || (H.value || b("focus", e), H.value = !0);
|
|
445
|
+
}, wt = (e) => {
|
|
444
446
|
if (!(e.currentTarget instanceof HTMLElement)) return;
|
|
445
447
|
let t = e.relatedTarget;
|
|
446
|
-
t instanceof Node && e.currentTarget.contains(t) || (
|
|
447
|
-
},
|
|
448
|
-
|
|
449
|
-
},
|
|
448
|
+
t instanceof Node && e.currentTarget.contains(t) || (H.value = !1, b("blur", e));
|
|
449
|
+
}, Tt = () => {
|
|
450
|
+
Be(), b("clear");
|
|
451
|
+
}, Et = (e) => {
|
|
450
452
|
b("endReached", e);
|
|
451
453
|
};
|
|
452
454
|
return o({
|
|
453
455
|
open: Q,
|
|
454
456
|
close: $,
|
|
455
|
-
toggle:
|
|
456
|
-
focusSearchInput:
|
|
457
|
-
}), (o, c) => (O(), g("div", { class: T(["s-ui-select",
|
|
458
|
-
modelValue:
|
|
459
|
-
"onUpdate:modelValue": c[4] ||= (e) =>
|
|
460
|
-
reference:
|
|
457
|
+
toggle: gt,
|
|
458
|
+
focusSearchInput: lt
|
|
459
|
+
}), (o, c) => (O(), g("div", { class: T(["s-ui-select", ct.value]) }, [y(M(a), {
|
|
460
|
+
modelValue: V.value,
|
|
461
|
+
"onUpdate:modelValue": c[4] ||= (e) => V.value = e,
|
|
462
|
+
reference: at.value,
|
|
461
463
|
disabled: i.disabled,
|
|
462
|
-
"match-reference-width":
|
|
464
|
+
"match-reference-width": _e.value,
|
|
463
465
|
"fit-viewport": i.fitViewport,
|
|
464
|
-
"
|
|
466
|
+
"surface-class": i.surfaceClass,
|
|
467
|
+
"content-id": it.value,
|
|
465
468
|
"dismiss-on-click-outside": !0,
|
|
466
469
|
"dismiss-on-escape": !0
|
|
467
470
|
}, {
|
|
468
471
|
content: F(() => [y(M(pe), {
|
|
469
472
|
class: "s-ui-select__menu",
|
|
470
|
-
width:
|
|
473
|
+
width: U.value
|
|
471
474
|
}, v({
|
|
472
475
|
default: F(() => [_("div", {
|
|
473
476
|
class: "s-ui-select__menu-body",
|
|
474
|
-
onClick:
|
|
475
|
-
onKeydown:
|
|
476
|
-
}, [M(
|
|
477
|
+
onClick: mt,
|
|
478
|
+
onKeydown: ht
|
|
479
|
+
}, [M(K).length > 0 ? (O(), m(M(d), {
|
|
477
480
|
key: 0,
|
|
478
481
|
ref_key: "listElementRef",
|
|
479
|
-
ref:
|
|
480
|
-
modelValue:
|
|
481
|
-
"onUpdate:modelValue": c[2] ||= (e) =>
|
|
482
|
-
selected: M(
|
|
483
|
-
"onUpdate:selected": c[3] ||= (e) => te(
|
|
484
|
-
items:
|
|
482
|
+
ref: ge,
|
|
483
|
+
modelValue: B.value,
|
|
484
|
+
"onUpdate:modelValue": c[2] ||= (e) => B.value = e,
|
|
485
|
+
selected: M(q),
|
|
486
|
+
"onUpdate:selected": c[3] ||= (e) => te(q) ? q.value = e : null,
|
|
487
|
+
items: $e.value,
|
|
485
488
|
"item-key": W.value,
|
|
486
489
|
"title-key": i.itemTitle,
|
|
487
490
|
"subtitle-key": i.itemSubtitle,
|
|
488
491
|
"icon-left-key": i.itemIconLeft,
|
|
489
492
|
"disabled-key": i.itemDisabled,
|
|
490
|
-
"selection-mode": M(
|
|
493
|
+
"selection-mode": M(ye),
|
|
491
494
|
mandatory: !i.multiple,
|
|
492
|
-
height:
|
|
493
|
-
"max-height":
|
|
494
|
-
virtual:
|
|
495
|
-
"item-props":
|
|
495
|
+
height: qe.value,
|
|
496
|
+
"max-height": Je.value,
|
|
497
|
+
virtual: Ke.value,
|
|
498
|
+
"item-props": et,
|
|
496
499
|
"can-load-more": i.canLoadMore,
|
|
497
500
|
"end-reached-distance": i.endReachedDistance,
|
|
498
|
-
onEndReached:
|
|
501
|
+
onEndReached: Et
|
|
499
502
|
}, v({ _: 2 }, [M(D).option || M(D)["option-icon"] || i.closableOptions || M(Z) ? {
|
|
500
503
|
name: "item",
|
|
501
|
-
fn: F((a) => [a.key ===
|
|
504
|
+
fn: F((a) => [a.key === Ne ? (O(), g("div", xe)) : M(D).option ? k(o.$slots, "option", E(C({ key: 1 }, a))) : i.closableOptions ? (O(), m(M(f), E(C({ key: 2 }, tt(a))), v({ _: 2 }, [M(D)["option-icon"] ? {
|
|
502
505
|
name: "icon-left",
|
|
503
506
|
fn: F(() => [k(o.$slots, "option-icon", E(x(a)))]),
|
|
504
507
|
key: "0"
|
|
505
|
-
} : void 0,
|
|
508
|
+
} : void 0, Xe(a.key) ? {
|
|
506
509
|
name: "right",
|
|
507
510
|
fn: F((i) => [y(M(r), {
|
|
508
511
|
appearance: M(n).BARE,
|
|
@@ -512,7 +515,7 @@ var de = {
|
|
|
512
515
|
"aria-label": M(S)("select.removeOption"),
|
|
513
516
|
disabled: i.disabled || i.readonly,
|
|
514
517
|
tabindex: -1,
|
|
515
|
-
onClick: ce((e) =>
|
|
518
|
+
onClick: ce((e) => nt(a.key), ["stop"])
|
|
516
519
|
}, null, 8, [
|
|
517
520
|
"appearance",
|
|
518
521
|
"variant",
|
|
@@ -522,7 +525,7 @@ var de = {
|
|
|
522
525
|
"onClick"
|
|
523
526
|
])]),
|
|
524
527
|
key: "1"
|
|
525
|
-
} : void 0]), 1040)) : (O(), m(M(f), E(C({ key: 3 },
|
|
528
|
+
} : void 0]), 1040)) : (O(), m(M(f), E(C({ key: 3 }, tt(a))), v({ _: 2 }, [M(D)["option-icon"] ? {
|
|
526
529
|
name: "icon-left",
|
|
527
530
|
fn: F(() => [k(o.$slots, "option-icon", E(x(a)))]),
|
|
528
531
|
key: "0"
|
|
@@ -544,7 +547,7 @@ var de = {
|
|
|
544
547
|
"virtual",
|
|
545
548
|
"can-load-more",
|
|
546
549
|
"end-reached-distance"
|
|
547
|
-
])) : (O(), g("div",
|
|
550
|
+
])) : (O(), g("div", Se, [k(o.$slots, "empty", {}, () => [ee(A(M(S)("select.noOptions")), 1)])]))], 32)]),
|
|
548
551
|
_: 2
|
|
549
552
|
}, [M(X) || M(D)["panel-header"] ? {
|
|
550
553
|
name: "header",
|
|
@@ -559,7 +562,7 @@ var de = {
|
|
|
559
562
|
clearable: !1,
|
|
560
563
|
"icon-left": "search",
|
|
561
564
|
onClick: c[1] ||= ce(() => {}, ["stop"]),
|
|
562
|
-
onKeydown: M(
|
|
565
|
+
onKeydown: M(St)
|
|
563
566
|
}, null, 8, [
|
|
564
567
|
"modelValue",
|
|
565
568
|
"placeholder",
|
|
@@ -571,13 +574,15 @@ var de = {
|
|
|
571
574
|
name: "footer",
|
|
572
575
|
fn: F(() => [k(o.$slots, "panel-footer")]),
|
|
573
576
|
key: "1"
|
|
574
|
-
} : void 0]),
|
|
577
|
+
} : void 0]), 1032, ["width"])]),
|
|
575
578
|
_: 3
|
|
576
579
|
}, 8, [
|
|
577
580
|
"modelValue",
|
|
578
581
|
"reference",
|
|
579
582
|
"disabled",
|
|
583
|
+
"match-reference-width",
|
|
580
584
|
"fit-viewport",
|
|
585
|
+
"surface-class",
|
|
581
586
|
"content-id"
|
|
582
587
|
]), y(M(s), {
|
|
583
588
|
ref_key: "triggerInputRef",
|
|
@@ -593,36 +598,36 @@ var de = {
|
|
|
593
598
|
disabled: i.disabled,
|
|
594
599
|
readonly: i.readonly,
|
|
595
600
|
clearable: i.clearable,
|
|
596
|
-
"has-value": M(
|
|
597
|
-
focused:
|
|
601
|
+
"has-value": M(Pe),
|
|
602
|
+
focused: H.value || V.value,
|
|
598
603
|
"icon-left": i.iconLeft,
|
|
599
604
|
customize: i.customize,
|
|
600
605
|
name: i.name,
|
|
601
|
-
id:
|
|
602
|
-
onClear:
|
|
603
|
-
onFocus:
|
|
604
|
-
onBlur:
|
|
606
|
+
id: rt.value,
|
|
607
|
+
onClear: Tt,
|
|
608
|
+
onFocus: Ct,
|
|
609
|
+
onBlur: wt
|
|
605
610
|
}, v({
|
|
606
611
|
control: F(() => [_("div", {
|
|
607
|
-
id:
|
|
612
|
+
id: rt.value,
|
|
608
613
|
class: T(["s-ui-select__control s-ui-typography-body-14-regular", {
|
|
609
614
|
"s-ui-select__control--multiple": M(Z),
|
|
610
|
-
"s-ui-select__control--empty": M(Z) && !M(
|
|
611
|
-
"s-ui-select__control--with-value-suffix":
|
|
615
|
+
"s-ui-select__control--empty": M(Z) && !M(Pe) && !M(Y),
|
|
616
|
+
"s-ui-select__control--with-value-suffix": We.value && !M(Z) && !M(Y) && !M(J)
|
|
612
617
|
}]),
|
|
613
618
|
role: "combobox",
|
|
614
|
-
"aria-expanded":
|
|
615
|
-
"aria-controls":
|
|
619
|
+
"aria-expanded": V.value,
|
|
620
|
+
"aria-controls": it.value,
|
|
616
621
|
"aria-haspopup": "listbox",
|
|
617
622
|
"aria-disabled": i.disabled ? !0 : void 0,
|
|
618
623
|
"aria-readonly": i.readonly ? !0 : void 0,
|
|
619
|
-
"aria-autocomplete": M(
|
|
620
|
-
tabindex:
|
|
621
|
-
onClick:
|
|
622
|
-
onKeydown:
|
|
624
|
+
"aria-autocomplete": M(Re) ? "list" : void 0,
|
|
625
|
+
tabindex: st.value,
|
|
626
|
+
onClick: _t,
|
|
627
|
+
onKeydown: bt
|
|
623
628
|
}, [
|
|
624
|
-
M(Z) ? k(o.$slots, "selection", E(C({ key: 0 },
|
|
625
|
-
|
|
629
|
+
M(Z) ? k(o.$slots, "selection", E(C({ key: 0 }, ot.value)), () => [M(Le) ? (O(), g("span", we, A(M(Le)), 1)) : M(J) && !M(Y) ? (O(), g("span", Te, A(i.placeholder), 1)) : h("", !0)]) : M(J) && !M(Y) ? (O(), g("span", Ee, A(i.placeholder), 1)) : M(Y) ? h("", !0) : (O(), g("span", De, A(M(Fe)), 1)),
|
|
630
|
+
We.value && !M(Z) && !M(Y) && !M(J) ? (O(), g("div", Oe, [k(o.$slots, "value-suffix", E(x(Ge.value)))])) : h("", !0),
|
|
626
631
|
M(Y) ? se((O(), g("input", {
|
|
627
632
|
key: 4,
|
|
628
633
|
ref_key: "searchInputElementRef",
|
|
@@ -636,13 +641,13 @@ var de = {
|
|
|
636
641
|
readonly: i.readonly,
|
|
637
642
|
autocomplete: "off",
|
|
638
643
|
onClick: c[6] ||= ce(() => {}, ["stop"]),
|
|
639
|
-
onFocus:
|
|
640
|
-
onKeydown:
|
|
641
|
-
}, null, 40,
|
|
642
|
-
], 42,
|
|
644
|
+
onFocus: ft,
|
|
645
|
+
onKeydown: xt
|
|
646
|
+
}, null, 40, ke)), [[oe, u.value]]) : h("", !0)
|
|
647
|
+
], 42, Ce)]),
|
|
643
648
|
action: F(() => [y(M(le), {
|
|
644
649
|
name: "chevronMiniDown",
|
|
645
|
-
size:
|
|
650
|
+
size: Ae,
|
|
646
651
|
class: "s-ui-select__chevron"
|
|
647
652
|
})]),
|
|
648
653
|
_: 2
|
|
@@ -688,4 +693,4 @@ var de = {
|
|
|
688
693
|
}
|
|
689
694
|
});
|
|
690
695
|
//#endregion
|
|
691
|
-
export {
|
|
696
|
+
export { V as n, pe as r, q as t };
|
|
@@ -20,7 +20,7 @@ var m = /* @__PURE__ */ function(e) {
|
|
|
20
20
|
type: Boolean,
|
|
21
21
|
default: !1
|
|
22
22
|
},
|
|
23
|
-
labelPlacement: { default: () => h.
|
|
23
|
+
labelPlacement: { default: () => h.RIGHT },
|
|
24
24
|
name: {},
|
|
25
25
|
size: { default: () => m.LARGE }
|
|
26
26
|
}, {
|
|
@@ -35,7 +35,7 @@ var m = /* @__PURE__ */ function(e) {
|
|
|
35
35
|
let m = u(i, "modelValue"), b = a, x = d(), S = e(() => !!(x.default || x.description)), C = e(() => [`s-ui-toggle--size-${i.size}`, {
|
|
36
36
|
"s-ui-toggle--checked": m.value,
|
|
37
37
|
"s-ui-toggle--disabled": i.disabled,
|
|
38
|
-
"s-ui-toggle--label-
|
|
38
|
+
"s-ui-toggle--label-left": i.labelPlacement === h.LEFT,
|
|
39
39
|
"s-ui-toggle--control-only": !S.value
|
|
40
40
|
}]), w = (e) => {
|
|
41
41
|
e.target instanceof HTMLInputElement && b("change", e.target.checked);
|
|
@@ -56,4 +56,4 @@ var m = /* @__PURE__ */ function(e) {
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
//#endregion
|
|
59
|
-
export {
|
|
59
|
+
export { h as n, m as r, b as t };
|
|
@@ -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.RIGHT},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-left":t.labelPlacement===n.LEFT,"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 n}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
@@ -7,6 +7,10 @@ export declare enum ESCheckboxColor {
|
|
|
7
7
|
MAIN = "main",
|
|
8
8
|
SUCCESS = "success"
|
|
9
9
|
}
|
|
10
|
+
export declare enum ESCheckboxLabelPlacement {
|
|
11
|
+
LEFT = "left",
|
|
12
|
+
RIGHT = "right"
|
|
13
|
+
}
|
|
10
14
|
export interface ISCheckboxProps {
|
|
11
15
|
/** Цветовая роль чекбокса. */
|
|
12
16
|
color?: ESCheckboxColor;
|
|
@@ -14,6 +18,8 @@ export interface ISCheckboxProps {
|
|
|
14
18
|
disabled?: boolean;
|
|
15
19
|
/** Неопределённое состояние (минус). */
|
|
16
20
|
indeterminate?: boolean;
|
|
21
|
+
/** Положение подписи относительно квадрата. */
|
|
22
|
+
labelPlacement?: ESCheckboxLabelPlacement;
|
|
17
23
|
/** Имя нативного поля формы. */
|
|
18
24
|
name?: string;
|
|
19
25
|
/** Размер квадрата и отступов. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SCheckbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/SCheckbox/SCheckbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,CAAA;AAElC,oBAAY,cAAc;IACxB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wCAAwC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"SCheckbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/SCheckbox/SCheckbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,CAAA;AAElC,oBAAY,cAAc;IACxB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,oBAAY,wBAAwB;IAClC,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wCAAwC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,wBAAwB,CAAA;IACzC,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB;AAED,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAA"}
|