@validol4ik/uikit 0.3.13 → 0.3.16

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