@shtabapp/ui-kit 1.54.0 → 1.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/{SColorPicker-BhJiFjkD.js → SColorPicker-B7CPiaY6.js} +1 -1
- package/dist/{SColorPicker-DUTOeRA_.cjs → SColorPicker-BlGyDlo9.cjs} +1 -1
- package/dist/SList-Cm4kEeX5.cjs +1 -0
- package/dist/SList-bZ3ShGZ0.js +548 -0
- package/dist/SSelect-BPPK05ru.cjs +1 -0
- package/dist/{SSelect-Cwlr2ruO.js → SSelect-DOy4CpWC.js} +132 -146
- package/dist/components/SList/SList.types.d.ts +2 -0
- package/dist/components/SList/SList.types.d.ts.map +1 -1
- package/dist/components/SList/SList.vue.d.ts.map +1 -1
- package/dist/components/SSelect/SSelect.vue.d.ts.map +1 -1
- package/dist/composables/useFlatTreeList.d.ts +8 -1
- package/dist/composables/useFlatTreeList.d.ts.map +1 -1
- package/dist/entries/color-picker.cjs +1 -1
- package/dist/entries/color-picker.js +1 -1
- package/dist/entries/list.cjs +1 -1
- package/dist/entries/list.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/uikit-components.css +1 -1
- package/package.json +3 -3
- package/dist/SList-BESqVnlh.js +0 -514
- package/dist/SList-qQ7B5u8o.cjs +0 -1
- package/dist/SSelect-BEvgscGV.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shtabapp/ui-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.55.0",
|
|
4
4
|
"description": "Vue 3 component library by Shtab — 30+ typed components, design tokens, light/dark themes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shtab",
|
|
@@ -264,8 +264,8 @@
|
|
|
264
264
|
"dependencies": {
|
|
265
265
|
"chart.js": "^4.5.0",
|
|
266
266
|
"vue-i18n": "^9.14.5",
|
|
267
|
-
"@shtabapp/ui-kit-
|
|
268
|
-
"@shtabapp/ui-kit-
|
|
267
|
+
"@shtabapp/ui-kit-primitives": "^1.24.0",
|
|
268
|
+
"@shtabapp/ui-kit-tokens": "^1.19.0"
|
|
269
269
|
},
|
|
270
270
|
"devDependencies": {
|
|
271
271
|
"@storybook/vue3-vite": "^10.4.1",
|
package/dist/SList-BESqVnlh.js
DELETED
|
@@ -1,514 +0,0 @@
|
|
|
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-DJ8uSadf.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 ne, renderSlot as y, toValue as b, unref as x, useId as re, useModel as S, useSlots as ie, useTemplateRef as ae, withCtx as C } from "vue";
|
|
4
|
-
import { ESIconName as w, SSpinner as oe, useUiKitI18n as se } from "@shtabapp/ui-kit-primitives";
|
|
5
|
-
import { useInfiniteScroll as T } from "@vueuse/core";
|
|
6
|
-
import { useVirtualizer as ce } from "@tanstack/vue-virtual";
|
|
7
|
-
//#region src/composables/useFlatTreeList.ts
|
|
8
|
-
var E = (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
|
-
}, D = (e, t) => {
|
|
13
|
-
let n = e[t];
|
|
14
|
-
return Array.isArray(n) ? n.filter((e) => typeof e == "object" && !!e) : [];
|
|
15
|
-
}, O = (e, t) => {
|
|
16
|
-
if (!t) return !1;
|
|
17
|
-
let n = e[t];
|
|
18
|
-
return typeof n == "boolean" ? n : !1;
|
|
19
|
-
}, le = "__s-ui-load-more:", k = (e) => `${le}${e}`, A = (e, t, n, r) => {
|
|
20
|
-
D(e, n).forEach((e) => {
|
|
21
|
-
let i = E(e, t);
|
|
22
|
-
i && r.add(i), A(e, t, n, r);
|
|
23
|
-
});
|
|
24
|
-
}, j = (e, t, n, r) => {
|
|
25
|
-
for (let i of e) {
|
|
26
|
-
if (E(i, n) === t) return i;
|
|
27
|
-
let e = j(D(i, r), t, n, r);
|
|
28
|
-
if (e) return e;
|
|
29
|
-
}
|
|
30
|
-
}, M = (e, t, n, r, i, a, o, s) => {
|
|
31
|
-
e.forEach((e) => {
|
|
32
|
-
let c = E(e, t);
|
|
33
|
-
if (!c) return;
|
|
34
|
-
let l = D(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 && M(l, t, n, r, i + 1, c, o, s), u && d && O(e, s) && o.push({
|
|
44
|
-
key: k(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
|
-
}, N = ({ items: e, childrenKey: t, itemKey: n, expanded: r, hasMoreChildrenKey: i }) => ({
|
|
55
|
-
flatRows: s(() => {
|
|
56
|
-
let a = [], o = b(e), s = b(t), c = b(n), l = b(i);
|
|
57
|
-
return M(o, c, s, r.value, 0, void 0, a, l), a;
|
|
58
|
-
}),
|
|
59
|
-
toggleExpanded: (i) => {
|
|
60
|
-
let a = b(e), o = b(t), s = b(n), c = new Set(r.value);
|
|
61
|
-
if (c.has(i)) {
|
|
62
|
-
c.delete(i);
|
|
63
|
-
let e = j(a, i, s, o);
|
|
64
|
-
if (e) {
|
|
65
|
-
let t = /* @__PURE__ */ new Set();
|
|
66
|
-
A(e, s, o, t), t.forEach((e) => {
|
|
67
|
-
c.delete(e);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
} else c.add(i);
|
|
71
|
-
r.value = [...c];
|
|
72
|
-
},
|
|
73
|
-
isExpanded: (e) => r.value.includes(e)
|
|
74
|
-
}), ue = (e, t) => T(e, () => {
|
|
75
|
-
t.onEndReached();
|
|
76
|
-
}, {
|
|
77
|
-
distance: b(t.distance),
|
|
78
|
-
canLoadMore: () => t.canLoadMore === void 0 ? !0 : b(t.canLoadMore),
|
|
79
|
-
direction: "bottom"
|
|
80
|
-
}), P = /* @__PURE__ */ function(e) {
|
|
81
|
-
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;
|
|
82
|
-
}({}), F = P.TWO_X_SMALL, de = {
|
|
83
|
-
[P.NONE]: "var(--s-ui-space-gap-none)",
|
|
84
|
-
[P.TWO_X_SMALL]: "var(--s-ui-space-gap-2x-small)",
|
|
85
|
-
[P.X_SMALL]: "var(--s-ui-space-gap-x-small)",
|
|
86
|
-
[P.SMALL]: "var(--s-ui-space-gap-small)",
|
|
87
|
-
[P.MEDIUM]: "var(--s-ui-space-gap-medium)",
|
|
88
|
-
[P.X_MEDIUM]: "var(--s-ui-space-gap-x-medium)",
|
|
89
|
-
[P.LARGE]: "var(--s-ui-space-gap-large)",
|
|
90
|
-
[P.X_LARGE]: "var(--s-ui-space-gap-x-large)",
|
|
91
|
-
[P.TWO_X_LARGE]: "var(--s-ui-space-gap-2x-large)"
|
|
92
|
-
}, fe = {
|
|
93
|
-
[P.NONE]: 0,
|
|
94
|
-
[P.TWO_X_SMALL]: 2,
|
|
95
|
-
[P.X_SMALL]: 4,
|
|
96
|
-
[P.SMALL]: 8,
|
|
97
|
-
[P.MEDIUM]: 12,
|
|
98
|
-
[P.X_MEDIUM]: 16,
|
|
99
|
-
[P.LARGE]: 20,
|
|
100
|
-
[P.X_LARGE]: 24,
|
|
101
|
-
[P.TWO_X_LARGE]: 32
|
|
102
|
-
}, pe = (e, t) => `s-ui-list-option-${e}-${t}`, I = (e, t) => {
|
|
103
|
-
let n = e[t];
|
|
104
|
-
if (typeof n == "string") return n;
|
|
105
|
-
}, L = (e, t) => {
|
|
106
|
-
let n = e[t];
|
|
107
|
-
return typeof n == "boolean" ? n : !1;
|
|
108
|
-
}, R = (e) => e in w, z = (e, t) => {
|
|
109
|
-
let n = e[t];
|
|
110
|
-
if (typeof n == "string" && n.length > 0 && R(n)) return n;
|
|
111
|
-
}, B = (e, t) => typeof t == "string" && t ? t : Array.isArray(t) && t[0] ? t[0] : e, me = (e) => e.some((e) => e.hasChildren || e.parentKey), V = (e, t, n) => {
|
|
112
|
-
if (!e.hasChildren) return null;
|
|
113
|
-
if (!e.expanded) return {
|
|
114
|
-
type: "expand",
|
|
115
|
-
rowKey: t
|
|
116
|
-
};
|
|
117
|
-
let r = n.find((e) => e.parentKey === t);
|
|
118
|
-
return r ? {
|
|
119
|
-
type: "select",
|
|
120
|
-
rowKey: r.key
|
|
121
|
-
} : null;
|
|
122
|
-
}, H = (e, t) => e.hasChildren && e.expanded ? {
|
|
123
|
-
type: "collapse",
|
|
124
|
-
rowKey: t
|
|
125
|
-
} : e.parentKey ? {
|
|
126
|
-
type: "select",
|
|
127
|
-
rowKey: e.parentKey
|
|
128
|
-
} : null, he = (e, t, n) => {
|
|
129
|
-
let r = n.find((e) => e.key === t);
|
|
130
|
-
return r ? e === "ArrowRight" ? V(r, t, n) : H(r, t) : null;
|
|
131
|
-
}, U = (e, t, n, r) => {
|
|
132
|
-
for (let i = t; i >= 0 && i < e.length; i += n) {
|
|
133
|
-
let t = e[i];
|
|
134
|
-
if (t && t.depth <= r) return t.key;
|
|
135
|
-
}
|
|
136
|
-
return null;
|
|
137
|
-
}, ge = (e, t, n) => {
|
|
138
|
-
let r = n.findIndex((e) => e.key === t);
|
|
139
|
-
if (r === -1) return null;
|
|
140
|
-
let i = n[r];
|
|
141
|
-
if (!i) return null;
|
|
142
|
-
let a = e === "ArrowDown" ? 1 : -1;
|
|
143
|
-
return U(n, r + a, a, i.depth);
|
|
144
|
-
}, _e = ["role", "aria-multiselectable"], ve = [
|
|
145
|
-
"aria-multiselectable",
|
|
146
|
-
"aria-activedescendant",
|
|
147
|
-
"tabindex"
|
|
148
|
-
], ye = ["data-index"], be = {
|
|
149
|
-
key: 2,
|
|
150
|
-
class: "s-ui-list__static"
|
|
151
|
-
}, W = /* @__PURE__ */ p({
|
|
152
|
-
__name: "SList",
|
|
153
|
-
props: /*@__PURE__*/ m({
|
|
154
|
-
items: {},
|
|
155
|
-
itemKey: {
|
|
156
|
-
type: [String, Function],
|
|
157
|
-
default: "id"
|
|
158
|
-
},
|
|
159
|
-
childrenKey: { default: "children" },
|
|
160
|
-
titleKey: { default: "title" },
|
|
161
|
-
subtitleKey: { default: "subtitle" },
|
|
162
|
-
iconLeftKey: { default: "iconLeft" },
|
|
163
|
-
disabledKey: { default: "disabled" },
|
|
164
|
-
itemProps: { type: Function },
|
|
165
|
-
selectionMode: { default: () => e.NONE },
|
|
166
|
-
mandatory: {
|
|
167
|
-
type: Boolean,
|
|
168
|
-
default: !1
|
|
169
|
-
},
|
|
170
|
-
virtual: { type: Boolean },
|
|
171
|
-
gap: { default: () => F },
|
|
172
|
-
estimateItemSize: { default: 36 },
|
|
173
|
-
overscan: { default: 5 },
|
|
174
|
-
endReachedDistance: { default: 0 },
|
|
175
|
-
canLoadMore: { type: Function },
|
|
176
|
-
height: { default: 320 },
|
|
177
|
-
maxHeight: {},
|
|
178
|
-
revealRight: {
|
|
179
|
-
type: Boolean,
|
|
180
|
-
default: !1
|
|
181
|
-
},
|
|
182
|
-
expandOnClick: {
|
|
183
|
-
type: Boolean,
|
|
184
|
-
default: !1
|
|
185
|
-
},
|
|
186
|
-
hasMoreChildrenKey: {},
|
|
187
|
-
loadingMoreChildrenKeys: { default: () => [] }
|
|
188
|
-
}, {
|
|
189
|
-
modelValue: {},
|
|
190
|
-
modelModifiers: {},
|
|
191
|
-
selected: {},
|
|
192
|
-
selectedModifiers: {},
|
|
193
|
-
expanded: { default: () => [] },
|
|
194
|
-
expandedModifiers: {}
|
|
195
|
-
}),
|
|
196
|
-
emits: /*@__PURE__*/ m(["endReached", "loadMoreChildren"], [
|
|
197
|
-
"update:modelValue",
|
|
198
|
-
"update:selected",
|
|
199
|
-
"update:expanded"
|
|
200
|
-
]),
|
|
201
|
-
setup(p, { expose: m, emit: b }) {
|
|
202
|
-
let w = S(p, "modelValue"), T = S(p, "selected"), E = S(p, "expanded"), D = b, O = ie(), le = re(), k = ae("scrollElementRef"), A = ae("listRootElementRef"), j = s(() => fe[p.gap]), M = s(() => p.items !== void 0), P = s(() => M.value ? p.virtual === void 0 ? !0 : p.virtual : !1), { flatRows: F, toggleExpanded: R } = N({
|
|
203
|
-
items: () => p.items ?? [],
|
|
204
|
-
childrenKey: () => p.childrenKey,
|
|
205
|
-
itemKey: () => p.itemKey,
|
|
206
|
-
expanded: E,
|
|
207
|
-
hasMoreChildrenKey: () => p.hasMoreChildrenKey
|
|
208
|
-
}), { t: V } = se(), H = s(() => new Set(p.loadingMoreChildrenKeys)), U = s(() => V("list.loadMore")), W = (e) => e.loadMoreForKey ? H.value.has(e.loadMoreForKey) : !1, xe = (e, t) => {
|
|
209
|
-
H.value.has(e) || D("loadMoreChildren", {
|
|
210
|
-
key: e,
|
|
211
|
-
item: t
|
|
212
|
-
});
|
|
213
|
-
}, G = (e) => {
|
|
214
|
-
e.loadMoreForKey && xe(e.loadMoreForKey, e.item);
|
|
215
|
-
}, Se = (e) => ({
|
|
216
|
-
parentKey: e.loadMoreForKey ?? "",
|
|
217
|
-
parentItem: e.item,
|
|
218
|
-
depth: e.depth,
|
|
219
|
-
loading: W(e),
|
|
220
|
-
loadMore: () => {
|
|
221
|
-
G(e);
|
|
222
|
-
}
|
|
223
|
-
}), K = ce(s(() => ({
|
|
224
|
-
count: F.value.length,
|
|
225
|
-
getScrollElement: () => k.value,
|
|
226
|
-
estimateSize: () => p.estimateItemSize,
|
|
227
|
-
gap: j.value,
|
|
228
|
-
overscan: p.overscan
|
|
229
|
-
}))), Ce = s(() => {
|
|
230
|
-
if (M.value) return F.value.map((e) => e.key);
|
|
231
|
-
}), we = s(() => {
|
|
232
|
-
let e = /* @__PURE__ */ new Set();
|
|
233
|
-
for (let t of F.value) !t.loadMoreForKey && L(t.item, p.disabledKey) && e.add(t.key);
|
|
234
|
-
return e;
|
|
235
|
-
}), Te = async (e) => {
|
|
236
|
-
if (!P.value) return;
|
|
237
|
-
let t = F.value.findIndex((t) => t.key === e);
|
|
238
|
-
t !== -1 && (K.value.scrollToIndex(t, { align: "auto" }), await new Promise((e) => {
|
|
239
|
-
requestAnimationFrame(() => {
|
|
240
|
-
e();
|
|
241
|
-
});
|
|
242
|
-
}), await ee());
|
|
243
|
-
}, q = (e) => pe(le, e), J = t({
|
|
244
|
-
modelValue: () => T.value,
|
|
245
|
-
onUpdateModelValue: (e) => {
|
|
246
|
-
T.value = e;
|
|
247
|
-
},
|
|
248
|
-
mode: () => p.selectionMode,
|
|
249
|
-
mandatory: () => p.mandatory,
|
|
250
|
-
orientation: () => n.VERTICAL,
|
|
251
|
-
enableTabNavigation: !0,
|
|
252
|
-
focusMode: () => P.value ? r.ACTIVE_DESCENDANT : r.DOM,
|
|
253
|
-
orderedValues: Ce,
|
|
254
|
-
isValueDisabled: (e) => we.value.has(e),
|
|
255
|
-
onBeforeFocusItem: async (e) => {
|
|
256
|
-
await Te(e);
|
|
257
|
-
},
|
|
258
|
-
onFocusGroup: () => {
|
|
259
|
-
k.value?.focus();
|
|
260
|
-
}
|
|
261
|
-
}), Ee = s(() => M.value && me(F.value)), Y = () => {
|
|
262
|
-
if (P.value) {
|
|
263
|
-
k.value?.focus();
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
A.value?.focus();
|
|
267
|
-
}, De = () => {
|
|
268
|
-
J.focusedValue.value = void 0, w.value = void 0;
|
|
269
|
-
let e = document.activeElement;
|
|
270
|
-
e instanceof HTMLElement && e !== k.value && e.blur(), Y();
|
|
271
|
-
}, X = async (e) => {
|
|
272
|
-
P.value && await Te(e);
|
|
273
|
-
}, Oe = async (e) => {
|
|
274
|
-
if (De(), e.type === "expand" || e.type === "collapse") {
|
|
275
|
-
R(e.rowKey), J.select(e.rowKey, !1), await X(e.rowKey);
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
J.select(e.rowKey, !1), await X(e.rowKey);
|
|
279
|
-
}, ke = async (e, t) => {
|
|
280
|
-
if (!Ee.value || e.key !== "ArrowUp" && e.key !== "ArrowDown") return !1;
|
|
281
|
-
let n = B(t, T.value), r = ge(e.key, n, F.value);
|
|
282
|
-
return r ? (e.preventDefault(), De(), J.select(r, !1), await X(r), !0) : !1;
|
|
283
|
-
}, Ae = async (e, t) => {
|
|
284
|
-
if (!Ee.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return !1;
|
|
285
|
-
let n = B(t, T.value), r = he(e.key, n, F.value);
|
|
286
|
-
return r ? (e.preventDefault(), await Oe(r), !0) : !1;
|
|
287
|
-
}, Z = () => {
|
|
288
|
-
if (w.value) return w.value;
|
|
289
|
-
let e = B("", T.value);
|
|
290
|
-
if (e) return e;
|
|
291
|
-
let t = Ce.value;
|
|
292
|
-
if (t) {
|
|
293
|
-
for (let e of t) if (!we.value.has(e)) return e;
|
|
294
|
-
}
|
|
295
|
-
}, je = () => Z(), Me = async (e) => {
|
|
296
|
-
let t = je();
|
|
297
|
-
t && await Q(e, t);
|
|
298
|
-
}, Ne = [
|
|
299
|
-
"Enter",
|
|
300
|
-
" ",
|
|
301
|
-
"Spacebar"
|
|
302
|
-
], Pe = (e, t) => {
|
|
303
|
-
if (!Ne.includes(e.key)) return !1;
|
|
304
|
-
let n = F.value.find((e) => e.key === t);
|
|
305
|
-
return n?.loadMoreForKey ? (e.preventDefault(), xe(n.loadMoreForKey, n.item), !0) : !1;
|
|
306
|
-
}, Q = async (e, t) => {
|
|
307
|
-
Pe(e, t) || await ke(e, t) || await Ae(e, t) || (await J.handleItemKeydown(e, t), w.value = J.focusedValue.value, !J.focusedValue.value && !P.value && Y());
|
|
308
|
-
}, Fe = async (e) => {
|
|
309
|
-
let t = Z();
|
|
310
|
-
t && await Q(e, t);
|
|
311
|
-
}, Ie = async (e) => {
|
|
312
|
-
if (P.value || e.target !== A.value) return;
|
|
313
|
-
let t = Z();
|
|
314
|
-
t && await Q(e, t);
|
|
315
|
-
}, Le = async () => {
|
|
316
|
-
let e = Z();
|
|
317
|
-
if (!e) {
|
|
318
|
-
Y();
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
await J.focusItem(e, !1);
|
|
322
|
-
};
|
|
323
|
-
te(i, {
|
|
324
|
-
mode: () => p.selectionMode,
|
|
325
|
-
isSelected: J.isSelected,
|
|
326
|
-
selectItem: J.toggle,
|
|
327
|
-
registerItem: J.registerItem,
|
|
328
|
-
getItemTabIndex: J.getItemTabIndex,
|
|
329
|
-
getGroupTabIndex: J.getGroupTabIndex,
|
|
330
|
-
handleItemKeydown: Q,
|
|
331
|
-
activeKey: () => w.value,
|
|
332
|
-
setActiveKey: (e) => {
|
|
333
|
-
w.value = e;
|
|
334
|
-
},
|
|
335
|
-
isExpanded: (e) => E.value.includes(e),
|
|
336
|
-
toggleExpanded: (e) => {
|
|
337
|
-
if (M.value) {
|
|
338
|
-
R(e);
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
let t = new Set(E.value);
|
|
342
|
-
t.has(e) ? t.delete(e) : t.add(e), E.value = [...t];
|
|
343
|
-
},
|
|
344
|
-
revealRight: () => p.revealRight,
|
|
345
|
-
expandOnClick: () => p.expandOnClick,
|
|
346
|
-
getItemOptionId: (e) => {
|
|
347
|
-
if (P.value) return q(e);
|
|
348
|
-
},
|
|
349
|
-
usesActiveDescendantNavigation: () => P.value,
|
|
350
|
-
handlesTreeKeyboardNavigation: () => M.value
|
|
351
|
-
});
|
|
352
|
-
let Re = s(() => K.value.getVirtualItems()), ze = s(() => Re.value.flatMap((e) => {
|
|
353
|
-
let t = F.value[e.index];
|
|
354
|
-
return t ? [{
|
|
355
|
-
virtualRow: e,
|
|
356
|
-
flatRow: t
|
|
357
|
-
}] : [];
|
|
358
|
-
})), Be = s(() => K.value.getTotalSize()), Ve = s(() => ({
|
|
359
|
-
height: `${Be.value}px`,
|
|
360
|
-
position: "relative",
|
|
361
|
-
width: "100%"
|
|
362
|
-
})), He = s(() => {
|
|
363
|
-
let e = {};
|
|
364
|
-
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;
|
|
365
|
-
}), Ue = s(() => ({
|
|
366
|
-
"s-ui-list--virtual": P.value,
|
|
367
|
-
"s-ui-list--static": !P.value
|
|
368
|
-
})), We = s(() => ({ "--s-ui-list-gap": de[p.gap] })), Ge = s(() => ({ "s-ui-list__scroll--flat": M.value && !P.value })), Ke = s(() => {
|
|
369
|
-
if (p.selectionMode === e.MULTIPLE) return !0;
|
|
370
|
-
}), qe = s(() => {
|
|
371
|
-
if (!P.value) return "listbox";
|
|
372
|
-
}), Je = s(() => {
|
|
373
|
-
if (!P.value) return Ke.value;
|
|
374
|
-
}), Ye = s(() => {
|
|
375
|
-
if (P.value) return J.getGroupTabIndex();
|
|
376
|
-
}), Xe = s(() => w.value ? w.value : B("", T.value)), Ze = s(() => {
|
|
377
|
-
if (!P.value) return;
|
|
378
|
-
let e = Xe.value;
|
|
379
|
-
if (e) return q(e);
|
|
380
|
-
});
|
|
381
|
-
ue(() => k.value, {
|
|
382
|
-
distance: () => p.endReachedDistance,
|
|
383
|
-
canLoadMore: () => p.canLoadMore ? p.canLoadMore() : !0,
|
|
384
|
-
onEndReached: () => {
|
|
385
|
-
D("endReached", { direction: "bottom" });
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
let Qe = (e) => ({
|
|
389
|
-
position: "absolute",
|
|
390
|
-
top: 0,
|
|
391
|
-
left: 0,
|
|
392
|
-
width: "100%",
|
|
393
|
-
transform: `translateY(${e.start}px)`
|
|
394
|
-
}), $e = (e) => {
|
|
395
|
-
e instanceof HTMLElement && K.value.measureElement(e);
|
|
396
|
-
}, et = (e) => {
|
|
397
|
-
let t = e.item, n = {
|
|
398
|
-
rowKey: e.key,
|
|
399
|
-
depth: e.depth,
|
|
400
|
-
expandable: e.hasChildren,
|
|
401
|
-
expanded: e.expanded,
|
|
402
|
-
selected: J.isSelected(e.key),
|
|
403
|
-
active: w.value === e.key,
|
|
404
|
-
disabled: L(t, p.disabledKey),
|
|
405
|
-
title: I(t, p.titleKey),
|
|
406
|
-
subtitle: I(t, p.subtitleKey),
|
|
407
|
-
iconLeft: z(t, p.iconLeftKey),
|
|
408
|
-
revealRight: p.revealRight
|
|
409
|
-
};
|
|
410
|
-
return p.itemProps ? {
|
|
411
|
-
...n,
|
|
412
|
-
...p.itemProps(t, e)
|
|
413
|
-
} : n;
|
|
414
|
-
}, $ = (e) => ({
|
|
415
|
-
...e,
|
|
416
|
-
revealRight: p.revealRight,
|
|
417
|
-
toggleExpanded: () => {
|
|
418
|
-
R(e.key);
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
return m({
|
|
422
|
-
focusNavigation: Le,
|
|
423
|
-
handleKeyboardNavigation: Fe
|
|
424
|
-
}), (e, t) => (v(), l("div", {
|
|
425
|
-
ref_key: "listRootElementRef",
|
|
426
|
-
ref: A,
|
|
427
|
-
class: g(["s-ui-list", Ue.value]),
|
|
428
|
-
style: _(We.value),
|
|
429
|
-
role: qe.value,
|
|
430
|
-
"aria-multiselectable": Je.value,
|
|
431
|
-
tabindex: "-1",
|
|
432
|
-
onKeydown: Ie
|
|
433
|
-
}, [M.value && P.value ? (v(), l("div", {
|
|
434
|
-
key: 0,
|
|
435
|
-
ref_key: "scrollElementRef",
|
|
436
|
-
ref: k,
|
|
437
|
-
class: g(["s-ui-list__scroll", Ge.value]),
|
|
438
|
-
style: _(He.value),
|
|
439
|
-
role: "listbox",
|
|
440
|
-
"aria-multiselectable": Ke.value,
|
|
441
|
-
"aria-activedescendant": Ze.value,
|
|
442
|
-
tabindex: Ye.value,
|
|
443
|
-
onKeydown: Me
|
|
444
|
-
}, [u("div", {
|
|
445
|
-
class: "s-ui-list__virtual-panel",
|
|
446
|
-
style: _(Ve.value)
|
|
447
|
-
}, [(v(!0), l(o, null, ne(ze.value, (t) => (v(), l("div", {
|
|
448
|
-
key: t.virtualRow.index,
|
|
449
|
-
class: "s-ui-list__virtual-row",
|
|
450
|
-
"data-index": t.virtualRow.index,
|
|
451
|
-
ref_for: !0,
|
|
452
|
-
ref: $e,
|
|
453
|
-
style: _(Qe(t.virtualRow))
|
|
454
|
-
}, [t.flatRow.loadMoreForKey ? (v(), l(o, { key: 0 }, [x(O).loadMore ? y(e.$slots, "loadMore", h({
|
|
455
|
-
key: 0,
|
|
456
|
-
ref_for: !0
|
|
457
|
-
}, Se(t.flatRow))) : (v(), c(x(a), {
|
|
458
|
-
key: 1,
|
|
459
|
-
"row-key": t.flatRow.key,
|
|
460
|
-
depth: t.flatRow.depth,
|
|
461
|
-
tiny: "",
|
|
462
|
-
title: U.value,
|
|
463
|
-
onClick: (e) => G(t.flatRow)
|
|
464
|
-
}, d({ _: 2 }, [W(t.flatRow) ? {
|
|
465
|
-
name: "icon-left",
|
|
466
|
-
fn: C(() => [f(x(oe), { size: 16 })]),
|
|
467
|
-
key: "0"
|
|
468
|
-
} : void 0]), 1032, [
|
|
469
|
-
"row-key",
|
|
470
|
-
"depth",
|
|
471
|
-
"title",
|
|
472
|
-
"onClick"
|
|
473
|
-
]))], 64)) : (v(), l(o, { key: 1 }, [x(O).item ? y(e.$slots, "item", h({
|
|
474
|
-
key: 0,
|
|
475
|
-
ref_for: !0
|
|
476
|
-
}, $(t.flatRow))) : (v(), c(x(a), h({
|
|
477
|
-
key: 1,
|
|
478
|
-
ref_for: !0
|
|
479
|
-
}, et(t.flatRow)), null, 16))], 64))], 12, ye))), 128))], 4)], 46, ve)) : M.value ? (v(), l("div", {
|
|
480
|
-
key: 1,
|
|
481
|
-
ref_key: "scrollElementRef",
|
|
482
|
-
ref: k,
|
|
483
|
-
class: g(["s-ui-list__scroll", Ge.value]),
|
|
484
|
-
style: _(He.value)
|
|
485
|
-
}, [(v(!0), l(o, null, ne(x(F), (t) => (v(), l(o, { key: t.key }, [t.loadMoreForKey ? (v(), l(o, { key: 0 }, [x(O).loadMore ? y(e.$slots, "loadMore", h({
|
|
486
|
-
key: 0,
|
|
487
|
-
ref_for: !0
|
|
488
|
-
}, Se(t))) : (v(), c(x(a), {
|
|
489
|
-
key: 1,
|
|
490
|
-
"row-key": t.key,
|
|
491
|
-
depth: t.depth,
|
|
492
|
-
tiny: "",
|
|
493
|
-
title: U.value,
|
|
494
|
-
onClick: (e) => G(t)
|
|
495
|
-
}, d({ _: 2 }, [W(t) ? {
|
|
496
|
-
name: "icon-left",
|
|
497
|
-
fn: C(() => [f(x(oe), { size: 16 })]),
|
|
498
|
-
key: "0"
|
|
499
|
-
} : void 0]), 1032, [
|
|
500
|
-
"row-key",
|
|
501
|
-
"depth",
|
|
502
|
-
"title",
|
|
503
|
-
"onClick"
|
|
504
|
-
]))], 64)) : (v(), l(o, { key: 1 }, [x(O).item ? y(e.$slots, "item", h({
|
|
505
|
-
key: 0,
|
|
506
|
-
ref_for: !0
|
|
507
|
-
}, $(t))) : (v(), c(x(a), h({
|
|
508
|
-
key: 1,
|
|
509
|
-
ref_for: !0
|
|
510
|
-
}, et(t)), null, 16))], 64))], 64))), 128))], 6)) : (v(), l("div", be, [y(e.$slots, "default")]))], 46, _e));
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
//#endregion
|
|
514
|
-
export { P as a, I as i, L as n, ue as o, z as r, N as s, W as t };
|
package/dist/SList-qQ7B5u8o.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./useSelectionGroup-TaektE-I.cjs"),t=require("./SListItem-DBGDVeoJ.cjs");let n=require("vue"),r=require("@shtabapp/ui-kit-primitives"),i=require("@vueuse/core"),a=require("@tanstack/vue-virtual");var o=(e,t)=>{if(typeof t==`function`)return t(e);let n=e[t];return typeof n==`string`?n:typeof n==`number`?String(n):``},s=(e,t)=>{let n=e[t];return Array.isArray(n)?n.filter(e=>typeof e==`object`&&!!e):[]},c=(e,t)=>{if(!t)return!1;let n=e[t];return typeof n==`boolean`?n:!1},l=`__s-ui-load-more:`,u=e=>`${l}${e}`,d=(e,t,n,r)=>{s(e,n).forEach(e=>{let i=o(e,t);i&&r.add(i),d(e,t,n,r)})},f=(e,t,n,r)=>{for(let i of e){if(o(i,n)===t)return i;let e=f(s(i,r),t,n,r);if(e)return e}},p=(e,t,n,r,i,a,l,d)=>{e.forEach(e=>{let f=o(e,t);if(!f)return;let m=s(e,n),h=m.length>0,g=r.includes(f);l.push({key:f,item:e,depth:i,flatIndex:l.length,hasChildren:h,expanded:g,parentKey:a}),h&&g&&p(m,t,n,r,i+1,f,l,d),h&&g&&c(e,d)&&l.push({key:u(f),item:e,depth:i+1,flatIndex:l.length,hasChildren:!1,expanded:!1,parentKey:f,loadMoreForKey:f})})},m=({items:e,childrenKey:t,itemKey:r,expanded:i,hasMoreChildrenKey:a})=>({flatRows:(0,n.computed)(()=>{let o=[],s=(0,n.toValue)(e),c=(0,n.toValue)(t),l=(0,n.toValue)(r),u=(0,n.toValue)(a);return p(s,l,c,i.value,0,void 0,o,u),o}),toggleExpanded:a=>{let o=(0,n.toValue)(e),s=(0,n.toValue)(t),c=(0,n.toValue)(r),l=new Set(i.value);if(l.has(a)){l.delete(a);let e=f(o,a,c,s);if(e){let t=new Set;d(e,c,s,t),t.forEach(e=>{l.delete(e)})}}else l.add(a);i.value=[...l]},isExpanded:e=>i.value.includes(e)}),h=(e,t)=>(0,i.useInfiniteScroll)(e,()=>{t.onEndReached()},{distance:(0,n.toValue)(t.distance),canLoadMore:()=>t.canLoadMore===void 0?!0:(0,n.toValue)(t.canLoadMore),direction:`bottom`}),g=function(e){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}({}),_=g.TWO_X_SMALL,ee={[g.NONE]:`var(--s-ui-space-gap-none)`,[g.TWO_X_SMALL]:`var(--s-ui-space-gap-2x-small)`,[g.X_SMALL]:`var(--s-ui-space-gap-x-small)`,[g.SMALL]:`var(--s-ui-space-gap-small)`,[g.MEDIUM]:`var(--s-ui-space-gap-medium)`,[g.X_MEDIUM]:`var(--s-ui-space-gap-x-medium)`,[g.LARGE]:`var(--s-ui-space-gap-large)`,[g.X_LARGE]:`var(--s-ui-space-gap-x-large)`,[g.TWO_X_LARGE]:`var(--s-ui-space-gap-2x-large)`},te={[g.NONE]:0,[g.TWO_X_SMALL]:2,[g.X_SMALL]:4,[g.SMALL]:8,[g.MEDIUM]:12,[g.X_MEDIUM]:16,[g.LARGE]:20,[g.X_LARGE]:24,[g.TWO_X_LARGE]:32},ne=(e,t)=>`s-ui-list-option-${e}-${t}`,v=(e,t)=>{let n=e[t];if(typeof n==`string`)return n},y=(e,t)=>{let n=e[t];return typeof n==`boolean`?n:!1},b=e=>e in r.ESIconName,x=(e,t)=>{let n=e[t];if(typeof n==`string`&&n.length>0&&b(n))return n},S=(e,t)=>typeof t==`string`&&t?t:Array.isArray(t)&&t[0]?t[0]:e,re=e=>e.some(e=>e.hasChildren||e.parentKey),C=(e,t,n)=>{if(!e.hasChildren)return null;if(!e.expanded)return{type:`expand`,rowKey:t};let r=n.find(e=>e.parentKey===t);return r?{type:`select`,rowKey:r.key}:null},w=(e,t)=>e.hasChildren&&e.expanded?{type:`collapse`,rowKey:t}:e.parentKey?{type:`select`,rowKey:e.parentKey}:null,T=(e,t,n)=>{let r=n.find(e=>e.key===t);return r?e===`ArrowRight`?C(r,t,n):w(r,t):null},E=(e,t,n,r)=>{for(let i=t;i>=0&&i<e.length;i+=n){let t=e[i];if(t&&t.depth<=r)return t.key}return null},ie=(e,t,n)=>{let r=n.findIndex(e=>e.key===t);if(r===-1)return null;let i=n[r];if(!i)return null;let a=e===`ArrowDown`?1:-1;return E(n,r+a,a,i.depth)},ae=[`role`,`aria-multiselectable`],oe=[`aria-multiselectable`,`aria-activedescendant`,`tabindex`],se=[`data-index`],ce={key:2,class:`s-ui-list__static`},D=(0,n.defineComponent)({__name:`SList`,props:(0,n.mergeModels)({items:{},itemKey:{type:[String,Function],default:`id`},childrenKey:{default:`children`},titleKey:{default:`title`},subtitleKey:{default:`subtitle`},iconLeftKey:{default:`iconLeft`},disabledKey:{default:`disabled`},itemProps:{type:Function},selectionMode:{default:()=>e.n.NONE},mandatory:{type:Boolean,default:!1},virtual:{type:Boolean},gap:{default:()=>_},estimateItemSize:{default:36},overscan:{default:5},endReachedDistance:{default:0},canLoadMore:{type:Function},height:{default:320},maxHeight:{},revealRight:{type:Boolean,default:!1},expandOnClick:{type:Boolean,default:!1},hasMoreChildrenKey:{},loadingMoreChildrenKeys:{default:()=>[]}},{modelValue:{},modelModifiers:{},selected:{},selectedModifiers:{},expanded:{default:()=>[]},expandedModifiers:{}}),emits:(0,n.mergeModels)([`endReached`,`loadMoreChildren`],[`update:modelValue`,`update:selected`,`update:expanded`]),setup(i,{expose:o,emit:s}){let c=(0,n.useModel)(i,`modelValue`),l=(0,n.useModel)(i,`selected`),u=(0,n.useModel)(i,`expanded`),d=s,f=(0,n.useSlots)(),p=(0,n.useId)(),g=(0,n.useTemplateRef)(`scrollElementRef`),_=(0,n.useTemplateRef)(`listRootElementRef`),b=(0,n.computed)(()=>te[i.gap]),C=(0,n.computed)(()=>i.items!==void 0),w=(0,n.computed)(()=>C.value?i.virtual===void 0?!0:i.virtual:!1),{flatRows:E,toggleExpanded:D}=m({items:()=>i.items??[],childrenKey:()=>i.childrenKey,itemKey:()=>i.itemKey,expanded:u,hasMoreChildrenKey:()=>i.hasMoreChildrenKey}),{t:O}=(0,r.useUiKitI18n)(),k=(0,n.computed)(()=>new Set(i.loadingMoreChildrenKeys)),A=(0,n.computed)(()=>O(`list.loadMore`)),j=e=>e.loadMoreForKey?k.value.has(e.loadMoreForKey):!1,M=(e,t)=>{k.value.has(e)||d(`loadMoreChildren`,{key:e,item:t})},N=e=>{e.loadMoreForKey&&M(e.loadMoreForKey,e.item)},P=e=>({parentKey:e.loadMoreForKey??``,parentItem:e.item,depth:e.depth,loading:j(e),loadMore:()=>{N(e)}}),F=(0,a.useVirtualizer)((0,n.computed)(()=>({count:E.value.length,getScrollElement:()=>g.value,estimateSize:()=>i.estimateItemSize,gap:b.value,overscan:i.overscan}))),I=(0,n.computed)(()=>{if(C.value)return E.value.map(e=>e.key)}),L=(0,n.computed)(()=>{let e=new Set;for(let t of E.value)!t.loadMoreForKey&&y(t.item,i.disabledKey)&&e.add(t.key);return e}),R=async e=>{if(!w.value)return;let t=E.value.findIndex(t=>t.key===e);t!==-1&&(F.value.scrollToIndex(t,{align:`auto`}),await new Promise(e=>{requestAnimationFrame(()=>{e()})}),await(0,n.nextTick)())},z=e=>ne(p,e),B=e.o({modelValue:()=>l.value,onUpdateModelValue:e=>{l.value=e},mode:()=>i.selectionMode,mandatory:()=>i.mandatory,orientation:()=>e.r.VERTICAL,enableTabNavigation:!0,focusMode:()=>w.value?e.t.ACTIVE_DESCENDANT:e.t.DOM,orderedValues:I,isValueDisabled:e=>L.value.has(e),onBeforeFocusItem:async e=>{await R(e)},onFocusGroup:()=>{g.value?.focus()}}),V=(0,n.computed)(()=>C.value&&re(E.value)),H=()=>{if(w.value){g.value?.focus();return}_.value?.focus()},U=()=>{B.focusedValue.value=void 0,c.value=void 0;let e=document.activeElement;e instanceof HTMLElement&&e!==g.value&&e.blur(),H()},W=async e=>{w.value&&await R(e)},G=async e=>{if(U(),e.type===`expand`||e.type===`collapse`){D(e.rowKey),B.select(e.rowKey,!1),await W(e.rowKey);return}B.select(e.rowKey,!1),await W(e.rowKey)},K=async(e,t)=>{if(!V.value||e.key!==`ArrowUp`&&e.key!==`ArrowDown`)return!1;let n=S(t,l.value),r=ie(e.key,n,E.value);return r?(e.preventDefault(),U(),B.select(r,!1),await W(r),!0):!1},le=async(e,t)=>{if(!V.value||e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return!1;let n=S(t,l.value),r=T(e.key,n,E.value);return r?(e.preventDefault(),await G(r),!0):!1},q=()=>{if(c.value)return c.value;let e=S(``,l.value);if(e)return e;let t=I.value;if(t){for(let e of t)if(!L.value.has(e))return e}},ue=()=>q(),de=async e=>{let t=ue();t&&await J(e,t)},fe=[`Enter`,` `,`Spacebar`],pe=(e,t)=>{if(!fe.includes(e.key))return!1;let n=E.value.find(e=>e.key===t);return n?.loadMoreForKey?(e.preventDefault(),M(n.loadMoreForKey,n.item),!0):!1},J=async(e,t)=>{pe(e,t)||await K(e,t)||await le(e,t)||(await B.handleItemKeydown(e,t),c.value=B.focusedValue.value,!B.focusedValue.value&&!w.value&&H())},me=async e=>{let t=q();t&&await J(e,t)},he=async e=>{if(w.value||e.target!==_.value)return;let t=q();t&&await J(e,t)},ge=async()=>{let e=q();if(!e){H();return}await B.focusItem(e,!1)};(0,n.provide)(t.r,{mode:()=>i.selectionMode,isSelected:B.isSelected,selectItem:B.toggle,registerItem:B.registerItem,getItemTabIndex:B.getItemTabIndex,getGroupTabIndex:B.getGroupTabIndex,handleItemKeydown:J,activeKey:()=>c.value,setActiveKey:e=>{c.value=e},isExpanded:e=>u.value.includes(e),toggleExpanded:e=>{if(C.value){D(e);return}let t=new Set(u.value);t.has(e)?t.delete(e):t.add(e),u.value=[...t]},revealRight:()=>i.revealRight,expandOnClick:()=>i.expandOnClick,getItemOptionId:e=>{if(w.value)return z(e)},usesActiveDescendantNavigation:()=>w.value,handlesTreeKeyboardNavigation:()=>C.value});let _e=(0,n.computed)(()=>F.value.getVirtualItems()),ve=(0,n.computed)(()=>_e.value.flatMap(e=>{let t=E.value[e.index];return t?[{virtualRow:e,flatRow:t}]:[]})),ye=(0,n.computed)(()=>F.value.getTotalSize()),be=(0,n.computed)(()=>({height:`${ye.value}px`,position:`relative`,width:`100%`})),Y=(0,n.computed)(()=>{let e={};return typeof i.height==`number`?e.height=`${i.height}px`:i.height&&(e.height=i.height),i.maxHeight&&(typeof i.maxHeight==`number`?e.maxHeight=`${i.maxHeight}px`:e.maxHeight=i.maxHeight),e}),xe=(0,n.computed)(()=>({"s-ui-list--virtual":w.value,"s-ui-list--static":!w.value})),Se=(0,n.computed)(()=>({"--s-ui-list-gap":ee[i.gap]})),X=(0,n.computed)(()=>({"s-ui-list__scroll--flat":C.value&&!w.value})),Z=(0,n.computed)(()=>{if(i.selectionMode===e.n.MULTIPLE)return!0}),Ce=(0,n.computed)(()=>{if(!w.value)return`listbox`}),we=(0,n.computed)(()=>{if(!w.value)return Z.value}),Te=(0,n.computed)(()=>{if(w.value)return B.getGroupTabIndex()}),Ee=(0,n.computed)(()=>c.value?c.value:S(``,l.value)),De=(0,n.computed)(()=>{if(!w.value)return;let e=Ee.value;if(e)return z(e)});h(()=>g.value,{distance:()=>i.endReachedDistance,canLoadMore:()=>i.canLoadMore?i.canLoadMore():!0,onEndReached:()=>{d(`endReached`,{direction:`bottom`})}});let Oe=e=>({position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`}),ke=e=>{e instanceof HTMLElement&&F.value.measureElement(e)},Q=e=>{let t=e.item,n={rowKey:e.key,depth:e.depth,expandable:e.hasChildren,expanded:e.expanded,selected:B.isSelected(e.key),active:c.value===e.key,disabled:y(t,i.disabledKey),title:v(t,i.titleKey),subtitle:v(t,i.subtitleKey),iconLeft:x(t,i.iconLeftKey),revealRight:i.revealRight};return i.itemProps?{...n,...i.itemProps(t,e)}:n},$=e=>({...e,revealRight:i.revealRight,toggleExpanded:()=>{D(e.key)}});return o({focusNavigation:ge,handleKeyboardNavigation:me}),(e,i)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{ref_key:`listRootElementRef`,ref:_,class:(0,n.normalizeClass)([`s-ui-list`,xe.value]),style:(0,n.normalizeStyle)(Se.value),role:Ce.value,"aria-multiselectable":we.value,tabindex:`-1`,onKeydown:he},[C.value&&w.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,ref_key:`scrollElementRef`,ref:g,class:(0,n.normalizeClass)([`s-ui-list__scroll`,X.value]),style:(0,n.normalizeStyle)(Y.value),role:`listbox`,"aria-multiselectable":Z.value,"aria-activedescendant":De.value,tabindex:Te.value,onKeydown:de},[(0,n.createElementVNode)(`div`,{class:`s-ui-list__virtual-panel`,style:(0,n.normalizeStyle)(be.value)},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(ve.value,i=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:i.virtualRow.index,class:`s-ui-list__virtual-row`,"data-index":i.virtualRow.index,ref_for:!0,ref:ke,style:(0,n.normalizeStyle)(Oe(i.virtualRow))},[i.flatRow.loadMoreForKey?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.unref)(f).loadMore?(0,n.renderSlot)(e.$slots,`loadMore`,(0,n.mergeProps)({key:0,ref_for:!0},P(i.flatRow))):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(t.t),{key:1,"row-key":i.flatRow.key,depth:i.flatRow.depth,tiny:``,title:A.value,onClick:e=>N(i.flatRow)},(0,n.createSlots)({_:2},[j(i.flatRow)?{name:`icon-left`,fn:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.SSpinner),{size:16})]),key:`0`}:void 0]),1032,[`row-key`,`depth`,`title`,`onClick`]))],64)):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.unref)(f).item?(0,n.renderSlot)(e.$slots,`item`,(0,n.mergeProps)({key:0,ref_for:!0},$(i.flatRow))):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(t.t),(0,n.mergeProps)({key:1,ref_for:!0},Q(i.flatRow)),null,16))],64))],12,se))),128))],4)],46,oe)):C.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:1,ref_key:`scrollElementRef`,ref:g,class:(0,n.normalizeClass)([`s-ui-list__scroll`,X.value]),style:(0,n.normalizeStyle)(Y.value)},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(E),i=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:i.key},[i.loadMoreForKey?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.unref)(f).loadMore?(0,n.renderSlot)(e.$slots,`loadMore`,(0,n.mergeProps)({key:0,ref_for:!0},P(i))):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(t.t),{key:1,"row-key":i.key,depth:i.depth,tiny:``,title:A.value,onClick:e=>N(i)},(0,n.createSlots)({_:2},[j(i)?{name:`icon-left`,fn:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.SSpinner),{size:16})]),key:`0`}:void 0]),1032,[`row-key`,`depth`,`title`,`onClick`]))],64)):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.unref)(f).item?(0,n.renderSlot)(e.$slots,`item`,(0,n.mergeProps)({key:0,ref_for:!0},$(i))):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(t.t),(0,n.mergeProps)({key:1,ref_for:!0},Q(i)),null,16))],64))],64))),128))],6)):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,ce,[(0,n.renderSlot)(e.$slots,`default`)]))],46,ae))}});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return D}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./SButton-C-z_q5CG.cjs"),n=require("./useSelectionGroup-TaektE-I.cjs"),r=require("./SDropdown-_QUOP-rw.cjs"),i=require("./SInput-DJL9QOIG.cjs"),a=require("./SList-qQ7B5u8o.cjs"),o=require("./SListItem-DBGDVeoJ.cjs");let s=require("vue"),c=require("@shtabapp/ui-kit-primitives");var l={key:0,class:`s-ui-dropdown-menu__header`},u={key:1,class:`s-ui-dropdown-menu__footer`},d=(0,s.defineComponent)({__name:`SDropdownMenu`,props:{width:{},maxHeight:{},accent:{type:Boolean,default:!1}},setup(e){let t=(0,s.useSlots)(),n=e=>typeof e==`number`?`${e}px`:e,r=(0,s.computed)(()=>({"s-ui-dropdown-menu--accent":e.accent,"s-ui-dropdown-menu--bounded":!!e.maxHeight})),i=(0,s.computed)(()=>({"s-ui-dropdown-menu__body--scrollable":!!e.maxHeight})),a=(0,s.computed)(()=>({"--s-ui-dropdown-menu-width":n(e.width),"--s-ui-dropdown-menu-max-height":n(e.maxHeight)}));return(e,n)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-dropdown-menu`,r.value]),style:(0,s.normalizeStyle)(a.value)},[(0,s.unref)(t).header?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,l,[(0,s.renderSlot)(e.$slots,`header`)])):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`div`,{class:(0,s.normalizeClass)([`s-ui-dropdown-menu__body`,i.value])},[(0,s.renderSlot)(e.$slots,`default`)],2),(0,s.unref)(t).footer?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,u,[(0,s.renderSlot)(e.$slots,`footer`)])):(0,s.createCommentVNode)(``,!0)],6))}}),f=({listItemScope:e,itemTitle:t,itemSubtitle:n,itemDisabled:r,itemIconLeft:i,listActiveKey:o,isOptionSelected:s})=>{let c=e.item;return{rowKey:e.key,title:a.i(c,t),subtitle:a.i(c,n),disabled:a.n(c,r),iconLeft:a.r(c,i),selected:s,active:o===e.key,revealRight:e.revealRight,tiny:!0}},p=e=>typeof e==`string`||typeof e==`number`,m=(e,t)=>{let n=e[t];if(p(n))return n},h=e=>typeof e==`string`?e:String(e),g=e=>e==null?!1:typeof e==`string`?e.length>0:!0,_=(e,t,n)=>t.find(t=>h(m(t,n)??``)===e),v=e=>typeof e==`object`&&!!e,y=(e,t,n)=>{let r=_(e,t,n);if(r)return m(r,n)},b=function(e){return e.INPUT=`input`,e.CONTENT=`content`,e}({}),x=(e,t,n)=>{if(!e)return!0;let r=e.toLocaleLowerCase(),i=a.i(t,n.itemTitle)?.toLocaleLowerCase()??``,o=h(m(t,n.itemValue)??``).toLocaleLowerCase();return i.includes(r)||o.includes(r)},S=(e,t,n,r)=>{let i=r??((e,t)=>x(e,t,n));return t?e.filter(e=>i(t,e)):[...e]},C=e=>typeof e==`string`&&g(e),w=e=>typeof e==`number`&&g(e),T=(e,t,n)=>{if(t){if(!v(e))return;let t=m(e,n);return C(t)||w(t)?t:void 0}let r=typeof e==`string`||typeof e==`number`?e:void 0;if(C(r)||w(r))return r},E=(e,t,n)=>e?(Array.isArray(e)?e:[e]).flatMap(e=>{let r=T(e,t,n);return g(r)?[r]:[]}):[],D=(e,t)=>{if(C(t)){e.value=t;return}if(w(t)){e.value=t;return}e.value=void 0},O=(e,t,n)=>t.flatMap(t=>{let r=h(t),i=e.find(e=>h(m(e,n)??``)===r);return i?[i]:[]}),ee=({modelValue:e,options:t,itemFields:r,multiple:i,returnObject:o,searchable:c,filterOption:l,isDropdownOpen:u,searchQuery:d})=>{let f=(0,s.computed)(()=>(0,s.toValue)(i)),p=(0,s.computed)(()=>(0,s.toValue)(o)),v=(0,s.computed)(()=>(0,s.toValue)(c)===b.INPUT),x=(0,s.computed)(()=>(0,s.toValue)(c)===b.CONTENT),C=(0,s.computed)(()=>!!(0,s.toValue)(c)),w=(0,s.computed)(()=>{let t=(0,s.toValue)(r);return E(e.value,p.value,t.itemValue)}),T=(0,s.computed)(()=>{let e=(0,s.toValue)(t),n=(0,s.toValue)(r);return S(e,C.value?d.value:``,n,(0,s.toValue)(l))}),ee=(0,s.computed)(()=>f.value?n.n.MULTIPLE:n.n.SINGLE),k=(t,n,r)=>{if(p.value){e.value=O(n,t,r);return}e.value=t},te=(t,n,r)=>{if(!t){e.value=void 0;return}if(p.value){e.value=_(t,n,r)??void 0;return}D(e,y(t,n,r))},ne=(0,s.computed)({get:()=>{if(f.value)return w.value.map(e=>h(e));let e=w.value[0];if(g(e))return h(e)},set:e=>{let n=(0,s.toValue)(t),i=(0,s.toValue)(r);if(f.value){k((Array.isArray(e)?e:[]).map(e=>y(e,n,i.itemValue)).filter(e=>g(e)),n,i.itemValue);return}te(typeof e==`string`?e:void 0,n,i.itemValue)}}),re=(0,s.computed)(()=>w.value.length>0),A=(e,t,n)=>{let r=h(t);return e.find(e=>h(m(e,n)??``)===r)},j=(0,s.computed)(()=>{let e=w.value[0];if(!g(e))return``;let n=(0,s.toValue)(r),i=A((0,s.toValue)(t),e,n.itemValue);return i?a.i(i,n.itemTitle)??``:h(e)}),M=(0,s.computed)(()=>{let e=(0,s.toValue)(t),n=(0,s.toValue)(r);return w.value.map(t=>{let r=A(e,t,n.itemValue);return r?a.i(r,n.itemTitle)??``:h(t)})}),N=(0,s.computed)(()=>M.value.join(`, `)),ie=(0,s.computed)(()=>f.value?w.value.length===0:!j.value),ae=(0,s.computed)(()=>v.value&&(u.value||f.value)),P=()=>{d.value=``};return(0,s.watch)(u,e=>{e||P()}),(0,s.watch)(()=>(0,s.toValue)(c),()=>{P()}),{searchQuery:d,selectedValues:w,filteredOptions:T,listSelectionMode:ee,listSelectedModel:ne,hasSelectedValues:re,singleDisplayLabel:j,multipleDisplayLabels:M,multipleDisplayText:N,showPlaceholder:ie,showInputSearchField:ae,isSearchableMode:C,isSearchableInputMode:v,isSearchableContentMode:x,isMultipleMode:f,isReturnObjectMode:p,clearSelection:()=>{e.value=void 0,P()},removeSelectedValue:e=>{let n=h(e);k(w.value.filter(e=>h(e)!==n),(0,s.toValue)(t),(0,s.toValue)(r).itemValue)},resetSearchQuery:P,formatSelectListKey:h,resolveValueFromListKey:e=>y(e,(0,s.toValue)(t),(0,s.toValue)(r).itemValue)}},k={key:0,class:`s-ui-select__options-divider`,role:`separator`},te={key:1,class:`s-ui-select__empty s-ui-typography-body-14-regular`},ne=[`id`,`aria-expanded`,`aria-controls`,`aria-disabled`,`aria-readonly`,`aria-autocomplete`,`tabindex`],re={key:0,class:`s-ui-select__value`},A={key:1,class:`s-ui-select__placeholder`},j={key:1,class:`s-ui-select__placeholder`},M={key:2,class:`s-ui-select__value`},N={key:3,class:`s-ui-select__value-suffix`},ie=[`name`,`placeholder`,`disabled`,`readonly`],ae=20,P=`100%`,oe=20,se=`__s-ui-select-options-divider__`,F=(0,s.defineComponent)({__name:`SSelect`,props:(0,s.mergeModels)({options:{},itemValue:{default:`value`},itemTitle:{default:`label`},itemSubtitle:{default:`subtitle`},itemId:{},itemDisabled:{default:`disabled`},itemIconLeft:{default:`iconLeft`},multiple:{type:Boolean,default:!1},returnObject:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},closableOptions:{type:Boolean,default:!1},searchable:{type:[String,Boolean],default:!1},closeOnSelect:{type:Boolean,default:!0},listHeight:{default:320},searchPlaceholder:{default:`Search`},filterOption:{type:Function},fitViewport:{type:Boolean,default:!0},panelWidth:{},surfaceClass:{},canLoadMore:{type:Function},endReachedDistance:{default:0},label:{},labelProps:{},placeholder:{},helpMessages:{},errorMessages:{},bordered:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},iconLeft:{},customize:{default:()=>i.n.NONE},name:{},id:{}},{modelValue:{},modelModifiers:{},searchQuery:{default:``},searchQueryModifiers:{}}),emits:(0,s.mergeModels)([`clear`,`focus`,`blur`,`open`,`close`,`endReached`],[`update:modelValue`,`update:searchQuery`]),setup(n,{expose:l,emit:u}){let p=(0,s.useModel)(n,`modelValue`),h=(0,s.useModel)(n,`searchQuery`),_=u,{t:v}=(0,c.useUiKitI18n)(),y=(0,s.useSlots)(),b=(0,s.useId)(),x=(0,s.useId)(),S=(0,s.useTemplateRef)(`triggerInputRef`),C=(0,s.ref)(``),w=(0,s.useTemplateRef)(`searchInputElementRef`),T=(0,s.useTemplateRef)(`panelSearchInputElementRef`),E=(0,s.useTemplateRef)(`listElementRef`),D=(0,s.ref)(),O=(0,s.ref)(!1),F=(0,s.ref)(!1),ce=(0,s.computed)(()=>n.panelWidth===void 0),le=(0,s.computed)(()=>n.panelWidth??P),I=(0,s.computed)(()=>n.itemId??n.itemValue),ue=(0,s.computed)(()=>({itemValue:n.itemValue,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemId:I.value})),{selectedValues:L,filteredOptions:R,listSelectionMode:de,listSelectedModel:z,hasSelectedValues:fe,singleDisplayLabel:pe,multipleDisplayLabels:me,multipleDisplayText:B,showPlaceholder:V,showInputSearchField:H,isSearchableMode:he,isSearchableInputMode:U,isSearchableContentMode:W,isMultipleMode:G,clearSelection:ge,removeSelectedValue:K,resolveValueFromListKey:_e,formatSelectListKey:q}=ee({modelValue:p,options:()=>n.options,itemFields:()=>ue.value,multiple:()=>n.multiple,returnObject:()=>n.returnObject,searchable:()=>n.searchable,filterOption:()=>n.filterOption,isDropdownOpen:O,searchQuery:h}),ve=(0,s.computed)(()=>!!y[`value-suffix`]),ye=(0,s.computed)(()=>({disabled:n.disabled,displayLabel:pe.value})),J=(0,s.computed)(()=>R.value.length>oe),be=(0,s.computed)(()=>W.value||J.value?n.listHeight:`auto`),xe=(0,s.computed)(()=>{if(!(W.value||J.value))return n.listHeight}),Se=(0,s.computed)(()=>L.value.map(e=>q(e))),Y=e=>Se.value.includes(e),Ce=(0,s.computed)(()=>({[I.value]:se,[n.itemDisabled]:!0})),we=e=>q(m(e,I.value)??``),Te=(0,s.computed)(()=>{if(!G.value)return R.value;let e=[],t=[];for(let n of R.value)Y(we(n))?e.push(n):t.push(n);return e.length===0||t.length===0?R.value:[...e,Ce.value,...t]}),Ee=()=>({tiny:!0}),De=e=>f({listItemScope:e,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemDisabled:n.itemDisabled,itemIconLeft:n.itemIconLeft,listActiveKey:D.value,isOptionSelected:Y(e.key)}),Oe=e=>{let t=_e(e);if(g(t)){if(G.value){K(t);return}p.value=void 0}},ke=(0,s.computed)(()=>n.id??b),Ae=(0,s.computed)(()=>x),je=(0,s.computed)(()=>S.value?.fieldElementRef??null),Me=(0,s.computed)(()=>({labels:me.value,values:L.value,displayText:B.value,disabled:n.disabled||n.readonly,removeValue:K})),Ne=(0,s.computed)(()=>{if(!n.disabled&&(n.readonly&&!U.value||!U.value))return 0}),Pe=(0,s.computed)(()=>({"s-ui-select--disabled":n.disabled,"s-ui-select--readonly":n.readonly,"s-ui-select--multiple":G.value,"s-ui-select--open":O.value})),Fe=()=>{if(W.value){T.value?.focus();return}w.value?.focus()},Ie=async()=>{await(0,s.nextTick)(),T.value?.focus()},Le=async()=>{await(0,s.nextTick)(),await E.value?.focusNavigation()},X=async()=>{if(!(n.disabled||n.readonly)&&!O.value){if(O.value=!0,_(`open`),W.value){await Ie();return}if(U.value){await(0,s.nextTick)(),w.value?.focus();return}await Le()}},Re=async()=>{n.disabled||n.readonly||O.value||await X()};(0,s.watch)(h,async e=>{U.value&&(n.disabled||n.readonly||e&&(O.value||await X()))});let Z=()=>{O.value&&(O.value=!1,D.value=void 0,_(`close`))},Q=()=>{!n.closeOnSelect||G.value||Z()};(0,s.watch)(p,(e,t)=>{!n.closeOnSelect||G.value||!O.value||!e||e===t||Z()});let ze=e=>{O.value&&e.target instanceof Element&&e.target.closest(`.s-ui-list-item`)&&Q()},Be=async e=>{e.key!==`Enter`&&e.key!==` `&&e.key!==`Spacebar`||O.value&&(await(0,s.nextTick)(),Q())},$=async()=>{if(O.value){Z();return}await X()},Ve=async e=>{if(!(n.disabled||n.readonly)&&e.target instanceof HTMLElement){if(e.target.closest(`.s-ui-select__search-input`)){O.value||await X();return}await $()}},He=async e=>e.key!==`ArrowDown`&&e.key!==`ArrowUp`?!1:(e.preventDefault(),e.stopPropagation(),O.value||await X(),await Le(),await E.value?.handleKeyboardNavigation(e),!0),Ue=e=>{let t=_e(e);if(t){if(G.value){L.value.some(t=>q(t)===e)?K(t):z.value=[...L.value.map(e=>q(e)),e];return}z.value=e,Q()}},We=async e=>{if(!(n.disabled||n.readonly)&&!await He(e)){if(e.key===`Escape`){e.preventDefault(),Z();return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),O.value&&D.value){Ue(D.value);return}await $()}}},Ge=async e=>{if(e.key===`Escape`){e.preventDefault(),Z();return}await He(e)},Ke=Ge,qe=e=>{n.disabled||(F.value||_(`focus`,e),F.value=!0)},Je=e=>{if(!(e.currentTarget instanceof HTMLElement))return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(F.value=!1,_(`blur`,e))},Ye=()=>{ge(),_(`clear`)},Xe=e=>{_(`endReached`,e)};return l({open:X,close:Z,toggle:$,focusSearchInput:Fe}),(l,u)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-select`,Pe.value])},[(0,s.createVNode)((0,s.unref)(r.t),{modelValue:O.value,"onUpdate:modelValue":u[4]||=e=>O.value=e,reference:je.value,disabled:n.disabled,"match-reference-width":ce.value,"fit-viewport":n.fitViewport,"surface-class":n.surfaceClass,"content-id":Ae.value,"dismiss-on-click-outside":!0,"dismiss-on-escape":!0},{content:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(d),{class:`s-ui-select__menu`,width:le.value},(0,s.createSlots)({default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{class:`s-ui-select__menu-body`,onClick:ze,onKeydown:Be},[(0,s.unref)(R).length>0?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),{key:0,ref_key:`listElementRef`,ref:E,modelValue:D.value,"onUpdate:modelValue":u[2]||=e=>D.value=e,selected:(0,s.unref)(z),"onUpdate:selected":u[3]||=e=>(0,s.isRef)(z)?z.value=e:null,items:Te.value,"item-key":I.value,"title-key":n.itemTitle,"subtitle-key":n.itemSubtitle,"icon-left-key":n.itemIconLeft,"disabled-key":n.itemDisabled,"selection-mode":(0,s.unref)(de),mandatory:!n.multiple,height:be.value,"max-height":xe.value,virtual:J.value,"item-props":Ee,"can-load-more":n.canLoadMore,"end-reached-distance":n.endReachedDistance,onEndReached:Xe},(0,s.createSlots)({_:2},[(0,s.unref)(y).option||(0,s.unref)(y)[`option-icon`]||n.closableOptions||(0,s.unref)(G)?{name:`item`,fn:(0,s.withCtx)(r=>[r.key===se?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,k)):(0,s.unref)(y).option?(0,s.renderSlot)(l.$slots,`option`,(0,s.normalizeProps)((0,s.mergeProps)({key:1},r))):n.closableOptions?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(o.t),(0,s.normalizeProps)((0,s.mergeProps)({key:2},De(r))),(0,s.createSlots)({_:2},[(0,s.unref)(y)[`option-icon`]?{name:`icon-left`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`option-icon`,(0,s.normalizeProps)((0,s.guardReactiveProps)(r)))]),key:`0`}:void 0,Y(r.key)?{name:`right`,fn:(0,s.withCtx)(n=>[(0,s.createVNode)((0,s.unref)(t.t),{appearance:(0,s.unref)(e.t).BARE,variant:(0,s.unref)(e.r).NEUTRAL,size:(0,s.unref)(e.n).SMALL,icon:`closeMini`,"aria-label":(0,s.unref)(v)(`select.removeOption`),disabled:n.disabled||n.readonly,tabindex:-1,onClick:(0,s.withModifiers)(e=>Oe(r.key),[`stop`])},null,8,[`appearance`,`variant`,`size`,`aria-label`,`disabled`,`onClick`])]),key:`1`}:void 0]),1040)):((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(o.t),(0,s.normalizeProps)((0,s.mergeProps)({key:3},De(r))),(0,s.createSlots)({_:2},[(0,s.unref)(y)[`option-icon`]?{name:`icon-left`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`option-icon`,(0,s.normalizeProps)((0,s.guardReactiveProps)(r)))]),key:`0`}:void 0]),1040))]),key:`0`}:void 0]),1032,[`modelValue`,`selected`,`items`,`item-key`,`title-key`,`subtitle-key`,`icon-left-key`,`disabled-key`,`selection-mode`,`mandatory`,`height`,`max-height`,`virtual`,`can-load-more`,`end-reached-distance`])):((0,s.openBlock)(),(0,s.createElementBlock)(`div`,te,[(0,s.renderSlot)(l.$slots,`empty`,{},()=>[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(v)(`select.noOptions`)),1)])]))],32)]),_:2},[(0,s.unref)(W)||(0,s.unref)(y)[`panel-header`]?{name:`header`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`panel-header`),(0,s.unref)(W)?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(i.t),{key:0,ref_key:`panelSearchInputElementRef`,ref:T,modelValue:h.value,"onUpdate:modelValue":u[0]||=e=>h.value=e,placeholder:n.searchPlaceholder,disabled:n.disabled,clearable:!1,"icon-left":`search`,onClick:u[1]||=(0,s.withModifiers)(()=>{},[`stop`]),onKeydown:(0,s.unref)(Ke)},null,8,[`modelValue`,`placeholder`,`disabled`,`onKeydown`])):(0,s.createCommentVNode)(``,!0)]),key:`0`}:void 0,(0,s.unref)(y)[`panel-footer`]?{name:`footer`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`panel-footer`)]),key:`1`}:void 0]),1032,[`width`])]),_:3},8,[`modelValue`,`reference`,`disabled`,`match-reference-width`,`fit-viewport`,`surface-class`,`content-id`]),(0,s.createVNode)((0,s.unref)(i.t),{ref_key:`triggerInputRef`,ref:S,modelValue:C.value,"onUpdate:modelValue":u[7]||=e=>C.value=e,label:n.label,"label-props":n.labelProps,placeholder:n.placeholder,"help-messages":n.helpMessages,"error-messages":n.errorMessages,bordered:n.bordered,disabled:n.disabled,readonly:n.readonly,clearable:n.clearable,"has-value":(0,s.unref)(fe),focused:F.value||O.value,"icon-left":n.iconLeft,customize:n.customize,name:n.name,id:ke.value,onClear:Ye,onFocus:qe,onBlur:Je},(0,s.createSlots)({control:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{id:ke.value,class:(0,s.normalizeClass)([`s-ui-select__control s-ui-typography-body-14-regular`,{"s-ui-select__control--multiple":(0,s.unref)(G),"s-ui-select__control--empty":(0,s.unref)(G)&&!(0,s.unref)(fe)&&!(0,s.unref)(H),"s-ui-select__control--with-value-suffix":ve.value&&!(0,s.unref)(G)&&!(0,s.unref)(H)&&!(0,s.unref)(V)}]),role:`combobox`,"aria-expanded":O.value,"aria-controls":Ae.value,"aria-haspopup":`listbox`,"aria-disabled":n.disabled?!0:void 0,"aria-readonly":n.readonly?!0:void 0,"aria-autocomplete":(0,s.unref)(he)?`list`:void 0,tabindex:Ne.value,onClick:Ve,onKeydown:We},[(0,s.unref)(G)?(0,s.renderSlot)(l.$slots,`selection`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},Me.value)),()=>[(0,s.unref)(B)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,re,(0,s.toDisplayString)((0,s.unref)(B)),1)):(0,s.unref)(V)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,A,(0,s.toDisplayString)(n.placeholder),1)):(0,s.createCommentVNode)(``,!0)]):(0,s.unref)(V)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,j,(0,s.toDisplayString)(n.placeholder),1)):(0,s.unref)(H)?(0,s.createCommentVNode)(``,!0):((0,s.openBlock)(),(0,s.createElementBlock)(`span`,M,(0,s.toDisplayString)((0,s.unref)(pe)),1)),ve.value&&!(0,s.unref)(G)&&!(0,s.unref)(H)&&!(0,s.unref)(V)?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,N,[(0,s.renderSlot)(l.$slots,`value-suffix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(ye.value)))])):(0,s.createCommentVNode)(``,!0),(0,s.unref)(H)?(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)(`input`,{key:4,ref_key:`searchInputElementRef`,ref:w,"onUpdate:modelValue":u[5]||=e=>h.value=e,class:`s-ui-select__search-input`,type:`text`,name:n.name,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:`off`,onClick:u[6]||=(0,s.withModifiers)(()=>{},[`stop`]),onFocus:Re,onKeydown:Ge},null,40,ie)),[[s.vModelText,h.value]]):(0,s.createCommentVNode)(``,!0)],42,ne)]),action:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.SIcon),{name:`chevronMiniDown`,size:ae,class:`s-ui-select__chevron`})]),_:2},[(0,s.unref)(y).label?{name:`label`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`label`)]),key:`0`}:void 0,(0,s.unref)(y).prefix?{name:`prefix`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`prefix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`1`}:void 0,(0,s.unref)(y).prepend?{name:`prepend`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`prepend`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`2`}:void 0,(0,s.unref)(y).message?{name:`message`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`message`)]),key:`3`}:void 0]),1032,[`modelValue`,`label`,`label-props`,`placeholder`,`help-messages`,`error-messages`,`bordered`,`disabled`,`readonly`,`clearable`,`has-value`,`focused`,`icon-left`,`customize`,`name`,`id`])],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return F}});
|