@validol4ik/uikit 0.10.1 → 0.11.1
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-DA-BU9Xi.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/types/components/form/AppSegment/AppSegment.vue.d.ts +11 -2
- package/dist/types/components/form/AppSegment/types.d.ts +4 -1
- package/dist/uikit.cjs +1 -1
- package/dist/uikit.es.js +6 -6
- package/package.json +3 -2
- package/dist/AppButtonCopy-DdUpZ4h7.js +0 -103
- package/dist/AppButtonCopy-_GgFOGpC.cjs +0 -1
- package/dist/AppSelect-CDi9fc0b.js +0 -1985
- package/dist/AppSelect-CFLvEgde.cjs +0 -1
- package/dist/BottomSheet-Op42z3Sw.cjs +0 -1
- package/dist/DropdownButton-D9zeJlrz.js +0 -292
- package/dist/DropdownButton-xSB2mzVf.cjs +0 -1
- package/dist/QDialog-BajIjVX3.js +0 -264
- package/dist/QDialog-DUkV6dWi.cjs +0 -1
- package/dist/QMenu-2jfaPSJc.cjs +0 -1
- package/dist/QMenu-ByZ-VL_d.js +0 -536
- package/dist/escape-key-BNqVqiWj.js +0 -281
- package/dist/escape-key-DG0KKsWF.cjs +0 -1
- package/dist/focusout-DjvPXP_b.js +0 -135
- package/dist/focusout-DzWGke-4.cjs +0 -1
- package/dist/index-D2z9gMNY.cjs +0 -1
- package/dist/index-W3hJ-aLX.js +0 -1838
package/dist/QMenu-ByZ-VL_d.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-W3hJ-aLX.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-BNqVqiWj.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
|
-
};
|