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