@validol4ik/uikit 0.10.2 → 0.11.2
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/AppButtonCopy-BjQVrYEH.js +58 -0
- package/dist/AppButtonCopy-CJCsQ2Zc.cjs +1 -0
- package/dist/AppSelect-DC8-TTlX.cjs +1 -0
- package/dist/AppSelect-pGQF24bM.js +166 -0
- package/dist/{BottomSheet-PinLAITZ.js → BottomSheet-BV1JZxic.js} +12 -11
- package/dist/BottomSheet-CLZ7f05J.cjs +1 -0
- package/dist/DropdownButton-BXievAey.cjs +1 -0
- package/dist/DropdownButton-BYc2A5TU.js +101 -0
- package/dist/index-CpG13Bfr.cjs +1 -0
- package/dist/index-qX2ysQuM.js +616 -0
- package/dist/style.css +1 -1
- package/dist/uikit.cjs +1 -1
- package/dist/uikit.es.js +6 -6
- package/package.json +3 -2
- package/dist/AppButtonCopy-66cFhDuo.cjs +0 -1
- package/dist/AppButtonCopy-QvkjU_h4.js +0 -103
- package/dist/AppSelect-0p8QDBZ9.js +0 -1985
- package/dist/AppSelect-D0gQOyMy.cjs +0 -1
- package/dist/BottomSheet-CUWjgAeZ.cjs +0 -1
- package/dist/DropdownButton-Cz1xTcUt.cjs +0 -1
- package/dist/DropdownButton-Dhvb9D_L.js +0 -292
- package/dist/QDialog-Cy2w4ntF.js +0 -264
- package/dist/QDialog-tGGvOIPj.cjs +0 -1
- package/dist/QMenu-k3AStoLY.js +0 -536
- package/dist/QMenu-lZpXWLnn.cjs +0 -1
- package/dist/escape-key-BlsDwJUQ.js +0 -281
- package/dist/escape-key-CRpXNCKN.cjs +0 -1
- package/dist/focusout-DjvPXP_b.js +0 -135
- package/dist/focusout-DzWGke-4.cjs +0 -1
- package/dist/index-BB31xQaa.cjs +0 -1
- package/dist/index-DFNWQp-Z.js +0 -1878
package/dist/QMenu-k3AStoLY.js
DELETED
|
@@ -1,536 +0,0 @@
|
|
|
1
|
-
import { ref as S, onMounted as fe, watch as C, computed as T, getCurrentInstance as he, nextTick as Ce, onBeforeUnmount as Q, h as J, Transition as He } from "vue";
|
|
2
|
-
import { i as ke, P as Me, c as Pe, r as We, a as Be } from "./focusout-DjvPXP_b.js";
|
|
3
|
-
import { p as ee, w as te, m as qe, x as Ae, y as j, z as ne, c as Re, u as Le, a as $e, B as ze, D as Fe, h as De, E as Ke, s as Ie } from "./index-DFNWQp-Z.js";
|
|
4
|
-
import { g as je, b as Oe, s as _e, u as Qe, c as Ue, d as Ne, e as Ve, f as Xe, h as Ye, i as Ze, j as oe, k as Ge, a as Je, l as et } from "./escape-key-BlsDwJUQ.js";
|
|
5
|
-
let K, q = 0;
|
|
6
|
-
const v = new Array(256);
|
|
7
|
-
for (let e = 0; e < 256; e++)
|
|
8
|
-
v[e] = (e + 256).toString(16).substring(1);
|
|
9
|
-
const tt = (() => {
|
|
10
|
-
const e = typeof crypto < "u" ? crypto : typeof window < "u" ? window.crypto || window.msCrypto : void 0;
|
|
11
|
-
if (e !== void 0) {
|
|
12
|
-
if (e.randomBytes !== void 0)
|
|
13
|
-
return e.randomBytes;
|
|
14
|
-
if (e.getRandomValues !== void 0)
|
|
15
|
-
return (t) => {
|
|
16
|
-
const o = new Uint8Array(t);
|
|
17
|
-
return e.getRandomValues(o), o;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
return (t) => {
|
|
21
|
-
const o = [];
|
|
22
|
-
for (let n = t; n > 0; n--)
|
|
23
|
-
o.push(Math.floor(Math.random() * 256));
|
|
24
|
-
return o;
|
|
25
|
-
};
|
|
26
|
-
})(), le = 4096;
|
|
27
|
-
function O() {
|
|
28
|
-
(K === void 0 || q + 16 > le) && (q = 0, K = tt(le));
|
|
29
|
-
const e = Array.prototype.slice.call(K, q, q += 16);
|
|
30
|
-
return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, v[e[0]] + v[e[1]] + v[e[2]] + v[e[3]] + "-" + v[e[4]] + v[e[5]] + "-" + v[e[6]] + v[e[7]] + "-" + v[e[8]] + v[e[9]] + "-" + v[e[10]] + v[e[11]] + v[e[12]] + v[e[13]] + v[e[14]] + v[e[15]];
|
|
31
|
-
}
|
|
32
|
-
function nt(e) {
|
|
33
|
-
return e ?? null;
|
|
34
|
-
}
|
|
35
|
-
function ie(e, t) {
|
|
36
|
-
return e ?? (t === !0 ? `f_${O()}` : null);
|
|
37
|
-
}
|
|
38
|
-
function xt({ getValue: e, required: t = !0 } = {}) {
|
|
39
|
-
if (ke.value === !0) {
|
|
40
|
-
const o = e !== void 0 ? S(nt(e())) : S(null);
|
|
41
|
-
return t === !0 && o.value === null && fe(() => {
|
|
42
|
-
o.value = `f_${O()}`;
|
|
43
|
-
}), e !== void 0 && C(e, (n) => {
|
|
44
|
-
o.value = ie(n, t);
|
|
45
|
-
}), o;
|
|
46
|
-
}
|
|
47
|
-
return e !== void 0 ? T(() => ie(e(), t)) : S(`f_${O()}`);
|
|
48
|
-
}
|
|
49
|
-
function ot() {
|
|
50
|
-
if (window.getSelection !== void 0) {
|
|
51
|
-
const e = window.getSelection();
|
|
52
|
-
e.empty !== void 0 ? e.empty() : e.removeAllRanges !== void 0 && (e.removeAllRanges(), Me.is.mobile !== !0 && e.addRange(document.createRange()));
|
|
53
|
-
} else document.selection !== void 0 && document.selection.empty();
|
|
54
|
-
}
|
|
55
|
-
const lt = {
|
|
56
|
-
/* SSR does not know about Element */
|
|
57
|
-
target: {
|
|
58
|
-
type: [Boolean, String, Element],
|
|
59
|
-
default: !0
|
|
60
|
-
},
|
|
61
|
-
noParentEvent: Boolean
|
|
62
|
-
}, it = {
|
|
63
|
-
...lt,
|
|
64
|
-
contextMenu: Boolean
|
|
65
|
-
};
|
|
66
|
-
function at({
|
|
67
|
-
showing: e,
|
|
68
|
-
avoidEmit: t,
|
|
69
|
-
// required for QPopupProxy (true)
|
|
70
|
-
configureAnchorEl: o
|
|
71
|
-
// optional
|
|
72
|
-
}) {
|
|
73
|
-
const { props: n, proxy: l, emit: c } = he(), i = S(null);
|
|
74
|
-
let f = null;
|
|
75
|
-
function h(a) {
|
|
76
|
-
return i.value === null ? !1 : a === void 0 || a.touches === void 0 || a.touches.length <= 1;
|
|
77
|
-
}
|
|
78
|
-
const s = {};
|
|
79
|
-
o === void 0 && (Object.assign(s, {
|
|
80
|
-
hide(a) {
|
|
81
|
-
l.hide(a);
|
|
82
|
-
},
|
|
83
|
-
toggle(a) {
|
|
84
|
-
l.toggle(a), a.qAnchorHandled = !0;
|
|
85
|
-
},
|
|
86
|
-
toggleKey(a) {
|
|
87
|
-
qe(a, 13) === !0 && s.toggle(a);
|
|
88
|
-
},
|
|
89
|
-
contextClick(a) {
|
|
90
|
-
l.hide(a), ee(a), Ce(() => {
|
|
91
|
-
l.show(a), a.qAnchorHandled = !0;
|
|
92
|
-
});
|
|
93
|
-
},
|
|
94
|
-
prevent: ee,
|
|
95
|
-
mobileTouch(a) {
|
|
96
|
-
if (s.mobileCleanup(a), h(a) !== !0) return;
|
|
97
|
-
l.hide(a), i.value.classList.add("non-selectable");
|
|
98
|
-
const r = a.target;
|
|
99
|
-
te(s, "anchor", [
|
|
100
|
-
[r, "touchmove", "mobileCleanup", "passive"],
|
|
101
|
-
[r, "touchend", "mobileCleanup", "passive"],
|
|
102
|
-
[r, "touchcancel", "mobileCleanup", "passive"],
|
|
103
|
-
[i.value, "contextmenu", "prevent", "notPassive"]
|
|
104
|
-
]), f = setTimeout(() => {
|
|
105
|
-
f = null, l.show(a), a.qAnchorHandled = !0;
|
|
106
|
-
}, 300);
|
|
107
|
-
},
|
|
108
|
-
mobileCleanup(a) {
|
|
109
|
-
i.value.classList.remove("non-selectable"), f !== null && (clearTimeout(f), f = null), e.value === !0 && a !== void 0 && ot();
|
|
110
|
-
}
|
|
111
|
-
}), o = function(a = n.contextMenu) {
|
|
112
|
-
if (n.noParentEvent === !0 || i.value === null) return;
|
|
113
|
-
let r;
|
|
114
|
-
a === !0 ? l.$q.platform.is.mobile === !0 ? r = [
|
|
115
|
-
[i.value, "touchstart", "mobileTouch", "passive"]
|
|
116
|
-
] : r = [
|
|
117
|
-
[i.value, "mousedown", "hide", "passive"],
|
|
118
|
-
[i.value, "contextmenu", "contextClick", "notPassive"]
|
|
119
|
-
] : r = [
|
|
120
|
-
[i.value, "click", "toggle", "passive"],
|
|
121
|
-
[i.value, "keyup", "toggleKey", "passive"]
|
|
122
|
-
], te(s, "anchor", r);
|
|
123
|
-
});
|
|
124
|
-
function d() {
|
|
125
|
-
Ae(s, "anchor");
|
|
126
|
-
}
|
|
127
|
-
function x(a) {
|
|
128
|
-
for (i.value = a; i.value.classList.contains("q-anchor--skip"); )
|
|
129
|
-
i.value = i.value.parentNode;
|
|
130
|
-
o();
|
|
131
|
-
}
|
|
132
|
-
function y() {
|
|
133
|
-
if (n.target === !1 || n.target === "" || l.$el.parentNode === null)
|
|
134
|
-
i.value = null;
|
|
135
|
-
else if (n.target === !0)
|
|
136
|
-
x(l.$el.parentNode);
|
|
137
|
-
else {
|
|
138
|
-
let a = n.target;
|
|
139
|
-
if (typeof n.target == "string")
|
|
140
|
-
try {
|
|
141
|
-
a = document.querySelector(n.target);
|
|
142
|
-
} catch {
|
|
143
|
-
a = void 0;
|
|
144
|
-
}
|
|
145
|
-
a != null ? (i.value = a.$el || a, o()) : (i.value = null, console.error(`Anchor: target "${n.target}" not found`));
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return C(() => n.contextMenu, (a) => {
|
|
149
|
-
i.value !== null && (d(), o(a));
|
|
150
|
-
}), C(() => n.target, () => {
|
|
151
|
-
i.value !== null && d(), y();
|
|
152
|
-
}), C(() => n.noParentEvent, (a) => {
|
|
153
|
-
i.value !== null && (a === !0 ? d() : o());
|
|
154
|
-
}), fe(() => {
|
|
155
|
-
y(), t !== !0 && n.modelValue === !0 && i.value === null && c("update:modelValue", !1);
|
|
156
|
-
}), Q(() => {
|
|
157
|
-
f !== null && clearTimeout(f), d();
|
|
158
|
-
}), {
|
|
159
|
-
anchorEl: i,
|
|
160
|
-
canShow: h,
|
|
161
|
-
anchorEvents: s
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
function ut(e, t) {
|
|
165
|
-
const o = S(null);
|
|
166
|
-
let n;
|
|
167
|
-
function l(f, h) {
|
|
168
|
-
const s = `${h !== void 0 ? "add" : "remove"}EventListener`, d = h !== void 0 ? h : n;
|
|
169
|
-
f !== window && f[s]("scroll", d, j.passive), window[s]("scroll", d, j.passive), n = h;
|
|
170
|
-
}
|
|
171
|
-
function c() {
|
|
172
|
-
o.value !== null && (l(o.value), o.value = null);
|
|
173
|
-
}
|
|
174
|
-
const i = C(() => e.noParentEvent, () => {
|
|
175
|
-
o.value !== null && (c(), t());
|
|
176
|
-
});
|
|
177
|
-
return Q(i), {
|
|
178
|
-
localScrollTarget: o,
|
|
179
|
-
unconfigureScrollTarget: c,
|
|
180
|
-
changeScrollEvent: l
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
const { notPassiveCapture: A } = j, H = [];
|
|
184
|
-
function R(e) {
|
|
185
|
-
const t = e.target;
|
|
186
|
-
if (t === void 0 || t.nodeType === 8 || t.classList.contains("no-pointer-events") === !0) return;
|
|
187
|
-
let o = ne.length - 1;
|
|
188
|
-
for (; o >= 0; ) {
|
|
189
|
-
const n = ne[o].$;
|
|
190
|
-
if (n.type.name === "QTooltip") {
|
|
191
|
-
o--;
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
if (n.type.name !== "QDialog")
|
|
195
|
-
break;
|
|
196
|
-
if (n.props.seamless !== !0) return;
|
|
197
|
-
o--;
|
|
198
|
-
}
|
|
199
|
-
for (let n = H.length - 1; n >= 0; n--) {
|
|
200
|
-
const l = H[n];
|
|
201
|
-
if ((l.anchorEl.value === null || l.anchorEl.value.contains(t) === !1) && (t === document.body || l.innerRef.value !== null && l.innerRef.value.contains(t) === !1))
|
|
202
|
-
e.qClickOutside = !0, l.onClickOutside(e);
|
|
203
|
-
else
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
function rt(e) {
|
|
208
|
-
H.push(e), H.length === 1 && (document.addEventListener("mousedown", R, A), document.addEventListener("touchstart", R, A));
|
|
209
|
-
}
|
|
210
|
-
function ae(e) {
|
|
211
|
-
const t = H.findIndex((o) => o === e);
|
|
212
|
-
t !== -1 && (H.splice(t, 1), H.length === 0 && (document.removeEventListener("mousedown", R, A), document.removeEventListener("touchstart", R, A)));
|
|
213
|
-
}
|
|
214
|
-
let ue, re;
|
|
215
|
-
function se(e) {
|
|
216
|
-
const t = e.split(" ");
|
|
217
|
-
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;
|
|
218
|
-
}
|
|
219
|
-
function st(e) {
|
|
220
|
-
return e ? !(e.length !== 2 || typeof e[0] != "number" || typeof e[1] != "number") : !0;
|
|
221
|
-
}
|
|
222
|
-
const _ = {
|
|
223
|
-
"start#ltr": "left",
|
|
224
|
-
"start#rtl": "right",
|
|
225
|
-
"end#ltr": "right",
|
|
226
|
-
"end#rtl": "left"
|
|
227
|
-
};
|
|
228
|
-
["left", "middle", "right"].forEach((e) => {
|
|
229
|
-
_[`${e}#ltr`] = e, _[`${e}#rtl`] = e;
|
|
230
|
-
});
|
|
231
|
-
function ce(e, t) {
|
|
232
|
-
const o = e.split(" ");
|
|
233
|
-
return {
|
|
234
|
-
vertical: o[0],
|
|
235
|
-
horizontal: _[`${o[1]}#${t === !0 ? "rtl" : "ltr"}`]
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
function ct(e, t) {
|
|
239
|
-
let { top: o, left: n, right: l, bottom: c, width: i, height: f } = e.getBoundingClientRect();
|
|
240
|
-
return t !== void 0 && (o -= t[1], n -= t[0], c += t[1], l += t[0], i += t[0], f += t[1]), {
|
|
241
|
-
top: o,
|
|
242
|
-
bottom: c,
|
|
243
|
-
height: f,
|
|
244
|
-
left: n,
|
|
245
|
-
right: l,
|
|
246
|
-
width: i,
|
|
247
|
-
middle: n + (l - n) / 2,
|
|
248
|
-
center: o + (c - o) / 2
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
function dt(e, t, o) {
|
|
252
|
-
let { top: n, left: l } = e.getBoundingClientRect();
|
|
253
|
-
return n += t.top, l += t.left, o !== void 0 && (n += o[1], l += o[0]), {
|
|
254
|
-
top: n,
|
|
255
|
-
bottom: n + 1,
|
|
256
|
-
height: 1,
|
|
257
|
-
left: l,
|
|
258
|
-
right: l + 1,
|
|
259
|
-
width: 1,
|
|
260
|
-
middle: l,
|
|
261
|
-
center: n
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
function ft(e, t) {
|
|
265
|
-
return {
|
|
266
|
-
top: 0,
|
|
267
|
-
center: t / 2,
|
|
268
|
-
bottom: t,
|
|
269
|
-
left: 0,
|
|
270
|
-
middle: e / 2,
|
|
271
|
-
right: e
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
function de(e, t, o, n) {
|
|
275
|
-
return {
|
|
276
|
-
top: e[o.vertical] - t[n.vertical],
|
|
277
|
-
left: e[o.horizontal] - t[n.horizontal]
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
function me(e, t = 0) {
|
|
281
|
-
if (e.targetEl === null || e.anchorEl === null || t > 5) return;
|
|
282
|
-
if (e.targetEl.offsetHeight === 0 || e.targetEl.offsetWidth === 0) {
|
|
283
|
-
setTimeout(() => {
|
|
284
|
-
me(e, t + 1);
|
|
285
|
-
}, 10);
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
const {
|
|
289
|
-
targetEl: o,
|
|
290
|
-
offset: n,
|
|
291
|
-
anchorEl: l,
|
|
292
|
-
anchorOrigin: c,
|
|
293
|
-
selfOrigin: i,
|
|
294
|
-
absoluteOffset: f,
|
|
295
|
-
fit: h,
|
|
296
|
-
cover: s,
|
|
297
|
-
maxHeight: d,
|
|
298
|
-
maxWidth: x
|
|
299
|
-
} = e;
|
|
300
|
-
if (Pe.is.ios === !0 && window.visualViewport !== void 0) {
|
|
301
|
-
const k = document.body.style, { offsetLeft: p, offsetTop: b } = window.visualViewport;
|
|
302
|
-
p !== ue && (k.setProperty("--q-pe-left", p + "px"), ue = p), b !== re && (k.setProperty("--q-pe-top", b + "px"), re = b);
|
|
303
|
-
}
|
|
304
|
-
const { scrollLeft: y, scrollTop: a } = o, r = f === void 0 ? ct(l, s === !0 ? [0, 0] : n) : dt(l, f, n);
|
|
305
|
-
Object.assign(o.style, {
|
|
306
|
-
top: 0,
|
|
307
|
-
left: 0,
|
|
308
|
-
minWidth: null,
|
|
309
|
-
minHeight: null,
|
|
310
|
-
maxWidth: x,
|
|
311
|
-
maxHeight: d,
|
|
312
|
-
visibility: "visible"
|
|
313
|
-
});
|
|
314
|
-
const { offsetWidth: W, offsetHeight: M } = o, { elWidth: B, elHeight: L } = h === !0 || s === !0 ? { elWidth: Math.max(r.width, W), elHeight: s === !0 ? Math.max(r.height, M) : M } : { elWidth: W, elHeight: M };
|
|
315
|
-
let g = { maxWidth: x, maxHeight: d };
|
|
316
|
-
(h === !0 || s === !0) && (g.minWidth = r.width + "px", s === !0 && (g.minHeight = r.height + "px")), Object.assign(o.style, g);
|
|
317
|
-
const w = ft(B, L);
|
|
318
|
-
let m = de(r, w, c, i);
|
|
319
|
-
if (f === void 0 || n === void 0)
|
|
320
|
-
I(m, r, w, c, i);
|
|
321
|
-
else {
|
|
322
|
-
const { top: k, left: p } = m;
|
|
323
|
-
I(m, r, w, c, i);
|
|
324
|
-
let b = !1;
|
|
325
|
-
if (m.top !== k) {
|
|
326
|
-
b = !0;
|
|
327
|
-
const E = 2 * n[1];
|
|
328
|
-
r.center = r.top -= E, r.bottom -= E + 2;
|
|
329
|
-
}
|
|
330
|
-
if (m.left !== p) {
|
|
331
|
-
b = !0;
|
|
332
|
-
const E = 2 * n[0];
|
|
333
|
-
r.middle = r.left -= E, r.right -= E + 2;
|
|
334
|
-
}
|
|
335
|
-
b === !0 && (m = de(r, w, c, i), I(m, r, w, c, i));
|
|
336
|
-
}
|
|
337
|
-
g = {
|
|
338
|
-
top: m.top + "px",
|
|
339
|
-
left: m.left + "px"
|
|
340
|
-
}, m.maxHeight !== void 0 && (g.maxHeight = m.maxHeight + "px", r.height > m.maxHeight && (g.minHeight = g.maxHeight)), m.maxWidth !== void 0 && (g.maxWidth = m.maxWidth + "px", r.width > m.maxWidth && (g.minWidth = g.maxWidth)), Object.assign(o.style, g), o.scrollTop !== a && (o.scrollTop = a), o.scrollLeft !== y && (o.scrollLeft = y);
|
|
341
|
-
}
|
|
342
|
-
function I(e, t, o, n, l) {
|
|
343
|
-
const c = o.bottom, i = o.right, f = je(), h = window.innerHeight - f, s = document.body.clientWidth;
|
|
344
|
-
if (e.top < 0 || e.top + c > h)
|
|
345
|
-
if (l.vertical === "center")
|
|
346
|
-
e.top = t[n.vertical] > h / 2 ? Math.max(0, h - c) : 0, e.maxHeight = Math.min(c, h);
|
|
347
|
-
else if (t[n.vertical] > h / 2) {
|
|
348
|
-
const d = Math.min(
|
|
349
|
-
h,
|
|
350
|
-
n.vertical === "center" ? t.center : n.vertical === l.vertical ? t.bottom : t.top
|
|
351
|
-
);
|
|
352
|
-
e.maxHeight = Math.min(c, d), e.top = Math.max(0, d - c);
|
|
353
|
-
} else
|
|
354
|
-
e.top = Math.max(
|
|
355
|
-
0,
|
|
356
|
-
n.vertical === "center" ? t.center : n.vertical === l.vertical ? t.top : t.bottom
|
|
357
|
-
), e.maxHeight = Math.min(c, h - e.top);
|
|
358
|
-
if (e.left < 0 || e.left + i > s)
|
|
359
|
-
if (e.maxWidth = Math.min(i, s), l.horizontal === "middle")
|
|
360
|
-
e.left = t[n.horizontal] > s / 2 ? Math.max(0, s - i) : 0;
|
|
361
|
-
else if (t[n.horizontal] > s / 2) {
|
|
362
|
-
const d = Math.min(
|
|
363
|
-
s,
|
|
364
|
-
n.horizontal === "middle" ? t.middle : n.horizontal === l.horizontal ? t.right : t.left
|
|
365
|
-
);
|
|
366
|
-
e.maxWidth = Math.min(i, d), e.left = Math.max(0, d - e.maxWidth);
|
|
367
|
-
} else
|
|
368
|
-
e.left = Math.max(
|
|
369
|
-
0,
|
|
370
|
-
n.horizontal === "middle" ? t.middle : n.horizontal === l.horizontal ? t.left : t.right
|
|
371
|
-
), e.maxWidth = Math.min(i, s - e.left);
|
|
372
|
-
}
|
|
373
|
-
const yt = Re({
|
|
374
|
-
name: "QMenu",
|
|
375
|
-
inheritAttrs: !1,
|
|
376
|
-
props: {
|
|
377
|
-
...it,
|
|
378
|
-
...Ue,
|
|
379
|
-
...Le,
|
|
380
|
-
...Qe,
|
|
381
|
-
persistent: Boolean,
|
|
382
|
-
autoClose: Boolean,
|
|
383
|
-
separateClosePopup: Boolean,
|
|
384
|
-
noEscDismiss: Boolean,
|
|
385
|
-
noRouteDismiss: Boolean,
|
|
386
|
-
noRefocus: Boolean,
|
|
387
|
-
noFocus: Boolean,
|
|
388
|
-
fit: Boolean,
|
|
389
|
-
cover: Boolean,
|
|
390
|
-
square: Boolean,
|
|
391
|
-
anchor: {
|
|
392
|
-
type: String,
|
|
393
|
-
validator: se
|
|
394
|
-
},
|
|
395
|
-
self: {
|
|
396
|
-
type: String,
|
|
397
|
-
validator: se
|
|
398
|
-
},
|
|
399
|
-
offset: {
|
|
400
|
-
type: Array,
|
|
401
|
-
validator: st
|
|
402
|
-
},
|
|
403
|
-
scrollTarget: _e,
|
|
404
|
-
touchPosition: Boolean,
|
|
405
|
-
maxHeight: {
|
|
406
|
-
type: String,
|
|
407
|
-
default: null
|
|
408
|
-
},
|
|
409
|
-
maxWidth: {
|
|
410
|
-
type: String,
|
|
411
|
-
default: null
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
emits: [
|
|
415
|
-
...Oe,
|
|
416
|
-
"click",
|
|
417
|
-
"escapeKey"
|
|
418
|
-
],
|
|
419
|
-
setup(e, { slots: t, emit: o, attrs: n }) {
|
|
420
|
-
let l = null, c, i, f;
|
|
421
|
-
const h = he(), { proxy: s } = h, { $q: d } = s, x = S(null), y = S(!1), a = T(
|
|
422
|
-
() => e.persistent !== !0 && e.noRouteDismiss !== !0
|
|
423
|
-
), r = $e(e, d), { registerTick: W, removeTick: M } = Ne(), { registerTimeout: B } = Ve(), { transitionProps: L, transitionStyle: g } = Xe(e), { localScrollTarget: w, changeScrollEvent: m, unconfigureScrollTarget: k } = ut(e, Z), { anchorEl: p, canShow: b } = at({ showing: y }), { hide: E } = Ye({
|
|
424
|
-
showing: y,
|
|
425
|
-
canShow: b,
|
|
426
|
-
handleShow: pe,
|
|
427
|
-
handleHide: be,
|
|
428
|
-
hideOnRouteChange: a,
|
|
429
|
-
processOnMount: !0
|
|
430
|
-
}), { showPortal: U, hidePortal: N, renderPortal: ve } = Ze(h, x, Ee, "menu"), $ = {
|
|
431
|
-
anchorEl: p,
|
|
432
|
-
innerRef: x,
|
|
433
|
-
onClickOutside(u) {
|
|
434
|
-
if (e.persistent !== !0 && y.value === !0)
|
|
435
|
-
return E(u), // always prevent touch event
|
|
436
|
-
(u.type === "touchstart" || u.target.classList.contains("q-dialog__backdrop")) && Ie(u), !0;
|
|
437
|
-
}
|
|
438
|
-
}, V = T(
|
|
439
|
-
() => ce(
|
|
440
|
-
e.anchor || (e.cover === !0 ? "center middle" : "bottom start"),
|
|
441
|
-
d.lang.rtl
|
|
442
|
-
)
|
|
443
|
-
), ge = T(() => e.cover === !0 ? V.value : ce(e.self || "top start", d.lang.rtl)), xe = T(
|
|
444
|
-
() => (e.square === !0 ? " q-menu--square" : "") + (r.value === !0 ? " q-menu--dark q-dark" : "")
|
|
445
|
-
), ye = T(() => e.autoClose === !0 ? { onClick: we } : {}), X = T(
|
|
446
|
-
() => y.value === !0 && e.persistent !== !0
|
|
447
|
-
);
|
|
448
|
-
C(X, (u) => {
|
|
449
|
-
u === !0 ? (et(F), rt($)) : (oe(F), ae($));
|
|
450
|
-
});
|
|
451
|
-
function z() {
|
|
452
|
-
Je(() => {
|
|
453
|
-
let u = x.value;
|
|
454
|
-
u && u.contains(document.activeElement) !== !0 && (u = u.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || u.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || u.querySelector("[autofocus], [data-autofocus]") || u, u.focus({ preventScroll: !0 }));
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
function pe(u) {
|
|
458
|
-
if (l = e.noRefocus === !1 ? document.activeElement : null, Be(G), U(), Z(), c = void 0, u !== void 0 && (e.touchPosition || e.contextMenu)) {
|
|
459
|
-
const D = ze(u);
|
|
460
|
-
if (D.left !== void 0) {
|
|
461
|
-
const { top: Te, left: Se } = p.value.getBoundingClientRect();
|
|
462
|
-
c = { left: D.left - Se, top: D.top - Te };
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
i === void 0 && (i = C(
|
|
466
|
-
() => d.screen.width + "|" + d.screen.height + "|" + e.self + "|" + e.anchor + "|" + d.lang.rtl,
|
|
467
|
-
P
|
|
468
|
-
)), e.noFocus !== !0 && document.activeElement.blur(), W(() => {
|
|
469
|
-
P(), e.noFocus !== !0 && z();
|
|
470
|
-
}), B(() => {
|
|
471
|
-
d.platform.is.ios === !0 && (f = e.autoClose, x.value.click()), P(), U(!0), o("show", u);
|
|
472
|
-
}, e.transitionDuration);
|
|
473
|
-
}
|
|
474
|
-
function be(u) {
|
|
475
|
-
M(), N(), Y(!0), l !== null && // menu was hidden from code or ESC plugin
|
|
476
|
-
(u === void 0 || u.qClickOutside !== !0) && ((((u == null ? void 0 : u.type.indexOf("key")) === 0 ? l.closest('[tabindex]:not([tabindex^="-"])') : void 0) || l).focus(), l = null), B(() => {
|
|
477
|
-
N(!0), o("hide", u);
|
|
478
|
-
}, e.transitionDuration);
|
|
479
|
-
}
|
|
480
|
-
function Y(u) {
|
|
481
|
-
c = void 0, i !== void 0 && (i(), i = void 0), (u === !0 || y.value === !0) && (We(G), k(), ae($), oe(F)), u !== !0 && (l = null);
|
|
482
|
-
}
|
|
483
|
-
function Z() {
|
|
484
|
-
(p.value !== null || e.scrollTarget !== void 0) && (w.value = Ge(p.value, e.scrollTarget), m(w.value, P));
|
|
485
|
-
}
|
|
486
|
-
function we(u) {
|
|
487
|
-
f !== !0 ? (Fe(s, u), o("click", u)) : f = !1;
|
|
488
|
-
}
|
|
489
|
-
function G(u) {
|
|
490
|
-
X.value === !0 && e.noFocus !== !0 && Ke(x.value, u.target) !== !0 && z();
|
|
491
|
-
}
|
|
492
|
-
function F(u) {
|
|
493
|
-
e.noEscDismiss !== !0 && (o("escapeKey"), E(u));
|
|
494
|
-
}
|
|
495
|
-
function P() {
|
|
496
|
-
me({
|
|
497
|
-
targetEl: x.value,
|
|
498
|
-
offset: e.offset,
|
|
499
|
-
anchorEl: p.value,
|
|
500
|
-
anchorOrigin: V.value,
|
|
501
|
-
selfOrigin: ge.value,
|
|
502
|
-
absoluteOffset: c,
|
|
503
|
-
fit: e.fit,
|
|
504
|
-
cover: e.cover,
|
|
505
|
-
maxHeight: e.maxHeight,
|
|
506
|
-
maxWidth: e.maxWidth
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
function Ee() {
|
|
510
|
-
return J(
|
|
511
|
-
He,
|
|
512
|
-
L.value,
|
|
513
|
-
() => y.value === !0 ? J("div", {
|
|
514
|
-
role: "menu",
|
|
515
|
-
...n,
|
|
516
|
-
ref: x,
|
|
517
|
-
tabindex: -1,
|
|
518
|
-
class: [
|
|
519
|
-
"q-menu q-position-engine scroll" + xe.value,
|
|
520
|
-
n.class
|
|
521
|
-
],
|
|
522
|
-
style: [
|
|
523
|
-
n.style,
|
|
524
|
-
g.value
|
|
525
|
-
],
|
|
526
|
-
...ye.value
|
|
527
|
-
}, De(t.default)) : null
|
|
528
|
-
);
|
|
529
|
-
}
|
|
530
|
-
return Q(Y), Object.assign(s, { focus: z, updatePosition: P }), ve;
|
|
531
|
-
}
|
|
532
|
-
});
|
|
533
|
-
export {
|
|
534
|
-
yt as Q,
|
|
535
|
-
xt as u
|
|
536
|
-
};
|
package/dist/QMenu-lZpXWLnn.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("vue"),W=require("./focusout-DzWGke-4.cjs"),v=require("./index-BB31xQaa.cjs"),y=require("./escape-key-CRpXNCKN.cjs");let I,A=0;const x=new Array(256);for(let e=0;e<256;e++)x[e]=(e+256).toString(16).substring(1);const xe=(()=>{const e=typeof crypto<"u"?crypto:typeof window<"u"?window.crypto||window.msCrypto:void 0;if(e!==void 0){if(e.randomBytes!==void 0)return e.randomBytes;if(e.getRandomValues!==void 0)return t=>{const o=new Uint8Array(t);return e.getRandomValues(o),o}}return t=>{const o=[];for(let n=t;n>0;n--)o.push(Math.floor(Math.random()*256));return o}})(),G=4096;function _(){(I===void 0||A+16>G)&&(A=0,I=xe(G));const e=Array.prototype.slice.call(I,A,A+=16);return e[6]=e[6]&15|64,e[8]=e[8]&63|128,x[e[0]]+x[e[1]]+x[e[2]]+x[e[3]]+"-"+x[e[4]]+x[e[5]]+"-"+x[e[6]]+x[e[7]]+"-"+x[e[8]]+x[e[9]]+"-"+x[e[10]]+x[e[11]]+x[e[12]]+x[e[13]]+x[e[14]]+x[e[15]]}function ye(e){return e??null}function J(e,t){return e??(t===!0?`f_${_()}`:null)}function pe({getValue:e,required:t=!0}={}){if(W.isRuntimeSsrPreHydration.value===!0){const o=e!==void 0?a.ref(ye(e())):a.ref(null);return t===!0&&o.value===null&&a.onMounted(()=>{o.value=`f_${_()}`}),e!==void 0&&a.watch(e,n=>{o.value=J(n,t)}),o}return e!==void 0?a.computed(()=>J(e(),t)):a.ref(`f_${_()}`)}function be(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),W.Platform.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const we={target:{type:[Boolean,String,Element],default:!0},noParentEvent:Boolean},Ee={...we,contextMenu:Boolean};function Te({showing:e,avoidEmit:t,configureAnchorEl:o}){const{props:n,proxy:i,emit:d}=a.getCurrentInstance(),l=a.ref(null);let h=null;function m(u){return l.value===null?!1:u===void 0||u.touches===void 0||u.touches.length<=1}const c={};o===void 0&&(Object.assign(c,{hide(u){i.hide(u)},toggle(u){i.toggle(u),u.qAnchorHandled=!0},toggleKey(u){v.isKeyCode(u,13)===!0&&c.toggle(u)},contextClick(u){i.hide(u),v.prevent(u),a.nextTick(()=>{i.show(u),u.qAnchorHandled=!0})},prevent:v.prevent,mobileTouch(u){if(c.mobileCleanup(u),m(u)!==!0)return;i.hide(u),l.value.classList.add("non-selectable");const s=u.target;v.addEvt(c,"anchor",[[s,"touchmove","mobileCleanup","passive"],[s,"touchend","mobileCleanup","passive"],[s,"touchcancel","mobileCleanup","passive"],[l.value,"contextmenu","prevent","notPassive"]]),h=setTimeout(()=>{h=null,i.show(u),u.qAnchorHandled=!0},300)},mobileCleanup(u){l.value.classList.remove("non-selectable"),h!==null&&(clearTimeout(h),h=null),e.value===!0&&u!==void 0&&be()}}),o=function(u=n.contextMenu){if(n.noParentEvent===!0||l.value===null)return;let s;u===!0?i.$q.platform.is.mobile===!0?s=[[l.value,"touchstart","mobileTouch","passive"]]:s=[[l.value,"mousedown","hide","passive"],[l.value,"contextmenu","contextClick","notPassive"]]:s=[[l.value,"click","toggle","passive"],[l.value,"keyup","toggleKey","passive"]],v.addEvt(c,"anchor",s)});function f(){v.cleanEvt(c,"anchor")}function b(u){for(l.value=u;l.value.classList.contains("q-anchor--skip");)l.value=l.value.parentNode;o()}function w(){if(n.target===!1||n.target===""||i.$el.parentNode===null)l.value=null;else if(n.target===!0)b(i.$el.parentNode);else{let u=n.target;if(typeof n.target=="string")try{u=document.querySelector(n.target)}catch{u=void 0}u!=null?(l.value=u.$el||u,o()):(l.value=null,console.error(`Anchor: target "${n.target}" not found`))}}return a.watch(()=>n.contextMenu,u=>{l.value!==null&&(f(),o(u))}),a.watch(()=>n.target,()=>{l.value!==null&&f(),w()}),a.watch(()=>n.noParentEvent,u=>{l.value!==null&&(u===!0?f():o())}),a.onMounted(()=>{w(),t!==!0&&n.modelValue===!0&&l.value===null&&d("update:modelValue",!1)}),a.onBeforeUnmount(()=>{h!==null&&clearTimeout(h),f()}),{anchorEl:l,canShow:m,anchorEvents:c}}function Se(e,t){const o=a.ref(null);let n;function i(h,m){const c=`${m!==void 0?"add":"remove"}EventListener`,f=m!==void 0?m:n;h!==window&&h[c]("scroll",f,v.listenOpts.passive),window[c]("scroll",f,v.listenOpts.passive),n=m}function d(){o.value!==null&&(i(o.value),o.value=null)}const l=a.watch(()=>e.noParentEvent,()=>{o.value!==null&&(d(),t())});return a.onBeforeUnmount(l),{localScrollTarget:o,unconfigureScrollTarget:d,changeScrollEvent:i}}const{notPassiveCapture:L}=v.listenOpts,H=[];function R(e){const t=e.target;if(t===void 0||t.nodeType===8||t.classList.contains("no-pointer-events")===!0)return;let o=v.portalProxyList.length-1;for(;o>=0;){const n=v.portalProxyList[o].$;if(n.type.name==="QTooltip"){o--;continue}if(n.type.name!=="QDialog")break;if(n.props.seamless!==!0)return;o--}for(let n=H.length-1;n>=0;n--){const i=H[n];if((i.anchorEl.value===null||i.anchorEl.value.contains(t)===!1)&&(t===document.body||i.innerRef.value!==null&&i.innerRef.value.contains(t)===!1))e.qClickOutside=!0,i.onClickOutside(e);else return}}function Ce(e){H.push(e),H.length===1&&(document.addEventListener("mousedown",R,L),document.addEventListener("touchstart",R,L))}function ee(e){const t=H.findIndex(o=>o===e);t!==-1&&(H.splice(t,1),H.length===0&&(document.removeEventListener("mousedown",R,L),document.removeEventListener("touchstart",R,L)))}let te,ne;function oe(e){const t=e.split(" ");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}function He(e){return e?!(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number"):!0}const j={"start#ltr":"left","start#rtl":"right","end#ltr":"right","end#rtl":"left"};["left","middle","right"].forEach(e=>{j[`${e}#ltr`]=e,j[`${e}#rtl`]=e});function ie(e,t){const o=e.split(" ");return{vertical:o[0],horizontal:j[`${o[1]}#${t===!0?"rtl":"ltr"}`]}}function Me(e,t){let{top:o,left:n,right:i,bottom:d,width:l,height:h}=e.getBoundingClientRect();return t!==void 0&&(o-=t[1],n-=t[0],d+=t[1],i+=t[0],l+=t[0],h+=t[1]),{top:o,bottom:d,height:h,left:n,right:i,width:l,middle:n+(i-n)/2,center:o+(d-o)/2}}function ke(e,t,o){let{top:n,left:i}=e.getBoundingClientRect();return n+=t.top,i+=t.left,o!==void 0&&(n+=o[1],i+=o[0]),{top:n,bottom:n+1,height:1,left:i,right:i+1,width:1,middle:i,center:n}}function Pe(e,t){return{top:0,center:t/2,bottom:t,left:0,middle:e/2,right:e}}function le(e,t,o,n){return{top:e[o.vertical]-t[n.vertical],left:e[o.horizontal]-t[n.horizontal]}}function ue(e,t=0){if(e.targetEl===null||e.anchorEl===null||t>5)return;if(e.targetEl.offsetHeight===0||e.targetEl.offsetWidth===0){setTimeout(()=>{ue(e,t+1)},10);return}const{targetEl:o,offset:n,anchorEl:i,anchorOrigin:d,selfOrigin:l,absoluteOffset:h,fit:m,cover:c,maxHeight:f,maxWidth:b}=e;if(W.client.is.ios===!0&&window.visualViewport!==void 0){const M=document.body.style,{offsetLeft:E,offsetTop:T}=window.visualViewport;E!==te&&(M.setProperty("--q-pe-left",E+"px"),te=E),T!==ne&&(M.setProperty("--q-pe-top",T+"px"),ne=T)}const{scrollLeft:w,scrollTop:u}=o,s=h===void 0?Me(i,c===!0?[0,0]:n):ke(i,h,n);Object.assign(o.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:b,maxHeight:f,visibility:"visible"});const{offsetWidth:B,offsetHeight:k}=o,{elWidth:q,elHeight:$}=m===!0||c===!0?{elWidth:Math.max(s.width,B),elHeight:c===!0?Math.max(s.height,k):k}:{elWidth:B,elHeight:k};let p={maxWidth:b,maxHeight:f};(m===!0||c===!0)&&(p.minWidth=s.width+"px",c===!0&&(p.minHeight=s.height+"px")),Object.assign(o.style,p);const S=Pe(q,$);let g=le(s,S,d,l);if(h===void 0||n===void 0)O(g,s,S,d,l);else{const{top:M,left:E}=g;O(g,s,S,d,l);let T=!1;if(g.top!==M){T=!0;const C=2*n[1];s.center=s.top-=C,s.bottom-=C+2}if(g.left!==E){T=!0;const C=2*n[0];s.middle=s.left-=C,s.right-=C+2}T===!0&&(g=le(s,S,d,l),O(g,s,S,d,l))}p={top:g.top+"px",left:g.left+"px"},g.maxHeight!==void 0&&(p.maxHeight=g.maxHeight+"px",s.height>g.maxHeight&&(p.minHeight=p.maxHeight)),g.maxWidth!==void 0&&(p.maxWidth=g.maxWidth+"px",s.width>g.maxWidth&&(p.minWidth=p.maxWidth)),Object.assign(o.style,p),o.scrollTop!==u&&(o.scrollTop=u),o.scrollLeft!==w&&(o.scrollLeft=w)}function O(e,t,o,n,i){const d=o.bottom,l=o.right,h=y.getScrollbarWidth(),m=window.innerHeight-h,c=document.body.clientWidth;if(e.top<0||e.top+d>m)if(i.vertical==="center")e.top=t[n.vertical]>m/2?Math.max(0,m-d):0,e.maxHeight=Math.min(d,m);else if(t[n.vertical]>m/2){const f=Math.min(m,n.vertical==="center"?t.center:n.vertical===i.vertical?t.bottom:t.top);e.maxHeight=Math.min(d,f),e.top=Math.max(0,f-d)}else e.top=Math.max(0,n.vertical==="center"?t.center:n.vertical===i.vertical?t.top:t.bottom),e.maxHeight=Math.min(d,m-e.top);if(e.left<0||e.left+l>c)if(e.maxWidth=Math.min(l,c),i.horizontal==="middle")e.left=t[n.horizontal]>c/2?Math.max(0,c-l):0;else if(t[n.horizontal]>c/2){const f=Math.min(c,n.horizontal==="middle"?t.middle:n.horizontal===i.horizontal?t.right:t.left);e.maxWidth=Math.min(l,f),e.left=Math.max(0,f-e.maxWidth)}else e.left=Math.max(0,n.horizontal==="middle"?t.middle:n.horizontal===i.horizontal?t.left:t.right),e.maxWidth=Math.min(l,c-e.left)}const We=v.createComponent({name:"QMenu",inheritAttrs:!1,props:{...Ee,...y.useModelToggleProps,...v.useDarkProps,...y.useTransitionProps,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:oe},self:{type:String,validator:oe},offset:{type:Array,validator:He},scrollTarget:y.scrollTargetProp,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...y.useModelToggleEmits,"click","escapeKey"],setup(e,{slots:t,emit:o,attrs:n}){let i=null,d,l,h;const m=a.getCurrentInstance(),{proxy:c}=m,{$q:f}=c,b=a.ref(null),w=a.ref(!1),u=a.computed(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),s=v.useDark(e,f),{registerTick:B,removeTick:k}=y.useTick(),{registerTimeout:q}=y.useTimeout(),{transitionProps:$,transitionStyle:p}=y.useTransition(e),{localScrollTarget:S,changeScrollEvent:g,unconfigureScrollTarget:M}=Se(e,Y),{anchorEl:E,canShow:T}=Te({showing:w}),{hide:C}=y.useModelToggle({showing:w,canShow:T,handleShow:de,handleHide:fe,hideOnRouteChange:u,processOnMount:!0}),{showPortal:Q,hidePortal:U,renderPortal:re}=y.usePortal(m,b,me,"menu"),F={anchorEl:E,innerRef:b,onClickOutside(r){if(e.persistent!==!0&&w.value===!0)return C(r),(r.type==="touchstart"||r.target.classList.contains("q-dialog__backdrop"))&&v.stopAndPrevent(r),!0}},N=a.computed(()=>ie(e.anchor||(e.cover===!0?"center middle":"bottom start"),f.lang.rtl)),ae=a.computed(()=>e.cover===!0?N.value:ie(e.self||"top start",f.lang.rtl)),se=a.computed(()=>(e.square===!0?" q-menu--square":"")+(s.value===!0?" q-menu--dark q-dark":"")),ce=a.computed(()=>e.autoClose===!0?{onClick:he}:{}),V=a.computed(()=>w.value===!0&&e.persistent!==!0);a.watch(V,r=>{r===!0?(y.addEscapeKey(D),Ce(F)):(y.removeEscapeKey(D),ee(F))});function z(){y.addFocusFn(()=>{let r=b.value;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}))})}function de(r){if(i=e.noRefocus===!1?document.activeElement:null,W.addFocusout(Z),Q(),Y(),d=void 0,r!==void 0&&(e.touchPosition||e.contextMenu)){const K=v.position(r);if(K.left!==void 0){const{top:ve,left:ge}=E.value.getBoundingClientRect();d={left:K.left-ge,top:K.top-ve}}}l===void 0&&(l=a.watch(()=>f.screen.width+"|"+f.screen.height+"|"+e.self+"|"+e.anchor+"|"+f.lang.rtl,P)),e.noFocus!==!0&&document.activeElement.blur(),B(()=>{P(),e.noFocus!==!0&&z()}),q(()=>{f.platform.is.ios===!0&&(h=e.autoClose,b.value.click()),P(),Q(!0),o("show",r)},e.transitionDuration)}function fe(r){k(),U(),X(!0),i!==null&&(r===void 0||r.qClickOutside!==!0)&&((((r==null?void 0:r.type.indexOf("key"))===0?i.closest('[tabindex]:not([tabindex^="-"])'):void 0)||i).focus(),i=null),q(()=>{U(!0),o("hide",r)},e.transitionDuration)}function X(r){d=void 0,l!==void 0&&(l(),l=void 0),(r===!0||w.value===!0)&&(W.removeFocusout(Z),M(),ee(F),y.removeEscapeKey(D)),r!==!0&&(i=null)}function Y(){(E.value!==null||e.scrollTarget!==void 0)&&(S.value=y.getScrollTarget(E.value,e.scrollTarget),g(S.value,P))}function he(r){h!==!0?(v.closePortalMenus(c,r),o("click",r)):h=!1}function Z(r){V.value===!0&&e.noFocus!==!0&&v.childHasFocus(b.value,r.target)!==!0&&z()}function D(r){e.noEscDismiss!==!0&&(o("escapeKey"),C(r))}function P(){ue({targetEl:b.value,offset:e.offset,anchorEl:E.value,anchorOrigin:N.value,selfOrigin:ae.value,absoluteOffset:d,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function me(){return a.h(a.Transition,$.value,()=>w.value===!0?a.h("div",{role:"menu",...n,ref:b,tabindex:-1,class:["q-menu q-position-engine scroll"+se.value,n.class],style:[n.style,p.value],...ce.value},v.hSlot(t.default)):null)}return a.onBeforeUnmount(X),Object.assign(c,{focus:z,updatePosition:P}),re}});exports.QMenu=We;exports.useId=pe;
|