@leaflink/stash 50.0.5 → 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 +55 -50
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +31 -6
- 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 +11 -0
- package/dist/Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js +88 -0
- 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 +162 -96
- package/dist/Input.js +97 -91
- package/dist/Input.js.map +1 -1
- package/dist/Input.vue.d.ts +31 -21
- package/dist/InputOptions.js +83 -62
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +49 -16
- package/dist/ListView.vue.d.ts +231 -134
- 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 +350 -336
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +54 -47
- 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 +65 -59
- package/dist/Textarea.js.map +1 -1
- package/dist/Textarea.vue.d.ts +50 -32
- package/dist/components.css +2 -2
- 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/Field.vue_vue_type_script_setup_true_lang-DjxUvSRF.js.map +0 -1
package/dist/Select.js
CHANGED
|
@@ -1,42 +1,39 @@
|
|
|
1
|
-
import { defineComponent 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 Je } from "./Field.vue_vue_type_script_setup_true_lang-DjxUvSRF.js";
|
|
15
14
|
import z from "./Icon.js";
|
|
16
|
-
import { _ as
|
|
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
|
-
},
|
|
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,419 +45,436 @@ const Ze = ["id", "aria-errormessage", "aria-invalid", "disabled", "multiple", "
|
|
|
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
48
|
single: { type: Boolean, default: !1 },
|
|
53
49
|
noTruncate: { type: Boolean, default: !1 },
|
|
54
50
|
loading: { type: Boolean, default: !1 },
|
|
55
51
|
searchLoading: { type: Boolean, default: !1 },
|
|
56
52
|
selectItemType: { default: "" },
|
|
57
|
-
id: { default: "" },
|
|
58
53
|
hideCheck: { type: Boolean, default: !1 },
|
|
59
|
-
showOptionalInLabel: { type: Boolean, default: !1 },
|
|
60
54
|
searchPlaceholder: { default: "Search" },
|
|
61
55
|
onSearch: { type: Function, default: void 0 },
|
|
62
|
-
addBottomSpace: { type: Boolean, default: !1 },
|
|
63
56
|
useFuzzySearch: { type: Boolean, default: !1 },
|
|
64
57
|
menuPlacement: { default: "bottom-start" },
|
|
65
58
|
enableTeleport: { type: Boolean, default: !1 },
|
|
66
|
-
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 }
|
|
67
72
|
},
|
|
68
73
|
emits: ["update:model-value", "clear", "add", "remove", "opened", "closed"],
|
|
69
74
|
setup(ce, { emit: ue }) {
|
|
70
|
-
const
|
|
71
|
-
whileElementsMounted:
|
|
72
|
-
placement:
|
|
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,
|
|
73
78
|
middleware: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
apply({ availableHeight:
|
|
78
|
-
|
|
79
|
+
Le(),
|
|
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, {
|
|
79
84
|
maxWidth: `${s.reference.width}px`,
|
|
80
|
-
maxHeight: `${Math.min(
|
|
85
|
+
maxHeight: `${Math.min(e, 300)}px`
|
|
81
86
|
});
|
|
82
87
|
}
|
|
83
88
|
})
|
|
84
89
|
]
|
|
85
|
-
}), X =
|
|
86
|
-
let
|
|
87
|
-
return
|
|
88
|
-
}),
|
|
89
|
-
() => !u.value && !
|
|
90
|
-
),
|
|
91
|
-
U(
|
|
92
|
-
() =>
|
|
93
|
-
(
|
|
94
|
-
if (Array.isArray(
|
|
95
|
-
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);
|
|
96
101
|
re(l, n.value) || (n.value = l);
|
|
97
102
|
return;
|
|
98
103
|
}
|
|
99
|
-
if (!
|
|
100
|
-
re(
|
|
104
|
+
if (!je(e)) {
|
|
105
|
+
re(e, n.value[0]) || (n.value[0] = e);
|
|
101
106
|
return;
|
|
102
107
|
}
|
|
103
108
|
n.value = [];
|
|
104
109
|
},
|
|
105
110
|
{ immediate: !0 }
|
|
106
111
|
), U(
|
|
107
|
-
() =>
|
|
112
|
+
() => t.options,
|
|
108
113
|
() => {
|
|
109
|
-
const { searchFor:
|
|
110
|
-
items:
|
|
111
|
-
fieldNames:
|
|
112
|
-
trackBy:
|
|
114
|
+
const { searchFor: e } = Xe({
|
|
115
|
+
items: h(() => A.value),
|
|
116
|
+
fieldNames: t.searchBy.length ? t.searchBy : [t.displayBy],
|
|
117
|
+
trackBy: t.trackBy
|
|
113
118
|
});
|
|
114
|
-
ee.value = (l) =>
|
|
119
|
+
ee.value = (l) => e(l, { fuzzy: t.useFuzzySearch });
|
|
115
120
|
},
|
|
116
121
|
{ immediate: !0 }
|
|
117
122
|
);
|
|
118
|
-
const
|
|
119
|
-
n.value = [], p("update:model-value",
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
if (
|
|
124
|
-
const s = A.value.find((
|
|
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) {
|
|
129
|
+
const s = A.value.find((o) => {
|
|
125
130
|
var i;
|
|
126
|
-
return ((i =
|
|
131
|
+
return ((i = o[t.trackBy]) == null ? void 0 : i.toString()) === e.target.value;
|
|
127
132
|
});
|
|
128
|
-
|
|
133
|
+
D(s);
|
|
129
134
|
return;
|
|
130
135
|
}
|
|
131
|
-
const l = [...
|
|
136
|
+
const l = [...e.target.selectedOptions];
|
|
132
137
|
for (const s of [...n.value])
|
|
133
138
|
l.find((i) => {
|
|
134
139
|
var a;
|
|
135
|
-
return i.value === ((a = s[
|
|
136
|
-
}) ||
|
|
140
|
+
return i.value === ((a = s[t.trackBy]) == null ? void 0 : a.toString());
|
|
141
|
+
}) || O(s);
|
|
137
142
|
for (const s of l) {
|
|
138
|
-
const
|
|
143
|
+
const o = A.value.find(
|
|
139
144
|
(i) => {
|
|
140
145
|
var a;
|
|
141
|
-
return ((a = i[
|
|
146
|
+
return ((a = i[t.trackBy]) == null ? void 0 : a.toString()) === s.value;
|
|
142
147
|
}
|
|
143
148
|
);
|
|
144
|
-
|
|
149
|
+
B(o) || D(o);
|
|
145
150
|
}
|
|
146
|
-
},
|
|
147
|
-
if (
|
|
151
|
+
}, O = (e) => {
|
|
152
|
+
if (t.disabled || ye.value && n.value.length === 1)
|
|
148
153
|
return;
|
|
149
|
-
const l = n.value.findIndex((s) => s[
|
|
154
|
+
const l = n.value.findIndex((s) => s[t.trackBy] === e[t.trackBy]);
|
|
150
155
|
if (l === -1) {
|
|
151
|
-
|
|
156
|
+
Ke.warn("ll-select: could not find option to remove", e);
|
|
152
157
|
return;
|
|
153
158
|
}
|
|
154
|
-
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);
|
|
155
160
|
}, ae = () => {
|
|
156
|
-
u.value || (
|
|
157
|
-
var
|
|
158
|
-
(
|
|
161
|
+
u.value || (I(), u.value = !0, p("opened"), X.value && Y(() => {
|
|
162
|
+
var e;
|
|
163
|
+
(e = Z.value) == null || e.focus({ preventScroll: !0 });
|
|
159
164
|
}));
|
|
160
|
-
},
|
|
161
|
-
var
|
|
162
|
-
u.value && p("closed", n.value),
|
|
163
|
-
},
|
|
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) => {
|
|
164
169
|
if (await Y(), !m.value)
|
|
165
170
|
return;
|
|
166
|
-
if (![E.ENTER, E.ESCAPE].includes(
|
|
167
|
-
const s = m.value.querySelector(".stash-select__option--highlighted"),
|
|
168
|
-
if (!
|
|
171
|
+
if (![E.ENTER, E.ESCAPE].includes(e.keyCode)) {
|
|
172
|
+
const s = m.value.querySelector(".stash-select__option--highlighted"), o = s == null ? void 0 : s.getBoundingClientRect(), i = m.value.getBoundingClientRect();
|
|
173
|
+
if (!o || !i)
|
|
169
174
|
return;
|
|
170
|
-
(
|
|
175
|
+
(o.bottom >= i.bottom || o.top <= i.top + o.height) && (s == null || s.scrollIntoView({ block: "nearest", inline: "nearest" }));
|
|
171
176
|
}
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
},
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
else if (
|
|
178
|
-
u.value &&
|
|
179
|
-
else if (
|
|
180
|
-
u.value &&
|
|
181
|
-
else if (
|
|
182
|
-
u.value &&
|
|
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]);
|
|
183
188
|
else
|
|
184
189
|
return;
|
|
185
|
-
|
|
186
|
-
}, se =
|
|
187
|
-
|
|
188
|
-
},
|
|
189
|
-
if (!
|
|
190
|
+
e.preventDefault(), ge(e);
|
|
191
|
+
}, se = Ge(function() {
|
|
192
|
+
Be();
|
|
193
|
+
}, Ye.FAST), Be = async function() {
|
|
194
|
+
if (!t.onSearch)
|
|
190
195
|
return;
|
|
191
|
-
const
|
|
196
|
+
const e = We("search-request-");
|
|
192
197
|
try {
|
|
193
|
-
W.value[
|
|
198
|
+
W.value[e] = !0, await t.onSearch(w.value);
|
|
194
199
|
} finally {
|
|
195
|
-
delete W.value[
|
|
200
|
+
delete W.value[e];
|
|
196
201
|
}
|
|
197
|
-
}, ke = (
|
|
202
|
+
}, ke = (e, l) => [
|
|
198
203
|
{
|
|
199
204
|
"stash-select__option": !0,
|
|
200
|
-
"stash-select__option--disabled":
|
|
201
|
-
"stash-select__option--highlighted":
|
|
202
|
-
"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)
|
|
203
208
|
},
|
|
204
209
|
// @deprecated
|
|
205
210
|
{
|
|
206
|
-
"tw-bg-ice-200":
|
|
207
|
-
"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)
|
|
208
213
|
}
|
|
209
|
-
],
|
|
210
|
-
function ne(
|
|
211
|
-
var
|
|
212
|
-
if (!
|
|
214
|
+
], B = (e) => e == null ? !1 : n.value.some((l) => (l == null ? void 0 : l[t.trackBy]) === e[t.trackBy]);
|
|
215
|
+
function ne(e) {
|
|
216
|
+
var o, i;
|
|
217
|
+
if (!e)
|
|
213
218
|
return !1;
|
|
214
|
-
const l = (
|
|
219
|
+
const l = (o = m.value) == null ? void 0 : o.contains(e), s = (i = x.value) == null ? void 0 : i.contains(e);
|
|
215
220
|
return l || s;
|
|
216
221
|
}
|
|
217
|
-
function
|
|
218
|
-
const l =
|
|
219
|
-
!ne(l) && l &&
|
|
222
|
+
function Se(e) {
|
|
223
|
+
const l = e.relatedTarget;
|
|
224
|
+
!ne(l) && l && b();
|
|
220
225
|
}
|
|
221
|
-
function
|
|
222
|
-
const l =
|
|
223
|
-
ne(l) ||
|
|
226
|
+
function Ee(e) {
|
|
227
|
+
const l = e.target;
|
|
228
|
+
ne(l) || b();
|
|
224
229
|
}
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
},
|
|
228
|
-
await Y(), q.value && m.value && (
|
|
230
|
+
const xe = () => {
|
|
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);
|
|
229
234
|
};
|
|
230
|
-
return
|
|
235
|
+
return Me(() => {
|
|
231
236
|
if (H.onInput)
|
|
232
237
|
throw new Error("ll-select: use the @update:model-value event instead of @input.");
|
|
233
|
-
window.addEventListener("resize",
|
|
234
|
-
}),
|
|
235
|
-
window.removeEventListener("resize",
|
|
236
|
-
}), (
|
|
237
|
-
|
|
238
|
-
class: k(["input ll-select stash-select", y(H).class]),
|
|
238
|
+
window.addEventListener("resize", I), I();
|
|
239
|
+
}), Fe(() => {
|
|
240
|
+
window.removeEventListener("resize", I);
|
|
241
|
+
}), (e, l) => (r(), V(Ze, Re(t, {
|
|
242
|
+
class: ["input ll-select stash-select", y(H).class],
|
|
239
243
|
"data-test": "stash-select",
|
|
240
|
-
"
|
|
241
|
-
"
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
ref: Q,
|
|
268
|
-
role: "listbox",
|
|
269
|
-
"aria-hidden": "true",
|
|
270
|
-
class: k(["stash-select__content-wrapper", [
|
|
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
|
|
244
|
+
"error-text": t.errorText || t.error,
|
|
245
|
+
"hint-text": t.hintText || t.hint
|
|
246
|
+
}), $e({ _: 2 }, [
|
|
247
|
+
t.isReadOnly ? {
|
|
248
|
+
name: "default",
|
|
249
|
+
fn: k(({ fieldId: s, labelId: o }) => [
|
|
250
|
+
d("div", tt, [
|
|
251
|
+
d("span", {
|
|
252
|
+
id: s,
|
|
253
|
+
"aria-labelledby": o,
|
|
254
|
+
class: "show-empty tw-h-min"
|
|
255
|
+
}, g(ve.value), 9, lt)
|
|
256
|
+
])
|
|
257
|
+
]),
|
|
258
|
+
key: "0"
|
|
259
|
+
} : {
|
|
260
|
+
name: "default",
|
|
261
|
+
fn: k(({ fieldId: s, fieldErrorId: o, hasError: i }) => [
|
|
262
|
+
d("select", {
|
|
263
|
+
id: s,
|
|
264
|
+
"aria-errormessage": o,
|
|
265
|
+
"aria-invalid": i,
|
|
266
|
+
class: "tw-sr-only",
|
|
267
|
+
disabled: t.disabled,
|
|
268
|
+
multiple: !t.single,
|
|
269
|
+
name: t.name,
|
|
270
|
+
onChange: _e
|
|
302
271
|
}, [
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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)),
|
|
277
|
+
l[5] || (l[5] = d("option", { value: "" }, null, -1))
|
|
278
|
+
], 40, at),
|
|
279
|
+
M((r(), f("div", {
|
|
280
|
+
ref_key: "selectRef",
|
|
281
|
+
ref: Q,
|
|
282
|
+
role: "listbox",
|
|
283
|
+
"aria-hidden": "true",
|
|
284
|
+
class: F(["stash-select__content-wrapper", [
|
|
285
|
+
{
|
|
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
|
|
290
|
+
},
|
|
291
|
+
// @deprecated
|
|
292
|
+
{
|
|
293
|
+
"is-active": u.value,
|
|
294
|
+
"is-single": t.single,
|
|
295
|
+
"is-disabled": t.disabled
|
|
296
|
+
}
|
|
297
|
+
]]),
|
|
298
|
+
"aria-controls": "listbox-" + s,
|
|
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"])
|
|
304
|
+
}, [
|
|
305
|
+
d("div", {
|
|
306
|
+
id: "listbox-" + s,
|
|
307
|
+
ref_key: "contentRef",
|
|
308
|
+
ref: m,
|
|
309
|
+
class: "input-field stash-select__content",
|
|
310
|
+
tabindex: "0",
|
|
311
|
+
onFocusin: ae,
|
|
312
|
+
onFocusinOnce: l[4] || (l[4] = (a) => te.value = !0),
|
|
313
|
+
onFocusout: Se,
|
|
314
|
+
onKeydown: ae,
|
|
315
|
+
onMouseleave: xe
|
|
307
316
|
}, [
|
|
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"
|
|
317
|
+
d("ul", {
|
|
318
|
+
ref_key: "chipsRef",
|
|
319
|
+
ref: q,
|
|
320
|
+
class: "stash-select__chips"
|
|
334
321
|
}, [
|
|
322
|
+
n.value.length ? R("", !0) : (r(), f("li", {
|
|
323
|
+
key: 0,
|
|
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 }])
|
|
329
|
+
}, [
|
|
330
|
+
j(e.$slots, "selected", { option: a }, () => [
|
|
331
|
+
$(g(a[t.displayBy] || a) + " ", 1),
|
|
332
|
+
d("button", {
|
|
333
|
+
tabindex: "-1",
|
|
334
|
+
class: "stash-select__remove",
|
|
335
|
+
onKeypress: oe(P((_) => O(a), ["prevent"]), ["enter"]),
|
|
336
|
+
onMousedown: P((_) => O(a), ["prevent", "stop"])
|
|
337
|
+
}, [
|
|
338
|
+
S(z, {
|
|
339
|
+
icon: "close",
|
|
340
|
+
name: "close",
|
|
341
|
+
size: "small"
|
|
342
|
+
})
|
|
343
|
+
], 40, rt)
|
|
344
|
+
], !0)
|
|
345
|
+
], 2))), 128)) : (r(!0), f(K, { key: 2 }, G(n.value, (a) => (r(), f("li", {
|
|
346
|
+
key: `chip-${a[t.trackBy]}`,
|
|
347
|
+
class: "tw-inline-block"
|
|
348
|
+
}, [
|
|
349
|
+
S(ie, {
|
|
350
|
+
"bg-color": "blue-500",
|
|
351
|
+
"is-removable": "",
|
|
352
|
+
"text-color": "white",
|
|
353
|
+
class: "stash-select__chip",
|
|
354
|
+
onRemove: (_) => O(a)
|
|
355
|
+
}, {
|
|
356
|
+
default: k(() => [
|
|
357
|
+
$(g(a[t.displayBy] || a), 1)
|
|
358
|
+
]),
|
|
359
|
+
_: 2
|
|
360
|
+
}, 1032, ["onRemove"])
|
|
361
|
+
]))), 128))
|
|
362
|
+
], 512),
|
|
363
|
+
pe.value ? (r(), f("div", it, [
|
|
335
364
|
S(ie, {
|
|
336
365
|
"bg-color": "blue-500",
|
|
337
366
|
"is-removable": "",
|
|
338
367
|
"text-color": "white",
|
|
339
368
|
class: "stash-select__chip",
|
|
340
|
-
onRemove:
|
|
369
|
+
onRemove: we
|
|
341
370
|
}, {
|
|
342
|
-
default:
|
|
343
|
-
$(
|
|
371
|
+
default: k(() => [
|
|
372
|
+
$(g(me.value), 1)
|
|
344
373
|
]),
|
|
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
|
-
F(h("input", {
|
|
386
|
-
ref_key: "searchRef",
|
|
387
|
-
ref: Z,
|
|
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, [
|
|
374
|
+
_: 1
|
|
375
|
+
})
|
|
376
|
+
])) : R("", !0),
|
|
377
|
+
t.icon ? (r(), V(z, {
|
|
378
|
+
key: 1,
|
|
379
|
+
class: F(["stash-select__icon", { "tw-text-ice-500": t.disabled }]),
|
|
380
|
+
"data-test": "stash-select|toggle-icon",
|
|
381
|
+
name: t.icon,
|
|
382
|
+
onMousedown: l[0] || (l[0] = P((a) => u.value && b(), ["prevent"]))
|
|
383
|
+
}, null, 8, ["name", "class"])) : R("", !0),
|
|
384
|
+
(r(), V(Pe, {
|
|
385
|
+
to: t.teleportTo,
|
|
386
|
+
disabled: !t.enableTeleport
|
|
387
|
+
}, [
|
|
388
|
+
S(ze, { name: "fade" }, {
|
|
389
|
+
default: k(() => [
|
|
390
|
+
M(d("div", {
|
|
391
|
+
ref_key: "optionsWrapperRef",
|
|
392
|
+
ref: x,
|
|
393
|
+
class: "stash-select__border-selector tw-w-full tw-shadow-2xl",
|
|
394
|
+
style: He(y(fe)),
|
|
395
|
+
onClick: l[3] || (l[3] = P(() => {
|
|
396
|
+
}, ["stop"]))
|
|
397
|
+
}, [
|
|
398
|
+
X.value ? (r(), f("div", ct, [
|
|
399
|
+
M(d("input", {
|
|
400
|
+
ref_key: "searchRef",
|
|
401
|
+
ref: Z,
|
|
402
|
+
"onUpdate:modelValue": l[1] || (l[1] = (a) => w.value = a),
|
|
403
|
+
type: "text",
|
|
404
|
+
autocomplete: "off",
|
|
405
|
+
class: "stash-select__search",
|
|
406
|
+
"data-test": y(H)["data-test"] ? y(H)["data-test"] + "-search" : "stash-select|search",
|
|
407
|
+
placeholder: t.searchPlaceholder,
|
|
408
|
+
spellcheck: !1,
|
|
409
|
+
onInput: l[2] || (l[2] = //@ts-ignore
|
|
410
|
+
(...a) => y(se) && y(se)(...a))
|
|
411
|
+
}, null, 40, ut), [
|
|
412
|
+
[Ne, w.value]
|
|
413
|
+
]),
|
|
423
414
|
S(z, {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
class: "tw-animate-spin tw-text-ice-500"
|
|
415
|
+
name: "search",
|
|
416
|
+
class: "tw-text-ice-500"
|
|
427
417
|
})
|
|
428
|
-
],
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
418
|
+
])) : R("", !0),
|
|
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"])
|
|
426
|
+
}, [
|
|
427
|
+
j(e.$slots, "option", { option: a }, () => [
|
|
428
|
+
$(g(a[t.displayBy] || a), 1)
|
|
429
|
+
], !0),
|
|
430
|
+
B(a) && !t.hideCheck ? (r(), V(z, {
|
|
431
|
+
key: 0,
|
|
432
|
+
class: "tw-ml-auto tw-text-blue-500",
|
|
433
|
+
name: "check"
|
|
434
|
+
})) : R("", !0)
|
|
435
|
+
], 42, ft))), 128)),
|
|
436
|
+
M(d("li", vt, [
|
|
437
|
+
S(z, {
|
|
438
|
+
"data-test": "stash-select|options-loading",
|
|
439
|
+
name: "working",
|
|
440
|
+
class: "tw-animate-spin tw-text-ice-500"
|
|
441
|
+
})
|
|
442
|
+
], 512), [
|
|
443
|
+
[J, t.loading || le.value]
|
|
444
|
+
]),
|
|
445
|
+
M(d("li", ht, [
|
|
446
|
+
j(e.$slots, "no-options", {}, () => [
|
|
447
|
+
l[6] || (l[6] = $(" No options "))
|
|
448
|
+
], !0)
|
|
449
|
+
], 512), [
|
|
450
|
+
[J, !t.loading && !le.value && !C.value.length]
|
|
451
|
+
])
|
|
437
452
|
])
|
|
453
|
+
], 4), [
|
|
454
|
+
[J, u.value && !t.disabled]
|
|
438
455
|
])
|
|
439
|
-
]
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
]
|
|
447
|
-
]
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
]),
|
|
451
|
-
_: 2
|
|
452
|
-
}, [
|
|
456
|
+
]),
|
|
457
|
+
_: 3
|
|
458
|
+
})
|
|
459
|
+
], 8, ["to", "disabled"]))
|
|
460
|
+
], 40, ot)
|
|
461
|
+
], 42, nt)), [
|
|
462
|
+
[y(Je), Ee]
|
|
463
|
+
])
|
|
464
|
+
]),
|
|
465
|
+
key: "1"
|
|
466
|
+
},
|
|
453
467
|
y(de).hint ? {
|
|
454
468
|
name: "hint",
|
|
455
|
-
fn:
|
|
456
|
-
j(
|
|
469
|
+
fn: k(() => [
|
|
470
|
+
j(e.$slots, "hint", {}, void 0, !0)
|
|
457
471
|
]),
|
|
458
|
-
key: "
|
|
472
|
+
key: "2"
|
|
459
473
|
} : void 0
|
|
460
|
-
]),
|
|
474
|
+
]), 1040, ["class", "error-text", "hint-text"]));
|
|
461
475
|
}
|
|
462
|
-
}),
|
|
476
|
+
}), $t = /* @__PURE__ */ et(pt, [["__scopeId", "data-v-c1887a6c"]]);
|
|
463
477
|
export {
|
|
464
|
-
|
|
478
|
+
$t as default
|
|
465
479
|
};
|
|
466
480
|
//# sourceMappingURL=Select.js.map
|