@validol4ik/uikit 0.3.30 → 0.3.31

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