@validol4ik/uikit 0.3.26 → 0.3.28

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