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