@validol4ik/uikit 0.7.1 → 0.7.4
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/{AppButtonCopy-DnqF8jZQ.cjs → AppButtonCopy-BxIKLbwj.cjs} +1 -1
- package/dist/{AppButtonCopy-Dj46pNGB.js → AppButtonCopy-CQItDNqg.js} +1 -1
- package/dist/AppSelect-BSBsAKPs.js +2302 -0
- package/dist/AppSelect-DPSeFPtt.cjs +1 -0
- package/dist/{DropdownButton-BE2k1gTw.js → DropdownButton-B-NTZXjl.js} +85 -112
- package/dist/DropdownButton-Dqg8kqPg.cjs +1 -0
- package/dist/QMenu-BeQ-7x7q.cjs +1 -0
- package/dist/{QMenu-CrcmhT0u.js → QMenu-CqwHVhVH.js} +234 -247
- package/dist/index-A0f7F3DW.cjs +1 -0
- package/dist/index-B8rGKrFf.js +1670 -0
- package/dist/style.css +1 -1
- package/dist/types/components/buttons/DropdownButton/types.d.ts +1 -1
- package/dist/types/components/form/AppSelect/types.d.ts +1 -0
- package/dist/types/components/menu/PopupItem/PopupItem.vue.d.ts +22 -0
- package/dist/types/components/menu/PopupItem/types.d.ts +23 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/uikit.cjs +1 -1
- package/dist/uikit.es.js +5 -4
- package/package.json +1 -1
- package/dist/AppSelect-B3eGqxF7.cjs +0 -1
- package/dist/AppSelect-ztwsDF-p.js +0 -2528
- package/dist/DropdownButton-DpTSg2fU.cjs +0 -1
- package/dist/QMenu-DNRkchme.cjs +0 -1
- package/dist/index-BV2qSN9C.js +0 -1317
- package/dist/index-DXwv6jwP.cjs +0 -1
|
@@ -1,2528 +0,0 @@
|
|
|
1
|
-
import { ref as M, computed as r, h as s, getCurrentInstance as se, toRaw as Oe, onBeforeUpdate as ol, inject as Ol, watch as G, onMounted as nl, onBeforeUnmount as Ae, nextTick as ve, onDeactivated as ul, onActivated as il, Transition as Ct, onBeforeMount as Ml, onUpdated as Ll, defineComponent as $l, createElementBlock as fe, openBlock as ae, normalizeClass as et, createCommentVNode as Me, createVNode as je, toDisplayString as Ke, unref as Hl, withCtx as ge, mergeProps as Pl, createBlock as $t, createElementVNode as mt, createTextVNode as gt, Fragment as tt, withModifiers as Dl } from "vue";
|
|
2
|
-
import { u as al, a as rt, b as st, d as rl, e as sl, h as be, s as ne, c as ye, Q as _e, f as jl, g as Kl, i as cl, j as Nl, p as he, k as Ql, l as Ul, m as Wl, R as Xl, n as qe, o as Yl, q as Zl, r as Jl, t as Gl, v as Le, S as eo, _ as to } from "./index-BV2qSN9C.js";
|
|
3
|
-
import { a as dl, u as lo, r as oo, g as no, b as uo, h as io, c as ao, d as ro, e as so, f as co, i as fo, j as vo, k as mo, l as go, m as Ht, n as ho, Q as po } from "./QMenu-CrcmhT0u.js";
|
|
4
|
-
import { b as bo, c as xe, r as Pt, a as yo } from "./focusout-DjvPXP_b.js";
|
|
5
|
-
function So(e, l) {
|
|
6
|
-
const t = M(null), n = r(() => e.disable === !0 ? null : s("span", {
|
|
7
|
-
ref: t,
|
|
8
|
-
class: "no-outline",
|
|
9
|
-
tabindex: -1
|
|
10
|
-
}));
|
|
11
|
-
function c(u) {
|
|
12
|
-
const a = l.value;
|
|
13
|
-
(u == null ? void 0 : u.qAvoidFocus) !== !0 && ((u == null ? void 0 : u.type.indexOf("key")) === 0 ? document.activeElement !== a && (a == null ? void 0 : a.contains(document.activeElement)) === !0 && a.focus() : t.value !== null && (u === void 0 || (a == null ? void 0 : a.contains(u.target)) === !0) && t.value.focus());
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
refocusTargetEl: n,
|
|
17
|
-
refocusTarget: c
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
const fl = {
|
|
21
|
-
name: String
|
|
22
|
-
};
|
|
23
|
-
function wo(e = {}) {
|
|
24
|
-
return (l, t, n) => {
|
|
25
|
-
l[t](
|
|
26
|
-
s("input", {
|
|
27
|
-
class: "hidden" + (n || ""),
|
|
28
|
-
...e.value
|
|
29
|
-
})
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function Co(e) {
|
|
34
|
-
return r(() => e.name || e.for);
|
|
35
|
-
}
|
|
36
|
-
const ko = {
|
|
37
|
-
xs: 30,
|
|
38
|
-
sm: 35,
|
|
39
|
-
md: 40,
|
|
40
|
-
lg: 50,
|
|
41
|
-
xl: 60
|
|
42
|
-
}, qo = {
|
|
43
|
-
...rt,
|
|
44
|
-
...al,
|
|
45
|
-
...fl,
|
|
46
|
-
modelValue: {
|
|
47
|
-
required: !0,
|
|
48
|
-
default: null
|
|
49
|
-
},
|
|
50
|
-
val: {},
|
|
51
|
-
trueValue: { default: !0 },
|
|
52
|
-
falseValue: { default: !1 },
|
|
53
|
-
indeterminateValue: { default: null },
|
|
54
|
-
checkedIcon: String,
|
|
55
|
-
uncheckedIcon: String,
|
|
56
|
-
indeterminateIcon: String,
|
|
57
|
-
toggleOrder: {
|
|
58
|
-
type: String,
|
|
59
|
-
validator: (e) => e === "tf" || e === "ft"
|
|
60
|
-
},
|
|
61
|
-
toggleIndeterminate: Boolean,
|
|
62
|
-
label: String,
|
|
63
|
-
leftLabel: Boolean,
|
|
64
|
-
color: String,
|
|
65
|
-
keepColor: Boolean,
|
|
66
|
-
dense: Boolean,
|
|
67
|
-
disable: Boolean,
|
|
68
|
-
tabindex: [String, Number]
|
|
69
|
-
}, Vo = ["update:modelValue"];
|
|
70
|
-
function xo(e, l) {
|
|
71
|
-
const { props: t, slots: n, emit: c, proxy: u } = se(), { $q: a } = u, b = st(t, a), y = M(null), { refocusTargetEl: _, refocusTarget: f } = So(t, y), w = rl(t, ko), k = r(
|
|
72
|
-
() => t.val !== void 0 && Array.isArray(t.modelValue)
|
|
73
|
-
), C = r(() => {
|
|
74
|
-
const q = Oe(t.val);
|
|
75
|
-
return k.value === !0 ? t.modelValue.findIndex((X) => Oe(X) === q) : -1;
|
|
76
|
-
}), V = r(() => k.value === !0 ? C.value !== -1 : Oe(t.modelValue) === Oe(t.trueValue)), h = r(() => k.value === !0 ? C.value === -1 : Oe(t.modelValue) === Oe(t.falseValue)), v = r(
|
|
77
|
-
() => V.value === !1 && h.value === !1
|
|
78
|
-
), x = r(() => t.disable === !0 ? -1 : t.tabindex || 0), j = r(
|
|
79
|
-
() => `q-${e} cursor-pointer no-outline row inline no-wrap items-center` + (t.disable === !0 ? " disabled" : "") + (b.value === !0 ? ` q-${e}--dark` : "") + (t.dense === !0 ? ` q-${e}--dense` : "") + (t.leftLabel === !0 ? " reverse" : "")
|
|
80
|
-
), A = r(() => {
|
|
81
|
-
const q = V.value === !0 ? "truthy" : h.value === !0 ? "falsy" : "indet", X = t.color !== void 0 && (t.keepColor === !0 || h.value !== !0) ? ` text-${t.color}` : "";
|
|
82
|
-
return `q-${e}__inner relative-position non-selectable q-${e}__inner--${q}${X}`;
|
|
83
|
-
}), L = r(() => {
|
|
84
|
-
const q = { type: "checkbox" };
|
|
85
|
-
return t.name !== void 0 && Object.assign(q, {
|
|
86
|
-
// see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
|
|
87
|
-
".checked": V.value,
|
|
88
|
-
"^checked": V.value === !0 ? "checked" : void 0,
|
|
89
|
-
name: t.name,
|
|
90
|
-
value: k.value === !0 ? t.val : t.trueValue
|
|
91
|
-
}), q;
|
|
92
|
-
}), Y = wo(L), F = r(() => {
|
|
93
|
-
const q = {
|
|
94
|
-
tabindex: x.value,
|
|
95
|
-
role: "checkbox",
|
|
96
|
-
"aria-label": t.label,
|
|
97
|
-
"aria-checked": v.value === !0 ? "mixed" : V.value === !0 ? "true" : "false"
|
|
98
|
-
};
|
|
99
|
-
return t.disable === !0 && (q["aria-disabled"] = "true"), q;
|
|
100
|
-
});
|
|
101
|
-
function $(q) {
|
|
102
|
-
q !== void 0 && (ne(q), f(q)), t.disable !== !0 && c("update:modelValue", H(), q);
|
|
103
|
-
}
|
|
104
|
-
function H() {
|
|
105
|
-
if (k.value === !0) {
|
|
106
|
-
if (V.value === !0) {
|
|
107
|
-
const q = t.modelValue.slice();
|
|
108
|
-
return q.splice(C.value, 1), q;
|
|
109
|
-
}
|
|
110
|
-
return t.modelValue.concat([t.val]);
|
|
111
|
-
}
|
|
112
|
-
if (V.value === !0) {
|
|
113
|
-
if (t.toggleOrder !== "ft" || t.toggleIndeterminate === !1)
|
|
114
|
-
return t.falseValue;
|
|
115
|
-
} else if (h.value === !0) {
|
|
116
|
-
if (t.toggleOrder === "ft" || t.toggleIndeterminate === !1)
|
|
117
|
-
return t.trueValue;
|
|
118
|
-
} else
|
|
119
|
-
return t.toggleOrder !== "ft" ? t.trueValue : t.falseValue;
|
|
120
|
-
return t.indeterminateValue;
|
|
121
|
-
}
|
|
122
|
-
function le(q) {
|
|
123
|
-
(q.keyCode === 13 || q.keyCode === 32) && ne(q);
|
|
124
|
-
}
|
|
125
|
-
function W(q) {
|
|
126
|
-
(q.keyCode === 13 || q.keyCode === 32) && $(q);
|
|
127
|
-
}
|
|
128
|
-
const oe = l(V, v);
|
|
129
|
-
return Object.assign(u, { toggle: $ }), () => {
|
|
130
|
-
const q = oe();
|
|
131
|
-
t.disable !== !0 && Y(
|
|
132
|
-
q,
|
|
133
|
-
"unshift",
|
|
134
|
-
` q-${e}__native absolute q-ma-none q-pa-none`
|
|
135
|
-
);
|
|
136
|
-
const X = [
|
|
137
|
-
s("div", {
|
|
138
|
-
class: A.value,
|
|
139
|
-
style: w.value,
|
|
140
|
-
"aria-hidden": "true"
|
|
141
|
-
}, q)
|
|
142
|
-
];
|
|
143
|
-
_.value !== null && X.push(_.value);
|
|
144
|
-
const ue = t.label !== void 0 ? sl(n.default, [t.label]) : be(n.default);
|
|
145
|
-
return ue !== void 0 && X.push(
|
|
146
|
-
s("div", {
|
|
147
|
-
class: `q-${e}__label q-anchor--skip`
|
|
148
|
-
}, ue)
|
|
149
|
-
), s("div", {
|
|
150
|
-
ref: y,
|
|
151
|
-
class: j.value,
|
|
152
|
-
...F.value,
|
|
153
|
-
onClick: $,
|
|
154
|
-
onKeydown: le,
|
|
155
|
-
onKeyup: W
|
|
156
|
-
}, X);
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
const _o = () => s("div", {
|
|
160
|
-
key: "svg",
|
|
161
|
-
class: "q-checkbox__bg absolute"
|
|
162
|
-
}, [
|
|
163
|
-
s("svg", {
|
|
164
|
-
class: "q-checkbox__svg fit absolute-full",
|
|
165
|
-
viewBox: "0 0 24 24"
|
|
166
|
-
}, [
|
|
167
|
-
s("path", {
|
|
168
|
-
class: "q-checkbox__truthy",
|
|
169
|
-
fill: "none",
|
|
170
|
-
d: "M1.73,12.91 8.1,19.28 22.79,4.59"
|
|
171
|
-
}),
|
|
172
|
-
s("path", {
|
|
173
|
-
class: "q-checkbox__indet",
|
|
174
|
-
d: "M4,14H20V10H4"
|
|
175
|
-
})
|
|
176
|
-
])
|
|
177
|
-
]), Ao = ye({
|
|
178
|
-
name: "QCheckbox",
|
|
179
|
-
props: qo,
|
|
180
|
-
emits: Vo,
|
|
181
|
-
setup(e) {
|
|
182
|
-
const l = _o();
|
|
183
|
-
function t(n, c) {
|
|
184
|
-
const u = r(
|
|
185
|
-
() => (n.value === !0 ? e.checkedIcon : c.value === !0 ? e.indeterminateIcon : e.uncheckedIcon) || null
|
|
186
|
-
);
|
|
187
|
-
return () => u.value !== null ? [
|
|
188
|
-
s("div", {
|
|
189
|
-
key: "icon",
|
|
190
|
-
class: "q-checkbox__icon-container absolute-full flex flex-center no-wrap"
|
|
191
|
-
}, [
|
|
192
|
-
s(_e, {
|
|
193
|
-
class: "q-checkbox__icon",
|
|
194
|
-
name: u.value
|
|
195
|
-
})
|
|
196
|
-
])
|
|
197
|
-
] : [l];
|
|
198
|
-
}
|
|
199
|
-
return xo("checkbox", t);
|
|
200
|
-
}
|
|
201
|
-
}), it = ye({
|
|
202
|
-
name: "QItemSection",
|
|
203
|
-
props: {
|
|
204
|
-
avatar: Boolean,
|
|
205
|
-
thumbnail: Boolean,
|
|
206
|
-
side: Boolean,
|
|
207
|
-
top: Boolean,
|
|
208
|
-
noWrap: Boolean
|
|
209
|
-
},
|
|
210
|
-
setup(e, { slots: l }) {
|
|
211
|
-
const t = r(
|
|
212
|
-
() => `q-item__section column q-item__section--${e.avatar === !0 || e.side === !0 || e.thumbnail === !0 ? "side" : "main"}` + (e.top === !0 ? " q-item__section--top justify-start" : " justify-center") + (e.avatar === !0 ? " q-item__section--avatar" : "") + (e.thumbnail === !0 ? " q-item__section--thumbnail" : "") + (e.noWrap === !0 ? " q-item__section--nowrap" : "")
|
|
213
|
-
);
|
|
214
|
-
return () => s("div", { class: t.value }, be(l.default));
|
|
215
|
-
}
|
|
216
|
-
}), vl = ye({
|
|
217
|
-
name: "QItemLabel",
|
|
218
|
-
props: {
|
|
219
|
-
overline: Boolean,
|
|
220
|
-
caption: Boolean,
|
|
221
|
-
header: Boolean,
|
|
222
|
-
lines: [Number, String]
|
|
223
|
-
},
|
|
224
|
-
setup(e, { slots: l }) {
|
|
225
|
-
const t = r(() => parseInt(e.lines, 10)), n = r(
|
|
226
|
-
() => "q-item__label" + (e.overline === !0 ? " q-item__label--overline text-overline" : "") + (e.caption === !0 ? " q-item__label--caption text-caption" : "") + (e.header === !0 ? " q-item__label--header" : "") + (t.value === 1 ? " ellipsis" : "")
|
|
227
|
-
), c = r(() => e.lines !== void 0 && t.value > 1 ? {
|
|
228
|
-
overflow: "hidden",
|
|
229
|
-
display: "-webkit-box",
|
|
230
|
-
"-webkit-box-orient": "vertical",
|
|
231
|
-
"-webkit-line-clamp": t.value
|
|
232
|
-
} : null);
|
|
233
|
-
return () => s("div", {
|
|
234
|
-
style: c.value,
|
|
235
|
-
class: n.value
|
|
236
|
-
}, be(l.default));
|
|
237
|
-
}
|
|
238
|
-
}), ml = ye({
|
|
239
|
-
name: "QItem",
|
|
240
|
-
props: {
|
|
241
|
-
...rt,
|
|
242
|
-
...jl,
|
|
243
|
-
tag: {
|
|
244
|
-
type: String,
|
|
245
|
-
default: "div"
|
|
246
|
-
},
|
|
247
|
-
active: {
|
|
248
|
-
type: Boolean,
|
|
249
|
-
default: null
|
|
250
|
-
},
|
|
251
|
-
clickable: Boolean,
|
|
252
|
-
dense: Boolean,
|
|
253
|
-
insetLevel: Number,
|
|
254
|
-
tabindex: [String, Number],
|
|
255
|
-
focused: Boolean,
|
|
256
|
-
manualFocus: Boolean
|
|
257
|
-
},
|
|
258
|
-
emits: ["click", "keyup"],
|
|
259
|
-
setup(e, { slots: l, emit: t }) {
|
|
260
|
-
const { proxy: { $q: n } } = se(), c = st(e, n), { hasLink: u, linkAttrs: a, linkClass: b, linkTag: y, navigateOnClick: _ } = Kl(), f = M(null), w = M(null), k = r(
|
|
261
|
-
() => e.clickable === !0 || u.value === !0 || e.tag === "label"
|
|
262
|
-
), C = r(
|
|
263
|
-
() => e.disable !== !0 && k.value === !0
|
|
264
|
-
), V = r(
|
|
265
|
-
() => "q-item q-item-type row no-wrap" + (e.dense === !0 ? " q-item--dense" : "") + (c.value === !0 ? " q-item--dark" : "") + (u.value === !0 && e.active === null ? b.value : e.active === !0 ? ` q-item--active${e.activeClass !== void 0 ? ` ${e.activeClass}` : ""}` : "") + (e.disable === !0 ? " disabled" : "") + (C.value === !0 ? " q-item--clickable q-link cursor-pointer " + (e.manualFocus === !0 ? "q-manual-focusable" : "q-focusable q-hoverable") + (e.focused === !0 ? " q-manual-focusable--focused" : "") : "")
|
|
266
|
-
), h = r(() => e.insetLevel === void 0 ? null : {
|
|
267
|
-
["padding" + (n.lang.rtl === !0 ? "Right" : "Left")]: 16 + e.insetLevel * 56 + "px"
|
|
268
|
-
});
|
|
269
|
-
function v(A) {
|
|
270
|
-
C.value === !0 && (w.value !== null && A.qAvoidFocus !== !0 && (A.qKeyEvent !== !0 && document.activeElement === f.value ? w.value.focus() : document.activeElement === w.value && f.value.focus()), _(A));
|
|
271
|
-
}
|
|
272
|
-
function x(A) {
|
|
273
|
-
if (C.value === !0 && cl(A, [13, 32]) === !0) {
|
|
274
|
-
ne(A), A.qKeyEvent = !0;
|
|
275
|
-
const L = new MouseEvent("click", A);
|
|
276
|
-
L.qKeyEvent = !0, f.value.dispatchEvent(L);
|
|
277
|
-
}
|
|
278
|
-
t("keyup", A);
|
|
279
|
-
}
|
|
280
|
-
function j() {
|
|
281
|
-
const A = Nl(l.default, []);
|
|
282
|
-
return C.value === !0 && A.unshift(
|
|
283
|
-
s("div", { class: "q-focus-helper", tabindex: -1, ref: w })
|
|
284
|
-
), A;
|
|
285
|
-
}
|
|
286
|
-
return () => {
|
|
287
|
-
const A = {
|
|
288
|
-
ref: f,
|
|
289
|
-
class: V.value,
|
|
290
|
-
style: h.value,
|
|
291
|
-
role: "listitem",
|
|
292
|
-
onClick: v,
|
|
293
|
-
onKeyup: x
|
|
294
|
-
};
|
|
295
|
-
return C.value === !0 ? (A.tabindex = e.tabindex || "0", Object.assign(A, a.value)) : k.value === !0 && (A["aria-disabled"] = "true"), s(
|
|
296
|
-
y.value,
|
|
297
|
-
A,
|
|
298
|
-
j()
|
|
299
|
-
);
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
}), Dt = (e) => e ? !0 : "Обовʼязкове поле", jt = /^on[A-Z]/;
|
|
303
|
-
function Bo() {
|
|
304
|
-
const { attrs: e, vnode: l } = se(), t = {
|
|
305
|
-
listeners: M({}),
|
|
306
|
-
attributes: M({})
|
|
307
|
-
};
|
|
308
|
-
function n() {
|
|
309
|
-
const c = {}, u = {};
|
|
310
|
-
for (const a in e)
|
|
311
|
-
a !== "class" && a !== "style" && jt.test(a) === !1 && (c[a] = e[a]);
|
|
312
|
-
for (const a in l.props)
|
|
313
|
-
jt.test(a) === !0 && (u[a] = l.props[a]);
|
|
314
|
-
t.attributes.value = c, t.listeners.value = u;
|
|
315
|
-
}
|
|
316
|
-
return ol(n), n(), t;
|
|
317
|
-
}
|
|
318
|
-
const Eo = "_q_fo_";
|
|
319
|
-
function zo({ validate: e, resetValidation: l, requiresQForm: t }) {
|
|
320
|
-
const n = Ol(Eo, !1);
|
|
321
|
-
if (n !== !1) {
|
|
322
|
-
const { props: c, proxy: u } = se();
|
|
323
|
-
Object.assign(u, { validate: e, resetValidation: l }), G(() => c.disable, (a) => {
|
|
324
|
-
a === !0 ? (typeof l == "function" && l(), n.unbindComponent(u)) : n.bindComponent(u);
|
|
325
|
-
}), nl(() => {
|
|
326
|
-
c.disable !== !0 && n.bindComponent(u);
|
|
327
|
-
}), Ae(() => {
|
|
328
|
-
c.disable !== !0 && n.unbindComponent(u);
|
|
329
|
-
});
|
|
330
|
-
} else t === !0 && console.error("Parent QForm not found on useFormChild()!");
|
|
331
|
-
}
|
|
332
|
-
const Kt = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/, Nt = /^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/, Qt = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, lt = /^rgb\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5])\)$/, ot = /^rgba\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),(0|0\.[0-9]+[1-9]|0\.[1-9]+|1)\)$/, ht = {
|
|
333
|
-
date: (e) => /^-?[\d]+\/[0-1]\d\/[0-3]\d$/.test(e),
|
|
334
|
-
time: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d$/.test(e),
|
|
335
|
-
fulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(e),
|
|
336
|
-
timeOrFulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(e),
|
|
337
|
-
// -- RFC 5322 --
|
|
338
|
-
// -- Added in v2.6.6 --
|
|
339
|
-
// This is a basic helper validation.
|
|
340
|
-
// For something more complex (like RFC 822) you should write and use your own rule.
|
|
341
|
-
// We won't be accepting PRs to enhance the one below because of the reason above.
|
|
342
|
-
// eslint-disable-next-line
|
|
343
|
-
email: (e) => /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),
|
|
344
|
-
hexColor: (e) => Kt.test(e),
|
|
345
|
-
hexaColor: (e) => Nt.test(e),
|
|
346
|
-
hexOrHexaColor: (e) => Qt.test(e),
|
|
347
|
-
rgbColor: (e) => lt.test(e),
|
|
348
|
-
rgbaColor: (e) => ot.test(e),
|
|
349
|
-
rgbOrRgbaColor: (e) => lt.test(e) || ot.test(e),
|
|
350
|
-
hexOrRgbColor: (e) => Kt.test(e) || lt.test(e),
|
|
351
|
-
hexaOrRgbaColor: (e) => Nt.test(e) || ot.test(e),
|
|
352
|
-
anyColor: (e) => Qt.test(e) || lt.test(e) || ot.test(e)
|
|
353
|
-
};
|
|
354
|
-
function gl(e, l = 250, t) {
|
|
355
|
-
let n = null;
|
|
356
|
-
function c() {
|
|
357
|
-
const u = arguments, a = () => {
|
|
358
|
-
n = null, e.apply(this, u);
|
|
359
|
-
};
|
|
360
|
-
n !== null ? clearTimeout(n) : t === !0 && e.apply(this, u), n = setTimeout(a, l);
|
|
361
|
-
}
|
|
362
|
-
return c.cancel = () => {
|
|
363
|
-
n !== null && clearTimeout(n);
|
|
364
|
-
}, c;
|
|
365
|
-
}
|
|
366
|
-
const Ro = [!0, !1, "ondemand"], Fo = {
|
|
367
|
-
modelValue: {},
|
|
368
|
-
error: {
|
|
369
|
-
type: Boolean,
|
|
370
|
-
default: null
|
|
371
|
-
},
|
|
372
|
-
errorMessage: String,
|
|
373
|
-
noErrorIcon: Boolean,
|
|
374
|
-
rules: Array,
|
|
375
|
-
reactiveRules: Boolean,
|
|
376
|
-
lazyRules: {
|
|
377
|
-
type: [Boolean, String],
|
|
378
|
-
default: !1,
|
|
379
|
-
// statement unneeded but avoids future vue implementation changes
|
|
380
|
-
validator: (e) => Ro.includes(e)
|
|
381
|
-
}
|
|
382
|
-
};
|
|
383
|
-
function Io(e, l) {
|
|
384
|
-
const { props: t, proxy: n } = se(), c = M(!1), u = M(null), a = M(!1);
|
|
385
|
-
zo({ validate: h, resetValidation: V });
|
|
386
|
-
let b = 0, y;
|
|
387
|
-
const _ = r(
|
|
388
|
-
() => t.rules !== void 0 && t.rules !== null && t.rules.length !== 0
|
|
389
|
-
), f = r(() => t.disable !== !0 && _.value === !0 && l.value === !1), w = r(
|
|
390
|
-
() => t.error === !0 || c.value === !0
|
|
391
|
-
), k = r(() => typeof t.errorMessage == "string" && t.errorMessage.length !== 0 ? t.errorMessage : u.value);
|
|
392
|
-
G(() => t.modelValue, () => {
|
|
393
|
-
a.value = !0, f.value === !0 && t.lazyRules === !1 && v();
|
|
394
|
-
});
|
|
395
|
-
function C() {
|
|
396
|
-
t.lazyRules !== "ondemand" && f.value === !0 && a.value === !0 && v();
|
|
397
|
-
}
|
|
398
|
-
G(() => t.reactiveRules, (x) => {
|
|
399
|
-
x === !0 ? y === void 0 && (y = G(() => t.rules, C, { immediate: !0, deep: !0 })) : y !== void 0 && (y(), y = void 0);
|
|
400
|
-
}, { immediate: !0 }), G(() => t.lazyRules, C), G(e, (x) => {
|
|
401
|
-
x === !0 ? a.value = !0 : f.value === !0 && t.lazyRules !== "ondemand" && v();
|
|
402
|
-
});
|
|
403
|
-
function V() {
|
|
404
|
-
b++, l.value = !1, a.value = !1, c.value = !1, u.value = null, v.cancel();
|
|
405
|
-
}
|
|
406
|
-
function h(x = t.modelValue) {
|
|
407
|
-
if (t.disable === !0 || _.value === !1)
|
|
408
|
-
return !0;
|
|
409
|
-
const j = ++b, A = l.value !== !0 ? () => {
|
|
410
|
-
a.value = !0;
|
|
411
|
-
} : () => {
|
|
412
|
-
}, L = (F, $) => {
|
|
413
|
-
F === !0 && A(), c.value = F, u.value = $ || null, l.value = !1;
|
|
414
|
-
}, Y = [];
|
|
415
|
-
for (let F = 0; F < t.rules.length; F++) {
|
|
416
|
-
const $ = t.rules[F];
|
|
417
|
-
let H;
|
|
418
|
-
if (typeof $ == "function" ? H = $(x, ht) : typeof $ == "string" && ht[$] !== void 0 && (H = ht[$](x)), H === !1 || typeof H == "string")
|
|
419
|
-
return L(!0, H), !1;
|
|
420
|
-
H !== !0 && H !== void 0 && Y.push(H);
|
|
421
|
-
}
|
|
422
|
-
return Y.length === 0 ? (L(!1), !0) : (l.value = !0, Promise.all(Y).then(
|
|
423
|
-
(F) => {
|
|
424
|
-
if (F === void 0 || Array.isArray(F) === !1 || F.length === 0)
|
|
425
|
-
return j === b && L(!1), !0;
|
|
426
|
-
const $ = F.find((H) => H === !1 || typeof H == "string");
|
|
427
|
-
return j === b && L($ !== void 0, $), $ === void 0;
|
|
428
|
-
},
|
|
429
|
-
(F) => (j === b && (console.error(F), L(!0)), !1)
|
|
430
|
-
));
|
|
431
|
-
}
|
|
432
|
-
const v = gl(h, 0);
|
|
433
|
-
return Ae(() => {
|
|
434
|
-
y == null || y(), v.cancel();
|
|
435
|
-
}), Object.assign(n, { resetValidation: V, validate: h }), bo(n, "hasError", () => w.value), {
|
|
436
|
-
isDirtyModel: a,
|
|
437
|
-
hasRules: _,
|
|
438
|
-
hasError: w,
|
|
439
|
-
errorMessage: k,
|
|
440
|
-
validate: h,
|
|
441
|
-
resetValidation: V
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
function kt(e) {
|
|
445
|
-
return e != null && ("" + e).length !== 0;
|
|
446
|
-
}
|
|
447
|
-
const To = {
|
|
448
|
-
...rt,
|
|
449
|
-
...Fo,
|
|
450
|
-
label: String,
|
|
451
|
-
stackLabel: Boolean,
|
|
452
|
-
hint: String,
|
|
453
|
-
hideHint: Boolean,
|
|
454
|
-
prefix: String,
|
|
455
|
-
suffix: String,
|
|
456
|
-
labelColor: String,
|
|
457
|
-
color: String,
|
|
458
|
-
bgColor: String,
|
|
459
|
-
filled: Boolean,
|
|
460
|
-
outlined: Boolean,
|
|
461
|
-
borderless: Boolean,
|
|
462
|
-
standout: [Boolean, String],
|
|
463
|
-
square: Boolean,
|
|
464
|
-
loading: Boolean,
|
|
465
|
-
labelSlot: Boolean,
|
|
466
|
-
bottomSlots: Boolean,
|
|
467
|
-
hideBottomSpace: Boolean,
|
|
468
|
-
rounded: Boolean,
|
|
469
|
-
dense: Boolean,
|
|
470
|
-
itemAligned: Boolean,
|
|
471
|
-
counter: Boolean,
|
|
472
|
-
clearable: Boolean,
|
|
473
|
-
clearIcon: String,
|
|
474
|
-
disable: Boolean,
|
|
475
|
-
readonly: Boolean,
|
|
476
|
-
autofocus: Boolean,
|
|
477
|
-
for: String
|
|
478
|
-
}, qt = {
|
|
479
|
-
...To,
|
|
480
|
-
maxlength: [Number, String]
|
|
481
|
-
}, hl = ["update:modelValue", "clear", "focus", "blur"];
|
|
482
|
-
function pl({ requiredForAttr: e = !0, tagProp: l, changeEvent: t = !1 } = {}) {
|
|
483
|
-
const { props: n, proxy: c } = se(), u = st(n, c.$q), a = lo({
|
|
484
|
-
required: e,
|
|
485
|
-
getValue: () => n.for
|
|
486
|
-
});
|
|
487
|
-
return {
|
|
488
|
-
requiredForAttr: e,
|
|
489
|
-
changeEvent: t,
|
|
490
|
-
tag: l === !0 ? r(() => n.tag) : { value: "label" },
|
|
491
|
-
isDark: u,
|
|
492
|
-
editable: r(
|
|
493
|
-
() => n.disable !== !0 && n.readonly !== !0
|
|
494
|
-
),
|
|
495
|
-
innerLoading: M(!1),
|
|
496
|
-
focused: M(!1),
|
|
497
|
-
hasPopupOpen: !1,
|
|
498
|
-
splitAttrs: Bo(),
|
|
499
|
-
targetUid: a,
|
|
500
|
-
rootRef: M(null),
|
|
501
|
-
targetRef: M(null),
|
|
502
|
-
controlRef: M(null)
|
|
503
|
-
/**
|
|
504
|
-
* user supplied additionals:
|
|
505
|
-
|
|
506
|
-
* innerValue - computed
|
|
507
|
-
* floatingLabel - computed
|
|
508
|
-
* inputRef - computed
|
|
509
|
-
|
|
510
|
-
* fieldClass - computed
|
|
511
|
-
* hasShadow - computed
|
|
512
|
-
|
|
513
|
-
* controlEvents - Object with fn(e)
|
|
514
|
-
|
|
515
|
-
* getControl - fn
|
|
516
|
-
* getInnerAppend - fn
|
|
517
|
-
* getControlChild - fn
|
|
518
|
-
* getShadowControl - fn
|
|
519
|
-
* showPopup - fn
|
|
520
|
-
*/
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
function bl(e) {
|
|
524
|
-
const { props: l, emit: t, slots: n, attrs: c, proxy: u } = se(), { $q: a } = u;
|
|
525
|
-
let b = null;
|
|
526
|
-
e.hasValue === void 0 && (e.hasValue = r(() => kt(l.modelValue))), e.emitValue === void 0 && (e.emitValue = (p) => {
|
|
527
|
-
t("update:modelValue", p);
|
|
528
|
-
}), e.controlEvents === void 0 && (e.controlEvents = {
|
|
529
|
-
onFocusin: le,
|
|
530
|
-
onFocusout: W
|
|
531
|
-
}), Object.assign(e, {
|
|
532
|
-
clearValue: oe,
|
|
533
|
-
onControlFocusin: le,
|
|
534
|
-
onControlFocusout: W,
|
|
535
|
-
focus: $
|
|
536
|
-
}), e.computedCounter === void 0 && (e.computedCounter = r(() => {
|
|
537
|
-
if (l.counter !== !1) {
|
|
538
|
-
const p = typeof l.modelValue == "string" || typeof l.modelValue == "number" ? ("" + l.modelValue).length : Array.isArray(l.modelValue) === !0 ? l.modelValue.length : 0, B = l.maxlength !== void 0 ? l.maxlength : l.maxValues;
|
|
539
|
-
return p + (B !== void 0 ? " / " + B : "");
|
|
540
|
-
}
|
|
541
|
-
}));
|
|
542
|
-
const {
|
|
543
|
-
isDirtyModel: y,
|
|
544
|
-
hasRules: _,
|
|
545
|
-
hasError: f,
|
|
546
|
-
errorMessage: w,
|
|
547
|
-
resetValidation: k
|
|
548
|
-
} = Io(e.focused, e.innerLoading), C = e.floatingLabel !== void 0 ? r(() => l.stackLabel === !0 || e.focused.value === !0 || e.floatingLabel.value === !0) : r(() => l.stackLabel === !0 || e.focused.value === !0 || e.hasValue.value === !0), V = r(
|
|
549
|
-
() => l.bottomSlots === !0 || l.hint !== void 0 || _.value === !0 || l.counter === !0 || l.error !== null
|
|
550
|
-
), h = r(() => l.filled === !0 ? "filled" : l.outlined === !0 ? "outlined" : l.borderless === !0 ? "borderless" : l.standout ? "standout" : "standard"), v = r(
|
|
551
|
-
() => `q-field row no-wrap items-start q-field--${h.value}` + (e.fieldClass !== void 0 ? ` ${e.fieldClass.value}` : "") + (l.rounded === !0 ? " q-field--rounded" : "") + (l.square === !0 ? " q-field--square" : "") + (C.value === !0 ? " q-field--float" : "") + (j.value === !0 ? " q-field--labeled" : "") + (l.dense === !0 ? " q-field--dense" : "") + (l.itemAligned === !0 ? " q-field--item-aligned q-item-type" : "") + (e.isDark.value === !0 ? " q-field--dark" : "") + (e.getControl === void 0 ? " q-field--auto-height" : "") + (e.focused.value === !0 ? " q-field--focused" : "") + (f.value === !0 ? " q-field--error" : "") + (f.value === !0 || e.focused.value === !0 ? " q-field--highlighted" : "") + (l.hideBottomSpace !== !0 && V.value === !0 ? " q-field--with-bottom" : "") + (l.disable === !0 ? " q-field--disabled" : l.readonly === !0 ? " q-field--readonly" : "")
|
|
552
|
-
), x = r(
|
|
553
|
-
() => "q-field__control relative-position row no-wrap" + (l.bgColor !== void 0 ? ` bg-${l.bgColor}` : "") + (f.value === !0 ? " text-negative" : typeof l.standout == "string" && l.standout.length !== 0 && e.focused.value === !0 ? ` ${l.standout}` : l.color !== void 0 ? ` text-${l.color}` : "")
|
|
554
|
-
), j = r(
|
|
555
|
-
() => l.labelSlot === !0 || l.label !== void 0
|
|
556
|
-
), A = r(
|
|
557
|
-
() => "q-field__label no-pointer-events absolute ellipsis" + (l.labelColor !== void 0 && f.value !== !0 ? ` text-${l.labelColor}` : "")
|
|
558
|
-
), L = r(() => ({
|
|
559
|
-
id: e.targetUid.value,
|
|
560
|
-
editable: e.editable.value,
|
|
561
|
-
focused: e.focused.value,
|
|
562
|
-
floatingLabel: C.value,
|
|
563
|
-
modelValue: l.modelValue,
|
|
564
|
-
emitValue: e.emitValue
|
|
565
|
-
})), Y = r(() => {
|
|
566
|
-
const p = {};
|
|
567
|
-
return e.targetUid.value && (p.for = e.targetUid.value), l.disable === !0 && (p["aria-disabled"] = "true"), p;
|
|
568
|
-
});
|
|
569
|
-
function F() {
|
|
570
|
-
var Z;
|
|
571
|
-
const p = document.activeElement;
|
|
572
|
-
let B = (Z = e.targetRef) == null ? void 0 : Z.value;
|
|
573
|
-
B && (p === null || p.id !== e.targetUid.value) && (B.hasAttribute("tabindex") === !0 || (B = B.querySelector("[tabindex]")), B !== p && (B == null || B.focus({ preventScroll: !0 })));
|
|
574
|
-
}
|
|
575
|
-
function $() {
|
|
576
|
-
dl(F);
|
|
577
|
-
}
|
|
578
|
-
function H() {
|
|
579
|
-
oo(F);
|
|
580
|
-
const p = document.activeElement;
|
|
581
|
-
p !== null && e.rootRef.value.contains(p) && p.blur();
|
|
582
|
-
}
|
|
583
|
-
function le(p) {
|
|
584
|
-
b !== null && (clearTimeout(b), b = null), e.editable.value === !0 && e.focused.value === !1 && (e.focused.value = !0, t("focus", p));
|
|
585
|
-
}
|
|
586
|
-
function W(p, B) {
|
|
587
|
-
b !== null && clearTimeout(b), b = setTimeout(() => {
|
|
588
|
-
b = null, !(document.hasFocus() === !0 && (e.hasPopupOpen === !0 || e.controlRef === void 0 || e.controlRef.value === null || e.controlRef.value.contains(document.activeElement) !== !1)) && (e.focused.value === !0 && (e.focused.value = !1, t("blur", p)), B == null || B());
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
function oe(p) {
|
|
592
|
-
var B;
|
|
593
|
-
ne(p), a.platform.is.mobile !== !0 ? (((B = e.targetRef) == null ? void 0 : B.value) || e.rootRef.value).focus() : e.rootRef.value.contains(document.activeElement) === !0 && document.activeElement.blur(), l.type === "file" && (e.inputRef.value.value = null), t("update:modelValue", null), e.changeEvent === !0 && t("change", null), t("clear", l.modelValue), ve(() => {
|
|
594
|
-
const Z = y.value;
|
|
595
|
-
k(), y.value = Z;
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
function q(p) {
|
|
599
|
-
[13, 32].includes(p.keyCode) && oe(p);
|
|
600
|
-
}
|
|
601
|
-
function X() {
|
|
602
|
-
const p = [];
|
|
603
|
-
return n.prepend !== void 0 && p.push(
|
|
604
|
-
s("div", {
|
|
605
|
-
class: "q-field__prepend q-field__marginal row no-wrap items-center",
|
|
606
|
-
key: "prepend",
|
|
607
|
-
onClick: he
|
|
608
|
-
}, n.prepend())
|
|
609
|
-
), p.push(
|
|
610
|
-
s("div", {
|
|
611
|
-
class: "q-field__control-container col relative-position row no-wrap q-anchor--skip"
|
|
612
|
-
}, ue())
|
|
613
|
-
), f.value === !0 && l.noErrorIcon === !1 && p.push(
|
|
614
|
-
U("error", [
|
|
615
|
-
s(_e, { name: a.iconSet.field.error, color: "negative" })
|
|
616
|
-
])
|
|
617
|
-
), l.loading === !0 || e.innerLoading.value === !0 ? p.push(
|
|
618
|
-
U(
|
|
619
|
-
"inner-loading-append",
|
|
620
|
-
n.loading !== void 0 ? n.loading() : [s(Ql, { color: l.color })]
|
|
621
|
-
)
|
|
622
|
-
) : l.clearable === !0 && e.hasValue.value === !0 && e.editable.value === !0 && p.push(
|
|
623
|
-
U("inner-clearable-append", [
|
|
624
|
-
s(_e, {
|
|
625
|
-
class: "q-field__focusable-action",
|
|
626
|
-
name: l.clearIcon || a.iconSet.field.clear,
|
|
627
|
-
tabindex: 0,
|
|
628
|
-
role: "button",
|
|
629
|
-
"aria-hidden": "false",
|
|
630
|
-
"aria-label": a.lang.label.clear,
|
|
631
|
-
onKeyup: q,
|
|
632
|
-
onClick: oe
|
|
633
|
-
})
|
|
634
|
-
])
|
|
635
|
-
), n.append !== void 0 && p.push(
|
|
636
|
-
s("div", {
|
|
637
|
-
class: "q-field__append q-field__marginal row no-wrap items-center",
|
|
638
|
-
key: "append",
|
|
639
|
-
onClick: he
|
|
640
|
-
}, n.append())
|
|
641
|
-
), e.getInnerAppend !== void 0 && p.push(
|
|
642
|
-
U("inner-append", e.getInnerAppend())
|
|
643
|
-
), e.getControlChild !== void 0 && p.push(
|
|
644
|
-
e.getControlChild()
|
|
645
|
-
), p;
|
|
646
|
-
}
|
|
647
|
-
function ue() {
|
|
648
|
-
const p = [];
|
|
649
|
-
return l.prefix !== void 0 && l.prefix !== null && p.push(
|
|
650
|
-
s("div", {
|
|
651
|
-
class: "q-field__prefix no-pointer-events row items-center"
|
|
652
|
-
}, l.prefix)
|
|
653
|
-
), e.getShadowControl !== void 0 && e.hasShadow.value === !0 && p.push(
|
|
654
|
-
e.getShadowControl()
|
|
655
|
-
), j.value === !0 && p.push(
|
|
656
|
-
s("div", {
|
|
657
|
-
class: A.value
|
|
658
|
-
}, be(n.label, l.label))
|
|
659
|
-
), e.getControl !== void 0 ? p.push(e.getControl()) : n.rawControl !== void 0 ? p.push(n.rawControl()) : n.control !== void 0 && p.push(
|
|
660
|
-
s("div", {
|
|
661
|
-
ref: e.targetRef,
|
|
662
|
-
class: "q-field__native row",
|
|
663
|
-
tabindex: -1,
|
|
664
|
-
...e.splitAttrs.attributes.value,
|
|
665
|
-
"data-autofocus": l.autofocus === !0 || void 0
|
|
666
|
-
}, n.control(L.value))
|
|
667
|
-
), l.suffix !== void 0 && l.suffix !== null && p.push(
|
|
668
|
-
s("div", {
|
|
669
|
-
class: "q-field__suffix no-pointer-events row items-center"
|
|
670
|
-
}, l.suffix)
|
|
671
|
-
), p.concat(be(n.default));
|
|
672
|
-
}
|
|
673
|
-
function J() {
|
|
674
|
-
let p, B;
|
|
675
|
-
f.value === !0 ? w.value !== null ? (p = [s("div", { role: "alert" }, w.value)], B = `q--slot-error-${w.value}`) : (p = be(n.error), B = "q--slot-error") : (l.hideHint !== !0 || e.focused.value === !0) && (l.hint !== void 0 ? (p = [s("div", l.hint)], B = `q--slot-hint-${l.hint}`) : (p = be(n.hint), B = "q--slot-hint"));
|
|
676
|
-
const Z = l.counter === !0 || n.counter !== void 0;
|
|
677
|
-
if (l.hideBottomSpace === !0 && Z === !1 && p === void 0) return;
|
|
678
|
-
const i = s("div", {
|
|
679
|
-
key: B,
|
|
680
|
-
class: "q-field__messages col"
|
|
681
|
-
}, p);
|
|
682
|
-
return s("div", {
|
|
683
|
-
class: "q-field__bottom row items-start q-field__bottom--" + (l.hideBottomSpace !== !0 ? "animated" : "stale"),
|
|
684
|
-
onClick: he
|
|
685
|
-
}, [
|
|
686
|
-
l.hideBottomSpace === !0 ? i : s(Ct, { name: "q-transition--field-message" }, () => i),
|
|
687
|
-
Z === !0 ? s("div", {
|
|
688
|
-
class: "q-field__counter"
|
|
689
|
-
}, n.counter !== void 0 ? n.counter() : e.computedCounter.value) : null
|
|
690
|
-
]);
|
|
691
|
-
}
|
|
692
|
-
function U(p, B) {
|
|
693
|
-
return B === null ? null : s("div", {
|
|
694
|
-
key: p,
|
|
695
|
-
class: "q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"
|
|
696
|
-
}, B);
|
|
697
|
-
}
|
|
698
|
-
let ce = !1;
|
|
699
|
-
return ul(() => {
|
|
700
|
-
ce = !0;
|
|
701
|
-
}), il(() => {
|
|
702
|
-
ce === !0 && l.autofocus === !0 && u.focus();
|
|
703
|
-
}), l.autofocus === !0 && nl(() => {
|
|
704
|
-
u.focus();
|
|
705
|
-
}), Ae(() => {
|
|
706
|
-
b !== null && clearTimeout(b);
|
|
707
|
-
}), Object.assign(u, { focus: $, blur: H }), function() {
|
|
708
|
-
const B = e.getControl === void 0 && n.control === void 0 ? {
|
|
709
|
-
...e.splitAttrs.attributes.value,
|
|
710
|
-
"data-autofocus": l.autofocus === !0 || void 0,
|
|
711
|
-
...Y.value
|
|
712
|
-
} : Y.value;
|
|
713
|
-
return s(e.tag.value, {
|
|
714
|
-
ref: e.rootRef,
|
|
715
|
-
class: [
|
|
716
|
-
v.value,
|
|
717
|
-
c.class
|
|
718
|
-
],
|
|
719
|
-
style: c.style,
|
|
720
|
-
...B
|
|
721
|
-
}, [
|
|
722
|
-
n.before !== void 0 ? s("div", {
|
|
723
|
-
class: "q-field__before q-field__marginal row no-wrap items-center",
|
|
724
|
-
onClick: he
|
|
725
|
-
}, n.before()) : null,
|
|
726
|
-
s("div", {
|
|
727
|
-
class: "q-field__inner relative-position col self-stretch"
|
|
728
|
-
}, [
|
|
729
|
-
s("div", {
|
|
730
|
-
ref: e.controlRef,
|
|
731
|
-
class: x.value,
|
|
732
|
-
tabindex: -1,
|
|
733
|
-
...e.controlEvents
|
|
734
|
-
}, X()),
|
|
735
|
-
V.value === !0 ? J() : null
|
|
736
|
-
]),
|
|
737
|
-
n.after !== void 0 ? s("div", {
|
|
738
|
-
class: "q-field__after q-field__marginal row no-wrap items-center",
|
|
739
|
-
onClick: he
|
|
740
|
-
}, n.after()) : null
|
|
741
|
-
]);
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
const Oo = ye({
|
|
745
|
-
name: "QField",
|
|
746
|
-
inheritAttrs: !1,
|
|
747
|
-
props: {
|
|
748
|
-
...qt,
|
|
749
|
-
tag: {
|
|
750
|
-
type: String,
|
|
751
|
-
default: "label"
|
|
752
|
-
}
|
|
753
|
-
},
|
|
754
|
-
emits: hl,
|
|
755
|
-
setup() {
|
|
756
|
-
return bl(
|
|
757
|
-
pl({ tagProp: !0 })
|
|
758
|
-
);
|
|
759
|
-
}
|
|
760
|
-
}), Mo = {
|
|
761
|
-
xs: 8,
|
|
762
|
-
sm: 10,
|
|
763
|
-
md: 14,
|
|
764
|
-
lg: 20,
|
|
765
|
-
xl: 24
|
|
766
|
-
}, Lo = ye({
|
|
767
|
-
name: "QChip",
|
|
768
|
-
props: {
|
|
769
|
-
...rt,
|
|
770
|
-
...al,
|
|
771
|
-
dense: Boolean,
|
|
772
|
-
icon: String,
|
|
773
|
-
iconRight: String,
|
|
774
|
-
iconRemove: String,
|
|
775
|
-
iconSelected: String,
|
|
776
|
-
label: [String, Number],
|
|
777
|
-
color: String,
|
|
778
|
-
textColor: String,
|
|
779
|
-
modelValue: {
|
|
780
|
-
type: Boolean,
|
|
781
|
-
default: !0
|
|
782
|
-
},
|
|
783
|
-
selected: {
|
|
784
|
-
type: Boolean,
|
|
785
|
-
default: null
|
|
786
|
-
},
|
|
787
|
-
square: Boolean,
|
|
788
|
-
outline: Boolean,
|
|
789
|
-
clickable: Boolean,
|
|
790
|
-
removable: Boolean,
|
|
791
|
-
removeAriaLabel: String,
|
|
792
|
-
tabindex: [String, Number],
|
|
793
|
-
disable: Boolean,
|
|
794
|
-
ripple: {
|
|
795
|
-
type: [Boolean, Object],
|
|
796
|
-
default: !0
|
|
797
|
-
}
|
|
798
|
-
},
|
|
799
|
-
emits: ["update:modelValue", "update:selected", "remove", "click"],
|
|
800
|
-
setup(e, { slots: l, emit: t }) {
|
|
801
|
-
const { proxy: { $q: n } } = se(), c = st(e, n), u = rl(e, Mo), a = r(() => e.selected === !0 || e.icon !== void 0), b = r(() => e.selected === !0 ? e.iconSelected || n.iconSet.chip.selected : e.icon), y = r(() => e.iconRemove || n.iconSet.chip.remove), _ = r(
|
|
802
|
-
() => e.disable === !1 && (e.clickable === !0 || e.selected !== null)
|
|
803
|
-
), f = r(() => {
|
|
804
|
-
const v = e.outline === !0 && e.color || e.textColor;
|
|
805
|
-
return "q-chip row inline no-wrap items-center" + (e.outline === !1 && e.color !== void 0 ? ` bg-${e.color}` : "") + (v ? ` text-${v} q-chip--colored` : "") + (e.disable === !0 ? " disabled" : "") + (e.dense === !0 ? " q-chip--dense" : "") + (e.outline === !0 ? " q-chip--outline" : "") + (e.selected === !0 ? " q-chip--selected" : "") + (_.value === !0 ? " q-chip--clickable cursor-pointer non-selectable q-hoverable" : "") + (e.square === !0 ? " q-chip--square" : "") + (c.value === !0 ? " q-chip--dark q-dark" : "");
|
|
806
|
-
}), w = r(() => {
|
|
807
|
-
const v = e.disable === !0 ? { tabindex: -1, "aria-disabled": "true" } : { tabindex: e.tabindex || 0 }, x = {
|
|
808
|
-
...v,
|
|
809
|
-
role: "button",
|
|
810
|
-
"aria-hidden": "false",
|
|
811
|
-
"aria-label": e.removeAriaLabel || n.lang.label.remove
|
|
812
|
-
};
|
|
813
|
-
return { chip: v, remove: x };
|
|
814
|
-
});
|
|
815
|
-
function k(v) {
|
|
816
|
-
v.keyCode === 13 && C(v);
|
|
817
|
-
}
|
|
818
|
-
function C(v) {
|
|
819
|
-
e.disable || (t("update:selected", !e.selected), t("click", v));
|
|
820
|
-
}
|
|
821
|
-
function V(v) {
|
|
822
|
-
(v.keyCode === void 0 || v.keyCode === 13) && (ne(v), e.disable === !1 && (t("update:modelValue", !1), t("remove")));
|
|
823
|
-
}
|
|
824
|
-
function h() {
|
|
825
|
-
const v = [];
|
|
826
|
-
_.value === !0 && v.push(
|
|
827
|
-
s("div", { class: "q-focus-helper" })
|
|
828
|
-
), a.value === !0 && v.push(
|
|
829
|
-
s(_e, {
|
|
830
|
-
class: "q-chip__icon q-chip__icon--left",
|
|
831
|
-
name: b.value
|
|
832
|
-
})
|
|
833
|
-
);
|
|
834
|
-
const x = e.label !== void 0 ? [s("div", { class: "ellipsis" }, [e.label])] : void 0;
|
|
835
|
-
return v.push(
|
|
836
|
-
s("div", {
|
|
837
|
-
class: "q-chip__content col row no-wrap items-center q-anchor--skip"
|
|
838
|
-
}, Wl(l.default, x))
|
|
839
|
-
), e.iconRight && v.push(
|
|
840
|
-
s(_e, {
|
|
841
|
-
class: "q-chip__icon q-chip__icon--right",
|
|
842
|
-
name: e.iconRight
|
|
843
|
-
})
|
|
844
|
-
), e.removable === !0 && v.push(
|
|
845
|
-
s(_e, {
|
|
846
|
-
class: "q-chip__icon q-chip__icon--remove cursor-pointer",
|
|
847
|
-
name: y.value,
|
|
848
|
-
...w.value.remove,
|
|
849
|
-
onClick: V,
|
|
850
|
-
onKeyup: V
|
|
851
|
-
})
|
|
852
|
-
), v;
|
|
853
|
-
}
|
|
854
|
-
return () => {
|
|
855
|
-
if (e.modelValue === !1) return;
|
|
856
|
-
const v = {
|
|
857
|
-
class: f.value,
|
|
858
|
-
style: u.value
|
|
859
|
-
};
|
|
860
|
-
return _.value === !0 && Object.assign(
|
|
861
|
-
v,
|
|
862
|
-
w.value.chip,
|
|
863
|
-
{ onClick: C, onKeyup: k }
|
|
864
|
-
), Ul(
|
|
865
|
-
"div",
|
|
866
|
-
v,
|
|
867
|
-
h(),
|
|
868
|
-
"ripple",
|
|
869
|
-
e.ripple !== !1 && e.disable !== !0,
|
|
870
|
-
() => [[Xl, e.ripple]]
|
|
871
|
-
);
|
|
872
|
-
};
|
|
873
|
-
}
|
|
874
|
-
});
|
|
875
|
-
function $o(e, l, t) {
|
|
876
|
-
function n() {
|
|
877
|
-
}
|
|
878
|
-
return Ae(() => {
|
|
879
|
-
e.value === !0 && void 0;
|
|
880
|
-
}), {
|
|
881
|
-
removeFromHistory: n,
|
|
882
|
-
addToHistory() {
|
|
883
|
-
}
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
let Ne = 0, pt, bt, Ue, yt = !1, Ut, Wt, Xt, Ve = null;
|
|
887
|
-
function Ho(e) {
|
|
888
|
-
Po(e) && ne(e);
|
|
889
|
-
}
|
|
890
|
-
function Po(e) {
|
|
891
|
-
if (e.target === document.body || e.target.classList.contains("q-layout__backdrop"))
|
|
892
|
-
return !0;
|
|
893
|
-
const l = Yl(e), t = e.shiftKey && !e.deltaX, n = !t && Math.abs(e.deltaX) <= Math.abs(e.deltaY), c = t || n ? e.deltaY : e.deltaX;
|
|
894
|
-
for (let u = 0; u < l.length; u++) {
|
|
895
|
-
const a = l[u];
|
|
896
|
-
if (io(a, n))
|
|
897
|
-
return n ? c < 0 && a.scrollTop === 0 ? !0 : c > 0 && a.scrollTop + a.clientHeight === a.scrollHeight : c < 0 && a.scrollLeft === 0 ? !0 : c > 0 && a.scrollLeft + a.clientWidth === a.scrollWidth;
|
|
898
|
-
}
|
|
899
|
-
return !0;
|
|
900
|
-
}
|
|
901
|
-
function Yt(e) {
|
|
902
|
-
e.target === document && (document.scrollingElement.scrollTop = document.scrollingElement.scrollTop);
|
|
903
|
-
}
|
|
904
|
-
function nt(e) {
|
|
905
|
-
yt !== !0 && (yt = !0, requestAnimationFrame(() => {
|
|
906
|
-
yt = !1;
|
|
907
|
-
const { height: l } = e.target, { clientHeight: t, scrollTop: n } = document.scrollingElement;
|
|
908
|
-
(Ue === void 0 || l !== window.innerHeight) && (Ue = t - l, document.scrollingElement.scrollTop = n), n > Ue && (document.scrollingElement.scrollTop -= Math.ceil((n - Ue) / 8));
|
|
909
|
-
}));
|
|
910
|
-
}
|
|
911
|
-
function Zt(e) {
|
|
912
|
-
const l = document.body, t = window.visualViewport !== void 0;
|
|
913
|
-
if (e === "add") {
|
|
914
|
-
const { overflowY: n, overflowX: c } = window.getComputedStyle(l);
|
|
915
|
-
pt = no(window), bt = uo(window), Ut = l.style.left, Wt = l.style.top, Xt = window.location.href, l.style.left = `-${pt}px`, l.style.top = `-${bt}px`, c !== "hidden" && (c === "scroll" || l.scrollWidth > window.innerWidth) && l.classList.add("q-body--force-scrollbar-x"), n !== "hidden" && (n === "scroll" || l.scrollHeight > window.innerHeight) && l.classList.add("q-body--force-scrollbar-y"), l.classList.add("q-body--prevent-scroll"), document.qScrollPrevented = !0, xe.is.ios === !0 && (t === !0 ? (window.scrollTo(0, 0), window.visualViewport.addEventListener("resize", nt, qe.passiveCapture), window.visualViewport.addEventListener("scroll", nt, qe.passiveCapture), window.scrollTo(0, 0)) : window.addEventListener("scroll", Yt, qe.passiveCapture));
|
|
916
|
-
}
|
|
917
|
-
xe.is.desktop === !0 && xe.is.mac === !0 && window[`${e}EventListener`]("wheel", Ho, qe.notPassive), e === "remove" && (xe.is.ios === !0 && (t === !0 ? (window.visualViewport.removeEventListener("resize", nt, qe.passiveCapture), window.visualViewport.removeEventListener("scroll", nt, qe.passiveCapture)) : window.removeEventListener("scroll", Yt, qe.passiveCapture)), l.classList.remove("q-body--prevent-scroll"), l.classList.remove("q-body--force-scrollbar-x"), l.classList.remove("q-body--force-scrollbar-y"), document.qScrollPrevented = !1, l.style.left = Ut, l.style.top = Wt, window.location.href === Xt && window.scrollTo(pt, bt), Ue = void 0);
|
|
918
|
-
}
|
|
919
|
-
function Do(e) {
|
|
920
|
-
let l = "add";
|
|
921
|
-
if (e === !0) {
|
|
922
|
-
if (Ne++, Ve !== null) {
|
|
923
|
-
clearTimeout(Ve), Ve = null;
|
|
924
|
-
return;
|
|
925
|
-
}
|
|
926
|
-
if (Ne > 1) return;
|
|
927
|
-
} else {
|
|
928
|
-
if (Ne === 0 || (Ne--, Ne > 0)) return;
|
|
929
|
-
if (l = "remove", xe.is.ios === !0 && xe.is.nativeMobile === !0) {
|
|
930
|
-
Ve !== null && clearTimeout(Ve), Ve = setTimeout(() => {
|
|
931
|
-
Zt(l), Ve = null;
|
|
932
|
-
}, 100);
|
|
933
|
-
return;
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
Zt(l);
|
|
937
|
-
}
|
|
938
|
-
function jo() {
|
|
939
|
-
let e;
|
|
940
|
-
return {
|
|
941
|
-
preventBodyScroll(l) {
|
|
942
|
-
l !== e && (e !== void 0 || l === !0) && (e = l, Do(l));
|
|
943
|
-
}
|
|
944
|
-
};
|
|
945
|
-
}
|
|
946
|
-
let ut = 0;
|
|
947
|
-
const Ko = {
|
|
948
|
-
standard: "fixed-full flex-center",
|
|
949
|
-
top: "fixed-top justify-center",
|
|
950
|
-
bottom: "fixed-bottom justify-center",
|
|
951
|
-
right: "fixed-right items-center",
|
|
952
|
-
left: "fixed-left items-center"
|
|
953
|
-
}, Jt = {
|
|
954
|
-
standard: ["scale", "scale"],
|
|
955
|
-
top: ["slide-down", "slide-up"],
|
|
956
|
-
bottom: ["slide-up", "slide-down"],
|
|
957
|
-
right: ["slide-left", "slide-right"],
|
|
958
|
-
left: ["slide-right", "slide-left"]
|
|
959
|
-
}, No = ye({
|
|
960
|
-
name: "QDialog",
|
|
961
|
-
inheritAttrs: !1,
|
|
962
|
-
props: {
|
|
963
|
-
...so,
|
|
964
|
-
...ro,
|
|
965
|
-
transitionShow: String,
|
|
966
|
-
// override useTransitionProps
|
|
967
|
-
transitionHide: String,
|
|
968
|
-
// override useTransitionProps
|
|
969
|
-
persistent: Boolean,
|
|
970
|
-
autoClose: Boolean,
|
|
971
|
-
allowFocusOutside: Boolean,
|
|
972
|
-
noEscDismiss: Boolean,
|
|
973
|
-
noBackdropDismiss: Boolean,
|
|
974
|
-
noRouteDismiss: Boolean,
|
|
975
|
-
noRefocus: Boolean,
|
|
976
|
-
noFocus: Boolean,
|
|
977
|
-
noShake: Boolean,
|
|
978
|
-
seamless: Boolean,
|
|
979
|
-
maximized: Boolean,
|
|
980
|
-
fullWidth: Boolean,
|
|
981
|
-
fullHeight: Boolean,
|
|
982
|
-
square: Boolean,
|
|
983
|
-
backdropFilter: String,
|
|
984
|
-
position: {
|
|
985
|
-
type: String,
|
|
986
|
-
default: "standard",
|
|
987
|
-
validator: (e) => ["standard", "top", "bottom", "left", "right"].includes(e)
|
|
988
|
-
}
|
|
989
|
-
},
|
|
990
|
-
emits: [
|
|
991
|
-
...ao,
|
|
992
|
-
"shake",
|
|
993
|
-
"click",
|
|
994
|
-
"escapeKey"
|
|
995
|
-
],
|
|
996
|
-
setup(e, { slots: l, emit: t, attrs: n }) {
|
|
997
|
-
const c = se(), u = M(null), a = M(!1), b = M(!1);
|
|
998
|
-
let y = null, _ = null, f, w;
|
|
999
|
-
const k = r(
|
|
1000
|
-
() => e.persistent !== !0 && e.noRouteDismiss !== !0 && e.seamless !== !0
|
|
1001
|
-
), { preventBodyScroll: C } = jo(), { registerTimeout: V } = co(), { registerTick: h, removeTick: v } = fo(), { transitionProps: x, transitionStyle: j } = vo(
|
|
1002
|
-
e,
|
|
1003
|
-
() => Jt[e.position][0],
|
|
1004
|
-
() => Jt[e.position][1]
|
|
1005
|
-
), A = r(() => j.value + (e.backdropFilter !== void 0 ? `;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}` : "")), { showPortal: L, hidePortal: Y, portalIsAccessible: F, renderPortal: $ } = mo(
|
|
1006
|
-
c,
|
|
1007
|
-
u,
|
|
1008
|
-
R,
|
|
1009
|
-
"dialog"
|
|
1010
|
-
), { hide: H } = go({
|
|
1011
|
-
showing: a,
|
|
1012
|
-
hideOnRouteChange: k,
|
|
1013
|
-
handleShow: X,
|
|
1014
|
-
handleHide: ue,
|
|
1015
|
-
processOnMount: !0
|
|
1016
|
-
});
|
|
1017
|
-
$o(a);
|
|
1018
|
-
const le = r(
|
|
1019
|
-
() => `q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized === !0 ? "maximized" : "minimized"} q-dialog__inner--${e.position} ${Ko[e.position]}` + (b.value === !0 ? " q-dialog__inner--animating" : "") + (e.fullWidth === !0 ? " q-dialog__inner--fullwidth" : "") + (e.fullHeight === !0 ? " q-dialog__inner--fullheight" : "") + (e.square === !0 ? " q-dialog__inner--square" : "")
|
|
1020
|
-
), W = r(() => a.value === !0 && e.seamless !== !0), oe = r(() => e.autoClose === !0 ? { onClick: Z } : {}), q = r(() => [
|
|
1021
|
-
`q-dialog fullscreen no-pointer-events q-dialog--${W.value === !0 ? "modal" : "seamless"}`,
|
|
1022
|
-
n.class
|
|
1023
|
-
]);
|
|
1024
|
-
G(() => e.maximized, (S) => {
|
|
1025
|
-
a.value === !0 && B(S);
|
|
1026
|
-
}), G(W, (S) => {
|
|
1027
|
-
C(S), S === !0 ? (yo(m), ho(ce)) : (Pt(m), Ht(ce));
|
|
1028
|
-
});
|
|
1029
|
-
function X(S) {
|
|
1030
|
-
var I;
|
|
1031
|
-
_ = e.noRefocus === !1 && document.activeElement !== null ? document.activeElement : null, B(e.maximized), L(), b.value = !0, e.noFocus !== !0 ? ((I = document.activeElement) == null || I.blur(), h(J)) : v(), V(() => {
|
|
1032
|
-
if (c.proxy.$q.platform.is.ios === !0) {
|
|
1033
|
-
if (e.seamless !== !0 && document.activeElement) {
|
|
1034
|
-
const { top: T, bottom: z } = document.activeElement.getBoundingClientRect(), { innerHeight: K } = window, E = window.visualViewport !== void 0 ? window.visualViewport.height : K;
|
|
1035
|
-
T > 0 && z > E / 2 && (document.scrollingElement.scrollTop = Math.min(
|
|
1036
|
-
document.scrollingElement.scrollHeight - E,
|
|
1037
|
-
z >= K ? 1 / 0 : Math.ceil(document.scrollingElement.scrollTop + z - E / 2)
|
|
1038
|
-
)), document.activeElement.scrollIntoView();
|
|
1039
|
-
}
|
|
1040
|
-
w = !0, u.value.click(), w = !1;
|
|
1041
|
-
}
|
|
1042
|
-
L(!0), b.value = !1, t("show", S);
|
|
1043
|
-
}, e.transitionDuration);
|
|
1044
|
-
}
|
|
1045
|
-
function ue(S) {
|
|
1046
|
-
v(), p(!0), b.value = !0, Y(), _ !== null && ((((S == null ? void 0 : S.type.indexOf("key")) === 0 ? _.closest('[tabindex]:not([tabindex^="-"])') : void 0) || _).focus(), _ = null), V(() => {
|
|
1047
|
-
Y(!0), b.value = !1, t("hide", S);
|
|
1048
|
-
}, e.transitionDuration);
|
|
1049
|
-
}
|
|
1050
|
-
function J(S) {
|
|
1051
|
-
dl(() => {
|
|
1052
|
-
let I = u.value;
|
|
1053
|
-
if (I !== null) {
|
|
1054
|
-
if (S !== void 0) {
|
|
1055
|
-
const T = I.querySelector(S);
|
|
1056
|
-
if (T !== null) {
|
|
1057
|
-
T.focus({ preventScroll: !0 });
|
|
1058
|
-
return;
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
I.contains(document.activeElement) !== !0 && (I = I.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || I.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || I.querySelector("[autofocus], [data-autofocus]") || I, I.focus({ preventScroll: !0 }));
|
|
1062
|
-
}
|
|
1063
|
-
});
|
|
1064
|
-
}
|
|
1065
|
-
function U(S) {
|
|
1066
|
-
S && typeof S.focus == "function" ? S.focus({ preventScroll: !0 }) : J(), t("shake");
|
|
1067
|
-
const I = u.value;
|
|
1068
|
-
I !== null && (I.classList.remove("q-animate--scale"), I.classList.add("q-animate--scale"), y !== null && clearTimeout(y), y = setTimeout(() => {
|
|
1069
|
-
y = null, u.value !== null && (I.classList.remove("q-animate--scale"), J());
|
|
1070
|
-
}, 170));
|
|
1071
|
-
}
|
|
1072
|
-
function ce() {
|
|
1073
|
-
e.seamless !== !0 && (e.persistent === !0 || e.noEscDismiss === !0 ? e.maximized !== !0 && e.noShake !== !0 && U() : (t("escapeKey"), H()));
|
|
1074
|
-
}
|
|
1075
|
-
function p(S) {
|
|
1076
|
-
y !== null && (clearTimeout(y), y = null), (S === !0 || a.value === !0) && (B(!1), e.seamless !== !0 && (C(!1), Pt(m), Ht(ce))), S !== !0 && (_ = null);
|
|
1077
|
-
}
|
|
1078
|
-
function B(S) {
|
|
1079
|
-
S === !0 ? f !== !0 && (ut < 1 && document.body.classList.add("q-body--dialog"), ut++, f = !0) : f === !0 && (ut < 2 && document.body.classList.remove("q-body--dialog"), ut--, f = !1);
|
|
1080
|
-
}
|
|
1081
|
-
function Z(S) {
|
|
1082
|
-
w !== !0 && (H(S), t("click", S));
|
|
1083
|
-
}
|
|
1084
|
-
function i(S) {
|
|
1085
|
-
e.persistent !== !0 && e.noBackdropDismiss !== !0 ? H(S) : e.noShake !== !0 && U();
|
|
1086
|
-
}
|
|
1087
|
-
function m(S) {
|
|
1088
|
-
e.allowFocusOutside !== !0 && F.value === !0 && Zl(u.value, S.target) !== !0 && J('[tabindex]:not([tabindex="-1"])');
|
|
1089
|
-
}
|
|
1090
|
-
Object.assign(c.proxy, {
|
|
1091
|
-
// expose public methods
|
|
1092
|
-
focus: J,
|
|
1093
|
-
shake: U,
|
|
1094
|
-
// private but needed by QSelect
|
|
1095
|
-
__updateRefocusTarget(S) {
|
|
1096
|
-
_ = S || null;
|
|
1097
|
-
}
|
|
1098
|
-
}), Ae(p);
|
|
1099
|
-
function R() {
|
|
1100
|
-
return s("div", {
|
|
1101
|
-
role: "dialog",
|
|
1102
|
-
"aria-modal": W.value === !0 ? "true" : "false",
|
|
1103
|
-
...n,
|
|
1104
|
-
class: q.value
|
|
1105
|
-
}, [
|
|
1106
|
-
s(Ct, {
|
|
1107
|
-
name: "q-transition--fade",
|
|
1108
|
-
appear: !0
|
|
1109
|
-
}, () => W.value === !0 ? s("div", {
|
|
1110
|
-
class: "q-dialog__backdrop fixed-full",
|
|
1111
|
-
style: A.value,
|
|
1112
|
-
"aria-hidden": "true",
|
|
1113
|
-
tabindex: -1,
|
|
1114
|
-
onClick: i
|
|
1115
|
-
}) : null),
|
|
1116
|
-
s(
|
|
1117
|
-
Ct,
|
|
1118
|
-
x.value,
|
|
1119
|
-
() => a.value === !0 ? s("div", {
|
|
1120
|
-
ref: u,
|
|
1121
|
-
class: le.value,
|
|
1122
|
-
style: j.value,
|
|
1123
|
-
tabindex: -1,
|
|
1124
|
-
...oe.value
|
|
1125
|
-
}, be(l.default)) : null
|
|
1126
|
-
)
|
|
1127
|
-
]);
|
|
1128
|
-
}
|
|
1129
|
-
return $;
|
|
1130
|
-
}
|
|
1131
|
-
});
|
|
1132
|
-
let at = !1;
|
|
1133
|
-
{
|
|
1134
|
-
const e = document.createElement("div");
|
|
1135
|
-
e.setAttribute("dir", "rtl"), Object.assign(e.style, {
|
|
1136
|
-
width: "1px",
|
|
1137
|
-
height: "1px",
|
|
1138
|
-
overflow: "auto"
|
|
1139
|
-
});
|
|
1140
|
-
const l = document.createElement("div");
|
|
1141
|
-
Object.assign(l.style, {
|
|
1142
|
-
width: "1000px",
|
|
1143
|
-
height: "1px"
|
|
1144
|
-
}), document.body.appendChild(e), e.appendChild(l), e.scrollLeft = -1e3, at = e.scrollLeft >= 0, e.remove();
|
|
1145
|
-
}
|
|
1146
|
-
const re = 1e3, Qo = [
|
|
1147
|
-
"start",
|
|
1148
|
-
"center",
|
|
1149
|
-
"end",
|
|
1150
|
-
"start-force",
|
|
1151
|
-
"center-force",
|
|
1152
|
-
"end-force"
|
|
1153
|
-
], yl = Array.prototype.filter, Uo = window.getComputedStyle(document.body).overflowAnchor === void 0 ? Jl : function(e, l) {
|
|
1154
|
-
e !== null && (e._qOverflowAnimationFrame !== void 0 && cancelAnimationFrame(e._qOverflowAnimationFrame), e._qOverflowAnimationFrame = requestAnimationFrame(() => {
|
|
1155
|
-
if (e === null) return;
|
|
1156
|
-
e._qOverflowAnimationFrame = void 0;
|
|
1157
|
-
const t = e.children || [];
|
|
1158
|
-
yl.call(t, (c) => c.dataset && c.dataset.qVsAnchor !== void 0).forEach((c) => {
|
|
1159
|
-
delete c.dataset.qVsAnchor;
|
|
1160
|
-
});
|
|
1161
|
-
const n = t[l];
|
|
1162
|
-
n != null && n.dataset && (n.dataset.qVsAnchor = "");
|
|
1163
|
-
}));
|
|
1164
|
-
};
|
|
1165
|
-
function $e(e, l) {
|
|
1166
|
-
return e + l;
|
|
1167
|
-
}
|
|
1168
|
-
function St(e, l, t, n, c, u, a, b) {
|
|
1169
|
-
const y = e === window ? document.scrollingElement || document.documentElement : e, _ = c === !0 ? "offsetWidth" : "offsetHeight", f = {
|
|
1170
|
-
scrollStart: 0,
|
|
1171
|
-
scrollViewSize: -a - b,
|
|
1172
|
-
scrollMaxSize: 0,
|
|
1173
|
-
offsetStart: -a,
|
|
1174
|
-
offsetEnd: -b
|
|
1175
|
-
};
|
|
1176
|
-
if (c === !0 ? (e === window ? (f.scrollStart = window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, f.scrollViewSize += document.documentElement.clientWidth) : (f.scrollStart = y.scrollLeft, f.scrollViewSize += y.clientWidth), f.scrollMaxSize = y.scrollWidth, u === !0 && (f.scrollStart = (at === !0 ? f.scrollMaxSize - f.scrollViewSize : 0) - f.scrollStart)) : (e === window ? (f.scrollStart = window.pageYOffset || window.scrollY || document.body.scrollTop || 0, f.scrollViewSize += document.documentElement.clientHeight) : (f.scrollStart = y.scrollTop, f.scrollViewSize += y.clientHeight), f.scrollMaxSize = y.scrollHeight), t !== null)
|
|
1177
|
-
for (let w = t.previousElementSibling; w !== null; w = w.previousElementSibling)
|
|
1178
|
-
w.classList.contains("q-virtual-scroll--skip") === !1 && (f.offsetStart += w[_]);
|
|
1179
|
-
if (n !== null)
|
|
1180
|
-
for (let w = n.nextElementSibling; w !== null; w = w.nextElementSibling)
|
|
1181
|
-
w.classList.contains("q-virtual-scroll--skip") === !1 && (f.offsetEnd += w[_]);
|
|
1182
|
-
if (l !== e) {
|
|
1183
|
-
const w = y.getBoundingClientRect(), k = l.getBoundingClientRect();
|
|
1184
|
-
c === !0 ? (f.offsetStart += k.left - w.left, f.offsetEnd -= k.width) : (f.offsetStart += k.top - w.top, f.offsetEnd -= k.height), e !== window && (f.offsetStart += f.scrollStart), f.offsetEnd += f.scrollMaxSize - f.offsetStart;
|
|
1185
|
-
}
|
|
1186
|
-
return f;
|
|
1187
|
-
}
|
|
1188
|
-
function Gt(e, l, t, n) {
|
|
1189
|
-
l === "end" && (l = (e === window ? document.body : e)[t === !0 ? "scrollWidth" : "scrollHeight"]), e === window ? t === !0 ? (n === !0 && (l = (at === !0 ? document.body.scrollWidth - document.documentElement.clientWidth : 0) - l), window.scrollTo(l, window.pageYOffset || window.scrollY || document.body.scrollTop || 0)) : window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, l) : t === !0 ? (n === !0 && (l = (at === !0 ? e.scrollWidth - e.offsetWidth : 0) - l), e.scrollLeft = l) : e.scrollTop = l;
|
|
1190
|
-
}
|
|
1191
|
-
function Qe(e, l, t, n) {
|
|
1192
|
-
if (t >= n)
|
|
1193
|
-
return 0;
|
|
1194
|
-
const c = l.length, u = Math.floor(t / re), a = Math.floor((n - 1) / re) + 1;
|
|
1195
|
-
let b = e.slice(u, a).reduce($e, 0);
|
|
1196
|
-
return t % re !== 0 && (b -= l.slice(u * re, t).reduce($e, 0)), n % re !== 0 && n !== c && (b -= l.slice(n, a * re).reduce($e, 0)), b;
|
|
1197
|
-
}
|
|
1198
|
-
const Wo = {
|
|
1199
|
-
virtualScrollSliceSize: {
|
|
1200
|
-
type: [Number, String],
|
|
1201
|
-
default: 10
|
|
1202
|
-
},
|
|
1203
|
-
virtualScrollSliceRatioBefore: {
|
|
1204
|
-
type: [Number, String],
|
|
1205
|
-
default: 1
|
|
1206
|
-
},
|
|
1207
|
-
virtualScrollSliceRatioAfter: {
|
|
1208
|
-
type: [Number, String],
|
|
1209
|
-
default: 1
|
|
1210
|
-
},
|
|
1211
|
-
virtualScrollItemSize: {
|
|
1212
|
-
type: [Number, String],
|
|
1213
|
-
default: 24
|
|
1214
|
-
},
|
|
1215
|
-
virtualScrollStickySizeStart: {
|
|
1216
|
-
type: [Number, String],
|
|
1217
|
-
default: 0
|
|
1218
|
-
},
|
|
1219
|
-
virtualScrollStickySizeEnd: {
|
|
1220
|
-
type: [Number, String],
|
|
1221
|
-
default: 0
|
|
1222
|
-
},
|
|
1223
|
-
tableColspan: [Number, String]
|
|
1224
|
-
}, el = {
|
|
1225
|
-
virtualScrollHorizontal: Boolean,
|
|
1226
|
-
onVirtualScroll: Function,
|
|
1227
|
-
...Wo
|
|
1228
|
-
};
|
|
1229
|
-
function Xo({
|
|
1230
|
-
virtualScrollLength: e,
|
|
1231
|
-
getVirtualScrollTarget: l,
|
|
1232
|
-
getVirtualScrollEl: t,
|
|
1233
|
-
virtualScrollItemSizeComputed: n
|
|
1234
|
-
// optional
|
|
1235
|
-
}) {
|
|
1236
|
-
const c = se(), { props: u, emit: a, proxy: b } = c, { $q: y } = b;
|
|
1237
|
-
let _, f, w, k = [], C;
|
|
1238
|
-
const V = M(0), h = M(0), v = M({}), x = M(null), j = M(null), A = M(null), L = M({ from: 0, to: 0 }), Y = r(() => u.tableColspan !== void 0 ? u.tableColspan : 100);
|
|
1239
|
-
n === void 0 && (n = r(() => u.virtualScrollItemSize));
|
|
1240
|
-
const F = r(() => n.value + ";" + u.virtualScrollHorizontal), $ = r(
|
|
1241
|
-
() => F.value + ";" + u.virtualScrollSliceRatioBefore + ";" + u.virtualScrollSliceRatioAfter
|
|
1242
|
-
);
|
|
1243
|
-
G($, () => {
|
|
1244
|
-
U();
|
|
1245
|
-
}), G(F, H);
|
|
1246
|
-
function H() {
|
|
1247
|
-
J(f, !0);
|
|
1248
|
-
}
|
|
1249
|
-
function le(i) {
|
|
1250
|
-
J(i === void 0 ? f : i);
|
|
1251
|
-
}
|
|
1252
|
-
function W(i, m) {
|
|
1253
|
-
const R = l();
|
|
1254
|
-
if (R == null || R.nodeType === 8) return;
|
|
1255
|
-
const S = St(
|
|
1256
|
-
R,
|
|
1257
|
-
t(),
|
|
1258
|
-
x.value,
|
|
1259
|
-
j.value,
|
|
1260
|
-
u.virtualScrollHorizontal,
|
|
1261
|
-
y.lang.rtl,
|
|
1262
|
-
u.virtualScrollStickySizeStart,
|
|
1263
|
-
u.virtualScrollStickySizeEnd
|
|
1264
|
-
);
|
|
1265
|
-
w !== S.scrollViewSize && U(S.scrollViewSize), q(
|
|
1266
|
-
R,
|
|
1267
|
-
S,
|
|
1268
|
-
Math.min(e.value - 1, Math.max(0, parseInt(i, 10) || 0)),
|
|
1269
|
-
0,
|
|
1270
|
-
Qo.indexOf(m) !== -1 ? m : f !== -1 && i > f ? "end" : "start"
|
|
1271
|
-
);
|
|
1272
|
-
}
|
|
1273
|
-
function oe() {
|
|
1274
|
-
const i = l();
|
|
1275
|
-
if (i == null || i.nodeType === 8) return;
|
|
1276
|
-
const m = St(
|
|
1277
|
-
i,
|
|
1278
|
-
t(),
|
|
1279
|
-
x.value,
|
|
1280
|
-
j.value,
|
|
1281
|
-
u.virtualScrollHorizontal,
|
|
1282
|
-
y.lang.rtl,
|
|
1283
|
-
u.virtualScrollStickySizeStart,
|
|
1284
|
-
u.virtualScrollStickySizeEnd
|
|
1285
|
-
), R = e.value - 1, S = m.scrollMaxSize - m.offsetStart - m.offsetEnd - h.value;
|
|
1286
|
-
if (_ === m.scrollStart) return;
|
|
1287
|
-
if (m.scrollMaxSize <= 0) {
|
|
1288
|
-
q(i, m, 0, 0);
|
|
1289
|
-
return;
|
|
1290
|
-
}
|
|
1291
|
-
w !== m.scrollViewSize && U(m.scrollViewSize), X(L.value.from);
|
|
1292
|
-
const I = Math.floor(m.scrollMaxSize - Math.max(m.scrollViewSize, m.offsetEnd) - Math.min(C[R], m.scrollViewSize / 2));
|
|
1293
|
-
if (I > 0 && Math.ceil(m.scrollStart) >= I) {
|
|
1294
|
-
q(
|
|
1295
|
-
i,
|
|
1296
|
-
m,
|
|
1297
|
-
R,
|
|
1298
|
-
m.scrollMaxSize - m.offsetEnd - k.reduce($e, 0)
|
|
1299
|
-
);
|
|
1300
|
-
return;
|
|
1301
|
-
}
|
|
1302
|
-
let T = 0, z = m.scrollStart - m.offsetStart, K = z;
|
|
1303
|
-
if (z <= S && z + m.scrollViewSize >= V.value)
|
|
1304
|
-
z -= V.value, T = L.value.from, K = z;
|
|
1305
|
-
else
|
|
1306
|
-
for (let E = 0; z >= k[E] && T < R; E++)
|
|
1307
|
-
z -= k[E], T += re;
|
|
1308
|
-
for (; z > 0 && T < R; )
|
|
1309
|
-
z -= C[T], z > -m.scrollViewSize ? (T++, K = z) : K = C[T] + z;
|
|
1310
|
-
q(
|
|
1311
|
-
i,
|
|
1312
|
-
m,
|
|
1313
|
-
T,
|
|
1314
|
-
K
|
|
1315
|
-
);
|
|
1316
|
-
}
|
|
1317
|
-
function q(i, m, R, S, I) {
|
|
1318
|
-
const T = typeof I == "string" && I.indexOf("-force") !== -1, z = T === !0 ? I.replace("-force", "") : I, K = z !== void 0 ? z : "start";
|
|
1319
|
-
let E = Math.max(0, R - v.value[K]), ee = E + v.value.total;
|
|
1320
|
-
ee > e.value && (ee = e.value, E = Math.max(0, ee - v.value.total)), _ = m.scrollStart;
|
|
1321
|
-
const me = E !== L.value.from || ee !== L.value.to;
|
|
1322
|
-
if (me === !1 && z === void 0) {
|
|
1323
|
-
p(R);
|
|
1324
|
-
return;
|
|
1325
|
-
}
|
|
1326
|
-
const { activeElement: We } = document, ie = A.value;
|
|
1327
|
-
me === !0 && ie !== null && ie !== We && ie.contains(We) === !0 && (ie.addEventListener("focusout", ue), setTimeout(() => {
|
|
1328
|
-
ie == null || ie.removeEventListener("focusout", ue);
|
|
1329
|
-
})), Uo(ie, R - E);
|
|
1330
|
-
const Xe = z !== void 0 ? C.slice(E, R).reduce($e, 0) : 0;
|
|
1331
|
-
if (me === !0) {
|
|
1332
|
-
const Se = ee >= L.value.from && E <= L.value.to ? L.value.to : ee;
|
|
1333
|
-
L.value = { from: E, to: Se }, V.value = Qe(k, C, 0, E), h.value = Qe(k, C, ee, e.value), requestAnimationFrame(() => {
|
|
1334
|
-
L.value.to !== ee && _ === m.scrollStart && (L.value = { from: L.value.from, to: ee }, h.value = Qe(k, C, ee, e.value));
|
|
1335
|
-
});
|
|
1336
|
-
}
|
|
1337
|
-
requestAnimationFrame(() => {
|
|
1338
|
-
if (_ !== m.scrollStart) return;
|
|
1339
|
-
me === !0 && X(E);
|
|
1340
|
-
const Se = C.slice(E, R).reduce($e, 0), we = Se + m.offsetStart + V.value, Ye = we + C[R];
|
|
1341
|
-
let He = we + S;
|
|
1342
|
-
if (z !== void 0) {
|
|
1343
|
-
const ct = Se - Xe, Pe = m.scrollStart + ct;
|
|
1344
|
-
He = T !== !0 && Pe < we && Ye < Pe + m.scrollViewSize ? Pe : z === "end" ? Ye - m.scrollViewSize : we - (z === "start" ? 0 : Math.round((m.scrollViewSize - C[R]) / 2));
|
|
1345
|
-
}
|
|
1346
|
-
_ = He, Gt(
|
|
1347
|
-
i,
|
|
1348
|
-
He,
|
|
1349
|
-
u.virtualScrollHorizontal,
|
|
1350
|
-
y.lang.rtl
|
|
1351
|
-
), p(R);
|
|
1352
|
-
});
|
|
1353
|
-
}
|
|
1354
|
-
function X(i) {
|
|
1355
|
-
const m = A.value;
|
|
1356
|
-
if (m) {
|
|
1357
|
-
const R = yl.call(
|
|
1358
|
-
m.children,
|
|
1359
|
-
(E) => E.classList && E.classList.contains("q-virtual-scroll--skip") === !1
|
|
1360
|
-
), S = R.length, I = u.virtualScrollHorizontal === !0 ? (E) => E.getBoundingClientRect().width : (E) => E.offsetHeight;
|
|
1361
|
-
let T = i, z, K;
|
|
1362
|
-
for (let E = 0; E < S; ) {
|
|
1363
|
-
for (z = I(R[E]), E++; E < S && R[E].classList.contains("q-virtual-scroll--with-prev") === !0; )
|
|
1364
|
-
z += I(R[E]), E++;
|
|
1365
|
-
K = z - C[T], K !== 0 && (C[T] += K, k[Math.floor(T / re)] += K), T++;
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
function ue() {
|
|
1370
|
-
var i;
|
|
1371
|
-
(i = A.value) == null || i.focus();
|
|
1372
|
-
}
|
|
1373
|
-
function J(i, m) {
|
|
1374
|
-
const R = 1 * n.value;
|
|
1375
|
-
(m === !0 || Array.isArray(C) === !1) && (C = []);
|
|
1376
|
-
const S = C.length;
|
|
1377
|
-
C.length = e.value;
|
|
1378
|
-
for (let T = e.value - 1; T >= S; T--)
|
|
1379
|
-
C[T] = R;
|
|
1380
|
-
const I = Math.floor((e.value - 1) / re);
|
|
1381
|
-
k = [];
|
|
1382
|
-
for (let T = 0; T <= I; T++) {
|
|
1383
|
-
let z = 0;
|
|
1384
|
-
const K = Math.min((T + 1) * re, e.value);
|
|
1385
|
-
for (let E = T * re; E < K; E++)
|
|
1386
|
-
z += C[E];
|
|
1387
|
-
k.push(z);
|
|
1388
|
-
}
|
|
1389
|
-
f = -1, _ = void 0, V.value = Qe(k, C, 0, L.value.from), h.value = Qe(k, C, L.value.to, e.value), i >= 0 ? (X(L.value.from), ve(() => {
|
|
1390
|
-
W(i);
|
|
1391
|
-
})) : B();
|
|
1392
|
-
}
|
|
1393
|
-
function U(i) {
|
|
1394
|
-
if (i === void 0 && typeof window < "u") {
|
|
1395
|
-
const z = l();
|
|
1396
|
-
z != null && z.nodeType !== 8 && (i = St(
|
|
1397
|
-
z,
|
|
1398
|
-
t(),
|
|
1399
|
-
x.value,
|
|
1400
|
-
j.value,
|
|
1401
|
-
u.virtualScrollHorizontal,
|
|
1402
|
-
y.lang.rtl,
|
|
1403
|
-
u.virtualScrollStickySizeStart,
|
|
1404
|
-
u.virtualScrollStickySizeEnd
|
|
1405
|
-
).scrollViewSize);
|
|
1406
|
-
}
|
|
1407
|
-
w = i;
|
|
1408
|
-
const m = parseFloat(u.virtualScrollSliceRatioBefore) || 0, R = parseFloat(u.virtualScrollSliceRatioAfter) || 0, S = 1 + m + R, I = i === void 0 || i <= 0 ? 1 : Math.ceil(i / n.value), T = Math.max(
|
|
1409
|
-
1,
|
|
1410
|
-
I,
|
|
1411
|
-
Math.ceil((u.virtualScrollSliceSize > 0 ? u.virtualScrollSliceSize : 10) / S)
|
|
1412
|
-
);
|
|
1413
|
-
v.value = {
|
|
1414
|
-
total: Math.ceil(T * S),
|
|
1415
|
-
start: Math.ceil(T * m),
|
|
1416
|
-
center: Math.ceil(T * (0.5 + m)),
|
|
1417
|
-
end: Math.ceil(T * (1 + m)),
|
|
1418
|
-
view: I
|
|
1419
|
-
};
|
|
1420
|
-
}
|
|
1421
|
-
function ce(i, m) {
|
|
1422
|
-
const R = u.virtualScrollHorizontal === !0 ? "width" : "height", S = {
|
|
1423
|
-
["--q-virtual-scroll-item-" + R]: n.value + "px"
|
|
1424
|
-
};
|
|
1425
|
-
return [
|
|
1426
|
-
i === "tbody" ? s(i, {
|
|
1427
|
-
class: "q-virtual-scroll__padding",
|
|
1428
|
-
key: "before",
|
|
1429
|
-
ref: x
|
|
1430
|
-
}, [
|
|
1431
|
-
s("tr", [
|
|
1432
|
-
s("td", {
|
|
1433
|
-
style: { [R]: `${V.value}px`, ...S },
|
|
1434
|
-
colspan: Y.value
|
|
1435
|
-
})
|
|
1436
|
-
])
|
|
1437
|
-
]) : s(i, {
|
|
1438
|
-
class: "q-virtual-scroll__padding",
|
|
1439
|
-
key: "before",
|
|
1440
|
-
ref: x,
|
|
1441
|
-
style: { [R]: `${V.value}px`, ...S }
|
|
1442
|
-
}),
|
|
1443
|
-
s(i, {
|
|
1444
|
-
class: "q-virtual-scroll__content",
|
|
1445
|
-
key: "content",
|
|
1446
|
-
ref: A,
|
|
1447
|
-
tabindex: -1
|
|
1448
|
-
}, m.flat()),
|
|
1449
|
-
i === "tbody" ? s(i, {
|
|
1450
|
-
class: "q-virtual-scroll__padding",
|
|
1451
|
-
key: "after",
|
|
1452
|
-
ref: j
|
|
1453
|
-
}, [
|
|
1454
|
-
s("tr", [
|
|
1455
|
-
s("td", {
|
|
1456
|
-
style: { [R]: `${h.value}px`, ...S },
|
|
1457
|
-
colspan: Y.value
|
|
1458
|
-
})
|
|
1459
|
-
])
|
|
1460
|
-
]) : s(i, {
|
|
1461
|
-
class: "q-virtual-scroll__padding",
|
|
1462
|
-
key: "after",
|
|
1463
|
-
ref: j,
|
|
1464
|
-
style: { [R]: `${h.value}px`, ...S }
|
|
1465
|
-
})
|
|
1466
|
-
];
|
|
1467
|
-
}
|
|
1468
|
-
function p(i) {
|
|
1469
|
-
f !== i && (u.onVirtualScroll !== void 0 && a("virtualScroll", {
|
|
1470
|
-
index: i,
|
|
1471
|
-
from: L.value.from,
|
|
1472
|
-
to: L.value.to - 1,
|
|
1473
|
-
direction: i < f ? "decrease" : "increase",
|
|
1474
|
-
ref: b
|
|
1475
|
-
}), f = i);
|
|
1476
|
-
}
|
|
1477
|
-
U();
|
|
1478
|
-
const B = gl(
|
|
1479
|
-
oe,
|
|
1480
|
-
y.platform.is.ios === !0 ? 120 : 35
|
|
1481
|
-
);
|
|
1482
|
-
Ml(() => {
|
|
1483
|
-
U();
|
|
1484
|
-
});
|
|
1485
|
-
let Z = !1;
|
|
1486
|
-
return ul(() => {
|
|
1487
|
-
Z = !0;
|
|
1488
|
-
}), il(() => {
|
|
1489
|
-
if (Z !== !0) return;
|
|
1490
|
-
const i = l();
|
|
1491
|
-
_ !== void 0 && i !== void 0 && i !== null && i.nodeType !== 8 ? Gt(
|
|
1492
|
-
i,
|
|
1493
|
-
_,
|
|
1494
|
-
u.virtualScrollHorizontal,
|
|
1495
|
-
y.lang.rtl
|
|
1496
|
-
) : W(f);
|
|
1497
|
-
}), Ae(() => {
|
|
1498
|
-
B.cancel();
|
|
1499
|
-
}), Object.assign(b, { scrollTo: W, reset: H, refresh: le }), {
|
|
1500
|
-
virtualScrollSliceRange: L,
|
|
1501
|
-
virtualScrollSliceSizeComputed: v,
|
|
1502
|
-
setVirtualScrollSize: U,
|
|
1503
|
-
onVirtualScrollEvt: B,
|
|
1504
|
-
localResetVirtualScroll: J,
|
|
1505
|
-
padVirtualScroll: ce,
|
|
1506
|
-
scrollTo: W,
|
|
1507
|
-
reset: H,
|
|
1508
|
-
refresh: le
|
|
1509
|
-
};
|
|
1510
|
-
}
|
|
1511
|
-
const Yo = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/, Zo = /[\u4e00-\u9fff\u3400-\u4dbf\u{20000}-\u{2a6df}\u{2a700}-\u{2b73f}\u{2b740}-\u{2b81f}\u{2b820}-\u{2ceaf}\uf900-\ufaff\u3300-\u33ff\ufe30-\ufe4f\uf900-\ufaff\u{2f800}-\u{2fa1f}]/u, Jo = /[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/, Go = /[a-z0-9_ -]$/i;
|
|
1512
|
-
function en(e) {
|
|
1513
|
-
return function(t) {
|
|
1514
|
-
if (t.type === "compositionend" || t.type === "change") {
|
|
1515
|
-
if (t.target.qComposing !== !0) return;
|
|
1516
|
-
t.target.qComposing = !1, e(t);
|
|
1517
|
-
} else t.type === "compositionupdate" && t.target.qComposing !== !0 && typeof t.data == "string" && (xe.is.firefox === !0 ? Go.test(t.data) === !1 : Yo.test(t.data) === !0 || Zo.test(t.data) === !0 || Jo.test(t.data) === !0) === !0 && (t.target.qComposing = !0);
|
|
1518
|
-
};
|
|
1519
|
-
}
|
|
1520
|
-
function pe(e, l) {
|
|
1521
|
-
if (e === l)
|
|
1522
|
-
return !0;
|
|
1523
|
-
if (e !== null && l !== null && typeof e == "object" && typeof l == "object") {
|
|
1524
|
-
if (e.constructor !== l.constructor)
|
|
1525
|
-
return !1;
|
|
1526
|
-
let t, n;
|
|
1527
|
-
if (e.constructor === Array) {
|
|
1528
|
-
if (t = e.length, t !== l.length)
|
|
1529
|
-
return !1;
|
|
1530
|
-
for (n = t; n-- !== 0; )
|
|
1531
|
-
if (pe(e[n], l[n]) !== !0)
|
|
1532
|
-
return !1;
|
|
1533
|
-
return !0;
|
|
1534
|
-
}
|
|
1535
|
-
if (e.constructor === Map) {
|
|
1536
|
-
if (e.size !== l.size)
|
|
1537
|
-
return !1;
|
|
1538
|
-
let u = e.entries();
|
|
1539
|
-
for (n = u.next(); n.done !== !0; ) {
|
|
1540
|
-
if (l.has(n.value[0]) !== !0)
|
|
1541
|
-
return !1;
|
|
1542
|
-
n = u.next();
|
|
1543
|
-
}
|
|
1544
|
-
for (u = e.entries(), n = u.next(); n.done !== !0; ) {
|
|
1545
|
-
if (pe(n.value[1], l.get(n.value[0])) !== !0)
|
|
1546
|
-
return !1;
|
|
1547
|
-
n = u.next();
|
|
1548
|
-
}
|
|
1549
|
-
return !0;
|
|
1550
|
-
}
|
|
1551
|
-
if (e.constructor === Set) {
|
|
1552
|
-
if (e.size !== l.size)
|
|
1553
|
-
return !1;
|
|
1554
|
-
const u = e.entries();
|
|
1555
|
-
for (n = u.next(); n.done !== !0; ) {
|
|
1556
|
-
if (l.has(n.value[0]) !== !0)
|
|
1557
|
-
return !1;
|
|
1558
|
-
n = u.next();
|
|
1559
|
-
}
|
|
1560
|
-
return !0;
|
|
1561
|
-
}
|
|
1562
|
-
if (e.buffer != null && e.buffer.constructor === ArrayBuffer) {
|
|
1563
|
-
if (t = e.length, t !== l.length)
|
|
1564
|
-
return !1;
|
|
1565
|
-
for (n = t; n-- !== 0; )
|
|
1566
|
-
if (e[n] !== l[n])
|
|
1567
|
-
return !1;
|
|
1568
|
-
return !0;
|
|
1569
|
-
}
|
|
1570
|
-
if (e.constructor === RegExp)
|
|
1571
|
-
return e.source === l.source && e.flags === l.flags;
|
|
1572
|
-
if (e.valueOf !== Object.prototype.valueOf)
|
|
1573
|
-
return e.valueOf() === l.valueOf();
|
|
1574
|
-
if (e.toString !== Object.prototype.toString)
|
|
1575
|
-
return e.toString() === l.toString();
|
|
1576
|
-
const c = Object.keys(e).filter((u) => e[u] !== void 0);
|
|
1577
|
-
if (t = c.length, t !== Object.keys(l).filter((u) => l[u] !== void 0).length)
|
|
1578
|
-
return !1;
|
|
1579
|
-
for (n = t; n-- !== 0; ) {
|
|
1580
|
-
const u = c[n];
|
|
1581
|
-
if (pe(e[u], l[u]) !== !0)
|
|
1582
|
-
return !1;
|
|
1583
|
-
}
|
|
1584
|
-
return !0;
|
|
1585
|
-
}
|
|
1586
|
-
return e !== e && l !== l;
|
|
1587
|
-
}
|
|
1588
|
-
function tl(e, l, t) {
|
|
1589
|
-
if (t <= l)
|
|
1590
|
-
return l;
|
|
1591
|
-
const n = t - l + 1;
|
|
1592
|
-
let c = l + (e - l) % n;
|
|
1593
|
-
return c < l && (c = n + c), c === 0 ? 0 : c;
|
|
1594
|
-
}
|
|
1595
|
-
const ll = (e) => ["add", "add-unique", "toggle"].includes(e), tn = ".*+?^${}()|[]\\", ln = Object.keys(qt);
|
|
1596
|
-
function wt(e, l) {
|
|
1597
|
-
if (typeof e == "function") return e;
|
|
1598
|
-
const t = e !== void 0 ? e : l;
|
|
1599
|
-
return (n) => n !== null && typeof n == "object" && t in n ? n[t] : n;
|
|
1600
|
-
}
|
|
1601
|
-
const on = ye({
|
|
1602
|
-
name: "QSelect",
|
|
1603
|
-
inheritAttrs: !1,
|
|
1604
|
-
props: {
|
|
1605
|
-
...el,
|
|
1606
|
-
...fl,
|
|
1607
|
-
...qt,
|
|
1608
|
-
// override of useFieldProps > modelValue
|
|
1609
|
-
modelValue: {
|
|
1610
|
-
required: !0
|
|
1611
|
-
},
|
|
1612
|
-
multiple: Boolean,
|
|
1613
|
-
displayValue: [String, Number],
|
|
1614
|
-
displayValueHtml: Boolean,
|
|
1615
|
-
dropdownIcon: String,
|
|
1616
|
-
options: {
|
|
1617
|
-
type: Array,
|
|
1618
|
-
default: () => []
|
|
1619
|
-
},
|
|
1620
|
-
optionValue: [Function, String],
|
|
1621
|
-
optionLabel: [Function, String],
|
|
1622
|
-
optionDisable: [Function, String],
|
|
1623
|
-
hideSelected: Boolean,
|
|
1624
|
-
hideDropdownIcon: Boolean,
|
|
1625
|
-
fillInput: Boolean,
|
|
1626
|
-
maxValues: [Number, String],
|
|
1627
|
-
optionsDense: Boolean,
|
|
1628
|
-
optionsDark: {
|
|
1629
|
-
type: Boolean,
|
|
1630
|
-
default: null
|
|
1631
|
-
},
|
|
1632
|
-
optionsSelectedClass: String,
|
|
1633
|
-
optionsHtml: Boolean,
|
|
1634
|
-
optionsCover: Boolean,
|
|
1635
|
-
menuShrink: Boolean,
|
|
1636
|
-
menuAnchor: String,
|
|
1637
|
-
menuSelf: String,
|
|
1638
|
-
menuOffset: Array,
|
|
1639
|
-
popupContentClass: String,
|
|
1640
|
-
popupContentStyle: [String, Array, Object],
|
|
1641
|
-
popupNoRouteDismiss: Boolean,
|
|
1642
|
-
useInput: Boolean,
|
|
1643
|
-
useChips: Boolean,
|
|
1644
|
-
newValueMode: {
|
|
1645
|
-
type: String,
|
|
1646
|
-
validator: ll
|
|
1647
|
-
},
|
|
1648
|
-
mapOptions: Boolean,
|
|
1649
|
-
emitValue: Boolean,
|
|
1650
|
-
disableTabSelection: Boolean,
|
|
1651
|
-
inputDebounce: {
|
|
1652
|
-
type: [Number, String],
|
|
1653
|
-
default: 500
|
|
1654
|
-
},
|
|
1655
|
-
inputClass: [Array, String, Object],
|
|
1656
|
-
inputStyle: [Array, String, Object],
|
|
1657
|
-
tabindex: {
|
|
1658
|
-
type: [String, Number],
|
|
1659
|
-
default: 0
|
|
1660
|
-
},
|
|
1661
|
-
autocomplete: String,
|
|
1662
|
-
transitionShow: {},
|
|
1663
|
-
transitionHide: {},
|
|
1664
|
-
transitionDuration: {},
|
|
1665
|
-
behavior: {
|
|
1666
|
-
type: String,
|
|
1667
|
-
validator: (e) => ["default", "menu", "dialog"].includes(e),
|
|
1668
|
-
default: "default"
|
|
1669
|
-
},
|
|
1670
|
-
// override of useVirtualScrollProps > virtualScrollItemSize (no default)
|
|
1671
|
-
virtualScrollItemSize: el.virtualScrollItemSize.type,
|
|
1672
|
-
onNewValue: Function,
|
|
1673
|
-
onFilter: Function
|
|
1674
|
-
},
|
|
1675
|
-
emits: [
|
|
1676
|
-
...hl,
|
|
1677
|
-
"add",
|
|
1678
|
-
"remove",
|
|
1679
|
-
"inputValue",
|
|
1680
|
-
"keyup",
|
|
1681
|
-
"keypress",
|
|
1682
|
-
"keydown",
|
|
1683
|
-
"popupShow",
|
|
1684
|
-
"popupHide",
|
|
1685
|
-
"filterAbort"
|
|
1686
|
-
],
|
|
1687
|
-
setup(e, { slots: l, emit: t }) {
|
|
1688
|
-
const { proxy: n } = se(), { $q: c } = n, u = M(!1), a = M(!1), b = M(-1), y = M(""), _ = M(!1), f = M(!1);
|
|
1689
|
-
let w = null, k = null, C, V, h, v = null, x, j, A, L;
|
|
1690
|
-
const Y = M(null), F = M(null), $ = M(null), H = M(null), le = M(null), W = Co(e), oe = en(It), q = r(() => Array.isArray(e.options) ? e.options.length : 0), X = r(() => e.virtualScrollItemSize === void 0 ? e.optionsDense === !0 ? 24 : 48 : e.virtualScrollItemSize), {
|
|
1691
|
-
virtualScrollSliceRange: ue,
|
|
1692
|
-
virtualScrollSliceSizeComputed: J,
|
|
1693
|
-
localResetVirtualScroll: U,
|
|
1694
|
-
padVirtualScroll: ce,
|
|
1695
|
-
onVirtualScrollEvt: p,
|
|
1696
|
-
scrollTo: B,
|
|
1697
|
-
setVirtualScrollSize: Z
|
|
1698
|
-
} = Xo({
|
|
1699
|
-
virtualScrollLength: q,
|
|
1700
|
-
getVirtualScrollTarget: kl,
|
|
1701
|
-
getVirtualScrollEl: Rt,
|
|
1702
|
-
virtualScrollItemSizeComputed: X
|
|
1703
|
-
}), i = pl(), m = r(() => {
|
|
1704
|
-
const o = e.mapOptions === !0 && e.multiple !== !0, d = e.modelValue !== void 0 && (e.modelValue !== null || o === !0) ? e.multiple === !0 && Array.isArray(e.modelValue) ? e.modelValue : [e.modelValue] : [];
|
|
1705
|
-
if (e.mapOptions === !0 && Array.isArray(e.options) === !0) {
|
|
1706
|
-
const g = e.mapOptions === !0 && C !== void 0 ? C : [], O = d.map((P) => Cl(P, g));
|
|
1707
|
-
return e.modelValue === null && o === !0 ? O.filter((P) => P !== null) : O;
|
|
1708
|
-
}
|
|
1709
|
-
return d;
|
|
1710
|
-
}), R = r(() => {
|
|
1711
|
-
const o = {};
|
|
1712
|
-
return ln.forEach((d) => {
|
|
1713
|
-
const g = e[d];
|
|
1714
|
-
g !== void 0 && (o[d] = g);
|
|
1715
|
-
}), o;
|
|
1716
|
-
}), S = r(() => e.optionsDark === null ? i.isDark.value : e.optionsDark), I = r(() => kt(m.value)), T = r(() => {
|
|
1717
|
-
let o = "q-field__input q-placeholder col";
|
|
1718
|
-
return e.hideSelected === !0 || m.value.length === 0 ? [o, e.inputClass] : (o += " q-field__input--padding", e.inputClass === void 0 ? o : [o, e.inputClass]);
|
|
1719
|
-
}), z = r(
|
|
1720
|
-
() => (e.virtualScrollHorizontal === !0 ? "q-virtual-scroll--horizontal" : "") + (e.popupContentClass ? " " + e.popupContentClass : "")
|
|
1721
|
-
), K = r(() => q.value === 0), E = r(
|
|
1722
|
-
() => m.value.map((o) => te.value(o)).join(", ")
|
|
1723
|
-
), ee = r(() => e.displayValue !== void 0 ? e.displayValue : E.value), me = r(() => e.optionsHtml === !0 ? () => !0 : (o) => (o == null ? void 0 : o.html) === !0), We = r(() => e.displayValueHtml === !0 || e.displayValue === void 0 && (e.optionsHtml === !0 || m.value.some(me.value))), ie = r(() => i.focused.value === !0 ? e.tabindex : -1), Xe = r(() => {
|
|
1724
|
-
const o = {
|
|
1725
|
-
tabindex: e.tabindex,
|
|
1726
|
-
role: "combobox",
|
|
1727
|
-
"aria-label": e.label,
|
|
1728
|
-
"aria-readonly": e.readonly === !0 ? "true" : "false",
|
|
1729
|
-
"aria-autocomplete": e.useInput === !0 ? "list" : "none",
|
|
1730
|
-
"aria-expanded": u.value === !0 ? "true" : "false",
|
|
1731
|
-
"aria-controls": `${i.targetUid.value}_lb`
|
|
1732
|
-
};
|
|
1733
|
-
return b.value >= 0 && (o["aria-activedescendant"] = `${i.targetUid.value}_${b.value}`), o;
|
|
1734
|
-
}), Se = r(() => ({
|
|
1735
|
-
id: `${i.targetUid.value}_lb`,
|
|
1736
|
-
role: "listbox",
|
|
1737
|
-
"aria-multiselectable": e.multiple === !0 ? "true" : "false"
|
|
1738
|
-
})), we = r(() => m.value.map((o, d) => ({
|
|
1739
|
-
index: d,
|
|
1740
|
-
opt: o,
|
|
1741
|
-
html: me.value(o),
|
|
1742
|
-
selected: !0,
|
|
1743
|
-
removeAtIndex: wl,
|
|
1744
|
-
toggleOption: Ce,
|
|
1745
|
-
tabindex: ie.value
|
|
1746
|
-
}))), Ye = r(() => {
|
|
1747
|
-
if (q.value === 0)
|
|
1748
|
-
return [];
|
|
1749
|
-
const { from: o, to: d } = ue.value;
|
|
1750
|
-
return e.options.slice(o, d).map((g, O) => {
|
|
1751
|
-
const P = Be.value(g) === !0, N = ft(g) === !0, D = o + O, Q = {
|
|
1752
|
-
clickable: !0,
|
|
1753
|
-
active: N,
|
|
1754
|
-
activeClass: Pe.value,
|
|
1755
|
-
manualFocus: !0,
|
|
1756
|
-
focused: !1,
|
|
1757
|
-
disable: P,
|
|
1758
|
-
tabindex: -1,
|
|
1759
|
-
dense: e.optionsDense,
|
|
1760
|
-
dark: S.value,
|
|
1761
|
-
role: "option",
|
|
1762
|
-
"aria-selected": N === !0 ? "true" : "false",
|
|
1763
|
-
id: `${i.targetUid.value}_${D}`,
|
|
1764
|
-
onClick: () => {
|
|
1765
|
-
Ce(g);
|
|
1766
|
-
}
|
|
1767
|
-
};
|
|
1768
|
-
return P !== !0 && (b.value === D && (Q.focused = !0), c.platform.is.desktop === !0 && (Q.onMousemove = () => {
|
|
1769
|
-
u.value === !0 && Ee(D);
|
|
1770
|
-
})), {
|
|
1771
|
-
index: D,
|
|
1772
|
-
opt: g,
|
|
1773
|
-
html: me.value(g),
|
|
1774
|
-
label: te.value(g),
|
|
1775
|
-
selected: Q.active,
|
|
1776
|
-
focused: Q.focused,
|
|
1777
|
-
toggleOption: Ce,
|
|
1778
|
-
setOptionIndex: Ee,
|
|
1779
|
-
itemProps: Q
|
|
1780
|
-
};
|
|
1781
|
-
});
|
|
1782
|
-
}), He = r(() => e.dropdownIcon !== void 0 ? e.dropdownIcon : c.iconSet.arrow.dropdown), ct = r(
|
|
1783
|
-
() => e.optionsCover === !1 && e.outlined !== !0 && e.standout !== !0 && e.borderless !== !0 && e.rounded !== !0
|
|
1784
|
-
), Pe = r(() => e.optionsSelectedClass !== void 0 ? e.optionsSelectedClass : e.color !== void 0 ? `text-${e.color}` : ""), de = r(() => wt(e.optionValue, "value")), te = r(() => wt(e.optionLabel, "label")), Be = r(() => wt(e.optionDisable, "disable")), Ze = r(() => m.value.map(de.value)), Sl = r(() => {
|
|
1785
|
-
const o = {
|
|
1786
|
-
onInput: It,
|
|
1787
|
-
// Safari < 10.2 & UIWebView doesn't fire compositionend when
|
|
1788
|
-
// switching focus before confirming composition choice
|
|
1789
|
-
// this also fixes the issue where some browsers e.g. iOS Chrome
|
|
1790
|
-
// fires "change" instead of "input" on autocomplete.
|
|
1791
|
-
onChange: oe,
|
|
1792
|
-
onKeydown: zt,
|
|
1793
|
-
onKeyup: Bt,
|
|
1794
|
-
onKeypress: Et,
|
|
1795
|
-
onFocus: _t,
|
|
1796
|
-
onClick(d) {
|
|
1797
|
-
V === !0 && Le(d);
|
|
1798
|
-
}
|
|
1799
|
-
};
|
|
1800
|
-
return o.onCompositionstart = o.onCompositionupdate = o.onCompositionend = oe, o;
|
|
1801
|
-
});
|
|
1802
|
-
G(m, (o) => {
|
|
1803
|
-
C = o, e.useInput === !0 && e.fillInput === !0 && e.multiple !== !0 && i.innerLoading.value !== !0 && (a.value !== !0 && u.value !== !0 || I.value !== !0) && (h !== !0 && Ie(), (a.value === !0 || u.value === !0) && ze(""));
|
|
1804
|
-
}, { immediate: !0 }), G(() => e.fillInput, Ie), G(u, vt), G(q, Tl);
|
|
1805
|
-
function Vt(o) {
|
|
1806
|
-
return e.emitValue === !0 ? de.value(o) : o;
|
|
1807
|
-
}
|
|
1808
|
-
function dt(o) {
|
|
1809
|
-
if (o !== -1 && o < m.value.length)
|
|
1810
|
-
if (e.multiple === !0) {
|
|
1811
|
-
const d = e.modelValue.slice();
|
|
1812
|
-
t("remove", { index: o, value: d.splice(o, 1)[0] }), t("update:modelValue", d);
|
|
1813
|
-
} else
|
|
1814
|
-
t("update:modelValue", null);
|
|
1815
|
-
}
|
|
1816
|
-
function wl(o) {
|
|
1817
|
-
dt(o), i.focus();
|
|
1818
|
-
}
|
|
1819
|
-
function xt(o, d) {
|
|
1820
|
-
const g = Vt(o);
|
|
1821
|
-
if (e.multiple !== !0) {
|
|
1822
|
-
e.fillInput === !0 && De(
|
|
1823
|
-
te.value(o),
|
|
1824
|
-
!0,
|
|
1825
|
-
!0
|
|
1826
|
-
), t("update:modelValue", g);
|
|
1827
|
-
return;
|
|
1828
|
-
}
|
|
1829
|
-
if (m.value.length === 0) {
|
|
1830
|
-
t("add", { index: 0, value: g }), t("update:modelValue", e.multiple === !0 ? [g] : g);
|
|
1831
|
-
return;
|
|
1832
|
-
}
|
|
1833
|
-
if (d === !0 && ft(o) === !0 || e.maxValues !== void 0 && e.modelValue.length >= e.maxValues) return;
|
|
1834
|
-
const O = e.modelValue.slice();
|
|
1835
|
-
t("add", { index: O.length, value: g }), O.push(g), t("update:modelValue", O);
|
|
1836
|
-
}
|
|
1837
|
-
function Ce(o, d) {
|
|
1838
|
-
var N;
|
|
1839
|
-
if (i.editable.value !== !0 || o === void 0 || Be.value(o) === !0) return;
|
|
1840
|
-
const g = de.value(o);
|
|
1841
|
-
if (e.multiple !== !0) {
|
|
1842
|
-
d !== !0 && (De(
|
|
1843
|
-
e.fillInput === !0 ? te.value(o) : "",
|
|
1844
|
-
!0,
|
|
1845
|
-
!0
|
|
1846
|
-
), ke()), (N = F.value) == null || N.focus(), (m.value.length === 0 || pe(de.value(m.value[0]), g) !== !0) && t("update:modelValue", e.emitValue === !0 ? g : o);
|
|
1847
|
-
return;
|
|
1848
|
-
}
|
|
1849
|
-
if ((V !== !0 || _.value === !0) && i.focus(), _t(), m.value.length === 0) {
|
|
1850
|
-
const D = e.emitValue === !0 ? g : o;
|
|
1851
|
-
t("add", { index: 0, value: D }), t("update:modelValue", e.multiple === !0 ? [D] : D);
|
|
1852
|
-
return;
|
|
1853
|
-
}
|
|
1854
|
-
const O = e.modelValue.slice(), P = Ze.value.findIndex((D) => pe(D, g));
|
|
1855
|
-
if (P !== -1)
|
|
1856
|
-
t("remove", { index: P, value: O.splice(P, 1)[0] });
|
|
1857
|
-
else {
|
|
1858
|
-
if (e.maxValues !== void 0 && O.length >= e.maxValues) return;
|
|
1859
|
-
const D = e.emitValue === !0 ? g : o;
|
|
1860
|
-
t("add", { index: O.length, value: D }), O.push(D);
|
|
1861
|
-
}
|
|
1862
|
-
t("update:modelValue", O);
|
|
1863
|
-
}
|
|
1864
|
-
function Ee(o) {
|
|
1865
|
-
if (c.platform.is.desktop !== !0) return;
|
|
1866
|
-
const d = o !== -1 && o < q.value ? o : -1;
|
|
1867
|
-
b.value !== d && (b.value = d);
|
|
1868
|
-
}
|
|
1869
|
-
function Je(o = 1, d) {
|
|
1870
|
-
if (u.value === !0) {
|
|
1871
|
-
let g = b.value;
|
|
1872
|
-
do
|
|
1873
|
-
g = tl(
|
|
1874
|
-
g + o,
|
|
1875
|
-
-1,
|
|
1876
|
-
q.value - 1
|
|
1877
|
-
);
|
|
1878
|
-
while (g !== -1 && g !== b.value && Be.value(e.options[g]) === !0);
|
|
1879
|
-
b.value !== g && (Ee(g), B(g), d !== !0 && e.useInput === !0 && e.fillInput === !0 && Ge(
|
|
1880
|
-
g >= 0 ? te.value(e.options[g]) : x,
|
|
1881
|
-
!0
|
|
1882
|
-
));
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
function Cl(o, d) {
|
|
1886
|
-
const g = (O) => pe(de.value(O), o);
|
|
1887
|
-
return e.options.find(g) || d.find(g) || o;
|
|
1888
|
-
}
|
|
1889
|
-
function ft(o) {
|
|
1890
|
-
const d = de.value(o);
|
|
1891
|
-
return Ze.value.find((g) => pe(g, d)) !== void 0;
|
|
1892
|
-
}
|
|
1893
|
-
function _t(o) {
|
|
1894
|
-
e.useInput === !0 && F.value !== null && (o === void 0 || F.value === o.target && o.target.value === E.value) && F.value.select();
|
|
1895
|
-
}
|
|
1896
|
-
function At(o) {
|
|
1897
|
-
cl(o, 27) === !0 && u.value === !0 && (Le(o), ke(), Ie()), t("keyup", o);
|
|
1898
|
-
}
|
|
1899
|
-
function Bt(o) {
|
|
1900
|
-
const { value: d } = o.target;
|
|
1901
|
-
if (o.keyCode !== void 0) {
|
|
1902
|
-
At(o);
|
|
1903
|
-
return;
|
|
1904
|
-
}
|
|
1905
|
-
if (o.target.value = "", w !== null && (clearTimeout(w), w = null), k !== null && (clearTimeout(k), k = null), Ie(), typeof d == "string" && d.length !== 0) {
|
|
1906
|
-
const g = d.toLocaleLowerCase(), O = (N) => {
|
|
1907
|
-
const D = e.options.find((Q) => String(N.value(Q)).toLocaleLowerCase() === g);
|
|
1908
|
-
return D === void 0 ? !1 : (m.value.indexOf(D) === -1 ? Ce(D) : ke(), !0);
|
|
1909
|
-
}, P = (N) => {
|
|
1910
|
-
O(de) !== !0 && N !== !0 && O(te) !== !0 && ze(d, !0, () => P(!0));
|
|
1911
|
-
};
|
|
1912
|
-
P();
|
|
1913
|
-
} else
|
|
1914
|
-
i.clearValue(o);
|
|
1915
|
-
}
|
|
1916
|
-
function Et(o) {
|
|
1917
|
-
t("keypress", o);
|
|
1918
|
-
}
|
|
1919
|
-
function zt(o) {
|
|
1920
|
-
if (t("keydown", o), Gl(o) === !0) return;
|
|
1921
|
-
const d = y.value.length !== 0 && (e.newValueMode !== void 0 || e.onNewValue !== void 0), g = o.shiftKey !== !0 && e.disableTabSelection !== !0 && e.multiple !== !0 && (b.value !== -1 || d === !0);
|
|
1922
|
-
if (o.keyCode === 27) {
|
|
1923
|
-
he(o);
|
|
1924
|
-
return;
|
|
1925
|
-
}
|
|
1926
|
-
if (o.keyCode === 9 && g === !1) {
|
|
1927
|
-
Re();
|
|
1928
|
-
return;
|
|
1929
|
-
}
|
|
1930
|
-
if (o.target === void 0 || o.target.id !== i.targetUid.value || i.editable.value !== !0) return;
|
|
1931
|
-
if (o.keyCode === 40 && i.innerLoading.value !== !0 && u.value === !1) {
|
|
1932
|
-
ne(o), Fe();
|
|
1933
|
-
return;
|
|
1934
|
-
}
|
|
1935
|
-
if (o.keyCode === 8 && (e.useChips === !0 || e.clearable === !0) && e.hideSelected !== !0 && y.value.length === 0) {
|
|
1936
|
-
e.multiple === !0 && Array.isArray(e.modelValue) === !0 ? dt(e.modelValue.length - 1) : e.multiple !== !0 && e.modelValue !== null && t("update:modelValue", null);
|
|
1937
|
-
return;
|
|
1938
|
-
}
|
|
1939
|
-
(o.keyCode === 35 || o.keyCode === 36) && (typeof y.value != "string" || y.value.length === 0) && (ne(o), b.value = -1, Je(o.keyCode === 36 ? 1 : -1, e.multiple)), (o.keyCode === 33 || o.keyCode === 34) && J.value !== void 0 && (ne(o), b.value = Math.max(
|
|
1940
|
-
-1,
|
|
1941
|
-
Math.min(
|
|
1942
|
-
q.value,
|
|
1943
|
-
b.value + (o.keyCode === 33 ? -1 : 1) * J.value.view
|
|
1944
|
-
)
|
|
1945
|
-
), Je(o.keyCode === 33 ? 1 : -1, e.multiple)), (o.keyCode === 38 || o.keyCode === 40) && (ne(o), Je(o.keyCode === 38 ? -1 : 1, e.multiple));
|
|
1946
|
-
const O = q.value;
|
|
1947
|
-
if ((A === void 0 || L < Date.now()) && (A = ""), O > 0 && e.useInput !== !0 && o.key !== void 0 && o.key.length === 1 && o.altKey === !1 && o.ctrlKey === !1 && o.metaKey === !1 && (o.keyCode !== 32 || A.length !== 0)) {
|
|
1948
|
-
u.value !== !0 && Fe(o);
|
|
1949
|
-
const P = o.key.toLocaleLowerCase(), N = A.length === 1 && A[0] === P;
|
|
1950
|
-
L = Date.now() + 1500, N === !1 && (ne(o), A += P);
|
|
1951
|
-
const D = new RegExp("^" + A.split("").map((Te) => tn.indexOf(Te) !== -1 ? "\\" + Te : Te).join(".*"), "i");
|
|
1952
|
-
let Q = b.value;
|
|
1953
|
-
if (N === !0 || Q < 0 || D.test(te.value(e.options[Q])) !== !0)
|
|
1954
|
-
do
|
|
1955
|
-
Q = tl(Q + 1, -1, O - 1);
|
|
1956
|
-
while (Q !== b.value && (Be.value(e.options[Q]) === !0 || D.test(te.value(e.options[Q])) !== !0));
|
|
1957
|
-
b.value !== Q && ve(() => {
|
|
1958
|
-
Ee(Q), B(Q), Q >= 0 && e.useInput === !0 && e.fillInput === !0 && Ge(te.value(e.options[Q]), !0);
|
|
1959
|
-
});
|
|
1960
|
-
return;
|
|
1961
|
-
}
|
|
1962
|
-
if (!(o.keyCode !== 13 && (o.keyCode !== 32 || e.useInput === !0 || A !== "") && (o.keyCode !== 9 || g === !1))) {
|
|
1963
|
-
if (o.keyCode !== 9 && ne(o), b.value !== -1 && b.value < O) {
|
|
1964
|
-
Ce(e.options[b.value]);
|
|
1965
|
-
return;
|
|
1966
|
-
}
|
|
1967
|
-
if (d === !0) {
|
|
1968
|
-
const P = (N, D) => {
|
|
1969
|
-
var Te;
|
|
1970
|
-
if (D) {
|
|
1971
|
-
if (ll(D) !== !0) return;
|
|
1972
|
-
} else
|
|
1973
|
-
D = e.newValueMode;
|
|
1974
|
-
if (De("", e.multiple !== !0, !0), N == null) return;
|
|
1975
|
-
(D === "toggle" ? Ce : xt)(N, D === "add-unique"), e.multiple !== !0 && ((Te = F.value) == null || Te.focus(), ke());
|
|
1976
|
-
};
|
|
1977
|
-
if (e.onNewValue !== void 0 ? t("newValue", y.value, P) : P(y.value), e.multiple !== !0) return;
|
|
1978
|
-
}
|
|
1979
|
-
u.value === !0 ? Re() : i.innerLoading.value !== !0 && Fe();
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
function Rt() {
|
|
1983
|
-
return V === !0 ? le.value : $.value !== null && $.value.contentEl !== null ? $.value.contentEl : void 0;
|
|
1984
|
-
}
|
|
1985
|
-
function kl() {
|
|
1986
|
-
return Rt();
|
|
1987
|
-
}
|
|
1988
|
-
function ql() {
|
|
1989
|
-
return e.hideSelected === !0 ? [] : l["selected-item"] !== void 0 ? we.value.map((o) => l["selected-item"](o)).slice() : l.selected !== void 0 ? [].concat(l.selected()) : e.useChips === !0 ? we.value.map((o, d) => s(Lo, {
|
|
1990
|
-
key: "option-" + d,
|
|
1991
|
-
removable: i.editable.value === !0 && Be.value(o.opt) !== !0,
|
|
1992
|
-
dense: !0,
|
|
1993
|
-
textColor: e.color,
|
|
1994
|
-
tabindex: ie.value,
|
|
1995
|
-
onRemove() {
|
|
1996
|
-
o.removeAtIndex(d);
|
|
1997
|
-
}
|
|
1998
|
-
}, () => s("span", {
|
|
1999
|
-
class: "ellipsis",
|
|
2000
|
-
[o.html === !0 ? "innerHTML" : "textContent"]: te.value(o.opt)
|
|
2001
|
-
}))) : [
|
|
2002
|
-
s("span", {
|
|
2003
|
-
class: "ellipsis",
|
|
2004
|
-
[We.value === !0 ? "innerHTML" : "textContent"]: ee.value
|
|
2005
|
-
})
|
|
2006
|
-
];
|
|
2007
|
-
}
|
|
2008
|
-
function Ft() {
|
|
2009
|
-
if (K.value === !0)
|
|
2010
|
-
return l["no-option"] !== void 0 ? l["no-option"]({ inputValue: y.value }) : void 0;
|
|
2011
|
-
const o = l.option !== void 0 ? l.option : (g) => s(ml, {
|
|
2012
|
-
key: g.index,
|
|
2013
|
-
...g.itemProps
|
|
2014
|
-
}, () => s(
|
|
2015
|
-
it,
|
|
2016
|
-
() => s(
|
|
2017
|
-
vl,
|
|
2018
|
-
() => s("span", {
|
|
2019
|
-
[g.html === !0 ? "innerHTML" : "textContent"]: g.label
|
|
2020
|
-
})
|
|
2021
|
-
)
|
|
2022
|
-
));
|
|
2023
|
-
let d = ce("div", Ye.value.map(o));
|
|
2024
|
-
return l["before-options"] !== void 0 && (d = l["before-options"]().concat(d)), sl(l["after-options"], d);
|
|
2025
|
-
}
|
|
2026
|
-
function Vl(o, d) {
|
|
2027
|
-
const g = d === !0 ? { ...Xe.value, ...i.splitAttrs.attributes.value } : void 0, O = {
|
|
2028
|
-
ref: d === !0 ? F : void 0,
|
|
2029
|
-
key: "i_t",
|
|
2030
|
-
class: T.value,
|
|
2031
|
-
style: e.inputStyle,
|
|
2032
|
-
value: y.value !== void 0 ? y.value : "",
|
|
2033
|
-
// required for Android in order to show ENTER key when in form
|
|
2034
|
-
type: "search",
|
|
2035
|
-
...g,
|
|
2036
|
-
id: d === !0 ? i.targetUid.value : void 0,
|
|
2037
|
-
maxlength: e.maxlength,
|
|
2038
|
-
autocomplete: e.autocomplete,
|
|
2039
|
-
"data-autofocus": o === !0 || e.autofocus === !0 || void 0,
|
|
2040
|
-
disabled: e.disable === !0,
|
|
2041
|
-
readonly: e.readonly === !0,
|
|
2042
|
-
...Sl.value
|
|
2043
|
-
};
|
|
2044
|
-
return o !== !0 && V === !0 && (Array.isArray(O.class) === !0 ? O.class = [...O.class, "no-pointer-events"] : O.class += " no-pointer-events"), s("input", O);
|
|
2045
|
-
}
|
|
2046
|
-
function It(o) {
|
|
2047
|
-
w !== null && (clearTimeout(w), w = null), k !== null && (clearTimeout(k), k = null), !(o && o.target && o.target.qComposing === !0) && (Ge(o.target.value || ""), h = !0, x = y.value, i.focused.value !== !0 && (V !== !0 || _.value === !0) && i.focus(), e.onFilter !== void 0 && (w = setTimeout(() => {
|
|
2048
|
-
w = null, ze(y.value);
|
|
2049
|
-
}, e.inputDebounce)));
|
|
2050
|
-
}
|
|
2051
|
-
function Ge(o, d) {
|
|
2052
|
-
y.value !== o && (y.value = o, d === !0 || e.inputDebounce === 0 || e.inputDebounce === "0" ? t("inputValue", o) : k = setTimeout(() => {
|
|
2053
|
-
k = null, t("inputValue", o);
|
|
2054
|
-
}, e.inputDebounce));
|
|
2055
|
-
}
|
|
2056
|
-
function De(o, d, g) {
|
|
2057
|
-
h = g !== !0, e.useInput === !0 && (Ge(o, !0), (d === !0 || g !== !0) && (x = o), d !== !0 && ze(o));
|
|
2058
|
-
}
|
|
2059
|
-
function ze(o, d, g) {
|
|
2060
|
-
if (e.onFilter === void 0 || d !== !0 && i.focused.value !== !0) return;
|
|
2061
|
-
i.innerLoading.value === !0 ? t("filterAbort") : (i.innerLoading.value = !0, f.value = !0), o !== "" && e.multiple !== !0 && m.value.length !== 0 && h !== !0 && o === te.value(m.value[0]) && (o = "");
|
|
2062
|
-
const O = setTimeout(() => {
|
|
2063
|
-
u.value === !0 && (u.value = !1);
|
|
2064
|
-
}, 10);
|
|
2065
|
-
v !== null && clearTimeout(v), v = O, t(
|
|
2066
|
-
"filter",
|
|
2067
|
-
o,
|
|
2068
|
-
(P, N) => {
|
|
2069
|
-
(d === !0 || i.focused.value === !0) && v === O && (clearTimeout(v), typeof P == "function" && P(), f.value = !1, ve(() => {
|
|
2070
|
-
i.innerLoading.value = !1, i.editable.value === !0 && (d === !0 ? u.value === !0 && ke() : u.value === !0 ? vt(!0) : u.value = !0), typeof N == "function" && ve(() => {
|
|
2071
|
-
N(n);
|
|
2072
|
-
}), typeof g == "function" && ve(() => {
|
|
2073
|
-
g(n);
|
|
2074
|
-
});
|
|
2075
|
-
}));
|
|
2076
|
-
},
|
|
2077
|
-
() => {
|
|
2078
|
-
i.focused.value === !0 && v === O && (clearTimeout(v), i.innerLoading.value = !1, f.value = !1), u.value === !0 && (u.value = !1);
|
|
2079
|
-
}
|
|
2080
|
-
);
|
|
2081
|
-
}
|
|
2082
|
-
function xl() {
|
|
2083
|
-
return s(po, {
|
|
2084
|
-
ref: $,
|
|
2085
|
-
class: z.value,
|
|
2086
|
-
style: e.popupContentStyle,
|
|
2087
|
-
modelValue: u.value,
|
|
2088
|
-
fit: e.menuShrink !== !0,
|
|
2089
|
-
cover: e.optionsCover === !0 && K.value !== !0 && e.useInput !== !0,
|
|
2090
|
-
anchor: e.menuAnchor,
|
|
2091
|
-
self: e.menuSelf,
|
|
2092
|
-
offset: e.menuOffset,
|
|
2093
|
-
dark: S.value,
|
|
2094
|
-
noParentEvent: !0,
|
|
2095
|
-
noRefocus: !0,
|
|
2096
|
-
noFocus: !0,
|
|
2097
|
-
noRouteDismiss: e.popupNoRouteDismiss,
|
|
2098
|
-
square: ct.value,
|
|
2099
|
-
transitionShow: e.transitionShow,
|
|
2100
|
-
transitionHide: e.transitionHide,
|
|
2101
|
-
transitionDuration: e.transitionDuration,
|
|
2102
|
-
separateClosePopup: !0,
|
|
2103
|
-
...Se.value,
|
|
2104
|
-
onScrollPassive: p,
|
|
2105
|
-
onBeforeShow: Ot,
|
|
2106
|
-
onBeforeHide: _l,
|
|
2107
|
-
onShow: Al
|
|
2108
|
-
}, Ft);
|
|
2109
|
-
}
|
|
2110
|
-
function _l(o) {
|
|
2111
|
-
Mt(o), Re();
|
|
2112
|
-
}
|
|
2113
|
-
function Al() {
|
|
2114
|
-
Z();
|
|
2115
|
-
}
|
|
2116
|
-
function Bl(o) {
|
|
2117
|
-
var d;
|
|
2118
|
-
Le(o), (d = F.value) == null || d.focus(), _.value = !0, window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0);
|
|
2119
|
-
}
|
|
2120
|
-
function El(o) {
|
|
2121
|
-
Le(o), ve(() => {
|
|
2122
|
-
_.value = !1;
|
|
2123
|
-
});
|
|
2124
|
-
}
|
|
2125
|
-
function zl() {
|
|
2126
|
-
const o = [
|
|
2127
|
-
s(Oo, {
|
|
2128
|
-
class: `col-auto ${i.fieldClass.value}`,
|
|
2129
|
-
...R.value,
|
|
2130
|
-
for: i.targetUid.value,
|
|
2131
|
-
dark: S.value,
|
|
2132
|
-
square: !0,
|
|
2133
|
-
loading: f.value,
|
|
2134
|
-
itemAligned: !1,
|
|
2135
|
-
filled: !0,
|
|
2136
|
-
stackLabel: y.value.length !== 0,
|
|
2137
|
-
...i.splitAttrs.listeners.value,
|
|
2138
|
-
onFocus: Bl,
|
|
2139
|
-
onBlur: El
|
|
2140
|
-
}, {
|
|
2141
|
-
...l,
|
|
2142
|
-
rawControl: () => i.getControl(!0),
|
|
2143
|
-
before: void 0,
|
|
2144
|
-
after: void 0
|
|
2145
|
-
})
|
|
2146
|
-
];
|
|
2147
|
-
return u.value === !0 && o.push(
|
|
2148
|
-
s("div", {
|
|
2149
|
-
ref: le,
|
|
2150
|
-
class: z.value + " scroll",
|
|
2151
|
-
style: e.popupContentStyle,
|
|
2152
|
-
...Se.value,
|
|
2153
|
-
onClick: he,
|
|
2154
|
-
onScrollPassive: p
|
|
2155
|
-
}, Ft())
|
|
2156
|
-
), s(No, {
|
|
2157
|
-
ref: H,
|
|
2158
|
-
modelValue: a.value,
|
|
2159
|
-
position: e.useInput === !0 ? "top" : void 0,
|
|
2160
|
-
transitionShow: j,
|
|
2161
|
-
transitionHide: e.transitionHide,
|
|
2162
|
-
transitionDuration: e.transitionDuration,
|
|
2163
|
-
noRouteDismiss: e.popupNoRouteDismiss,
|
|
2164
|
-
onBeforeShow: Ot,
|
|
2165
|
-
onBeforeHide: Rl,
|
|
2166
|
-
onHide: Fl,
|
|
2167
|
-
onShow: Il
|
|
2168
|
-
}, () => s("div", {
|
|
2169
|
-
class: "q-select__dialog" + (S.value === !0 ? " q-select__dialog--dark q-dark" : "") + (_.value === !0 ? " q-select__dialog--focused" : "")
|
|
2170
|
-
}, o));
|
|
2171
|
-
}
|
|
2172
|
-
function Rl(o) {
|
|
2173
|
-
Mt(o), H.value !== null && H.value.__updateRefocusTarget(
|
|
2174
|
-
i.rootRef.value.querySelector(".q-field__native > [tabindex]:last-child")
|
|
2175
|
-
), i.focused.value = !1;
|
|
2176
|
-
}
|
|
2177
|
-
function Fl(o) {
|
|
2178
|
-
ke(), i.focused.value === !1 && t("blur", o), Ie();
|
|
2179
|
-
}
|
|
2180
|
-
function Il() {
|
|
2181
|
-
const o = document.activeElement;
|
|
2182
|
-
(o === null || o.id !== i.targetUid.value) && F.value !== null && F.value !== o && F.value.focus(), Z();
|
|
2183
|
-
}
|
|
2184
|
-
function Re() {
|
|
2185
|
-
a.value !== !0 && (b.value = -1, u.value === !0 && (u.value = !1), i.focused.value === !1 && (v !== null && (clearTimeout(v), v = null), i.innerLoading.value === !0 && (t("filterAbort"), i.innerLoading.value = !1, f.value = !1)));
|
|
2186
|
-
}
|
|
2187
|
-
function Fe(o) {
|
|
2188
|
-
i.editable.value === !0 && (V === !0 ? (i.onControlFocusin(o), a.value = !0, ve(() => {
|
|
2189
|
-
i.focus();
|
|
2190
|
-
})) : i.focus(), e.onFilter !== void 0 ? ze(y.value) : (K.value !== !0 || l["no-option"] !== void 0) && (u.value = !0));
|
|
2191
|
-
}
|
|
2192
|
-
function ke() {
|
|
2193
|
-
a.value = !1, Re();
|
|
2194
|
-
}
|
|
2195
|
-
function Ie() {
|
|
2196
|
-
e.useInput === !0 && De(
|
|
2197
|
-
e.multiple !== !0 && e.fillInput === !0 && m.value.length !== 0 && te.value(m.value[0]) || "",
|
|
2198
|
-
!0,
|
|
2199
|
-
!0
|
|
2200
|
-
);
|
|
2201
|
-
}
|
|
2202
|
-
function vt(o) {
|
|
2203
|
-
let d = -1;
|
|
2204
|
-
if (o === !0) {
|
|
2205
|
-
if (m.value.length !== 0) {
|
|
2206
|
-
const g = de.value(m.value[0]);
|
|
2207
|
-
d = e.options.findIndex((O) => pe(de.value(O), g));
|
|
2208
|
-
}
|
|
2209
|
-
U(d);
|
|
2210
|
-
}
|
|
2211
|
-
Ee(d);
|
|
2212
|
-
}
|
|
2213
|
-
function Tl(o, d) {
|
|
2214
|
-
u.value === !0 && i.innerLoading.value === !1 && (U(-1, !0), ve(() => {
|
|
2215
|
-
u.value === !0 && i.innerLoading.value === !1 && (o > d ? U() : vt(!0));
|
|
2216
|
-
}));
|
|
2217
|
-
}
|
|
2218
|
-
function Tt() {
|
|
2219
|
-
a.value === !1 && $.value !== null && $.value.updatePosition();
|
|
2220
|
-
}
|
|
2221
|
-
function Ot(o) {
|
|
2222
|
-
o !== void 0 && Le(o), t("popupShow", o), i.hasPopupOpen = !0, i.onControlFocusin(o);
|
|
2223
|
-
}
|
|
2224
|
-
function Mt(o) {
|
|
2225
|
-
o !== void 0 && Le(o), t("popupHide", o), i.hasPopupOpen = !1, i.onControlFocusout(o);
|
|
2226
|
-
}
|
|
2227
|
-
function Lt() {
|
|
2228
|
-
V = c.platform.is.mobile !== !0 && e.behavior !== "dialog" ? !1 : e.behavior !== "menu" && (e.useInput === !0 ? l["no-option"] !== void 0 || e.onFilter !== void 0 || K.value === !1 : !0), j = c.platform.is.ios === !0 && V === !0 && e.useInput === !0 ? "fade" : e.transitionShow;
|
|
2229
|
-
}
|
|
2230
|
-
return ol(Lt), Ll(Tt), Lt(), Ae(() => {
|
|
2231
|
-
w !== null && clearTimeout(w), k !== null && clearTimeout(k);
|
|
2232
|
-
}), Object.assign(n, {
|
|
2233
|
-
showPopup: Fe,
|
|
2234
|
-
hidePopup: ke,
|
|
2235
|
-
removeAtIndex: dt,
|
|
2236
|
-
add: xt,
|
|
2237
|
-
toggleOption: Ce,
|
|
2238
|
-
getOptionIndex: () => b.value,
|
|
2239
|
-
setOptionIndex: Ee,
|
|
2240
|
-
moveOptionSelection: Je,
|
|
2241
|
-
filter: ze,
|
|
2242
|
-
updateMenuPosition: Tt,
|
|
2243
|
-
updateInputValue: De,
|
|
2244
|
-
isOptionSelected: ft,
|
|
2245
|
-
getEmittingOptionValue: Vt,
|
|
2246
|
-
isOptionDisabled: (...o) => Be.value.apply(null, o) === !0,
|
|
2247
|
-
getOptionValue: (...o) => de.value.apply(null, o),
|
|
2248
|
-
getOptionLabel: (...o) => te.value.apply(null, o)
|
|
2249
|
-
}), Object.assign(i, {
|
|
2250
|
-
innerValue: m,
|
|
2251
|
-
fieldClass: r(
|
|
2252
|
-
() => `q-select q-field--auto-height q-select--with${e.useInput !== !0 ? "out" : ""}-input q-select--with${e.useChips !== !0 ? "out" : ""}-chips q-select--${e.multiple === !0 ? "multiple" : "single"}`
|
|
2253
|
-
),
|
|
2254
|
-
inputRef: Y,
|
|
2255
|
-
targetRef: F,
|
|
2256
|
-
hasValue: I,
|
|
2257
|
-
showPopup: Fe,
|
|
2258
|
-
floatingLabel: r(
|
|
2259
|
-
() => e.hideSelected !== !0 && I.value === !0 || typeof y.value == "number" || y.value.length !== 0 || kt(e.displayValue)
|
|
2260
|
-
),
|
|
2261
|
-
getControlChild: () => {
|
|
2262
|
-
if (i.editable.value !== !1 && (a.value === !0 || K.value !== !0 || l["no-option"] !== void 0))
|
|
2263
|
-
return V === !0 ? zl() : xl();
|
|
2264
|
-
i.hasPopupOpen === !0 && (i.hasPopupOpen = !1);
|
|
2265
|
-
},
|
|
2266
|
-
controlEvents: {
|
|
2267
|
-
onFocusin(o) {
|
|
2268
|
-
i.onControlFocusin(o);
|
|
2269
|
-
},
|
|
2270
|
-
onFocusout(o) {
|
|
2271
|
-
i.onControlFocusout(o, () => {
|
|
2272
|
-
Ie(), Re();
|
|
2273
|
-
});
|
|
2274
|
-
},
|
|
2275
|
-
onClick(o) {
|
|
2276
|
-
var d;
|
|
2277
|
-
if (he(o), V !== !0 && u.value === !0) {
|
|
2278
|
-
Re(), (d = F.value) == null || d.focus();
|
|
2279
|
-
return;
|
|
2280
|
-
}
|
|
2281
|
-
Fe(o);
|
|
2282
|
-
}
|
|
2283
|
-
},
|
|
2284
|
-
getControl: (o) => {
|
|
2285
|
-
const d = ql(), g = o === !0 || a.value !== !0 || V !== !0;
|
|
2286
|
-
if (e.useInput === !0)
|
|
2287
|
-
d.push(Vl(o, g));
|
|
2288
|
-
else if (i.editable.value === !0) {
|
|
2289
|
-
const P = g === !0 ? Xe.value : void 0;
|
|
2290
|
-
d.push(
|
|
2291
|
-
s("input", {
|
|
2292
|
-
ref: g === !0 ? F : void 0,
|
|
2293
|
-
key: "d_t",
|
|
2294
|
-
class: "q-select__focus-target",
|
|
2295
|
-
id: g === !0 ? i.targetUid.value : void 0,
|
|
2296
|
-
value: ee.value,
|
|
2297
|
-
readonly: !0,
|
|
2298
|
-
"data-autofocus": o === !0 || e.autofocus === !0 || void 0,
|
|
2299
|
-
...P,
|
|
2300
|
-
onKeydown: zt,
|
|
2301
|
-
onKeyup: At,
|
|
2302
|
-
onKeypress: Et
|
|
2303
|
-
})
|
|
2304
|
-
), g === !0 && typeof e.autocomplete == "string" && e.autocomplete.length !== 0 && d.push(
|
|
2305
|
-
s("input", {
|
|
2306
|
-
class: "q-select__autocomplete-input",
|
|
2307
|
-
autocomplete: e.autocomplete,
|
|
2308
|
-
tabindex: -1,
|
|
2309
|
-
onKeyup: Bt
|
|
2310
|
-
})
|
|
2311
|
-
);
|
|
2312
|
-
}
|
|
2313
|
-
if (W.value !== void 0 && e.disable !== !0 && Ze.value.length !== 0) {
|
|
2314
|
-
const P = Ze.value.map((N) => s("option", { value: N, selected: !0 }));
|
|
2315
|
-
d.push(
|
|
2316
|
-
s("select", {
|
|
2317
|
-
class: "hidden",
|
|
2318
|
-
name: W.value,
|
|
2319
|
-
multiple: e.multiple
|
|
2320
|
-
}, P)
|
|
2321
|
-
);
|
|
2322
|
-
}
|
|
2323
|
-
const O = e.useInput === !0 || g !== !0 ? void 0 : i.splitAttrs.attributes.value;
|
|
2324
|
-
return s("div", {
|
|
2325
|
-
class: "q-field__native row items-center",
|
|
2326
|
-
...O,
|
|
2327
|
-
...i.splitAttrs.listeners.value
|
|
2328
|
-
}, d);
|
|
2329
|
-
},
|
|
2330
|
-
getInnerAppend: () => e.loading !== !0 && f.value !== !0 && e.hideDropdownIcon !== !0 ? [
|
|
2331
|
-
s(_e, {
|
|
2332
|
-
class: "q-select__dropdown-icon" + (u.value === !0 ? " rotate-180" : ""),
|
|
2333
|
-
name: He.value
|
|
2334
|
-
})
|
|
2335
|
-
] : null
|
|
2336
|
-
}), bl(i);
|
|
2337
|
-
}
|
|
2338
|
-
}), nn = { class: "app-select__amount" }, un = /* @__PURE__ */ $l({
|
|
2339
|
-
__name: "AppSelect",
|
|
2340
|
-
props: {
|
|
2341
|
-
modelValue: {},
|
|
2342
|
-
size: { default: eo.MD },
|
|
2343
|
-
options: {},
|
|
2344
|
-
multiple: { type: Boolean },
|
|
2345
|
-
label: {},
|
|
2346
|
-
placeholder: {},
|
|
2347
|
-
required: { type: Boolean },
|
|
2348
|
-
clearable: { type: Boolean },
|
|
2349
|
-
disabled: { type: Boolean },
|
|
2350
|
-
loading: { type: Boolean },
|
|
2351
|
-
filtering: { type: Boolean },
|
|
2352
|
-
autofocus: { type: Boolean },
|
|
2353
|
-
rules: {},
|
|
2354
|
-
lazyRules: { type: [Boolean, String] },
|
|
2355
|
-
menuClass: {}
|
|
2356
|
-
},
|
|
2357
|
-
emits: ["update:modelValue", "popupShow", "popupHide"],
|
|
2358
|
-
setup(e, { emit: l }) {
|
|
2359
|
-
const t = e, n = l, c = M(!1), u = M(""), a = r({
|
|
2360
|
-
get() {
|
|
2361
|
-
if (t.modelValue) {
|
|
2362
|
-
if (t.multiple && Array.isArray(t.modelValue))
|
|
2363
|
-
return t.options.filter(
|
|
2364
|
-
(h) => t.modelValue.includes(h.value)
|
|
2365
|
-
);
|
|
2366
|
-
if (!Array.isArray(t.modelValue))
|
|
2367
|
-
return t.options.find(
|
|
2368
|
-
(h) => h.value === t.modelValue
|
|
2369
|
-
);
|
|
2370
|
-
}
|
|
2371
|
-
},
|
|
2372
|
-
set(h) {
|
|
2373
|
-
if (!h) {
|
|
2374
|
-
n("update:modelValue", void 0);
|
|
2375
|
-
return;
|
|
2376
|
-
}
|
|
2377
|
-
if (t.multiple && Array.isArray(h)) {
|
|
2378
|
-
const v = h.map((x) => x.value);
|
|
2379
|
-
n("update:modelValue", v);
|
|
2380
|
-
} else Array.isArray(h) || n("update:modelValue", h.value);
|
|
2381
|
-
}
|
|
2382
|
-
}), b = r(() => {
|
|
2383
|
-
var h;
|
|
2384
|
-
if (Array.isArray(a.value)) {
|
|
2385
|
-
if (t.multiple && a.value.length == 0)
|
|
2386
|
-
return t.placeholder;
|
|
2387
|
-
} else return ((h = a.value) == null ? void 0 : h.label) || t.placeholder || "";
|
|
2388
|
-
return "";
|
|
2389
|
-
}), y = r(() => !(!t.clearable || !t.modelValue || t.modelValue && Array.isArray(t.modelValue) && !t.modelValue.length)), _ = r(() => u.value ? t.options.filter(
|
|
2390
|
-
(h) => h.label.toLowerCase().includes(u.value.toLowerCase())
|
|
2391
|
-
) : t.options), f = r(() => {
|
|
2392
|
-
if (t.rules)
|
|
2393
|
-
return t.required ? [...t.rules, Dt] : t.rules;
|
|
2394
|
-
if (t.required)
|
|
2395
|
-
return [Dt];
|
|
2396
|
-
}), w = () => {
|
|
2397
|
-
c.value = !0, n("popupShow");
|
|
2398
|
-
}, k = () => {
|
|
2399
|
-
c.value = !1, n("popupHide");
|
|
2400
|
-
}, C = () => {
|
|
2401
|
-
a.value = void 0;
|
|
2402
|
-
}, V = (h, v) => {
|
|
2403
|
-
v(() => {
|
|
2404
|
-
u.value = h;
|
|
2405
|
-
});
|
|
2406
|
-
};
|
|
2407
|
-
return (h, v) => (ae(), fe("div", {
|
|
2408
|
-
class: et(["app-select", [{ "app-select_opened": c.value }, `app-select_${h.size}`]])
|
|
2409
|
-
}, [
|
|
2410
|
-
h.label ? (ae(), fe("label", {
|
|
2411
|
-
key: 0,
|
|
2412
|
-
class: et(["app-select__label", { "app-select__label_bold": h.required }])
|
|
2413
|
-
}, Ke(h.required ? `${h.label} *` : h.label), 3)) : Me("", !0),
|
|
2414
|
-
je(Hl(on), {
|
|
2415
|
-
standout: "",
|
|
2416
|
-
"hide-bottom-space": "",
|
|
2417
|
-
"hide-dropdown-icon": "",
|
|
2418
|
-
"no-error-icon": "",
|
|
2419
|
-
behavior: "menu",
|
|
2420
|
-
"popup-no-route-dismiss": "",
|
|
2421
|
-
"popup-content-class": `app-select-menu app-select-menu_${h.size} ${h.menuClass}`,
|
|
2422
|
-
placeholder: h.filtering && "Почніть вводити",
|
|
2423
|
-
"input-debounce": "50",
|
|
2424
|
-
modelValue: a.value,
|
|
2425
|
-
"onUpdate:modelValue": v[0] || (v[0] = (x) => a.value = x),
|
|
2426
|
-
options: _.value,
|
|
2427
|
-
multiple: h.multiple,
|
|
2428
|
-
"use-input": h.filtering && (Array.isArray(a.value) || !a.value),
|
|
2429
|
-
rules: f.value,
|
|
2430
|
-
"lazy-rules": h.lazyRules,
|
|
2431
|
-
autofocus: h.autofocus,
|
|
2432
|
-
disable: h.disabled,
|
|
2433
|
-
loading: h.loading,
|
|
2434
|
-
onFilter: V,
|
|
2435
|
-
onPopupShow: w,
|
|
2436
|
-
onPopupHide: k
|
|
2437
|
-
}, {
|
|
2438
|
-
append: ge(() => [
|
|
2439
|
-
y.value ? (ae(), fe("i", {
|
|
2440
|
-
key: 0,
|
|
2441
|
-
class: "icon-kl icon-kl-circle-close app-select__clear",
|
|
2442
|
-
onClick: Dl(C, ["stop", "prevent"])
|
|
2443
|
-
})) : Me("", !0),
|
|
2444
|
-
v[1] || (v[1] = mt("i", { class: "icon-kl icon-kl-arrow-down app-select__drop-icon" }, null, -1))
|
|
2445
|
-
]),
|
|
2446
|
-
selected: ge(() => {
|
|
2447
|
-
var x, j;
|
|
2448
|
-
return [
|
|
2449
|
-
Array.isArray(a.value) ? (ae(), fe(tt, { key: 0 }, [
|
|
2450
|
-
!h.filtering || a.value.length ? (ae(), fe("span", {
|
|
2451
|
-
key: 0,
|
|
2452
|
-
class: et([
|
|
2453
|
-
"app-select__selected",
|
|
2454
|
-
{
|
|
2455
|
-
"app-select__placeholder": !((x = a.value) != null && x.length) && h.placeholder
|
|
2456
|
-
}
|
|
2457
|
-
])
|
|
2458
|
-
}, [
|
|
2459
|
-
(j = a.value) != null && j.length ? (ae(), fe(tt, { key: 0 }, [
|
|
2460
|
-
v[2] || (v[2] = gt(" Вибрано ", -1)),
|
|
2461
|
-
mt("span", nn, Ke(a.value.length), 1)
|
|
2462
|
-
], 64)) : (ae(), fe(tt, { key: 1 }, [
|
|
2463
|
-
gt(Ke(t.placeholder), 1)
|
|
2464
|
-
], 64))
|
|
2465
|
-
], 2)) : Me("", !0)
|
|
2466
|
-
], 64)) : (ae(), fe(tt, { key: 1 }, [
|
|
2467
|
-
!h.filtering || a.value ? (ae(), fe("span", {
|
|
2468
|
-
key: 0,
|
|
2469
|
-
class: et([
|
|
2470
|
-
"app-select__selected",
|
|
2471
|
-
{ "app-select__placeholder": !a.value && h.placeholder }
|
|
2472
|
-
])
|
|
2473
|
-
}, Ke(b.value), 3)) : Me("", !0)
|
|
2474
|
-
], 64))
|
|
2475
|
-
];
|
|
2476
|
-
}),
|
|
2477
|
-
option: ge((x) => [
|
|
2478
|
-
je(ml, Pl({
|
|
2479
|
-
class: ["app-select__option", { "app-select__option_selected": x.selected }]
|
|
2480
|
-
}, x.itemProps), {
|
|
2481
|
-
default: ge(() => [
|
|
2482
|
-
t.multiple ? (ae(), $t(it, {
|
|
2483
|
-
key: 0,
|
|
2484
|
-
class: "option-multiple",
|
|
2485
|
-
avatar: ""
|
|
2486
|
-
}, {
|
|
2487
|
-
default: ge(() => [
|
|
2488
|
-
je(Ao, {
|
|
2489
|
-
size: "30px",
|
|
2490
|
-
"model-value": x.selected,
|
|
2491
|
-
"onUpdate:modelValue": () => x.toggleOption(x.opt)
|
|
2492
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"])
|
|
2493
|
-
]),
|
|
2494
|
-
_: 2
|
|
2495
|
-
}, 1024)) : Me("", !0),
|
|
2496
|
-
x.opt.done ? (ae(), $t(it, {
|
|
2497
|
-
key: 1,
|
|
2498
|
-
class: "option-done",
|
|
2499
|
-
avatar: ""
|
|
2500
|
-
}, {
|
|
2501
|
-
default: ge(() => [...v[3] || (v[3] = [
|
|
2502
|
-
mt("i", { class: "icon-kl icon-kl-check option-done__icon" }, null, -1)
|
|
2503
|
-
])]),
|
|
2504
|
-
_: 1
|
|
2505
|
-
})) : Me("", !0),
|
|
2506
|
-
je(it, null, {
|
|
2507
|
-
default: ge(() => [
|
|
2508
|
-
je(vl, null, {
|
|
2509
|
-
default: ge(() => [
|
|
2510
|
-
gt(Ke(x.opt.label), 1)
|
|
2511
|
-
]),
|
|
2512
|
-
_: 2
|
|
2513
|
-
}, 1024)
|
|
2514
|
-
]),
|
|
2515
|
-
_: 2
|
|
2516
|
-
}, 1024)
|
|
2517
|
-
]),
|
|
2518
|
-
_: 2
|
|
2519
|
-
}, 1040, ["class"])
|
|
2520
|
-
]),
|
|
2521
|
-
_: 1
|
|
2522
|
-
}, 8, ["popup-content-class", "placeholder", "modelValue", "options", "multiple", "use-input", "rules", "lazy-rules", "autofocus", "disable", "loading"])
|
|
2523
|
-
], 2));
|
|
2524
|
-
}
|
|
2525
|
-
}), dn = /* @__PURE__ */ to(un, [["__scopeId", "data-v-9e880834"]]);
|
|
2526
|
-
export {
|
|
2527
|
-
dn as default
|
|
2528
|
-
};
|