@validol4ik/uikit 0.7.0 → 0.7.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-BAsaHaa4.js → AppButtonCopy-Dj46pNGB.js} +1 -1
- package/dist/{AppButtonCopy-Dyb9GEq2.cjs → AppButtonCopy-DnqF8jZQ.cjs} +1 -1
- package/dist/AppSelect-B3eGqxF7.cjs +1 -0
- package/dist/{AppSelect-WIENN4a-.js → AppSelect-ztwsDF-p.js} +756 -752
- package/dist/{DropdownButton-DUUK14vz.js → DropdownButton-BE2k1gTw.js} +88 -89
- package/dist/DropdownButton-DpTSg2fU.cjs +1 -0
- package/dist/{QMenu-CFrDqWMF.js → QMenu-CrcmhT0u.js} +1 -1
- package/dist/{QMenu-DtmHqodr.cjs → QMenu-DNRkchme.cjs} +1 -1
- package/dist/{index-CheOtzui.js → index-BV2qSN9C.js} +160 -162
- package/dist/index-DXwv6jwP.cjs +1 -0
- package/dist/kl.woff +0 -0
- package/dist/style.css +1 -1
- package/dist/types/components/buttons/AppButton/types.d.ts +1 -0
- package/dist/types/components/buttons/DropdownButton/types.d.ts +1 -0
- package/dist/types/components/constants.d.ts +3 -0
- package/dist/types/components/form/AppSelect/AppSelect.vue.d.ts +4 -0
- package/dist/types/components/types.d.ts +1 -1
- package/dist/types/index.d.ts +6 -2
- package/dist/types/types/types.d.ts +1 -0
- package/dist/uikit.cjs +1 -1
- package/dist/uikit.es.js +8 -8
- package/package.json +7 -1
- package/dist/AppSelect-5p3euh6R.cjs +0 -1
- package/dist/DropdownButton-BL00UPY1.cjs +0 -1
- package/dist/index-d12F-Rqz.cjs +0 -1
- /package/dist/types/{components/AppIcon/quasarBoot.d.ts → bootFiles/iconSet.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getCurrentInstance as L, computed as
|
|
2
|
-
import { c as q, a as W, b as
|
|
3
|
-
import { d as
|
|
1
|
+
import { getCurrentInstance as L, computed as u, h as i, ref as D, watch as M, onMounted as z, defineComponent as _, createBlock as E, openBlock as m, unref as h, normalizeClass as w, withCtx as v, createVNode as j, renderSlot as F, createElementBlock as p, createCommentVNode as S, Fragment as G, createTextVNode as N, toDisplayString as T } from "vue";
|
|
2
|
+
import { c as q, a as W, b as x, h as k, S as c, w as $, x as U, Q as X, y, v as Y, C as Z, _ as J } from "./index-BV2qSN9C.js";
|
|
3
|
+
import { d as K, u as ee, Q as ne } from "./QMenu-CrcmhT0u.js";
|
|
4
4
|
const oe = ["ul", "ol"], te = q({
|
|
5
5
|
name: "QList",
|
|
6
6
|
props: {
|
|
@@ -15,17 +15,18 @@ const oe = ["ul", "ol"], te = q({
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
setup(e, { slots: l }) {
|
|
18
|
-
const
|
|
18
|
+
const t = L(), s = x(e, t.proxy.$q), a = u(
|
|
19
19
|
() => oe.includes(e.tag) ? null : "list"
|
|
20
|
-
), d =
|
|
20
|
+
), d = u(
|
|
21
21
|
() => "q-list" + (e.bordered === !0 ? " q-list--bordered" : "") + (e.dense === !0 ? " q-list--dense" : "") + (e.separator === !0 ? " q-list--separator" : "") + (s.value === !0 ? " q-list--dark" : "") + (e.padding === !0 ? " q-list--padding" : "")
|
|
22
22
|
);
|
|
23
23
|
return () => i(e.tag, { class: d.value, role: a.value }, k(l.default));
|
|
24
24
|
}
|
|
25
25
|
}), ae = {
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
26
|
+
[c.SM]: "3px 9px",
|
|
27
|
+
[c.MD]: "5px 12px",
|
|
28
|
+
[c.LG]: "6px 15px",
|
|
29
|
+
[c.XL]: "9px 20px"
|
|
29
30
|
}, le = q({
|
|
30
31
|
name: "QBtnGroup",
|
|
31
32
|
props: {
|
|
@@ -40,24 +41,24 @@ const oe = ["ul", "ol"], te = q({
|
|
|
40
41
|
spread: Boolean
|
|
41
42
|
},
|
|
42
43
|
setup(e, { slots: l }) {
|
|
43
|
-
const
|
|
44
|
+
const t = u(() => {
|
|
44
45
|
const s = ["unelevated", "outline", "flat", "rounded", "square", "push", "stretch", "glossy"].filter((a) => e[a] === !0).map((a) => `q-btn-group--${a}`).join(" ");
|
|
45
46
|
return `q-btn-group row no-wrap${s.length !== 0 ? " " + s : ""}` + (e.spread === !0 ? " q-btn-group--spread" : " inline");
|
|
46
47
|
});
|
|
47
|
-
return () => i("div", { class:
|
|
48
|
+
return () => i("div", { class: t.value }, k(l.default));
|
|
48
49
|
}
|
|
49
|
-
}), se = Object.keys(
|
|
50
|
+
}), se = Object.keys($);
|
|
50
51
|
function re(e) {
|
|
51
|
-
return se.reduce((l,
|
|
52
|
-
const s = e[
|
|
53
|
-
return s !== void 0 && (l[
|
|
52
|
+
return se.reduce((l, t) => {
|
|
53
|
+
const s = e[t];
|
|
54
|
+
return s !== void 0 && (l[t] = s), l;
|
|
54
55
|
}, {});
|
|
55
56
|
}
|
|
56
57
|
const de = q({
|
|
57
58
|
name: "QBtnDropdown",
|
|
58
59
|
props: {
|
|
59
|
-
|
|
60
|
-
...
|
|
60
|
+
...$,
|
|
61
|
+
...K,
|
|
61
62
|
modelValue: Boolean,
|
|
62
63
|
split: Boolean,
|
|
63
64
|
dropdownIcon: String,
|
|
@@ -85,66 +86,66 @@ const de = q({
|
|
|
85
86
|
toggleAriaLabel: String
|
|
86
87
|
},
|
|
87
88
|
emits: ["update:modelValue", "click", "beforeShow", "show", "beforeHide", "hide"],
|
|
88
|
-
setup(e, { slots: l, emit:
|
|
89
|
-
const { proxy: s } = L(), a = D(e.modelValue), d = D(null), f = ee(), b =
|
|
90
|
-
const
|
|
89
|
+
setup(e, { slots: l, emit: t }) {
|
|
90
|
+
const { proxy: s } = L(), a = D(e.modelValue), d = D(null), f = ee(), b = u(() => {
|
|
91
|
+
const n = {
|
|
91
92
|
"aria-expanded": a.value === !0 ? "true" : "false",
|
|
92
93
|
"aria-haspopup": "true",
|
|
93
94
|
"aria-controls": f.value,
|
|
94
95
|
"aria-label": e.toggleAriaLabel || s.$q.lang.label[a.value === !0 ? "collapse" : "expand"](e.label)
|
|
95
96
|
};
|
|
96
|
-
return (e.disable === !0 || e.split === !1 && e.disableMainBtn === !0 || e.disableDropdown === !0) && (
|
|
97
|
-
}),
|
|
97
|
+
return (e.disable === !0 || e.split === !1 && e.disableMainBtn === !0 || e.disableDropdown === !0) && (n["aria-disabled"] = "true"), n;
|
|
98
|
+
}), o = u(
|
|
98
99
|
() => "q-btn-dropdown__arrow" + (a.value === !0 && e.noIconAnimation === !1 ? " rotate-180" : "") + (e.split === !1 ? " q-btn-dropdown__arrow-container" : "")
|
|
99
|
-
),
|
|
100
|
-
|
|
100
|
+
), B = u(() => U(e)), C = u(() => re(e));
|
|
101
|
+
M(() => e.modelValue, (n) => {
|
|
101
102
|
var r;
|
|
102
|
-
(r = d.value) == null || r[
|
|
103
|
-
}),
|
|
104
|
-
function
|
|
105
|
-
a.value = !0,
|
|
103
|
+
(r = d.value) == null || r[n ? "show" : "hide"]();
|
|
104
|
+
}), M(() => e.split, g);
|
|
105
|
+
function I(n) {
|
|
106
|
+
a.value = !0, t("beforeShow", n);
|
|
106
107
|
}
|
|
107
|
-
function Q(
|
|
108
|
-
|
|
108
|
+
function Q(n) {
|
|
109
|
+
t("show", n), t("update:modelValue", !0);
|
|
109
110
|
}
|
|
110
|
-
function R(
|
|
111
|
-
a.value = !1,
|
|
111
|
+
function R(n) {
|
|
112
|
+
a.value = !1, t("beforeHide", n);
|
|
112
113
|
}
|
|
113
|
-
function H(
|
|
114
|
-
|
|
114
|
+
function H(n) {
|
|
115
|
+
t("hide", n), t("update:modelValue", !1);
|
|
115
116
|
}
|
|
116
|
-
function O(
|
|
117
|
-
|
|
117
|
+
function O(n) {
|
|
118
|
+
t("click", n);
|
|
118
119
|
}
|
|
119
|
-
function V(
|
|
120
|
-
|
|
120
|
+
function V(n) {
|
|
121
|
+
Y(n), g(), t("click", n);
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
+
function P(n) {
|
|
123
124
|
var r;
|
|
124
|
-
(r = d.value) == null || r.toggle(
|
|
125
|
+
(r = d.value) == null || r.toggle(n);
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function A(n) {
|
|
127
128
|
var r;
|
|
128
|
-
(r = d.value) == null || r.show(
|
|
129
|
+
(r = d.value) == null || r.show(n);
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
+
function g(n) {
|
|
131
132
|
var r;
|
|
132
|
-
(r = d.value) == null || r.hide(
|
|
133
|
+
(r = d.value) == null || r.hide(n);
|
|
133
134
|
}
|
|
134
135
|
return Object.assign(s, {
|
|
135
|
-
show:
|
|
136
|
-
hide:
|
|
137
|
-
toggle:
|
|
138
|
-
}),
|
|
139
|
-
e.modelValue === !0 &&
|
|
136
|
+
show: A,
|
|
137
|
+
hide: g,
|
|
138
|
+
toggle: P
|
|
139
|
+
}), z(() => {
|
|
140
|
+
e.modelValue === !0 && A();
|
|
140
141
|
}), () => {
|
|
141
|
-
const
|
|
142
|
-
i(
|
|
143
|
-
class:
|
|
142
|
+
const n = [
|
|
143
|
+
i(X, {
|
|
144
|
+
class: o.value,
|
|
144
145
|
name: e.dropdownIcon || s.$q.iconSet.arrow.dropdown
|
|
145
146
|
})
|
|
146
147
|
];
|
|
147
|
-
return e.disableDropdown !== !0 &&
|
|
148
|
+
return e.disableDropdown !== !0 && n.push(
|
|
148
149
|
i(ne, {
|
|
149
150
|
ref: d,
|
|
150
151
|
id: f.value,
|
|
@@ -165,7 +166,7 @@ const de = q({
|
|
|
165
166
|
transitionShow: e.transitionShow,
|
|
166
167
|
transitionHide: e.transitionHide,
|
|
167
168
|
transitionDuration: e.transitionDuration,
|
|
168
|
-
onBeforeShow:
|
|
169
|
+
onBeforeShow: I,
|
|
169
170
|
onShow: Q,
|
|
170
171
|
onBeforeHide: R,
|
|
171
172
|
onHide: H
|
|
@@ -179,13 +180,13 @@ const de = q({
|
|
|
179
180
|
round: !1,
|
|
180
181
|
onClick: O
|
|
181
182
|
}, {
|
|
182
|
-
default: () => k(l.label, []).concat(
|
|
183
|
+
default: () => k(l.label, []).concat(n),
|
|
183
184
|
loading: l.loading
|
|
184
185
|
}) : i(le, {
|
|
185
186
|
class: "q-btn-dropdown q-btn-dropdown--split no-wrap q-btn-item",
|
|
186
187
|
rounded: e.rounded,
|
|
187
188
|
square: e.square,
|
|
188
|
-
...
|
|
189
|
+
...B.value,
|
|
189
190
|
glossy: e.glossy,
|
|
190
191
|
stretch: e.stretch
|
|
191
192
|
}, () => [
|
|
@@ -203,7 +204,7 @@ const de = q({
|
|
|
203
204
|
i(y, {
|
|
204
205
|
class: "q-btn-dropdown__arrow-container q-anchor--skip",
|
|
205
206
|
...b.value,
|
|
206
|
-
...
|
|
207
|
+
...B.value,
|
|
207
208
|
disable: e.disable === !0 || e.disableDropdown === !0,
|
|
208
209
|
rounded: e.rounded,
|
|
209
210
|
color: e.color,
|
|
@@ -212,18 +213,18 @@ const de = q({
|
|
|
212
213
|
size: e.size,
|
|
213
214
|
padding: e.padding,
|
|
214
215
|
ripple: e.ripple
|
|
215
|
-
}, () =>
|
|
216
|
+
}, () => n)
|
|
216
217
|
]);
|
|
217
218
|
};
|
|
218
219
|
}
|
|
219
220
|
}), ie = /* @__PURE__ */ _({
|
|
220
221
|
__name: "DropdownButton",
|
|
221
222
|
props: {
|
|
222
|
-
size: { default:
|
|
223
|
+
size: { default: c.MD },
|
|
223
224
|
transparent: { type: Boolean },
|
|
224
225
|
flat: { type: Boolean },
|
|
225
226
|
rounded: { type: Boolean },
|
|
226
|
-
color: { default:
|
|
227
|
+
color: { default: Z.PRIMARY },
|
|
227
228
|
iconLeft: {},
|
|
228
229
|
iconMiddle: {},
|
|
229
230
|
hideDropIcon: { type: Boolean },
|
|
@@ -238,68 +239,66 @@ const de = q({
|
|
|
238
239
|
},
|
|
239
240
|
emits: ["menuShown", "menuHidden"],
|
|
240
241
|
setup(e, { emit: l }) {
|
|
241
|
-
const
|
|
242
|
+
const t = e, s = l, a = D(!1), d = u(() => [
|
|
242
243
|
"dropdown-btn",
|
|
243
244
|
{
|
|
244
|
-
"dropdown-btn_default": !
|
|
245
|
-
"dropdown-btn_trans":
|
|
246
|
-
"dropdown-btn_flat":
|
|
247
|
-
"dropdown-btn_rounded":
|
|
248
|
-
"dropdown-
|
|
249
|
-
"dropdown-
|
|
250
|
-
"dropdown-btn_lg": n.size === u.LG,
|
|
251
|
-
"dropdown-btn_icon-left": n.iconLeft,
|
|
252
|
-
"dropdown-btn_icon-middle": n.iconMiddle
|
|
245
|
+
"dropdown-btn_default": !t.transparent && !t.flat,
|
|
246
|
+
"dropdown-btn_trans": t.transparent,
|
|
247
|
+
"dropdown-btn_flat": t.flat,
|
|
248
|
+
"dropdown-btn_rounded": t.rounded,
|
|
249
|
+
"dropdown-btn_icon-left": t.iconLeft,
|
|
250
|
+
"dropdown-btn_icon-middle": t.iconMiddle
|
|
253
251
|
},
|
|
254
|
-
`dropdown-btn_${
|
|
252
|
+
`dropdown-btn_${t.size}`,
|
|
253
|
+
`dropdown-btn_${t.color}`
|
|
255
254
|
]), f = () => {
|
|
256
255
|
a.value = !0, s("menuShown");
|
|
257
256
|
}, b = () => {
|
|
258
257
|
a.value = !1, s("menuHidden");
|
|
259
258
|
};
|
|
260
|
-
return (
|
|
259
|
+
return (o, B) => (m(), E(h(de), {
|
|
261
260
|
"no-caps": "",
|
|
262
261
|
unelevated: "",
|
|
263
262
|
class: w(d.value),
|
|
264
|
-
padding: h(ae)[
|
|
265
|
-
loading:
|
|
266
|
-
disable:
|
|
267
|
-
"aria-label":
|
|
268
|
-
"menu-offset":
|
|
269
|
-
"menu-anchor":
|
|
270
|
-
"menu-self":
|
|
263
|
+
padding: h(ae)[o.size || h(c).MD],
|
|
264
|
+
loading: o.loading,
|
|
265
|
+
disable: o.disabled || void 0,
|
|
266
|
+
"aria-label": o.ariaLabel,
|
|
267
|
+
"menu-offset": o.menuOffset,
|
|
268
|
+
"menu-anchor": o.menuAnchor,
|
|
269
|
+
"menu-self": o.menuSelf,
|
|
271
270
|
onBeforeShow: f,
|
|
272
271
|
onBeforeHide: b
|
|
273
272
|
}, {
|
|
274
273
|
label: v(() => [
|
|
275
|
-
|
|
274
|
+
o.iconLeft || o.iconMiddle ? (m(), p("i", {
|
|
276
275
|
key: 0,
|
|
277
276
|
class: w([
|
|
278
277
|
"icon-kl",
|
|
279
|
-
|
|
280
|
-
`icon-kl-${
|
|
281
|
-
|
|
278
|
+
o.iconLeft ? "icon-kl_left" : "icon-kl_middle",
|
|
279
|
+
`icon-kl-${o.iconLeft || o.iconMiddle}`,
|
|
280
|
+
o.transparent || o.flat ? `text-${o.color}` : "text-secondary"
|
|
282
281
|
])
|
|
283
282
|
}, null, 2)) : S("", !0),
|
|
284
|
-
|
|
285
|
-
N(T(
|
|
283
|
+
o.label ? (m(), p(G, { key: 1 }, [
|
|
284
|
+
N(T(o.label), 1)
|
|
286
285
|
], 64)) : S("", !0),
|
|
287
|
-
|
|
286
|
+
o.hideDropIcon ? S("", !0) : (m(), p("i", {
|
|
288
287
|
key: 2,
|
|
289
288
|
class: w([
|
|
290
289
|
"icon-kl",
|
|
291
290
|
"icon-kl-arrow-down",
|
|
292
291
|
{ "icon-kl-arrow-down_rotated": a.value },
|
|
293
|
-
|
|
292
|
+
o.transparent ? `text-${o.color}` : "text-secondary"
|
|
294
293
|
])
|
|
295
294
|
}, null, 2))
|
|
296
295
|
]),
|
|
297
296
|
default: v(() => [
|
|
298
297
|
j(te, {
|
|
299
|
-
class: w(["dropdown-btn-menu", `dropdown-btn-menu_${
|
|
298
|
+
class: w(["dropdown-btn-menu", `dropdown-btn-menu_${o.size} ${o.menuClass ? o.menuClass : ""}`])
|
|
300
299
|
}, {
|
|
301
300
|
default: v(() => [
|
|
302
|
-
F(
|
|
301
|
+
F(o.$slots, "default", {}, void 0, !0)
|
|
303
302
|
]),
|
|
304
303
|
_: 3
|
|
305
304
|
}, 8, ["class"])
|
|
@@ -307,7 +306,7 @@ const de = q({
|
|
|
307
306
|
_: 3
|
|
308
307
|
}, 8, ["class", "padding", "loading", "disable", "aria-label", "menu-offset", "menu-anchor", "menu-self"]));
|
|
309
308
|
}
|
|
310
|
-
}), be = /* @__PURE__ */
|
|
309
|
+
}), be = /* @__PURE__ */ J(ie, [["__scopeId", "data-v-4019f157"]]);
|
|
311
310
|
export {
|
|
312
311
|
be as default
|
|
313
312
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),l=require("./index-DXwv6jwP.cjs"),w=require("./QMenu-DNRkchme.cjs"),y=["ul","ol"],D=l.createComponent({name:"QList",props:{...l.useDarkProps,bordered:Boolean,dense:Boolean,separator:Boolean,padding:Boolean,tag:{type:String,default:"div"}},setup(e,{slots:d}){const a=n.getCurrentInstance(),s=l.useDark(e,a.proxy.$q),r=n.computed(()=>y.includes(e.tag)?null:"list"),i=n.computed(()=>"q-list"+(e.bordered===!0?" q-list--bordered":"")+(e.dense===!0?" q-list--dense":"")+(e.separator===!0?" q-list--separator":"")+(s.value===!0?" q-list--dark":"")+(e.padding===!0?" q-list--padding":""));return()=>n.h(e.tag,{class:i.value,role:r.value},l.hSlot(d.default))}}),M={[l.SIZES.SM]:"3px 9px",[l.SIZES.MD]:"5px 12px",[l.SIZES.LG]:"6px 15px",[l.SIZES.XL]:"9px 20px"},I=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:d}){const a=n.computed(()=>{const s=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(r=>e[r]===!0).map(r=>`q-btn-group--${r}`).join(" ");return`q-btn-group row no-wrap${s.length!==0?" "+s:""}`+(e.spread===!0?" q-btn-group--spread":" inline")});return()=>n.h("div",{class:a.value},l.hSlot(d.default))}}),A=Object.keys(l.nonRoundBtnProps);function L(e){return A.reduce((d,a)=>{const s=e[a];return s!==void 0&&(d[a]=s),d},{})}const E=l.createComponent({name:"QBtnDropdown",props:{...l.nonRoundBtnProps,...w.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:d,emit:a}){const{proxy:s}=n.getCurrentInstance(),r=n.ref(e.modelValue),i=n.ref(null),c=w.useId(),f=n.computed(()=>{const o={"aria-expanded":r.value===!0?"true":"false","aria-haspopup":"true","aria-controls":c.value,"aria-label":e.toggleAriaLabel||s.$q.lang.label[r.value===!0?"collapse":"expand"](e.label)};return(e.disable===!0||e.split===!1&&e.disableMainBtn===!0||e.disableDropdown===!0)&&(o["aria-disabled"]="true"),o}),t=n.computed(()=>"q-btn-dropdown__arrow"+(r.value===!0&&e.noIconAnimation===!1?" rotate-180":"")+(e.split===!1?" q-btn-dropdown__arrow-container":"")),m=n.computed(()=>l.getBtnDesignAttr(e)),B=n.computed(()=>L(e));n.watch(()=>e.modelValue,o=>{var u;(u=i.value)==null||u[o?"show":"hide"]()}),n.watch(()=>e.split,b);function g(o){r.value=!0,a("beforeShow",o)}function p(o){a("show",o),a("update:modelValue",!0)}function S(o){r.value=!1,a("beforeHide",o)}function v(o){a("hide",o),a("update:modelValue",!1)}function C(o){a("click",o)}function k(o){l.stop(o),b(),a("click",o)}function q(o){var u;(u=i.value)==null||u.toggle(o)}function h(o){var u;(u=i.value)==null||u.show(o)}function b(o){var u;(u=i.value)==null||u.hide(o)}return Object.assign(s,{show:h,hide:b,toggle:q}),n.onMounted(()=>{e.modelValue===!0&&h()}),()=>{const o=[n.h(l.QIcon,{class:t.value,name:e.dropdownIcon||s.$q.iconSet.arrow.dropdown})];return e.disableDropdown!==!0&&o.push(n.h(w.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},d.default)),e.split===!1?n.h(l.QBtn,{class:"q-btn-dropdown q-btn-dropdown--simple",...B.value,...f.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:C},{default:()=>l.hSlot(d.label,[]).concat(o),loading:d.loading}):n.h(I,{class:"q-btn-dropdown q-btn-dropdown--split no-wrap q-btn-item",rounded:e.rounded,square:e.square,...m.value,glossy:e.glossy,stretch:e.stretch},()=>[n.h(l.QBtn,{class:"q-btn-dropdown--current",...B.value,disable:e.disable===!0||e.disableMainBtn===!0,noWrap:!0,round:!1,onClick:k},{default:d.label,loading:d.loading}),n.h(l.QBtn,{class:"q-btn-dropdown__arrow-container q-anchor--skip",...f.value,...m.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)])}}}),$=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:{},menuClass:{},menuOffset:{},menuAnchor:{},menuSelf:{}},emits:["menuShown","menuHidden"],setup(e,{emit:d}){const a=e,s=d,r=n.ref(!1),i=n.computed(()=>["dropdown-btn",{"dropdown-btn_default":!a.transparent&&!a.flat,"dropdown-btn_trans":a.transparent,"dropdown-btn_flat":a.flat,"dropdown-btn_rounded":a.rounded,"dropdown-btn_icon-left":a.iconLeft,"dropdown-btn_icon-middle":a.iconMiddle},`dropdown-btn_${a.size}`,`dropdown-btn_${a.color}`]),c=()=>{r.value=!0,s("menuShown")},f=()=>{r.value=!1,s("menuHidden")};return(t,m)=>(n.openBlock(),n.createBlock(n.unref(E),{"no-caps":"",unelevated:"",class:n.normalizeClass(i.value),padding:n.unref(M)[t.size||n.unref(l.SIZES).MD],loading:t.loading,disable:t.disabled||void 0,"aria-label":t.ariaLabel,"menu-offset":t.menuOffset,"menu-anchor":t.menuAnchor,"menu-self":t.menuSelf,onBeforeShow:c,onBeforeHide:f},{label:n.withCtx(()=>[t.iconLeft||t.iconMiddle?(n.openBlock(),n.createElementBlock("i",{key:0,class:n.normalizeClass(["icon-kl",t.iconLeft?"icon-kl_left":"icon-kl_middle",`icon-kl-${t.iconLeft||t.iconMiddle}`,t.transparent||t.flat?`text-${t.color}`:"text-secondary"])},null,2)):n.createCommentVNode("",!0),t.label?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(t.label),1)],64)):n.createCommentVNode("",!0),t.hideDropIcon?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("i",{key:2,class:n.normalizeClass(["icon-kl","icon-kl-arrow-down",{"icon-kl-arrow-down_rotated":r.value},t.transparent?`text-${t.color}`:"text-secondary"])},null,2))]),default:n.withCtx(()=>[n.createVNode(D,{class:n.normalizeClass(["dropdown-btn-menu",`dropdown-btn-menu_${t.size} ${t.menuClass?t.menuClass:""}`])},{default:n.withCtx(()=>[n.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3},8,["class"])]),_:3},8,["class","padding","loading","disable","aria-label","menu-offset","menu-anchor","menu-self"]))}}),Q=l._export_sfc($,[["__scopeId","data-v-4019f157"]]);exports.default=Q;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as T, onMounted as oe, watch as S, computed as E, getCurrentInstance as R, nextTick as I, onBeforeUnmount as z, onUnmounted as Ie, h as Q, Teleport as Qe, onDeactivated as Se, Transition as _e } from "vue";
|
|
2
2
|
import { i as Ne, P as Ke, b as je, c as Ce, r as Ue, a as Ge } from "./focusout-DjvPXP_b.js";
|
|
3
|
-
import { p as ce, z as de, i as Pe, B as Xe, n as J, D as Ye, E as X, c as He, F as ke, G as Ze, H as fe, a as Je, b as et, I as tt, h as ot, q as nt, s as lt } from "./index-
|
|
3
|
+
import { p as ce, z as de, i as Pe, B as Xe, n as J, D as Ye, E as X, c as He, F as ke, G as Ze, H as fe, a as Je, b as et, I as tt, h as ot, q as nt, s as lt } from "./index-BV2qSN9C.js";
|
|
4
4
|
let Y, V = 0;
|
|
5
5
|
const y = new Array(256);
|
|
6
6
|
for (let e = 0; e < 256; e++)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("vue"),B=require("./focusout-DzWGke-4.cjs"),g=require("./index-d12F-Rqz.cjs");let _,R=0;const b=new Array(256);for(let e=0;e<256;e++)b[e]=(e+256).toString(16).substring(1);const De=(()=>{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}})(),le=4096;function j(){(_===void 0||R+16>le)&&(R=0,_=De(le));const e=Array.prototype.slice.call(_,R,R+=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 Re(e){return e??null}function ie(e,t){return e??(t===!0?`f_${j()}`:null)}function Ie({getValue:e,required:t=!0}={}){if(B.isRuntimeSsrPreHydration.value===!0){const o=e!==void 0?u.ref(Re(e())):u.ref(null);return t===!0&&o.value===null&&u.onMounted(()=>{o.value=`f_${j()}`}),e!==void 0&&u.watch(e,n=>{o.value=ie(n,t)}),o}return e!==void 0?u.computed(()=>ie(e(),t)):u.ref(`f_${j()}`)}let k=[],D=[];function he(e){D=D.filter(t=>t!==e)}function ze(e){he(e),D.push(e)}function ue(e){he(e),D.length===0&&k.length!==0&&(k[k.length-1](),k=[])}function ve(e){D.length===0?e():k.push(e)}function Oe(e){k=k.filter(t=>t!==e)}function Ve(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),B.Platform.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const Ke={target:{type:[Boolean,String,Element],default:!0},noParentEvent:Boolean},Qe={...Ke,contextMenu:Boolean};function Ue({showing:e,avoidEmit:t,configureAnchorEl:o}){const{props:n,proxy:l,emit:m}=u.getCurrentInstance(),i=u.ref(null);let a=null;function h(r){return i.value===null?!1:r===void 0||r.touches===void 0||r.touches.length<=1}const d={};o===void 0&&(Object.assign(d,{hide(r){l.hide(r)},toggle(r){l.toggle(r),r.qAnchorHandled=!0},toggleKey(r){g.isKeyCode(r,13)===!0&&d.toggle(r)},contextClick(r){l.hide(r),g.prevent(r),u.nextTick(()=>{l.show(r),r.qAnchorHandled=!0})},prevent:g.prevent,mobileTouch(r){if(d.mobileCleanup(r),h(r)!==!0)return;l.hide(r),i.value.classList.add("non-selectable");const f=r.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(r),r.qAnchorHandled=!0},300)},mobileCleanup(r){i.value.classList.remove("non-selectable"),a!==null&&(clearTimeout(a),a=null),e.value===!0&&r!==void 0&&Ve()}}),o=function(r=n.contextMenu){if(n.noParentEvent===!0||i.value===null)return;let f;r===!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 w(r){for(i.value=r;i.value.classList.contains("q-anchor--skip");)i.value=i.value.parentNode;o()}function y(){if(n.target===!1||n.target===""||l.$el.parentNode===null)i.value=null;else if(n.target===!0)w(l.$el.parentNode);else{let r=n.target;if(typeof n.target=="string")try{r=document.querySelector(n.target)}catch{r=void 0}r!=null?(i.value=r.$el||r,o()):(i.value=null,console.error(`Anchor: target "${n.target}" not found`))}}return u.watch(()=>n.contextMenu,r=>{i.value!==null&&(c(),o(r))}),u.watch(()=>n.target,()=>{i.value!==null&&c(),y()}),u.watch(()=>n.noParentEvent,r=>{i.value!==null&&(r===!0?c():o())}),u.onMounted(()=>{y(),t!==!0&&n.modelValue===!0&&i.value===null&&m("update:modelValue",!1)}),u.onBeforeUnmount(()=>{a!==null&&clearTimeout(a),c()}),{anchorEl:i,canShow:h,anchorEvents:d}}function _e(e,t){const o=u.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=u.watch(()=>e.noParentEvent,()=>{o.value!==null&&(m(),t())});return u.onBeforeUnmount(i),{localScrollTarget:o,unconfigureScrollTarget:m,changeScrollEvent:l}}const ge={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},pe=["beforeShow","show","beforeHide","hide"];function we({showing:e,canShow:t,hideOnRouteChange:o,handleShow:n,handleHide:l,processOnMount:m}){const i=u.getCurrentInstance(),{props:a,emit:h,proxy:d}=i;let c;function w(v){e.value===!0?f(v):y(v)}function y(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,u.nextTick(()=>{c===v&&(c=void 0)})),(a.modelValue===null||p===!1)&&r(v)}function r(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,u.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?r:H)(c)}u.watch(()=>a.modelValue,C),o!==void 0&&g.vmHasRouter(i)===!0&&u.watch(()=>d.$route.fullPath,()=>{o.value===!0&&e.value===!0&&f()}),u.onMounted(()=>{C(a.modelValue)});const M={show:y,hide:f,toggle:w};return Object.assign(d,M),M}const re={};let Ne=1,je=document.body;function Ge(e,t){const o=document.createElement("div");if(o.id=t!==void 0?`q-portal--${t}--${Ne++}`:e,re.globalNodes!==void 0){const n=re.globalNodes.class;n!==void 0&&(o.className=n)}return je.appendChild(o),o}function Xe(e){e.remove()}const A=[];function Ye(e,t){do{if(e.$options.name==="QMenu"){if(e.hide(t),e.$props.separateClosePopup===!0)return g.getParentProxy(e)}else if(e.__qPortal===!0){const o=g.getParentProxy(e);return(o==null?void 0:o.$options.name)==="QPopupProxy"?(e.hide(t),o):e}e=g.getParentProxy(e)}while(e!=null)}const Ze=g.createComponent({name:"QPortal",setup(e,{slots:t}){return()=>t.default()}});function Je(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=u.ref(!1),m=u.ref(!1);let i=null;const a={},h=n==="dialog"&&Je(e);function d(w){if(w===!0){ue(a),m.value=!0;return}m.value=!1,l.value===!1&&(h===!1&&i===null&&(i=Ge(!1,n)),l.value=!0,A.push(e.proxy),ze(a))}function c(w){if(m.value=!1,w!==!0)return;ue(a),l.value=!1;const y=A.indexOf(e.proxy);y!==-1&&A.splice(y,1),i!==null&&(Xe(i),i=null)}return u.onUnmounted(()=>{c(!0)}),e.proxy.__qPortal=!0,B.injectProp(e.proxy,"contentEl",()=>t.value),{showPortal:d,hidePortal:c,portalIsActive:l,portalIsAccessible:m,renderPortal:()=>h===!0?o():l.value===!0?[u.h(u.Teleport,{to:i},u.h(Ze,o))]:void 0}}const xe={transitionShow:{type:String,default:"fade"},transitionHide:{type:String,default:"fade"},transitionDuration:{type:[String,Number],default:300}};function be(e,t=()=>{},o=()=>{}){return{transitionProps:u.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:u.computed(()=>`--q-transition-duration: ${e.transitionDuration}ms`)}}function Ee(){let e;const t=u.getCurrentInstance();function o(){e=void 0}return u.onDeactivated(o),u.onBeforeUnmount(o),{removeTick:o,registerTick(n){e=n,u.nextTick(()=>{e===n&&(g.vmIsDestroyed(t)===!1&&e(),e=void 0)})}}}function Te(){let e=null;const t=u.getCurrentInstance();function o(){e!==null&&(clearTimeout(e),e=null)}return u.onDeactivated(o),u.onBeforeUnmount(o),{removeTimeout:o,registerTimeout(n,l){o(),g.vmIsDestroyed(t)===!1&&(e=setTimeout(()=>{e=null,n()},l))}}}const et=[Element,String],tt=[null,document,document.body,document.scrollingElement,document.documentElement];function ot(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 tt.includes(o)?window:o}function nt(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function lt(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}let I;function it(){if(I!==void 0)return I;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(),I=o-n,I}function ut(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 $;function rt(e){$=e.keyCode===27}function at(){$===!0&&($=!1)}function st(e){$===!0&&($=!1,g.isKeyCode(e,27)===!0&&W[W.length-1](e))}function Ce(e){window[e]("keydown",rt),window[e]("blur",at),window[e]("keyup",st),$=!1}function Pe(e){B.client.is.desktop===!0&&(W.push(e),W.length===1&&Ce("addEventListener"))}function G(e){const t=W.indexOf(e);t!==-1&&(W.splice(t,1),W.length===0&&Ce("removeEventListener"))}const{notPassiveCapture:z}=g.listenOpts,q=[];function O(e){const t=e.target;if(t===void 0||t.nodeType===8||t.classList.contains("no-pointer-events")===!0)return;let o=A.length-1;for(;o>=0;){const n=A[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 ct(e){q.push(e),q.length===1&&(document.addEventListener("mousedown",O,z),document.addEventListener("touchstart",O,z))}function ae(e){const t=q.findIndex(o=>o===e);t!==-1&&(q.splice(t,1),q.length===0&&(document.removeEventListener("mousedown",O,z),document.removeEventListener("touchstart",O,z)))}let se,ce;function de(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 dt(e){return e?!(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number"):!0}const X={"start#ltr":"left","start#rtl":"right","end#ltr":"right","end#rtl":"left"};["left","middle","right"].forEach(e=>{X[`${e}#ltr`]=e,X[`${e}#rtl`]=e});function fe(e,t){const o=e.split(" ");return{vertical:o[0],horizontal:X[`${o[1]}#${t===!0?"rtl":"ltr"}`]}}function ft(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 mt(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 ht(e,t){return{top:0,center:t/2,bottom:t,left:0,middle:e/2,right:e}}function me(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:w}=e;if(B.client.is.ios===!0&&window.visualViewport!==void 0){const F=document.body.style,{offsetLeft:E,offsetTop:T}=window.visualViewport;E!==se&&(F.setProperty("--q-pe-left",E+"px"),se=E),T!==ce&&(F.setProperty("--q-pe-top",T+"px"),ce=T)}const{scrollLeft:y,scrollTop:r}=o,f=a===void 0?ft(l,d===!0?[0,0]:n):mt(l,a,n);Object.assign(o.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:w,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:w,maxHeight:c};(h===!0||d===!0)&&(p.minWidth=f.width+"px",d===!0&&(p.minHeight=f.height+"px")),Object.assign(o.style,p);const P=ht(M,v);let x=me(f,P,m,i);if(a===void 0||n===void 0)N(x,f,P,m,i);else{const{top:F,left:E}=x;N(x,f,P,m,i);let T=!1;if(x.top!==F){T=!0;const S=2*n[1];f.center=f.top-=S,f.bottom-=S+2}if(x.left!==E){T=!0;const S=2*n[0];f.middle=f.left-=S,f.right-=S+2}T===!0&&(x=me(f,P,m,i),N(x,f,P,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!==r&&(o.scrollTop=r),o.scrollLeft!==y&&(o.scrollLeft=y)}function N(e,t,o,n,l){const m=o.bottom,i=o.right,a=it(),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 vt=g.createComponent({name:"QMenu",inheritAttrs:!1,props:{...Qe,...ge,...g.useDarkProps,...xe,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:de},self:{type:String,validator:de},offset:{type:Array,validator:dt},scrollTarget:et,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...pe,"click","escapeKey"],setup(e,{slots:t,emit:o,attrs:n}){let l=null,m,i,a;const h=u.getCurrentInstance(),{proxy:d}=h,{$q:c}=d,w=u.ref(null),y=u.ref(!1),r=u.computed(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),f=g.useDark(e,c),{registerTick:H,removeTick:C}=Ee(),{registerTimeout:M}=Te(),{transitionProps:v,transitionStyle:p}=be(e),{localScrollTarget:P,changeScrollEvent:x,unconfigureScrollTarget:F}=_e(e,oe),{anchorEl:E,canShow:T}=Ue({showing:y}),{hide:S}=we({showing:y,canShow:T,handleShow:qe,handleHide:Be,hideOnRouteChange:r,processOnMount:!0}),{showPortal:Y,hidePortal:Z,renderPortal:He}=ye(h,w,$e,"menu"),V={anchorEl:E,innerRef:w,onClickOutside(s){if(e.persistent!==!0&&y.value===!0)return S(s),(s.type==="touchstart"||s.target.classList.contains("q-dialog__backdrop"))&&g.stopAndPrevent(s),!0}},J=u.computed(()=>fe(e.anchor||(e.cover===!0?"center middle":"bottom start"),c.lang.rtl)),Me=u.computed(()=>e.cover===!0?J.value:fe(e.self||"top start",c.lang.rtl)),ke=u.computed(()=>(e.square===!0?" q-menu--square":"")+(f.value===!0?" q-menu--dark q-dark":"")),We=u.computed(()=>e.autoClose===!0?{onClick:Fe}:{}),ee=u.computed(()=>y.value===!0&&e.persistent!==!0);u.watch(ee,s=>{s===!0?(Pe(Q),ct(V)):(G(Q),ae(V))});function K(){ve(()=>{let s=w.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 qe(s){if(l=e.noRefocus===!1?document.activeElement:null,B.addFocusout(ne),Y(),oe(),m=void 0,s!==void 0&&(e.touchPosition||e.contextMenu)){const U=g.position(s);if(U.left!==void 0){const{top:Le,left:Ae}=E.value.getBoundingClientRect();m={left:U.left-Ae,top:U.top-Le}}}i===void 0&&(i=u.watch(()=>c.screen.width+"|"+c.screen.height+"|"+e.self+"|"+e.anchor+"|"+c.lang.rtl,L)),e.noFocus!==!0&&document.activeElement.blur(),H(()=>{L(),e.noFocus!==!0&&K()}),M(()=>{c.platform.is.ios===!0&&(a=e.autoClose,w.value.click()),L(),Y(!0),o("show",s)},e.transitionDuration)}function Be(s){C(),Z(),te(!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(()=>{Z(!0),o("hide",s)},e.transitionDuration)}function te(s){m=void 0,i!==void 0&&(i(),i=void 0),(s===!0||y.value===!0)&&(B.removeFocusout(ne),F(),ae(V),G(Q)),s!==!0&&(l=null)}function oe(){(E.value!==null||e.scrollTarget!==void 0)&&(P.value=ot(E.value,e.scrollTarget),x(P.value,L))}function Fe(s){a!==!0?(Ye(d,s),o("click",s)):a=!1}function ne(s){ee.value===!0&&e.noFocus!==!0&&g.childHasFocus(w.value,s.target)!==!0&&K()}function Q(s){e.noEscDismiss!==!0&&(o("escapeKey"),S(s))}function L(){Se({targetEl:w.value,offset:e.offset,anchorEl:E.value,anchorOrigin:J.value,selfOrigin:Me.value,absoluteOffset:m,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function $e(){return u.h(u.Transition,v.value,()=>y.value===!0?u.h("div",{role:"menu",...n,ref:w,tabindex:-1,class:["q-menu q-position-engine scroll"+ke.value,n.class],style:[n.style,p.value],...We.value},g.hSlot(t.default)):null)}return u.onBeforeUnmount(te),Object.assign(d,{focus:K,updatePosition:L}),He}});exports.QMenu=vt;exports.addEscapeKey=Pe;exports.addFocusFn=ve;exports.getHorizontalScrollPosition=lt;exports.getVerticalScrollPosition=nt;exports.hasScrollbar=ut;exports.removeEscapeKey=G;exports.removeFocusFn=Oe;exports.useId=Ie;exports.useModelToggle=we;exports.useModelToggleEmits=pe;exports.useModelToggleProps=ge;exports.usePortal=ye;exports.useTick=Ee;exports.useTimeout=Te;exports.useTransition=be;exports.useTransitionProps=xe;
|
|
1
|
+
"use strict";const u=require("vue"),B=require("./focusout-DzWGke-4.cjs"),g=require("./index-DXwv6jwP.cjs");let _,R=0;const b=new Array(256);for(let e=0;e<256;e++)b[e]=(e+256).toString(16).substring(1);const De=(()=>{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}})(),le=4096;function j(){(_===void 0||R+16>le)&&(R=0,_=De(le));const e=Array.prototype.slice.call(_,R,R+=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 Re(e){return e??null}function ie(e,t){return e??(t===!0?`f_${j()}`:null)}function Ie({getValue:e,required:t=!0}={}){if(B.isRuntimeSsrPreHydration.value===!0){const o=e!==void 0?u.ref(Re(e())):u.ref(null);return t===!0&&o.value===null&&u.onMounted(()=>{o.value=`f_${j()}`}),e!==void 0&&u.watch(e,n=>{o.value=ie(n,t)}),o}return e!==void 0?u.computed(()=>ie(e(),t)):u.ref(`f_${j()}`)}let k=[],D=[];function he(e){D=D.filter(t=>t!==e)}function ze(e){he(e),D.push(e)}function ue(e){he(e),D.length===0&&k.length!==0&&(k[k.length-1](),k=[])}function ve(e){D.length===0?e():k.push(e)}function Oe(e){k=k.filter(t=>t!==e)}function Ve(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),B.Platform.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const Ke={target:{type:[Boolean,String,Element],default:!0},noParentEvent:Boolean},Qe={...Ke,contextMenu:Boolean};function Ue({showing:e,avoidEmit:t,configureAnchorEl:o}){const{props:n,proxy:l,emit:m}=u.getCurrentInstance(),i=u.ref(null);let a=null;function h(r){return i.value===null?!1:r===void 0||r.touches===void 0||r.touches.length<=1}const d={};o===void 0&&(Object.assign(d,{hide(r){l.hide(r)},toggle(r){l.toggle(r),r.qAnchorHandled=!0},toggleKey(r){g.isKeyCode(r,13)===!0&&d.toggle(r)},contextClick(r){l.hide(r),g.prevent(r),u.nextTick(()=>{l.show(r),r.qAnchorHandled=!0})},prevent:g.prevent,mobileTouch(r){if(d.mobileCleanup(r),h(r)!==!0)return;l.hide(r),i.value.classList.add("non-selectable");const f=r.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(r),r.qAnchorHandled=!0},300)},mobileCleanup(r){i.value.classList.remove("non-selectable"),a!==null&&(clearTimeout(a),a=null),e.value===!0&&r!==void 0&&Ve()}}),o=function(r=n.contextMenu){if(n.noParentEvent===!0||i.value===null)return;let f;r===!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 w(r){for(i.value=r;i.value.classList.contains("q-anchor--skip");)i.value=i.value.parentNode;o()}function y(){if(n.target===!1||n.target===""||l.$el.parentNode===null)i.value=null;else if(n.target===!0)w(l.$el.parentNode);else{let r=n.target;if(typeof n.target=="string")try{r=document.querySelector(n.target)}catch{r=void 0}r!=null?(i.value=r.$el||r,o()):(i.value=null,console.error(`Anchor: target "${n.target}" not found`))}}return u.watch(()=>n.contextMenu,r=>{i.value!==null&&(c(),o(r))}),u.watch(()=>n.target,()=>{i.value!==null&&c(),y()}),u.watch(()=>n.noParentEvent,r=>{i.value!==null&&(r===!0?c():o())}),u.onMounted(()=>{y(),t!==!0&&n.modelValue===!0&&i.value===null&&m("update:modelValue",!1)}),u.onBeforeUnmount(()=>{a!==null&&clearTimeout(a),c()}),{anchorEl:i,canShow:h,anchorEvents:d}}function _e(e,t){const o=u.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=u.watch(()=>e.noParentEvent,()=>{o.value!==null&&(m(),t())});return u.onBeforeUnmount(i),{localScrollTarget:o,unconfigureScrollTarget:m,changeScrollEvent:l}}const ge={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},pe=["beforeShow","show","beforeHide","hide"];function we({showing:e,canShow:t,hideOnRouteChange:o,handleShow:n,handleHide:l,processOnMount:m}){const i=u.getCurrentInstance(),{props:a,emit:h,proxy:d}=i;let c;function w(v){e.value===!0?f(v):y(v)}function y(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,u.nextTick(()=>{c===v&&(c=void 0)})),(a.modelValue===null||p===!1)&&r(v)}function r(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,u.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?r:H)(c)}u.watch(()=>a.modelValue,C),o!==void 0&&g.vmHasRouter(i)===!0&&u.watch(()=>d.$route.fullPath,()=>{o.value===!0&&e.value===!0&&f()}),u.onMounted(()=>{C(a.modelValue)});const M={show:y,hide:f,toggle:w};return Object.assign(d,M),M}const re={};let Ne=1,je=document.body;function Ge(e,t){const o=document.createElement("div");if(o.id=t!==void 0?`q-portal--${t}--${Ne++}`:e,re.globalNodes!==void 0){const n=re.globalNodes.class;n!==void 0&&(o.className=n)}return je.appendChild(o),o}function Xe(e){e.remove()}const A=[];function Ye(e,t){do{if(e.$options.name==="QMenu"){if(e.hide(t),e.$props.separateClosePopup===!0)return g.getParentProxy(e)}else if(e.__qPortal===!0){const o=g.getParentProxy(e);return(o==null?void 0:o.$options.name)==="QPopupProxy"?(e.hide(t),o):e}e=g.getParentProxy(e)}while(e!=null)}const Ze=g.createComponent({name:"QPortal",setup(e,{slots:t}){return()=>t.default()}});function Je(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=u.ref(!1),m=u.ref(!1);let i=null;const a={},h=n==="dialog"&&Je(e);function d(w){if(w===!0){ue(a),m.value=!0;return}m.value=!1,l.value===!1&&(h===!1&&i===null&&(i=Ge(!1,n)),l.value=!0,A.push(e.proxy),ze(a))}function c(w){if(m.value=!1,w!==!0)return;ue(a),l.value=!1;const y=A.indexOf(e.proxy);y!==-1&&A.splice(y,1),i!==null&&(Xe(i),i=null)}return u.onUnmounted(()=>{c(!0)}),e.proxy.__qPortal=!0,B.injectProp(e.proxy,"contentEl",()=>t.value),{showPortal:d,hidePortal:c,portalIsActive:l,portalIsAccessible:m,renderPortal:()=>h===!0?o():l.value===!0?[u.h(u.Teleport,{to:i},u.h(Ze,o))]:void 0}}const xe={transitionShow:{type:String,default:"fade"},transitionHide:{type:String,default:"fade"},transitionDuration:{type:[String,Number],default:300}};function be(e,t=()=>{},o=()=>{}){return{transitionProps:u.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:u.computed(()=>`--q-transition-duration: ${e.transitionDuration}ms`)}}function Ee(){let e;const t=u.getCurrentInstance();function o(){e=void 0}return u.onDeactivated(o),u.onBeforeUnmount(o),{removeTick:o,registerTick(n){e=n,u.nextTick(()=>{e===n&&(g.vmIsDestroyed(t)===!1&&e(),e=void 0)})}}}function Te(){let e=null;const t=u.getCurrentInstance();function o(){e!==null&&(clearTimeout(e),e=null)}return u.onDeactivated(o),u.onBeforeUnmount(o),{removeTimeout:o,registerTimeout(n,l){o(),g.vmIsDestroyed(t)===!1&&(e=setTimeout(()=>{e=null,n()},l))}}}const et=[Element,String],tt=[null,document,document.body,document.scrollingElement,document.documentElement];function ot(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 tt.includes(o)?window:o}function nt(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function lt(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}let I;function it(){if(I!==void 0)return I;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(),I=o-n,I}function ut(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 $;function rt(e){$=e.keyCode===27}function at(){$===!0&&($=!1)}function st(e){$===!0&&($=!1,g.isKeyCode(e,27)===!0&&W[W.length-1](e))}function Ce(e){window[e]("keydown",rt),window[e]("blur",at),window[e]("keyup",st),$=!1}function Pe(e){B.client.is.desktop===!0&&(W.push(e),W.length===1&&Ce("addEventListener"))}function G(e){const t=W.indexOf(e);t!==-1&&(W.splice(t,1),W.length===0&&Ce("removeEventListener"))}const{notPassiveCapture:z}=g.listenOpts,q=[];function O(e){const t=e.target;if(t===void 0||t.nodeType===8||t.classList.contains("no-pointer-events")===!0)return;let o=A.length-1;for(;o>=0;){const n=A[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 ct(e){q.push(e),q.length===1&&(document.addEventListener("mousedown",O,z),document.addEventListener("touchstart",O,z))}function ae(e){const t=q.findIndex(o=>o===e);t!==-1&&(q.splice(t,1),q.length===0&&(document.removeEventListener("mousedown",O,z),document.removeEventListener("touchstart",O,z)))}let se,ce;function de(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 dt(e){return e?!(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number"):!0}const X={"start#ltr":"left","start#rtl":"right","end#ltr":"right","end#rtl":"left"};["left","middle","right"].forEach(e=>{X[`${e}#ltr`]=e,X[`${e}#rtl`]=e});function fe(e,t){const o=e.split(" ");return{vertical:o[0],horizontal:X[`${o[1]}#${t===!0?"rtl":"ltr"}`]}}function ft(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 mt(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 ht(e,t){return{top:0,center:t/2,bottom:t,left:0,middle:e/2,right:e}}function me(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:w}=e;if(B.client.is.ios===!0&&window.visualViewport!==void 0){const F=document.body.style,{offsetLeft:E,offsetTop:T}=window.visualViewport;E!==se&&(F.setProperty("--q-pe-left",E+"px"),se=E),T!==ce&&(F.setProperty("--q-pe-top",T+"px"),ce=T)}const{scrollLeft:y,scrollTop:r}=o,f=a===void 0?ft(l,d===!0?[0,0]:n):mt(l,a,n);Object.assign(o.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:w,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:w,maxHeight:c};(h===!0||d===!0)&&(p.minWidth=f.width+"px",d===!0&&(p.minHeight=f.height+"px")),Object.assign(o.style,p);const P=ht(M,v);let x=me(f,P,m,i);if(a===void 0||n===void 0)N(x,f,P,m,i);else{const{top:F,left:E}=x;N(x,f,P,m,i);let T=!1;if(x.top!==F){T=!0;const S=2*n[1];f.center=f.top-=S,f.bottom-=S+2}if(x.left!==E){T=!0;const S=2*n[0];f.middle=f.left-=S,f.right-=S+2}T===!0&&(x=me(f,P,m,i),N(x,f,P,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!==r&&(o.scrollTop=r),o.scrollLeft!==y&&(o.scrollLeft=y)}function N(e,t,o,n,l){const m=o.bottom,i=o.right,a=it(),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 vt=g.createComponent({name:"QMenu",inheritAttrs:!1,props:{...Qe,...ge,...g.useDarkProps,...xe,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:de},self:{type:String,validator:de},offset:{type:Array,validator:dt},scrollTarget:et,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...pe,"click","escapeKey"],setup(e,{slots:t,emit:o,attrs:n}){let l=null,m,i,a;const h=u.getCurrentInstance(),{proxy:d}=h,{$q:c}=d,w=u.ref(null),y=u.ref(!1),r=u.computed(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),f=g.useDark(e,c),{registerTick:H,removeTick:C}=Ee(),{registerTimeout:M}=Te(),{transitionProps:v,transitionStyle:p}=be(e),{localScrollTarget:P,changeScrollEvent:x,unconfigureScrollTarget:F}=_e(e,oe),{anchorEl:E,canShow:T}=Ue({showing:y}),{hide:S}=we({showing:y,canShow:T,handleShow:qe,handleHide:Be,hideOnRouteChange:r,processOnMount:!0}),{showPortal:Y,hidePortal:Z,renderPortal:He}=ye(h,w,$e,"menu"),V={anchorEl:E,innerRef:w,onClickOutside(s){if(e.persistent!==!0&&y.value===!0)return S(s),(s.type==="touchstart"||s.target.classList.contains("q-dialog__backdrop"))&&g.stopAndPrevent(s),!0}},J=u.computed(()=>fe(e.anchor||(e.cover===!0?"center middle":"bottom start"),c.lang.rtl)),Me=u.computed(()=>e.cover===!0?J.value:fe(e.self||"top start",c.lang.rtl)),ke=u.computed(()=>(e.square===!0?" q-menu--square":"")+(f.value===!0?" q-menu--dark q-dark":"")),We=u.computed(()=>e.autoClose===!0?{onClick:Fe}:{}),ee=u.computed(()=>y.value===!0&&e.persistent!==!0);u.watch(ee,s=>{s===!0?(Pe(Q),ct(V)):(G(Q),ae(V))});function K(){ve(()=>{let s=w.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 qe(s){if(l=e.noRefocus===!1?document.activeElement:null,B.addFocusout(ne),Y(),oe(),m=void 0,s!==void 0&&(e.touchPosition||e.contextMenu)){const U=g.position(s);if(U.left!==void 0){const{top:Le,left:Ae}=E.value.getBoundingClientRect();m={left:U.left-Ae,top:U.top-Le}}}i===void 0&&(i=u.watch(()=>c.screen.width+"|"+c.screen.height+"|"+e.self+"|"+e.anchor+"|"+c.lang.rtl,L)),e.noFocus!==!0&&document.activeElement.blur(),H(()=>{L(),e.noFocus!==!0&&K()}),M(()=>{c.platform.is.ios===!0&&(a=e.autoClose,w.value.click()),L(),Y(!0),o("show",s)},e.transitionDuration)}function Be(s){C(),Z(),te(!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(()=>{Z(!0),o("hide",s)},e.transitionDuration)}function te(s){m=void 0,i!==void 0&&(i(),i=void 0),(s===!0||y.value===!0)&&(B.removeFocusout(ne),F(),ae(V),G(Q)),s!==!0&&(l=null)}function oe(){(E.value!==null||e.scrollTarget!==void 0)&&(P.value=ot(E.value,e.scrollTarget),x(P.value,L))}function Fe(s){a!==!0?(Ye(d,s),o("click",s)):a=!1}function ne(s){ee.value===!0&&e.noFocus!==!0&&g.childHasFocus(w.value,s.target)!==!0&&K()}function Q(s){e.noEscDismiss!==!0&&(o("escapeKey"),S(s))}function L(){Se({targetEl:w.value,offset:e.offset,anchorEl:E.value,anchorOrigin:J.value,selfOrigin:Me.value,absoluteOffset:m,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function $e(){return u.h(u.Transition,v.value,()=>y.value===!0?u.h("div",{role:"menu",...n,ref:w,tabindex:-1,class:["q-menu q-position-engine scroll"+ke.value,n.class],style:[n.style,p.value],...We.value},g.hSlot(t.default)):null)}return u.onBeforeUnmount(te),Object.assign(d,{focus:K,updatePosition:L}),He}});exports.QMenu=vt;exports.addEscapeKey=Pe;exports.addFocusFn=ve;exports.getHorizontalScrollPosition=lt;exports.getVerticalScrollPosition=nt;exports.hasScrollbar=ut;exports.removeEscapeKey=G;exports.removeFocusFn=Oe;exports.useId=Ie;exports.useModelToggle=we;exports.useModelToggleEmits=pe;exports.useModelToggleProps=ge;exports.usePortal=ye;exports.useTick=Ee;exports.useTimeout=Te;exports.useTransition=be;exports.useTransitionProps=xe;
|