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