@validol4ik/uikit 0.3.21 → 0.3.23

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.
@@ -1,4445 +0,0 @@
1
- import { computed as d, markRaw as fn, defineComponent as mt, h as g, withDirectives as vn, getCurrentInstance as ne, unref as st, ref as P, onBeforeUnmount as me, Transition as dt, openBlock as ue, createBlock as $t, normalizeClass as Be, withCtx as xe, createElementBlock as de, createCommentVNode as Ce, renderSlot as bo, Fragment as at, createTextVNode as Bt, toDisplayString as Ze, reactive as yo, mergeProps as mn, withModifiers as hn, toRaw as Ue, onMounted as ht, watch as Z, onBeforeUpdate as gn, inject as wo, nextTick as fe, onDeactivated as Pt, onActivated as pn, onUnmounted as So, Teleport as ko, onBeforeMount as xo, onUpdated as Co, createVNode as ot, createElementVNode as Wt, normalizeStyle as qo } from "vue";
2
- const bn = {
3
- PRIMARY: "primary",
4
- INFO: "info"
5
- }, qe = {
6
- SM: "sm",
7
- MD: "md",
8
- LG: "lg"
9
- }, _o = {
10
- [qe.SM]: "3px 9px",
11
- [qe.MD]: "5px 12px",
12
- [qe.LG]: "9px 20px"
13
- }, nl = {
14
- xs: 18,
15
- sm: 24,
16
- md: 32,
17
- lg: 38,
18
- xl: 46
19
- }, zt = {
20
- size: String
21
- };
22
- function Ft(e, t = nl) {
23
- return d(() => e.size !== void 0 ? { fontSize: e.size in t ? `${t[e.size]}px` : e.size } : null);
24
- }
25
- function dl(e, t, l, n) {
26
- return Object.defineProperty(e, t, {
27
- get: l,
28
- set: n,
29
- enumerable: !0
30
- }), e;
31
- }
32
- function he(e) {
33
- return fn(mt(e));
34
- }
35
- function Eo(e) {
36
- return fn(e);
37
- }
38
- function ke(e, t) {
39
- return e !== void 0 && e() || t;
40
- }
41
- function Vo(e, t) {
42
- if (e !== void 0) {
43
- const l = e();
44
- if (l != null)
45
- return l.slice();
46
- }
47
- return t;
48
- }
49
- function Ae(e, t) {
50
- return e !== void 0 ? t.concat(e()) : t;
51
- }
52
- function Bo(e, t) {
53
- return e === void 0 ? t : t !== void 0 ? t.concat(e()) : e();
54
- }
55
- function To(e, t, l, n, o, u) {
56
- t.key = n + o;
57
- const a = g(e, t, l);
58
- return o === !0 ? vn(a, u()) : a;
59
- }
60
- const Tl = "0 0 24 24", $l = (e) => e, Kt = (e) => `ionicons ${e}`, yn = {
61
- "mdi-": (e) => `mdi ${e}`,
62
- "icon-": $l,
63
- // fontawesome equiv
64
- "bt-": (e) => `bt ${e}`,
65
- "eva-": (e) => `eva ${e}`,
66
- "ion-md": Kt,
67
- "ion-ios": Kt,
68
- "ion-logo": Kt,
69
- "iconfont ": $l,
70
- "ti-": (e) => `themify-icon ${e}`,
71
- "bi-": (e) => `bootstrap-icons ${e}`
72
- }, wn = {
73
- o_: "-outlined",
74
- r_: "-round",
75
- s_: "-sharp"
76
- }, Sn = {
77
- sym_o_: "-outlined",
78
- sym_r_: "-rounded",
79
- sym_s_: "-sharp"
80
- }, $o = new RegExp("^(" + Object.keys(yn).join("|") + ")"), Ro = new RegExp("^(" + Object.keys(wn).join("|") + ")"), Rl = new RegExp("^(" + Object.keys(Sn).join("|") + ")"), Lo = /^[Mm]\s?[-+]?\.?\d/, Mo = /^img:/, Ao = /^svguse:/, Oo = /^ion-/, Po = /^(fa-(classic|sharp|solid|regular|light|brands|duotone|thin)|[lf]a[srlbdk]?) /, _e = he({
81
- name: "QIcon",
82
- props: {
83
- ...zt,
84
- tag: {
85
- type: String,
86
- default: "i"
87
- },
88
- name: String,
89
- color: String,
90
- left: Boolean,
91
- right: Boolean
92
- },
93
- setup(e, { slots: t }) {
94
- const { proxy: { $q: l } } = ne(), n = Ft(e), o = d(
95
- () => "q-icon" + (e.left === !0 ? " on-left" : "") + (e.right === !0 ? " on-right" : "") + (e.color !== void 0 ? ` text-${e.color}` : "")
96
- ), u = d(() => {
97
- let a, r = e.name;
98
- if (r === "none" || !r)
99
- return { none: !0 };
100
- if (l.iconMapFn !== null) {
101
- const s = l.iconMapFn(r);
102
- if (s !== void 0)
103
- if (s.icon !== void 0) {
104
- if (r = s.icon, r === "none" || !r)
105
- return { none: !0 };
106
- } else
107
- return {
108
- cls: s.cls,
109
- content: s.content !== void 0 ? s.content : " "
110
- };
111
- }
112
- if (Lo.test(r) === !0) {
113
- const [s, y = Tl] = r.split("|");
114
- return {
115
- svg: !0,
116
- viewBox: y,
117
- nodes: s.split("&&").map((v) => {
118
- const [c, m, C] = v.split("@@");
119
- return g("path", { style: m, d: c, transform: C });
120
- })
121
- };
122
- }
123
- if (Mo.test(r) === !0)
124
- return {
125
- img: !0,
126
- src: r.substring(4)
127
- };
128
- if (Ao.test(r) === !0) {
129
- const [s, y = Tl] = r.split("|");
130
- return {
131
- svguse: !0,
132
- src: s.substring(7),
133
- viewBox: y
134
- };
135
- }
136
- let h = " ";
137
- const b = r.match($o);
138
- if (b !== null)
139
- a = yn[b[1]](r);
140
- else if (Po.test(r) === !0)
141
- a = r;
142
- else if (Oo.test(r) === !0)
143
- a = `ionicons ion-${l.platform.is.ios === !0 ? "ios" : "md"}${r.substring(3)}`;
144
- else if (Rl.test(r) === !0) {
145
- a = "notranslate material-symbols";
146
- const s = r.match(Rl);
147
- s !== null && (r = r.substring(6), a += Sn[s[1]]), h = r;
148
- } else {
149
- a = "notranslate material-icons";
150
- const s = r.match(Ro);
151
- s !== null && (r = r.substring(2), a += wn[s[1]]), h = r;
152
- }
153
- return {
154
- cls: a,
155
- content: h
156
- };
157
- });
158
- return () => {
159
- const a = {
160
- class: o.value,
161
- style: n.value,
162
- "aria-hidden": "true",
163
- role: "presentation"
164
- };
165
- return u.value.none === !0 ? g(e.tag, a, ke(t.default)) : u.value.img === !0 ? g(e.tag, a, Ae(t.default, [
166
- g("img", { src: u.value.src })
167
- ])) : u.value.svg === !0 ? g(e.tag, a, Ae(t.default, [
168
- g("svg", {
169
- viewBox: u.value.viewBox || "0 0 24 24"
170
- }, u.value.nodes)
171
- ])) : u.value.svguse === !0 ? g(e.tag, a, Ae(t.default, [
172
- g("svg", {
173
- viewBox: u.value.viewBox
174
- }, [
175
- g("use", { "xlink:href": u.value.src })
176
- ])
177
- ])) : (u.value.cls !== void 0 && (a.class += " " + u.value.cls), g(e.tag, a, Ae(t.default, [
178
- u.value.content
179
- ])));
180
- };
181
- }
182
- }), zo = {
183
- size: {
184
- type: [String, Number],
185
- default: "1em"
186
- },
187
- color: String
188
- };
189
- function Fo(e) {
190
- return {
191
- cSize: d(() => e.size in nl ? `${nl[e.size]}px` : e.size),
192
- classes: d(
193
- () => "q-spinner" + (e.color ? ` text-${e.color}` : "")
194
- )
195
- };
196
- }
197
- const kn = he({
198
- name: "QSpinner",
199
- props: {
200
- ...zo,
201
- thickness: {
202
- type: Number,
203
- default: 5
204
- }
205
- },
206
- setup(e) {
207
- const { cSize: t, classes: l } = Fo(e);
208
- return () => g("svg", {
209
- class: l.value + " q-spinner-mat",
210
- width: t.value,
211
- height: t.value,
212
- viewBox: "25 25 50 50"
213
- }, [
214
- g("circle", {
215
- class: "path",
216
- cx: "50",
217
- cy: "50",
218
- r: "20",
219
- fill: "none",
220
- stroke: "currentColor",
221
- "stroke-width": e.thickness,
222
- "stroke-miterlimit": "10"
223
- })
224
- ]);
225
- }
226
- });
227
- function ol(e, t) {
228
- const l = e.style;
229
- for (const n in t)
230
- l[n] = t[n];
231
- }
232
- function Io(e) {
233
- if (e == null)
234
- return;
235
- if (typeof e == "string")
236
- try {
237
- return document.querySelector(e) || void 0;
238
- } catch {
239
- return;
240
- }
241
- const t = st(e);
242
- if (t)
243
- return t.$el || t;
244
- }
245
- function xn(e, t) {
246
- if (e == null || e.contains(t) === !0)
247
- return !0;
248
- for (let l = e.nextElementSibling; l !== null; l = l.nextElementSibling)
249
- if (l.contains(t))
250
- return !0;
251
- return !1;
252
- }
253
- const re = {
254
- hasPassive: !1,
255
- passiveCapture: !0,
256
- notPassiveCapture: !0
257
- };
258
- try {
259
- const e = Object.defineProperty({}, "passive", {
260
- get() {
261
- Object.assign(re, {
262
- hasPassive: !0,
263
- passive: { passive: !0 },
264
- notPassive: { passive: !1 },
265
- passiveCapture: { passive: !0, capture: !0 },
266
- notPassiveCapture: { passive: !1, capture: !0 }
267
- });
268
- }
269
- });
270
- window.addEventListener("qtest", null, e), window.removeEventListener("qtest", null, e);
271
- } catch {
272
- }
273
- function Ho() {
274
- }
275
- function Cn(e) {
276
- return e.touches && e.touches[0] ? e = e.touches[0] : e.changedTouches && e.changedTouches[0] ? e = e.changedTouches[0] : e.targetTouches && e.targetTouches[0] && (e = e.targetTouches[0]), {
277
- top: e.clientY,
278
- left: e.clientX
279
- };
280
- }
281
- function Do(e) {
282
- if (e.path)
283
- return e.path;
284
- if (e.composedPath)
285
- return e.composedPath();
286
- const t = [];
287
- let l = e.target;
288
- for (; l; ) {
289
- if (t.push(l), l.tagName === "HTML")
290
- return t.push(document), t.push(window), t;
291
- l = l.parentElement;
292
- }
293
- }
294
- function Ee(e) {
295
- e.stopPropagation();
296
- }
297
- function be(e) {
298
- e.cancelable !== !1 && e.preventDefault();
299
- }
300
- function le(e) {
301
- e.cancelable !== !1 && e.preventDefault(), e.stopPropagation();
302
- }
303
- function il(e, t, l) {
304
- const n = `__q_${t}_evt`;
305
- e[n] = e[n] !== void 0 ? e[n].concat(l) : l, l.forEach((o) => {
306
- o[0].addEventListener(o[1], e[o[2]], re[o[3]]);
307
- });
308
- }
309
- function qn(e, t) {
310
- const l = `__q_${t}_evt`;
311
- e[l] !== void 0 && (e[l].forEach((n) => {
312
- n[0].removeEventListener(n[1], e[n[2]], re[n[3]]);
313
- }), e[l] = void 0);
314
- }
315
- function _n(e) {
316
- return e !== Object(e) || e.isComposing === !0 || e.qKeyEvent === !0;
317
- }
318
- function Ie(e, t) {
319
- return _n(e) === !0 ? !1 : [].concat(t).includes(e.keyCode);
320
- }
321
- function jo(e, t = 250) {
322
- let l = !1, n;
323
- return function() {
324
- return l === !1 && (l = !0, setTimeout(() => {
325
- l = !1;
326
- }, t), n = e.apply(this, arguments)), n;
327
- };
328
- }
329
- function Ll(e, t, l, n) {
330
- l.modifiers.stop === !0 && Ee(e);
331
- const o = l.modifiers.color;
332
- let u = l.modifiers.center;
333
- u = u === !0 || n === !0;
334
- const a = document.createElement("span"), r = document.createElement("span"), h = Cn(e), { left: b, top: s, width: y, height: v } = t.getBoundingClientRect(), c = Math.sqrt(y * y + v * v), m = c / 2, C = `${(y - c) / 2}px`, p = u ? C : `${h.left - b - m}px`, O = `${(v - c) / 2}px`, T = u ? O : `${h.top - s - m}px`;
335
- r.className = "q-ripple__inner", ol(r, {
336
- height: `${c}px`,
337
- width: `${c}px`,
338
- transform: `translate3d(${p},${T},0) scale3d(.2,.2,1)`,
339
- opacity: 0
340
- }), a.className = `q-ripple${o ? " text-" + o : ""}`, a.setAttribute("dir", "ltr"), a.appendChild(r), t.appendChild(a);
341
- const k = () => {
342
- a.remove(), clearTimeout(M);
343
- };
344
- l.abort.push(k);
345
- let M = setTimeout(() => {
346
- r.classList.add("q-ripple__inner--enter"), r.style.transform = `translate3d(${C},${O},0) scale3d(1,1,1)`, r.style.opacity = 0.2, M = setTimeout(() => {
347
- r.classList.remove("q-ripple__inner--enter"), r.classList.add("q-ripple__inner--leave"), r.style.opacity = 0, M = setTimeout(() => {
348
- a.remove(), l.abort.splice(l.abort.indexOf(k), 1);
349
- }, 275);
350
- }, 250);
351
- }, 50);
352
- }
353
- function Ml(e, { modifiers: t, value: l, arg: n }) {
354
- const o = Object.assign({}, e.cfg.ripple, t, l);
355
- e.modifiers = {
356
- early: o.early === !0,
357
- stop: o.stop === !0,
358
- center: o.center === !0,
359
- color: o.color || n,
360
- keyCodes: [].concat(o.keyCodes || 13)
361
- };
362
- }
363
- const En = Eo(
364
- {
365
- name: "ripple",
366
- beforeMount(e, t) {
367
- const l = t.instance.$.appContext.config.globalProperties.$q.config || {};
368
- if (l.ripple === !1)
369
- return;
370
- const n = {
371
- cfg: l,
372
- enabled: t.value !== !1,
373
- modifiers: {},
374
- abort: [],
375
- start(o) {
376
- n.enabled === !0 && o.qSkipRipple !== !0 && o.type === (n.modifiers.early === !0 ? "pointerdown" : "click") && Ll(o, e, n, o.qKeyEvent === !0);
377
- },
378
- keystart: jo((o) => {
379
- n.enabled === !0 && o.qSkipRipple !== !0 && Ie(o, n.modifiers.keyCodes) === !0 && o.type === `key${n.modifiers.early === !0 ? "down" : "up"}` && Ll(o, e, n, !0);
380
- }, 300)
381
- };
382
- Ml(n, t), e.__qripple = n, il(n, "main", [
383
- [e, "pointerdown", "start", "passive"],
384
- [e, "click", "start", "passive"],
385
- [e, "keydown", "keystart", "passive"],
386
- [e, "keyup", "keystart", "passive"]
387
- ]);
388
- },
389
- updated(e, t) {
390
- if (t.oldValue !== t.value) {
391
- const l = e.__qripple;
392
- l !== void 0 && (l.enabled = t.value !== !1, l.enabled === !0 && Object(t.value) === t.value && Ml(l, t));
393
- }
394
- },
395
- beforeUnmount(e) {
396
- const t = e.__qripple;
397
- t !== void 0 && (t.abort.forEach((l) => {
398
- l();
399
- }), qn(t, "main"), delete e._qripple);
400
- }
401
- }
402
- ), Vn = {
403
- left: "start",
404
- center: "center",
405
- right: "end",
406
- between: "between",
407
- around: "around",
408
- evenly: "evenly",
409
- stretch: "stretch"
410
- }, No = Object.keys(Vn), Wo = {
411
- align: {
412
- type: String,
413
- validator: (e) => No.includes(e)
414
- }
415
- };
416
- function Ko(e) {
417
- return d(() => {
418
- const t = e.align === void 0 ? e.vertical === !0 ? "stretch" : "left" : e.align;
419
- return `${e.vertical === !0 ? "items" : "justify"}-${Vn[t]}`;
420
- });
421
- }
422
- function Qt(e) {
423
- if (Object(e.$parent) === e.$parent)
424
- return e.$parent;
425
- let { parent: t } = e.$;
426
- for (; Object(t) === t; ) {
427
- if (Object(t.proxy) === t.proxy)
428
- return t.proxy;
429
- t = t.parent;
430
- }
431
- }
432
- function Bn(e) {
433
- return e.appContext.config.globalProperties.$router !== void 0;
434
- }
435
- function Tn(e) {
436
- return e.isUnmounted === !0 || e.isDeactivated === !0;
437
- }
438
- function Al(e) {
439
- return e ? e.aliasOf ? e.aliasOf.path : e.path : "";
440
- }
441
- function Ol(e, t) {
442
- return (e.aliasOf || e) === (t.aliasOf || t);
443
- }
444
- function Qo(e, t) {
445
- for (const l in t) {
446
- const n = t[l], o = e[l];
447
- if (typeof n == "string") {
448
- if (n !== o)
449
- return !1;
450
- } else if (Array.isArray(o) === !1 || o.length !== n.length || n.some((u, a) => u !== o[a]))
451
- return !1;
452
- }
453
- return !0;
454
- }
455
- function Pl(e, t) {
456
- return Array.isArray(t) === !0 ? e.length === t.length && e.every((l, n) => l === t[n]) : e.length === 1 && e[0] === t;
457
- }
458
- function Uo(e, t) {
459
- return Array.isArray(e) === !0 ? Pl(e, t) : Array.isArray(t) === !0 ? Pl(t, e) : e === t;
460
- }
461
- function Yo(e, t) {
462
- if (Object.keys(e).length !== Object.keys(t).length)
463
- return !1;
464
- for (const l in e)
465
- if (Uo(e[l], t[l]) === !1)
466
- return !1;
467
- return !0;
468
- }
469
- const $n = {
470
- // router-link
471
- to: [String, Object],
472
- replace: Boolean,
473
- // regular <a> link
474
- href: String,
475
- target: String,
476
- // state
477
- disable: Boolean
478
- }, Xo = {
479
- ...$n,
480
- // router-link
481
- exact: Boolean,
482
- activeClass: {
483
- type: String,
484
- default: "q-router-link--active"
485
- },
486
- exactActiveClass: {
487
- type: String,
488
- default: "q-router-link--exact-active"
489
- }
490
- };
491
- function Rn({ fallbackTag: e, useDisableForRouterLinkProps: t = !0 } = {}) {
492
- const l = ne(), { props: n, proxy: o, emit: u } = l, a = Bn(l), r = d(() => n.disable !== !0 && n.href !== void 0), h = t === !0 ? d(
493
- () => a === !0 && n.disable !== !0 && r.value !== !0 && n.to !== void 0 && n.to !== null && n.to !== ""
494
- ) : d(
495
- () => a === !0 && r.value !== !0 && n.to !== void 0 && n.to !== null && n.to !== ""
496
- ), b = d(() => h.value === !0 ? T(n.to) : null), s = d(() => b.value !== null), y = d(() => r.value === !0 || s.value === !0), v = d(() => n.type === "a" || y.value === !0 ? "a" : n.tag || e || "div"), c = d(() => r.value === !0 ? {
497
- href: n.href,
498
- target: n.target
499
- } : s.value === !0 ? {
500
- href: b.value.href,
501
- target: n.target
502
- } : {}), m = d(() => {
503
- if (s.value === !1)
504
- return -1;
505
- const { matched: R } = b.value, { length: B } = R, A = R[B - 1];
506
- if (A === void 0)
507
- return -1;
508
- const z = o.$route.matched;
509
- if (z.length === 0)
510
- return -1;
511
- const N = z.findIndex(
512
- Ol.bind(null, A)
513
- );
514
- if (N !== -1)
515
- return N;
516
- const J = Al(R[B - 2]);
517
- return (
518
- // we are dealing with nested routes
519
- B > 1 && Al(A) === J && z[z.length - 1].path !== J ? z.findIndex(
520
- Ol.bind(null, R[B - 2])
521
- ) : N
522
- );
523
- }), C = d(
524
- () => s.value === !0 && m.value !== -1 && Qo(o.$route.params, b.value.params)
525
- ), p = d(
526
- () => C.value === !0 && m.value === o.$route.matched.length - 1 && Yo(o.$route.params, b.value.params)
527
- ), O = d(() => s.value === !0 ? p.value === !0 ? ` ${n.exactActiveClass} ${n.activeClass}` : n.exact === !0 ? "" : C.value === !0 ? ` ${n.activeClass}` : "" : "");
528
- function T(R) {
529
- try {
530
- return o.$router.resolve(R);
531
- } catch {
532
- }
533
- return null;
534
- }
535
- function k(R, { returnRouterError: B, to: A = n.to, replace: z = n.replace } = {}) {
536
- if (n.disable === !0)
537
- return R.preventDefault(), Promise.resolve(!1);
538
- if (
539
- // don't redirect with control keys;
540
- // should match RouterLink from Vue Router
541
- R.metaKey || R.altKey || R.ctrlKey || R.shiftKey || R.button !== void 0 && R.button !== 0 || n.target === "_blank"
542
- )
543
- return Promise.resolve(!1);
544
- R.preventDefault();
545
- const N = o.$router[z === !0 ? "replace" : "push"](A);
546
- return B === !0 ? N : N.then(() => {
547
- }).catch(() => {
548
- });
549
- }
550
- function M(R) {
551
- if (s.value === !0) {
552
- const B = (A) => k(R, A);
553
- u("click", R, B), R.defaultPrevented !== !0 && B();
554
- } else
555
- u("click", R);
556
- }
557
- return {
558
- hasRouterLink: s,
559
- hasHrefLink: r,
560
- hasLink: y,
561
- linkTag: v,
562
- resolvedLink: b,
563
- linkIsActive: C,
564
- linkIsExactActive: p,
565
- linkClass: O,
566
- linkAttrs: c,
567
- getLink: T,
568
- navigateToRouterLink: k,
569
- navigateOnClick: M
570
- };
571
- }
572
- const zl = {
573
- none: 0,
574
- xs: 4,
575
- sm: 8,
576
- md: 16,
577
- lg: 24,
578
- xl: 32
579
- }, Go = {
580
- xs: 8,
581
- sm: 10,
582
- md: 14,
583
- lg: 20,
584
- xl: 24
585
- }, Zo = ["button", "submit", "reset"], Jo = /[^\s]\/[^\s]/, ei = ["flat", "outline", "push", "unelevated"];
586
- function ti(e, t) {
587
- return e.flat === !0 ? "flat" : e.outline === !0 ? "outline" : e.push === !0 ? "push" : e.unelevated === !0 ? "unelevated" : t;
588
- }
589
- const li = {
590
- ...zt,
591
- ...$n,
592
- type: {
593
- type: String,
594
- default: "button"
595
- },
596
- label: [Number, String],
597
- icon: String,
598
- iconRight: String,
599
- ...ei.reduce(
600
- (e, t) => (e[t] = Boolean) && e,
601
- {}
602
- ),
603
- square: Boolean,
604
- rounded: Boolean,
605
- glossy: Boolean,
606
- size: String,
607
- fab: Boolean,
608
- fabMini: Boolean,
609
- padding: String,
610
- color: String,
611
- textColor: String,
612
- noCaps: Boolean,
613
- noWrap: Boolean,
614
- dense: Boolean,
615
- tabindex: [Number, String],
616
- ripple: {
617
- type: [Boolean, Object],
618
- default: !0
619
- },
620
- align: {
621
- ...Wo.align,
622
- default: "center"
623
- },
624
- stack: Boolean,
625
- stretch: Boolean,
626
- loading: {
627
- type: Boolean,
628
- default: null
629
- },
630
- disable: Boolean
631
- }, ni = {
632
- ...li,
633
- round: Boolean
634
- };
635
- function oi(e) {
636
- const t = Ft(e, Go), l = Ko(e), { hasRouterLink: n, hasLink: o, linkTag: u, linkAttrs: a, navigateOnClick: r } = Rn({
637
- fallbackTag: "button"
638
- }), h = d(() => {
639
- const p = e.fab === !1 && e.fabMini === !1 ? t.value : {};
640
- return e.padding !== void 0 ? Object.assign({}, p, {
641
- padding: e.padding.split(/\s+/).map((O) => O in zl ? zl[O] + "px" : O).join(" "),
642
- minWidth: "0",
643
- minHeight: "0"
644
- }) : p;
645
- }), b = d(
646
- () => e.rounded === !0 || e.fab === !0 || e.fabMini === !0
647
- ), s = d(
648
- () => e.disable !== !0 && e.loading !== !0
649
- ), y = d(() => s.value === !0 ? e.tabindex || 0 : -1), v = d(() => ti(e, "standard")), c = d(() => {
650
- const p = { tabindex: y.value };
651
- return o.value === !0 ? Object.assign(p, a.value) : Zo.includes(e.type) === !0 && (p.type = e.type), u.value === "a" ? (e.disable === !0 ? p["aria-disabled"] = "true" : p.href === void 0 && (p.role = "button"), n.value !== !0 && Jo.test(e.type) === !0 && (p.type = e.type)) : e.disable === !0 && (p.disabled = "", p["aria-disabled"] = "true"), e.loading === !0 && e.percentage !== void 0 && Object.assign(p, {
652
- role: "progressbar",
653
- "aria-valuemin": 0,
654
- "aria-valuemax": 100,
655
- "aria-valuenow": e.percentage
656
- }), p;
657
- }), m = d(() => {
658
- let p;
659
- e.color !== void 0 ? e.flat === !0 || e.outline === !0 ? p = `text-${e.textColor || e.color}` : p = `bg-${e.color} text-${e.textColor || "white"}` : e.textColor && (p = `text-${e.textColor}`);
660
- const O = e.round === !0 ? "round" : `rectangle${b.value === !0 ? " q-btn--rounded" : e.square === !0 ? " q-btn--square" : ""}`;
661
- return `q-btn--${v.value} q-btn--${O}` + (p !== void 0 ? " " + p : "") + (s.value === !0 ? " q-btn--actionable q-focusable q-hoverable" : e.disable === !0 ? " disabled" : "") + (e.fab === !0 ? " q-btn--fab" : e.fabMini === !0 ? " q-btn--fab-mini" : "") + (e.noCaps === !0 ? " q-btn--no-uppercase" : "") + (e.dense === !0 ? " q-btn--dense" : "") + (e.stretch === !0 ? " no-border-radius self-stretch" : "") + (e.glossy === !0 ? " glossy" : "") + (e.square ? " q-btn--square" : "");
662
- }), C = d(
663
- () => l.value + (e.stack === !0 ? " column" : " row") + (e.noWrap === !0 ? " no-wrap text-no-wrap" : "") + (e.loading === !0 ? " q-btn__content--hidden" : "")
664
- );
665
- return {
666
- classes: m,
667
- style: h,
668
- innerClasses: C,
669
- attributes: c,
670
- hasLink: o,
671
- linkTag: u,
672
- navigateOnClick: r,
673
- isActionable: s
674
- };
675
- }
676
- const { passiveCapture: ge } = re;
677
- let Ye = null, Xe = null, Ge = null;
678
- const ii = he({
679
- name: "QBtn",
680
- props: {
681
- ...ni,
682
- percentage: Number,
683
- darkPercentage: Boolean,
684
- onTouchstart: [Function, Array]
685
- },
686
- emits: ["click", "keydown", "mousedown", "keyup"],
687
- setup(e, { slots: t, emit: l }) {
688
- const { proxy: n } = ne(), {
689
- classes: o,
690
- style: u,
691
- innerClasses: a,
692
- attributes: r,
693
- hasLink: h,
694
- linkTag: b,
695
- navigateOnClick: s,
696
- isActionable: y
697
- } = oi(e), v = P(null), c = P(null);
698
- let m = null, C, p = null;
699
- const O = d(
700
- () => e.label !== void 0 && e.label !== null && e.label !== ""
701
- ), T = d(() => e.disable === !0 || e.ripple === !1 ? !1 : {
702
- keyCodes: h.value === !0 ? [13, 32] : [13],
703
- ...e.ripple === !0 ? {} : e.ripple
704
- }), k = d(() => ({ center: e.round })), M = d(() => {
705
- const V = Math.max(0, Math.min(100, e.percentage));
706
- return V > 0 ? { transition: "transform 0.6s", transform: `translateX(${V - 100}%)` } : {};
707
- }), R = d(() => {
708
- if (e.loading === !0)
709
- return {
710
- onMousedown: K,
711
- onTouchstart: K,
712
- onClick: K,
713
- onKeydown: K,
714
- onKeyup: K
715
- };
716
- if (y.value === !0) {
717
- const V = {
718
- onClick: A,
719
- onKeydown: z,
720
- onMousedown: J
721
- };
722
- if (n.$q.platform.has.touch === !0) {
723
- const D = e.onTouchstart !== void 0 ? "" : "Passive";
724
- V[`onTouchstart${D}`] = N;
725
- }
726
- return V;
727
- }
728
- return {
729
- // needed; especially for disabled <a> tags
730
- onClick: le
731
- };
732
- }), B = d(() => ({
733
- ref: v,
734
- class: "q-btn q-btn-item non-selectable no-outline " + o.value,
735
- style: u.value,
736
- ...r.value,
737
- ...R.value
738
- }));
739
- function A(V) {
740
- if (v.value !== null) {
741
- if (V !== void 0) {
742
- if (V.defaultPrevented === !0)
743
- return;
744
- const D = document.activeElement;
745
- if (e.type === "submit" && D !== document.body && v.value.contains(D) === !1 && D.contains(v.value) === !1) {
746
- v.value.focus();
747
- const X = () => {
748
- document.removeEventListener("keydown", le, !0), document.removeEventListener("keyup", X, ge), v.value !== null && v.value.removeEventListener("blur", X, ge);
749
- };
750
- document.addEventListener("keydown", le, !0), document.addEventListener("keyup", X, ge), v.value.addEventListener("blur", X, ge);
751
- }
752
- }
753
- s(V);
754
- }
755
- }
756
- function z(V) {
757
- v.value !== null && (l("keydown", V), Ie(V, [13, 32]) === !0 && Xe !== v.value && (Xe !== null && L(), V.defaultPrevented !== !0 && (v.value.focus(), Xe = v.value, v.value.classList.add("q-btn--active"), document.addEventListener("keyup", U, !0), v.value.addEventListener("blur", U, ge)), le(V)));
758
- }
759
- function N(V) {
760
- v.value !== null && (l("touchstart", V), V.defaultPrevented !== !0 && (Ye !== v.value && (Ye !== null && L(), Ye = v.value, m = V.target, m.addEventListener("touchcancel", U, ge), m.addEventListener("touchend", U, ge)), C = !0, p !== null && clearTimeout(p), p = setTimeout(() => {
761
- p = null, C = !1;
762
- }, 200)));
763
- }
764
- function J(V) {
765
- v.value !== null && (V.qSkipRipple = C === !0, l("mousedown", V), V.defaultPrevented !== !0 && Ge !== v.value && (Ge !== null && L(), Ge = v.value, v.value.classList.add("q-btn--active"), document.addEventListener("mouseup", U, ge)));
766
- }
767
- function U(V) {
768
- if (v.value !== null && !(V !== void 0 && V.type === "blur" && document.activeElement === v.value)) {
769
- if (V !== void 0 && V.type === "keyup") {
770
- if (Xe === v.value && Ie(V, [13, 32]) === !0) {
771
- const D = new MouseEvent("click", V);
772
- D.qKeyEvent = !0, V.defaultPrevented === !0 && be(D), V.cancelBubble === !0 && Ee(D), v.value.dispatchEvent(D), le(V), V.qKeyEvent = !0;
773
- }
774
- l("keyup", V);
775
- }
776
- L();
777
- }
778
- }
779
- function L(V) {
780
- const D = c.value;
781
- V !== !0 && (Ye === v.value || Ge === v.value) && D !== null && D !== document.activeElement && (D.setAttribute("tabindex", -1), D.focus()), Ye === v.value && (m !== null && (m.removeEventListener("touchcancel", U, ge), m.removeEventListener("touchend", U, ge)), Ye = m = null), Ge === v.value && (document.removeEventListener("mouseup", U, ge), Ge = null), Xe === v.value && (document.removeEventListener("keyup", U, !0), v.value !== null && v.value.removeEventListener("blur", U, ge), Xe = null), v.value !== null && v.value.classList.remove("q-btn--active");
782
- }
783
- function K(V) {
784
- le(V), V.qSkipRipple = !0;
785
- }
786
- return me(() => {
787
- L(!0);
788
- }), Object.assign(n, {
789
- click: (V) => {
790
- y.value === !0 && A(V);
791
- }
792
- }), () => {
793
- let V = [];
794
- e.icon !== void 0 && V.push(
795
- g(_e, {
796
- name: e.icon,
797
- left: e.stack !== !0 && O.value === !0,
798
- role: "img"
799
- })
800
- ), O.value === !0 && V.push(
801
- g("span", { class: "block" }, [e.label])
802
- ), V = Ae(t.default, V), e.iconRight !== void 0 && e.round === !1 && V.push(
803
- g(_e, {
804
- name: e.iconRight,
805
- right: e.stack !== !0 && O.value === !0,
806
- role: "img"
807
- })
808
- );
809
- const D = [
810
- g("span", {
811
- class: "q-focus-helper",
812
- ref: c
813
- })
814
- ];
815
- return e.loading === !0 && e.percentage !== void 0 && D.push(
816
- g("span", {
817
- class: "q-btn__progress absolute-full overflow-hidden" + (e.darkPercentage === !0 ? " q-btn__progress--dark" : "")
818
- }, [
819
- g("span", {
820
- class: "q-btn__progress-indicator fit block",
821
- style: M.value
822
- })
823
- ])
824
- ), D.push(
825
- g("span", {
826
- class: "q-btn__content text-center col items-center q-anchor--skip " + a.value
827
- }, V)
828
- ), e.loading !== null && D.push(
829
- g(dt, {
830
- name: "q-transition--fade"
831
- }, () => e.loading === !0 ? [
832
- g("span", {
833
- key: "loading",
834
- class: "absolute-full flex flex-center"
835
- }, t.loading !== void 0 ? t.loading() : [g(kn)])
836
- ] : null)
837
- ), vn(
838
- g(
839
- b.value,
840
- B.value,
841
- D
842
- ),
843
- [[
844
- En,
845
- T.value,
846
- void 0,
847
- k.value
848
- ]]
849
- );
850
- };
851
- }
852
- }), ui = /* @__PURE__ */ mt({
853
- __name: "index",
854
- props: {
855
- size: { default: qe.MD },
856
- transparent: { type: Boolean },
857
- flat: { type: Boolean },
858
- rounded: { type: Boolean },
859
- color: { default: bn.PRIMARY },
860
- iconLeft: {},
861
- iconRight: {},
862
- iconMiddle: {},
863
- disabled: { type: Boolean },
864
- loading: { type: Boolean },
865
- to: {},
866
- href: {},
867
- target: {},
868
- submit: { type: Boolean },
869
- ariaLabel: {},
870
- label: {}
871
- },
872
- emits: ["click"],
873
- setup(e) {
874
- const t = e, l = d(() => [
875
- "app-btn",
876
- {
877
- "app-btn_default": !t.transparent && !t.flat,
878
- "app-btn_trans": t.transparent,
879
- "app-btn_flat": t.flat,
880
- "app-btn_rounded": t.rounded,
881
- "app-btn_sm": t.size === qe.SM,
882
- "app-btn_md": t.size === qe.MD,
883
- "app-btn_lg": t.size === qe.LG,
884
- "app-btn_icon-left": t.iconLeft,
885
- "app-btn_icon-right": t.iconRight,
886
- "app-btn_icon-middle": t.iconMiddle
887
- },
888
- `app-btn_${t.color}`
889
- ]);
890
- return (n, o) => (ue(), $t(st(ii), {
891
- "no-caps": "",
892
- unelevated: "",
893
- class: Be(l.value),
894
- padding: st(_o)[n.size || st(qe).MD],
895
- loading: n.loading,
896
- disable: n.disabled || void 0,
897
- to: n.to,
898
- href: n.href,
899
- target: n.target,
900
- type: n.submit ? "submit" : void 0,
901
- "aria-label": n.ariaLabel,
902
- onClick: o[0] || (o[0] = (u) => n.$emit("click", u))
903
- }, {
904
- default: xe(() => [
905
- n.iconLeft || n.iconMiddle ? (ue(), de("i", {
906
- key: 0,
907
- class: Be([
908
- "icon-kl",
909
- n.iconLeft ? "icon-kl_left" : "icon-kl_middle",
910
- `icon-kl-${n.iconLeft || n.iconMiddle}`,
911
- n.transparent || n.flat ? `text-${n.color}` : "text-secondary"
912
- ])
913
- }, null, 2)) : Ce("", !0),
914
- bo(n.$slots, "default", {}, void 0, !0),
915
- n.label ? (ue(), de(at, { key: 1 }, [
916
- Bt(Ze(n.label), 1)
917
- ], 64)) : Ce("", !0),
918
- n.iconRight ? (ue(), de("i", {
919
- key: 2,
920
- class: Be([
921
- "icon-kl",
922
- "icon-kl_right",
923
- `icon-kl-${n.iconRight}`,
924
- n.transparent ? `text-${n.color}` : "text-secondary"
925
- ])
926
- }, null, 2)) : Ce("", !0)
927
- ]),
928
- _: 3
929
- }, 8, ["class", "padding", "loading", "disable", "to", "href", "target", "type", "aria-label"]));
930
- }
931
- }), fl = (e, t) => {
932
- const l = e.__vccOpts || e;
933
- for (const [n, o] of t)
934
- l[n] = o;
935
- return l;
936
- }, ai = /* @__PURE__ */ fl(ui, [["__scopeId", "data-v-59859915"]]), ft = P(
937
- !1
938
- );
939
- let ul;
940
- function ri(e, t) {
941
- const l = /(edg|edge|edga|edgios)\/([\w.]+)/.exec(e) || /(opr)[\/]([\w.]+)/.exec(e) || /(vivaldi)[\/]([\w.]+)/.exec(e) || /(chrome|crios)[\/]([\w.]+)/.exec(e) || /(version)(applewebkit)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(e) || /(webkit)[\/]([\w.]+).*(version)[\/]([\w.]+).*(safari)[\/]([\w.]+)/.exec(e) || /(firefox|fxios)[\/]([\w.]+)/.exec(e) || /(webkit)[\/]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[\/]([\w.]+)/.exec(e) || [];
942
- return {
943
- browser: l[5] || l[3] || l[1] || "",
944
- version: l[4] || l[2] || "0",
945
- platform: t[0] || ""
946
- };
947
- }
948
- function si(e) {
949
- return /(ipad)/.exec(e) || /(ipod)/.exec(e) || /(windows phone)/.exec(e) || /(iphone)/.exec(e) || /(kindle)/.exec(e) || /(silk)/.exec(e) || /(android)/.exec(e) || /(win)/.exec(e) || /(mac)/.exec(e) || /(linux)/.exec(e) || /(cros)/.exec(e) || /(playbook)/.exec(e) || /(bb)/.exec(e) || /(blackberry)/.exec(e) || [];
950
- }
951
- const Ln = "ontouchstart" in window || window.navigator.maxTouchPoints > 0;
952
- function ci(e) {
953
- const t = e.toLowerCase(), l = si(t), n = ri(t, l), o = {
954
- mobile: !1,
955
- desktop: !1,
956
- cordova: !1,
957
- capacitor: !1,
958
- nativeMobile: !1,
959
- // nativeMobileWrapper: void 0,
960
- electron: !1,
961
- bex: !1,
962
- linux: !1,
963
- mac: !1,
964
- win: !1,
965
- cros: !1,
966
- chrome: !1,
967
- firefox: !1,
968
- opera: !1,
969
- safari: !1,
970
- vivaldi: !1,
971
- edge: !1,
972
- edgeChromium: !1,
973
- ie: !1,
974
- webkit: !1,
975
- android: !1,
976
- ios: !1,
977
- ipad: !1,
978
- iphone: !1,
979
- ipod: !1,
980
- kindle: !1,
981
- winphone: !1,
982
- blackberry: !1,
983
- playbook: !1,
984
- silk: !1
985
- };
986
- n.browser && (o[n.browser] = !0, o.version = n.version, o.versionNumber = parseInt(n.version, 10)), n.platform && (o[n.platform] = !0);
987
- const u = o.android || o.ios || o.bb || o.blackberry || o.ipad || o.iphone || o.ipod || o.kindle || o.playbook || o.silk || o["windows phone"];
988
- if (u === !0 || t.indexOf("mobile") !== -1 ? o.mobile = !0 : o.desktop = !0, o["windows phone"] && (o.winphone = !0, delete o["windows phone"]), o.edga || o.edgios || o.edg ? (o.edge = !0, n.browser = "edge") : o.crios ? (o.chrome = !0, n.browser = "chrome") : o.fxios && (o.firefox = !0, n.browser = "firefox"), (o.ipod || o.ipad || o.iphone) && (o.ios = !0), o.vivaldi && (n.browser = "vivaldi", o.vivaldi = !0), // Chrome, Opera 15+, Vivaldi and Safari are webkit based browsers
989
- (o.chrome || o.opr || o.safari || o.vivaldi || o.mobile === !0 && o.ios !== !0 && u !== !0) && (o.webkit = !0), o.opr && (n.browser = "opera", o.opera = !0), o.safari && (o.blackberry || o.bb ? (n.browser = "blackberry", o.blackberry = !0) : o.playbook ? (n.browser = "playbook", o.playbook = !0) : o.android ? (n.browser = "android", o.android = !0) : o.kindle ? (n.browser = "kindle", o.kindle = !0) : o.silk && (n.browser = "silk", o.silk = !0)), o.name = n.browser, o.platform = n.platform, t.indexOf("electron") !== -1)
990
- o.electron = !0;
991
- else if (document.location.href.indexOf("-extension://") !== -1)
992
- o.bex = !0;
993
- else {
994
- if (window.Capacitor !== void 0 ? (o.capacitor = !0, o.nativeMobile = !0, o.nativeMobileWrapper = "capacitor") : (window._cordovaNative !== void 0 || window.cordova !== void 0) && (o.cordova = !0, o.nativeMobile = !0, o.nativeMobileWrapper = "cordova"), ft.value === !0 && (ul = { is: { ...o } }), Ln === !0 && o.mac === !0 && (o.desktop === !0 && o.safari === !0 || o.nativeMobile === !0 && o.android !== !0 && o.ios !== !0 && o.ipad !== !0)) {
995
- delete o.mac, delete o.desktop;
996
- const a = Math.min(window.innerHeight, window.innerWidth) > 414 ? "ipad" : "iphone";
997
- Object.assign(o, {
998
- mobile: !0,
999
- ios: !0,
1000
- platform: a,
1001
- [a]: !0
1002
- });
1003
- }
1004
- o.mobile !== !0 && window.navigator.userAgentData && window.navigator.userAgentData.mobile && (delete o.desktop, o.mobile = !0);
1005
- }
1006
- return o;
1007
- }
1008
- const Fl = navigator.userAgent || navigator.vendor || window.opera, di = {
1009
- has: {
1010
- touch: !1,
1011
- webStorage: !1
1012
- },
1013
- within: { iframe: !1 }
1014
- }, ve = {
1015
- userAgent: Fl,
1016
- is: ci(Fl),
1017
- has: {
1018
- touch: Ln
1019
- },
1020
- within: {
1021
- iframe: window.self !== window.top
1022
- }
1023
- }, al = {
1024
- install(e) {
1025
- const { $q: t } = e;
1026
- ft.value === !0 ? (e.onSSRHydrated.push(() => {
1027
- Object.assign(t.platform, ve), ft.value = !1;
1028
- }), t.platform = yo(this)) : t.platform = this;
1029
- }
1030
- };
1031
- {
1032
- let e;
1033
- dl(ve.has, "webStorage", () => {
1034
- if (e !== void 0)
1035
- return e;
1036
- try {
1037
- if (window.localStorage)
1038
- return e = !0, !0;
1039
- } catch {
1040
- }
1041
- return e = !1, !1;
1042
- }), Object.assign(al, ve), ft.value === !0 && (Object.assign(al, ul, di), ul = null);
1043
- }
1044
- const Pe = [];
1045
- function Mn(e) {
1046
- Pe[Pe.length - 1](e);
1047
- }
1048
- function vl(e) {
1049
- ve.is.desktop === !0 && (Pe.push(e), Pe.length === 1 && document.body.addEventListener("focusin", Mn));
1050
- }
1051
- function Rt(e) {
1052
- const t = Pe.indexOf(e);
1053
- t !== -1 && (Pe.splice(t, 1), Pe.length === 0 && document.body.removeEventListener("focusin", Mn));
1054
- }
1055
- function fi(e) {
1056
- const t = document.createElement("textarea");
1057
- t.value = e, t.contentEditable = "true", t.style.position = "fixed";
1058
- const l = () => {
1059
- };
1060
- vl(l), document.body.appendChild(t), t.focus(), t.select();
1061
- const n = document.execCommand("copy");
1062
- return t.remove(), Rt(l), n;
1063
- }
1064
- function vi(e) {
1065
- return navigator.clipboard !== void 0 ? navigator.clipboard.writeText(e) : new Promise((t, l) => {
1066
- const n = fi(e);
1067
- n ? t(!0) : l(n);
1068
- });
1069
- }
1070
- const Ut = {
1071
- COPY: "copy_o",
1072
- COPIED: "copied_o"
1073
- }, Au = /* @__PURE__ */ mt({
1074
- __name: "index",
1075
- props: {
1076
- text: {},
1077
- size: {},
1078
- transparent: { type: Boolean, default: !0 },
1079
- flat: { type: Boolean },
1080
- rounded: { type: Boolean },
1081
- color: { default: bn.INFO },
1082
- iconLeft: {},
1083
- iconRight: {},
1084
- iconMiddle: {},
1085
- disabled: { type: Boolean },
1086
- loading: { type: Boolean },
1087
- to: {},
1088
- href: {},
1089
- target: {},
1090
- submit: { type: Boolean },
1091
- ariaLabel: {},
1092
- label: {}
1093
- },
1094
- setup(e) {
1095
- const t = e, l = P(Ut.COPY), n = () => {
1096
- l.value = Ut.COPIED, setTimeout(() => {
1097
- l.value = Ut.COPY;
1098
- }, 2e3);
1099
- }, o = () => {
1100
- vi(t.text).then(n).catch((u) => {
1101
- console.log(u);
1102
- });
1103
- };
1104
- return (u, a) => (ue(), $t(ai, mn(t, {
1105
- "icon-middle": l.value,
1106
- onClick: hn(o, ["prevent"])
1107
- }), null, 16, ["icon-middle"]));
1108
- }
1109
- }), gt = {
1110
- dark: {
1111
- type: Boolean,
1112
- default: null
1113
- }
1114
- };
1115
- function pt(e, t) {
1116
- return d(() => e.dark === null ? t.dark.isActive : e.dark);
1117
- }
1118
- function mi(e, t) {
1119
- const l = P(null), n = d(() => e.disable === !0 ? null : g("span", {
1120
- ref: l,
1121
- class: "no-outline",
1122
- tabindex: -1
1123
- }));
1124
- function o(u) {
1125
- const a = t.value;
1126
- u !== void 0 && u.type.indexOf("key") === 0 ? a !== null && document.activeElement !== a && a.contains(document.activeElement) === !0 && a.focus() : l.value !== null && (u === void 0 || a !== null && a.contains(u.target) === !0) && l.value.focus();
1127
- }
1128
- return {
1129
- refocusTargetEl: n,
1130
- refocusTarget: o
1131
- };
1132
- }
1133
- const An = {
1134
- name: String
1135
- };
1136
- function hi(e = {}) {
1137
- return (t, l, n) => {
1138
- t[l](
1139
- g("input", {
1140
- class: "hidden" + (n || ""),
1141
- ...e.value
1142
- })
1143
- );
1144
- };
1145
- }
1146
- function gi(e) {
1147
- return d(() => e.name || e.for);
1148
- }
1149
- const pi = {
1150
- xs: 30,
1151
- sm: 35,
1152
- md: 40,
1153
- lg: 50,
1154
- xl: 60
1155
- }, bi = {
1156
- ...gt,
1157
- ...zt,
1158
- ...An,
1159
- modelValue: {
1160
- required: !0,
1161
- default: null
1162
- },
1163
- val: {},
1164
- trueValue: { default: !0 },
1165
- falseValue: { default: !1 },
1166
- indeterminateValue: { default: null },
1167
- checkedIcon: String,
1168
- uncheckedIcon: String,
1169
- indeterminateIcon: String,
1170
- toggleOrder: {
1171
- type: String,
1172
- validator: (e) => e === "tf" || e === "ft"
1173
- },
1174
- toggleIndeterminate: Boolean,
1175
- label: String,
1176
- leftLabel: Boolean,
1177
- color: String,
1178
- keepColor: Boolean,
1179
- dense: Boolean,
1180
- disable: Boolean,
1181
- tabindex: [String, Number]
1182
- }, yi = ["update:modelValue"];
1183
- function wi(e, t) {
1184
- const { props: l, slots: n, emit: o, proxy: u } = ne(), { $q: a } = u, r = pt(l, a), h = P(null), { refocusTargetEl: b, refocusTarget: s } = mi(l, h), y = Ft(l, pi), v = d(
1185
- () => l.val !== void 0 && Array.isArray(l.modelValue)
1186
- ), c = d(() => {
1187
- const L = Ue(l.val);
1188
- return v.value === !0 ? l.modelValue.findIndex((K) => Ue(K) === L) : -1;
1189
- }), m = d(() => v.value === !0 ? c.value !== -1 : Ue(l.modelValue) === Ue(l.trueValue)), C = d(() => v.value === !0 ? c.value === -1 : Ue(l.modelValue) === Ue(l.falseValue)), p = d(
1190
- () => m.value === !1 && C.value === !1
1191
- ), O = d(() => l.disable === !0 ? -1 : l.tabindex || 0), T = d(
1192
- () => `q-${e} cursor-pointer no-outline row inline no-wrap items-center` + (l.disable === !0 ? " disabled" : "") + (r.value === !0 ? ` q-${e}--dark` : "") + (l.dense === !0 ? ` q-${e}--dense` : "") + (l.leftLabel === !0 ? " reverse" : "")
1193
- ), k = d(() => {
1194
- const L = m.value === !0 ? "truthy" : C.value === !0 ? "falsy" : "indet", K = l.color !== void 0 && (l.keepColor === !0 || C.value !== !0) ? ` text-${l.color}` : "";
1195
- return `q-${e}__inner relative-position non-selectable q-${e}__inner--${L}${K}`;
1196
- }), M = d(() => {
1197
- const L = { type: "checkbox" };
1198
- return l.name !== void 0 && Object.assign(L, {
1199
- // see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
1200
- ".checked": m.value,
1201
- "^checked": m.value === !0 ? "checked" : void 0,
1202
- name: l.name,
1203
- value: v.value === !0 ? l.val : l.trueValue
1204
- }), L;
1205
- }), R = hi(M), B = d(() => {
1206
- const L = {
1207
- tabindex: O.value,
1208
- role: "checkbox",
1209
- "aria-label": l.label,
1210
- "aria-checked": p.value === !0 ? "mixed" : m.value === !0 ? "true" : "false"
1211
- };
1212
- return l.disable === !0 && (L["aria-disabled"] = "true"), L;
1213
- });
1214
- function A(L) {
1215
- L !== void 0 && (le(L), s(L)), l.disable !== !0 && o("update:modelValue", z(), L);
1216
- }
1217
- function z() {
1218
- if (v.value === !0) {
1219
- if (m.value === !0) {
1220
- const L = l.modelValue.slice();
1221
- return L.splice(c.value, 1), L;
1222
- }
1223
- return l.modelValue.concat([l.val]);
1224
- }
1225
- if (m.value === !0) {
1226
- if (l.toggleOrder !== "ft" || l.toggleIndeterminate === !1)
1227
- return l.falseValue;
1228
- } else if (C.value === !0) {
1229
- if (l.toggleOrder === "ft" || l.toggleIndeterminate === !1)
1230
- return l.trueValue;
1231
- } else
1232
- return l.toggleOrder !== "ft" ? l.trueValue : l.falseValue;
1233
- return l.indeterminateValue;
1234
- }
1235
- function N(L) {
1236
- (L.keyCode === 13 || L.keyCode === 32) && le(L);
1237
- }
1238
- function J(L) {
1239
- (L.keyCode === 13 || L.keyCode === 32) && A(L);
1240
- }
1241
- const U = t(m, p);
1242
- return Object.assign(u, { toggle: A }), () => {
1243
- const L = U();
1244
- l.disable !== !0 && R(
1245
- L,
1246
- "unshift",
1247
- ` q-${e}__native absolute q-ma-none q-pa-none`
1248
- );
1249
- const K = [
1250
- g("div", {
1251
- class: k.value,
1252
- style: y.value,
1253
- "aria-hidden": "true"
1254
- }, L)
1255
- ];
1256
- b.value !== null && K.push(b.value);
1257
- const V = l.label !== void 0 ? Ae(n.default, [l.label]) : ke(n.default);
1258
- return V !== void 0 && K.push(
1259
- g("div", {
1260
- class: `q-${e}__label q-anchor--skip`
1261
- }, V)
1262
- ), g("div", {
1263
- ref: h,
1264
- class: T.value,
1265
- ...B.value,
1266
- onClick: A,
1267
- onKeydown: N,
1268
- onKeyup: J
1269
- }, K);
1270
- };
1271
- }
1272
- const Si = () => g("div", {
1273
- key: "svg",
1274
- class: "q-checkbox__bg absolute"
1275
- }, [
1276
- g("svg", {
1277
- class: "q-checkbox__svg fit absolute-full",
1278
- viewBox: "0 0 24 24"
1279
- }, [
1280
- g("path", {
1281
- class: "q-checkbox__truthy",
1282
- fill: "none",
1283
- d: "M1.73,12.91 8.1,19.28 22.79,4.59"
1284
- }),
1285
- g("path", {
1286
- class: "q-checkbox__indet",
1287
- d: "M4,14H20V10H4"
1288
- })
1289
- ])
1290
- ]), ki = he({
1291
- name: "QCheckbox",
1292
- props: bi,
1293
- emits: yi,
1294
- setup(e) {
1295
- const t = Si();
1296
- function l(n, o) {
1297
- const u = d(
1298
- () => (n.value === !0 ? e.checkedIcon : o.value === !0 ? e.indeterminateIcon : e.uncheckedIcon) || null
1299
- );
1300
- return () => u.value !== null ? [
1301
- g("div", {
1302
- key: "icon",
1303
- class: "q-checkbox__icon-container absolute-full flex flex-center no-wrap"
1304
- }, [
1305
- g(_e, {
1306
- class: "q-checkbox__icon",
1307
- name: u.value
1308
- })
1309
- ])
1310
- ] : [t];
1311
- }
1312
- return wi("checkbox", l);
1313
- }
1314
- }), Tt = he({
1315
- name: "QItemSection",
1316
- props: {
1317
- avatar: Boolean,
1318
- thumbnail: Boolean,
1319
- side: Boolean,
1320
- top: Boolean,
1321
- noWrap: Boolean
1322
- },
1323
- setup(e, { slots: t }) {
1324
- const l = d(
1325
- () => `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" : "")
1326
- );
1327
- return () => g("div", { class: l.value }, ke(t.default));
1328
- }
1329
- }), On = he({
1330
- name: "QItemLabel",
1331
- props: {
1332
- overline: Boolean,
1333
- caption: Boolean,
1334
- header: Boolean,
1335
- lines: [Number, String]
1336
- },
1337
- setup(e, { slots: t }) {
1338
- const l = d(() => parseInt(e.lines, 10)), n = d(
1339
- () => "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" : "") + (l.value === 1 ? " ellipsis" : "")
1340
- ), o = d(() => e.lines !== void 0 && l.value > 1 ? {
1341
- overflow: "hidden",
1342
- display: "-webkit-box",
1343
- "-webkit-box-orient": "vertical",
1344
- "-webkit-line-clamp": l.value
1345
- } : null);
1346
- return () => g("div", {
1347
- style: o.value,
1348
- class: n.value
1349
- }, ke(t.default));
1350
- }
1351
- }), Pn = he({
1352
- name: "QItem",
1353
- props: {
1354
- ...gt,
1355
- ...Xo,
1356
- tag: {
1357
- type: String,
1358
- default: "div"
1359
- },
1360
- active: {
1361
- type: Boolean,
1362
- default: null
1363
- },
1364
- clickable: Boolean,
1365
- dense: Boolean,
1366
- insetLevel: Number,
1367
- tabindex: [String, Number],
1368
- focused: Boolean,
1369
- manualFocus: Boolean
1370
- },
1371
- emits: ["click", "keyup"],
1372
- setup(e, { slots: t, emit: l }) {
1373
- const { proxy: { $q: n } } = ne(), o = pt(e, n), { hasLink: u, linkAttrs: a, linkClass: r, linkTag: h, navigateOnClick: b } = Rn(), s = P(null), y = P(null), v = d(
1374
- () => e.clickable === !0 || u.value === !0 || e.tag === "label"
1375
- ), c = d(
1376
- () => e.disable !== !0 && v.value === !0
1377
- ), m = d(
1378
- () => "q-item q-item-type row no-wrap" + (e.dense === !0 ? " q-item--dense" : "") + (o.value === !0 ? " q-item--dark" : "") + (u.value === !0 && e.active === null ? r.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" : "") : "")
1379
- ), C = d(() => e.insetLevel === void 0 ? null : {
1380
- ["padding" + (n.lang.rtl === !0 ? "Right" : "Left")]: 16 + e.insetLevel * 56 + "px"
1381
- });
1382
- function p(k) {
1383
- c.value === !0 && (y.value !== null && (k.qKeyEvent !== !0 && document.activeElement === s.value ? y.value.focus() : document.activeElement === y.value && s.value.focus()), b(k));
1384
- }
1385
- function O(k) {
1386
- if (c.value === !0 && Ie(k, [13, 32]) === !0) {
1387
- le(k), k.qKeyEvent = !0;
1388
- const M = new MouseEvent("click", k);
1389
- M.qKeyEvent = !0, s.value.dispatchEvent(M);
1390
- }
1391
- l("keyup", k);
1392
- }
1393
- function T() {
1394
- const k = Vo(t.default, []);
1395
- return c.value === !0 && k.unshift(
1396
- g("div", { class: "q-focus-helper", tabindex: -1, ref: y })
1397
- ), k;
1398
- }
1399
- return () => {
1400
- const k = {
1401
- ref: s,
1402
- class: m.value,
1403
- style: C.value,
1404
- role: "listitem",
1405
- onClick: p,
1406
- onKeyup: O
1407
- };
1408
- return c.value === !0 ? (k.tabindex = e.tabindex || "0", Object.assign(k, a.value)) : v.value === !0 && (k["aria-disabled"] = "true"), g(
1409
- h.value,
1410
- k,
1411
- T()
1412
- );
1413
- };
1414
- }
1415
- }), Il = (e) => e ? !0 : "Обовʼязкове поле";
1416
- let Yt, xt = 0;
1417
- const ie = new Array(256);
1418
- for (let e = 0; e < 256; e++)
1419
- ie[e] = (e + 256).toString(16).substring(1);
1420
- const xi = (() => {
1421
- const e = typeof crypto < "u" ? crypto : typeof window < "u" ? window.crypto || window.msCrypto : void 0;
1422
- if (e !== void 0) {
1423
- if (e.randomBytes !== void 0)
1424
- return e.randomBytes;
1425
- if (e.getRandomValues !== void 0)
1426
- return (t) => {
1427
- const l = new Uint8Array(t);
1428
- return e.getRandomValues(l), l;
1429
- };
1430
- }
1431
- return (t) => {
1432
- const l = [];
1433
- for (let n = t; n > 0; n--)
1434
- l.push(Math.floor(Math.random() * 256));
1435
- return l;
1436
- };
1437
- })(), Hl = 4096;
1438
- function rl() {
1439
- (Yt === void 0 || xt + 16 > Hl) && (xt = 0, Yt = xi(Hl));
1440
- const e = Array.prototype.slice.call(Yt, xt, xt += 16);
1441
- return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, ie[e[0]] + ie[e[1]] + ie[e[2]] + ie[e[3]] + "-" + ie[e[4]] + ie[e[5]] + "-" + ie[e[6]] + ie[e[7]] + "-" + ie[e[8]] + ie[e[9]] + "-" + ie[e[10]] + ie[e[11]] + ie[e[12]] + ie[e[13]] + ie[e[14]] + ie[e[15]];
1442
- }
1443
- function Ci(e) {
1444
- return e ?? null;
1445
- }
1446
- function Dl(e, t) {
1447
- return e ?? (t === !0 ? `f_${rl()}` : null);
1448
- }
1449
- function qi({ getValue: e, required: t = !0 } = {}) {
1450
- if (ft.value === !0) {
1451
- const l = e !== void 0 ? P(Ci(e())) : P(null);
1452
- return t === !0 && l.value === null && ht(() => {
1453
- l.value = `f_${rl()}`;
1454
- }), e !== void 0 && Z(e, (n) => {
1455
- l.value = Dl(n, t);
1456
- }), l;
1457
- }
1458
- return e !== void 0 ? d(() => Dl(e(), t)) : P(`f_${rl()}`);
1459
- }
1460
- const jl = /^on[A-Z]/;
1461
- function _i() {
1462
- const { attrs: e, vnode: t } = ne(), l = {
1463
- listeners: P({}),
1464
- attributes: P({})
1465
- };
1466
- function n() {
1467
- const o = {}, u = {};
1468
- for (const a in e)
1469
- a !== "class" && a !== "style" && jl.test(a) === !1 && (o[a] = e[a]);
1470
- for (const a in t.props)
1471
- jl.test(a) === !0 && (u[a] = t.props[a]);
1472
- l.attributes.value = o, l.listeners.value = u;
1473
- }
1474
- return gn(n), n(), l;
1475
- }
1476
- const Ei = "_q_fo_";
1477
- function Vi({ validate: e, resetValidation: t, requiresQForm: l }) {
1478
- const n = wo(Ei, !1);
1479
- if (n !== !1) {
1480
- const { props: o, proxy: u } = ne();
1481
- Object.assign(u, { validate: e, resetValidation: t }), Z(() => o.disable, (a) => {
1482
- a === !0 ? (typeof t == "function" && t(), n.unbindComponent(u)) : n.bindComponent(u);
1483
- }), ht(() => {
1484
- o.disable !== !0 && n.bindComponent(u);
1485
- }), me(() => {
1486
- o.disable !== !0 && n.unbindComponent(u);
1487
- });
1488
- } else l === !0 && console.error("Parent QForm not found on useFormChild()!");
1489
- }
1490
- const Nl = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/, Wl = /^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/, Kl = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, Ct = /^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])\)$/, qt = /^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)\)$/, Xt = {
1491
- date: (e) => /^-?[\d]+\/[0-1]\d\/[0-3]\d$/.test(e),
1492
- time: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d$/.test(e),
1493
- fulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(e),
1494
- timeOrFulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(e),
1495
- // -- RFC 5322 --
1496
- // -- Added in v2.6.6 --
1497
- // This is a basic helper validation.
1498
- // For something more complex (like RFC 822) you should write and use your own rule.
1499
- // We won't be accepting PRs to enhance the one below because of the reason above.
1500
- // eslint-disable-next-line
1501
- 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),
1502
- hexColor: (e) => Nl.test(e),
1503
- hexaColor: (e) => Wl.test(e),
1504
- hexOrHexaColor: (e) => Kl.test(e),
1505
- rgbColor: (e) => Ct.test(e),
1506
- rgbaColor: (e) => qt.test(e),
1507
- rgbOrRgbaColor: (e) => Ct.test(e) || qt.test(e),
1508
- hexOrRgbColor: (e) => Nl.test(e) || Ct.test(e),
1509
- hexaOrRgbaColor: (e) => Wl.test(e) || qt.test(e),
1510
- anyColor: (e) => Kl.test(e) || Ct.test(e) || qt.test(e)
1511
- };
1512
- function zn(e, t = 250, l) {
1513
- let n = null;
1514
- function o() {
1515
- const u = arguments, a = () => {
1516
- n = null, e.apply(this, u);
1517
- };
1518
- n !== null && clearTimeout(n), n = setTimeout(a, t);
1519
- }
1520
- return o.cancel = () => {
1521
- n !== null && clearTimeout(n);
1522
- }, o;
1523
- }
1524
- const Bi = [!0, !1, "ondemand"], Ti = {
1525
- modelValue: {},
1526
- error: {
1527
- type: Boolean,
1528
- default: null
1529
- },
1530
- errorMessage: String,
1531
- noErrorIcon: Boolean,
1532
- rules: Array,
1533
- reactiveRules: Boolean,
1534
- lazyRules: {
1535
- type: [Boolean, String],
1536
- default: !1,
1537
- // statement unneeded but avoids future vue implementation changes
1538
- validator: (e) => Bi.includes(e)
1539
- }
1540
- };
1541
- function $i(e, t) {
1542
- const { props: l, proxy: n } = ne(), o = P(!1), u = P(null), a = P(!1);
1543
- Vi({ validate: C, resetValidation: m });
1544
- let r = 0, h;
1545
- const b = d(
1546
- () => l.rules !== void 0 && l.rules !== null && l.rules.length !== 0
1547
- ), s = d(() => l.disable !== !0 && b.value === !0 && t.value === !1), y = d(
1548
- () => l.error === !0 || o.value === !0
1549
- ), v = d(() => typeof l.errorMessage == "string" && l.errorMessage.length !== 0 ? l.errorMessage : u.value);
1550
- Z(() => l.modelValue, () => {
1551
- a.value = !0, s.value === !0 && l.lazyRules === !1 && p();
1552
- });
1553
- function c() {
1554
- l.lazyRules !== "ondemand" && s.value === !0 && a.value === !0 && p();
1555
- }
1556
- Z(() => l.reactiveRules, (O) => {
1557
- O === !0 ? h === void 0 && (h = Z(() => l.rules, c, { immediate: !0, deep: !0 })) : h !== void 0 && (h(), h = void 0);
1558
- }, { immediate: !0 }), Z(() => l.lazyRules, c), Z(e, (O) => {
1559
- O === !0 ? a.value = !0 : s.value === !0 && l.lazyRules !== "ondemand" && p();
1560
- });
1561
- function m() {
1562
- r++, t.value = !1, a.value = !1, o.value = !1, u.value = null, p.cancel();
1563
- }
1564
- function C(O = l.modelValue) {
1565
- if (l.disable === !0 || b.value === !1)
1566
- return !0;
1567
- const T = ++r, k = t.value !== !0 ? () => {
1568
- a.value = !0;
1569
- } : () => {
1570
- }, M = (B, A) => {
1571
- B === !0 && k(), o.value = B, u.value = A || null, t.value = !1;
1572
- }, R = [];
1573
- for (let B = 0; B < l.rules.length; B++) {
1574
- const A = l.rules[B];
1575
- let z;
1576
- if (typeof A == "function" ? z = A(O, Xt) : typeof A == "string" && Xt[A] !== void 0 && (z = Xt[A](O)), z === !1 || typeof z == "string")
1577
- return M(!0, z), !1;
1578
- z !== !0 && z !== void 0 && R.push(z);
1579
- }
1580
- return R.length === 0 ? (M(!1), !0) : (t.value = !0, Promise.all(R).then(
1581
- (B) => {
1582
- if (B === void 0 || Array.isArray(B) === !1 || B.length === 0)
1583
- return T === r && M(!1), !0;
1584
- const A = B.find((z) => z === !1 || typeof z == "string");
1585
- return T === r && M(A !== void 0, A), A === void 0;
1586
- },
1587
- (B) => (T === r && (console.error(B), M(!0)), !1)
1588
- ));
1589
- }
1590
- const p = zn(C, 0);
1591
- return me(() => {
1592
- h !== void 0 && h(), p.cancel();
1593
- }), Object.assign(n, { resetValidation: m, validate: C }), dl(n, "hasError", () => y.value), {
1594
- isDirtyModel: a,
1595
- hasRules: b,
1596
- hasError: y,
1597
- errorMessage: v,
1598
- validate: C,
1599
- resetValidation: m
1600
- };
1601
- }
1602
- let Oe = [], vt = [];
1603
- function Fn(e) {
1604
- vt = vt.filter((t) => t !== e);
1605
- }
1606
- function Ri(e) {
1607
- Fn(e), vt.push(e);
1608
- }
1609
- function Ql(e) {
1610
- Fn(e), vt.length === 0 && Oe.length !== 0 && (Oe[Oe.length - 1](), Oe = []);
1611
- }
1612
- function ml(e) {
1613
- vt.length === 0 ? e() : Oe.push(e);
1614
- }
1615
- function Li(e) {
1616
- Oe = Oe.filter((t) => t !== e);
1617
- }
1618
- function sl(e) {
1619
- return e != null && ("" + e).length !== 0;
1620
- }
1621
- const Mi = {
1622
- ...gt,
1623
- ...Ti,
1624
- label: String,
1625
- stackLabel: Boolean,
1626
- hint: String,
1627
- hideHint: Boolean,
1628
- prefix: String,
1629
- suffix: String,
1630
- labelColor: String,
1631
- color: String,
1632
- bgColor: String,
1633
- filled: Boolean,
1634
- outlined: Boolean,
1635
- borderless: Boolean,
1636
- standout: [Boolean, String],
1637
- square: Boolean,
1638
- loading: Boolean,
1639
- labelSlot: Boolean,
1640
- bottomSlots: Boolean,
1641
- hideBottomSpace: Boolean,
1642
- rounded: Boolean,
1643
- dense: Boolean,
1644
- itemAligned: Boolean,
1645
- counter: Boolean,
1646
- clearable: Boolean,
1647
- clearIcon: String,
1648
- disable: Boolean,
1649
- readonly: Boolean,
1650
- autofocus: Boolean,
1651
- for: String
1652
- }, hl = {
1653
- ...Mi,
1654
- maxlength: [Number, String]
1655
- }, In = ["update:modelValue", "clear", "focus", "blur"];
1656
- function Hn({ requiredForAttr: e = !0, tagProp: t, changeEvent: l = !1 } = {}) {
1657
- const { props: n, proxy: o } = ne(), u = pt(n, o.$q), a = qi({
1658
- required: e,
1659
- getValue: () => n.for
1660
- });
1661
- return {
1662
- requiredForAttr: e,
1663
- changeEvent: l,
1664
- tag: t === !0 ? d(() => n.tag) : { value: "label" },
1665
- isDark: u,
1666
- editable: d(
1667
- () => n.disable !== !0 && n.readonly !== !0
1668
- ),
1669
- innerLoading: P(!1),
1670
- focused: P(!1),
1671
- hasPopupOpen: !1,
1672
- splitAttrs: _i(),
1673
- targetUid: a,
1674
- rootRef: P(null),
1675
- targetRef: P(null),
1676
- controlRef: P(null)
1677
- /**
1678
- * user supplied additionals:
1679
-
1680
- * innerValue - computed
1681
- * floatingLabel - computed
1682
- * inputRef - computed
1683
-
1684
- * fieldClass - computed
1685
- * hasShadow - computed
1686
-
1687
- * controlEvents - Object with fn(e)
1688
-
1689
- * getControl - fn
1690
- * getInnerAppend - fn
1691
- * getControlChild - fn
1692
- * getShadowControl - fn
1693
- * showPopup - fn
1694
- */
1695
- };
1696
- }
1697
- function Dn(e) {
1698
- const { props: t, emit: l, slots: n, attrs: o, proxy: u } = ne(), { $q: a } = u;
1699
- let r = null;
1700
- e.hasValue === void 0 && (e.hasValue = d(() => sl(t.modelValue))), e.emitValue === void 0 && (e.emitValue = (E) => {
1701
- l("update:modelValue", E);
1702
- }), e.controlEvents === void 0 && (e.controlEvents = {
1703
- onFocusin: N,
1704
- onFocusout: J
1705
- }), Object.assign(e, {
1706
- clearValue: U,
1707
- onControlFocusin: N,
1708
- onControlFocusout: J,
1709
- focus: A
1710
- }), e.computedCounter === void 0 && (e.computedCounter = d(() => {
1711
- if (t.counter !== !1) {
1712
- const E = typeof t.modelValue == "string" || typeof t.modelValue == "number" ? ("" + t.modelValue).length : Array.isArray(t.modelValue) === !0 ? t.modelValue.length : 0, F = t.maxlength !== void 0 ? t.maxlength : t.maxValues;
1713
- return E + (F !== void 0 ? " / " + F : "");
1714
- }
1715
- }));
1716
- const {
1717
- isDirtyModel: h,
1718
- hasRules: b,
1719
- hasError: s,
1720
- errorMessage: y,
1721
- resetValidation: v
1722
- } = $i(e.focused, e.innerLoading), c = e.floatingLabel !== void 0 ? d(() => t.stackLabel === !0 || e.focused.value === !0 || e.floatingLabel.value === !0) : d(() => t.stackLabel === !0 || e.focused.value === !0 || e.hasValue.value === !0), m = d(
1723
- () => t.bottomSlots === !0 || t.hint !== void 0 || b.value === !0 || t.counter === !0 || t.error !== null
1724
- ), C = d(() => t.filled === !0 ? "filled" : t.outlined === !0 ? "outlined" : t.borderless === !0 ? "borderless" : t.standout ? "standout" : "standard"), p = d(
1725
- () => `q-field row no-wrap items-start q-field--${C.value}` + (e.fieldClass !== void 0 ? ` ${e.fieldClass.value}` : "") + (t.rounded === !0 ? " q-field--rounded" : "") + (t.square === !0 ? " q-field--square" : "") + (c.value === !0 ? " q-field--float" : "") + (T.value === !0 ? " q-field--labeled" : "") + (t.dense === !0 ? " q-field--dense" : "") + (t.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" : "") + (s.value === !0 ? " q-field--error" : "") + (s.value === !0 || e.focused.value === !0 ? " q-field--highlighted" : "") + (t.hideBottomSpace !== !0 && m.value === !0 ? " q-field--with-bottom" : "") + (t.disable === !0 ? " q-field--disabled" : t.readonly === !0 ? " q-field--readonly" : "")
1726
- ), O = d(
1727
- () => "q-field__control relative-position row no-wrap" + (t.bgColor !== void 0 ? ` bg-${t.bgColor}` : "") + (s.value === !0 ? " text-negative" : typeof t.standout == "string" && t.standout.length !== 0 && e.focused.value === !0 ? ` ${t.standout}` : t.color !== void 0 ? ` text-${t.color}` : "")
1728
- ), T = d(
1729
- () => t.labelSlot === !0 || t.label !== void 0
1730
- ), k = d(
1731
- () => "q-field__label no-pointer-events absolute ellipsis" + (t.labelColor !== void 0 && s.value !== !0 ? ` text-${t.labelColor}` : "")
1732
- ), M = d(() => ({
1733
- id: e.targetUid.value,
1734
- editable: e.editable.value,
1735
- focused: e.focused.value,
1736
- floatingLabel: c.value,
1737
- modelValue: t.modelValue,
1738
- emitValue: e.emitValue
1739
- })), R = d(() => {
1740
- const E = {};
1741
- return e.targetUid.value && (E.for = e.targetUid.value), t.disable === !0 && (E["aria-disabled"] = "true"), E;
1742
- });
1743
- function B() {
1744
- const E = document.activeElement;
1745
- let F = e.targetRef !== void 0 && e.targetRef.value;
1746
- F && (E === null || E.id !== e.targetUid.value) && (F.hasAttribute("tabindex") === !0 || (F = F.querySelector("[tabindex]")), F && F !== E && F.focus({ preventScroll: !0 }));
1747
- }
1748
- function A() {
1749
- ml(B);
1750
- }
1751
- function z() {
1752
- Li(B);
1753
- const E = document.activeElement;
1754
- E !== null && e.rootRef.value.contains(E) && E.blur();
1755
- }
1756
- function N(E) {
1757
- r !== null && (clearTimeout(r), r = null), e.editable.value === !0 && e.focused.value === !1 && (e.focused.value = !0, l("focus", E));
1758
- }
1759
- function J(E, F) {
1760
- r !== null && clearTimeout(r), r = setTimeout(() => {
1761
- r = 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, l("blur", E)), F !== void 0 && F());
1762
- });
1763
- }
1764
- function U(E) {
1765
- le(E), a.platform.is.mobile !== !0 ? (e.targetRef !== void 0 && e.targetRef.value || e.rootRef.value).focus() : e.rootRef.value.contains(document.activeElement) === !0 && document.activeElement.blur(), t.type === "file" && (e.inputRef.value.value = null), l("update:modelValue", null), e.changeEvent === !0 && l("change", null), l("clear", t.modelValue), fe(() => {
1766
- const F = h.value;
1767
- v(), h.value = F;
1768
- });
1769
- }
1770
- function L(E) {
1771
- [13, 32].includes(E.keyCode) && U(E);
1772
- }
1773
- function K() {
1774
- const E = [];
1775
- return n.prepend !== void 0 && E.push(
1776
- g("div", {
1777
- class: "q-field__prepend q-field__marginal row no-wrap items-center",
1778
- key: "prepend",
1779
- onClick: be
1780
- }, n.prepend())
1781
- ), E.push(
1782
- g("div", {
1783
- class: "q-field__control-container col relative-position row no-wrap q-anchor--skip"
1784
- }, V())
1785
- ), s.value === !0 && t.noErrorIcon === !1 && E.push(
1786
- X("error", [
1787
- g(_e, { name: a.iconSet.field.error, color: "negative" })
1788
- ])
1789
- ), t.loading === !0 || e.innerLoading.value === !0 ? E.push(
1790
- X(
1791
- "inner-loading-append",
1792
- n.loading !== void 0 ? n.loading() : [g(kn, { color: t.color })]
1793
- )
1794
- ) : t.clearable === !0 && e.hasValue.value === !0 && e.editable.value === !0 && E.push(
1795
- X("inner-clearable-append", [
1796
- g(_e, {
1797
- class: "q-field__focusable-action",
1798
- name: t.clearIcon || a.iconSet.field.clear,
1799
- tabindex: 0,
1800
- role: "button",
1801
- "aria-hidden": "false",
1802
- "aria-label": a.lang.label.clear,
1803
- onKeyup: L,
1804
- onClick: U
1805
- })
1806
- ])
1807
- ), n.append !== void 0 && E.push(
1808
- g("div", {
1809
- class: "q-field__append q-field__marginal row no-wrap items-center",
1810
- key: "append",
1811
- onClick: be
1812
- }, n.append())
1813
- ), e.getInnerAppend !== void 0 && E.push(
1814
- X("inner-append", e.getInnerAppend())
1815
- ), e.getControlChild !== void 0 && E.push(
1816
- e.getControlChild()
1817
- ), E;
1818
- }
1819
- function V() {
1820
- const E = [];
1821
- return t.prefix !== void 0 && t.prefix !== null && E.push(
1822
- g("div", {
1823
- class: "q-field__prefix no-pointer-events row items-center"
1824
- }, t.prefix)
1825
- ), e.getShadowControl !== void 0 && e.hasShadow.value === !0 && E.push(
1826
- e.getShadowControl()
1827
- ), e.getControl !== void 0 ? E.push(e.getControl()) : n.rawControl !== void 0 ? E.push(n.rawControl()) : n.control !== void 0 && E.push(
1828
- g("div", {
1829
- ref: e.targetRef,
1830
- class: "q-field__native row",
1831
- tabindex: -1,
1832
- ...e.splitAttrs.attributes.value,
1833
- "data-autofocus": t.autofocus === !0 || void 0
1834
- }, n.control(M.value))
1835
- ), T.value === !0 && E.push(
1836
- g("div", {
1837
- class: k.value
1838
- }, ke(n.label, t.label))
1839
- ), t.suffix !== void 0 && t.suffix !== null && E.push(
1840
- g("div", {
1841
- class: "q-field__suffix no-pointer-events row items-center"
1842
- }, t.suffix)
1843
- ), E.concat(ke(n.default));
1844
- }
1845
- function D() {
1846
- let E, F;
1847
- s.value === !0 ? y.value !== null ? (E = [g("div", { role: "alert" }, y.value)], F = `q--slot-error-${y.value}`) : (E = ke(n.error), F = "q--slot-error") : (t.hideHint !== !0 || e.focused.value === !0) && (t.hint !== void 0 ? (E = [g("div", t.hint)], F = `q--slot-hint-${t.hint}`) : (E = ke(n.hint), F = "q--slot-hint"));
1848
- const se = t.counter === !0 || n.counter !== void 0;
1849
- if (t.hideBottomSpace === !0 && se === !1 && E === void 0)
1850
- return;
1851
- const f = g("div", {
1852
- key: F,
1853
- class: "q-field__messages col"
1854
- }, E);
1855
- return g("div", {
1856
- class: "q-field__bottom row items-start q-field__bottom--" + (t.hideBottomSpace !== !0 ? "animated" : "stale"),
1857
- onClick: be
1858
- }, [
1859
- t.hideBottomSpace === !0 ? f : g(dt, { name: "q-transition--field-message" }, () => f),
1860
- se === !0 ? g("div", {
1861
- class: "q-field__counter"
1862
- }, n.counter !== void 0 ? n.counter() : e.computedCounter.value) : null
1863
- ]);
1864
- }
1865
- function X(E, F) {
1866
- return F === null ? null : g("div", {
1867
- key: E,
1868
- class: "q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"
1869
- }, F);
1870
- }
1871
- let ae = !1;
1872
- return Pt(() => {
1873
- ae = !0;
1874
- }), pn(() => {
1875
- ae === !0 && t.autofocus === !0 && u.focus();
1876
- }), t.autofocus === !0 && ht(() => {
1877
- u.focus();
1878
- }), me(() => {
1879
- r !== null && clearTimeout(r);
1880
- }), Object.assign(u, { focus: A, blur: z }), function() {
1881
- const F = e.getControl === void 0 && n.control === void 0 ? {
1882
- ...e.splitAttrs.attributes.value,
1883
- "data-autofocus": t.autofocus === !0 || void 0,
1884
- ...R.value
1885
- } : R.value;
1886
- return g(e.tag.value, {
1887
- ref: e.rootRef,
1888
- class: [
1889
- p.value,
1890
- o.class
1891
- ],
1892
- style: o.style,
1893
- ...F
1894
- }, [
1895
- n.before !== void 0 ? g("div", {
1896
- class: "q-field__before q-field__marginal row no-wrap items-center",
1897
- onClick: be
1898
- }, n.before()) : null,
1899
- g("div", {
1900
- class: "q-field__inner relative-position col self-stretch"
1901
- }, [
1902
- g("div", {
1903
- ref: e.controlRef,
1904
- class: O.value,
1905
- tabindex: -1,
1906
- ...e.controlEvents
1907
- }, K()),
1908
- m.value === !0 ? D() : null
1909
- ]),
1910
- n.after !== void 0 ? g("div", {
1911
- class: "q-field__after q-field__marginal row no-wrap items-center",
1912
- onClick: be
1913
- }, n.after()) : null
1914
- ]);
1915
- };
1916
- }
1917
- const Ai = he({
1918
- name: "QField",
1919
- inheritAttrs: !1,
1920
- props: {
1921
- ...hl,
1922
- tag: {
1923
- type: String,
1924
- default: "label"
1925
- }
1926
- },
1927
- emits: In,
1928
- setup() {
1929
- return Dn(
1930
- Hn({ tagProp: !0 })
1931
- );
1932
- }
1933
- }), Oi = {
1934
- xs: 8,
1935
- sm: 10,
1936
- md: 14,
1937
- lg: 20,
1938
- xl: 24
1939
- }, Pi = he({
1940
- name: "QChip",
1941
- props: {
1942
- ...gt,
1943
- ...zt,
1944
- dense: Boolean,
1945
- icon: String,
1946
- iconRight: String,
1947
- iconRemove: String,
1948
- iconSelected: String,
1949
- label: [String, Number],
1950
- color: String,
1951
- textColor: String,
1952
- modelValue: {
1953
- type: Boolean,
1954
- default: !0
1955
- },
1956
- selected: {
1957
- type: Boolean,
1958
- default: null
1959
- },
1960
- square: Boolean,
1961
- outline: Boolean,
1962
- clickable: Boolean,
1963
- removable: Boolean,
1964
- removeAriaLabel: String,
1965
- tabindex: [String, Number],
1966
- disable: Boolean,
1967
- ripple: {
1968
- type: [Boolean, Object],
1969
- default: !0
1970
- }
1971
- },
1972
- emits: ["update:modelValue", "update:selected", "remove", "click"],
1973
- setup(e, { slots: t, emit: l }) {
1974
- const { proxy: { $q: n } } = ne(), o = pt(e, n), u = Ft(e, Oi), a = d(() => e.selected === !0 || e.icon !== void 0), r = d(() => e.selected === !0 ? e.iconSelected || n.iconSet.chip.selected : e.icon), h = d(() => e.iconRemove || n.iconSet.chip.remove), b = d(
1975
- () => e.disable === !1 && (e.clickable === !0 || e.selected !== null)
1976
- ), s = d(() => {
1977
- const p = e.outline === !0 && e.color || e.textColor;
1978
- return "q-chip row inline no-wrap items-center" + (e.outline === !1 && e.color !== void 0 ? ` bg-${e.color}` : "") + (p ? ` text-${p} 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" : "") + (b.value === !0 ? " q-chip--clickable cursor-pointer non-selectable q-hoverable" : "") + (e.square === !0 ? " q-chip--square" : "") + (o.value === !0 ? " q-chip--dark q-dark" : "");
1979
- }), y = d(() => {
1980
- const p = e.disable === !0 ? { tabindex: -1, "aria-disabled": "true" } : { tabindex: e.tabindex || 0 }, O = {
1981
- ...p,
1982
- role: "button",
1983
- "aria-hidden": "false",
1984
- "aria-label": e.removeAriaLabel || n.lang.label.remove
1985
- };
1986
- return { chip: p, remove: O };
1987
- });
1988
- function v(p) {
1989
- p.keyCode === 13 && c(p);
1990
- }
1991
- function c(p) {
1992
- e.disable || (l("update:selected", !e.selected), l("click", p));
1993
- }
1994
- function m(p) {
1995
- (p.keyCode === void 0 || p.keyCode === 13) && (le(p), e.disable === !1 && (l("update:modelValue", !1), l("remove")));
1996
- }
1997
- function C() {
1998
- const p = [];
1999
- b.value === !0 && p.push(
2000
- g("div", { class: "q-focus-helper" })
2001
- ), a.value === !0 && p.push(
2002
- g(_e, {
2003
- class: "q-chip__icon q-chip__icon--left",
2004
- name: r.value
2005
- })
2006
- );
2007
- const O = e.label !== void 0 ? [g("div", { class: "ellipsis" }, [e.label])] : void 0;
2008
- return p.push(
2009
- g("div", {
2010
- class: "q-chip__content col row no-wrap items-center q-anchor--skip"
2011
- }, Bo(t.default, O))
2012
- ), e.iconRight && p.push(
2013
- g(_e, {
2014
- class: "q-chip__icon q-chip__icon--right",
2015
- name: e.iconRight
2016
- })
2017
- ), e.removable === !0 && p.push(
2018
- g(_e, {
2019
- class: "q-chip__icon q-chip__icon--remove cursor-pointer",
2020
- name: h.value,
2021
- ...y.value.remove,
2022
- onClick: m,
2023
- onKeyup: m
2024
- })
2025
- ), p;
2026
- }
2027
- return () => {
2028
- if (e.modelValue === !1) return;
2029
- const p = {
2030
- class: s.value,
2031
- style: u.value
2032
- };
2033
- return b.value === !0 && Object.assign(
2034
- p,
2035
- y.value.chip,
2036
- { onClick: c, onKeyup: v }
2037
- ), To(
2038
- "div",
2039
- p,
2040
- C(),
2041
- "ripple",
2042
- e.ripple !== !1 && e.disable !== !0,
2043
- () => [[En, e.ripple]]
2044
- );
2045
- };
2046
- }
2047
- });
2048
- function zi() {
2049
- if (window.getSelection !== void 0) {
2050
- const e = window.getSelection();
2051
- e.empty !== void 0 ? e.empty() : e.removeAllRanges !== void 0 && (e.removeAllRanges(), al.is.mobile !== !0 && e.addRange(document.createRange()));
2052
- } else document.selection !== void 0 && document.selection.empty();
2053
- }
2054
- const Fi = {
2055
- /* SSR does not know about Element */
2056
- target: {
2057
- type: [Boolean, String, Element],
2058
- default: !0
2059
- },
2060
- noParentEvent: Boolean
2061
- }, Ii = {
2062
- ...Fi,
2063
- contextMenu: Boolean
2064
- };
2065
- function Hi({
2066
- showing: e,
2067
- avoidEmit: t,
2068
- // required for QPopupProxy (true)
2069
- configureAnchorEl: l
2070
- // optional
2071
- }) {
2072
- const { props: n, proxy: o, emit: u } = ne(), a = P(null);
2073
- let r = null;
2074
- function h(c) {
2075
- return a.value === null ? !1 : c === void 0 || c.touches === void 0 || c.touches.length <= 1;
2076
- }
2077
- const b = {};
2078
- l === void 0 && (Object.assign(b, {
2079
- hide(c) {
2080
- o.hide(c);
2081
- },
2082
- toggle(c) {
2083
- o.toggle(c), c.qAnchorHandled = !0;
2084
- },
2085
- toggleKey(c) {
2086
- Ie(c, 13) === !0 && b.toggle(c);
2087
- },
2088
- contextClick(c) {
2089
- o.hide(c), be(c), fe(() => {
2090
- o.show(c), c.qAnchorHandled = !0;
2091
- });
2092
- },
2093
- prevent: be,
2094
- mobileTouch(c) {
2095
- if (b.mobileCleanup(c), h(c) !== !0)
2096
- return;
2097
- o.hide(c), a.value.classList.add("non-selectable");
2098
- const m = c.target;
2099
- il(b, "anchor", [
2100
- [m, "touchmove", "mobileCleanup", "passive"],
2101
- [m, "touchend", "mobileCleanup", "passive"],
2102
- [m, "touchcancel", "mobileCleanup", "passive"],
2103
- [a.value, "contextmenu", "prevent", "notPassive"]
2104
- ]), r = setTimeout(() => {
2105
- r = null, o.show(c), c.qAnchorHandled = !0;
2106
- }, 300);
2107
- },
2108
- mobileCleanup(c) {
2109
- a.value.classList.remove("non-selectable"), r !== null && (clearTimeout(r), r = null), e.value === !0 && c !== void 0 && zi();
2110
- }
2111
- }), l = function(c = n.contextMenu) {
2112
- if (n.noParentEvent === !0 || a.value === null) return;
2113
- let m;
2114
- c === !0 ? o.$q.platform.is.mobile === !0 ? m = [
2115
- [a.value, "touchstart", "mobileTouch", "passive"]
2116
- ] : m = [
2117
- [a.value, "mousedown", "hide", "passive"],
2118
- [a.value, "contextmenu", "contextClick", "notPassive"]
2119
- ] : m = [
2120
- [a.value, "click", "toggle", "passive"],
2121
- [a.value, "keyup", "toggleKey", "passive"]
2122
- ], il(b, "anchor", m);
2123
- });
2124
- function s() {
2125
- qn(b, "anchor");
2126
- }
2127
- function y(c) {
2128
- for (a.value = c; a.value.classList.contains("q-anchor--skip"); )
2129
- a.value = a.value.parentNode;
2130
- l();
2131
- }
2132
- function v() {
2133
- if (n.target === !1 || n.target === "" || o.$el.parentNode === null)
2134
- a.value = null;
2135
- else if (n.target === !0)
2136
- y(o.$el.parentNode);
2137
- else {
2138
- let c = n.target;
2139
- if (typeof n.target == "string")
2140
- try {
2141
- c = document.querySelector(n.target);
2142
- } catch {
2143
- c = void 0;
2144
- }
2145
- c != null ? (a.value = c.$el || c, l()) : (a.value = null, console.error(`Anchor: target "${n.target}" not found`));
2146
- }
2147
- }
2148
- return Z(() => n.contextMenu, (c) => {
2149
- a.value !== null && (s(), l(c));
2150
- }), Z(() => n.target, () => {
2151
- a.value !== null && s(), v();
2152
- }), Z(() => n.noParentEvent, (c) => {
2153
- a.value !== null && (c === !0 ? s() : l());
2154
- }), ht(() => {
2155
- v(), t !== !0 && n.modelValue === !0 && a.value === null && u("update:modelValue", !1);
2156
- }), me(() => {
2157
- r !== null && clearTimeout(r), s();
2158
- }), {
2159
- anchorEl: a,
2160
- canShow: h,
2161
- anchorEvents: b
2162
- };
2163
- }
2164
- function Di(e, t) {
2165
- const l = P(null);
2166
- let n;
2167
- function o(r, h) {
2168
- const b = `${h !== void 0 ? "add" : "remove"}EventListener`, s = h !== void 0 ? h : n;
2169
- r !== window && r[b]("scroll", s, re.passive), window[b]("scroll", s, re.passive), n = h;
2170
- }
2171
- function u() {
2172
- l.value !== null && (o(l.value), l.value = null);
2173
- }
2174
- const a = Z(() => e.noParentEvent, () => {
2175
- l.value !== null && (u(), t());
2176
- });
2177
- return me(a), {
2178
- localScrollTarget: l,
2179
- unconfigureScrollTarget: u,
2180
- changeScrollEvent: o
2181
- };
2182
- }
2183
- const jn = {
2184
- modelValue: {
2185
- type: Boolean,
2186
- default: null
2187
- },
2188
- "onUpdate:modelValue": [Function, Array]
2189
- }, Nn = [
2190
- "beforeShow",
2191
- "show",
2192
- "beforeHide",
2193
- "hide"
2194
- ];
2195
- function Wn({
2196
- showing: e,
2197
- canShow: t,
2198
- // optional
2199
- hideOnRouteChange: l,
2200
- // optional
2201
- handleShow: n,
2202
- // optional
2203
- handleHide: o,
2204
- // optional
2205
- processOnMount: u
2206
- // optional
2207
- }) {
2208
- const a = ne(), { props: r, emit: h, proxy: b } = a;
2209
- let s;
2210
- function y(T) {
2211
- e.value === !0 ? m(T) : v(T);
2212
- }
2213
- function v(T) {
2214
- if (r.disable === !0 || T !== void 0 && T.qAnchorHandled === !0 || t !== void 0 && t(T) !== !0)
2215
- return;
2216
- const k = r["onUpdate:modelValue"] !== void 0;
2217
- k === !0 && (h("update:modelValue", !0), s = T, fe(() => {
2218
- s === T && (s = void 0);
2219
- })), (r.modelValue === null || k === !1) && c(T);
2220
- }
2221
- function c(T) {
2222
- e.value !== !0 && (e.value = !0, h("beforeShow", T), n !== void 0 ? n(T) : h("show", T));
2223
- }
2224
- function m(T) {
2225
- if (r.disable === !0)
2226
- return;
2227
- const k = r["onUpdate:modelValue"] !== void 0;
2228
- k === !0 && (h("update:modelValue", !1), s = T, fe(() => {
2229
- s === T && (s = void 0);
2230
- })), (r.modelValue === null || k === !1) && C(T);
2231
- }
2232
- function C(T) {
2233
- e.value !== !1 && (e.value = !1, h("beforeHide", T), o !== void 0 ? o(T) : h("hide", T));
2234
- }
2235
- function p(T) {
2236
- r.disable === !0 && T === !0 ? r["onUpdate:modelValue"] !== void 0 && h("update:modelValue", !1) : T === !0 !== e.value && (T === !0 ? c : C)(s);
2237
- }
2238
- Z(() => r.modelValue, p), l !== void 0 && Bn(a) === !0 && Z(() => b.$route.fullPath, () => {
2239
- l.value === !0 && e.value === !0 && m();
2240
- }), ht(() => {
2241
- p(r.modelValue);
2242
- });
2243
- const O = { show: v, hide: m, toggle: y };
2244
- return Object.assign(b, O), O;
2245
- }
2246
- const Ul = {};
2247
- let ji = 1, Ni = document.body;
2248
- function Wi(e, t) {
2249
- const l = document.createElement("div");
2250
- if (l.id = t !== void 0 ? `q-portal--${t}--${ji++}` : e, Ul.globalNodes !== void 0) {
2251
- const n = Ul.globalNodes.class;
2252
- n !== void 0 && (l.className = n);
2253
- }
2254
- return Ni.appendChild(l), l;
2255
- }
2256
- function Ki(e) {
2257
- e.remove();
2258
- }
2259
- const ct = [];
2260
- function Qi(e, t) {
2261
- do {
2262
- if (e.$options.name === "QMenu") {
2263
- if (e.hide(t), e.$props.separateClosePopup === !0)
2264
- return Qt(e);
2265
- } else if (e.__qPortal === !0) {
2266
- const l = Qt(e);
2267
- return l !== void 0 && l.$options.name === "QPopupProxy" ? (e.hide(t), l) : e;
2268
- }
2269
- e = Qt(e);
2270
- } while (e != null);
2271
- }
2272
- const Ui = he({
2273
- name: "QPortal",
2274
- setup(e, { slots: t }) {
2275
- return () => t.default();
2276
- }
2277
- });
2278
- function Yi(e) {
2279
- for (e = e.parent; e != null; ) {
2280
- if (e.type.name === "QGlobalDialog")
2281
- return !0;
2282
- if (e.type.name === "QDialog" || e.type.name === "QMenu")
2283
- return !1;
2284
- e = e.parent;
2285
- }
2286
- return !1;
2287
- }
2288
- function Kn(e, t, l, n) {
2289
- const o = P(!1), u = P(!1);
2290
- let a = null;
2291
- const r = {}, h = n === "dialog" && Yi(e);
2292
- function b(y) {
2293
- if (y === !0) {
2294
- Ql(r), u.value = !0;
2295
- return;
2296
- }
2297
- u.value = !1, o.value === !1 && (h === !1 && a === null && (a = Wi(!1, n)), o.value = !0, ct.push(e.proxy), Ri(r));
2298
- }
2299
- function s(y) {
2300
- if (u.value = !1, y !== !0) return;
2301
- Ql(r), o.value = !1;
2302
- const v = ct.indexOf(e.proxy);
2303
- v !== -1 && ct.splice(v, 1), a !== null && (Ki(a), a = null);
2304
- }
2305
- return So(() => {
2306
- s(!0);
2307
- }), e.proxy.__qPortal = !0, dl(e.proxy, "contentEl", () => t.value), {
2308
- showPortal: b,
2309
- hidePortal: s,
2310
- portalIsActive: o,
2311
- portalIsAccessible: u,
2312
- renderPortal: () => h === !0 ? l() : o.value === !0 ? [g(ko, { to: a }, g(Ui, l))] : void 0
2313
- };
2314
- }
2315
- const Qn = {
2316
- transitionShow: {
2317
- type: String,
2318
- default: "fade"
2319
- },
2320
- transitionHide: {
2321
- type: String,
2322
- default: "fade"
2323
- },
2324
- transitionDuration: {
2325
- type: [String, Number],
2326
- default: 300
2327
- }
2328
- };
2329
- function Un(e, t = () => {
2330
- }, l = () => {
2331
- }) {
2332
- return {
2333
- transitionProps: d(() => {
2334
- const n = `q-transition--${e.transitionShow || t()}`, o = `q-transition--${e.transitionHide || l()}`;
2335
- return {
2336
- appear: !0,
2337
- enterFromClass: `${n}-enter-from`,
2338
- enterActiveClass: `${n}-enter-active`,
2339
- enterToClass: `${n}-enter-to`,
2340
- leaveFromClass: `${o}-leave-from`,
2341
- leaveActiveClass: `${o}-leave-active`,
2342
- leaveToClass: `${o}-leave-to`
2343
- };
2344
- }),
2345
- transitionStyle: d(() => `--q-transition-duration: ${e.transitionDuration}ms`)
2346
- };
2347
- }
2348
- function Yn() {
2349
- let e;
2350
- const t = ne();
2351
- function l() {
2352
- e = void 0;
2353
- }
2354
- return Pt(l), me(l), {
2355
- removeTick: l,
2356
- registerTick(n) {
2357
- e = n, fe(() => {
2358
- e === n && (Tn(t) === !1 && e(), e = void 0);
2359
- });
2360
- }
2361
- };
2362
- }
2363
- function Xn() {
2364
- let e = null;
2365
- const t = ne();
2366
- function l() {
2367
- e !== null && (clearTimeout(e), e = null);
2368
- }
2369
- return Pt(l), me(l), {
2370
- removeTimeout: l,
2371
- registerTimeout(n, o) {
2372
- l(), Tn(t) === !1 && (e = setTimeout(() => {
2373
- e = null, n();
2374
- }, o));
2375
- }
2376
- };
2377
- }
2378
- const Xi = [Element, String], Gi = [null, document, document.body, document.scrollingElement, document.documentElement];
2379
- function Zi(e, t) {
2380
- let l = Io(t);
2381
- if (l === void 0) {
2382
- if (e == null)
2383
- return window;
2384
- l = e.closest(".scroll,.scroll-y,.overflow-auto");
2385
- }
2386
- return Gi.includes(l) ? window : l;
2387
- }
2388
- function Ji(e) {
2389
- return e === window ? window.pageYOffset || window.scrollY || document.body.scrollTop || 0 : e.scrollTop;
2390
- }
2391
- function eu(e) {
2392
- return e === window ? window.pageXOffset || window.scrollX || document.body.scrollLeft || 0 : e.scrollLeft;
2393
- }
2394
- let _t;
2395
- function tu() {
2396
- if (_t !== void 0)
2397
- return _t;
2398
- const e = document.createElement("p"), t = document.createElement("div");
2399
- ol(e, {
2400
- width: "100%",
2401
- height: "200px"
2402
- }), ol(t, {
2403
- position: "absolute",
2404
- top: "0px",
2405
- left: "0px",
2406
- visibility: "hidden",
2407
- width: "200px",
2408
- height: "150px",
2409
- overflow: "hidden"
2410
- }), t.appendChild(e), document.body.appendChild(t);
2411
- const l = e.offsetWidth;
2412
- t.style.overflow = "scroll";
2413
- let n = e.offsetWidth;
2414
- return l === n && (n = t.clientWidth), t.remove(), _t = l - n, _t;
2415
- }
2416
- function lu(e, t = !0) {
2417
- return !e || e.nodeType !== Node.ELEMENT_NODE ? !1 : t ? e.scrollHeight > e.clientHeight && (e.classList.contains("scroll") || e.classList.contains("overflow-auto") || ["auto", "scroll"].includes(window.getComputedStyle(e)["overflow-y"])) : e.scrollWidth > e.clientWidth && (e.classList.contains("scroll") || e.classList.contains("overflow-auto") || ["auto", "scroll"].includes(window.getComputedStyle(e)["overflow-x"]));
2418
- }
2419
- const ze = [];
2420
- let et;
2421
- function nu(e) {
2422
- et = e.keyCode === 27;
2423
- }
2424
- function ou() {
2425
- et === !0 && (et = !1);
2426
- }
2427
- function iu(e) {
2428
- et === !0 && (et = !1, Ie(e, 27) === !0 && ze[ze.length - 1](e));
2429
- }
2430
- function Gn(e) {
2431
- window[e]("keydown", nu), window[e]("blur", ou), window[e]("keyup", iu), et = !1;
2432
- }
2433
- function Zn(e) {
2434
- ve.is.desktop === !0 && (ze.push(e), ze.length === 1 && Gn("addEventListener"));
2435
- }
2436
- function Lt(e) {
2437
- const t = ze.indexOf(e);
2438
- t !== -1 && (ze.splice(t, 1), ze.length === 0 && Gn("removeEventListener"));
2439
- }
2440
- const { notPassiveCapture: Mt } = re, Fe = [];
2441
- function At(e) {
2442
- const t = e.target;
2443
- if (t === void 0 || t.nodeType === 8 || t.classList.contains("no-pointer-events") === !0)
2444
- return;
2445
- let l = ct.length - 1;
2446
- for (; l >= 0; ) {
2447
- const n = ct[l].$;
2448
- if (n.type.name === "QTooltip") {
2449
- l--;
2450
- continue;
2451
- }
2452
- if (n.type.name !== "QDialog")
2453
- break;
2454
- if (n.props.seamless !== !0)
2455
- return;
2456
- l--;
2457
- }
2458
- for (let n = Fe.length - 1; n >= 0; n--) {
2459
- const o = Fe[n];
2460
- if ((o.anchorEl.value === null || o.anchorEl.value.contains(t) === !1) && (t === document.body || o.innerRef.value !== null && o.innerRef.value.contains(t) === !1))
2461
- e.qClickOutside = !0, o.onClickOutside(e);
2462
- else
2463
- return;
2464
- }
2465
- }
2466
- function uu(e) {
2467
- Fe.push(e), Fe.length === 1 && (document.addEventListener("mousedown", At, Mt), document.addEventListener("touchstart", At, Mt));
2468
- }
2469
- function Yl(e) {
2470
- const t = Fe.findIndex((l) => l === e);
2471
- t !== -1 && (Fe.splice(t, 1), Fe.length === 0 && (document.removeEventListener("mousedown", At, Mt), document.removeEventListener("touchstart", At, Mt)));
2472
- }
2473
- let Xl, Gl;
2474
- function Zl(e) {
2475
- const t = e.split(" ");
2476
- return t.length !== 2 ? !1 : ["top", "center", "bottom"].includes(t[0]) !== !0 ? (console.error("Anchor/Self position must start with one of top/center/bottom"), !1) : ["left", "middle", "right", "start", "end"].includes(t[1]) !== !0 ? (console.error("Anchor/Self position must end with one of left/middle/right/start/end"), !1) : !0;
2477
- }
2478
- function au(e) {
2479
- return e ? !(e.length !== 2 || typeof e[0] != "number" || typeof e[1] != "number") : !0;
2480
- }
2481
- const cl = {
2482
- "start#ltr": "left",
2483
- "start#rtl": "right",
2484
- "end#ltr": "right",
2485
- "end#rtl": "left"
2486
- };
2487
- ["left", "middle", "right"].forEach((e) => {
2488
- cl[`${e}#ltr`] = e, cl[`${e}#rtl`] = e;
2489
- });
2490
- function Jl(e, t) {
2491
- const l = e.split(" ");
2492
- return {
2493
- vertical: l[0],
2494
- horizontal: cl[`${l[1]}#${t === !0 ? "rtl" : "ltr"}`]
2495
- };
2496
- }
2497
- function ru(e, t) {
2498
- let { top: l, left: n, right: o, bottom: u, width: a, height: r } = e.getBoundingClientRect();
2499
- return t !== void 0 && (l -= t[1], n -= t[0], u += t[1], o += t[0], a += t[0], r += t[1]), {
2500
- top: l,
2501
- bottom: u,
2502
- height: r,
2503
- left: n,
2504
- right: o,
2505
- width: a,
2506
- middle: n + (o - n) / 2,
2507
- center: l + (u - l) / 2
2508
- };
2509
- }
2510
- function su(e, t, l) {
2511
- let { top: n, left: o } = e.getBoundingClientRect();
2512
- return n += t.top, o += t.left, l !== void 0 && (n += l[1], o += l[0]), {
2513
- top: n,
2514
- bottom: n + 1,
2515
- height: 1,
2516
- left: o,
2517
- right: o + 1,
2518
- width: 1,
2519
- middle: o,
2520
- center: n
2521
- };
2522
- }
2523
- function cu(e, t) {
2524
- return {
2525
- top: 0,
2526
- center: t / 2,
2527
- bottom: t,
2528
- left: 0,
2529
- middle: e / 2,
2530
- right: e
2531
- };
2532
- }
2533
- function en(e, t, l, n) {
2534
- return {
2535
- top: e[l.vertical] - t[n.vertical],
2536
- left: e[l.horizontal] - t[n.horizontal]
2537
- };
2538
- }
2539
- function Jn(e, t = 0) {
2540
- if (e.targetEl === null || e.anchorEl === null || t > 5)
2541
- return;
2542
- if (e.targetEl.offsetHeight === 0 || e.targetEl.offsetWidth === 0) {
2543
- setTimeout(() => {
2544
- Jn(e, t + 1);
2545
- }, 10);
2546
- return;
2547
- }
2548
- const {
2549
- targetEl: l,
2550
- offset: n,
2551
- anchorEl: o,
2552
- anchorOrigin: u,
2553
- selfOrigin: a,
2554
- absoluteOffset: r,
2555
- fit: h,
2556
- cover: b,
2557
- maxHeight: s,
2558
- maxWidth: y
2559
- } = e;
2560
- if (ve.is.ios === !0 && window.visualViewport !== void 0) {
2561
- const B = document.body.style, { offsetLeft: A, offsetTop: z } = window.visualViewport;
2562
- A !== Xl && (B.setProperty("--q-pe-left", A + "px"), Xl = A), z !== Gl && (B.setProperty("--q-pe-top", z + "px"), Gl = z);
2563
- }
2564
- const { scrollLeft: v, scrollTop: c } = l, m = r === void 0 ? ru(o, b === !0 ? [0, 0] : n) : su(o, r, n);
2565
- Object.assign(l.style, {
2566
- top: 0,
2567
- left: 0,
2568
- minWidth: null,
2569
- minHeight: null,
2570
- maxWidth: y,
2571
- maxHeight: s,
2572
- visibility: "visible"
2573
- });
2574
- const { offsetWidth: C, offsetHeight: p } = l, { elWidth: O, elHeight: T } = h === !0 || b === !0 ? { elWidth: Math.max(m.width, C), elHeight: b === !0 ? Math.max(m.height, p) : p } : { elWidth: C, elHeight: p };
2575
- let k = { maxWidth: y, maxHeight: s };
2576
- (h === !0 || b === !0) && (k.minWidth = m.width + "px", b === !0 && (k.minHeight = m.height + "px")), Object.assign(l.style, k);
2577
- const M = cu(O, T);
2578
- let R = en(m, M, u, a);
2579
- if (r === void 0 || n === void 0)
2580
- Gt(R, m, M, u, a);
2581
- else {
2582
- const { top: B, left: A } = R;
2583
- Gt(R, m, M, u, a);
2584
- let z = !1;
2585
- if (R.top !== B) {
2586
- z = !0;
2587
- const N = 2 * n[1];
2588
- m.center = m.top -= N, m.bottom -= N + 2;
2589
- }
2590
- if (R.left !== A) {
2591
- z = !0;
2592
- const N = 2 * n[0];
2593
- m.middle = m.left -= N, m.right -= N + 2;
2594
- }
2595
- z === !0 && (R = en(m, M, u, a), Gt(R, m, M, u, a));
2596
- }
2597
- k = {
2598
- top: R.top + "px",
2599
- left: R.left + "px"
2600
- }, R.maxHeight !== void 0 && (k.maxHeight = R.maxHeight + "px", m.height > R.maxHeight && (k.minHeight = k.maxHeight)), R.maxWidth !== void 0 && (k.maxWidth = R.maxWidth + "px", m.width > R.maxWidth && (k.minWidth = k.maxWidth)), Object.assign(l.style, k), l.scrollTop !== c && (l.scrollTop = c), l.scrollLeft !== v && (l.scrollLeft = v);
2601
- }
2602
- function Gt(e, t, l, n, o) {
2603
- const u = l.bottom, a = l.right, r = tu(), h = window.innerHeight - r, b = document.body.clientWidth;
2604
- if (e.top < 0 || e.top + u > h)
2605
- if (o.vertical === "center")
2606
- e.top = t[n.vertical] > h / 2 ? Math.max(0, h - u) : 0, e.maxHeight = Math.min(u, h);
2607
- else if (t[n.vertical] > h / 2) {
2608
- const s = Math.min(
2609
- h,
2610
- n.vertical === "center" ? t.center : n.vertical === o.vertical ? t.bottom : t.top
2611
- );
2612
- e.maxHeight = Math.min(u, s), e.top = Math.max(0, s - u);
2613
- } else
2614
- e.top = Math.max(
2615
- 0,
2616
- n.vertical === "center" ? t.center : n.vertical === o.vertical ? t.top : t.bottom
2617
- ), e.maxHeight = Math.min(u, h - e.top);
2618
- if (e.left < 0 || e.left + a > b)
2619
- if (e.maxWidth = Math.min(a, b), o.horizontal === "middle")
2620
- e.left = t[n.horizontal] > b / 2 ? Math.max(0, b - a) : 0;
2621
- else if (t[n.horizontal] > b / 2) {
2622
- const s = Math.min(
2623
- b,
2624
- n.horizontal === "middle" ? t.middle : n.horizontal === o.horizontal ? t.right : t.left
2625
- );
2626
- e.maxWidth = Math.min(a, s), e.left = Math.max(0, s - e.maxWidth);
2627
- } else
2628
- e.left = Math.max(
2629
- 0,
2630
- n.horizontal === "middle" ? t.middle : n.horizontal === o.horizontal ? t.left : t.right
2631
- ), e.maxWidth = Math.min(a, b - e.left);
2632
- }
2633
- const du = he({
2634
- name: "QMenu",
2635
- inheritAttrs: !1,
2636
- props: {
2637
- ...Ii,
2638
- ...jn,
2639
- ...gt,
2640
- ...Qn,
2641
- persistent: Boolean,
2642
- autoClose: Boolean,
2643
- separateClosePopup: Boolean,
2644
- noRouteDismiss: Boolean,
2645
- noRefocus: Boolean,
2646
- noFocus: Boolean,
2647
- fit: Boolean,
2648
- cover: Boolean,
2649
- square: Boolean,
2650
- anchor: {
2651
- type: String,
2652
- validator: Zl
2653
- },
2654
- self: {
2655
- type: String,
2656
- validator: Zl
2657
- },
2658
- offset: {
2659
- type: Array,
2660
- validator: au
2661
- },
2662
- scrollTarget: Xi,
2663
- touchPosition: Boolean,
2664
- maxHeight: {
2665
- type: String,
2666
- default: null
2667
- },
2668
- maxWidth: {
2669
- type: String,
2670
- default: null
2671
- }
2672
- },
2673
- emits: [
2674
- ...Nn,
2675
- "click",
2676
- "escapeKey"
2677
- ],
2678
- setup(e, { slots: t, emit: l, attrs: n }) {
2679
- let o = null, u, a, r;
2680
- const h = ne(), { proxy: b } = h, { $q: s } = b, y = P(null), v = P(!1), c = d(
2681
- () => e.persistent !== !0 && e.noRouteDismiss !== !0
2682
- ), m = pt(e, s), { registerTick: C, removeTick: p } = Yn(), { registerTimeout: O } = Xn(), { transitionProps: T, transitionStyle: k } = Un(e), { localScrollTarget: M, changeScrollEvent: R, unconfigureScrollTarget: B } = Di(e, I), { anchorEl: A, canShow: z } = Hi({ showing: v }), { hide: N } = Wn({
2683
- showing: v,
2684
- canShow: z,
2685
- handleShow: se,
2686
- handleHide: f,
2687
- hideOnRouteChange: c,
2688
- processOnMount: !0
2689
- }), { showPortal: J, hidePortal: U, renderPortal: L } = Kn(h, y, W, "menu"), K = {
2690
- anchorEl: A,
2691
- innerRef: y,
2692
- onClickOutside(w) {
2693
- if (e.persistent !== !0 && v.value === !0)
2694
- return N(w), // always prevent touch event
2695
- (w.type === "touchstart" || w.target.classList.contains("q-dialog__backdrop")) && le(w), !0;
2696
- }
2697
- }, V = d(
2698
- () => Jl(
2699
- e.anchor || (e.cover === !0 ? "center middle" : "bottom start"),
2700
- s.lang.rtl
2701
- )
2702
- ), D = d(() => e.cover === !0 ? V.value : Jl(e.self || "top start", s.lang.rtl)), X = d(
2703
- () => (e.square === !0 ? " q-menu--square" : "") + (m.value === !0 ? " q-menu--dark q-dark" : "")
2704
- ), ae = d(() => e.autoClose === !0 ? { onClick: j } : {}), E = d(
2705
- () => v.value === !0 && e.persistent !== !0
2706
- );
2707
- Z(E, (w) => {
2708
- w === !0 ? (Zn(x), uu(K)) : (Lt(x), Yl(K));
2709
- });
2710
- function F() {
2711
- ml(() => {
2712
- let w = y.value;
2713
- w && w.contains(document.activeElement) !== !0 && (w = w.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || w.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || w.querySelector("[autofocus], [data-autofocus]") || w, w.focus({ preventScroll: !0 }));
2714
- });
2715
- }
2716
- function se(w) {
2717
- if (o = e.noRefocus === !1 ? document.activeElement : null, vl(G), J(), I(), u = void 0, w !== void 0 && (e.touchPosition || e.contextMenu)) {
2718
- const ee = Cn(w);
2719
- if (ee.left !== void 0) {
2720
- const { top: ye, left: He } = A.value.getBoundingClientRect();
2721
- u = { left: ee.left - He, top: ee.top - ye };
2722
- }
2723
- }
2724
- a === void 0 && (a = Z(
2725
- () => s.screen.width + "|" + s.screen.height + "|" + e.self + "|" + e.anchor + "|" + s.lang.rtl,
2726
- $
2727
- )), e.noFocus !== !0 && document.activeElement.blur(), C(() => {
2728
- $(), e.noFocus !== !0 && F();
2729
- }), O(() => {
2730
- s.platform.is.ios === !0 && (r = e.autoClose, y.value.click()), $(), J(!0), l("show", w);
2731
- }, e.transitionDuration);
2732
- }
2733
- function f(w) {
2734
- p(), U(), S(!0), o !== null && // menu was hidden from code or ESC plugin
2735
- (w === void 0 || w.qClickOutside !== !0) && (((w && w.type.indexOf("key") === 0 ? o.closest('[tabindex]:not([tabindex^="-"])') : void 0) || o).focus(), o = null), O(() => {
2736
- U(!0), l("hide", w);
2737
- }, e.transitionDuration);
2738
- }
2739
- function S(w) {
2740
- u = void 0, a !== void 0 && (a(), a = void 0), (w === !0 || v.value === !0) && (Rt(G), B(), Yl(K), Lt(x)), w !== !0 && (o = null);
2741
- }
2742
- function I() {
2743
- (A.value !== null || e.scrollTarget !== void 0) && (M.value = Zi(A.value, e.scrollTarget), R(M.value, $));
2744
- }
2745
- function j(w) {
2746
- r !== !0 ? (Qi(b, w), l("click", w)) : r = !1;
2747
- }
2748
- function G(w) {
2749
- E.value === !0 && e.noFocus !== !0 && xn(y.value, w.target) !== !0 && F();
2750
- }
2751
- function x(w) {
2752
- l("escapeKey"), N(w);
2753
- }
2754
- function $() {
2755
- Jn({
2756
- targetEl: y.value,
2757
- offset: e.offset,
2758
- anchorEl: A.value,
2759
- anchorOrigin: V.value,
2760
- selfOrigin: D.value,
2761
- absoluteOffset: u,
2762
- fit: e.fit,
2763
- cover: e.cover,
2764
- maxHeight: e.maxHeight,
2765
- maxWidth: e.maxWidth
2766
- });
2767
- }
2768
- function W() {
2769
- return g(
2770
- dt,
2771
- T.value,
2772
- () => v.value === !0 ? g("div", {
2773
- role: "menu",
2774
- ...n,
2775
- ref: y,
2776
- tabindex: -1,
2777
- class: [
2778
- "q-menu q-position-engine scroll" + X.value,
2779
- n.class
2780
- ],
2781
- style: [
2782
- n.style,
2783
- k.value
2784
- ],
2785
- ...ae.value
2786
- }, ke(t.default)) : null
2787
- );
2788
- }
2789
- return me(S), Object.assign(b, { focus: F, updatePosition: $ }), L;
2790
- }
2791
- });
2792
- function fu(e, t, l) {
2793
- function n() {
2794
- }
2795
- return me(() => {
2796
- e.value === !0 && void 0;
2797
- }), {
2798
- removeFromHistory: n,
2799
- addToHistory() {
2800
- }
2801
- };
2802
- }
2803
- let it = 0, Zt, Jt, rt, el = !1, tn, ln, nn, Me = null;
2804
- function vu(e) {
2805
- mu(e) && le(e);
2806
- }
2807
- function mu(e) {
2808
- if (e.target === document.body || e.target.classList.contains("q-layout__backdrop"))
2809
- return !0;
2810
- const t = Do(e), l = e.shiftKey && !e.deltaX, n = !l && Math.abs(e.deltaX) <= Math.abs(e.deltaY), o = l || n ? e.deltaY : e.deltaX;
2811
- for (let u = 0; u < t.length; u++) {
2812
- const a = t[u];
2813
- if (lu(a, n))
2814
- return n ? o < 0 && a.scrollTop === 0 ? !0 : o > 0 && a.scrollTop + a.clientHeight === a.scrollHeight : o < 0 && a.scrollLeft === 0 ? !0 : o > 0 && a.scrollLeft + a.clientWidth === a.scrollWidth;
2815
- }
2816
- return !0;
2817
- }
2818
- function on(e) {
2819
- e.target === document && (document.scrollingElement.scrollTop = document.scrollingElement.scrollTop);
2820
- }
2821
- function Et(e) {
2822
- el !== !0 && (el = !0, requestAnimationFrame(() => {
2823
- el = !1;
2824
- const { height: t } = e.target, { clientHeight: l, scrollTop: n } = document.scrollingElement;
2825
- (rt === void 0 || t !== window.innerHeight) && (rt = l - t, document.scrollingElement.scrollTop = n), n > rt && (document.scrollingElement.scrollTop -= Math.ceil((n - rt) / 8));
2826
- }));
2827
- }
2828
- function un(e) {
2829
- const t = document.body, l = window.visualViewport !== void 0;
2830
- if (e === "add") {
2831
- const { overflowY: n, overflowX: o } = window.getComputedStyle(t);
2832
- Zt = eu(window), Jt = Ji(window), tn = t.style.left, ln = t.style.top, nn = window.location.href, t.style.left = `-${Zt}px`, t.style.top = `-${Jt}px`, o !== "hidden" && (o === "scroll" || t.scrollWidth > window.innerWidth) && t.classList.add("q-body--force-scrollbar-x"), n !== "hidden" && (n === "scroll" || t.scrollHeight > window.innerHeight) && t.classList.add("q-body--force-scrollbar-y"), t.classList.add("q-body--prevent-scroll"), document.qScrollPrevented = !0, ve.is.ios === !0 && (l === !0 ? (window.scrollTo(0, 0), window.visualViewport.addEventListener("resize", Et, re.passiveCapture), window.visualViewport.addEventListener("scroll", Et, re.passiveCapture), window.scrollTo(0, 0)) : window.addEventListener("scroll", on, re.passiveCapture));
2833
- }
2834
- ve.is.desktop === !0 && ve.is.mac === !0 && window[`${e}EventListener`]("wheel", vu, re.notPassive), e === "remove" && (ve.is.ios === !0 && (l === !0 ? (window.visualViewport.removeEventListener("resize", Et, re.passiveCapture), window.visualViewport.removeEventListener("scroll", Et, re.passiveCapture)) : window.removeEventListener("scroll", on, re.passiveCapture)), t.classList.remove("q-body--prevent-scroll"), t.classList.remove("q-body--force-scrollbar-x"), t.classList.remove("q-body--force-scrollbar-y"), document.qScrollPrevented = !1, t.style.left = tn, t.style.top = ln, window.location.href === nn && window.scrollTo(Zt, Jt), rt = void 0);
2835
- }
2836
- function hu(e) {
2837
- let t = "add";
2838
- if (e === !0) {
2839
- if (it++, Me !== null) {
2840
- clearTimeout(Me), Me = null;
2841
- return;
2842
- }
2843
- if (it > 1)
2844
- return;
2845
- } else {
2846
- if (it === 0 || (it--, it > 0))
2847
- return;
2848
- if (t = "remove", ve.is.ios === !0 && ve.is.nativeMobile === !0) {
2849
- Me !== null && clearTimeout(Me), Me = setTimeout(() => {
2850
- un(t), Me = null;
2851
- }, 100);
2852
- return;
2853
- }
2854
- }
2855
- un(t);
2856
- }
2857
- function gu() {
2858
- let e;
2859
- return {
2860
- preventBodyScroll(t) {
2861
- t !== e && (e !== void 0 || t === !0) && (e = t, hu(t));
2862
- }
2863
- };
2864
- }
2865
- let Vt = 0;
2866
- const pu = {
2867
- standard: "fixed-full flex-center",
2868
- top: "fixed-top justify-center",
2869
- bottom: "fixed-bottom justify-center",
2870
- right: "fixed-right items-center",
2871
- left: "fixed-left items-center"
2872
- }, an = {
2873
- standard: ["scale", "scale"],
2874
- top: ["slide-down", "slide-up"],
2875
- bottom: ["slide-up", "slide-down"],
2876
- right: ["slide-left", "slide-right"],
2877
- left: ["slide-right", "slide-left"]
2878
- }, bu = he({
2879
- name: "QDialog",
2880
- inheritAttrs: !1,
2881
- props: {
2882
- ...jn,
2883
- ...Qn,
2884
- transitionShow: String,
2885
- // override useTransitionProps
2886
- transitionHide: String,
2887
- // override useTransitionProps
2888
- persistent: Boolean,
2889
- autoClose: Boolean,
2890
- allowFocusOutside: Boolean,
2891
- noEscDismiss: Boolean,
2892
- noBackdropDismiss: Boolean,
2893
- noRouteDismiss: Boolean,
2894
- noRefocus: Boolean,
2895
- noFocus: Boolean,
2896
- noShake: Boolean,
2897
- seamless: Boolean,
2898
- maximized: Boolean,
2899
- fullWidth: Boolean,
2900
- fullHeight: Boolean,
2901
- square: Boolean,
2902
- backdropFilter: String,
2903
- position: {
2904
- type: String,
2905
- default: "standard",
2906
- validator: (e) => ["standard", "top", "bottom", "left", "right"].includes(e)
2907
- }
2908
- },
2909
- emits: [
2910
- ...Nn,
2911
- "shake",
2912
- "click",
2913
- "escapeKey"
2914
- ],
2915
- setup(e, { slots: t, emit: l, attrs: n }) {
2916
- const o = ne(), u = P(null), a = P(!1), r = P(!1);
2917
- let h = null, b = null, s, y;
2918
- const v = d(
2919
- () => e.persistent !== !0 && e.noRouteDismiss !== !0 && e.seamless !== !0
2920
- ), { preventBodyScroll: c } = gu(), { registerTimeout: m } = Xn(), { registerTick: C, removeTick: p } = Yn(), { transitionProps: O, transitionStyle: T } = Un(
2921
- e,
2922
- () => an[e.position][0],
2923
- () => an[e.position][1]
2924
- ), k = d(() => T.value + (e.backdropFilter !== void 0 ? `;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}` : "")), { showPortal: M, hidePortal: R, portalIsAccessible: B, renderPortal: A } = Kn(
2925
- o,
2926
- u,
2927
- G,
2928
- "dialog"
2929
- ), { hide: z } = Wn({
2930
- showing: a,
2931
- hideOnRouteChange: v,
2932
- handleShow: D,
2933
- handleHide: X,
2934
- processOnMount: !0
2935
- }), { addToHistory: N, removeFromHistory: J } = fu(a, z), U = d(
2936
- () => `q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized === !0 ? "maximized" : "minimized"} q-dialog__inner--${e.position} ${pu[e.position]}` + (r.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" : "")
2937
- ), L = d(() => a.value === !0 && e.seamless !== !0), K = d(() => e.autoClose === !0 ? { onClick: S } : {}), V = d(() => [
2938
- `q-dialog fullscreen no-pointer-events q-dialog--${L.value === !0 ? "modal" : "seamless"}`,
2939
- n.class
2940
- ]);
2941
- Z(() => e.maximized, (x) => {
2942
- a.value === !0 && f(x);
2943
- }), Z(L, (x) => {
2944
- c(x), x === !0 ? (vl(j), Zn(F)) : (Rt(j), Lt(F));
2945
- });
2946
- function D(x) {
2947
- N(), b = e.noRefocus === !1 && document.activeElement !== null ? document.activeElement : null, f(e.maximized), M(), r.value = !0, e.noFocus !== !0 ? (document.activeElement !== null && document.activeElement.blur(), C(ae)) : p(), m(() => {
2948
- if (o.proxy.$q.platform.is.ios === !0) {
2949
- if (e.seamless !== !0 && document.activeElement) {
2950
- const { top: $, bottom: W } = document.activeElement.getBoundingClientRect(), { innerHeight: w } = window, ee = window.visualViewport !== void 0 ? window.visualViewport.height : w;
2951
- $ > 0 && W > ee / 2 && (document.scrollingElement.scrollTop = Math.min(
2952
- document.scrollingElement.scrollHeight - ee,
2953
- W >= w ? 1 / 0 : Math.ceil(document.scrollingElement.scrollTop + W - ee / 2)
2954
- )), document.activeElement.scrollIntoView();
2955
- }
2956
- y = !0, u.value.click(), y = !1;
2957
- }
2958
- M(!0), r.value = !1, l("show", x);
2959
- }, e.transitionDuration);
2960
- }
2961
- function X(x) {
2962
- p(), J(), se(!0), r.value = !0, R(), b !== null && (((x && x.type.indexOf("key") === 0 ? b.closest('[tabindex]:not([tabindex^="-"])') : void 0) || b).focus(), b = null), m(() => {
2963
- R(!0), r.value = !1, l("hide", x);
2964
- }, e.transitionDuration);
2965
- }
2966
- function ae(x) {
2967
- ml(() => {
2968
- let $ = u.value;
2969
- if ($ !== null) {
2970
- if (x !== void 0) {
2971
- const W = $.querySelector(x);
2972
- if (W !== null) {
2973
- W.focus({ preventScroll: !0 });
2974
- return;
2975
- }
2976
- }
2977
- $.contains(document.activeElement) !== !0 && ($ = $.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || $.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || $.querySelector("[autofocus], [data-autofocus]") || $, $.focus({ preventScroll: !0 }));
2978
- }
2979
- });
2980
- }
2981
- function E(x) {
2982
- x && typeof x.focus == "function" ? x.focus({ preventScroll: !0 }) : ae(), l("shake");
2983
- const $ = u.value;
2984
- $ !== null && ($.classList.remove("q-animate--scale"), $.classList.add("q-animate--scale"), h !== null && clearTimeout(h), h = setTimeout(() => {
2985
- h = null, u.value !== null && ($.classList.remove("q-animate--scale"), ae());
2986
- }, 170));
2987
- }
2988
- function F() {
2989
- e.seamless !== !0 && (e.persistent === !0 || e.noEscDismiss === !0 ? e.maximized !== !0 && e.noShake !== !0 && E() : (l("escapeKey"), z()));
2990
- }
2991
- function se(x) {
2992
- h !== null && (clearTimeout(h), h = null), (x === !0 || a.value === !0) && (f(!1), e.seamless !== !0 && (c(!1), Rt(j), Lt(F))), x !== !0 && (b = null);
2993
- }
2994
- function f(x) {
2995
- x === !0 ? s !== !0 && (Vt < 1 && document.body.classList.add("q-body--dialog"), Vt++, s = !0) : s === !0 && (Vt < 2 && document.body.classList.remove("q-body--dialog"), Vt--, s = !1);
2996
- }
2997
- function S(x) {
2998
- y !== !0 && (z(x), l("click", x));
2999
- }
3000
- function I(x) {
3001
- e.persistent !== !0 && e.noBackdropDismiss !== !0 ? z(x) : e.noShake !== !0 && E();
3002
- }
3003
- function j(x) {
3004
- e.allowFocusOutside !== !0 && B.value === !0 && xn(u.value, x.target) !== !0 && ae('[tabindex]:not([tabindex="-1"])');
3005
- }
3006
- Object.assign(o.proxy, {
3007
- // expose public methods
3008
- focus: ae,
3009
- shake: E,
3010
- // private but needed by QSelect
3011
- __updateRefocusTarget(x) {
3012
- b = x || null;
3013
- }
3014
- }), me(se);
3015
- function G() {
3016
- return g("div", {
3017
- role: "dialog",
3018
- "aria-modal": L.value === !0 ? "true" : "false",
3019
- ...n,
3020
- class: V.value
3021
- }, [
3022
- g(dt, {
3023
- name: "q-transition--fade",
3024
- appear: !0
3025
- }, () => L.value === !0 ? g("div", {
3026
- class: "q-dialog__backdrop fixed-full",
3027
- style: k.value,
3028
- "aria-hidden": "true",
3029
- tabindex: -1,
3030
- onClick: I
3031
- }) : null),
3032
- g(
3033
- dt,
3034
- O.value,
3035
- () => a.value === !0 ? g("div", {
3036
- ref: u,
3037
- class: U.value,
3038
- style: T.value,
3039
- tabindex: -1,
3040
- ...K.value
3041
- }, ke(t.default)) : null
3042
- )
3043
- ]);
3044
- }
3045
- return A;
3046
- }
3047
- });
3048
- let Ot = !1;
3049
- {
3050
- const e = document.createElement("div");
3051
- e.setAttribute("dir", "rtl"), Object.assign(e.style, {
3052
- width: "1px",
3053
- height: "1px",
3054
- overflow: "auto"
3055
- });
3056
- const t = document.createElement("div");
3057
- Object.assign(t.style, {
3058
- width: "1000px",
3059
- height: "1px"
3060
- }), document.body.appendChild(e), e.appendChild(t), e.scrollLeft = -1e3, Ot = e.scrollLeft >= 0, e.remove();
3061
- }
3062
- const pe = 1e3, yu = [
3063
- "start",
3064
- "center",
3065
- "end",
3066
- "start-force",
3067
- "center-force",
3068
- "end-force"
3069
- ], eo = Array.prototype.filter, wu = window.getComputedStyle(document.body).overflowAnchor === void 0 ? Ho : function(e, t) {
3070
- e !== null && (e._qOverflowAnimationFrame !== void 0 && cancelAnimationFrame(e._qOverflowAnimationFrame), e._qOverflowAnimationFrame = requestAnimationFrame(() => {
3071
- if (e === null)
3072
- return;
3073
- e._qOverflowAnimationFrame = void 0;
3074
- const l = e.children || [];
3075
- eo.call(l, (o) => o.dataset && o.dataset.qVsAnchor !== void 0).forEach((o) => {
3076
- delete o.dataset.qVsAnchor;
3077
- });
3078
- const n = l[t];
3079
- n && n.dataset && (n.dataset.qVsAnchor = "");
3080
- }));
3081
- };
3082
- function Je(e, t) {
3083
- return e + t;
3084
- }
3085
- function tl(e, t, l, n, o, u, a, r) {
3086
- const h = e === window ? document.scrollingElement || document.documentElement : e, b = o === !0 ? "offsetWidth" : "offsetHeight", s = {
3087
- scrollStart: 0,
3088
- scrollViewSize: -a - r,
3089
- scrollMaxSize: 0,
3090
- offsetStart: -a,
3091
- offsetEnd: -r
3092
- };
3093
- if (o === !0 ? (e === window ? (s.scrollStart = window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, s.scrollViewSize += document.documentElement.clientWidth) : (s.scrollStart = h.scrollLeft, s.scrollViewSize += h.clientWidth), s.scrollMaxSize = h.scrollWidth, u === !0 && (s.scrollStart = (Ot === !0 ? s.scrollMaxSize - s.scrollViewSize : 0) - s.scrollStart)) : (e === window ? (s.scrollStart = window.pageYOffset || window.scrollY || document.body.scrollTop || 0, s.scrollViewSize += document.documentElement.clientHeight) : (s.scrollStart = h.scrollTop, s.scrollViewSize += h.clientHeight), s.scrollMaxSize = h.scrollHeight), l !== null)
3094
- for (let y = l.previousElementSibling; y !== null; y = y.previousElementSibling)
3095
- y.classList.contains("q-virtual-scroll--skip") === !1 && (s.offsetStart += y[b]);
3096
- if (n !== null)
3097
- for (let y = n.nextElementSibling; y !== null; y = y.nextElementSibling)
3098
- y.classList.contains("q-virtual-scroll--skip") === !1 && (s.offsetEnd += y[b]);
3099
- if (t !== e) {
3100
- const y = h.getBoundingClientRect(), v = t.getBoundingClientRect();
3101
- o === !0 ? (s.offsetStart += v.left - y.left, s.offsetEnd -= v.width) : (s.offsetStart += v.top - y.top, s.offsetEnd -= v.height), e !== window && (s.offsetStart += s.scrollStart), s.offsetEnd += s.scrollMaxSize - s.offsetStart;
3102
- }
3103
- return s;
3104
- }
3105
- function rn(e, t, l, n) {
3106
- t === "end" && (t = (e === window ? document.body : e)[l === !0 ? "scrollWidth" : "scrollHeight"]), e === window ? l === !0 ? (n === !0 && (t = (Ot === !0 ? document.body.scrollWidth - document.documentElement.clientWidth : 0) - t), window.scrollTo(t, window.pageYOffset || window.scrollY || document.body.scrollTop || 0)) : window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, t) : l === !0 ? (n === !0 && (t = (Ot === !0 ? e.scrollWidth - e.offsetWidth : 0) - t), e.scrollLeft = t) : e.scrollTop = t;
3107
- }
3108
- function ut(e, t, l, n) {
3109
- if (l >= n)
3110
- return 0;
3111
- const o = t.length, u = Math.floor(l / pe), a = Math.floor((n - 1) / pe) + 1;
3112
- let r = e.slice(u, a).reduce(Je, 0);
3113
- return l % pe !== 0 && (r -= t.slice(u * pe, l).reduce(Je, 0)), n % pe !== 0 && n !== o && (r -= t.slice(n, a * pe).reduce(Je, 0)), r;
3114
- }
3115
- const Su = {
3116
- virtualScrollSliceSize: {
3117
- type: [Number, String],
3118
- default: 10
3119
- },
3120
- virtualScrollSliceRatioBefore: {
3121
- type: [Number, String],
3122
- default: 1
3123
- },
3124
- virtualScrollSliceRatioAfter: {
3125
- type: [Number, String],
3126
- default: 1
3127
- },
3128
- virtualScrollItemSize: {
3129
- type: [Number, String],
3130
- default: 24
3131
- },
3132
- virtualScrollStickySizeStart: {
3133
- type: [Number, String],
3134
- default: 0
3135
- },
3136
- virtualScrollStickySizeEnd: {
3137
- type: [Number, String],
3138
- default: 0
3139
- },
3140
- tableColspan: [Number, String]
3141
- }, sn = {
3142
- virtualScrollHorizontal: Boolean,
3143
- onVirtualScroll: Function,
3144
- ...Su
3145
- };
3146
- function ku({
3147
- virtualScrollLength: e,
3148
- getVirtualScrollTarget: t,
3149
- getVirtualScrollEl: l,
3150
- virtualScrollItemSizeComputed: n
3151
- // optional
3152
- }) {
3153
- const o = ne(), { props: u, emit: a, proxy: r } = o, { $q: h } = r;
3154
- let b, s, y, v = [], c;
3155
- const m = P(0), C = P(0), p = P({}), O = P(null), T = P(null), k = P(null), M = P({ from: 0, to: 0 }), R = d(() => u.tableColspan !== void 0 ? u.tableColspan : 100);
3156
- n === void 0 && (n = d(() => u.virtualScrollItemSize));
3157
- const B = d(() => n.value + ";" + u.virtualScrollHorizontal), A = d(
3158
- () => B.value + ";" + u.virtualScrollSliceRatioBefore + ";" + u.virtualScrollSliceRatioAfter
3159
- );
3160
- Z(A, () => {
3161
- X();
3162
- }), Z(B, z);
3163
- function z() {
3164
- D(s, !0);
3165
- }
3166
- function N(f) {
3167
- D(f === void 0 ? s : f);
3168
- }
3169
- function J(f, S) {
3170
- const I = t();
3171
- if (I == null || I.nodeType === 8)
3172
- return;
3173
- const j = tl(
3174
- I,
3175
- l(),
3176
- O.value,
3177
- T.value,
3178
- u.virtualScrollHorizontal,
3179
- h.lang.rtl,
3180
- u.virtualScrollStickySizeStart,
3181
- u.virtualScrollStickySizeEnd
3182
- );
3183
- y !== j.scrollViewSize && X(j.scrollViewSize), L(
3184
- I,
3185
- j,
3186
- Math.min(e.value - 1, Math.max(0, parseInt(f, 10) || 0)),
3187
- 0,
3188
- yu.indexOf(S) !== -1 ? S : s !== -1 && f > s ? "end" : "start"
3189
- );
3190
- }
3191
- function U() {
3192
- const f = t();
3193
- if (f == null || f.nodeType === 8)
3194
- return;
3195
- const S = tl(
3196
- f,
3197
- l(),
3198
- O.value,
3199
- T.value,
3200
- u.virtualScrollHorizontal,
3201
- h.lang.rtl,
3202
- u.virtualScrollStickySizeStart,
3203
- u.virtualScrollStickySizeEnd
3204
- ), I = e.value - 1, j = S.scrollMaxSize - S.offsetStart - S.offsetEnd - C.value;
3205
- if (b === S.scrollStart)
3206
- return;
3207
- if (S.scrollMaxSize <= 0) {
3208
- L(f, S, 0, 0);
3209
- return;
3210
- }
3211
- y !== S.scrollViewSize && X(S.scrollViewSize), K(M.value.from);
3212
- const G = Math.floor(S.scrollMaxSize - Math.max(S.scrollViewSize, S.offsetEnd) - Math.min(c[I], S.scrollViewSize / 2));
3213
- if (G > 0 && Math.ceil(S.scrollStart) >= G) {
3214
- L(
3215
- f,
3216
- S,
3217
- I,
3218
- S.scrollMaxSize - S.offsetEnd - v.reduce(Je, 0)
3219
- );
3220
- return;
3221
- }
3222
- let x = 0, $ = S.scrollStart - S.offsetStart, W = $;
3223
- if ($ <= j && $ + S.scrollViewSize >= m.value)
3224
- $ -= m.value, x = M.value.from, W = $;
3225
- else
3226
- for (let w = 0; $ >= v[w] && x < I; w++)
3227
- $ -= v[w], x += pe;
3228
- for (; $ > 0 && x < I; )
3229
- $ -= c[x], $ > -S.scrollViewSize ? (x++, W = $) : W = c[x] + $;
3230
- L(
3231
- f,
3232
- S,
3233
- x,
3234
- W
3235
- );
3236
- }
3237
- function L(f, S, I, j, G) {
3238
- const x = typeof G == "string" && G.indexOf("-force") !== -1, $ = x === !0 ? G.replace("-force", "") : G, W = $ !== void 0 ? $ : "start";
3239
- let w = Math.max(0, I - p.value[W]), ee = w + p.value.total;
3240
- ee > e.value && (ee = e.value, w = Math.max(0, ee - p.value.total)), b = S.scrollStart;
3241
- const ye = w !== M.value.from || ee !== M.value.to;
3242
- if (ye === !1 && $ === void 0) {
3243
- E(I);
3244
- return;
3245
- }
3246
- const { activeElement: He } = document, we = k.value;
3247
- ye === !0 && we !== null && we !== He && we.contains(He) === !0 && (we.addEventListener("focusout", V), setTimeout(() => {
3248
- we !== null && we.removeEventListener("focusout", V);
3249
- })), wu(we, I - w);
3250
- const bt = $ !== void 0 ? c.slice(w, I).reduce(Je, 0) : 0;
3251
- if (ye === !0) {
3252
- const Te = ee >= M.value.from && w <= M.value.to ? M.value.to : ee;
3253
- M.value = { from: w, to: Te }, m.value = ut(v, c, 0, w), C.value = ut(v, c, ee, e.value), requestAnimationFrame(() => {
3254
- M.value.to !== ee && b === S.scrollStart && (M.value = { from: M.value.from, to: ee }, C.value = ut(v, c, ee, e.value));
3255
- });
3256
- }
3257
- requestAnimationFrame(() => {
3258
- if (b !== S.scrollStart)
3259
- return;
3260
- ye === !0 && K(w);
3261
- const Te = c.slice(w, I).reduce(Je, 0), $e = Te + S.offsetStart + m.value, yt = $e + c[I];
3262
- let tt = $e + j;
3263
- if ($ !== void 0) {
3264
- const It = Te - bt, lt = S.scrollStart + It;
3265
- tt = x !== !0 && lt < $e && yt < lt + S.scrollViewSize ? lt : $ === "end" ? yt - S.scrollViewSize : $e - ($ === "start" ? 0 : Math.round((S.scrollViewSize - c[I]) / 2));
3266
- }
3267
- b = tt, rn(
3268
- f,
3269
- tt,
3270
- u.virtualScrollHorizontal,
3271
- h.lang.rtl
3272
- ), E(I);
3273
- });
3274
- }
3275
- function K(f) {
3276
- const S = k.value;
3277
- if (S) {
3278
- const I = eo.call(
3279
- S.children,
3280
- (w) => w.classList && w.classList.contains("q-virtual-scroll--skip") === !1
3281
- ), j = I.length, G = u.virtualScrollHorizontal === !0 ? (w) => w.getBoundingClientRect().width : (w) => w.offsetHeight;
3282
- let x = f, $, W;
3283
- for (let w = 0; w < j; ) {
3284
- for ($ = G(I[w]), w++; w < j && I[w].classList.contains("q-virtual-scroll--with-prev") === !0; )
3285
- $ += G(I[w]), w++;
3286
- W = $ - c[x], W !== 0 && (c[x] += W, v[Math.floor(x / pe)] += W), x++;
3287
- }
3288
- }
3289
- }
3290
- function V() {
3291
- k.value !== null && k.value !== void 0 && k.value.focus();
3292
- }
3293
- function D(f, S) {
3294
- const I = 1 * n.value;
3295
- (S === !0 || Array.isArray(c) === !1) && (c = []);
3296
- const j = c.length;
3297
- c.length = e.value;
3298
- for (let x = e.value - 1; x >= j; x--)
3299
- c[x] = I;
3300
- const G = Math.floor((e.value - 1) / pe);
3301
- v = [];
3302
- for (let x = 0; x <= G; x++) {
3303
- let $ = 0;
3304
- const W = Math.min((x + 1) * pe, e.value);
3305
- for (let w = x * pe; w < W; w++)
3306
- $ += c[w];
3307
- v.push($);
3308
- }
3309
- s = -1, b = void 0, m.value = ut(v, c, 0, M.value.from), C.value = ut(v, c, M.value.to, e.value), f >= 0 ? (K(M.value.from), fe(() => {
3310
- J(f);
3311
- })) : F();
3312
- }
3313
- function X(f) {
3314
- if (f === void 0 && typeof window < "u") {
3315
- const $ = t();
3316
- $ != null && $.nodeType !== 8 && (f = tl(
3317
- $,
3318
- l(),
3319
- O.value,
3320
- T.value,
3321
- u.virtualScrollHorizontal,
3322
- h.lang.rtl,
3323
- u.virtualScrollStickySizeStart,
3324
- u.virtualScrollStickySizeEnd
3325
- ).scrollViewSize);
3326
- }
3327
- y = f;
3328
- const S = parseFloat(u.virtualScrollSliceRatioBefore) || 0, I = parseFloat(u.virtualScrollSliceRatioAfter) || 0, j = 1 + S + I, G = f === void 0 || f <= 0 ? 1 : Math.ceil(f / n.value), x = Math.max(
3329
- 1,
3330
- G,
3331
- Math.ceil((u.virtualScrollSliceSize > 0 ? u.virtualScrollSliceSize : 10) / j)
3332
- );
3333
- p.value = {
3334
- total: Math.ceil(x * j),
3335
- start: Math.ceil(x * S),
3336
- center: Math.ceil(x * (0.5 + S)),
3337
- end: Math.ceil(x * (1 + S)),
3338
- view: G
3339
- };
3340
- }
3341
- function ae(f, S) {
3342
- const I = u.virtualScrollHorizontal === !0 ? "width" : "height", j = {
3343
- ["--q-virtual-scroll-item-" + I]: n.value + "px"
3344
- };
3345
- return [
3346
- f === "tbody" ? g(f, {
3347
- class: "q-virtual-scroll__padding",
3348
- key: "before",
3349
- ref: O
3350
- }, [
3351
- g("tr", [
3352
- g("td", {
3353
- style: { [I]: `${m.value}px`, ...j },
3354
- colspan: R.value
3355
- })
3356
- ])
3357
- ]) : g(f, {
3358
- class: "q-virtual-scroll__padding",
3359
- key: "before",
3360
- ref: O,
3361
- style: { [I]: `${m.value}px`, ...j }
3362
- }),
3363
- g(f, {
3364
- class: "q-virtual-scroll__content",
3365
- key: "content",
3366
- ref: k,
3367
- tabindex: -1
3368
- }, S.flat()),
3369
- f === "tbody" ? g(f, {
3370
- class: "q-virtual-scroll__padding",
3371
- key: "after",
3372
- ref: T
3373
- }, [
3374
- g("tr", [
3375
- g("td", {
3376
- style: { [I]: `${C.value}px`, ...j },
3377
- colspan: R.value
3378
- })
3379
- ])
3380
- ]) : g(f, {
3381
- class: "q-virtual-scroll__padding",
3382
- key: "after",
3383
- ref: T,
3384
- style: { [I]: `${C.value}px`, ...j }
3385
- })
3386
- ];
3387
- }
3388
- function E(f) {
3389
- s !== f && (u.onVirtualScroll !== void 0 && a("virtualScroll", {
3390
- index: f,
3391
- from: M.value.from,
3392
- to: M.value.to - 1,
3393
- direction: f < s ? "decrease" : "increase",
3394
- ref: r
3395
- }), s = f);
3396
- }
3397
- X();
3398
- const F = zn(
3399
- U,
3400
- h.platform.is.ios === !0 ? 120 : 35
3401
- );
3402
- xo(() => {
3403
- X();
3404
- });
3405
- let se = !1;
3406
- return Pt(() => {
3407
- se = !0;
3408
- }), pn(() => {
3409
- if (se !== !0) return;
3410
- const f = t();
3411
- b !== void 0 && f !== void 0 && f !== null && f.nodeType !== 8 ? rn(
3412
- f,
3413
- b,
3414
- u.virtualScrollHorizontal,
3415
- h.lang.rtl
3416
- ) : J(s);
3417
- }), me(() => {
3418
- F.cancel();
3419
- }), Object.assign(r, { scrollTo: J, reset: z, refresh: N }), {
3420
- virtualScrollSliceRange: M,
3421
- virtualScrollSliceSizeComputed: p,
3422
- setVirtualScrollSize: X,
3423
- onVirtualScrollEvt: F,
3424
- localResetVirtualScroll: D,
3425
- padVirtualScroll: ae,
3426
- scrollTo: J,
3427
- reset: z,
3428
- refresh: N
3429
- };
3430
- }
3431
- const xu = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/, Cu = /[\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, qu = /[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/, _u = /[a-z0-9_ -]$/i;
3432
- function Eu(e) {
3433
- return function(l) {
3434
- if (l.type === "compositionend" || l.type === "change") {
3435
- if (l.target.qComposing !== !0) return;
3436
- l.target.qComposing = !1, e(l);
3437
- } else l.type === "compositionupdate" && l.target.qComposing !== !0 && typeof l.data == "string" && (ve.is.firefox === !0 ? _u.test(l.data) === !1 : xu.test(l.data) === !0 || Cu.test(l.data) === !0 || qu.test(l.data) === !0) === !0 && (l.target.qComposing = !0);
3438
- };
3439
- }
3440
- function Ve(e, t) {
3441
- if (e === t)
3442
- return !0;
3443
- if (e !== null && t !== null && typeof e == "object" && typeof t == "object") {
3444
- if (e.constructor !== t.constructor)
3445
- return !1;
3446
- let l, n;
3447
- if (e.constructor === Array) {
3448
- if (l = e.length, l !== t.length)
3449
- return !1;
3450
- for (n = l; n-- !== 0; )
3451
- if (Ve(e[n], t[n]) !== !0)
3452
- return !1;
3453
- return !0;
3454
- }
3455
- if (e.constructor === Map) {
3456
- if (e.size !== t.size)
3457
- return !1;
3458
- let u = e.entries();
3459
- for (n = u.next(); n.done !== !0; ) {
3460
- if (t.has(n.value[0]) !== !0)
3461
- return !1;
3462
- n = u.next();
3463
- }
3464
- for (u = e.entries(), n = u.next(); n.done !== !0; ) {
3465
- if (Ve(n.value[1], t.get(n.value[0])) !== !0)
3466
- return !1;
3467
- n = u.next();
3468
- }
3469
- return !0;
3470
- }
3471
- if (e.constructor === Set) {
3472
- if (e.size !== t.size)
3473
- return !1;
3474
- const u = e.entries();
3475
- for (n = u.next(); n.done !== !0; ) {
3476
- if (t.has(n.value[0]) !== !0)
3477
- return !1;
3478
- n = u.next();
3479
- }
3480
- return !0;
3481
- }
3482
- if (e.buffer != null && e.buffer.constructor === ArrayBuffer) {
3483
- if (l = e.length, l !== t.length)
3484
- return !1;
3485
- for (n = l; n-- !== 0; )
3486
- if (e[n] !== t[n])
3487
- return !1;
3488
- return !0;
3489
- }
3490
- if (e.constructor === RegExp)
3491
- return e.source === t.source && e.flags === t.flags;
3492
- if (e.valueOf !== Object.prototype.valueOf)
3493
- return e.valueOf() === t.valueOf();
3494
- if (e.toString !== Object.prototype.toString)
3495
- return e.toString() === t.toString();
3496
- const o = Object.keys(e).filter((u) => e[u] !== void 0);
3497
- if (l = o.length, l !== Object.keys(t).filter((u) => t[u] !== void 0).length)
3498
- return !1;
3499
- for (n = l; n-- !== 0; ) {
3500
- const u = o[n];
3501
- if (Ve(e[u], t[u]) !== !0)
3502
- return !1;
3503
- }
3504
- return !0;
3505
- }
3506
- return e !== e && t !== t;
3507
- }
3508
- function cn(e, t, l) {
3509
- if (l <= t)
3510
- return t;
3511
- const n = l - t + 1;
3512
- let o = t + (e - t) % n;
3513
- return o < t && (o = n + o), o === 0 ? 0 : o;
3514
- }
3515
- const dn = (e) => ["add", "add-unique", "toggle"].includes(e), Vu = ".*+?^${}()|[]\\", Bu = Object.keys(hl);
3516
- function ll(e, t) {
3517
- if (typeof e == "function") return e;
3518
- const l = e !== void 0 ? e : t;
3519
- return (n) => n !== null && typeof n == "object" && l in n ? n[l] : n;
3520
- }
3521
- const Tu = he({
3522
- name: "QSelect",
3523
- inheritAttrs: !1,
3524
- props: {
3525
- ...sn,
3526
- ...An,
3527
- ...hl,
3528
- // override of useFieldProps > modelValue
3529
- modelValue: {
3530
- required: !0
3531
- },
3532
- multiple: Boolean,
3533
- displayValue: [String, Number],
3534
- displayValueHtml: Boolean,
3535
- dropdownIcon: String,
3536
- options: {
3537
- type: Array,
3538
- default: () => []
3539
- },
3540
- optionValue: [Function, String],
3541
- optionLabel: [Function, String],
3542
- optionDisable: [Function, String],
3543
- hideSelected: Boolean,
3544
- hideDropdownIcon: Boolean,
3545
- fillInput: Boolean,
3546
- maxValues: [Number, String],
3547
- optionsDense: Boolean,
3548
- optionsDark: {
3549
- type: Boolean,
3550
- default: null
3551
- },
3552
- optionsSelectedClass: String,
3553
- optionsHtml: Boolean,
3554
- optionsCover: Boolean,
3555
- menuShrink: Boolean,
3556
- menuAnchor: String,
3557
- menuSelf: String,
3558
- menuOffset: Array,
3559
- popupContentClass: String,
3560
- popupContentStyle: [String, Array, Object],
3561
- popupNoRouteDismiss: Boolean,
3562
- useInput: Boolean,
3563
- useChips: Boolean,
3564
- newValueMode: {
3565
- type: String,
3566
- validator: dn
3567
- },
3568
- mapOptions: Boolean,
3569
- emitValue: Boolean,
3570
- disableTabSelection: Boolean,
3571
- inputDebounce: {
3572
- type: [Number, String],
3573
- default: 500
3574
- },
3575
- inputClass: [Array, String, Object],
3576
- inputStyle: [Array, String, Object],
3577
- tabindex: {
3578
- type: [String, Number],
3579
- default: 0
3580
- },
3581
- autocomplete: String,
3582
- transitionShow: {},
3583
- transitionHide: {},
3584
- transitionDuration: {},
3585
- behavior: {
3586
- type: String,
3587
- validator: (e) => ["default", "menu", "dialog"].includes(e),
3588
- default: "default"
3589
- },
3590
- // override of useVirtualScrollProps > virtualScrollItemSize (no default)
3591
- virtualScrollItemSize: sn.virtualScrollItemSize.type,
3592
- onNewValue: Function,
3593
- onFilter: Function
3594
- },
3595
- emits: [
3596
- ...In,
3597
- "add",
3598
- "remove",
3599
- "inputValue",
3600
- "keyup",
3601
- "keypress",
3602
- "keydown",
3603
- "popupShow",
3604
- "popupHide",
3605
- "filterAbort"
3606
- ],
3607
- setup(e, { slots: t, emit: l }) {
3608
- const { proxy: n } = ne(), { $q: o } = n, u = P(!1), a = P(!1), r = P(-1), h = P(""), b = P(!1), s = P(!1);
3609
- let y = null, v = null, c, m, C, p = null, O, T, k, M;
3610
- const R = P(null), B = P(null), A = P(null), z = P(null), N = P(null), J = gi(e), U = Eu(ql), L = d(() => Array.isArray(e.options) ? e.options.length : 0), K = d(() => e.virtualScrollItemSize === void 0 ? e.optionsDense === !0 ? 24 : 48 : e.virtualScrollItemSize), {
3611
- virtualScrollSliceRange: V,
3612
- virtualScrollSliceSizeComputed: D,
3613
- localResetVirtualScroll: X,
3614
- padVirtualScroll: ae,
3615
- onVirtualScrollEvt: E,
3616
- scrollTo: F,
3617
- setVirtualScrollSize: se
3618
- } = ku({
3619
- virtualScrollLength: L,
3620
- getVirtualScrollTarget: oo,
3621
- getVirtualScrollEl: xl,
3622
- virtualScrollItemSizeComputed: K
3623
- }), f = Hn(), S = d(() => {
3624
- const i = e.mapOptions === !0 && e.multiple !== !0, q = e.modelValue !== void 0 && (e.modelValue !== null || i === !0) ? e.multiple === !0 && Array.isArray(e.modelValue) ? e.modelValue : [e.modelValue] : [];
3625
- if (e.mapOptions === !0 && Array.isArray(e.options) === !0) {
3626
- const _ = e.mapOptions === !0 && c !== void 0 ? c : [], H = q.map((Y) => no(Y, _));
3627
- return e.modelValue === null && i === !0 ? H.filter((Y) => Y !== null) : H;
3628
- }
3629
- return q;
3630
- }), I = d(() => {
3631
- const i = {};
3632
- return Bu.forEach((q) => {
3633
- const _ = e[q];
3634
- _ !== void 0 && (i[q] = _);
3635
- }), i;
3636
- }), j = d(() => e.optionsDark === null ? f.isDark.value : e.optionsDark), G = d(() => sl(S.value)), x = d(() => {
3637
- let i = "q-field__input q-placeholder col";
3638
- return e.hideSelected === !0 || S.value.length === 0 ? [i, e.inputClass] : (i += " q-field__input--padding", e.inputClass === void 0 ? i : [i, e.inputClass]);
3639
- }), $ = d(
3640
- () => (e.virtualScrollHorizontal === !0 ? "q-virtual-scroll--horizontal" : "") + (e.popupContentClass ? " " + e.popupContentClass : "")
3641
- ), W = d(() => L.value === 0), w = d(
3642
- () => S.value.map((i) => ce.value(i)).join(", ")
3643
- ), ee = d(() => e.displayValue !== void 0 ? e.displayValue : w.value), ye = d(() => e.optionsHtml === !0 ? () => !0 : (i) => i != null && i.html === !0), He = d(() => e.displayValueHtml === !0 || e.displayValue === void 0 && (e.optionsHtml === !0 || S.value.some(ye.value))), we = d(() => f.focused.value === !0 ? e.tabindex : -1), bt = d(() => {
3644
- const i = {
3645
- tabindex: e.tabindex,
3646
- role: "combobox",
3647
- "aria-label": e.label,
3648
- "aria-readonly": e.readonly === !0 ? "true" : "false",
3649
- "aria-autocomplete": e.useInput === !0 ? "list" : "none",
3650
- "aria-expanded": u.value === !0 ? "true" : "false",
3651
- "aria-controls": `${f.targetUid.value}_lb`
3652
- };
3653
- return r.value >= 0 && (i["aria-activedescendant"] = `${f.targetUid.value}_${r.value}`), i;
3654
- }), Te = d(() => ({
3655
- id: `${f.targetUid.value}_lb`,
3656
- role: "listbox",
3657
- "aria-multiselectable": e.multiple === !0 ? "true" : "false"
3658
- })), $e = d(() => S.value.map((i, q) => ({
3659
- index: q,
3660
- opt: i,
3661
- html: ye.value(i),
3662
- selected: !0,
3663
- removeAtIndex: lo,
3664
- toggleOption: Re,
3665
- tabindex: we.value
3666
- }))), yt = d(() => {
3667
- if (L.value === 0)
3668
- return [];
3669
- const { from: i, to: q } = V.value;
3670
- return e.options.slice(i, q).map((_, H) => {
3671
- const Y = De.value(_) === !0, Q = Dt(_) === !0, oe = i + H, te = {
3672
- clickable: !0,
3673
- active: Q,
3674
- activeClass: lt.value,
3675
- manualFocus: !0,
3676
- focused: !1,
3677
- disable: Y,
3678
- tabindex: -1,
3679
- dense: e.optionsDense,
3680
- dark: j.value,
3681
- role: "option",
3682
- "aria-selected": Q === !0 ? "true" : "false",
3683
- id: `${f.targetUid.value}_${oe}`,
3684
- onClick: () => {
3685
- Re(_);
3686
- }
3687
- };
3688
- return Y !== !0 && (r.value === oe && (te.focused = !0), o.platform.is.desktop === !0 && (te.onMousemove = () => {
3689
- u.value === !0 && je(oe);
3690
- })), {
3691
- index: oe,
3692
- opt: _,
3693
- html: ye.value(_),
3694
- label: ce.value(_),
3695
- selected: te.active,
3696
- focused: te.focused,
3697
- toggleOption: Re,
3698
- setOptionIndex: je,
3699
- itemProps: te
3700
- };
3701
- });
3702
- }), tt = d(() => e.dropdownIcon !== void 0 ? e.dropdownIcon : o.iconSet.arrow.dropdown), It = d(
3703
- () => e.optionsCover === !1 && e.outlined !== !0 && e.standout !== !0 && e.borderless !== !0 && e.rounded !== !0
3704
- ), lt = d(() => e.optionsSelectedClass !== void 0 ? e.optionsSelectedClass : e.color !== void 0 ? `text-${e.color}` : ""), Se = d(() => ll(e.optionValue, "value")), ce = d(() => ll(e.optionLabel, "label")), De = d(() => ll(e.optionDisable, "disable")), wt = d(() => S.value.map(Se.value)), to = d(() => {
3705
- const i = {
3706
- onInput: ql,
3707
- // Safari < 10.2 & UIWebView doesn't fire compositionend when
3708
- // switching focus before confirming composition choice
3709
- // this also fixes the issue where some browsers e.g. iOS Chrome
3710
- // fires "change" instead of "input" on autocomplete.
3711
- onChange: U,
3712
- onKeydown: kl,
3713
- onKeyup: wl,
3714
- onKeypress: Sl,
3715
- onFocus: bl,
3716
- onClick(q) {
3717
- m === !0 && Ee(q);
3718
- }
3719
- };
3720
- return i.onCompositionstart = i.onCompositionupdate = i.onCompositionend = U, i;
3721
- });
3722
- Z(S, (i) => {
3723
- c = i, e.useInput === !0 && e.fillInput === !0 && e.multiple !== !0 && f.innerLoading.value !== !0 && (a.value !== !0 && u.value !== !0 || G.value !== !0) && (C !== !0 && Qe(), (a.value === !0 || u.value === !0) && Ne(""));
3724
- }, { immediate: !0 }), Z(() => e.fillInput, Qe), Z(u, jt), Z(L, po);
3725
- function gl(i) {
3726
- return e.emitValue === !0 ? Se.value(i) : i;
3727
- }
3728
- function Ht(i) {
3729
- if (i !== -1 && i < S.value.length)
3730
- if (e.multiple === !0) {
3731
- const q = e.modelValue.slice();
3732
- l("remove", { index: i, value: q.splice(i, 1)[0] }), l("update:modelValue", q);
3733
- } else
3734
- l("update:modelValue", null);
3735
- }
3736
- function lo(i) {
3737
- Ht(i), f.focus();
3738
- }
3739
- function pl(i, q) {
3740
- const _ = gl(i);
3741
- if (e.multiple !== !0) {
3742
- e.fillInput === !0 && nt(
3743
- ce.value(i),
3744
- !0,
3745
- !0
3746
- ), l("update:modelValue", _);
3747
- return;
3748
- }
3749
- if (S.value.length === 0) {
3750
- l("add", { index: 0, value: _ }), l("update:modelValue", e.multiple === !0 ? [_] : _);
3751
- return;
3752
- }
3753
- if (q === !0 && Dt(i) === !0 || e.maxValues !== void 0 && e.modelValue.length >= e.maxValues)
3754
- return;
3755
- const H = e.modelValue.slice();
3756
- l("add", { index: H.length, value: _ }), H.push(_), l("update:modelValue", H);
3757
- }
3758
- function Re(i, q) {
3759
- if (f.editable.value !== !0 || i === void 0 || De.value(i) === !0)
3760
- return;
3761
- const _ = Se.value(i);
3762
- if (e.multiple !== !0) {
3763
- q !== !0 && (nt(
3764
- e.fillInput === !0 ? ce.value(i) : "",
3765
- !0,
3766
- !0
3767
- ), Le()), B.value !== null && B.value.focus(), (S.value.length === 0 || Ve(Se.value(S.value[0]), _) !== !0) && l("update:modelValue", e.emitValue === !0 ? _ : i);
3768
- return;
3769
- }
3770
- if ((m !== !0 || b.value === !0) && f.focus(), bl(), S.value.length === 0) {
3771
- const Q = e.emitValue === !0 ? _ : i;
3772
- l("add", { index: 0, value: Q }), l("update:modelValue", e.multiple === !0 ? [Q] : Q);
3773
- return;
3774
- }
3775
- const H = e.modelValue.slice(), Y = wt.value.findIndex((Q) => Ve(Q, _));
3776
- if (Y !== -1)
3777
- l("remove", { index: Y, value: H.splice(Y, 1)[0] });
3778
- else {
3779
- if (e.maxValues !== void 0 && H.length >= e.maxValues)
3780
- return;
3781
- const Q = e.emitValue === !0 ? _ : i;
3782
- l("add", { index: H.length, value: Q }), H.push(Q);
3783
- }
3784
- l("update:modelValue", H);
3785
- }
3786
- function je(i) {
3787
- if (o.platform.is.desktop !== !0) return;
3788
- const q = i !== -1 && i < L.value ? i : -1;
3789
- r.value !== q && (r.value = q);
3790
- }
3791
- function St(i = 1, q) {
3792
- if (u.value === !0) {
3793
- let _ = r.value;
3794
- do
3795
- _ = cn(
3796
- _ + i,
3797
- -1,
3798
- L.value - 1
3799
- );
3800
- while (_ !== -1 && _ !== r.value && De.value(e.options[_]) === !0);
3801
- r.value !== _ && (je(_), F(_), q !== !0 && e.useInput === !0 && e.fillInput === !0 && kt(
3802
- _ >= 0 ? ce.value(e.options[_]) : O,
3803
- !0
3804
- ));
3805
- }
3806
- }
3807
- function no(i, q) {
3808
- const _ = (H) => Ve(Se.value(H), i);
3809
- return e.options.find(_) || q.find(_) || i;
3810
- }
3811
- function Dt(i) {
3812
- const q = Se.value(i);
3813
- return wt.value.find((_) => Ve(_, q)) !== void 0;
3814
- }
3815
- function bl(i) {
3816
- e.useInput === !0 && B.value !== null && (i === void 0 || B.value === i.target && i.target.value === w.value) && B.value.select();
3817
- }
3818
- function yl(i) {
3819
- Ie(i, 27) === !0 && u.value === !0 && (Ee(i), Le(), Qe()), l("keyup", i);
3820
- }
3821
- function wl(i) {
3822
- const { value: q } = i.target;
3823
- if (i.keyCode !== void 0) {
3824
- yl(i);
3825
- return;
3826
- }
3827
- if (i.target.value = "", y !== null && (clearTimeout(y), y = null), v !== null && (clearTimeout(v), v = null), Qe(), typeof q == "string" && q.length !== 0) {
3828
- const _ = q.toLocaleLowerCase(), H = (Q) => {
3829
- const oe = e.options.find((te) => String(Q.value(te)).toLocaleLowerCase() === _);
3830
- return oe === void 0 ? !1 : (S.value.indexOf(oe) === -1 ? Re(oe) : Le(), !0);
3831
- }, Y = (Q) => {
3832
- H(Se) !== !0 && Q !== !0 && H(ce) !== !0 && Ne(q, !0, () => Y(!0));
3833
- };
3834
- Y();
3835
- } else
3836
- f.clearValue(i);
3837
- }
3838
- function Sl(i) {
3839
- l("keypress", i);
3840
- }
3841
- function kl(i) {
3842
- if (l("keydown", i), _n(i) === !0)
3843
- return;
3844
- const q = h.value.length !== 0 && (e.newValueMode !== void 0 || e.onNewValue !== void 0), _ = i.shiftKey !== !0 && e.disableTabSelection !== !0 && e.multiple !== !0 && (r.value !== -1 || q === !0);
3845
- if (i.keyCode === 27) {
3846
- be(i);
3847
- return;
3848
- }
3849
- if (i.keyCode === 9 && _ === !1) {
3850
- We();
3851
- return;
3852
- }
3853
- if (i.target === void 0 || i.target.id !== f.targetUid.value || f.editable.value !== !0) return;
3854
- if (i.keyCode === 40 && f.innerLoading.value !== !0 && u.value === !1) {
3855
- le(i), Ke();
3856
- return;
3857
- }
3858
- if (i.keyCode === 8 && (e.useChips === !0 || e.clearable === !0) && e.hideSelected !== !0 && h.value.length === 0) {
3859
- e.multiple === !0 && Array.isArray(e.modelValue) === !0 ? Ht(e.modelValue.length - 1) : e.multiple !== !0 && e.modelValue !== null && l("update:modelValue", null);
3860
- return;
3861
- }
3862
- (i.keyCode === 35 || i.keyCode === 36) && (typeof h.value != "string" || h.value.length === 0) && (le(i), r.value = -1, St(i.keyCode === 36 ? 1 : -1, e.multiple)), (i.keyCode === 33 || i.keyCode === 34) && D.value !== void 0 && (le(i), r.value = Math.max(
3863
- -1,
3864
- Math.min(
3865
- L.value,
3866
- r.value + (i.keyCode === 33 ? -1 : 1) * D.value.view
3867
- )
3868
- ), St(i.keyCode === 33 ? 1 : -1, e.multiple)), (i.keyCode === 38 || i.keyCode === 40) && (le(i), St(i.keyCode === 38 ? -1 : 1, e.multiple));
3869
- const H = L.value;
3870
- if ((k === void 0 || M < Date.now()) && (k = ""), H > 0 && e.useInput !== !0 && i.key !== void 0 && i.key.length === 1 && i.altKey === !1 && i.ctrlKey === !1 && i.metaKey === !1 && (i.keyCode !== 32 || k.length !== 0)) {
3871
- u.value !== !0 && Ke(i);
3872
- const Y = i.key.toLocaleLowerCase(), Q = k.length === 1 && k[0] === Y;
3873
- M = Date.now() + 1500, Q === !1 && (le(i), k += Y);
3874
- const oe = new RegExp("^" + k.split("").map((Nt) => Vu.indexOf(Nt) !== -1 ? "\\" + Nt : Nt).join(".*"), "i");
3875
- let te = r.value;
3876
- if (Q === !0 || te < 0 || oe.test(ce.value(e.options[te])) !== !0)
3877
- do
3878
- te = cn(te + 1, -1, H - 1);
3879
- while (te !== r.value && (De.value(e.options[te]) === !0 || oe.test(ce.value(e.options[te])) !== !0));
3880
- r.value !== te && fe(() => {
3881
- je(te), F(te), te >= 0 && e.useInput === !0 && e.fillInput === !0 && kt(ce.value(e.options[te]), !0);
3882
- });
3883
- return;
3884
- }
3885
- if (!(i.keyCode !== 13 && (i.keyCode !== 32 || e.useInput === !0 || k !== "") && (i.keyCode !== 9 || _ === !1))) {
3886
- if (i.keyCode !== 9 && le(i), r.value !== -1 && r.value < H) {
3887
- Re(e.options[r.value]);
3888
- return;
3889
- }
3890
- if (q === !0) {
3891
- const Y = (Q, oe) => {
3892
- if (oe) {
3893
- if (dn(oe) !== !0)
3894
- return;
3895
- } else
3896
- oe = e.newValueMode;
3897
- if (nt("", e.multiple !== !0, !0), Q == null)
3898
- return;
3899
- (oe === "toggle" ? Re : pl)(Q, oe === "add-unique"), e.multiple !== !0 && (B.value !== null && B.value.focus(), Le());
3900
- };
3901
- if (e.onNewValue !== void 0 ? l("newValue", h.value, Y) : Y(h.value), e.multiple !== !0)
3902
- return;
3903
- }
3904
- u.value === !0 ? We() : f.innerLoading.value !== !0 && Ke();
3905
- }
3906
- }
3907
- function xl() {
3908
- return m === !0 ? N.value : A.value !== null && A.value.contentEl !== null ? A.value.contentEl : void 0;
3909
- }
3910
- function oo() {
3911
- return xl();
3912
- }
3913
- function io() {
3914
- return e.hideSelected === !0 ? [] : t["selected-item"] !== void 0 ? $e.value.map((i) => t["selected-item"](i)).slice() : t.selected !== void 0 ? [].concat(t.selected()) : e.useChips === !0 ? $e.value.map((i, q) => g(Pi, {
3915
- key: "option-" + q,
3916
- removable: f.editable.value === !0 && De.value(i.opt) !== !0,
3917
- dense: !0,
3918
- textColor: e.color,
3919
- tabindex: we.value,
3920
- onRemove() {
3921
- i.removeAtIndex(q);
3922
- }
3923
- }, () => g("span", {
3924
- class: "ellipsis",
3925
- [i.html === !0 ? "innerHTML" : "textContent"]: ce.value(i.opt)
3926
- }))) : [
3927
- g("span", {
3928
- [He.value === !0 ? "innerHTML" : "textContent"]: ee.value
3929
- })
3930
- ];
3931
- }
3932
- function Cl() {
3933
- if (W.value === !0)
3934
- return t["no-option"] !== void 0 ? t["no-option"]({ inputValue: h.value }) : void 0;
3935
- const i = t.option !== void 0 ? t.option : (_) => g(Pn, {
3936
- key: _.index,
3937
- ..._.itemProps
3938
- }, () => g(
3939
- Tt,
3940
- () => g(
3941
- On,
3942
- () => g("span", {
3943
- [_.html === !0 ? "innerHTML" : "textContent"]: _.label
3944
- })
3945
- )
3946
- ));
3947
- let q = ae("div", yt.value.map(i));
3948
- return t["before-options"] !== void 0 && (q = t["before-options"]().concat(q)), Ae(t["after-options"], q);
3949
- }
3950
- function uo(i, q) {
3951
- const _ = q === !0 ? { ...bt.value, ...f.splitAttrs.attributes.value } : void 0, H = {
3952
- ref: q === !0 ? B : void 0,
3953
- key: "i_t",
3954
- class: x.value,
3955
- style: e.inputStyle,
3956
- value: h.value !== void 0 ? h.value : "",
3957
- // required for Android in order to show ENTER key when in form
3958
- type: "search",
3959
- ..._,
3960
- id: q === !0 ? f.targetUid.value : void 0,
3961
- maxlength: e.maxlength,
3962
- autocomplete: e.autocomplete,
3963
- "data-autofocus": i === !0 || e.autofocus === !0 || void 0,
3964
- disabled: e.disable === !0,
3965
- readonly: e.readonly === !0,
3966
- ...to.value
3967
- };
3968
- return i !== !0 && m === !0 && (Array.isArray(H.class) === !0 ? H.class = [...H.class, "no-pointer-events"] : H.class += " no-pointer-events"), g("input", H);
3969
- }
3970
- function ql(i) {
3971
- y !== null && (clearTimeout(y), y = null), v !== null && (clearTimeout(v), v = null), !(i && i.target && i.target.qComposing === !0) && (kt(i.target.value || ""), C = !0, O = h.value, f.focused.value !== !0 && (m !== !0 || b.value === !0) && f.focus(), e.onFilter !== void 0 && (y = setTimeout(() => {
3972
- y = null, Ne(h.value);
3973
- }, e.inputDebounce)));
3974
- }
3975
- function kt(i, q) {
3976
- h.value !== i && (h.value = i, q === !0 || e.inputDebounce === 0 || e.inputDebounce === "0" ? l("inputValue", i) : v = setTimeout(() => {
3977
- v = null, l("inputValue", i);
3978
- }, e.inputDebounce));
3979
- }
3980
- function nt(i, q, _) {
3981
- C = _ !== !0, e.useInput === !0 && (kt(i, !0), (q === !0 || _ !== !0) && (O = i), q !== !0 && Ne(i));
3982
- }
3983
- function Ne(i, q, _) {
3984
- if (e.onFilter === void 0 || q !== !0 && f.focused.value !== !0)
3985
- return;
3986
- f.innerLoading.value === !0 ? l("filterAbort") : (f.innerLoading.value = !0, s.value = !0), i !== "" && e.multiple !== !0 && S.value.length !== 0 && C !== !0 && i === ce.value(S.value[0]) && (i = "");
3987
- const H = setTimeout(() => {
3988
- u.value === !0 && (u.value = !1);
3989
- }, 10);
3990
- p !== null && clearTimeout(p), p = H, l(
3991
- "filter",
3992
- i,
3993
- (Y, Q) => {
3994
- (q === !0 || f.focused.value === !0) && p === H && (clearTimeout(p), typeof Y == "function" && Y(), s.value = !1, fe(() => {
3995
- f.innerLoading.value = !1, f.editable.value === !0 && (q === !0 ? u.value === !0 && Le() : u.value === !0 ? jt(!0) : u.value = !0), typeof Q == "function" && fe(() => {
3996
- Q(n);
3997
- }), typeof _ == "function" && fe(() => {
3998
- _(n);
3999
- });
4000
- }));
4001
- },
4002
- () => {
4003
- f.focused.value === !0 && p === H && (clearTimeout(p), f.innerLoading.value = !1, s.value = !1), u.value === !0 && (u.value = !1);
4004
- }
4005
- );
4006
- }
4007
- function ao() {
4008
- return g(du, {
4009
- ref: A,
4010
- class: $.value,
4011
- style: e.popupContentStyle,
4012
- modelValue: u.value,
4013
- fit: e.menuShrink !== !0,
4014
- cover: e.optionsCover === !0 && W.value !== !0 && e.useInput !== !0,
4015
- anchor: e.menuAnchor,
4016
- self: e.menuSelf,
4017
- offset: e.menuOffset,
4018
- dark: j.value,
4019
- noParentEvent: !0,
4020
- noRefocus: !0,
4021
- noFocus: !0,
4022
- noRouteDismiss: e.popupNoRouteDismiss,
4023
- square: It.value,
4024
- transitionShow: e.transitionShow,
4025
- transitionHide: e.transitionHide,
4026
- transitionDuration: e.transitionDuration,
4027
- separateClosePopup: !0,
4028
- ...Te.value,
4029
- onScrollPassive: E,
4030
- onBeforeShow: El,
4031
- onBeforeHide: ro,
4032
- onShow: so
4033
- }, Cl);
4034
- }
4035
- function ro(i) {
4036
- Vl(i), We();
4037
- }
4038
- function so() {
4039
- se();
4040
- }
4041
- function co(i) {
4042
- Ee(i), B.value !== null && B.value.focus(), b.value = !0, window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0);
4043
- }
4044
- function fo(i) {
4045
- Ee(i), fe(() => {
4046
- b.value = !1;
4047
- });
4048
- }
4049
- function vo() {
4050
- const i = [
4051
- g(Ai, {
4052
- class: `col-auto ${f.fieldClass.value}`,
4053
- ...I.value,
4054
- for: f.targetUid.value,
4055
- dark: j.value,
4056
- square: !0,
4057
- loading: s.value,
4058
- itemAligned: !1,
4059
- filled: !0,
4060
- stackLabel: h.value.length !== 0,
4061
- ...f.splitAttrs.listeners.value,
4062
- onFocus: co,
4063
- onBlur: fo
4064
- }, {
4065
- ...t,
4066
- rawControl: () => f.getControl(!0),
4067
- before: void 0,
4068
- after: void 0
4069
- })
4070
- ];
4071
- return u.value === !0 && i.push(
4072
- g("div", {
4073
- ref: N,
4074
- class: $.value + " scroll",
4075
- style: e.popupContentStyle,
4076
- ...Te.value,
4077
- onClick: be,
4078
- onScrollPassive: E
4079
- }, Cl())
4080
- ), g(bu, {
4081
- ref: z,
4082
- modelValue: a.value,
4083
- position: e.useInput === !0 ? "top" : void 0,
4084
- transitionShow: T,
4085
- transitionHide: e.transitionHide,
4086
- transitionDuration: e.transitionDuration,
4087
- noRouteDismiss: e.popupNoRouteDismiss,
4088
- onBeforeShow: El,
4089
- onBeforeHide: mo,
4090
- onHide: ho,
4091
- onShow: go
4092
- }, () => g("div", {
4093
- class: "q-select__dialog" + (j.value === !0 ? " q-select__dialog--dark q-dark" : "") + (b.value === !0 ? " q-select__dialog--focused" : "")
4094
- }, i));
4095
- }
4096
- function mo(i) {
4097
- Vl(i), z.value !== null && z.value.__updateRefocusTarget(
4098
- f.rootRef.value.querySelector(".q-field__native > [tabindex]:last-child")
4099
- ), f.focused.value = !1;
4100
- }
4101
- function ho(i) {
4102
- Le(), f.focused.value === !1 && l("blur", i), Qe();
4103
- }
4104
- function go() {
4105
- const i = document.activeElement;
4106
- (i === null || i.id !== f.targetUid.value) && B.value !== null && B.value !== i && B.value.focus(), se();
4107
- }
4108
- function We() {
4109
- a.value !== !0 && (r.value = -1, u.value === !0 && (u.value = !1), f.focused.value === !1 && (p !== null && (clearTimeout(p), p = null), f.innerLoading.value === !0 && (l("filterAbort"), f.innerLoading.value = !1, s.value = !1)));
4110
- }
4111
- function Ke(i) {
4112
- f.editable.value === !0 && (m === !0 ? (f.onControlFocusin(i), a.value = !0, fe(() => {
4113
- f.focus();
4114
- })) : f.focus(), e.onFilter !== void 0 ? Ne(h.value) : (W.value !== !0 || t["no-option"] !== void 0) && (u.value = !0));
4115
- }
4116
- function Le() {
4117
- a.value = !1, We();
4118
- }
4119
- function Qe() {
4120
- e.useInput === !0 && nt(
4121
- e.multiple !== !0 && e.fillInput === !0 && S.value.length !== 0 && ce.value(S.value[0]) || "",
4122
- !0,
4123
- !0
4124
- );
4125
- }
4126
- function jt(i) {
4127
- let q = -1;
4128
- if (i === !0) {
4129
- if (S.value.length !== 0) {
4130
- const _ = Se.value(S.value[0]);
4131
- q = e.options.findIndex((H) => Ve(Se.value(H), _));
4132
- }
4133
- X(q);
4134
- }
4135
- je(q);
4136
- }
4137
- function po(i, q) {
4138
- u.value === !0 && f.innerLoading.value === !1 && (X(-1, !0), fe(() => {
4139
- u.value === !0 && f.innerLoading.value === !1 && (i > q ? X() : jt(!0));
4140
- }));
4141
- }
4142
- function _l() {
4143
- a.value === !1 && A.value !== null && A.value.updatePosition();
4144
- }
4145
- function El(i) {
4146
- i !== void 0 && Ee(i), l("popupShow", i), f.hasPopupOpen = !0, f.onControlFocusin(i);
4147
- }
4148
- function Vl(i) {
4149
- i !== void 0 && Ee(i), l("popupHide", i), f.hasPopupOpen = !1, f.onControlFocusout(i);
4150
- }
4151
- function Bl() {
4152
- m = o.platform.is.mobile !== !0 && e.behavior !== "dialog" ? !1 : e.behavior !== "menu" && (e.useInput === !0 ? t["no-option"] !== void 0 || e.onFilter !== void 0 || W.value === !1 : !0), T = o.platform.is.ios === !0 && m === !0 && e.useInput === !0 ? "fade" : e.transitionShow;
4153
- }
4154
- return gn(Bl), Co(_l), Bl(), me(() => {
4155
- y !== null && clearTimeout(y), v !== null && clearTimeout(v);
4156
- }), Object.assign(n, {
4157
- showPopup: Ke,
4158
- hidePopup: Le,
4159
- removeAtIndex: Ht,
4160
- add: pl,
4161
- toggleOption: Re,
4162
- getOptionIndex: () => r.value,
4163
- setOptionIndex: je,
4164
- moveOptionSelection: St,
4165
- filter: Ne,
4166
- updateMenuPosition: _l,
4167
- updateInputValue: nt,
4168
- isOptionSelected: Dt,
4169
- getEmittingOptionValue: gl,
4170
- isOptionDisabled: (...i) => De.value.apply(null, i) === !0,
4171
- getOptionValue: (...i) => Se.value.apply(null, i),
4172
- getOptionLabel: (...i) => ce.value.apply(null, i)
4173
- }), Object.assign(f, {
4174
- innerValue: S,
4175
- fieldClass: d(
4176
- () => `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"}`
4177
- ),
4178
- inputRef: R,
4179
- targetRef: B,
4180
- hasValue: G,
4181
- showPopup: Ke,
4182
- floatingLabel: d(
4183
- () => e.hideSelected !== !0 && G.value === !0 || typeof h.value == "number" || h.value.length !== 0 || sl(e.displayValue)
4184
- ),
4185
- getControlChild: () => {
4186
- if (f.editable.value !== !1 && (a.value === !0 || W.value !== !0 || t["no-option"] !== void 0))
4187
- return m === !0 ? vo() : ao();
4188
- f.hasPopupOpen === !0 && (f.hasPopupOpen = !1);
4189
- },
4190
- controlEvents: {
4191
- onFocusin(i) {
4192
- f.onControlFocusin(i);
4193
- },
4194
- onFocusout(i) {
4195
- f.onControlFocusout(i, () => {
4196
- Qe(), We();
4197
- });
4198
- },
4199
- onClick(i) {
4200
- if (be(i), m !== !0 && u.value === !0) {
4201
- We(), B.value !== null && B.value.focus();
4202
- return;
4203
- }
4204
- Ke(i);
4205
- }
4206
- },
4207
- getControl: (i) => {
4208
- const q = io(), _ = i === !0 || a.value !== !0 || m !== !0;
4209
- if (e.useInput === !0)
4210
- q.push(uo(i, _));
4211
- else if (f.editable.value === !0) {
4212
- const Y = _ === !0 ? bt.value : void 0;
4213
- q.push(
4214
- g("input", {
4215
- ref: _ === !0 ? B : void 0,
4216
- key: "d_t",
4217
- class: "q-select__focus-target",
4218
- id: _ === !0 ? f.targetUid.value : void 0,
4219
- value: ee.value,
4220
- readonly: !0,
4221
- "data-autofocus": i === !0 || e.autofocus === !0 || void 0,
4222
- ...Y,
4223
- onKeydown: kl,
4224
- onKeyup: yl,
4225
- onKeypress: Sl
4226
- })
4227
- ), _ === !0 && typeof e.autocomplete == "string" && e.autocomplete.length !== 0 && q.push(
4228
- g("input", {
4229
- class: "q-select__autocomplete-input",
4230
- autocomplete: e.autocomplete,
4231
- tabindex: -1,
4232
- onKeyup: wl
4233
- })
4234
- );
4235
- }
4236
- if (J.value !== void 0 && e.disable !== !0 && wt.value.length !== 0) {
4237
- const Y = wt.value.map((Q) => g("option", { value: Q, selected: !0 }));
4238
- q.push(
4239
- g("select", {
4240
- class: "hidden",
4241
- name: J.value,
4242
- multiple: e.multiple
4243
- }, Y)
4244
- );
4245
- }
4246
- const H = e.useInput === !0 || _ !== !0 ? void 0 : f.splitAttrs.attributes.value;
4247
- return g("div", {
4248
- class: "q-field__native row items-center",
4249
- ...H,
4250
- ...f.splitAttrs.listeners.value
4251
- }, q);
4252
- },
4253
- getInnerAppend: () => e.loading !== !0 && s.value !== !0 && e.hideDropdownIcon !== !0 ? [
4254
- g(_e, {
4255
- class: "q-select__dropdown-icon" + (u.value === !0 ? " rotate-180" : ""),
4256
- name: tt.value
4257
- })
4258
- ] : null
4259
- }), Dn(f);
4260
- }
4261
- }), $u = { class: "app-select__amount" }, Ru = /* @__PURE__ */ mt({
4262
- __name: "index",
4263
- props: {
4264
- modelValue: {},
4265
- size: { default: qe.MD },
4266
- options: {},
4267
- multiple: { type: Boolean },
4268
- label: {},
4269
- placeholder: {},
4270
- required: { type: Boolean },
4271
- clearable: { type: Boolean },
4272
- disabled: { type: Boolean },
4273
- loading: { type: Boolean },
4274
- filtering: { type: Boolean },
4275
- autofocus: { type: Boolean },
4276
- rules: {},
4277
- lazyRules: { type: [Boolean, String] }
4278
- },
4279
- emits: ["update:modelValue"],
4280
- setup(e, { emit: t }) {
4281
- const l = e, n = t, o = P(!1), u = P(""), a = d({
4282
- get() {
4283
- return l.modelValue;
4284
- },
4285
- set(c) {
4286
- n("update:modelValue", c);
4287
- }
4288
- }), r = d(() => {
4289
- var c;
4290
- if (Array.isArray(a.value)) {
4291
- if (l.multiple && a.value.length == 0)
4292
- return l.placeholder;
4293
- } else return ((c = a.value) == null ? void 0 : c.label) || l.placeholder || "";
4294
- return "";
4295
- }), h = d(() => !(!l.clearable || !l.modelValue || l.modelValue && Array.isArray(l.modelValue) && !l.modelValue.length)), b = d(() => u.value ? l.options.filter(
4296
- (c) => c.label.toLowerCase().includes(u.value.toLowerCase())
4297
- ) : l.options), s = d(() => {
4298
- if (l.rules)
4299
- return l.required ? [...l.rules, Il] : l.rules;
4300
- if (l.required)
4301
- return [Il];
4302
- }), y = () => {
4303
- a.value = void 0;
4304
- }, v = (c, m) => {
4305
- m(() => {
4306
- u.value = c;
4307
- });
4308
- };
4309
- return (c, m) => (ue(), de("div", {
4310
- class: Be(["app-select", [{ "app-select_opened": o.value }, `app-select_${c.size}`]])
4311
- }, [
4312
- c.label ? (ue(), de("label", {
4313
- key: 0,
4314
- class: Be(["app-select__label", { "app-select__label_bold": c.required }])
4315
- }, Ze(c.required ? `${c.label} *` : c.label), 3)) : Ce("", !0),
4316
- ot(st(Tu), {
4317
- standout: "",
4318
- "hide-bottom-space": "",
4319
- "hide-dropdown-icon": "",
4320
- "no-error-icon": "",
4321
- behavior: "menu",
4322
- "popup-content-class": `app-select-menu app-select-menu_${c.size}`,
4323
- placeholder: c.filtering && "Почніть вводити",
4324
- "input-debounce": "50",
4325
- modelValue: a.value,
4326
- "onUpdate:modelValue": m[0] || (m[0] = (C) => a.value = C),
4327
- options: b.value,
4328
- multiple: c.multiple,
4329
- "use-input": c.filtering && (Array.isArray(a.value) || !a.value),
4330
- rules: s.value,
4331
- "lazy-rules": c.lazyRules,
4332
- autofocus: c.autofocus,
4333
- disable: c.disabled,
4334
- loading: c.loading,
4335
- onFilter: v,
4336
- onPopupShow: m[1] || (m[1] = (C) => o.value = !0),
4337
- onPopupHide: m[2] || (m[2] = (C) => o.value = !1)
4338
- }, {
4339
- append: xe(() => [
4340
- h.value ? (ue(), de("i", {
4341
- key: 0,
4342
- class: "icon-kl icon-kl-close app-select__clear",
4343
- onClick: hn(y, ["stop", "prevent"])
4344
- })) : Ce("", !0),
4345
- m[3] || (m[3] = Wt("i", { class: "icon-kl icon-kl-arrow-down app-select__drop-icon" }, null, -1))
4346
- ]),
4347
- selected: xe(() => {
4348
- var C, p;
4349
- return [
4350
- Array.isArray(a.value) ? (ue(), de(at, { key: 0 }, [
4351
- !c.filtering || a.value.length ? (ue(), de("span", {
4352
- key: 0,
4353
- class: Be([
4354
- "app-select__selected",
4355
- {
4356
- "app-select__placeholder": !((C = a.value) != null && C.length) && c.placeholder
4357
- }
4358
- ])
4359
- }, [
4360
- (p = a.value) != null && p.length ? (ue(), de(at, { key: 0 }, [
4361
- m[4] || (m[4] = Bt(" Вибрано ")),
4362
- Wt("span", $u, Ze(a.value.length), 1)
4363
- ], 64)) : (ue(), de(at, { key: 1 }, [
4364
- Bt(Ze(l.placeholder), 1)
4365
- ], 64))
4366
- ], 2)) : Ce("", !0)
4367
- ], 64)) : (ue(), de(at, { key: 1 }, [
4368
- !c.filtering || a.value ? (ue(), de("span", {
4369
- key: 0,
4370
- class: Be([
4371
- "app-select__selected",
4372
- { "app-select__placeholder": !a.value && c.placeholder }
4373
- ])
4374
- }, Ze(r.value), 3)) : Ce("", !0)
4375
- ], 64))
4376
- ];
4377
- }),
4378
- option: xe((C) => [
4379
- ot(Pn, mn({
4380
- class: ["app-select__option", { "app-select__option_selected": C.selected }]
4381
- }, C.itemProps), {
4382
- default: xe(() => [
4383
- l.multiple ? (ue(), $t(Tt, {
4384
- key: 0,
4385
- class: "option-multiple",
4386
- avatar: ""
4387
- }, {
4388
- default: xe(() => [
4389
- ot(ki, {
4390
- size: "30px",
4391
- "model-value": C.selected,
4392
- "onUpdate:modelValue": () => C.toggleOption(C.opt)
4393
- }, null, 8, ["model-value", "onUpdate:modelValue"])
4394
- ]),
4395
- _: 2
4396
- }, 1024)) : Ce("", !0),
4397
- C.opt.done ? (ue(), $t(Tt, {
4398
- key: 1,
4399
- class: "option-done",
4400
- avatar: ""
4401
- }, {
4402
- default: xe(() => m[5] || (m[5] = [
4403
- Wt("i", { class: "icon-kl icon-kl-check option-done__icon" }, null, -1)
4404
- ])),
4405
- _: 1
4406
- })) : Ce("", !0),
4407
- ot(Tt, null, {
4408
- default: xe(() => [
4409
- ot(On, null, {
4410
- default: xe(() => [
4411
- Bt(Ze(C.opt.label), 1)
4412
- ]),
4413
- _: 2
4414
- }, 1024)
4415
- ]),
4416
- _: 2
4417
- }, 1024)
4418
- ]),
4419
- _: 2
4420
- }, 1040, ["class"])
4421
- ]),
4422
- _: 1
4423
- }, 8, ["popup-content-class", "placeholder", "modelValue", "options", "multiple", "use-input", "rules", "lazy-rules", "autofocus", "disable", "loading"])
4424
- ], 2));
4425
- }
4426
- }), Ou = /* @__PURE__ */ fl(Ru, [["__scopeId", "data-v-7e772358"]]), Lu = /* @__PURE__ */ mt({
4427
- __name: "index",
4428
- props: {
4429
- name: {},
4430
- size: {},
4431
- color: {}
4432
- },
4433
- setup(e) {
4434
- return (t, l) => (ue(), de("i", {
4435
- class: Be(["icon-kl", `icon-kl-${t.name}`, t.color ? `text-${t.color}` : ""]),
4436
- style: qo(t.size ? `font-size: ${t.size}` : void 0)
4437
- }, null, 6));
4438
- }
4439
- }), Pu = /* @__PURE__ */ fl(Lu, [["__scopeId", "data-v-100590bf"]]);
4440
- export {
4441
- ai as A,
4442
- Au as _,
4443
- Ou as a,
4444
- Pu as b
4445
- };