@shtabapp/ui-kit 1.54.0 → 1.56.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{SCard-BZ2TUqpd.cjs → SCard-DKZYyR5b.cjs} +1 -1
  3. package/dist/{SCard-BPYqNqDs.js → SCard-DgGxjBUV.js} +1 -1
  4. package/dist/{SCheckbox-CU6nzXrI.js → SCheckbox-BMkOc5cn.js} +7 -8
  5. package/dist/SCheckbox-DnnC5mOH.cjs +1 -0
  6. package/dist/{SColorPicker-DUTOeRA_.cjs → SColorPicker-Cucd749L.cjs} +1 -1
  7. package/dist/{SColorPicker-BhJiFjkD.js → SColorPicker-PI3xoFtS.js} +1 -1
  8. package/dist/{SInlineInput-6LglCWSn.cjs → SInlineInput-D3vCX4QA.cjs} +1 -1
  9. package/dist/{SInlineInput-DHq5BNPn.js → SInlineInput-DO_glYxP.js} +1 -1
  10. package/dist/{SInput-ug89CYt3.js → SInput-C-_R5pug.js} +1 -1
  11. package/dist/{SInput-DJL9QOIG.cjs → SInput-Cw8pt9Sr.cjs} +1 -1
  12. package/dist/SLabel-DLKfepRW.cjs +1 -0
  13. package/dist/SLabel-FHHPlcKq.js +59 -0
  14. package/dist/SList-D9SztBPD.cjs +1 -0
  15. package/dist/SList-DhjYsx7q.js +548 -0
  16. package/dist/SListItem-3IpjaE9h.cjs +1 -0
  17. package/dist/{SListItem-DJ8uSadf.js → SListItem-BYMbFs2A.js} +19 -19
  18. package/dist/{SRadio-C1CfSeb_.js → SRadio-D6_Pd6XX.js} +7 -8
  19. package/dist/SRadio-DRo_GU5A.cjs +1 -0
  20. package/dist/{SSelect-Cwlr2ruO.js → SSelect-8RPurgr-.js} +134 -148
  21. package/dist/SSelect-BVs3lWQ9.cjs +1 -0
  22. package/dist/STextarea-Cz7Frk82.cjs +1 -0
  23. package/dist/STextarea-SwVygHwh.js +148 -0
  24. package/dist/{SToggle-CSz9gHYO.js → SToggle-BtKNq9ZX.js} +6 -7
  25. package/dist/SToggle-FrWtwY4F.cjs +1 -0
  26. package/dist/components/SCheckbox/SCheckbox.vue.d.ts.map +1 -1
  27. package/dist/components/SLabel/SLabel.vue.d.ts +3 -3
  28. package/dist/components/SLabel/SLabel.vue.d.ts.map +1 -1
  29. package/dist/components/SList/SList.types.d.ts +2 -0
  30. package/dist/components/SList/SList.types.d.ts.map +1 -1
  31. package/dist/components/SList/SList.vue.d.ts.map +1 -1
  32. package/dist/components/SListItem/SListItem.vue.d.ts.map +1 -1
  33. package/dist/components/SRadio/SRadio.vue.d.ts.map +1 -1
  34. package/dist/components/SSelect/SSelect.vue.d.ts.map +1 -1
  35. package/dist/components/STextarea/STextarea.types.d.ts +6 -0
  36. package/dist/components/STextarea/STextarea.types.d.ts.map +1 -1
  37. package/dist/components/STextarea/STextarea.vue.d.ts.map +1 -1
  38. package/dist/components/SToggle/SToggle.vue.d.ts.map +1 -1
  39. package/dist/composables/useFlatTreeList.d.ts +8 -1
  40. package/dist/composables/useFlatTreeList.d.ts.map +1 -1
  41. package/dist/entries/card.cjs +1 -1
  42. package/dist/entries/card.js +1 -1
  43. package/dist/entries/checkbox.cjs +1 -1
  44. package/dist/entries/checkbox.js +1 -1
  45. package/dist/entries/color-picker.cjs +1 -1
  46. package/dist/entries/color-picker.js +1 -1
  47. package/dist/entries/inline-input.cjs +1 -1
  48. package/dist/entries/inline-input.js +1 -1
  49. package/dist/entries/input.cjs +1 -1
  50. package/dist/entries/input.js +1 -1
  51. package/dist/entries/label.cjs +1 -1
  52. package/dist/entries/label.js +1 -1
  53. package/dist/entries/list-item.cjs +1 -1
  54. package/dist/entries/list-item.js +1 -1
  55. package/dist/entries/list.cjs +1 -1
  56. package/dist/entries/list.js +1 -1
  57. package/dist/entries/radio.cjs +1 -1
  58. package/dist/entries/radio.js +1 -1
  59. package/dist/entries/select.cjs +1 -1
  60. package/dist/entries/select.js +1 -1
  61. package/dist/entries/textarea.cjs +1 -1
  62. package/dist/entries/textarea.js +1 -1
  63. package/dist/entries/toggle.cjs +1 -1
  64. package/dist/entries/toggle.js +1 -1
  65. package/dist/index.cjs +1 -1
  66. package/dist/index.js +12 -12
  67. package/dist/uikit-components.css +1 -1
  68. package/package.json +3 -3
  69. package/dist/SCheckbox-BAPXAjnl.cjs +0 -1
  70. package/dist/SLabel-CTiOAAOu.cjs +0 -1
  71. package/dist/SLabel-yzcX4qp5.js +0 -55
  72. package/dist/SList-BESqVnlh.js +0 -514
  73. package/dist/SList-qQ7B5u8o.cjs +0 -1
  74. package/dist/SListItem-DBGDVeoJ.cjs +0 -1
  75. package/dist/SRadio-xfAIUC2I.cjs +0 -1
  76. package/dist/SSelect-BEvgscGV.cjs +0 -1
  77. package/dist/STextarea-ASdLqfpC.js +0 -118
  78. package/dist/STextarea-BJWrc9t1.cjs +0 -1
  79. package/dist/SToggle-CXl6RWi1.cjs +0 -1
@@ -0,0 +1,548 @@
1
+ import { n as e, o as t, r as n, t as r } from "./useSelectionGroup-cKj38lEN.js";
2
+ import { r as i, t as a } from "./SListItem-BYMbFs2A.js";
3
+ import { Fragment as o, computed as s, createBlock as c, createElementBlock as l, createElementVNode as u, createSlots as d, createVNode as f, defineComponent as p, mergeModels as m, mergeProps as h, nextTick as ee, normalizeClass as g, normalizeStyle as _, openBlock as v, provide as te, renderList as y, renderSlot as b, toValue as x, unref as S, useId as ne, useModel as C, useSlots as re, useTemplateRef as ie, withCtx as w } from "vue";
4
+ import { ESIconName as T, SSpinner as ae, useUiKitI18n as oe } from "@shtabapp/ui-kit-primitives";
5
+ import { useInfiniteScroll as E } from "@vueuse/core";
6
+ import { useVirtualizer as se } from "@tanstack/vue-virtual";
7
+ //#region src/composables/useFlatTreeList.ts
8
+ var D = (e, t) => {
9
+ if (typeof t == "function") return t(e);
10
+ let n = e[t];
11
+ return typeof n == "string" ? n : typeof n == "number" ? String(n) : "";
12
+ }, O = (e, t) => {
13
+ let n = e[t];
14
+ return Array.isArray(n) ? n.filter((e) => typeof e == "object" && !!e) : [];
15
+ }, k = (e, t) => {
16
+ if (!t) return !1;
17
+ let n = e[t];
18
+ return typeof n == "boolean" ? n : !1;
19
+ }, ce = "__s-ui-load-more:", A = (e) => `${ce}${e}`, j = "__s-ui-list-divider__", le = () => Object.create(null), M = (e) => e === void 0 ? /* @__PURE__ */ new Set() : typeof e == "string" ? new Set([e]) : new Set(e), N = (e, t, n, r) => {
20
+ O(e, n).forEach((e) => {
21
+ let i = D(e, t);
22
+ i && r.add(i), N(e, t, n, r);
23
+ });
24
+ }, P = (e, t, n, r) => {
25
+ for (let i of e) {
26
+ if (D(i, n) === t) return i;
27
+ let e = P(O(i, r), t, n, r);
28
+ if (e) return e;
29
+ }
30
+ }, F = (e, t, n, r, i, a, o, s) => {
31
+ e.forEach((e) => {
32
+ let c = D(e, t);
33
+ if (!c) return;
34
+ let l = O(e, n), u = l.length > 0, d = r.includes(c);
35
+ o.push({
36
+ key: c,
37
+ item: e,
38
+ depth: i,
39
+ flatIndex: o.length,
40
+ hasChildren: u,
41
+ expanded: d,
42
+ parentKey: a
43
+ }), u && d && F(l, t, n, r, i + 1, c, o, s), u && d && k(e, s) && o.push({
44
+ key: A(c),
45
+ item: e,
46
+ depth: i + 1,
47
+ flatIndex: o.length,
48
+ hasChildren: !1,
49
+ expanded: !1,
50
+ parentKey: c,
51
+ loadMoreForKey: c
52
+ });
53
+ });
54
+ }, ue = (e, t, n, r) => {
55
+ let i = M(r);
56
+ if (i.size === 0) return;
57
+ let a = [], o = [];
58
+ for (let r of e) {
59
+ if (O(r, n).length > 0) return;
60
+ i.has(D(r, t)) ? a.push(r) : o.push(r);
61
+ }
62
+ if (!(a.length === 0 || o.length === 0)) return {
63
+ selectedItems: a,
64
+ restItems: o
65
+ };
66
+ }, I = ({ items: e, childrenKey: t, itemKey: n, expanded: r, hasMoreChildrenKey: i, selectedOnTop: a, selectedKeys: o }) => ({
67
+ flatRows: s(() => {
68
+ let s = [], c = x(e), l = x(t), u = x(n), d = x(i), f = x(a) ? ue(c, u, l, x(o)) : void 0;
69
+ return f ? (F(f.selectedItems, u, l, r.value, 0, void 0, s, d), s.push({
70
+ key: j,
71
+ item: le(),
72
+ depth: 0,
73
+ flatIndex: s.length,
74
+ hasChildren: !1,
75
+ expanded: !1,
76
+ divider: !0
77
+ }), F(f.restItems, u, l, r.value, 0, void 0, s, d), s) : (F(c, u, l, r.value, 0, void 0, s, d), s);
78
+ }),
79
+ toggleExpanded: (i) => {
80
+ let a = x(e), o = x(t), s = x(n), c = new Set(r.value);
81
+ if (c.has(i)) {
82
+ c.delete(i);
83
+ let e = P(a, i, s, o);
84
+ if (e) {
85
+ let t = /* @__PURE__ */ new Set();
86
+ N(e, s, o, t), t.forEach((e) => {
87
+ c.delete(e);
88
+ });
89
+ }
90
+ } else c.add(i);
91
+ r.value = [...c];
92
+ },
93
+ isExpanded: (e) => r.value.includes(e)
94
+ }), L = (e, t) => E(e, () => {
95
+ t.onEndReached();
96
+ }, {
97
+ distance: x(t.distance),
98
+ canLoadMore: () => t.canLoadMore === void 0 ? !0 : x(t.canLoadMore),
99
+ direction: "bottom"
100
+ }), R = /* @__PURE__ */ function(e) {
101
+ return e.NONE = "none", e.TWO_X_SMALL = "2x-small", e.X_SMALL = "x-small", e.SMALL = "small", e.MEDIUM = "medium", e.X_MEDIUM = "x-medium", e.LARGE = "large", e.X_LARGE = "x-large", e.TWO_X_LARGE = "2x-large", e;
102
+ }({}), z = R.TWO_X_SMALL, de = {
103
+ [R.NONE]: "var(--s-ui-space-gap-none)",
104
+ [R.TWO_X_SMALL]: "var(--s-ui-space-gap-2x-small)",
105
+ [R.X_SMALL]: "var(--s-ui-space-gap-x-small)",
106
+ [R.SMALL]: "var(--s-ui-space-gap-small)",
107
+ [R.MEDIUM]: "var(--s-ui-space-gap-medium)",
108
+ [R.X_MEDIUM]: "var(--s-ui-space-gap-x-medium)",
109
+ [R.LARGE]: "var(--s-ui-space-gap-large)",
110
+ [R.X_LARGE]: "var(--s-ui-space-gap-x-large)",
111
+ [R.TWO_X_LARGE]: "var(--s-ui-space-gap-2x-large)"
112
+ }, fe = {
113
+ [R.NONE]: 0,
114
+ [R.TWO_X_SMALL]: 2,
115
+ [R.X_SMALL]: 4,
116
+ [R.SMALL]: 8,
117
+ [R.MEDIUM]: 12,
118
+ [R.X_MEDIUM]: 16,
119
+ [R.LARGE]: 20,
120
+ [R.X_LARGE]: 24,
121
+ [R.TWO_X_LARGE]: 32
122
+ }, pe = (e, t) => `s-ui-list-option-${e}-${t}`, B = (e, t) => {
123
+ let n = e[t];
124
+ if (typeof n == "string") return n;
125
+ }, V = (e, t) => {
126
+ let n = e[t];
127
+ return typeof n == "boolean" ? n : !1;
128
+ }, H = (e) => e in T, U = (e, t) => {
129
+ let n = e[t];
130
+ if (typeof n == "string" && n.length > 0 && H(n)) return n;
131
+ }, W = (e, t) => typeof t == "string" && t ? t : Array.isArray(t) && t[0] ? t[0] : e, me = (e) => e.some((e) => e.hasChildren || e.parentKey), G = (e, t, n) => {
132
+ if (!e.hasChildren) return null;
133
+ if (!e.expanded) return {
134
+ type: "expand",
135
+ rowKey: t
136
+ };
137
+ let r = n.find((e) => e.parentKey === t);
138
+ return r ? {
139
+ type: "select",
140
+ rowKey: r.key
141
+ } : null;
142
+ }, K = (e, t) => e.hasChildren && e.expanded ? {
143
+ type: "collapse",
144
+ rowKey: t
145
+ } : e.parentKey ? {
146
+ type: "select",
147
+ rowKey: e.parentKey
148
+ } : null, he = (e, t, n) => {
149
+ let r = n.find((e) => e.key === t);
150
+ return r ? e === "ArrowRight" ? G(r, t, n) : K(r, t) : null;
151
+ }, q = (e, t, n, r) => {
152
+ for (let i = t; i >= 0 && i < e.length; i += n) {
153
+ let t = e[i];
154
+ if (t && t.depth <= r) return t.key;
155
+ }
156
+ return null;
157
+ }, ge = (e, t, n) => {
158
+ let r = n.findIndex((e) => e.key === t);
159
+ if (r === -1) return null;
160
+ let i = n[r];
161
+ if (!i) return null;
162
+ let a = e === "ArrowDown" ? 1 : -1;
163
+ return q(n, r + a, a, i.depth);
164
+ }, _e = ["role", "aria-multiselectable"], ve = [
165
+ "aria-multiselectable",
166
+ "aria-activedescendant",
167
+ "tabindex"
168
+ ], ye = ["data-index"], be = {
169
+ key: 0,
170
+ class: "s-ui-list__divider",
171
+ role: "separator"
172
+ }, xe = {
173
+ key: 0,
174
+ class: "s-ui-list__divider",
175
+ role: "separator"
176
+ }, Se = {
177
+ key: 2,
178
+ class: "s-ui-list__static"
179
+ }, J = /* @__PURE__ */ p({
180
+ __name: "SList",
181
+ props: /*@__PURE__*/ m({
182
+ items: {},
183
+ itemKey: {
184
+ type: [String, Function],
185
+ default: "id"
186
+ },
187
+ childrenKey: { default: "children" },
188
+ titleKey: { default: "title" },
189
+ subtitleKey: { default: "subtitle" },
190
+ iconLeftKey: { default: "iconLeft" },
191
+ disabledKey: { default: "disabled" },
192
+ itemProps: { type: Function },
193
+ selectionMode: { default: () => e.NONE },
194
+ mandatory: {
195
+ type: Boolean,
196
+ default: !1
197
+ },
198
+ virtual: { type: Boolean },
199
+ gap: { default: () => z },
200
+ estimateItemSize: { default: 36 },
201
+ overscan: { default: 5 },
202
+ endReachedDistance: { default: 0 },
203
+ canLoadMore: { type: Function },
204
+ height: { default: 320 },
205
+ maxHeight: {},
206
+ revealRight: {
207
+ type: Boolean,
208
+ default: !1
209
+ },
210
+ expandOnClick: {
211
+ type: Boolean,
212
+ default: !1
213
+ },
214
+ selectedOnTop: {
215
+ type: Boolean,
216
+ default: !1
217
+ },
218
+ hasMoreChildrenKey: {},
219
+ loadingMoreChildrenKeys: { default: () => [] }
220
+ }, {
221
+ modelValue: {},
222
+ modelModifiers: {},
223
+ selected: {},
224
+ selectedModifiers: {},
225
+ expanded: { default: () => [] },
226
+ expandedModifiers: {}
227
+ }),
228
+ emits: /*@__PURE__*/ m(["endReached", "loadMoreChildren"], [
229
+ "update:modelValue",
230
+ "update:selected",
231
+ "update:expanded"
232
+ ]),
233
+ setup(p, { expose: m, emit: x }) {
234
+ let T = C(p, "modelValue"), E = C(p, "selected"), D = C(p, "expanded"), O = x, k = re(), ce = ne(), A = ie("scrollElementRef"), j = ie("listRootElementRef"), le = s(() => fe[p.gap]), M = s(() => p.items !== void 0), N = s(() => M.value ? p.virtual === void 0 ? !0 : p.virtual : !1), { flatRows: P, toggleExpanded: F } = I({
235
+ items: () => p.items ?? [],
236
+ childrenKey: () => p.childrenKey,
237
+ itemKey: () => p.itemKey,
238
+ expanded: D,
239
+ hasMoreChildrenKey: () => p.hasMoreChildrenKey,
240
+ selectedOnTop: () => p.selectedOnTop,
241
+ selectedKeys: () => E.value
242
+ }), { t: ue } = oe(), R = s(() => new Set(p.loadingMoreChildrenKeys)), z = s(() => ue("list.loadMore")), H = (e) => e.loadMoreForKey ? R.value.has(e.loadMoreForKey) : !1, G = (e, t) => {
243
+ R.value.has(e) || O("loadMoreChildren", {
244
+ key: e,
245
+ item: t
246
+ });
247
+ }, K = (e) => {
248
+ e.loadMoreForKey && G(e.loadMoreForKey, e.item);
249
+ }, q = (e) => ({
250
+ parentKey: e.loadMoreForKey ?? "",
251
+ parentItem: e.item,
252
+ depth: e.depth,
253
+ loading: H(e),
254
+ loadMore: () => {
255
+ K(e);
256
+ }
257
+ }), J = se(s(() => ({
258
+ count: P.value.length,
259
+ getScrollElement: () => A.value,
260
+ estimateSize: () => p.estimateItemSize,
261
+ gap: le.value,
262
+ overscan: p.overscan
263
+ }))), Ce = s(() => {
264
+ if (M.value) return P.value.reduce((e, t) => (t.divider || e.push(t.key), e), []);
265
+ }), we = s(() => {
266
+ let e = /* @__PURE__ */ new Set();
267
+ for (let t of P.value) !t.loadMoreForKey && V(t.item, p.disabledKey) && e.add(t.key);
268
+ return e;
269
+ }), Te = async (e) => {
270
+ if (!N.value) return;
271
+ let t = P.value.findIndex((t) => t.key === e);
272
+ t !== -1 && (J.value.scrollToIndex(t, { align: "auto" }), await new Promise((e) => {
273
+ requestAnimationFrame(() => {
274
+ e();
275
+ });
276
+ }), await ee());
277
+ }, Ee = (e) => pe(ce, e), Y = t({
278
+ modelValue: () => E.value,
279
+ onUpdateModelValue: (e) => {
280
+ E.value = e;
281
+ },
282
+ mode: () => p.selectionMode,
283
+ mandatory: () => p.mandatory,
284
+ orientation: () => n.VERTICAL,
285
+ enableTabNavigation: !0,
286
+ focusMode: () => N.value ? r.ACTIVE_DESCENDANT : r.DOM,
287
+ orderedValues: Ce,
288
+ isValueDisabled: (e) => we.value.has(e),
289
+ onBeforeFocusItem: async (e) => {
290
+ await Te(e);
291
+ },
292
+ onFocusGroup: () => {
293
+ A.value?.focus();
294
+ }
295
+ }), De = s(() => M.value && me(P.value)), X = () => {
296
+ if (N.value) {
297
+ A.value?.focus();
298
+ return;
299
+ }
300
+ j.value?.focus();
301
+ }, Oe = () => {
302
+ Y.focusedValue.value = void 0, T.value = void 0;
303
+ let e = document.activeElement;
304
+ e instanceof HTMLElement && e !== A.value && e.blur(), X();
305
+ }, Z = async (e) => {
306
+ N.value && await Te(e);
307
+ }, ke = async (e) => {
308
+ if (Oe(), e.type === "expand" || e.type === "collapse") {
309
+ F(e.rowKey), Y.select(e.rowKey, !1), await Z(e.rowKey);
310
+ return;
311
+ }
312
+ Y.select(e.rowKey, !1), await Z(e.rowKey);
313
+ }, Ae = async (e, t) => {
314
+ if (!De.value || e.key !== "ArrowUp" && e.key !== "ArrowDown") return !1;
315
+ let n = W(t, E.value), r = ge(e.key, n, P.value);
316
+ return r ? (e.preventDefault(), Oe(), Y.select(r, !1), await Z(r), !0) : !1;
317
+ }, je = async (e, t) => {
318
+ if (!De.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return !1;
319
+ let n = W(t, E.value), r = he(e.key, n, P.value);
320
+ return r ? (e.preventDefault(), await ke(r), !0) : !1;
321
+ }, Q = () => {
322
+ if (T.value) return T.value;
323
+ let e = W("", E.value);
324
+ if (e) return e;
325
+ let t = Ce.value;
326
+ if (t) {
327
+ for (let e of t) if (!we.value.has(e)) return e;
328
+ }
329
+ }, Me = () => Q(), Ne = async (e) => {
330
+ let t = Me();
331
+ t && await $(e, t);
332
+ }, Pe = [
333
+ "Enter",
334
+ " ",
335
+ "Spacebar"
336
+ ], Fe = (e, t) => {
337
+ if (!Pe.includes(e.key)) return !1;
338
+ let n = P.value.find((e) => e.key === t);
339
+ return n?.loadMoreForKey ? (e.preventDefault(), G(n.loadMoreForKey, n.item), !0) : !1;
340
+ }, $ = async (e, t) => {
341
+ Fe(e, t) || await Ae(e, t) || await je(e, t) || (await Y.handleItemKeydown(e, t), T.value = Y.focusedValue.value, !Y.focusedValue.value && !N.value && X());
342
+ }, Ie = async (e) => {
343
+ let t = Q();
344
+ t && await $(e, t);
345
+ }, Le = async (e) => {
346
+ if (N.value || e.target !== j.value) return;
347
+ let t = Q();
348
+ t && await $(e, t);
349
+ }, Re = async () => {
350
+ let e = Q();
351
+ if (!e) {
352
+ X();
353
+ return;
354
+ }
355
+ await Y.focusItem(e, !1);
356
+ };
357
+ te(i, {
358
+ mode: () => p.selectionMode,
359
+ isSelected: Y.isSelected,
360
+ selectItem: Y.toggle,
361
+ registerItem: Y.registerItem,
362
+ getItemTabIndex: Y.getItemTabIndex,
363
+ getGroupTabIndex: Y.getGroupTabIndex,
364
+ handleItemKeydown: $,
365
+ activeKey: () => T.value,
366
+ setActiveKey: (e) => {
367
+ T.value = e;
368
+ },
369
+ isExpanded: (e) => D.value.includes(e),
370
+ toggleExpanded: (e) => {
371
+ if (M.value) {
372
+ F(e);
373
+ return;
374
+ }
375
+ let t = new Set(D.value);
376
+ t.has(e) ? t.delete(e) : t.add(e), D.value = [...t];
377
+ },
378
+ revealRight: () => p.revealRight,
379
+ expandOnClick: () => p.expandOnClick,
380
+ getItemOptionId: (e) => {
381
+ if (N.value) return Ee(e);
382
+ },
383
+ usesActiveDescendantNavigation: () => N.value,
384
+ handlesTreeKeyboardNavigation: () => M.value
385
+ });
386
+ let ze = s(() => J.value.getVirtualItems()), Be = s(() => ze.value.flatMap((e) => {
387
+ let t = P.value[e.index];
388
+ return t ? [{
389
+ virtualRow: e,
390
+ flatRow: t
391
+ }] : [];
392
+ })), Ve = s(() => J.value.getTotalSize()), He = s(() => ({
393
+ height: `${Ve.value}px`,
394
+ position: "relative",
395
+ width: "100%"
396
+ })), Ue = s(() => {
397
+ let e = {};
398
+ return typeof p.height == "number" ? e.height = `${p.height}px` : p.height && (e.height = p.height), p.maxHeight && (typeof p.maxHeight == "number" ? e.maxHeight = `${p.maxHeight}px` : e.maxHeight = p.maxHeight), e;
399
+ }), We = s(() => ({
400
+ "s-ui-list--virtual": N.value,
401
+ "s-ui-list--static": !N.value
402
+ })), Ge = s(() => ({ "--s-ui-list-gap": de[p.gap] })), Ke = s(() => ({ "s-ui-list__scroll--flat": M.value && !N.value })), qe = s(() => {
403
+ if (p.selectionMode === e.MULTIPLE) return !0;
404
+ }), Je = s(() => {
405
+ if (!N.value) return "listbox";
406
+ }), Ye = s(() => {
407
+ if (!N.value) return qe.value;
408
+ }), Xe = s(() => {
409
+ if (N.value) return Y.getGroupTabIndex();
410
+ }), Ze = s(() => T.value ? T.value : W("", E.value)), Qe = s(() => {
411
+ if (!N.value) return;
412
+ let e = Ze.value;
413
+ if (e) return Ee(e);
414
+ });
415
+ L(() => A.value, {
416
+ distance: () => p.endReachedDistance,
417
+ canLoadMore: () => p.canLoadMore ? p.canLoadMore() : !0,
418
+ onEndReached: () => {
419
+ O("endReached", { direction: "bottom" });
420
+ }
421
+ });
422
+ let $e = (e) => ({
423
+ position: "absolute",
424
+ top: 0,
425
+ left: 0,
426
+ width: "100%",
427
+ transform: `translateY(${e.start}px)`
428
+ }), et = (e) => {
429
+ e instanceof HTMLElement && J.value.measureElement(e);
430
+ }, tt = (e) => {
431
+ let t = e.item, n = {
432
+ rowKey: e.key,
433
+ depth: e.depth,
434
+ expandable: e.hasChildren,
435
+ expanded: e.expanded,
436
+ selected: Y.isSelected(e.key),
437
+ active: T.value === e.key,
438
+ disabled: V(t, p.disabledKey),
439
+ title: B(t, p.titleKey),
440
+ subtitle: B(t, p.subtitleKey),
441
+ iconLeft: U(t, p.iconLeftKey),
442
+ revealRight: p.revealRight
443
+ };
444
+ return p.itemProps ? {
445
+ ...n,
446
+ ...p.itemProps(t, e)
447
+ } : n;
448
+ }, nt = (e) => ({
449
+ ...e,
450
+ revealRight: p.revealRight,
451
+ toggleExpanded: () => {
452
+ F(e.key);
453
+ }
454
+ });
455
+ return m({
456
+ focusNavigation: Re,
457
+ handleKeyboardNavigation: Ie
458
+ }), (e, t) => (v(), l("div", {
459
+ ref_key: "listRootElementRef",
460
+ ref: j,
461
+ class: g(["s-ui-list", We.value]),
462
+ style: _(Ge.value),
463
+ role: Je.value,
464
+ "aria-multiselectable": Ye.value,
465
+ tabindex: "-1",
466
+ onKeydown: Le
467
+ }, [M.value && N.value ? (v(), l("div", {
468
+ key: 0,
469
+ ref_key: "scrollElementRef",
470
+ ref: A,
471
+ class: g(["s-ui-list__scroll", Ke.value]),
472
+ style: _(Ue.value),
473
+ role: "listbox",
474
+ "aria-multiselectable": qe.value,
475
+ "aria-activedescendant": Qe.value,
476
+ tabindex: Xe.value,
477
+ onKeydown: Ne
478
+ }, [u("div", {
479
+ class: "s-ui-list__virtual-panel",
480
+ style: _(He.value)
481
+ }, [(v(!0), l(o, null, y(Be.value, (t) => (v(), l("div", {
482
+ key: t.virtualRow.index,
483
+ class: "s-ui-list__virtual-row",
484
+ "data-index": t.virtualRow.index,
485
+ ref_for: !0,
486
+ ref: et,
487
+ style: _($e(t.virtualRow))
488
+ }, [t.flatRow.divider ? (v(), l("div", be)) : t.flatRow.loadMoreForKey ? (v(), l(o, { key: 1 }, [S(k).loadMore ? b(e.$slots, "loadMore", h({
489
+ key: 0,
490
+ ref_for: !0
491
+ }, q(t.flatRow))) : (v(), c(S(a), {
492
+ key: 1,
493
+ "row-key": t.flatRow.key,
494
+ depth: t.flatRow.depth,
495
+ tiny: "",
496
+ title: z.value,
497
+ onClick: (e) => K(t.flatRow)
498
+ }, d({ _: 2 }, [H(t.flatRow) ? {
499
+ name: "icon-left",
500
+ fn: w(() => [f(S(ae), { size: 16 })]),
501
+ key: "0"
502
+ } : void 0]), 1032, [
503
+ "row-key",
504
+ "depth",
505
+ "title",
506
+ "onClick"
507
+ ]))], 64)) : (v(), l(o, { key: 2 }, [S(k).item ? b(e.$slots, "item", h({
508
+ key: 0,
509
+ ref_for: !0
510
+ }, nt(t.flatRow))) : (v(), c(S(a), h({
511
+ key: 1,
512
+ ref_for: !0
513
+ }, tt(t.flatRow)), null, 16))], 64))], 12, ye))), 128))], 4)], 46, ve)) : M.value ? (v(), l("div", {
514
+ key: 1,
515
+ ref_key: "scrollElementRef",
516
+ ref: A,
517
+ class: g(["s-ui-list__scroll", Ke.value]),
518
+ style: _(Ue.value)
519
+ }, [(v(!0), l(o, null, y(S(P), (t) => (v(), l(o, { key: t.key }, [t.divider ? (v(), l("div", xe)) : t.loadMoreForKey ? (v(), l(o, { key: 1 }, [S(k).loadMore ? b(e.$slots, "loadMore", h({
520
+ key: 0,
521
+ ref_for: !0
522
+ }, q(t))) : (v(), c(S(a), {
523
+ key: 1,
524
+ "row-key": t.key,
525
+ depth: t.depth,
526
+ tiny: "",
527
+ title: z.value,
528
+ onClick: (e) => K(t)
529
+ }, d({ _: 2 }, [H(t) ? {
530
+ name: "icon-left",
531
+ fn: w(() => [f(S(ae), { size: 16 })]),
532
+ key: "0"
533
+ } : void 0]), 1032, [
534
+ "row-key",
535
+ "depth",
536
+ "title",
537
+ "onClick"
538
+ ]))], 64)) : (v(), l(o, { key: 2 }, [S(k).item ? b(e.$slots, "item", h({
539
+ key: 0,
540
+ ref_for: !0
541
+ }, nt(t))) : (v(), c(S(a), h({
542
+ key: 1,
543
+ ref_for: !0
544
+ }, tt(t)), null, 16))], 64))], 64))), 128))], 6)) : (v(), l("div", Se, [b(e.$slots, "default")]))], 46, _e));
545
+ }
546
+ });
547
+ //#endregion
548
+ export { R as a, B as i, V as n, L as o, U as r, I as s, J as t };
@@ -0,0 +1 @@
1
+ const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./SButton-C-z_q5CG.cjs"),n=require("./useSelectLink-DDdMmsJB.cjs");let r=require("vue"),i=require("@shtabapp/ui-kit-primitives");var a=Symbol(`sListInjectionKey`),o=function(e){return e.NEUTRAL=`neutral`,e.MAIN=`main`,e.ERROR=`error`,e.BILLING=`billing`,e}({}),s=[`id`,`tabindex`,`aria-selected`,`aria-disabled`,`aria-readonly`,`aria-busy`,`aria-expanded`],c={key:0,class:`s-ui-list-item__level`},l={class:`s-ui-list-item__body`},u={key:0,class:`s-ui-list-item__icon-left`},d={class:`s-ui-list-item__text`},f={key:0,class:`s-ui-list-item__title s-ui-typography-label-14-medium`},p={key:1,class:`s-ui-list-item__subtitle s-ui-typography-body-12-regular`},m={key:1,class:`s-ui-list-item__title-action`},h={key:1,class:`s-ui-list-item__actions`},g={class:`s-ui-list-item__actions-reveal`},_={class:`s-ui-list-item__actions-inner`},v={key:0,class:`s-ui-list-item__trailing`},y={key:1,class:`s-ui-list-item__action-end`},b=16,x=`.s-ui-list-item__expand, .s-ui-list-item__title-action, .s-ui-list-item__actions`,S=(0,r.defineComponent)({__name:`SListItem`,props:{depth:{default:0},expandable:{type:Boolean,default:!1},expanded:{type:Boolean,default:!1},variant:{default:()=>o.NEUTRAL},tiny:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},title:{},subtitle:{},iconLeft:{},rowKey:{},revealRight:{type:Boolean},expandOnClick:{type:Boolean}},emits:[`click`,`toggleExpand`,`keydown`],setup(S,{expose:C,emit:w}){let T=w,E=(0,r.computed)(()=>({disabled:S.disabled,readonly:S.readonly})),D=(0,r.useSlots)(),O=(0,r.useTemplateRef)(`listItemElementRef`),k=(0,r.inject)(a,null),{t:A}=(0,i.useUiKitI18n)(),j=n.n({group:()=>k,value:()=>S.rowKey,el:()=>O.value,disabled:()=>S.disabled||S.loading,interactive:()=>!S.readonly&&!S.loading}),M=(0,r.computed)(()=>S.variant===o.BILLING&&!S.disabled),N=(0,r.computed)(()=>k&&S.rowKey?k.isExpanded(S.rowKey):S.expanded),P=(0,r.computed)(()=>N.value?A(`listItem.collapse`):A(`listItem.expand`)),F=(0,r.computed)(()=>j.isInGroup.value?j.isActive.value:S.selected),I=(0,r.computed)(()=>k&&S.rowKey?k.activeKey()===S.rowKey:S.active),L=(0,r.computed)(()=>S.revealRight?!0:k?k.revealRight():!1),R=(0,r.computed)(()=>S.expandOnClick?!0:k?k.expandOnClick():!1),z=(0,r.computed)(()=>{if(!(!k||!S.rowKey))return k.getItemOptionId(S.rowKey)}),B=(0,r.computed)(()=>{if(k?.usesActiveDescendantNavigation())return-1;if(!(S.disabled||S.readonly||S.loading))return j.tabIndex.value===void 0?0:j.tabIndex.value}),V=(0,r.computed)(()=>({"--s-ui-list-item-depth":String(S.depth)})),H=(0,r.computed)(()=>[`s-ui-list-item--variant-${S.variant}`,{"s-ui-list-item--tiny":S.tiny,"s-ui-list-item--selected":F.value,"s-ui-list-item--active":I.value,"s-ui-list-item--disabled":S.disabled,"s-ui-list-item--readonly":S.readonly,"s-ui-list-item--loading":S.loading,"s-ui-list-item--expandable":S.expandable,"s-ui-list-item--reveal-right":L.value}]),U=()=>{if(k&&S.rowKey){k.toggleExpanded(S.rowKey);return}T(`toggleExpand`)},W=()=>{S.disabled||S.readonly||S.loading||U()},G=e=>e.target instanceof Element&&!!e.target.closest(x),K=e=>{S.disabled||S.readonly||S.loading||G(e)||(S.expandable&&R.value&&(k&&S.rowKey?k.toggleExpanded(S.rowKey):T(`toggleExpand`)),k&&S.rowKey&&k.setActiveKey(S.rowKey),j.isInGroup.value&&j.handleClick(),T(`click`,e))},q=e=>!S.expandable||k?.handlesTreeKeyboardNavigation()||e.key!==`ArrowLeft`&&e.key!==`ArrowRight`||e.key===`ArrowRight`===N.value?!1:(e.preventDefault(),U(),!0),J=e=>{S.disabled||S.readonly||S.loading||(!q(e)&&j.isInGroup.value&&j.handleKeydown(e),T(`keydown`,e))};return C({listItemElementRef:O}),(n,a)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref_key:`listItemElementRef`,ref:O,id:z.value,class:(0,r.normalizeClass)([`s-ui-list-item`,H.value]),style:(0,r.normalizeStyle)(V.value),tabindex:B.value,role:`option`,"aria-selected":F.value?!0:void 0,"aria-disabled":S.disabled||S.loading?!0:void 0,"aria-readonly":S.readonly?!0:void 0,"aria-busy":S.loading?!0:void 0,"aria-expanded":S.expandable&&!S.loading?N.value:void 0,onClick:K,onKeydown:J},[S.loading?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(i.SSkeleton),{key:0,type:(0,r.unref)(i.ESSkeletonType).S_LIST_ITEM},null,8,[`type`])):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[S.expandable||S.depth||(0,r.unref)(D).level?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,c,[(0,r.renderSlot)(n.$slots,`level`,{},()=>[S.expandable?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(t.t),{key:0,class:(0,r.normalizeClass)([`s-ui-list-item__expand`,{"s-ui-list-item__expand--expanded":N.value}]),appearance:(0,r.unref)(e.t).BARE,variant:(0,r.unref)(e.r).NEUTRAL,size:(0,r.unref)(e.n).SMALL,icon:`chevronMiniRight`,disabled:S.disabled||S.readonly,tabindex:-1,"aria-label":P.value,onClick:(0,r.withModifiers)(W,[`stop`])},null,8,[`class`,`appearance`,`variant`,`size`,`disabled`,`aria-label`])):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,l,[S.iconLeft||(0,r.unref)(D)[`icon-left`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,u,[(0,r.renderSlot)(n.$slots,`icon-left`,{},()=>[S.iconLeft?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(i.SIcon),{key:0,name:S.iconLeft,size:b,billing:M.value},null,8,[`name`,`billing`])):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,d,[S.title||(0,r.unref)(D).title?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,f,[(0,r.renderSlot)(n.$slots,`title`,{},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(S.title),1)])])):(0,r.createCommentVNode)(``,!0),S.subtitle||(0,r.unref)(D).subtitle?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,p,[(0,r.renderSlot)(n.$slots,`subtitle`,{},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(S.subtitle),1)])])):(0,r.createCommentVNode)(``,!0)]),(0,r.unref)(D)[`title-action`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,m,[(0,r.renderSlot)(n.$slots,`title-action`,(0,r.normalizeProps)((0,r.guardReactiveProps)(E.value)))])):(0,r.createCommentVNode)(``,!0)]),(0,r.unref)(D).trailing||(0,r.unref)(D).right||(0,r.unref)(D)[`action-end`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,h,[(0,r.createElementVNode)(`div`,g,[(0,r.createElementVNode)(`div`,_,[(0,r.unref)(D).trailing?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,v,[(0,r.renderSlot)(n.$slots,`trailing`,(0,r.normalizeProps)((0,r.guardReactiveProps)(E.value)))])):(0,r.createCommentVNode)(``,!0),(0,r.renderSlot)(n.$slots,`right`,(0,r.normalizeProps)((0,r.guardReactiveProps)(E.value))),(0,r.unref)(D)[`action-end`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,y,[(0,r.renderSlot)(n.$slots,`action-end`,(0,r.normalizeProps)((0,r.guardReactiveProps)(E.value)))])):(0,r.createCommentVNode)(``,!0)])])])):(0,r.createCommentVNode)(``,!0)],64))],46,s))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return S}});
@@ -97,48 +97,48 @@ var w = Symbol("sListInjectionKey"), T = /* @__PURE__ */ function(e) {
97
97
  el: () => K.value,
98
98
  disabled: () => d.disabled || d.loading,
99
99
  interactive: () => !d.readonly && !d.loading
100
- }), ae = a(() => d.variant === T.BILLING && !d.disabled), oe = a(() => !!(G.trailing || G.right || G["action-end"])), X = a(() => q && d.rowKey ? q.isExpanded(d.rowKey) : d.expanded), se = a(() => X.value ? J("listItem.collapse") : J("listItem.expand")), Z = a(() => Y.isInGroup.value ? Y.isActive.value : d.selected), ce = a(() => q && d.rowKey ? q.activeKey() === d.rowKey : d.active), le = a(() => d.revealRight ? !0 : q ? q.revealRight() : !1), ue = a(() => d.expandOnClick ? !0 : q ? q.expandOnClick() : !1), de = a(() => {
100
+ }), ae = a(() => d.variant === T.BILLING && !d.disabled), X = a(() => q && d.rowKey ? q.isExpanded(d.rowKey) : d.expanded), oe = a(() => X.value ? J("listItem.collapse") : J("listItem.expand")), Z = a(() => Y.isInGroup.value ? Y.isActive.value : d.selected), se = a(() => q && d.rowKey ? q.activeKey() === d.rowKey : d.active), ce = a(() => d.revealRight ? !0 : q ? q.revealRight() : !1), le = a(() => d.expandOnClick ? !0 : q ? q.expandOnClick() : !1), ue = a(() => {
101
101
  if (!(!q || !d.rowKey)) return q.getItemOptionId(d.rowKey);
102
- }), fe = a(() => {
102
+ }), de = a(() => {
103
103
  if (q?.usesActiveDescendantNavigation()) return -1;
104
104
  if (!(d.disabled || d.readonly || d.loading)) return Y.tabIndex.value === void 0 ? 0 : Y.tabIndex.value;
105
- }), pe = a(() => ({ "--s-ui-list-item-depth": String(d.depth) })), me = a(() => [`s-ui-list-item--variant-${d.variant}`, {
105
+ }), fe = a(() => ({ "--s-ui-list-item-depth": String(d.depth) })), pe = a(() => [`s-ui-list-item--variant-${d.variant}`, {
106
106
  "s-ui-list-item--tiny": d.tiny,
107
107
  "s-ui-list-item--selected": Z.value,
108
- "s-ui-list-item--active": ce.value,
108
+ "s-ui-list-item--active": se.value,
109
109
  "s-ui-list-item--disabled": d.disabled,
110
110
  "s-ui-list-item--readonly": d.readonly,
111
111
  "s-ui-list-item--loading": d.loading,
112
112
  "s-ui-list-item--expandable": d.expandable,
113
- "s-ui-list-item--reveal-right": le.value
113
+ "s-ui-list-item--reveal-right": ce.value
114
114
  }]), Q = () => {
115
115
  if (q && d.rowKey) {
116
116
  q.toggleExpanded(d.rowKey);
117
117
  return;
118
118
  }
119
119
  U("toggleExpand");
120
- }, he = () => {
120
+ }, $ = () => {
121
121
  d.disabled || d.readonly || d.loading || Q();
122
- }, ge = (e) => e.target instanceof Element && !!e.target.closest(B), $ = (e) => {
123
- d.disabled || d.readonly || d.loading || ge(e) || (d.expandable && ue.value && (q && d.rowKey ? q.toggleExpanded(d.rowKey) : U("toggleExpand")), q && d.rowKey && q.setActiveKey(d.rowKey), Y.isInGroup.value && Y.handleClick(), U("click", e));
124
- }, _e = (e) => !d.expandable || q?.handlesTreeKeyboardNavigation() || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.key === "ArrowRight" === X.value ? !1 : (e.preventDefault(), Q(), !0), ve = (e) => {
125
- d.disabled || d.readonly || d.loading || (!_e(e) && Y.isInGroup.value && Y.handleKeydown(e), U("keydown", e));
122
+ }, me = (e) => e.target instanceof Element && !!e.target.closest(B), he = (e) => {
123
+ d.disabled || d.readonly || d.loading || me(e) || (d.expandable && le.value && (q && d.rowKey ? q.toggleExpanded(d.rowKey) : U("toggleExpand")), q && d.rowKey && q.setActiveKey(d.rowKey), Y.isInGroup.value && Y.handleClick(), U("click", e));
124
+ }, ge = (e) => !d.expandable || q?.handlesTreeKeyboardNavigation() || e.key !== "ArrowLeft" && e.key !== "ArrowRight" || e.key === "ArrowRight" === X.value ? !1 : (e.preventDefault(), Q(), !0), _e = (e) => {
125
+ d.disabled || d.readonly || d.loading || (!ge(e) && Y.isInGroup.value && Y.handleKeydown(e), U("keydown", e));
126
126
  };
127
127
  return V({ listItemElementRef: K }), (r, a) => (g(), c("div", {
128
128
  ref_key: "listItemElementRef",
129
129
  ref: K,
130
- id: de.value,
131
- class: m(["s-ui-list-item", me.value]),
132
- style: te(pe.value),
133
- tabindex: fe.value,
130
+ id: ue.value,
131
+ class: m(["s-ui-list-item", pe.value]),
132
+ style: te(fe.value),
133
+ tabindex: de.value,
134
134
  role: "option",
135
135
  "aria-selected": Z.value ? !0 : void 0,
136
136
  "aria-disabled": d.disabled || d.loading ? !0 : void 0,
137
137
  "aria-readonly": d.readonly ? !0 : void 0,
138
138
  "aria-busy": d.loading ? !0 : void 0,
139
139
  "aria-expanded": d.expandable && !d.loading ? X.value : void 0,
140
- onClick: $,
141
- onKeydown: ve
140
+ onClick: he,
141
+ onKeydown: _e
142
142
  }, [d.loading ? (g(), o(y(re), {
143
143
  key: 0,
144
144
  type: y(S).S_LIST_ITEM
@@ -152,8 +152,8 @@ var w = Symbol("sListInjectionKey"), T = /* @__PURE__ */ function(e) {
152
152
  icon: "chevronMiniRight",
153
153
  disabled: d.disabled || d.readonly,
154
154
  tabindex: -1,
155
- "aria-label": se.value,
156
- onClick: x(he, ["stop"])
155
+ "aria-label": oe.value,
156
+ onClick: x($, ["stop"])
157
157
  }, null, 8, [
158
158
  "class",
159
159
  "appearance",
@@ -172,7 +172,7 @@ var w = Symbol("sListInjectionKey"), T = /* @__PURE__ */ function(e) {
172
172
  l("div", A, [d.title || y(G).title ? (g(), c("span", j, [_(r.$slots, "title", {}, () => [u(v(d.title), 1)])])) : s("", !0), d.subtitle || y(G).subtitle ? (g(), c("span", M, [_(r.$slots, "subtitle", {}, () => [u(v(d.subtitle), 1)])])) : s("", !0)]),
173
173
  y(G)["title-action"] ? (g(), c("div", N, [_(r.$slots, "title-action", h(f(W.value)))])) : s("", !0)
174
174
  ]),
175
- oe.value ? (g(), c("div", P, [l("div", F, [l("div", I, [
175
+ y(G).trailing || y(G).right || y(G)["action-end"] ? (g(), c("div", P, [l("div", F, [l("div", I, [
176
176
  y(G).trailing ? (g(), c("div", L, [_(r.$slots, "trailing", h(f(W.value)))])) : s("", !0),
177
177
  _(r.$slots, "right", h(f(W.value))),
178
178
  y(G)["action-end"] ? (g(), c("div", R, [_(r.$slots, "action-end", h(f(W.value)))])) : s("", !0)
@@ -31,15 +31,14 @@ var m = /* @__PURE__ */ function(e) {
31
31
  }),
32
32
  emits: /*@__PURE__*/ a(["change"], ["update:modelValue"]),
33
33
  setup(i, { emit: a }) {
34
- let y = u(i, "modelValue"), b = a, x = d(), S = e(() => !!(x.default || x.description)), C = e(() => y.value === i.value), w = e(() => [{
35
- "s-ui-radio--checked": C.value,
34
+ let y = u(i, "modelValue"), b = a, x = d(), S = e(() => y.value === i.value), C = e(() => [{
35
+ "s-ui-radio--checked": S.value,
36
36
  "s-ui-radio--disabled": i.disabled,
37
- "s-ui-radio--label-left": i.labelPlacement === m.LEFT,
38
- "s-ui-radio--control-only": !S.value
39
- }]), T = (e) => {
37
+ "s-ui-radio--label-left": i.labelPlacement === m.LEFT
38
+ }]), w = (e) => {
40
39
  e.target instanceof HTMLInputElement && e.target.checked && b("change", i.value);
41
40
  };
42
- return (e, a) => (s(), n("label", { class: o(["s-ui-radio", w.value]) }, [
41
+ return (e, a) => (s(), n("label", { class: o(["s-ui-radio", [C.value, { "s-ui-radio--control-only": !l(x).default && !l(x).description }]]) }, [
43
42
  p(r("input", {
44
43
  "onUpdate:modelValue": a[0] ||= (e) => y.value = e,
45
44
  type: "radio",
@@ -47,10 +46,10 @@ var m = /* @__PURE__ */ function(e) {
47
46
  disabled: i.disabled,
48
47
  name: i.name,
49
48
  value: i.value,
50
- onChange: T
49
+ onChange: w
51
50
  }, null, 40, h), [[f, y.value]]),
52
51
  a[1] ||= r("span", { class: "s-ui-radio__control" }, [r("span", { class: "s-ui-radio__thumb" })], -1),
53
- S.value ? (s(), n("span", g, [l(x).default ? (s(), n("span", _, [c(e.$slots, "default")])) : t("", !0), l(x).description ? (s(), n("span", v, [c(e.$slots, "description")])) : t("", !0)])) : t("", !0)
52
+ l(x).default || l(x).description ? (s(), n("span", g, [l(x).default ? (s(), n("span", _, [c(e.$slots, "default")])) : t("", !0), l(x).description ? (s(), n("span", v, [c(e.$slots, "description")])) : t("", !0)])) : t("", !0)
54
53
  ], 2));
55
54
  }
56
55
  });