@leaflink/stash 51.4.0 → 51.5.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.
- package/dist/DescriptionListDetail.js +1 -1
- package/dist/DescriptionListDetail.js.map +1 -1
- package/dist/DescriptionListGroup.js +14 -14
- package/dist/DescriptionListGroup.js.map +1 -1
- package/dist/DescriptionListTerm.js +14 -16
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/DescriptionListTerm.vue.d.ts +2 -0
- package/dist/Dialog.js +1 -1
- package/dist/Dialog.js.map +1 -1
- package/dist/Select.js +137 -133
- package/dist/Select.js.map +1 -1
- package/dist/components.css +1 -1
- package/package.json +1 -1
package/dist/Select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Oe, useAttrs as Ie, useSlots as Me, ref as c, computed as
|
|
1
|
+
import { defineComponent as Oe, useAttrs as Ie, useSlots as Me, ref as c, computed as h, watch as U, nextTick as Y, onMounted as Fe, onUnmounted as Re, createBlock as J, openBlock as r, mergeProps as $e, unref as y, createSlots as Pe, withCtx as S, createElementVNode as f, toDisplayString as g, withDirectives as M, createElementBlock as d, Fragment as V, renderList as K, withKeys as re, normalizeClass as F, createCommentVNode as R, renderSlot as G, createTextVNode as $, withModifiers as P, createVNode as b, Teleport as ze, Transition as He, normalizeStyle as Ne, vModelText as Ae, vShow as Q } from "vue";
|
|
2
2
|
import { u as De, a as Le, f as Ue, o as Ve, s as Ke } from "./floating-ui.vue-pzUuloyX.js";
|
|
3
3
|
import Ge from "@leaflink/snitch";
|
|
4
4
|
import qe from "lodash-es/debounce";
|
|
@@ -14,16 +14,19 @@ import ce from "./Chip.js";
|
|
|
14
14
|
import z from "./Icon.js";
|
|
15
15
|
import { _ as et } from "./Field.vue_vue_type_script_setup_true_lang-DI6z3AE9.js";
|
|
16
16
|
import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
17
|
-
const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" },
|
|
17
|
+
const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, st = ["id", "aria-labelledby"], at = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "name"], nt = ["selected", "value", "disabled"], ot = ["aria-controls", "aria-expanded", "aria-label", "aria-disabled"], rt = ["id"], it = ["onKeypress", "onMousedown"], ct = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "stash-select__total"
|
|
20
20
|
}, ut = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "tw-flex tw-items-center tw-border-b tw-border-blue-500 tw-pr-1.5"
|
|
23
|
-
}, dt = ["data-test", "placeholder"], ft = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, pt = ["data-test", "onClick", "onMouseenter"],
|
|
23
|
+
}, dt = ["data-test", "placeholder"], ft = { class: "stash-select__options options tw-my-1.5 tw-w-full tw-border-white tw-bg-white" }, pt = ["data-test", "onClick", "onMouseenter"], ht = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "tw-ml-auto tw-pl-1.5"
|
|
26
|
+
}, vt = { class: "tw-m-1.5 tw-cursor-default tw-p-1.5" }, mt = {
|
|
24
27
|
class: "tw-m-1.5 tw-cursor-default tw-p-1.5",
|
|
25
28
|
"data-test": "stash-select|no-options"
|
|
26
|
-
},
|
|
29
|
+
}, yt = /* @__PURE__ */ Oe({
|
|
27
30
|
name: "ll-select",
|
|
28
31
|
__name: "Select",
|
|
29
32
|
props: {
|
|
@@ -73,27 +76,27 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
73
76
|
},
|
|
74
77
|
emits: ["update:model-value", "clear", "add", "remove", "opened", "closed"],
|
|
75
78
|
setup(ue, { emit: de }) {
|
|
76
|
-
const t = ue,
|
|
79
|
+
const t = ue, v = de, H = Ie(), fe = Me(), Z = c(null), m = c(null), x = c(null), q = c(null), ee = c(null), N = c(0), T = c(0), n = c([]), te = c(() => []), w = c(""), p = c(-1), u = c(!1), j = c({}), le = c(!1), { floatingStyles: pe } = De(Z, x, {
|
|
77
80
|
whileElementsMounted: Le,
|
|
78
81
|
placement: t.menuPlacement,
|
|
79
82
|
middleware: [
|
|
80
83
|
Ue(),
|
|
81
84
|
Ve(({ rects: e, placement: l }) => l.split("-")[0] === "bottom" && N.value > T.value ? N.value - e.reference.height + 6 : 6),
|
|
82
85
|
Ke({
|
|
83
|
-
apply({ availableHeight: e, elements: l, rects:
|
|
86
|
+
apply({ availableHeight: e, elements: l, rects: a }) {
|
|
84
87
|
t.enableTeleport && Object.assign(l.floating.style, {
|
|
85
|
-
maxWidth: `${
|
|
88
|
+
maxWidth: `${a.reference.width}px`,
|
|
86
89
|
maxHeight: `${Math.min(e, 300)}px`
|
|
87
90
|
});
|
|
88
91
|
}
|
|
89
92
|
})
|
|
90
93
|
]
|
|
91
|
-
}),
|
|
94
|
+
}), W = h(() => !t.hideSearch && t.searchable !== "false" && t.searchable !== !1), A = h(() => {
|
|
92
95
|
let e = (le.value && t.lazy ? t.lazy() : t.options).filter(Boolean);
|
|
93
|
-
return We(e[0]) || (e = e.map((l,
|
|
94
|
-
}),
|
|
95
|
-
() => !u.value && !t.single && !
|
|
96
|
-
), ye =
|
|
96
|
+
return We(e[0]) || (e = e.map((l, a) => ({ name: l, id: a }))), e;
|
|
97
|
+
}), he = h(() => n.value.length ? n.value.map((e) => e[t.displayBy] || e).join(", ") : ""), se = h(() => t.searchLoading || Object.keys(j.value).length > 0), C = h(() => t.disableFiltering || !(w.value || "").trim() ? A.value : te.value(w.value)), ve = h(() => N.value <= T.value), me = h(
|
|
98
|
+
() => !u.value && !t.single && !ve.value && n.value.length
|
|
99
|
+
), ye = h(() => [n.value.length, t.selectItemType, "selected"].filter(Boolean).join(" ")), we = h(() => t.preventEmpty || t.allowEmpty === "false" || t.allowEmpty === !1);
|
|
97
100
|
U(w, (e, l) => l !== e && L(-1)), U(n, () => I(), { deep: !0 }), U(
|
|
98
101
|
() => t.modelValue,
|
|
99
102
|
(e) => {
|
|
@@ -113,7 +116,7 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
113
116
|
() => t.options,
|
|
114
117
|
() => {
|
|
115
118
|
const { searchFor: e } = Ye({
|
|
116
|
-
items:
|
|
119
|
+
items: h(() => A.value),
|
|
117
120
|
fieldNames: t.searchBy.length ? t.searchBy : [t.displayBy],
|
|
118
121
|
trackBy: t.trackBy
|
|
119
122
|
});
|
|
@@ -121,69 +124,69 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
121
124
|
},
|
|
122
125
|
{ immediate: !0 }
|
|
123
126
|
);
|
|
124
|
-
const
|
|
125
|
-
n.value = [],
|
|
127
|
+
const X = (e) => e && typeof e == "object" && "disabled" in e && (e == null ? void 0 : e.disabled), _e = () => {
|
|
128
|
+
n.value = [], v("update:model-value", t.single ? void 0 : n.value), v("clear");
|
|
126
129
|
}, D = (e) => {
|
|
127
|
-
t.disabled || !e ||
|
|
128
|
-
},
|
|
130
|
+
t.disabled || !e || X(e) || (k(e) ? O(e) : (t.single && (n.value = []), n.value.push(e), v("update:model-value", t.single ? n.value[0] : n.value), v("add", e)), t.single && B());
|
|
131
|
+
}, ge = (e) => {
|
|
129
132
|
if (t.single) {
|
|
130
|
-
const
|
|
133
|
+
const a = A.value.find((o) => {
|
|
131
134
|
var i;
|
|
132
135
|
return ((i = o[t.trackBy]) == null ? void 0 : i.toString()) === e.target.value;
|
|
133
136
|
});
|
|
134
|
-
D(
|
|
137
|
+
D(a);
|
|
135
138
|
return;
|
|
136
139
|
}
|
|
137
140
|
const l = [...e.target.selectedOptions];
|
|
138
|
-
for (const
|
|
141
|
+
for (const a of [...n.value])
|
|
139
142
|
l.find((i) => {
|
|
140
|
-
var
|
|
141
|
-
return i.value === ((
|
|
142
|
-
}) || O(
|
|
143
|
-
for (const
|
|
143
|
+
var s;
|
|
144
|
+
return i.value === ((s = a[t.trackBy]) == null ? void 0 : s.toString());
|
|
145
|
+
}) || O(a);
|
|
146
|
+
for (const a of l) {
|
|
144
147
|
const o = A.value.find(
|
|
145
148
|
(i) => {
|
|
146
|
-
var
|
|
147
|
-
return ((
|
|
149
|
+
var s;
|
|
150
|
+
return ((s = i[t.trackBy]) == null ? void 0 : s.toString()) === a.value;
|
|
148
151
|
}
|
|
149
152
|
);
|
|
150
|
-
|
|
153
|
+
k(o) || D(o);
|
|
151
154
|
}
|
|
152
155
|
}, O = (e) => {
|
|
153
156
|
if (t.disabled || we.value && n.value.length === 1)
|
|
154
157
|
return;
|
|
155
|
-
const l = n.value.findIndex((
|
|
158
|
+
const l = n.value.findIndex((a) => a[t.trackBy] === e[t.trackBy]);
|
|
156
159
|
if (l === -1) {
|
|
157
160
|
Ge.warn("ll-select: could not find option to remove", e);
|
|
158
161
|
return;
|
|
159
162
|
}
|
|
160
|
-
n.value.splice(l, 1),
|
|
161
|
-
},
|
|
162
|
-
u.value || (I(), u.value = !0,
|
|
163
|
+
n.value.splice(l, 1), v("update:model-value", t.single ? n.value[0] : n.value), v("remove", e, l);
|
|
164
|
+
}, ae = () => {
|
|
165
|
+
u.value || (I(), u.value = !0, v("opened"), W.value && Y(() => {
|
|
163
166
|
var e;
|
|
164
167
|
(e = ee.value) == null || e.focus({ preventScroll: !0 });
|
|
165
168
|
}));
|
|
166
|
-
},
|
|
169
|
+
}, B = () => {
|
|
167
170
|
var e;
|
|
168
|
-
u.value &&
|
|
171
|
+
u.value && v("closed", n.value), L(-1), u.value = !1, t.preserveSearchTerm || (w.value = ""), (e = m.value) == null || e.blur();
|
|
169
172
|
}, be = async (e) => {
|
|
170
|
-
if (await
|
|
173
|
+
if (await Y(), !m.value)
|
|
171
174
|
return;
|
|
172
175
|
if (![E.ENTER, E.ESCAPE].includes(e.keyCode)) {
|
|
173
|
-
const
|
|
176
|
+
const a = m.value.querySelector(".stash-select__option--highlighted"), o = a == null ? void 0 : a.getBoundingClientRect(), i = m.value.getBoundingClientRect();
|
|
174
177
|
if (!o || !i)
|
|
175
178
|
return;
|
|
176
|
-
(o.bottom >= i.bottom || o.top <= i.top + o.height) && (
|
|
179
|
+
(o.bottom >= i.bottom || o.top <= i.top + o.height) && (a == null || a.scrollIntoView({ block: "nearest", inline: "nearest" }));
|
|
177
180
|
}
|
|
178
181
|
}, L = (e) => {
|
|
179
182
|
p.value = e;
|
|
180
183
|
}, Be = (e) => {
|
|
181
184
|
if (e.keyCode === E.ESCAPE)
|
|
182
|
-
|
|
185
|
+
B();
|
|
183
186
|
else if (e.keyCode === E.DOWN && p.value < C.value.length - 1 && u.value)
|
|
184
187
|
p.value++;
|
|
185
188
|
else if (e.keyCode === E.UP && p.value > 0)
|
|
186
|
-
u.value && p.value--, x.value &&
|
|
189
|
+
u.value && p.value--, x.value && W.value && p.value === 0 && (x.value.scrollTop -= 100);
|
|
187
190
|
else if (e.keyCode === E.ENTER && p.value !== -1 && u.value)
|
|
188
191
|
D(C.value[p.value]);
|
|
189
192
|
else
|
|
@@ -196,44 +199,44 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
196
199
|
return;
|
|
197
200
|
const e = Xe("search-request-");
|
|
198
201
|
try {
|
|
199
|
-
|
|
202
|
+
j.value[e] = !0, await t.onSearch(w.value);
|
|
200
203
|
} finally {
|
|
201
|
-
delete
|
|
204
|
+
delete j.value[e];
|
|
202
205
|
}
|
|
203
206
|
}, Se = (e, l) => [
|
|
204
207
|
{
|
|
205
208
|
"stash-select__option": !0,
|
|
206
|
-
"stash-select__option--disabled":
|
|
209
|
+
"stash-select__option--disabled": X(e),
|
|
207
210
|
"stash-select__option--highlighted": p.value === l,
|
|
208
|
-
"stash-select__option--selected":
|
|
211
|
+
"stash-select__option--selected": k(e)
|
|
209
212
|
},
|
|
210
213
|
// @deprecated
|
|
211
214
|
// backwards compatibility
|
|
212
215
|
{
|
|
213
216
|
"is-selected": p.value === l,
|
|
214
217
|
"tw-bg-ice-200": p.value === l,
|
|
215
|
-
"tw-bg-blue-100 tw-text-ice-700":
|
|
218
|
+
"tw-bg-blue-100 tw-text-ice-700": k(e)
|
|
216
219
|
}
|
|
217
|
-
],
|
|
220
|
+
], k = (e) => e == null ? !1 : n.value.some((l) => (l == null ? void 0 : l[t.trackBy]) === e[t.trackBy]);
|
|
218
221
|
function oe(e) {
|
|
219
222
|
var o, i;
|
|
220
223
|
if (!e)
|
|
221
224
|
return !1;
|
|
222
|
-
const l = (o = m.value) == null ? void 0 : o.contains(e),
|
|
223
|
-
return l ||
|
|
225
|
+
const l = (o = m.value) == null ? void 0 : o.contains(e), a = (i = x.value) == null ? void 0 : i.contains(e);
|
|
226
|
+
return l || a;
|
|
224
227
|
}
|
|
225
228
|
function Ee(e) {
|
|
226
229
|
const l = e.relatedTarget;
|
|
227
|
-
!oe(l) && l &&
|
|
230
|
+
!oe(l) && l && B();
|
|
228
231
|
}
|
|
229
232
|
function xe(e) {
|
|
230
233
|
const l = e.target;
|
|
231
|
-
oe(l) ||
|
|
234
|
+
oe(l) || B();
|
|
232
235
|
}
|
|
233
236
|
const Te = () => {
|
|
234
237
|
L(-1);
|
|
235
238
|
}, I = async () => {
|
|
236
|
-
await
|
|
239
|
+
await Y(), q.value && m.value && (T.value = T.value === 0 ? m.value.clientHeight : T.value, N.value = q.value.clientHeight);
|
|
237
240
|
};
|
|
238
241
|
return Fe(() => {
|
|
239
242
|
if (H.onInput)
|
|
@@ -241,7 +244,7 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
241
244
|
window.addEventListener("resize", I), I();
|
|
242
245
|
}), Re(() => {
|
|
243
246
|
window.removeEventListener("resize", I);
|
|
244
|
-
}), (e, l) => (r(),
|
|
247
|
+
}), (e, l) => (r(), J(et, $e(t, {
|
|
245
248
|
class: ["input ll-select stash-select", y(H).class],
|
|
246
249
|
"data-test": "stash-select",
|
|
247
250
|
"error-text": t.errorText || t.error,
|
|
@@ -249,38 +252,38 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
249
252
|
}), Pe({ _: 2 }, [
|
|
250
253
|
t.isReadOnly ? {
|
|
251
254
|
name: "default",
|
|
252
|
-
fn:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
id:
|
|
255
|
+
fn: S(({ fieldId: a, labelId: o }) => [
|
|
256
|
+
f("div", lt, [
|
|
257
|
+
f("span", {
|
|
258
|
+
id: a,
|
|
256
259
|
"aria-labelledby": o,
|
|
257
260
|
class: "show-empty tw-h-min"
|
|
258
|
-
},
|
|
261
|
+
}, g(he.value), 9, st)
|
|
259
262
|
])
|
|
260
263
|
]),
|
|
261
264
|
key: "0"
|
|
262
265
|
} : {
|
|
263
266
|
name: "default",
|
|
264
|
-
fn:
|
|
265
|
-
|
|
266
|
-
id:
|
|
267
|
+
fn: S(({ fieldId: a, fieldErrorId: o, hasError: i }) => [
|
|
268
|
+
f("select", {
|
|
269
|
+
id: a,
|
|
267
270
|
"aria-errormessage": o,
|
|
268
271
|
"aria-invalid": i,
|
|
269
272
|
class: "tw-sr-only",
|
|
270
273
|
disabled: t.disabled,
|
|
271
274
|
multiple: !t.single,
|
|
272
275
|
name: t.name,
|
|
273
|
-
onChange:
|
|
276
|
+
onChange: ge
|
|
274
277
|
}, [
|
|
275
|
-
(r(!0),
|
|
276
|
-
key: `srOnlyOption-${
|
|
277
|
-
selected:
|
|
278
|
-
value:
|
|
279
|
-
disabled:
|
|
280
|
-
},
|
|
281
|
-
l[5] || (l[5] =
|
|
282
|
-
], 40,
|
|
283
|
-
M((r(),
|
|
278
|
+
(r(!0), d(V, null, K(C.value, (s, _) => (r(), d("option", {
|
|
279
|
+
key: `srOnlyOption-${_}`,
|
|
280
|
+
selected: k(s),
|
|
281
|
+
value: s[t.trackBy],
|
|
282
|
+
disabled: X(s)
|
|
283
|
+
}, g(s[t.displayBy] || ""), 9, nt))), 128)),
|
|
284
|
+
l[5] || (l[5] = f("option", { value: "" }, null, -1))
|
|
285
|
+
], 40, at),
|
|
286
|
+
M((r(), d("div", {
|
|
284
287
|
ref_key: "selectRef",
|
|
285
288
|
ref: Z,
|
|
286
289
|
role: "listbox",
|
|
@@ -300,100 +303,100 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
300
303
|
"is-disabled": t.disabled
|
|
301
304
|
}
|
|
302
305
|
]]),
|
|
303
|
-
"aria-controls": "listbox-" +
|
|
306
|
+
"aria-controls": "listbox-" + a,
|
|
304
307
|
"aria-expanded": u.value,
|
|
305
308
|
"aria-label": t.placeholder,
|
|
306
309
|
"aria-disabled": t.disabled || void 0,
|
|
307
310
|
onKeydown: Be,
|
|
308
|
-
onKeyup: re(
|
|
311
|
+
onKeyup: re(B, ["esc"])
|
|
309
312
|
}, [
|
|
310
|
-
|
|
311
|
-
id: "listbox-" +
|
|
313
|
+
f("div", {
|
|
314
|
+
id: "listbox-" + a,
|
|
312
315
|
ref_key: "contentRef",
|
|
313
316
|
ref: m,
|
|
314
317
|
class: "input-field stash-select__content",
|
|
315
318
|
tabindex: "0",
|
|
316
319
|
"data-test": "stash-select|dropdown-trigger",
|
|
317
|
-
onFocusin:
|
|
318
|
-
onFocusinOnce: l[4] || (l[4] = (
|
|
320
|
+
onFocusin: ae,
|
|
321
|
+
onFocusinOnce: l[4] || (l[4] = (s) => le.value = !0),
|
|
319
322
|
onFocusout: Ee,
|
|
320
|
-
onKeydown:
|
|
323
|
+
onKeydown: ae,
|
|
321
324
|
onMouseleave: Te
|
|
322
325
|
}, [
|
|
323
|
-
|
|
326
|
+
f("ul", {
|
|
324
327
|
ref_key: "chipsRef",
|
|
325
|
-
ref:
|
|
328
|
+
ref: q,
|
|
326
329
|
class: "stash-select__chips"
|
|
327
330
|
}, [
|
|
328
|
-
n.value.length ? R("", !0) : (r(),
|
|
331
|
+
n.value.length ? R("", !0) : (r(), d("li", {
|
|
329
332
|
key: 0,
|
|
330
333
|
class: F(["stash-select__placeholder tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
|
|
331
|
-
},
|
|
332
|
-
t.single ? (r(!0),
|
|
333
|
-
key: `chip-${
|
|
334
|
+
}, g(t.placeholder), 3)),
|
|
335
|
+
t.single ? (r(!0), d(V, { key: 1 }, K(n.value, (s) => (r(), d("li", {
|
|
336
|
+
key: `chip-${s[t.trackBy]}`,
|
|
334
337
|
class: F(["stash-select__selected tw-mr-0 tw-pl-1.5", { "tw-truncate": !t.noTruncate }])
|
|
335
338
|
}, [
|
|
336
|
-
|
|
337
|
-
$(
|
|
338
|
-
|
|
339
|
+
G(e.$slots, "selected", { option: s }, () => [
|
|
340
|
+
$(g(s[t.displayBy] || s) + " ", 1),
|
|
341
|
+
f("button", {
|
|
339
342
|
tabindex: "-1",
|
|
340
343
|
class: "stash-select__remove",
|
|
341
|
-
onKeypress: re(P((
|
|
342
|
-
onMousedown: P((
|
|
344
|
+
onKeypress: re(P((_) => O(s), ["prevent"]), ["enter"]),
|
|
345
|
+
onMousedown: P((_) => O(s), ["prevent", "stop"])
|
|
343
346
|
}, [
|
|
344
|
-
|
|
347
|
+
b(z, {
|
|
345
348
|
icon: "close",
|
|
346
349
|
name: "close",
|
|
347
350
|
size: "small"
|
|
348
351
|
})
|
|
349
352
|
], 40, it)
|
|
350
353
|
], !0)
|
|
351
|
-
], 2))), 128)) : (r(!0),
|
|
352
|
-
key: `chip-${
|
|
354
|
+
], 2))), 128)) : (r(!0), d(V, { key: 2 }, K(n.value, (s) => (r(), d("li", {
|
|
355
|
+
key: `chip-${s[t.trackBy]}`,
|
|
353
356
|
class: "tw-inline-block"
|
|
354
357
|
}, [
|
|
355
|
-
|
|
358
|
+
b(ce, {
|
|
356
359
|
"bg-color": "blue-500",
|
|
357
360
|
"is-removable": "",
|
|
358
361
|
"text-color": "white",
|
|
359
362
|
class: "stash-select__chip",
|
|
360
|
-
onRemove: (
|
|
363
|
+
onRemove: (_) => O(s)
|
|
361
364
|
}, {
|
|
362
|
-
default:
|
|
363
|
-
$(
|
|
365
|
+
default: S(() => [
|
|
366
|
+
$(g(s[t.displayBy] || s), 1)
|
|
364
367
|
]),
|
|
365
368
|
_: 2
|
|
366
369
|
}, 1032, ["onRemove"])
|
|
367
370
|
]))), 128))
|
|
368
371
|
], 512),
|
|
369
|
-
me.value ? (r(),
|
|
370
|
-
|
|
372
|
+
me.value ? (r(), d("div", ct, [
|
|
373
|
+
b(ce, {
|
|
371
374
|
"bg-color": "blue-500",
|
|
372
375
|
"is-removable": "",
|
|
373
376
|
"text-color": "white",
|
|
374
377
|
class: "stash-select__chip",
|
|
375
|
-
onRemove:
|
|
378
|
+
onRemove: _e
|
|
376
379
|
}, {
|
|
377
|
-
default:
|
|
378
|
-
$(
|
|
380
|
+
default: S(() => [
|
|
381
|
+
$(g(ye.value), 1)
|
|
379
382
|
]),
|
|
380
383
|
_: 1
|
|
381
384
|
})
|
|
382
385
|
])) : R("", !0),
|
|
383
|
-
t.icon ? (r(),
|
|
386
|
+
t.icon ? (r(), J(z, {
|
|
384
387
|
key: 1,
|
|
385
388
|
class: F(["stash-select__icon", { "tw-text-ice-500": t.disabled }]),
|
|
386
389
|
"data-test": "stash-select|toggle-icon",
|
|
387
390
|
name: t.icon,
|
|
388
|
-
onMousedown: l[0] || (l[0] = P((
|
|
391
|
+
onMousedown: l[0] || (l[0] = P((s) => u.value && B(), ["prevent"]))
|
|
389
392
|
}, null, 8, ["name", "class"])) : R("", !0),
|
|
390
|
-
(r(),
|
|
393
|
+
(r(), J(ze, {
|
|
391
394
|
to: t.teleportTo,
|
|
392
395
|
disabled: !t.enableTeleport
|
|
393
396
|
}, [
|
|
394
|
-
|
|
395
|
-
default:
|
|
396
|
-
M(
|
|
397
|
+
b(He, { name: "fade" }, {
|
|
398
|
+
default: S(() => [
|
|
399
|
+
M(f("div", {
|
|
397
400
|
ref_key: "optionsWrapperRef",
|
|
398
401
|
ref: x,
|
|
399
402
|
class: "stash-select__border-selector tw-w-full tw-shadow-2xl",
|
|
@@ -401,11 +404,11 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
401
404
|
onClick: l[3] || (l[3] = P(() => {
|
|
402
405
|
}, ["stop"]))
|
|
403
406
|
}, [
|
|
404
|
-
|
|
405
|
-
M(
|
|
407
|
+
W.value ? (r(), d("div", ut, [
|
|
408
|
+
M(f("input", {
|
|
406
409
|
ref_key: "searchRef",
|
|
407
410
|
ref: ee,
|
|
408
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
411
|
+
"onUpdate:modelValue": l[1] || (l[1] = (s) => w.value = s),
|
|
409
412
|
type: "text",
|
|
410
413
|
autocomplete: "off",
|
|
411
414
|
class: "stash-select__search",
|
|
@@ -413,47 +416,48 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
413
416
|
placeholder: t.searchPlaceholder,
|
|
414
417
|
spellcheck: !1,
|
|
415
418
|
onInput: l[2] || (l[2] = //@ts-ignore
|
|
416
|
-
(...
|
|
419
|
+
(...s) => y(ne) && y(ne)(...s))
|
|
417
420
|
}, null, 40, dt), [
|
|
418
421
|
[Ae, w.value]
|
|
419
422
|
]),
|
|
420
|
-
|
|
423
|
+
b(z, {
|
|
421
424
|
name: "search",
|
|
422
425
|
class: "tw-text-ice-500"
|
|
423
426
|
})
|
|
424
427
|
])) : R("", !0),
|
|
425
|
-
|
|
426
|
-
(r(!0),
|
|
427
|
-
key: `option-${
|
|
428
|
-
"data-test":
|
|
429
|
-
class: F(Se(
|
|
430
|
-
onClick: (Ce) => D(
|
|
431
|
-
onMouseenter: P((Ce) => L(
|
|
428
|
+
f("ul", ft, [
|
|
429
|
+
(r(!0), d(V, null, K(C.value, (s, _) => (r(), d("li", {
|
|
430
|
+
key: `option-${s[t.trackBy]}`,
|
|
431
|
+
"data-test": s[t.trackBy],
|
|
432
|
+
class: F(Se(s, _)),
|
|
433
|
+
onClick: (Ce) => D(s),
|
|
434
|
+
onMouseenter: P((Ce) => L(_), ["self"])
|
|
432
435
|
}, [
|
|
433
|
-
|
|
434
|
-
$(
|
|
436
|
+
G(e.$slots, "option", { option: s }, () => [
|
|
437
|
+
$(g(s[t.displayBy] || s), 1)
|
|
435
438
|
], !0),
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
439
|
+
k(s) && !t.hideCheck ? (r(), d("span", ht, [
|
|
440
|
+
b(z, {
|
|
441
|
+
class: "tw-text-blue-500",
|
|
442
|
+
name: "check"
|
|
443
|
+
})
|
|
444
|
+
])) : R("", !0)
|
|
441
445
|
], 42, pt))), 128)),
|
|
442
|
-
M(
|
|
443
|
-
|
|
446
|
+
M(f("li", vt, [
|
|
447
|
+
b(z, {
|
|
444
448
|
"data-test": "stash-select|options-loading",
|
|
445
449
|
name: "working",
|
|
446
450
|
class: "tw-animate-spin tw-text-ice-500"
|
|
447
451
|
})
|
|
448
452
|
], 512), [
|
|
449
|
-
[Q, t.loading ||
|
|
453
|
+
[Q, t.loading || se.value]
|
|
450
454
|
]),
|
|
451
|
-
M(
|
|
452
|
-
|
|
455
|
+
M(f("li", mt, [
|
|
456
|
+
G(e.$slots, "no-options", {}, () => [
|
|
453
457
|
l[6] || (l[6] = $(" No options "))
|
|
454
458
|
], !0)
|
|
455
459
|
], 512), [
|
|
456
|
-
[Q, !t.loading && !
|
|
460
|
+
[Q, !t.loading && !se.value && !C.value.length]
|
|
457
461
|
])
|
|
458
462
|
])
|
|
459
463
|
], 4), [
|
|
@@ -472,15 +476,15 @@ const lt = { class: "tw-flex tw-h-input tw-items-center tw-text-sm" }, at = ["id
|
|
|
472
476
|
},
|
|
473
477
|
y(fe).hint ? {
|
|
474
478
|
name: "hint",
|
|
475
|
-
fn:
|
|
476
|
-
|
|
479
|
+
fn: S(() => [
|
|
480
|
+
G(e.$slots, "hint", {}, void 0, !0)
|
|
477
481
|
]),
|
|
478
482
|
key: "2"
|
|
479
483
|
} : void 0
|
|
480
484
|
]), 1040, ["class", "error-text", "hint-text"]));
|
|
481
485
|
}
|
|
482
|
-
}),
|
|
486
|
+
}), zt = /* @__PURE__ */ tt(yt, [["__scopeId", "data-v-c5883dfe"]]);
|
|
483
487
|
export {
|
|
484
|
-
|
|
488
|
+
zt as default
|
|
485
489
|
};
|
|
486
490
|
//# sourceMappingURL=Select.js.map
|