@validol4ik/uikit 0.9.4 → 0.9.6

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