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