@validol4ik/uikit 0.3.43 → 0.4.0

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.
@@ -0,0 +1,837 @@
1
+ import { computed as x, ref as T, onMounted as ne, watch as S, getCurrentInstance as R, nextTick as Q, onBeforeUnmount as z, onUnmounted as Qe, h as _, Teleport as _e, onDeactivated as Se, Transition as Ie } from "vue";
2
+ import { i as Ne, P as Ke, b as je, c as Ce, r as Ue, a as Ge } from "./focusout-DjvPXP_b.js";
3
+ import { x as ce, p as de, i as Pe, y as Xe, l as J, z as Ye, B as X, c as ke, D as He, E as Ze, F as fe, h as Je, G as et, n as tt, s as nt } from "./index-Ddt1_zHz.js";
4
+ const ot = {
5
+ dark: {
6
+ type: Boolean,
7
+ default: null
8
+ }
9
+ };
10
+ function lt(e, t) {
11
+ return x(() => e.dark === null ? t.dark.isActive : e.dark);
12
+ }
13
+ let Y, V = 0;
14
+ const y = new Array(256);
15
+ for (let e = 0; e < 256; e++)
16
+ y[e] = (e + 256).toString(16).substring(1);
17
+ const it = (() => {
18
+ const e = typeof crypto < "u" ? crypto : typeof window < "u" ? window.crypto || window.msCrypto : void 0;
19
+ if (e !== void 0) {
20
+ if (e.randomBytes !== void 0)
21
+ return e.randomBytes;
22
+ if (e.getRandomValues !== void 0)
23
+ return (t) => {
24
+ const n = new Uint8Array(t);
25
+ return e.getRandomValues(n), n;
26
+ };
27
+ }
28
+ return (t) => {
29
+ const n = [];
30
+ for (let o = t; o > 0; o--)
31
+ n.push(Math.floor(Math.random() * 256));
32
+ return n;
33
+ };
34
+ })(), me = 4096;
35
+ function ee() {
36
+ (Y === void 0 || V + 16 > me) && (V = 0, Y = it(me));
37
+ const e = Array.prototype.slice.call(Y, V, V += 16);
38
+ return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, y[e[0]] + y[e[1]] + y[e[2]] + y[e[3]] + "-" + y[e[4]] + y[e[5]] + "-" + y[e[6]] + y[e[7]] + "-" + y[e[8]] + y[e[9]] + "-" + y[e[10]] + y[e[11]] + y[e[12]] + y[e[13]] + y[e[14]] + y[e[15]];
39
+ }
40
+ function ut(e) {
41
+ return e ?? null;
42
+ }
43
+ function he(e, t) {
44
+ return e ?? (t === !0 ? `f_${ee()}` : null);
45
+ }
46
+ function Nt({ getValue: e, required: t = !0 } = {}) {
47
+ if (Ne.value === !0) {
48
+ const n = e !== void 0 ? T(ut(e())) : T(null);
49
+ return t === !0 && n.value === null && ne(() => {
50
+ n.value = `f_${ee()}`;
51
+ }), e !== void 0 && S(e, (o) => {
52
+ n.value = he(o, t);
53
+ }), n;
54
+ }
55
+ return e !== void 0 ? x(() => he(e(), t)) : T(`f_${ee()}`);
56
+ }
57
+ let W = [], D = [];
58
+ function Me(e) {
59
+ D = D.filter((t) => t !== e);
60
+ }
61
+ function at(e) {
62
+ Me(e), D.push(e);
63
+ }
64
+ function ve(e) {
65
+ Me(e), D.length === 0 && W.length !== 0 && (W[W.length - 1](), W = []);
66
+ }
67
+ function rt(e) {
68
+ D.length === 0 ? e() : W.push(e);
69
+ }
70
+ function Kt(e) {
71
+ W = W.filter((t) => t !== e);
72
+ }
73
+ function st() {
74
+ if (window.getSelection !== void 0) {
75
+ const e = window.getSelection();
76
+ e.empty !== void 0 ? e.empty() : e.removeAllRanges !== void 0 && (e.removeAllRanges(), Ke.is.mobile !== !0 && e.addRange(document.createRange()));
77
+ } else document.selection !== void 0 && document.selection.empty();
78
+ }
79
+ const ct = {
80
+ /* SSR does not know about Element */
81
+ target: {
82
+ type: [Boolean, String, Element],
83
+ default: !0
84
+ },
85
+ noParentEvent: Boolean
86
+ }, dt = {
87
+ ...ct,
88
+ contextMenu: Boolean
89
+ };
90
+ function ft({
91
+ showing: e,
92
+ avoidEmit: t,
93
+ // required for QPopupProxy (true)
94
+ configureAnchorEl: n
95
+ // optional
96
+ }) {
97
+ const { props: o, proxy: l, emit: f } = R(), i = T(null);
98
+ let a = null;
99
+ function m(u) {
100
+ return i.value === null ? !1 : u === void 0 || u.touches === void 0 || u.touches.length <= 1;
101
+ }
102
+ const c = {};
103
+ n === void 0 && (Object.assign(c, {
104
+ hide(u) {
105
+ l.hide(u);
106
+ },
107
+ toggle(u) {
108
+ l.toggle(u), u.qAnchorHandled = !0;
109
+ },
110
+ toggleKey(u) {
111
+ Pe(u, 13) === !0 && c.toggle(u);
112
+ },
113
+ contextClick(u) {
114
+ l.hide(u), de(u), Q(() => {
115
+ l.show(u), u.qAnchorHandled = !0;
116
+ });
117
+ },
118
+ prevent: de,
119
+ mobileTouch(u) {
120
+ if (c.mobileCleanup(u), m(u) !== !0)
121
+ return;
122
+ l.hide(u), i.value.classList.add("non-selectable");
123
+ const d = u.target;
124
+ ce(c, "anchor", [
125
+ [d, "touchmove", "mobileCleanup", "passive"],
126
+ [d, "touchend", "mobileCleanup", "passive"],
127
+ [d, "touchcancel", "mobileCleanup", "passive"],
128
+ [i.value, "contextmenu", "prevent", "notPassive"]
129
+ ]), a = setTimeout(() => {
130
+ a = null, l.show(u), u.qAnchorHandled = !0;
131
+ }, 300);
132
+ },
133
+ mobileCleanup(u) {
134
+ i.value.classList.remove("non-selectable"), a !== null && (clearTimeout(a), a = null), e.value === !0 && u !== void 0 && st();
135
+ }
136
+ }), n = function(u = o.contextMenu) {
137
+ if (o.noParentEvent === !0 || i.value === null) return;
138
+ let d;
139
+ u === !0 ? l.$q.platform.is.mobile === !0 ? d = [
140
+ [i.value, "touchstart", "mobileTouch", "passive"]
141
+ ] : d = [
142
+ [i.value, "mousedown", "hide", "passive"],
143
+ [i.value, "contextmenu", "contextClick", "notPassive"]
144
+ ] : d = [
145
+ [i.value, "click", "toggle", "passive"],
146
+ [i.value, "keyup", "toggleKey", "passive"]
147
+ ], ce(c, "anchor", d);
148
+ });
149
+ function r() {
150
+ Xe(c, "anchor");
151
+ }
152
+ function g(u) {
153
+ for (i.value = u; i.value.classList.contains("q-anchor--skip"); )
154
+ i.value = i.value.parentNode;
155
+ n();
156
+ }
157
+ function p() {
158
+ if (o.target === !1 || o.target === "" || l.$el.parentNode === null)
159
+ i.value = null;
160
+ else if (o.target === !0)
161
+ g(l.$el.parentNode);
162
+ else {
163
+ let u = o.target;
164
+ if (typeof o.target == "string")
165
+ try {
166
+ u = document.querySelector(o.target);
167
+ } catch {
168
+ u = void 0;
169
+ }
170
+ u != null ? (i.value = u.$el || u, n()) : (i.value = null, console.error(`Anchor: target "${o.target}" not found`));
171
+ }
172
+ }
173
+ return S(() => o.contextMenu, (u) => {
174
+ i.value !== null && (r(), n(u));
175
+ }), S(() => o.target, () => {
176
+ i.value !== null && r(), p();
177
+ }), S(() => o.noParentEvent, (u) => {
178
+ i.value !== null && (u === !0 ? r() : n());
179
+ }), ne(() => {
180
+ p(), t !== !0 && o.modelValue === !0 && i.value === null && f("update:modelValue", !1);
181
+ }), z(() => {
182
+ a !== null && clearTimeout(a), r();
183
+ }), {
184
+ anchorEl: i,
185
+ canShow: m,
186
+ anchorEvents: c
187
+ };
188
+ }
189
+ function mt(e, t) {
190
+ const n = T(null);
191
+ let o;
192
+ function l(a, m) {
193
+ const c = `${m !== void 0 ? "add" : "remove"}EventListener`, r = m !== void 0 ? m : o;
194
+ a !== window && a[c]("scroll", r, J.passive), window[c]("scroll", r, J.passive), o = m;
195
+ }
196
+ function f() {
197
+ n.value !== null && (l(n.value), n.value = null);
198
+ }
199
+ const i = S(() => e.noParentEvent, () => {
200
+ n.value !== null && (f(), t());
201
+ });
202
+ return z(i), {
203
+ localScrollTarget: n,
204
+ unconfigureScrollTarget: f,
205
+ changeScrollEvent: l
206
+ };
207
+ }
208
+ const ht = {
209
+ modelValue: {
210
+ type: Boolean,
211
+ default: null
212
+ },
213
+ "onUpdate:modelValue": [Function, Array]
214
+ }, vt = [
215
+ "beforeShow",
216
+ "show",
217
+ "beforeHide",
218
+ "hide"
219
+ ];
220
+ function gt({
221
+ showing: e,
222
+ canShow: t,
223
+ // optional
224
+ hideOnRouteChange: n,
225
+ // optional
226
+ handleShow: o,
227
+ // optional
228
+ handleHide: l,
229
+ // optional
230
+ processOnMount: f
231
+ // optional
232
+ }) {
233
+ const i = R(), { props: a, emit: m, proxy: c } = i;
234
+ let r;
235
+ function g(h) {
236
+ e.value === !0 ? d(h) : p(h);
237
+ }
238
+ function p(h) {
239
+ if (a.disable === !0 || h !== void 0 && h.qAnchorHandled === !0 || t !== void 0 && t(h) !== !0)
240
+ return;
241
+ const v = a["onUpdate:modelValue"] !== void 0;
242
+ v === !0 && (m("update:modelValue", !0), r = h, Q(() => {
243
+ r === h && (r = void 0);
244
+ })), (a.modelValue === null || v === !1) && u(h);
245
+ }
246
+ function u(h) {
247
+ e.value !== !0 && (e.value = !0, m("beforeShow", h), o !== void 0 ? o(h) : m("show", h));
248
+ }
249
+ function d(h) {
250
+ if (a.disable === !0)
251
+ return;
252
+ const v = a["onUpdate:modelValue"] !== void 0;
253
+ v === !0 && (m("update:modelValue", !1), r = h, Q(() => {
254
+ r === h && (r = void 0);
255
+ })), (a.modelValue === null || v === !1) && H(h);
256
+ }
257
+ function H(h) {
258
+ e.value !== !1 && (e.value = !1, m("beforeHide", h), l !== void 0 ? l(h) : m("hide", h));
259
+ }
260
+ function C(h) {
261
+ a.disable === !0 && h === !0 ? a["onUpdate:modelValue"] !== void 0 && m("update:modelValue", !1) : h === !0 !== e.value && (h === !0 ? u : H)(r);
262
+ }
263
+ S(() => a.modelValue, C), n !== void 0 && Ye(i) === !0 && S(() => c.$route.fullPath, () => {
264
+ n.value === !0 && e.value === !0 && d();
265
+ }), ne(() => {
266
+ C(a.modelValue);
267
+ });
268
+ const M = { show: p, hide: d, toggle: g };
269
+ return Object.assign(c, M), M;
270
+ }
271
+ const ge = {};
272
+ let pt = 1, wt = document.body;
273
+ function yt(e, t) {
274
+ const n = document.createElement("div");
275
+ if (n.id = t !== void 0 ? `q-portal--${t}--${pt++}` : e, ge.globalNodes !== void 0) {
276
+ const o = ge.globalNodes.class;
277
+ o !== void 0 && (n.className = o);
278
+ }
279
+ return wt.appendChild(n), n;
280
+ }
281
+ function bt(e) {
282
+ e.remove();
283
+ }
284
+ const L = [];
285
+ function xt(e, t) {
286
+ do {
287
+ if (e.$options.name === "QMenu") {
288
+ if (e.hide(t), e.$props.separateClosePopup === !0)
289
+ return X(e);
290
+ } else if (e.__qPortal === !0) {
291
+ const n = X(e);
292
+ return n !== void 0 && n.$options.name === "QPopupProxy" ? (e.hide(t), n) : e;
293
+ }
294
+ e = X(e);
295
+ } while (e != null);
296
+ }
297
+ const Et = ke({
298
+ name: "QPortal",
299
+ setup(e, { slots: t }) {
300
+ return () => t.default();
301
+ }
302
+ });
303
+ function Tt(e) {
304
+ for (e = e.parent; e != null; ) {
305
+ if (e.type.name === "QGlobalDialog")
306
+ return !0;
307
+ if (e.type.name === "QDialog" || e.type.name === "QMenu")
308
+ return !1;
309
+ e = e.parent;
310
+ }
311
+ return !1;
312
+ }
313
+ function St(e, t, n, o) {
314
+ const l = T(!1), f = T(!1);
315
+ let i = null;
316
+ const a = {}, m = o === "dialog" && Tt(e);
317
+ function c(g) {
318
+ if (g === !0) {
319
+ ve(a), f.value = !0;
320
+ return;
321
+ }
322
+ f.value = !1, l.value === !1 && (m === !1 && i === null && (i = yt(!1, o)), l.value = !0, L.push(e.proxy), at(a));
323
+ }
324
+ function r(g) {
325
+ if (f.value = !1, g !== !0) return;
326
+ ve(a), l.value = !1;
327
+ const p = L.indexOf(e.proxy);
328
+ p !== -1 && L.splice(p, 1), i !== null && (bt(i), i = null);
329
+ }
330
+ return Qe(() => {
331
+ r(!0);
332
+ }), e.proxy.__qPortal = !0, je(e.proxy, "contentEl", () => t.value), {
333
+ showPortal: c,
334
+ hidePortal: r,
335
+ portalIsActive: l,
336
+ portalIsAccessible: f,
337
+ renderPortal: () => m === !0 ? n() : l.value === !0 ? [_(_e, { to: i }, _(Et, n))] : void 0
338
+ };
339
+ }
340
+ const Ct = {
341
+ transitionShow: {
342
+ type: String,
343
+ default: "fade"
344
+ },
345
+ transitionHide: {
346
+ type: String,
347
+ default: "fade"
348
+ },
349
+ transitionDuration: {
350
+ type: [String, Number],
351
+ default: 300
352
+ }
353
+ };
354
+ function Pt(e, t = () => {
355
+ }, n = () => {
356
+ }) {
357
+ return {
358
+ transitionProps: x(() => {
359
+ const o = `q-transition--${e.transitionShow || t()}`, l = `q-transition--${e.transitionHide || n()}`;
360
+ return {
361
+ appear: !0,
362
+ enterFromClass: `${o}-enter-from`,
363
+ enterActiveClass: `${o}-enter-active`,
364
+ enterToClass: `${o}-enter-to`,
365
+ leaveFromClass: `${l}-leave-from`,
366
+ leaveActiveClass: `${l}-leave-active`,
367
+ leaveToClass: `${l}-leave-to`
368
+ };
369
+ }),
370
+ transitionStyle: x(() => `--q-transition-duration: ${e.transitionDuration}ms`)
371
+ };
372
+ }
373
+ function kt() {
374
+ let e;
375
+ const t = R();
376
+ function n() {
377
+ e = void 0;
378
+ }
379
+ return Se(n), z(n), {
380
+ removeTick: n,
381
+ registerTick(o) {
382
+ e = o, Q(() => {
383
+ e === o && (He(t) === !1 && e(), e = void 0);
384
+ });
385
+ }
386
+ };
387
+ }
388
+ function Ht() {
389
+ let e = null;
390
+ const t = R();
391
+ function n() {
392
+ e !== null && (clearTimeout(e), e = null);
393
+ }
394
+ return Se(n), z(n), {
395
+ removeTimeout: n,
396
+ registerTimeout(o, l) {
397
+ n(), He(t) === !1 && (e = setTimeout(() => {
398
+ e = null, o();
399
+ }, l));
400
+ }
401
+ };
402
+ }
403
+ const Mt = [Element, String], Wt = [null, document, document.body, document.scrollingElement, document.documentElement];
404
+ function $t(e, t) {
405
+ let n = Ze(t);
406
+ if (n === void 0) {
407
+ if (e == null)
408
+ return window;
409
+ n = e.closest(".scroll,.scroll-y,.overflow-auto");
410
+ }
411
+ return Wt.includes(n) ? window : n;
412
+ }
413
+ function jt(e) {
414
+ return e === window ? window.pageYOffset || window.scrollY || document.body.scrollTop || 0 : e.scrollTop;
415
+ }
416
+ function Ut(e) {
417
+ return e === window ? window.pageXOffset || window.scrollX || document.body.scrollLeft || 0 : e.scrollLeft;
418
+ }
419
+ let O;
420
+ function qt() {
421
+ if (O !== void 0)
422
+ return O;
423
+ const e = document.createElement("p"), t = document.createElement("div");
424
+ fe(e, {
425
+ width: "100%",
426
+ height: "200px"
427
+ }), fe(t, {
428
+ position: "absolute",
429
+ top: "0px",
430
+ left: "0px",
431
+ visibility: "hidden",
432
+ width: "200px",
433
+ height: "150px",
434
+ overflow: "hidden"
435
+ }), t.appendChild(e), document.body.appendChild(t);
436
+ const n = e.offsetWidth;
437
+ t.style.overflow = "scroll";
438
+ let o = e.offsetWidth;
439
+ return n === o && (o = t.clientWidth), t.remove(), O = n - o, O;
440
+ }
441
+ function Gt(e, t = !0) {
442
+ 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"]));
443
+ }
444
+ const $ = [];
445
+ let B;
446
+ function At(e) {
447
+ B = e.keyCode === 27;
448
+ }
449
+ function Bt() {
450
+ B === !0 && (B = !1);
451
+ }
452
+ function Ft(e) {
453
+ B === !0 && (B = !1, Pe(e, 27) === !0 && $[$.length - 1](e));
454
+ }
455
+ function We(e) {
456
+ window[e]("keydown", At), window[e]("blur", Bt), window[e]("keyup", Ft), B = !1;
457
+ }
458
+ function Lt(e) {
459
+ Ce.is.desktop === !0 && ($.push(e), $.length === 1 && We("addEventListener"));
460
+ }
461
+ function pe(e) {
462
+ const t = $.indexOf(e);
463
+ t !== -1 && ($.splice(t, 1), $.length === 0 && We("removeEventListener"));
464
+ }
465
+ const { notPassiveCapture: I } = J, q = [];
466
+ function N(e) {
467
+ const t = e.target;
468
+ if (t === void 0 || t.nodeType === 8 || t.classList.contains("no-pointer-events") === !0)
469
+ return;
470
+ let n = L.length - 1;
471
+ for (; n >= 0; ) {
472
+ const o = L[n].$;
473
+ if (o.type.name === "QTooltip") {
474
+ n--;
475
+ continue;
476
+ }
477
+ if (o.type.name !== "QDialog")
478
+ break;
479
+ if (o.props.seamless !== !0)
480
+ return;
481
+ n--;
482
+ }
483
+ for (let o = q.length - 1; o >= 0; o--) {
484
+ const l = q[o];
485
+ if ((l.anchorEl.value === null || l.anchorEl.value.contains(t) === !1) && (t === document.body || l.innerRef.value !== null && l.innerRef.value.contains(t) === !1))
486
+ e.qClickOutside = !0, l.onClickOutside(e);
487
+ else
488
+ return;
489
+ }
490
+ }
491
+ function Dt(e) {
492
+ q.push(e), q.length === 1 && (document.addEventListener("mousedown", N, I), document.addEventListener("touchstart", N, I));
493
+ }
494
+ function we(e) {
495
+ const t = q.findIndex((n) => n === e);
496
+ t !== -1 && (q.splice(t, 1), q.length === 0 && (document.removeEventListener("mousedown", N, I), document.removeEventListener("touchstart", N, I)));
497
+ }
498
+ let ye, be;
499
+ function xe(e) {
500
+ const t = e.split(" ");
501
+ 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;
502
+ }
503
+ function Rt(e) {
504
+ return e ? !(e.length !== 2 || typeof e[0] != "number" || typeof e[1] != "number") : !0;
505
+ }
506
+ const te = {
507
+ "start#ltr": "left",
508
+ "start#rtl": "right",
509
+ "end#ltr": "right",
510
+ "end#rtl": "left"
511
+ };
512
+ ["left", "middle", "right"].forEach((e) => {
513
+ te[`${e}#ltr`] = e, te[`${e}#rtl`] = e;
514
+ });
515
+ function Ee(e, t) {
516
+ const n = e.split(" ");
517
+ return {
518
+ vertical: n[0],
519
+ horizontal: te[`${n[1]}#${t === !0 ? "rtl" : "ltr"}`]
520
+ };
521
+ }
522
+ function zt(e, t) {
523
+ let { top: n, left: o, right: l, bottom: f, width: i, height: a } = e.getBoundingClientRect();
524
+ return t !== void 0 && (n -= t[1], o -= t[0], f += t[1], l += t[0], i += t[0], a += t[1]), {
525
+ top: n,
526
+ bottom: f,
527
+ height: a,
528
+ left: o,
529
+ right: l,
530
+ width: i,
531
+ middle: o + (l - o) / 2,
532
+ center: n + (f - n) / 2
533
+ };
534
+ }
535
+ function Vt(e, t, n) {
536
+ let { top: o, left: l } = e.getBoundingClientRect();
537
+ return o += t.top, l += t.left, n !== void 0 && (o += n[1], l += n[0]), {
538
+ top: o,
539
+ bottom: o + 1,
540
+ height: 1,
541
+ left: l,
542
+ right: l + 1,
543
+ width: 1,
544
+ middle: l,
545
+ center: o
546
+ };
547
+ }
548
+ function Ot(e, t) {
549
+ return {
550
+ top: 0,
551
+ center: t / 2,
552
+ bottom: t,
553
+ left: 0,
554
+ middle: e / 2,
555
+ right: e
556
+ };
557
+ }
558
+ function Te(e, t, n, o) {
559
+ return {
560
+ top: e[n.vertical] - t[o.vertical],
561
+ left: e[n.horizontal] - t[o.horizontal]
562
+ };
563
+ }
564
+ function $e(e, t = 0) {
565
+ if (e.targetEl === null || e.anchorEl === null || t > 5)
566
+ return;
567
+ if (e.targetEl.offsetHeight === 0 || e.targetEl.offsetWidth === 0) {
568
+ setTimeout(() => {
569
+ $e(e, t + 1);
570
+ }, 10);
571
+ return;
572
+ }
573
+ const {
574
+ targetEl: n,
575
+ offset: o,
576
+ anchorEl: l,
577
+ anchorOrigin: f,
578
+ selfOrigin: i,
579
+ absoluteOffset: a,
580
+ fit: m,
581
+ cover: c,
582
+ maxHeight: r,
583
+ maxWidth: g
584
+ } = e;
585
+ if (Ce.is.ios === !0 && window.visualViewport !== void 0) {
586
+ const A = document.body.style, { offsetLeft: b, offsetTop: E } = window.visualViewport;
587
+ b !== ye && (A.setProperty("--q-pe-left", b + "px"), ye = b), E !== be && (A.setProperty("--q-pe-top", E + "px"), be = E);
588
+ }
589
+ const { scrollLeft: p, scrollTop: u } = n, d = a === void 0 ? zt(l, c === !0 ? [0, 0] : o) : Vt(l, a, o);
590
+ Object.assign(n.style, {
591
+ top: 0,
592
+ left: 0,
593
+ minWidth: null,
594
+ minHeight: null,
595
+ maxWidth: g,
596
+ maxHeight: r,
597
+ visibility: "visible"
598
+ });
599
+ const { offsetWidth: H, offsetHeight: C } = n, { elWidth: M, elHeight: h } = m === !0 || c === !0 ? { elWidth: Math.max(d.width, H), elHeight: c === !0 ? Math.max(d.height, C) : C } : { elWidth: H, elHeight: C };
600
+ let v = { maxWidth: g, maxHeight: r };
601
+ (m === !0 || c === !0) && (v.minWidth = d.width + "px", c === !0 && (v.minHeight = d.height + "px")), Object.assign(n.style, v);
602
+ const P = Ot(M, h);
603
+ let w = Te(d, P, f, i);
604
+ if (a === void 0 || o === void 0)
605
+ Z(w, d, P, f, i);
606
+ else {
607
+ const { top: A, left: b } = w;
608
+ Z(w, d, P, f, i);
609
+ let E = !1;
610
+ if (w.top !== A) {
611
+ E = !0;
612
+ const k = 2 * o[1];
613
+ d.center = d.top -= k, d.bottom -= k + 2;
614
+ }
615
+ if (w.left !== b) {
616
+ E = !0;
617
+ const k = 2 * o[0];
618
+ d.middle = d.left -= k, d.right -= k + 2;
619
+ }
620
+ E === !0 && (w = Te(d, P, f, i), Z(w, d, P, f, i));
621
+ }
622
+ v = {
623
+ top: w.top + "px",
624
+ left: w.left + "px"
625
+ }, w.maxHeight !== void 0 && (v.maxHeight = w.maxHeight + "px", d.height > w.maxHeight && (v.minHeight = v.maxHeight)), w.maxWidth !== void 0 && (v.maxWidth = w.maxWidth + "px", d.width > w.maxWidth && (v.minWidth = v.maxWidth)), Object.assign(n.style, v), n.scrollTop !== u && (n.scrollTop = u), n.scrollLeft !== p && (n.scrollLeft = p);
626
+ }
627
+ function Z(e, t, n, o, l) {
628
+ const f = n.bottom, i = n.right, a = qt(), m = window.innerHeight - a, c = document.body.clientWidth;
629
+ if (e.top < 0 || e.top + f > m)
630
+ if (l.vertical === "center")
631
+ e.top = t[o.vertical] > m / 2 ? Math.max(0, m - f) : 0, e.maxHeight = Math.min(f, m);
632
+ else if (t[o.vertical] > m / 2) {
633
+ const r = Math.min(
634
+ m,
635
+ o.vertical === "center" ? t.center : o.vertical === l.vertical ? t.bottom : t.top
636
+ );
637
+ e.maxHeight = Math.min(f, r), e.top = Math.max(0, r - f);
638
+ } else
639
+ e.top = Math.max(
640
+ 0,
641
+ o.vertical === "center" ? t.center : o.vertical === l.vertical ? t.top : t.bottom
642
+ ), e.maxHeight = Math.min(f, m - e.top);
643
+ if (e.left < 0 || e.left + i > c)
644
+ if (e.maxWidth = Math.min(i, c), l.horizontal === "middle")
645
+ e.left = t[o.horizontal] > c / 2 ? Math.max(0, c - i) : 0;
646
+ else if (t[o.horizontal] > c / 2) {
647
+ const r = Math.min(
648
+ c,
649
+ o.horizontal === "middle" ? t.middle : o.horizontal === l.horizontal ? t.right : t.left
650
+ );
651
+ e.maxWidth = Math.min(i, r), e.left = Math.max(0, r - e.maxWidth);
652
+ } else
653
+ e.left = Math.max(
654
+ 0,
655
+ o.horizontal === "middle" ? t.middle : o.horizontal === l.horizontal ? t.left : t.right
656
+ ), e.maxWidth = Math.min(i, c - e.left);
657
+ }
658
+ const Xt = ke({
659
+ name: "QMenu",
660
+ inheritAttrs: !1,
661
+ props: {
662
+ ...dt,
663
+ ...ht,
664
+ ...ot,
665
+ ...Ct,
666
+ persistent: Boolean,
667
+ autoClose: Boolean,
668
+ separateClosePopup: Boolean,
669
+ noRouteDismiss: Boolean,
670
+ noRefocus: Boolean,
671
+ noFocus: Boolean,
672
+ fit: Boolean,
673
+ cover: Boolean,
674
+ square: Boolean,
675
+ anchor: {
676
+ type: String,
677
+ validator: xe
678
+ },
679
+ self: {
680
+ type: String,
681
+ validator: xe
682
+ },
683
+ offset: {
684
+ type: Array,
685
+ validator: Rt
686
+ },
687
+ scrollTarget: Mt,
688
+ touchPosition: Boolean,
689
+ maxHeight: {
690
+ type: String,
691
+ default: null
692
+ },
693
+ maxWidth: {
694
+ type: String,
695
+ default: null
696
+ }
697
+ },
698
+ emits: [
699
+ ...vt,
700
+ "click",
701
+ "escapeKey"
702
+ ],
703
+ setup(e, { slots: t, emit: n, attrs: o }) {
704
+ let l = null, f, i, a;
705
+ const m = R(), { proxy: c } = m, { $q: r } = c, g = T(null), p = T(!1), u = x(
706
+ () => e.persistent !== !0 && e.noRouteDismiss !== !0
707
+ ), d = lt(e, r), { registerTick: H, removeTick: C } = kt(), { registerTimeout: M } = Ht(), { transitionProps: h, transitionStyle: v } = Pt(e), { localScrollTarget: P, changeScrollEvent: w, unconfigureScrollTarget: A } = mt(e, re), { anchorEl: b, canShow: E } = ft({ showing: p }), { hide: k } = gt({
708
+ showing: p,
709
+ canShow: E,
710
+ handleShow: Le,
711
+ handleHide: De,
712
+ hideOnRouteChange: u,
713
+ processOnMount: !0
714
+ }), { showPortal: oe, hidePortal: le, renderPortal: qe } = St(m, g, ze, "menu"), K = {
715
+ anchorEl: b,
716
+ innerRef: g,
717
+ onClickOutside(s) {
718
+ if (e.persistent !== !0 && p.value === !0)
719
+ return k(s), // always prevent touch event
720
+ (s.type === "touchstart" || s.target.classList.contains("q-dialog__backdrop")) && nt(s), !0;
721
+ }
722
+ }, ie = x(
723
+ () => Ee(
724
+ e.anchor || (e.cover === !0 ? "center middle" : "bottom start"),
725
+ r.lang.rtl
726
+ )
727
+ ), Ae = x(() => e.cover === !0 ? ie.value : Ee(e.self || "top start", r.lang.rtl)), Be = x(
728
+ () => (e.square === !0 ? " q-menu--square" : "") + (d.value === !0 ? " q-menu--dark q-dark" : "")
729
+ ), Fe = x(() => e.autoClose === !0 ? { onClick: Re } : {}), ue = x(
730
+ () => p.value === !0 && e.persistent !== !0
731
+ );
732
+ S(ue, (s) => {
733
+ s === !0 ? (Lt(U), Dt(K)) : (pe(U), we(K));
734
+ });
735
+ function j() {
736
+ rt(() => {
737
+ let s = g.value;
738
+ s && s.contains(document.activeElement) !== !0 && (s = s.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || s.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || s.querySelector("[autofocus], [data-autofocus]") || s, s.focus({ preventScroll: !0 }));
739
+ });
740
+ }
741
+ function Le(s) {
742
+ if (l = e.noRefocus === !1 ? document.activeElement : null, Ge(se), oe(), re(), f = void 0, s !== void 0 && (e.touchPosition || e.contextMenu)) {
743
+ const G = et(s);
744
+ if (G.left !== void 0) {
745
+ const { top: Ve, left: Oe } = b.value.getBoundingClientRect();
746
+ f = { left: G.left - Oe, top: G.top - Ve };
747
+ }
748
+ }
749
+ i === void 0 && (i = S(
750
+ () => r.screen.width + "|" + r.screen.height + "|" + e.self + "|" + e.anchor + "|" + r.lang.rtl,
751
+ F
752
+ )), e.noFocus !== !0 && document.activeElement.blur(), H(() => {
753
+ F(), e.noFocus !== !0 && j();
754
+ }), M(() => {
755
+ r.platform.is.ios === !0 && (a = e.autoClose, g.value.click()), F(), oe(!0), n("show", s);
756
+ }, e.transitionDuration);
757
+ }
758
+ function De(s) {
759
+ C(), le(), ae(!0), l !== null && // menu was hidden from code or ESC plugin
760
+ (s === void 0 || s.qClickOutside !== !0) && (((s && s.type.indexOf("key") === 0 ? l.closest('[tabindex]:not([tabindex^="-"])') : void 0) || l).focus(), l = null), M(() => {
761
+ le(!0), n("hide", s);
762
+ }, e.transitionDuration);
763
+ }
764
+ function ae(s) {
765
+ f = void 0, i !== void 0 && (i(), i = void 0), (s === !0 || p.value === !0) && (Ue(se), A(), we(K), pe(U)), s !== !0 && (l = null);
766
+ }
767
+ function re() {
768
+ (b.value !== null || e.scrollTarget !== void 0) && (P.value = $t(b.value, e.scrollTarget), w(P.value, F));
769
+ }
770
+ function Re(s) {
771
+ a !== !0 ? (xt(c, s), n("click", s)) : a = !1;
772
+ }
773
+ function se(s) {
774
+ ue.value === !0 && e.noFocus !== !0 && tt(g.value, s.target) !== !0 && j();
775
+ }
776
+ function U(s) {
777
+ n("escapeKey"), k(s);
778
+ }
779
+ function F() {
780
+ $e({
781
+ targetEl: g.value,
782
+ offset: e.offset,
783
+ anchorEl: b.value,
784
+ anchorOrigin: ie.value,
785
+ selfOrigin: Ae.value,
786
+ absoluteOffset: f,
787
+ fit: e.fit,
788
+ cover: e.cover,
789
+ maxHeight: e.maxHeight,
790
+ maxWidth: e.maxWidth
791
+ });
792
+ }
793
+ function ze() {
794
+ return _(
795
+ Ie,
796
+ h.value,
797
+ () => p.value === !0 ? _("div", {
798
+ role: "menu",
799
+ ...o,
800
+ ref: g,
801
+ tabindex: -1,
802
+ class: [
803
+ "q-menu q-position-engine scroll" + Be.value,
804
+ o.class
805
+ ],
806
+ style: [
807
+ o.style,
808
+ v.value
809
+ ],
810
+ ...Fe.value
811
+ }, Je(t.default)) : null
812
+ );
813
+ }
814
+ return z(ae), Object.assign(c, { focus: j, updatePosition: F }), qe;
815
+ }
816
+ });
817
+ export {
818
+ Xt as Q,
819
+ ot as a,
820
+ Nt as b,
821
+ rt as c,
822
+ jt as d,
823
+ Ht as e,
824
+ kt as f,
825
+ Ut as g,
826
+ Gt as h,
827
+ Pt as i,
828
+ St as j,
829
+ gt as k,
830
+ pe as l,
831
+ vt as m,
832
+ Ct as n,
833
+ ht as o,
834
+ Lt as p,
835
+ Kt as r,
836
+ lt as u
837
+ };