@validol4ik/uikit 0.8.9 → 0.9.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-ksL4USb7.cjs → AppButtonCopy-4nM5Qd2X.cjs} +1 -1
- package/dist/{AppButtonCopy-DtyuObNR.js → AppButtonCopy-DDAmqwuY.js} +1 -1
- package/dist/{AppSelect-BsJ5zHQu.cjs → AppSelect-BC3jrZMN.cjs} +1 -1
- package/dist/{AppSelect-CYhIzu1c.js → AppSelect-C1G_e_Mw.js} +3 -3
- package/dist/{DropdownButton-C9ezj3x1.js → DropdownButton-BlygVDV4.js} +85 -92
- package/dist/DropdownButton-nNqAlRmy.cjs +1 -0
- package/dist/{QMenu-YxMyCS9G.js → QMenu-DslscGkx.js} +1 -1
- package/dist/{QMenu-DTfOI5cn.cjs → QMenu-Is1Y4Ebq.cjs} +1 -1
- package/dist/{index-PLQPOSmX.js → index-B0biLfNh.js} +210 -208
- package/dist/{index-CnKvri-w.cjs → index-BkdFu2Tl.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/uikit.cjs +1 -1
- package/dist/uikit.es.js +1 -1
- package/package.json +1 -1
- package/dist/DropdownButton-DND4bvfo.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { computed as u, h as i, getCurrentInstance as
|
|
2
|
-
import { S as c, c as A, h as L, y as I, z as G, Q as U, B as
|
|
3
|
-
import { d as X, u as Y, Q as Z } from "./QMenu-
|
|
1
|
+
import { computed as u, h as i, getCurrentInstance as P, ref as S, watch as D, onMounted as z, defineComponent as j, openBlock as g, createBlock as E, unref as h, normalizeClass as C, withCtx as k, renderSlot as p, createElementBlock as q, createCommentVNode as M, toDisplayString as F } from "vue";
|
|
2
|
+
import { S as c, c as A, h as L, y as I, z as G, Q as U, B as v, w as W, C as N, _ as T } from "./index-B0biLfNh.js";
|
|
3
|
+
import { d as X, u as Y, Q as Z } from "./QMenu-DslscGkx.js";
|
|
4
4
|
const J = {
|
|
5
5
|
[c.SM]: "3px 9px",
|
|
6
6
|
[c.MD]: "5px 12px",
|
|
@@ -20,17 +20,17 @@ const J = {
|
|
|
20
20
|
spread: Boolean
|
|
21
21
|
},
|
|
22
22
|
setup(e, { slots: l }) {
|
|
23
|
-
const
|
|
23
|
+
const o = u(() => {
|
|
24
24
|
const s = ["unelevated", "outline", "flat", "rounded", "square", "push", "stretch", "glossy"].filter((a) => e[a] === !0).map((a) => `q-btn-group--${a}`).join(" ");
|
|
25
25
|
return `q-btn-group row no-wrap${s.length !== 0 ? " " + s : ""}` + (e.spread === !0 ? " q-btn-group--spread" : " inline");
|
|
26
26
|
});
|
|
27
|
-
return () => i("div", { class:
|
|
27
|
+
return () => i("div", { class: o.value }, L(l.default));
|
|
28
28
|
}
|
|
29
29
|
}), x = Object.keys(I);
|
|
30
30
|
function ee(e) {
|
|
31
|
-
return x.reduce((l,
|
|
32
|
-
const s = e[
|
|
33
|
-
return s !== void 0 && (l[
|
|
31
|
+
return x.reduce((l, o) => {
|
|
32
|
+
const s = e[o];
|
|
33
|
+
return s !== void 0 && (l[o] = s), l;
|
|
34
34
|
}, {});
|
|
35
35
|
}
|
|
36
36
|
const ne = A({
|
|
@@ -65,66 +65,66 @@ const ne = A({
|
|
|
65
65
|
toggleAriaLabel: String
|
|
66
66
|
},
|
|
67
67
|
emits: ["update:modelValue", "click", "beforeShow", "show", "beforeHide", "hide"],
|
|
68
|
-
setup(e, { slots: l, emit:
|
|
69
|
-
const { proxy: s } =
|
|
70
|
-
const
|
|
68
|
+
setup(e, { slots: l, emit: o }) {
|
|
69
|
+
const { proxy: s } = P(), a = S(e.modelValue), r = S(null), f = Y(), b = u(() => {
|
|
70
|
+
const n = {
|
|
71
71
|
"aria-expanded": a.value === !0 ? "true" : "false",
|
|
72
72
|
"aria-haspopup": "true",
|
|
73
73
|
"aria-controls": f.value,
|
|
74
74
|
"aria-label": e.toggleAriaLabel || s.$q.lang.label[a.value === !0 ? "collapse" : "expand"](e.label)
|
|
75
75
|
};
|
|
76
|
-
return (e.disable === !0 || e.split === !1 && e.disableMainBtn === !0 || e.disableDropdown === !0) && (
|
|
77
|
-
}),
|
|
76
|
+
return (e.disable === !0 || e.split === !1 && e.disableMainBtn === !0 || e.disableDropdown === !0) && (n["aria-disabled"] = "true"), n;
|
|
77
|
+
}), t = u(
|
|
78
78
|
() => "q-btn-dropdown__arrow" + (a.value === !0 && e.noIconAnimation === !1 ? " rotate-180" : "") + (e.split === !1 ? " q-btn-dropdown__arrow-container" : "")
|
|
79
79
|
), m = u(() => G(e)), w = u(() => ee(e));
|
|
80
|
-
|
|
80
|
+
D(() => e.modelValue, (n) => {
|
|
81
81
|
var d;
|
|
82
|
-
(d = r.value) == null || d[
|
|
83
|
-
}),
|
|
84
|
-
function
|
|
85
|
-
a.value = !0,
|
|
82
|
+
(d = r.value) == null || d[n ? "show" : "hide"]();
|
|
83
|
+
}), D(() => e.split, B);
|
|
84
|
+
function R(n) {
|
|
85
|
+
a.value = !0, o("beforeShow", n);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
|
|
87
|
+
function V(n) {
|
|
88
|
+
o("show", n), o("update:modelValue", !0);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
a.value = !1,
|
|
90
|
+
function $(n) {
|
|
91
|
+
a.value = !1, o("beforeHide", n);
|
|
92
92
|
}
|
|
93
|
-
function H(
|
|
94
|
-
|
|
93
|
+
function H(n) {
|
|
94
|
+
o("hide", n), o("update:modelValue", !1);
|
|
95
95
|
}
|
|
96
|
-
function O(
|
|
97
|
-
|
|
96
|
+
function O(n) {
|
|
97
|
+
o("click", n);
|
|
98
98
|
}
|
|
99
|
-
function Q(
|
|
100
|
-
W(
|
|
99
|
+
function Q(n) {
|
|
100
|
+
W(n), B(), o("click", n);
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function _(n) {
|
|
103
103
|
var d;
|
|
104
|
-
(d = r.value) == null || d.toggle(
|
|
104
|
+
(d = r.value) == null || d.toggle(n);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function y(n) {
|
|
107
107
|
var d;
|
|
108
|
-
(d = r.value) == null || d.show(
|
|
108
|
+
(d = r.value) == null || d.show(n);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function B(n) {
|
|
111
111
|
var d;
|
|
112
|
-
(d = r.value) == null || d.hide(
|
|
112
|
+
(d = r.value) == null || d.hide(n);
|
|
113
113
|
}
|
|
114
114
|
return Object.assign(s, {
|
|
115
|
-
show:
|
|
116
|
-
hide:
|
|
117
|
-
toggle:
|
|
118
|
-
}),
|
|
119
|
-
e.modelValue === !0 &&
|
|
115
|
+
show: y,
|
|
116
|
+
hide: B,
|
|
117
|
+
toggle: _
|
|
118
|
+
}), z(() => {
|
|
119
|
+
e.modelValue === !0 && y();
|
|
120
120
|
}), () => {
|
|
121
|
-
const
|
|
121
|
+
const n = [
|
|
122
122
|
i(U, {
|
|
123
|
-
class:
|
|
123
|
+
class: t.value,
|
|
124
124
|
name: e.dropdownIcon || s.$q.iconSet.arrow.dropdown
|
|
125
125
|
})
|
|
126
126
|
];
|
|
127
|
-
return e.disableDropdown !== !0 &&
|
|
127
|
+
return e.disableDropdown !== !0 && n.push(
|
|
128
128
|
i(Z, {
|
|
129
129
|
ref: r,
|
|
130
130
|
id: f.value,
|
|
@@ -145,12 +145,12 @@ const ne = A({
|
|
|
145
145
|
transitionShow: e.transitionShow,
|
|
146
146
|
transitionHide: e.transitionHide,
|
|
147
147
|
transitionDuration: e.transitionDuration,
|
|
148
|
-
onBeforeShow:
|
|
149
|
-
onShow:
|
|
150
|
-
onBeforeHide:
|
|
148
|
+
onBeforeShow: R,
|
|
149
|
+
onShow: V,
|
|
150
|
+
onBeforeHide: $,
|
|
151
151
|
onHide: H
|
|
152
152
|
}, l.default)
|
|
153
|
-
), e.split === !1 ? i(
|
|
153
|
+
), e.split === !1 ? i(v, {
|
|
154
154
|
class: "q-btn-dropdown q-btn-dropdown--simple",
|
|
155
155
|
...w.value,
|
|
156
156
|
...b.value,
|
|
@@ -159,7 +159,7 @@ const ne = A({
|
|
|
159
159
|
round: !1,
|
|
160
160
|
onClick: O
|
|
161
161
|
}, {
|
|
162
|
-
default: () => L(l.label, []).concat(
|
|
162
|
+
default: () => L(l.label, []).concat(n),
|
|
163
163
|
loading: l.loading
|
|
164
164
|
}) : i(K, {
|
|
165
165
|
class: "q-btn-dropdown q-btn-dropdown--split no-wrap q-btn-item",
|
|
@@ -169,7 +169,7 @@ const ne = A({
|
|
|
169
169
|
glossy: e.glossy,
|
|
170
170
|
stretch: e.stretch
|
|
171
171
|
}, () => [
|
|
172
|
-
i(
|
|
172
|
+
i(v, {
|
|
173
173
|
class: "q-btn-dropdown--current",
|
|
174
174
|
...w.value,
|
|
175
175
|
disable: e.disable === !0 || e.disableMainBtn === !0,
|
|
@@ -180,7 +180,7 @@ const ne = A({
|
|
|
180
180
|
default: l.label,
|
|
181
181
|
loading: l.loading
|
|
182
182
|
}),
|
|
183
|
-
i(
|
|
183
|
+
i(v, {
|
|
184
184
|
class: "q-btn-dropdown__arrow-container q-anchor--skip",
|
|
185
185
|
...b.value,
|
|
186
186
|
...m.value,
|
|
@@ -192,7 +192,7 @@ const ne = A({
|
|
|
192
192
|
size: e.size,
|
|
193
193
|
padding: e.padding,
|
|
194
194
|
ripple: e.ripple
|
|
195
|
-
}, () =>
|
|
195
|
+
}, () => n)
|
|
196
196
|
]);
|
|
197
197
|
};
|
|
198
198
|
}
|
|
@@ -222,69 +222,62 @@ const ne = A({
|
|
|
222
222
|
},
|
|
223
223
|
emits: ["menuShown", "menuHidden"],
|
|
224
224
|
setup(e, { emit: l }) {
|
|
225
|
-
const
|
|
225
|
+
const o = e, s = l, a = S(!1), r = u(() => [
|
|
226
226
|
"dropdown-btn",
|
|
227
227
|
{
|
|
228
|
-
"dropdown-btn_default": !
|
|
229
|
-
"dropdown-btn_trans":
|
|
230
|
-
"dropdown-btn_flat":
|
|
231
|
-
"dropdown-btn_rounded":
|
|
232
|
-
"dropdown-btn_icon-left":
|
|
233
|
-
"dropdown-btn_icon-middle":
|
|
228
|
+
"dropdown-btn_default": !o.transparent && !o.flat,
|
|
229
|
+
"dropdown-btn_trans": o.transparent,
|
|
230
|
+
"dropdown-btn_flat": o.flat,
|
|
231
|
+
"dropdown-btn_rounded": o.rounded,
|
|
232
|
+
"dropdown-btn_icon-left": o.iconLeft,
|
|
233
|
+
"dropdown-btn_icon-middle": o.iconMiddle,
|
|
234
|
+
"dropdown-btn_no-drop": o.hideDropIcon
|
|
234
235
|
},
|
|
235
|
-
`dropdown-btn_${
|
|
236
|
-
`dropdown-btn_${
|
|
236
|
+
`dropdown-btn_${o.size}`,
|
|
237
|
+
`dropdown-btn_${o.color}`
|
|
237
238
|
]), f = () => {
|
|
238
239
|
a.value = !0, s("menuShown");
|
|
239
240
|
}, b = () => {
|
|
240
241
|
a.value = !1, s("menuHidden");
|
|
241
242
|
};
|
|
242
|
-
return (
|
|
243
|
+
return (t, m) => (g(), E(h(ne), {
|
|
243
244
|
"no-caps": "",
|
|
244
245
|
unelevated: "",
|
|
245
246
|
modelValue: a.value,
|
|
246
247
|
"onUpdate:modelValue": m[0] || (m[0] = (w) => a.value = w),
|
|
247
|
-
class:
|
|
248
|
-
padding: h(J)[
|
|
249
|
-
loading:
|
|
250
|
-
disable:
|
|
251
|
-
"aria-label":
|
|
252
|
-
"menu-offset":
|
|
253
|
-
"menu-anchor":
|
|
254
|
-
"menu-self":
|
|
248
|
+
class: C(r.value),
|
|
249
|
+
padding: h(J)[t.size || h(c).MD],
|
|
250
|
+
loading: t.loading,
|
|
251
|
+
disable: t.disabled || void 0,
|
|
252
|
+
"aria-label": t.ariaLabel,
|
|
253
|
+
"menu-offset": t.menuOffset,
|
|
254
|
+
"menu-anchor": t.menuAnchor,
|
|
255
|
+
"menu-self": t.menuSelf,
|
|
255
256
|
"content-class": [
|
|
256
257
|
"kl-menu dropdown-menu",
|
|
257
|
-
{ "glass-menu":
|
|
258
|
-
|
|
258
|
+
{ "glass-menu": t.glass },
|
|
259
|
+
t.menuClass
|
|
259
260
|
],
|
|
261
|
+
"dropdown-icon": "icon-kl icon-kl-arrow-down",
|
|
260
262
|
onBeforeShow: f,
|
|
261
263
|
onBeforeHide: b
|
|
262
264
|
}, {
|
|
263
|
-
label:
|
|
264
|
-
|
|
265
|
+
label: k(() => [
|
|
266
|
+
t.iconLeft || t.iconMiddle ? (g(), q("i", {
|
|
265
267
|
key: 0,
|
|
266
|
-
class:
|
|
268
|
+
class: C([
|
|
267
269
|
"icon-kl",
|
|
268
|
-
|
|
269
|
-
`icon-kl-${
|
|
270
|
-
|
|
270
|
+
t.iconLeft ? "icon-kl_left" : "icon-kl_middle",
|
|
271
|
+
`icon-kl-${t.iconLeft || t.iconMiddle}`,
|
|
272
|
+
t.transparent || t.flat ? `text-${t.color}` : "text-secondary"
|
|
271
273
|
])
|
|
272
|
-
}, null, 2)) :
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
n.hideDropIcon ? y("", !0) : (B(), S("i", {
|
|
276
|
-
key: 2,
|
|
277
|
-
class: p([
|
|
278
|
-
"icon-kl",
|
|
279
|
-
"icon-kl-arrow-down",
|
|
280
|
-
{ "icon-kl-arrow-down_rotated": a.value },
|
|
281
|
-
n.transparent ? `text-${n.color}` : "text-secondary"
|
|
282
|
-
])
|
|
283
|
-
}, null, 2))
|
|
274
|
+
}, null, 2)) : M("", !0),
|
|
275
|
+
t.label ? (g(), q("span", oe, F(t.label), 1)) : M("", !0),
|
|
276
|
+
p(t.$slots, "label", {}, void 0, !0)
|
|
284
277
|
]),
|
|
285
|
-
default:
|
|
286
|
-
|
|
287
|
-
|
|
278
|
+
default: k(() => [
|
|
279
|
+
p(t.$slots, "default", {}, void 0, !0),
|
|
280
|
+
p(t.$slots, "options", {
|
|
288
281
|
hideMenu: b,
|
|
289
282
|
showMenu: f
|
|
290
283
|
}, void 0, !0)
|
|
@@ -292,7 +285,7 @@ const ne = A({
|
|
|
292
285
|
_: 3
|
|
293
286
|
}, 8, ["modelValue", "class", "padding", "loading", "disable", "aria-label", "menu-offset", "menu-anchor", "menu-self", "content-class"]));
|
|
294
287
|
}
|
|
295
|
-
}), de = /* @__PURE__ */ T(te, [["__scopeId", "data-v-
|
|
288
|
+
}), de = /* @__PURE__ */ T(te, [["__scopeId", "data-v-9ad6865d"]]);
|
|
296
289
|
export {
|
|
297
290
|
de as default
|
|
298
291
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),l=require("./index-BkdFu2Tl.cjs"),B=require("./QMenu-Is1Y4Ebq.cjs"),k={[l.SIZES.SM]:"3px 9px",[l.SIZES.MD]:"5px 12px",[l.SIZES.LG]:"6px 15px",[l.SIZES.XL]:"9px 20px"},q=l.createComponent({name:"QBtnGroup",props:{unelevated:Boolean,outline:Boolean,flat:Boolean,rounded:Boolean,square:Boolean,push:Boolean,stretch:Boolean,glossy:Boolean,spread:Boolean},setup(e,{slots:r}){const t=n.computed(()=>{const u=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(d=>e[d]===!0).map(d=>`q-btn-group--${d}`).join(" ");return`q-btn-group row no-wrap${u.length!==0?" "+u:""}`+(e.spread===!0?" q-btn-group--spread":" inline")});return()=>n.h("div",{class:t.value},l.hSlot(r.default))}}),M=Object.keys(l.nonRoundBtnProps);function I(e){return M.reduce((r,t)=>{const u=e[t];return u!==void 0&&(r[t]=u),r},{})}const A=l.createComponent({name:"QBtnDropdown",props:{...l.nonRoundBtnProps,...B.useTransitionProps,modelValue:Boolean,split:Boolean,dropdownIcon:String,contentClass:[Array,String,Object],contentStyle:[Array,String,Object],cover:Boolean,persistent:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,autoClose:Boolean,noRefocus:Boolean,noFocus:Boolean,menuAnchor:{type:String,default:"bottom end"},menuSelf:{type:String,default:"top end"},menuOffset:Array,disableMainBtn:Boolean,disableDropdown:Boolean,noIconAnimation:Boolean,toggleAriaLabel:String},emits:["update:modelValue","click","beforeShow","show","beforeHide","hide"],setup(e,{slots:r,emit:t}){const{proxy:u}=n.getCurrentInstance(),d=n.ref(e.modelValue),i=n.ref(null),c=B.useId(),f=n.computed(()=>{const o={"aria-expanded":d.value===!0?"true":"false","aria-haspopup":"true","aria-controls":c.value,"aria-label":e.toggleAriaLabel||u.$q.lang.label[d.value===!0?"collapse":"expand"](e.label)};return(e.disable===!0||e.split===!1&&e.disableMainBtn===!0||e.disableDropdown===!0)&&(o["aria-disabled"]="true"),o}),a=n.computed(()=>"q-btn-dropdown__arrow"+(d.value===!0&&e.noIconAnimation===!1?" rotate-180":"")+(e.split===!1?" q-btn-dropdown__arrow-container":"")),b=n.computed(()=>l.getBtnDesignAttr(e)),m=n.computed(()=>I(e));n.watch(()=>e.modelValue,o=>{var s;(s=i.value)==null||s[o?"show":"hide"]()}),n.watch(()=>e.split,w);function g(o){d.value=!0,t("beforeShow",o)}function p(o){t("show",o),t("update:modelValue",!0)}function S(o){d.value=!1,t("beforeHide",o)}function v(o){t("hide",o),t("update:modelValue",!1)}function y(o){t("click",o)}function C(o){l.stop(o),w(),t("click",o)}function D(o){var s;(s=i.value)==null||s.toggle(o)}function h(o){var s;(s=i.value)==null||s.show(o)}function w(o){var s;(s=i.value)==null||s.hide(o)}return Object.assign(u,{show:h,hide:w,toggle:D}),n.onMounted(()=>{e.modelValue===!0&&h()}),()=>{const o=[n.h(l.QIcon,{class:a.value,name:e.dropdownIcon||u.$q.iconSet.arrow.dropdown})];return e.disableDropdown!==!0&&o.push(n.h(B.QMenu,{ref:i,id:c.value,class:e.contentClass,style:e.contentStyle,cover:e.cover,fit:!0,persistent:e.persistent,noEscDismiss:e.noEscDismiss,noRouteDismiss:e.noRouteDismiss,autoClose:e.autoClose,noFocus:e.noFocus,noRefocus:e.noRefocus,anchor:e.menuAnchor,self:e.menuSelf,offset:e.menuOffset,separateClosePopup:!0,transitionShow:e.transitionShow,transitionHide:e.transitionHide,transitionDuration:e.transitionDuration,onBeforeShow:g,onShow:p,onBeforeHide:S,onHide:v},r.default)),e.split===!1?n.h(l.QBtn,{class:"q-btn-dropdown q-btn-dropdown--simple",...m.value,...f.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:y},{default:()=>l.hSlot(r.label,[]).concat(o),loading:r.loading}):n.h(q,{class:"q-btn-dropdown q-btn-dropdown--split no-wrap q-btn-item",rounded:e.rounded,square:e.square,...b.value,glossy:e.glossy,stretch:e.stretch},()=>[n.h(l.QBtn,{class:"q-btn-dropdown--current",...m.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:C},{default:r.label,loading:r.loading}),n.h(l.QBtn,{class:"q-btn-dropdown__arrow-container q-anchor--skip",...f.value,...b.value,disable:e.disable===!0||e.disableDropdown===!0,rounded:e.rounded,color:e.color,textColor:e.textColor,dense:e.dense,size:e.size,padding:e.padding,ripple:e.ripple},()=>o)])}}}),L={key:1,class:"dropdown-btn__label"},R=n.defineComponent({__name:"DropdownButton",props:{size:{default:l.SIZES.MD},transparent:{type:Boolean},flat:{type:Boolean},rounded:{type:Boolean},color:{default:l.COLORS.PRIMARY},iconLeft:{},iconMiddle:{},hideDropIcon:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},ariaLabel:{},label:{},menuOffset:{},menuAnchor:{},menuSelf:{},menuClass:{},glass:{type:Boolean}},emits:["menuShown","menuHidden"],setup(e,{emit:r}){const t=e,u=r,d=n.ref(!1),i=n.computed(()=>["dropdown-btn",{"dropdown-btn_default":!t.transparent&&!t.flat,"dropdown-btn_trans":t.transparent,"dropdown-btn_flat":t.flat,"dropdown-btn_rounded":t.rounded,"dropdown-btn_icon-left":t.iconLeft,"dropdown-btn_icon-middle":t.iconMiddle,"dropdown-btn_no-drop":t.hideDropIcon},`dropdown-btn_${t.size}`,`dropdown-btn_${t.color}`]),c=()=>{d.value=!0,u("menuShown")},f=()=>{d.value=!1,u("menuHidden")};return(a,b)=>(n.openBlock(),n.createBlock(n.unref(A),{"no-caps":"",unelevated:"",modelValue:d.value,"onUpdate:modelValue":b[0]||(b[0]=m=>d.value=m),class:n.normalizeClass(i.value),padding:n.unref(k)[a.size||n.unref(l.SIZES).MD],loading:a.loading,disable:a.disabled||void 0,"aria-label":a.ariaLabel,"menu-offset":a.menuOffset,"menu-anchor":a.menuAnchor,"menu-self":a.menuSelf,"content-class":["kl-menu dropdown-menu",{"glass-menu":a.glass},a.menuClass],"dropdown-icon":"icon-kl icon-kl-arrow-down",onBeforeShow:c,onBeforeHide:f},{label:n.withCtx(()=>[a.iconLeft||a.iconMiddle?(n.openBlock(),n.createElementBlock("i",{key:0,class:n.normalizeClass(["icon-kl",a.iconLeft?"icon-kl_left":"icon-kl_middle",`icon-kl-${a.iconLeft||a.iconMiddle}`,a.transparent||a.flat?`text-${a.color}`:"text-secondary"])},null,2)):n.createCommentVNode("",!0),a.label?(n.openBlock(),n.createElementBlock("span",L,n.toDisplayString(a.label),1)):n.createCommentVNode("",!0),n.renderSlot(a.$slots,"label",{},void 0,!0)]),default:n.withCtx(()=>[n.renderSlot(a.$slots,"default",{},void 0,!0),n.renderSlot(a.$slots,"options",{hideMenu:f,showMenu:c},void 0,!0)]),_:3},8,["modelValue","class","padding","loading","disable","aria-label","menu-offset","menu-anchor","menu-self","content-class"]))}}),V=l._export_sfc(R,[["__scopeId","data-v-9ad6865d"]]);exports.default=V;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
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-
|
|
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-B0biLfNh.js";
|
|
4
4
|
let X, V = 0;
|
|
5
5
|
const w = new Array(256);
|
|
6
6
|
for (let e = 0; e < 256; e++)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("vue"),L=require("./focusout-DzWGke-4.cjs"),g=require("./index-CnKvri-w.cjs");let N,D=0;const b=new Array(256);for(let e=0;e<256;e++)b[e]=(e+256).toString(16).substring(1);const Ae=(()=>{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}})(),ne=4096;function _(){(N===void 0||D+16>ne)&&(D=0,N=Ae(ne));const e=Array.prototype.slice.call(N,D,D+=16);return e[6]=e[6]&15|64,e[8]=e[8]&63|128,b[e[0]]+b[e[1]]+b[e[2]]+b[e[3]]+"-"+b[e[4]]+b[e[5]]+"-"+b[e[6]]+b[e[7]]+"-"+b[e[8]]+b[e[9]]+"-"+b[e[10]]+b[e[11]]+b[e[12]]+b[e[13]]+b[e[14]]+b[e[15]]}function De(e){return e??null}function le(e,t){return e??(t===!0?`f_${_()}`:null)}function Re({getValue:e,required:t=!0}={}){if(L.isRuntimeSsrPreHydration.value===!0){const o=e!==void 0?r.ref(De(e())):r.ref(null);return t===!0&&o.value===null&&r.onMounted(()=>{o.value=`f_${_()}`}),e!==void 0&&r.watch(e,n=>{o.value=le(n,t)}),o}return e!==void 0?r.computed(()=>le(e(),t)):r.ref(`f_${_()}`)}let k=[],A=[];function me(e){A=A.filter(t=>t!==e)}function Ie(e){me(e),A.push(e)}function ie(e){me(e),A.length===0&&k.length!==0&&(k[k.length-1](),k=[])}function he(e){A.length===0?e():k.push(e)}function ze(e){k=k.filter(t=>t!==e)}function Oe(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),L.Platform.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const Ve={target:{type:[Boolean,String,Element],default:!0},noParentEvent:Boolean},Ke={...Ve,contextMenu:Boolean};function Ue({showing:e,avoidEmit:t,configureAnchorEl:o}){const{props:n,proxy:l,emit:m}=r.getCurrentInstance(),i=r.ref(null);let a=null;function h(u){return i.value===null?!1:u===void 0||u.touches===void 0||u.touches.length<=1}const d={};o===void 0&&(Object.assign(d,{hide(u){l.hide(u)},toggle(u){l.toggle(u),u.qAnchorHandled=!0},toggleKey(u){g.isKeyCode(u,13)===!0&&d.toggle(u)},contextClick(u){l.hide(u),g.prevent(u),r.nextTick(()=>{l.show(u),u.qAnchorHandled=!0})},prevent:g.prevent,mobileTouch(u){if(d.mobileCleanup(u),h(u)!==!0)return;l.hide(u),i.value.classList.add("non-selectable");const f=u.target;g.addEvt(d,"anchor",[[f,"touchmove","mobileCleanup","passive"],[f,"touchend","mobileCleanup","passive"],[f,"touchcancel","mobileCleanup","passive"],[i.value,"contextmenu","prevent","notPassive"]]),a=setTimeout(()=>{a=null,l.show(u),u.qAnchorHandled=!0},300)},mobileCleanup(u){i.value.classList.remove("non-selectable"),a!==null&&(clearTimeout(a),a=null),e.value===!0&&u!==void 0&&Oe()}}),o=function(u=n.contextMenu){if(n.noParentEvent===!0||i.value===null)return;let f;u===!0?l.$q.platform.is.mobile===!0?f=[[i.value,"touchstart","mobileTouch","passive"]]:f=[[i.value,"mousedown","hide","passive"],[i.value,"contextmenu","contextClick","notPassive"]]:f=[[i.value,"click","toggle","passive"],[i.value,"keyup","toggleKey","passive"]],g.addEvt(d,"anchor",f)});function c(){g.cleanEvt(d,"anchor")}function y(u){for(i.value=u;i.value.classList.contains("q-anchor--skip");)i.value=i.value.parentNode;o()}function w(){if(n.target===!1||n.target===""||l.$el.parentNode===null)i.value=null;else if(n.target===!0)y(l.$el.parentNode);else{let u=n.target;if(typeof n.target=="string")try{u=document.querySelector(n.target)}catch{u=void 0}u!=null?(i.value=u.$el||u,o()):(i.value=null,console.error(`Anchor: target "${n.target}" not found`))}}return r.watch(()=>n.contextMenu,u=>{i.value!==null&&(c(),o(u))}),r.watch(()=>n.target,()=>{i.value!==null&&c(),w()}),r.watch(()=>n.noParentEvent,u=>{i.value!==null&&(u===!0?c():o())}),r.onMounted(()=>{w(),t!==!0&&n.modelValue===!0&&i.value===null&&m("update:modelValue",!1)}),r.onBeforeUnmount(()=>{a!==null&&clearTimeout(a),c()}),{anchorEl:i,canShow:h,anchorEvents:d}}function Ne(e,t){const o=r.ref(null);let n;function l(a,h){const d=`${h!==void 0?"add":"remove"}EventListener`,c=h!==void 0?h:n;a!==window&&a[d]("scroll",c,g.listenOpts.passive),window[d]("scroll",c,g.listenOpts.passive),n=h}function m(){o.value!==null&&(l(o.value),o.value=null)}const i=r.watch(()=>e.noParentEvent,()=>{o.value!==null&&(m(),t())});return r.onBeforeUnmount(i),{localScrollTarget:o,unconfigureScrollTarget:m,changeScrollEvent:l}}const ve={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},ge=["beforeShow","show","beforeHide","hide"];function pe({showing:e,canShow:t,hideOnRouteChange:o,handleShow:n,handleHide:l,processOnMount:m}){const i=r.getCurrentInstance(),{props:a,emit:h,proxy:d}=i;let c;function y(v){e.value===!0?f(v):w(v)}function w(v){if(a.disable===!0||(v==null?void 0:v.qAnchorHandled)===!0||t!==void 0&&t(v)!==!0)return;const p=a["onUpdate:modelValue"]!==void 0;p===!0&&(h("update:modelValue",!0),c=v,r.nextTick(()=>{c===v&&(c=void 0)})),(a.modelValue===null||p===!1)&&u(v)}function u(v){e.value!==!0&&(e.value=!0,h("beforeShow",v),n!==void 0?n(v):h("show",v))}function f(v){if(a.disable===!0)return;const p=a["onUpdate:modelValue"]!==void 0;p===!0&&(h("update:modelValue",!1),c=v,r.nextTick(()=>{c===v&&(c=void 0)})),(a.modelValue===null||p===!1)&&H(v)}function H(v){e.value!==!1&&(e.value=!1,h("beforeHide",v),l!==void 0?l(v):h("hide",v))}function C(v){a.disable===!0&&v===!0?a["onUpdate:modelValue"]!==void 0&&h("update:modelValue",!1):v===!0!==e.value&&(v===!0?u:H)(c)}r.watch(()=>a.modelValue,C),o!==void 0&&g.vmHasRouter(i)===!0&&r.watch(()=>d.$route.fullPath,()=>{o.value===!0&&e.value===!0&&f()}),r.onMounted(()=>{C(a.modelValue)});const M={show:w,hide:f,toggle:y};return Object.assign(d,M),M}const re={};let Qe=1,_e=document.body;function je(e,t){const o=document.createElement("div");if(o.id=t!==void 0?`q-portal--${t}--${Qe++}`:e,re.globalNodes!==void 0){const n=re.globalNodes.class;n!==void 0&&(o.className=n)}return _e.appendChild(o),o}function Ge(e){e.remove()}const Xe=g.createComponent({name:"QPortal",setup(e,{slots:t}){return()=>t.default()}});function Ye(e){for(e=e.parent;e!=null;){if(e.type.name==="QGlobalDialog")return!0;if(e.type.name==="QDialog"||e.type.name==="QMenu")return!1;e=e.parent}return!1}function ye(e,t,o,n){const l=r.ref(!1),m=r.ref(!1);let i=null;const a={},h=n==="dialog"&&Ye(e);function d(y){if(y===!0){ie(a),m.value=!0;return}m.value=!1,l.value===!1&&(h===!1&&i===null&&(i=je(!1,n)),l.value=!0,g.portalProxyList.push(e.proxy),Ie(a))}function c(y){if(m.value=!1,y!==!0)return;ie(a),l.value=!1;const w=g.portalProxyList.indexOf(e.proxy);w!==-1&&g.portalProxyList.splice(w,1),i!==null&&(Ge(i),i=null)}return r.onUnmounted(()=>{c(!0)}),e.proxy.__qPortal=!0,L.injectProp(e.proxy,"contentEl",()=>t.value),{showPortal:d,hidePortal:c,portalIsActive:l,portalIsAccessible:m,renderPortal:()=>h===!0?o():l.value===!0?[r.h(r.Teleport,{to:i},r.h(Xe,o))]:void 0}}const we={transitionShow:{type:String,default:"fade"},transitionHide:{type:String,default:"fade"},transitionDuration:{type:[String,Number],default:300}};function xe(e,t=()=>{},o=()=>{}){return{transitionProps:r.computed(()=>{const n=`q-transition--${e.transitionShow||t()}`,l=`q-transition--${e.transitionHide||o()}`;return{appear:!0,enterFromClass:`${n}-enter-from`,enterActiveClass:`${n}-enter-active`,enterToClass:`${n}-enter-to`,leaveFromClass:`${l}-leave-from`,leaveActiveClass:`${l}-leave-active`,leaveToClass:`${l}-leave-to`}}),transitionStyle:r.computed(()=>`--q-transition-duration: ${e.transitionDuration}ms`)}}function be(){let e;const t=r.getCurrentInstance();function o(){e=void 0}return r.onDeactivated(o),r.onBeforeUnmount(o),{removeTick:o,registerTick(n){e=n,r.nextTick(()=>{e===n&&(g.vmIsDestroyed(t)===!1&&e(),e=void 0)})}}}function Ee(){let e=null;const t=r.getCurrentInstance();function o(){e!==null&&(clearTimeout(e),e=null)}return r.onDeactivated(o),r.onBeforeUnmount(o),{removeTimeout:o,registerTimeout(n,l){o(),g.vmIsDestroyed(t)===!1&&(e=setTimeout(()=>{e=null,n()},l))}}}const Ze=[Element,String],Je=[null,document,document.body,document.scrollingElement,document.documentElement];function et(e,t){let o=g.getElement(t);if(o===void 0){if(e==null)return window;o=e.closest(".scroll,.scroll-y,.overflow-auto")}return Je.includes(o)?window:o}function tt(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function ot(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}let R;function nt(){if(R!==void 0)return R;const e=document.createElement("p"),t=document.createElement("div");g.css(e,{width:"100%",height:"200px"}),g.css(t,{position:"absolute",top:"0px",left:"0px",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),t.appendChild(e),document.body.appendChild(t);const o=e.offsetWidth;t.style.overflow="scroll";let n=e.offsetWidth;return o===n&&(n=t.clientWidth),t.remove(),R=o-n,R}function lt(e,t=!0){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"]))}const W=[];let F;function it(e){F=e.keyCode===27}function rt(){F===!0&&(F=!1)}function ut(e){F===!0&&(F=!1,g.isKeyCode(e,27)===!0&&W[W.length-1](e))}function Te(e){window[e]("keydown",it),window[e]("blur",rt),window[e]("keyup",ut),F=!1}function Ce(e){L.client.is.desktop===!0&&(W.push(e),W.length===1&&Te("addEventListener"))}function j(e){const t=W.indexOf(e);t!==-1&&(W.splice(t,1),W.length===0&&Te("removeEventListener"))}const{notPassiveCapture:I}=g.listenOpts,q=[];function z(e){const t=e.target;if(t===void 0||t.nodeType===8||t.classList.contains("no-pointer-events")===!0)return;let o=g.portalProxyList.length-1;for(;o>=0;){const n=g.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=q.length-1;n>=0;n--){const l=q[n];if((l.anchorEl.value===null||l.anchorEl.value.contains(t)===!1)&&(t===document.body||l.innerRef.value!==null&&l.innerRef.value.contains(t)===!1))e.qClickOutside=!0,l.onClickOutside(e);else return}}function at(e){q.push(e),q.length===1&&(document.addEventListener("mousedown",z,I),document.addEventListener("touchstart",z,I))}function ue(e){const t=q.findIndex(o=>o===e);t!==-1&&(q.splice(t,1),q.length===0&&(document.removeEventListener("mousedown",z,I),document.removeEventListener("touchstart",z,I)))}let ae,se;function ce(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 st(e){return e?!(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number"):!0}const G={"start#ltr":"left","start#rtl":"right","end#ltr":"right","end#rtl":"left"};["left","middle","right"].forEach(e=>{G[`${e}#ltr`]=e,G[`${e}#rtl`]=e});function de(e,t){const o=e.split(" ");return{vertical:o[0],horizontal:G[`${o[1]}#${t===!0?"rtl":"ltr"}`]}}function ct(e,t){let{top:o,left:n,right:l,bottom:m,width:i,height:a}=e.getBoundingClientRect();return t!==void 0&&(o-=t[1],n-=t[0],m+=t[1],l+=t[0],i+=t[0],a+=t[1]),{top:o,bottom:m,height:a,left:n,right:l,width:i,middle:n+(l-n)/2,center:o+(m-o)/2}}function dt(e,t,o){let{top:n,left:l}=e.getBoundingClientRect();return n+=t.top,l+=t.left,o!==void 0&&(n+=o[1],l+=o[0]),{top:n,bottom:n+1,height:1,left:l,right:l+1,width:1,middle:l,center:n}}function ft(e,t){return{top:0,center:t/2,bottom:t,left:0,middle:e/2,right:e}}function fe(e,t,o,n){return{top:e[o.vertical]-t[n.vertical],left:e[o.horizontal]-t[n.horizontal]}}function Se(e,t=0){if(e.targetEl===null||e.anchorEl===null||t>5)return;if(e.targetEl.offsetHeight===0||e.targetEl.offsetWidth===0){setTimeout(()=>{Se(e,t+1)},10);return}const{targetEl:o,offset:n,anchorEl:l,anchorOrigin:m,selfOrigin:i,absoluteOffset:a,fit:h,cover:d,maxHeight:c,maxWidth:y}=e;if(L.client.is.ios===!0&&window.visualViewport!==void 0){const B=document.body.style,{offsetLeft:E,offsetTop:T}=window.visualViewport;E!==ae&&(B.setProperty("--q-pe-left",E+"px"),ae=E),T!==se&&(B.setProperty("--q-pe-top",T+"px"),se=T)}const{scrollLeft:w,scrollTop:u}=o,f=a===void 0?ct(l,d===!0?[0,0]:n):dt(l,a,n);Object.assign(o.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:y,maxHeight:c,visibility:"visible"});const{offsetWidth:H,offsetHeight:C}=o,{elWidth:M,elHeight:v}=h===!0||d===!0?{elWidth:Math.max(f.width,H),elHeight:d===!0?Math.max(f.height,C):C}:{elWidth:H,elHeight:C};let p={maxWidth:y,maxHeight:c};(h===!0||d===!0)&&(p.minWidth=f.width+"px",d===!0&&(p.minHeight=f.height+"px")),Object.assign(o.style,p);const S=ft(M,v);let x=fe(f,S,m,i);if(a===void 0||n===void 0)Q(x,f,S,m,i);else{const{top:B,left:E}=x;Q(x,f,S,m,i);let T=!1;if(x.top!==B){T=!0;const P=2*n[1];f.center=f.top-=P,f.bottom-=P+2}if(x.left!==E){T=!0;const P=2*n[0];f.middle=f.left-=P,f.right-=P+2}T===!0&&(x=fe(f,S,m,i),Q(x,f,S,m,i))}p={top:x.top+"px",left:x.left+"px"},x.maxHeight!==void 0&&(p.maxHeight=x.maxHeight+"px",f.height>x.maxHeight&&(p.minHeight=p.maxHeight)),x.maxWidth!==void 0&&(p.maxWidth=x.maxWidth+"px",f.width>x.maxWidth&&(p.minWidth=p.maxWidth)),Object.assign(o.style,p),o.scrollTop!==u&&(o.scrollTop=u),o.scrollLeft!==w&&(o.scrollLeft=w)}function Q(e,t,o,n,l){const m=o.bottom,i=o.right,a=nt(),h=window.innerHeight-a,d=document.body.clientWidth;if(e.top<0||e.top+m>h)if(l.vertical==="center")e.top=t[n.vertical]>h/2?Math.max(0,h-m):0,e.maxHeight=Math.min(m,h);else if(t[n.vertical]>h/2){const c=Math.min(h,n.vertical==="center"?t.center:n.vertical===l.vertical?t.bottom:t.top);e.maxHeight=Math.min(m,c),e.top=Math.max(0,c-m)}else e.top=Math.max(0,n.vertical==="center"?t.center:n.vertical===l.vertical?t.top:t.bottom),e.maxHeight=Math.min(m,h-e.top);if(e.left<0||e.left+i>d)if(e.maxWidth=Math.min(i,d),l.horizontal==="middle")e.left=t[n.horizontal]>d/2?Math.max(0,d-i):0;else if(t[n.horizontal]>d/2){const c=Math.min(d,n.horizontal==="middle"?t.middle:n.horizontal===l.horizontal?t.right:t.left);e.maxWidth=Math.min(i,c),e.left=Math.max(0,c-e.maxWidth)}else e.left=Math.max(0,n.horizontal==="middle"?t.middle:n.horizontal===l.horizontal?t.left:t.right),e.maxWidth=Math.min(i,d-e.left)}const mt=g.createComponent({name:"QMenu",inheritAttrs:!1,props:{...Ke,...ve,...g.useDarkProps,...we,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:ce},self:{type:String,validator:ce},offset:{type:Array,validator:st},scrollTarget:Ze,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...ge,"click","escapeKey"],setup(e,{slots:t,emit:o,attrs:n}){let l=null,m,i,a;const h=r.getCurrentInstance(),{proxy:d}=h,{$q:c}=d,y=r.ref(null),w=r.ref(!1),u=r.computed(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),f=g.useDark(e,c),{registerTick:H,removeTick:C}=be(),{registerTimeout:M}=Ee(),{transitionProps:v,transitionStyle:p}=xe(e),{localScrollTarget:S,changeScrollEvent:x,unconfigureScrollTarget:B}=Ne(e,te),{anchorEl:E,canShow:T}=Ue({showing:w}),{hide:P}=pe({showing:w,canShow:T,handleShow:We,handleHide:qe,hideOnRouteChange:u,processOnMount:!0}),{showPortal:X,hidePortal:Y,renderPortal:Pe}=ye(h,y,Be,"menu"),O={anchorEl:E,innerRef:y,onClickOutside(s){if(e.persistent!==!0&&w.value===!0)return P(s),(s.type==="touchstart"||s.target.classList.contains("q-dialog__backdrop"))&&g.stopAndPrevent(s),!0}},Z=r.computed(()=>de(e.anchor||(e.cover===!0?"center middle":"bottom start"),c.lang.rtl)),He=r.computed(()=>e.cover===!0?Z.value:de(e.self||"top start",c.lang.rtl)),Me=r.computed(()=>(e.square===!0?" q-menu--square":"")+(f.value===!0?" q-menu--dark q-dark":"")),ke=r.computed(()=>e.autoClose===!0?{onClick:Le}:{}),J=r.computed(()=>w.value===!0&&e.persistent!==!0);r.watch(J,s=>{s===!0?(Ce(K),at(O)):(j(K),ue(O))});function V(){he(()=>{let s=y.value;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}))})}function We(s){if(l=e.noRefocus===!1?document.activeElement:null,L.addFocusout(oe),X(),te(),m=void 0,s!==void 0&&(e.touchPosition||e.contextMenu)){const U=g.position(s);if(U.left!==void 0){const{top:Fe,left:$e}=E.value.getBoundingClientRect();m={left:U.left-$e,top:U.top-Fe}}}i===void 0&&(i=r.watch(()=>c.screen.width+"|"+c.screen.height+"|"+e.self+"|"+e.anchor+"|"+c.lang.rtl,$)),e.noFocus!==!0&&document.activeElement.blur(),H(()=>{$(),e.noFocus!==!0&&V()}),M(()=>{c.platform.is.ios===!0&&(a=e.autoClose,y.value.click()),$(),X(!0),o("show",s)},e.transitionDuration)}function qe(s){C(),Y(),ee(!0),l!==null&&(s===void 0||s.qClickOutside!==!0)&&((((s==null?void 0:s.type.indexOf("key"))===0?l.closest('[tabindex]:not([tabindex^="-"])'):void 0)||l).focus(),l=null),M(()=>{Y(!0),o("hide",s)},e.transitionDuration)}function ee(s){m=void 0,i!==void 0&&(i(),i=void 0),(s===!0||w.value===!0)&&(L.removeFocusout(oe),B(),ue(O),j(K)),s!==!0&&(l=null)}function te(){(E.value!==null||e.scrollTarget!==void 0)&&(S.value=et(E.value,e.scrollTarget),x(S.value,$))}function Le(s){a!==!0?(g.closePortalMenus(d,s),o("click",s)):a=!1}function oe(s){J.value===!0&&e.noFocus!==!0&&g.childHasFocus(y.value,s.target)!==!0&&V()}function K(s){e.noEscDismiss!==!0&&(o("escapeKey"),P(s))}function $(){Se({targetEl:y.value,offset:e.offset,anchorEl:E.value,anchorOrigin:Z.value,selfOrigin:He.value,absoluteOffset:m,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function Be(){return r.h(r.Transition,v.value,()=>w.value===!0?r.h("div",{role:"menu",...n,ref:y,tabindex:-1,class:["q-menu q-position-engine scroll"+Me.value,n.class],style:[n.style,p.value],...ke.value},g.hSlot(t.default)):null)}return r.onBeforeUnmount(ee),Object.assign(d,{focus:V,updatePosition:$}),Pe}});exports.QMenu=mt;exports.addEscapeKey=Ce;exports.addFocusFn=he;exports.getHorizontalScrollPosition=ot;exports.getVerticalScrollPosition=tt;exports.hasScrollbar=lt;exports.removeEscapeKey=j;exports.removeFocusFn=ze;exports.useId=Re;exports.useModelToggle=pe;exports.useModelToggleEmits=ge;exports.useModelToggleProps=ve;exports.usePortal=ye;exports.useTick=be;exports.useTimeout=Ee;exports.useTransition=xe;exports.useTransitionProps=we;
|
|
1
|
+
"use strict";const r=require("vue"),L=require("./focusout-DzWGke-4.cjs"),g=require("./index-BkdFu2Tl.cjs");let N,D=0;const b=new Array(256);for(let e=0;e<256;e++)b[e]=(e+256).toString(16).substring(1);const Ae=(()=>{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}})(),ne=4096;function _(){(N===void 0||D+16>ne)&&(D=0,N=Ae(ne));const e=Array.prototype.slice.call(N,D,D+=16);return e[6]=e[6]&15|64,e[8]=e[8]&63|128,b[e[0]]+b[e[1]]+b[e[2]]+b[e[3]]+"-"+b[e[4]]+b[e[5]]+"-"+b[e[6]]+b[e[7]]+"-"+b[e[8]]+b[e[9]]+"-"+b[e[10]]+b[e[11]]+b[e[12]]+b[e[13]]+b[e[14]]+b[e[15]]}function De(e){return e??null}function le(e,t){return e??(t===!0?`f_${_()}`:null)}function Re({getValue:e,required:t=!0}={}){if(L.isRuntimeSsrPreHydration.value===!0){const o=e!==void 0?r.ref(De(e())):r.ref(null);return t===!0&&o.value===null&&r.onMounted(()=>{o.value=`f_${_()}`}),e!==void 0&&r.watch(e,n=>{o.value=le(n,t)}),o}return e!==void 0?r.computed(()=>le(e(),t)):r.ref(`f_${_()}`)}let k=[],A=[];function me(e){A=A.filter(t=>t!==e)}function Ie(e){me(e),A.push(e)}function ie(e){me(e),A.length===0&&k.length!==0&&(k[k.length-1](),k=[])}function he(e){A.length===0?e():k.push(e)}function ze(e){k=k.filter(t=>t!==e)}function Oe(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),L.Platform.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const Ve={target:{type:[Boolean,String,Element],default:!0},noParentEvent:Boolean},Ke={...Ve,contextMenu:Boolean};function Ue({showing:e,avoidEmit:t,configureAnchorEl:o}){const{props:n,proxy:l,emit:m}=r.getCurrentInstance(),i=r.ref(null);let a=null;function h(u){return i.value===null?!1:u===void 0||u.touches===void 0||u.touches.length<=1}const d={};o===void 0&&(Object.assign(d,{hide(u){l.hide(u)},toggle(u){l.toggle(u),u.qAnchorHandled=!0},toggleKey(u){g.isKeyCode(u,13)===!0&&d.toggle(u)},contextClick(u){l.hide(u),g.prevent(u),r.nextTick(()=>{l.show(u),u.qAnchorHandled=!0})},prevent:g.prevent,mobileTouch(u){if(d.mobileCleanup(u),h(u)!==!0)return;l.hide(u),i.value.classList.add("non-selectable");const f=u.target;g.addEvt(d,"anchor",[[f,"touchmove","mobileCleanup","passive"],[f,"touchend","mobileCleanup","passive"],[f,"touchcancel","mobileCleanup","passive"],[i.value,"contextmenu","prevent","notPassive"]]),a=setTimeout(()=>{a=null,l.show(u),u.qAnchorHandled=!0},300)},mobileCleanup(u){i.value.classList.remove("non-selectable"),a!==null&&(clearTimeout(a),a=null),e.value===!0&&u!==void 0&&Oe()}}),o=function(u=n.contextMenu){if(n.noParentEvent===!0||i.value===null)return;let f;u===!0?l.$q.platform.is.mobile===!0?f=[[i.value,"touchstart","mobileTouch","passive"]]:f=[[i.value,"mousedown","hide","passive"],[i.value,"contextmenu","contextClick","notPassive"]]:f=[[i.value,"click","toggle","passive"],[i.value,"keyup","toggleKey","passive"]],g.addEvt(d,"anchor",f)});function c(){g.cleanEvt(d,"anchor")}function y(u){for(i.value=u;i.value.classList.contains("q-anchor--skip");)i.value=i.value.parentNode;o()}function w(){if(n.target===!1||n.target===""||l.$el.parentNode===null)i.value=null;else if(n.target===!0)y(l.$el.parentNode);else{let u=n.target;if(typeof n.target=="string")try{u=document.querySelector(n.target)}catch{u=void 0}u!=null?(i.value=u.$el||u,o()):(i.value=null,console.error(`Anchor: target "${n.target}" not found`))}}return r.watch(()=>n.contextMenu,u=>{i.value!==null&&(c(),o(u))}),r.watch(()=>n.target,()=>{i.value!==null&&c(),w()}),r.watch(()=>n.noParentEvent,u=>{i.value!==null&&(u===!0?c():o())}),r.onMounted(()=>{w(),t!==!0&&n.modelValue===!0&&i.value===null&&m("update:modelValue",!1)}),r.onBeforeUnmount(()=>{a!==null&&clearTimeout(a),c()}),{anchorEl:i,canShow:h,anchorEvents:d}}function Ne(e,t){const o=r.ref(null);let n;function l(a,h){const d=`${h!==void 0?"add":"remove"}EventListener`,c=h!==void 0?h:n;a!==window&&a[d]("scroll",c,g.listenOpts.passive),window[d]("scroll",c,g.listenOpts.passive),n=h}function m(){o.value!==null&&(l(o.value),o.value=null)}const i=r.watch(()=>e.noParentEvent,()=>{o.value!==null&&(m(),t())});return r.onBeforeUnmount(i),{localScrollTarget:o,unconfigureScrollTarget:m,changeScrollEvent:l}}const ve={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},ge=["beforeShow","show","beforeHide","hide"];function pe({showing:e,canShow:t,hideOnRouteChange:o,handleShow:n,handleHide:l,processOnMount:m}){const i=r.getCurrentInstance(),{props:a,emit:h,proxy:d}=i;let c;function y(v){e.value===!0?f(v):w(v)}function w(v){if(a.disable===!0||(v==null?void 0:v.qAnchorHandled)===!0||t!==void 0&&t(v)!==!0)return;const p=a["onUpdate:modelValue"]!==void 0;p===!0&&(h("update:modelValue",!0),c=v,r.nextTick(()=>{c===v&&(c=void 0)})),(a.modelValue===null||p===!1)&&u(v)}function u(v){e.value!==!0&&(e.value=!0,h("beforeShow",v),n!==void 0?n(v):h("show",v))}function f(v){if(a.disable===!0)return;const p=a["onUpdate:modelValue"]!==void 0;p===!0&&(h("update:modelValue",!1),c=v,r.nextTick(()=>{c===v&&(c=void 0)})),(a.modelValue===null||p===!1)&&H(v)}function H(v){e.value!==!1&&(e.value=!1,h("beforeHide",v),l!==void 0?l(v):h("hide",v))}function C(v){a.disable===!0&&v===!0?a["onUpdate:modelValue"]!==void 0&&h("update:modelValue",!1):v===!0!==e.value&&(v===!0?u:H)(c)}r.watch(()=>a.modelValue,C),o!==void 0&&g.vmHasRouter(i)===!0&&r.watch(()=>d.$route.fullPath,()=>{o.value===!0&&e.value===!0&&f()}),r.onMounted(()=>{C(a.modelValue)});const M={show:w,hide:f,toggle:y};return Object.assign(d,M),M}const re={};let Qe=1,_e=document.body;function je(e,t){const o=document.createElement("div");if(o.id=t!==void 0?`q-portal--${t}--${Qe++}`:e,re.globalNodes!==void 0){const n=re.globalNodes.class;n!==void 0&&(o.className=n)}return _e.appendChild(o),o}function Ge(e){e.remove()}const Xe=g.createComponent({name:"QPortal",setup(e,{slots:t}){return()=>t.default()}});function Ye(e){for(e=e.parent;e!=null;){if(e.type.name==="QGlobalDialog")return!0;if(e.type.name==="QDialog"||e.type.name==="QMenu")return!1;e=e.parent}return!1}function ye(e,t,o,n){const l=r.ref(!1),m=r.ref(!1);let i=null;const a={},h=n==="dialog"&&Ye(e);function d(y){if(y===!0){ie(a),m.value=!0;return}m.value=!1,l.value===!1&&(h===!1&&i===null&&(i=je(!1,n)),l.value=!0,g.portalProxyList.push(e.proxy),Ie(a))}function c(y){if(m.value=!1,y!==!0)return;ie(a),l.value=!1;const w=g.portalProxyList.indexOf(e.proxy);w!==-1&&g.portalProxyList.splice(w,1),i!==null&&(Ge(i),i=null)}return r.onUnmounted(()=>{c(!0)}),e.proxy.__qPortal=!0,L.injectProp(e.proxy,"contentEl",()=>t.value),{showPortal:d,hidePortal:c,portalIsActive:l,portalIsAccessible:m,renderPortal:()=>h===!0?o():l.value===!0?[r.h(r.Teleport,{to:i},r.h(Xe,o))]:void 0}}const we={transitionShow:{type:String,default:"fade"},transitionHide:{type:String,default:"fade"},transitionDuration:{type:[String,Number],default:300}};function xe(e,t=()=>{},o=()=>{}){return{transitionProps:r.computed(()=>{const n=`q-transition--${e.transitionShow||t()}`,l=`q-transition--${e.transitionHide||o()}`;return{appear:!0,enterFromClass:`${n}-enter-from`,enterActiveClass:`${n}-enter-active`,enterToClass:`${n}-enter-to`,leaveFromClass:`${l}-leave-from`,leaveActiveClass:`${l}-leave-active`,leaveToClass:`${l}-leave-to`}}),transitionStyle:r.computed(()=>`--q-transition-duration: ${e.transitionDuration}ms`)}}function be(){let e;const t=r.getCurrentInstance();function o(){e=void 0}return r.onDeactivated(o),r.onBeforeUnmount(o),{removeTick:o,registerTick(n){e=n,r.nextTick(()=>{e===n&&(g.vmIsDestroyed(t)===!1&&e(),e=void 0)})}}}function Ee(){let e=null;const t=r.getCurrentInstance();function o(){e!==null&&(clearTimeout(e),e=null)}return r.onDeactivated(o),r.onBeforeUnmount(o),{removeTimeout:o,registerTimeout(n,l){o(),g.vmIsDestroyed(t)===!1&&(e=setTimeout(()=>{e=null,n()},l))}}}const Ze=[Element,String],Je=[null,document,document.body,document.scrollingElement,document.documentElement];function et(e,t){let o=g.getElement(t);if(o===void 0){if(e==null)return window;o=e.closest(".scroll,.scroll-y,.overflow-auto")}return Je.includes(o)?window:o}function tt(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function ot(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}let R;function nt(){if(R!==void 0)return R;const e=document.createElement("p"),t=document.createElement("div");g.css(e,{width:"100%",height:"200px"}),g.css(t,{position:"absolute",top:"0px",left:"0px",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),t.appendChild(e),document.body.appendChild(t);const o=e.offsetWidth;t.style.overflow="scroll";let n=e.offsetWidth;return o===n&&(n=t.clientWidth),t.remove(),R=o-n,R}function lt(e,t=!0){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"]))}const W=[];let F;function it(e){F=e.keyCode===27}function rt(){F===!0&&(F=!1)}function ut(e){F===!0&&(F=!1,g.isKeyCode(e,27)===!0&&W[W.length-1](e))}function Te(e){window[e]("keydown",it),window[e]("blur",rt),window[e]("keyup",ut),F=!1}function Ce(e){L.client.is.desktop===!0&&(W.push(e),W.length===1&&Te("addEventListener"))}function j(e){const t=W.indexOf(e);t!==-1&&(W.splice(t,1),W.length===0&&Te("removeEventListener"))}const{notPassiveCapture:I}=g.listenOpts,q=[];function z(e){const t=e.target;if(t===void 0||t.nodeType===8||t.classList.contains("no-pointer-events")===!0)return;let o=g.portalProxyList.length-1;for(;o>=0;){const n=g.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=q.length-1;n>=0;n--){const l=q[n];if((l.anchorEl.value===null||l.anchorEl.value.contains(t)===!1)&&(t===document.body||l.innerRef.value!==null&&l.innerRef.value.contains(t)===!1))e.qClickOutside=!0,l.onClickOutside(e);else return}}function at(e){q.push(e),q.length===1&&(document.addEventListener("mousedown",z,I),document.addEventListener("touchstart",z,I))}function ue(e){const t=q.findIndex(o=>o===e);t!==-1&&(q.splice(t,1),q.length===0&&(document.removeEventListener("mousedown",z,I),document.removeEventListener("touchstart",z,I)))}let ae,se;function ce(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 st(e){return e?!(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number"):!0}const G={"start#ltr":"left","start#rtl":"right","end#ltr":"right","end#rtl":"left"};["left","middle","right"].forEach(e=>{G[`${e}#ltr`]=e,G[`${e}#rtl`]=e});function de(e,t){const o=e.split(" ");return{vertical:o[0],horizontal:G[`${o[1]}#${t===!0?"rtl":"ltr"}`]}}function ct(e,t){let{top:o,left:n,right:l,bottom:m,width:i,height:a}=e.getBoundingClientRect();return t!==void 0&&(o-=t[1],n-=t[0],m+=t[1],l+=t[0],i+=t[0],a+=t[1]),{top:o,bottom:m,height:a,left:n,right:l,width:i,middle:n+(l-n)/2,center:o+(m-o)/2}}function dt(e,t,o){let{top:n,left:l}=e.getBoundingClientRect();return n+=t.top,l+=t.left,o!==void 0&&(n+=o[1],l+=o[0]),{top:n,bottom:n+1,height:1,left:l,right:l+1,width:1,middle:l,center:n}}function ft(e,t){return{top:0,center:t/2,bottom:t,left:0,middle:e/2,right:e}}function fe(e,t,o,n){return{top:e[o.vertical]-t[n.vertical],left:e[o.horizontal]-t[n.horizontal]}}function Se(e,t=0){if(e.targetEl===null||e.anchorEl===null||t>5)return;if(e.targetEl.offsetHeight===0||e.targetEl.offsetWidth===0){setTimeout(()=>{Se(e,t+1)},10);return}const{targetEl:o,offset:n,anchorEl:l,anchorOrigin:m,selfOrigin:i,absoluteOffset:a,fit:h,cover:d,maxHeight:c,maxWidth:y}=e;if(L.client.is.ios===!0&&window.visualViewport!==void 0){const B=document.body.style,{offsetLeft:E,offsetTop:T}=window.visualViewport;E!==ae&&(B.setProperty("--q-pe-left",E+"px"),ae=E),T!==se&&(B.setProperty("--q-pe-top",T+"px"),se=T)}const{scrollLeft:w,scrollTop:u}=o,f=a===void 0?ct(l,d===!0?[0,0]:n):dt(l,a,n);Object.assign(o.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:y,maxHeight:c,visibility:"visible"});const{offsetWidth:H,offsetHeight:C}=o,{elWidth:M,elHeight:v}=h===!0||d===!0?{elWidth:Math.max(f.width,H),elHeight:d===!0?Math.max(f.height,C):C}:{elWidth:H,elHeight:C};let p={maxWidth:y,maxHeight:c};(h===!0||d===!0)&&(p.minWidth=f.width+"px",d===!0&&(p.minHeight=f.height+"px")),Object.assign(o.style,p);const S=ft(M,v);let x=fe(f,S,m,i);if(a===void 0||n===void 0)Q(x,f,S,m,i);else{const{top:B,left:E}=x;Q(x,f,S,m,i);let T=!1;if(x.top!==B){T=!0;const P=2*n[1];f.center=f.top-=P,f.bottom-=P+2}if(x.left!==E){T=!0;const P=2*n[0];f.middle=f.left-=P,f.right-=P+2}T===!0&&(x=fe(f,S,m,i),Q(x,f,S,m,i))}p={top:x.top+"px",left:x.left+"px"},x.maxHeight!==void 0&&(p.maxHeight=x.maxHeight+"px",f.height>x.maxHeight&&(p.minHeight=p.maxHeight)),x.maxWidth!==void 0&&(p.maxWidth=x.maxWidth+"px",f.width>x.maxWidth&&(p.minWidth=p.maxWidth)),Object.assign(o.style,p),o.scrollTop!==u&&(o.scrollTop=u),o.scrollLeft!==w&&(o.scrollLeft=w)}function Q(e,t,o,n,l){const m=o.bottom,i=o.right,a=nt(),h=window.innerHeight-a,d=document.body.clientWidth;if(e.top<0||e.top+m>h)if(l.vertical==="center")e.top=t[n.vertical]>h/2?Math.max(0,h-m):0,e.maxHeight=Math.min(m,h);else if(t[n.vertical]>h/2){const c=Math.min(h,n.vertical==="center"?t.center:n.vertical===l.vertical?t.bottom:t.top);e.maxHeight=Math.min(m,c),e.top=Math.max(0,c-m)}else e.top=Math.max(0,n.vertical==="center"?t.center:n.vertical===l.vertical?t.top:t.bottom),e.maxHeight=Math.min(m,h-e.top);if(e.left<0||e.left+i>d)if(e.maxWidth=Math.min(i,d),l.horizontal==="middle")e.left=t[n.horizontal]>d/2?Math.max(0,d-i):0;else if(t[n.horizontal]>d/2){const c=Math.min(d,n.horizontal==="middle"?t.middle:n.horizontal===l.horizontal?t.right:t.left);e.maxWidth=Math.min(i,c),e.left=Math.max(0,c-e.maxWidth)}else e.left=Math.max(0,n.horizontal==="middle"?t.middle:n.horizontal===l.horizontal?t.left:t.right),e.maxWidth=Math.min(i,d-e.left)}const mt=g.createComponent({name:"QMenu",inheritAttrs:!1,props:{...Ke,...ve,...g.useDarkProps,...we,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:ce},self:{type:String,validator:ce},offset:{type:Array,validator:st},scrollTarget:Ze,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...ge,"click","escapeKey"],setup(e,{slots:t,emit:o,attrs:n}){let l=null,m,i,a;const h=r.getCurrentInstance(),{proxy:d}=h,{$q:c}=d,y=r.ref(null),w=r.ref(!1),u=r.computed(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),f=g.useDark(e,c),{registerTick:H,removeTick:C}=be(),{registerTimeout:M}=Ee(),{transitionProps:v,transitionStyle:p}=xe(e),{localScrollTarget:S,changeScrollEvent:x,unconfigureScrollTarget:B}=Ne(e,te),{anchorEl:E,canShow:T}=Ue({showing:w}),{hide:P}=pe({showing:w,canShow:T,handleShow:We,handleHide:qe,hideOnRouteChange:u,processOnMount:!0}),{showPortal:X,hidePortal:Y,renderPortal:Pe}=ye(h,y,Be,"menu"),O={anchorEl:E,innerRef:y,onClickOutside(s){if(e.persistent!==!0&&w.value===!0)return P(s),(s.type==="touchstart"||s.target.classList.contains("q-dialog__backdrop"))&&g.stopAndPrevent(s),!0}},Z=r.computed(()=>de(e.anchor||(e.cover===!0?"center middle":"bottom start"),c.lang.rtl)),He=r.computed(()=>e.cover===!0?Z.value:de(e.self||"top start",c.lang.rtl)),Me=r.computed(()=>(e.square===!0?" q-menu--square":"")+(f.value===!0?" q-menu--dark q-dark":"")),ke=r.computed(()=>e.autoClose===!0?{onClick:Le}:{}),J=r.computed(()=>w.value===!0&&e.persistent!==!0);r.watch(J,s=>{s===!0?(Ce(K),at(O)):(j(K),ue(O))});function V(){he(()=>{let s=y.value;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}))})}function We(s){if(l=e.noRefocus===!1?document.activeElement:null,L.addFocusout(oe),X(),te(),m=void 0,s!==void 0&&(e.touchPosition||e.contextMenu)){const U=g.position(s);if(U.left!==void 0){const{top:Fe,left:$e}=E.value.getBoundingClientRect();m={left:U.left-$e,top:U.top-Fe}}}i===void 0&&(i=r.watch(()=>c.screen.width+"|"+c.screen.height+"|"+e.self+"|"+e.anchor+"|"+c.lang.rtl,$)),e.noFocus!==!0&&document.activeElement.blur(),H(()=>{$(),e.noFocus!==!0&&V()}),M(()=>{c.platform.is.ios===!0&&(a=e.autoClose,y.value.click()),$(),X(!0),o("show",s)},e.transitionDuration)}function qe(s){C(),Y(),ee(!0),l!==null&&(s===void 0||s.qClickOutside!==!0)&&((((s==null?void 0:s.type.indexOf("key"))===0?l.closest('[tabindex]:not([tabindex^="-"])'):void 0)||l).focus(),l=null),M(()=>{Y(!0),o("hide",s)},e.transitionDuration)}function ee(s){m=void 0,i!==void 0&&(i(),i=void 0),(s===!0||w.value===!0)&&(L.removeFocusout(oe),B(),ue(O),j(K)),s!==!0&&(l=null)}function te(){(E.value!==null||e.scrollTarget!==void 0)&&(S.value=et(E.value,e.scrollTarget),x(S.value,$))}function Le(s){a!==!0?(g.closePortalMenus(d,s),o("click",s)):a=!1}function oe(s){J.value===!0&&e.noFocus!==!0&&g.childHasFocus(y.value,s.target)!==!0&&V()}function K(s){e.noEscDismiss!==!0&&(o("escapeKey"),P(s))}function $(){Se({targetEl:y.value,offset:e.offset,anchorEl:E.value,anchorOrigin:Z.value,selfOrigin:He.value,absoluteOffset:m,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function Be(){return r.h(r.Transition,v.value,()=>w.value===!0?r.h("div",{role:"menu",...n,ref:y,tabindex:-1,class:["q-menu q-position-engine scroll"+Me.value,n.class],style:[n.style,p.value],...ke.value},g.hSlot(t.default)):null)}return r.onBeforeUnmount(ee),Object.assign(d,{focus:V,updatePosition:$}),Pe}});exports.QMenu=mt;exports.addEscapeKey=Ce;exports.addFocusFn=he;exports.getHorizontalScrollPosition=ot;exports.getVerticalScrollPosition=tt;exports.hasScrollbar=lt;exports.removeEscapeKey=j;exports.removeFocusFn=ze;exports.useId=Re;exports.useModelToggle=pe;exports.useModelToggleEmits=ge;exports.useModelToggleProps=ve;exports.usePortal=ye;exports.useTick=be;exports.useTimeout=Ee;exports.useTransition=xe;exports.useTransitionProps=we;
|