@shtabapp/ui-kit 1.63.0 → 1.64.1

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