@validol4ik/uikit 0.3.43 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,298 @@
1
+ import { getCurrentInstance as A, computed as u, h as d, ref as p, watch as C, onMounted as H, defineComponent as R, openBlock as c, createBlock as j, unref as m, normalizeClass as f, withCtx as w, createVNode as _, renderSlot as G, createElementBlock as g, createCommentVNode as B, Fragment as E, createTextVNode as N, toDisplayString as T } from "vue";
2
+ import { c as h, h as S, S as s, t as W, v as M, Q as F, w as v, q as U, C as Y, _ as Z } from "./index-qz3EnjN5.js";
3
+ import { u as J, a as K, b as X, Q as x, n as ee } from "./QMenu-DukNjdn3.js";
4
+ const ne = ["ul", "ol"], oe = h({
5
+ name: "QList",
6
+ props: {
7
+ ...K,
8
+ bordered: Boolean,
9
+ dense: Boolean,
10
+ separator: Boolean,
11
+ padding: Boolean,
12
+ tag: {
13
+ type: String,
14
+ default: "div"
15
+ }
16
+ },
17
+ setup(e, { slots: t }) {
18
+ const a = A(), r = J(e, a.proxy.$q), n = u(
19
+ () => ne.includes(e.tag) ? null : "list"
20
+ ), l = u(
21
+ () => "q-list" + (e.bordered === !0 ? " q-list--bordered" : "") + (e.dense === !0 ? " q-list--dense" : "") + (e.separator === !0 ? " q-list--separator" : "") + (r.value === !0 ? " q-list--dark" : "") + (e.padding === !0 ? " q-list--padding" : "")
22
+ );
23
+ return () => d(e.tag, { class: l.value, role: n.value }, S(t.default));
24
+ }
25
+ }), te = {
26
+ [s.SM]: "3px 9px",
27
+ [s.MD]: "5px 12px",
28
+ [s.LG]: "9px 20px"
29
+ }, ae = h({
30
+ name: "QBtnGroup",
31
+ props: {
32
+ unelevated: Boolean,
33
+ outline: Boolean,
34
+ flat: Boolean,
35
+ rounded: Boolean,
36
+ square: Boolean,
37
+ push: Boolean,
38
+ stretch: Boolean,
39
+ glossy: Boolean,
40
+ spread: Boolean
41
+ },
42
+ setup(e, { slots: t }) {
43
+ const a = u(() => {
44
+ const r = ["unelevated", "outline", "flat", "rounded", "square", "push", "stretch", "glossy"].filter((n) => e[n] === !0).map((n) => `q-btn-group--${n}`).join(" ");
45
+ return `q-btn-group row no-wrap${r.length !== 0 ? " " + r : ""}` + (e.spread === !0 ? " q-btn-group--spread" : " inline");
46
+ });
47
+ return () => d("div", { class: a.value }, S(t.default));
48
+ }
49
+ }), le = Object.keys(M);
50
+ function re(e) {
51
+ return le.reduce((t, a) => {
52
+ const r = e[a];
53
+ return r !== void 0 && (t[a] = r), t;
54
+ }, {});
55
+ }
56
+ const de = h({
57
+ name: "QBtnDropdown",
58
+ props: {
59
+ ...M,
60
+ ...ee,
61
+ modelValue: Boolean,
62
+ split: Boolean,
63
+ dropdownIcon: String,
64
+ contentClass: [Array, String, Object],
65
+ contentStyle: [Array, String, Object],
66
+ cover: Boolean,
67
+ persistent: Boolean,
68
+ noRouteDismiss: Boolean,
69
+ autoClose: Boolean,
70
+ menuAnchor: {
71
+ type: String,
72
+ default: "bottom end"
73
+ },
74
+ menuSelf: {
75
+ type: String,
76
+ default: "top end"
77
+ },
78
+ menuOffset: Array,
79
+ disableMainBtn: Boolean,
80
+ disableDropdown: Boolean,
81
+ noIconAnimation: Boolean,
82
+ toggleAriaLabel: String
83
+ },
84
+ emits: ["update:modelValue", "click", "beforeShow", "show", "beforeHide", "hide"],
85
+ setup(e, { slots: t, emit: a }) {
86
+ const { proxy: r } = A(), n = p(e.modelValue), l = p(null), i = X(), q = u(() => {
87
+ const o = {
88
+ "aria-expanded": n.value === !0 ? "true" : "false",
89
+ "aria-haspopup": "true",
90
+ "aria-controls": i.value,
91
+ "aria-label": e.toggleAriaLabel || r.$q.lang.label[n.value === !0 ? "collapse" : "expand"](e.label)
92
+ };
93
+ return (e.disable === !0 || e.split === !1 && e.disableMainBtn === !0 || e.disableDropdown === !0) && (o["aria-disabled"] = "true"), o;
94
+ }), L = u(
95
+ () => "q-btn-dropdown__arrow" + (n.value === !0 && e.noIconAnimation === !1 ? " rotate-180" : "") + (e.split === !1 ? " q-btn-dropdown__arrow-container" : "")
96
+ ), y = u(() => W(e)), D = u(() => re(e));
97
+ C(() => e.modelValue, (o) => {
98
+ l.value !== null && l.value[o ? "show" : "hide"]();
99
+ }), C(() => e.split, b);
100
+ function $(o) {
101
+ n.value = !0, a("beforeShow", o);
102
+ }
103
+ function I(o) {
104
+ a("show", o), a("update:modelValue", !0);
105
+ }
106
+ function Q(o) {
107
+ n.value = !1, a("beforeHide", o);
108
+ }
109
+ function O(o) {
110
+ a("hide", o), a("update:modelValue", !1);
111
+ }
112
+ function V(o) {
113
+ a("click", o);
114
+ }
115
+ function z(o) {
116
+ U(o), b(), a("click", o);
117
+ }
118
+ function P(o) {
119
+ l.value !== null && l.value.toggle(o);
120
+ }
121
+ function k(o) {
122
+ l.value !== null && l.value.show(o);
123
+ }
124
+ function b(o) {
125
+ l.value !== null && l.value.hide(o);
126
+ }
127
+ return Object.assign(r, {
128
+ show: k,
129
+ hide: b,
130
+ toggle: P
131
+ }), H(() => {
132
+ e.modelValue === !0 && k();
133
+ }), () => {
134
+ const o = [
135
+ d(F, {
136
+ class: L.value,
137
+ name: e.dropdownIcon || r.$q.iconSet.arrow.dropdown
138
+ })
139
+ ];
140
+ return e.disableDropdown !== !0 && o.push(
141
+ d(x, {
142
+ ref: l,
143
+ id: i.value,
144
+ class: e.contentClass,
145
+ style: e.contentStyle,
146
+ cover: e.cover,
147
+ fit: !0,
148
+ persistent: e.persistent,
149
+ noRouteDismiss: e.noRouteDismiss,
150
+ autoClose: e.autoClose,
151
+ anchor: e.menuAnchor,
152
+ self: e.menuSelf,
153
+ offset: e.menuOffset,
154
+ separateClosePopup: !0,
155
+ transitionShow: e.transitionShow,
156
+ transitionHide: e.transitionHide,
157
+ transitionDuration: e.transitionDuration,
158
+ onBeforeShow: $,
159
+ onShow: I,
160
+ onBeforeHide: Q,
161
+ onHide: O
162
+ }, t.default)
163
+ ), e.split === !1 ? d(v, {
164
+ class: "q-btn-dropdown q-btn-dropdown--simple",
165
+ ...D.value,
166
+ ...q.value,
167
+ disable: e.disable === !0 || e.disableMainBtn === !0,
168
+ noWrap: !0,
169
+ round: !1,
170
+ onClick: V
171
+ }, {
172
+ default: () => S(t.label, []).concat(o),
173
+ loading: t.loading
174
+ }) : d(ae, {
175
+ class: "q-btn-dropdown q-btn-dropdown--split no-wrap q-btn-item",
176
+ rounded: e.rounded,
177
+ square: e.square,
178
+ ...y.value,
179
+ glossy: e.glossy,
180
+ stretch: e.stretch
181
+ }, () => [
182
+ d(v, {
183
+ class: "q-btn-dropdown--current",
184
+ ...D.value,
185
+ disable: e.disable === !0 || e.disableMainBtn === !0,
186
+ noWrap: !0,
187
+ round: !1,
188
+ onClick: z
189
+ }, {
190
+ default: t.label,
191
+ loading: t.loading
192
+ }),
193
+ d(v, {
194
+ class: "q-btn-dropdown__arrow-container q-anchor--skip",
195
+ ...q.value,
196
+ ...y.value,
197
+ disable: e.disable === !0 || e.disableDropdown === !0,
198
+ rounded: e.rounded,
199
+ color: e.color,
200
+ textColor: e.textColor,
201
+ dense: e.dense,
202
+ size: e.size,
203
+ padding: e.padding,
204
+ ripple: e.ripple
205
+ }, () => o)
206
+ ]);
207
+ };
208
+ }
209
+ }), se = /* @__PURE__ */ R({
210
+ __name: "DropdownButton",
211
+ props: {
212
+ size: { default: s.MD },
213
+ transparent: { type: Boolean },
214
+ flat: { type: Boolean },
215
+ rounded: { type: Boolean },
216
+ color: { default: Y.PRIMARY },
217
+ iconLeft: {},
218
+ iconMiddle: {},
219
+ hideDropIcon: { type: Boolean },
220
+ disabled: { type: Boolean },
221
+ loading: { type: Boolean },
222
+ ariaLabel: {},
223
+ label: {},
224
+ menuClass: {},
225
+ menuOffset: {},
226
+ menuAnchor: {},
227
+ menuSelf: {}
228
+ },
229
+ setup(e) {
230
+ const t = e, a = p(!1), r = u(() => [
231
+ "dropdown-btn",
232
+ {
233
+ "dropdown-btn_default": !t.transparent && !t.flat,
234
+ "dropdown-btn_trans": t.transparent,
235
+ "dropdown-btn_flat": t.flat,
236
+ "dropdown-btn_rounded": t.rounded,
237
+ "dropdown-btn_sm": t.size === s.SM,
238
+ "dropdown-btn_md": t.size === s.MD,
239
+ "dropdown-btn_lg": t.size === s.LG,
240
+ "dropdown-btn_icon-left": t.iconLeft,
241
+ "dropdown-btn_icon-middle": t.iconMiddle
242
+ },
243
+ `dropdown-btn_${t.color}`
244
+ ]);
245
+ return (n, l) => (c(), j(m(de), {
246
+ "no-caps": "",
247
+ unelevated: "",
248
+ class: f(r.value),
249
+ padding: m(te)[n.size || m(s).MD],
250
+ loading: n.loading,
251
+ disable: n.disabled || void 0,
252
+ "aria-label": n.ariaLabel,
253
+ "menu-offset": n.menuOffset,
254
+ "menu-anchor": n.menuAnchor,
255
+ "menu-self": n.menuSelf,
256
+ onBeforeShow: l[0] || (l[0] = (i) => a.value = !0),
257
+ onBeforeHide: l[1] || (l[1] = (i) => a.value = !1)
258
+ }, {
259
+ label: w(() => [
260
+ n.iconLeft || n.iconMiddle ? (c(), g("i", {
261
+ key: 0,
262
+ class: f([
263
+ "icon-kl",
264
+ n.iconLeft ? "icon-kl_left" : "icon-kl_middle",
265
+ `icon-kl-${n.iconLeft || n.iconMiddle}`,
266
+ n.transparent || n.flat ? `text-${n.color}` : "text-secondary"
267
+ ])
268
+ }, null, 2)) : B("", !0),
269
+ n.label ? (c(), g(E, { key: 1 }, [
270
+ N(T(n.label), 1)
271
+ ], 64)) : B("", !0),
272
+ n.hideDropIcon ? B("", !0) : (c(), g("i", {
273
+ key: 2,
274
+ class: f([
275
+ "icon-kl",
276
+ "icon-kl-arrow-down",
277
+ { "icon-kl-arrow-down_rotated": a.value },
278
+ n.transparent ? `text-${n.color}` : "text-secondary"
279
+ ])
280
+ }, null, 2))
281
+ ]),
282
+ default: w(() => [
283
+ _(oe, {
284
+ class: f(["dropdown-btn-menu", `dropdown-btn-menu_${n.size} ${n.menuClass ? n.menuClass : ""}`])
285
+ }, {
286
+ default: w(() => [
287
+ G(n.$slots, "default", {}, void 0, !0)
288
+ ]),
289
+ _: 3
290
+ }, 8, ["class"])
291
+ ]),
292
+ _: 3
293
+ }, 8, ["class", "padding", "loading", "disable", "aria-label", "menu-offset", "menu-anchor", "menu-self"]));
294
+ }
295
+ }), fe = /* @__PURE__ */ Z(se, [["__scopeId", "data-v-25a6ff66"]]);
296
+ export {
297
+ fe as default
298
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),l=require("./index-DCnxIAYv.cjs"),s=require("./QMenu-Dh-V-9ws.cjs"),q=["ul","ol"],y=l.createComponent({name:"QList",props:{...s.useDarkProps,bordered:Boolean,dense:Boolean,separator:Boolean,padding:Boolean,tag:{type:String,default:"div"}},setup(e,{slots:a}){const r=n.getCurrentInstance(),u=s.useDark(e,r.proxy.$q),o=n.computed(()=>q.includes(e.tag)?null:"list"),d=n.computed(()=>"q-list"+(e.bordered===!0?" q-list--bordered":"")+(e.dense===!0?" q-list--dense":"")+(e.separator===!0?" q-list--separator":"")+(u.value===!0?" q-list--dark":"")+(e.padding===!0?" q-list--padding":""));return()=>n.h(e.tag,{class:d.value,role:o.value},l.hSlot(a.default))}}),D={[l.SIZES.SM]:"3px 9px",[l.SIZES.MD]:"5px 12px",[l.SIZES.LG]:"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:a}){const r=n.computed(()=>{const u=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(o=>e[o]===!0).map(o=>`q-btn-group--${o}`).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:r.value},l.hSlot(a.default))}}),M=Object.keys(l.nonRoundBtnProps);function A(e){return M.reduce((a,r)=>{const u=e[r];return u!==void 0&&(a[r]=u),a},{})}const L=l.createComponent({name:"QBtnDropdown",props:{...l.nonRoundBtnProps,...s.useTransitionProps,modelValue:Boolean,split:Boolean,dropdownIcon:String,contentClass:[Array,String,Object],contentStyle:[Array,String,Object],cover:Boolean,persistent:Boolean,noRouteDismiss:Boolean,autoClose: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:a,emit:r}){const{proxy:u}=n.getCurrentInstance(),o=n.ref(e.modelValue),d=n.ref(null),i=s.useId(),f=n.computed(()=>{const t={"aria-expanded":o.value===!0?"true":"false","aria-haspopup":"true","aria-controls":i.value,"aria-label":e.toggleAriaLabel||u.$q.lang.label[o.value===!0?"collapse":"expand"](e.label)};return(e.disable===!0||e.split===!1&&e.disableMainBtn===!0||e.disableDropdown===!0)&&(t["aria-disabled"]="true"),t}),B=n.computed(()=>"q-btn-dropdown__arrow"+(o.value===!0&&e.noIconAnimation===!1?" rotate-180":"")+(e.split===!1?" q-btn-dropdown__arrow-container":"")),b=n.computed(()=>l.getBtnDesignAttr(e)),m=n.computed(()=>A(e));n.watch(()=>e.modelValue,t=>{d.value!==null&&d.value[t?"show":"hide"]()}),n.watch(()=>e.split,c);function g(t){o.value=!0,r("beforeShow",t)}function p(t){r("show",t),r("update:modelValue",!0)}function h(t){o.value=!1,r("beforeHide",t)}function v(t){r("hide",t),r("update:modelValue",!1)}function S(t){r("click",t)}function C(t){l.stop(t),c(),r("click",t)}function k(t){d.value!==null&&d.value.toggle(t)}function w(t){d.value!==null&&d.value.show(t)}function c(t){d.value!==null&&d.value.hide(t)}return Object.assign(u,{show:w,hide:c,toggle:k}),n.onMounted(()=>{e.modelValue===!0&&w()}),()=>{const t=[n.h(l.QIcon,{class:B.value,name:e.dropdownIcon||u.$q.iconSet.arrow.dropdown})];return e.disableDropdown!==!0&&t.push(n.h(s.QMenu,{ref:d,id:i.value,class:e.contentClass,style:e.contentStyle,cover:e.cover,fit:!0,persistent:e.persistent,noRouteDismiss:e.noRouteDismiss,autoClose:e.autoClose,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:h,onHide:v},a.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:S},{default:()=>l.hSlot(a.label,[]).concat(t),loading:a.loading}):n.h(I,{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:a.label,loading:a.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},()=>t)])}}}),$=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:{}},setup(e){const a=e,r=n.ref(!1),u=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_sm":a.size===l.SIZES.SM,"dropdown-btn_md":a.size===l.SIZES.MD,"dropdown-btn_lg":a.size===l.SIZES.LG,"dropdown-btn_icon-left":a.iconLeft,"dropdown-btn_icon-middle":a.iconMiddle},`dropdown-btn_${a.color}`]);return(o,d)=>(n.openBlock(),n.createBlock(n.unref(L),{"no-caps":"",unelevated:"",class:n.normalizeClass(u.value),padding:n.unref(D)[o.size||n.unref(l.SIZES).MD],loading:o.loading,disable:o.disabled||void 0,"aria-label":o.ariaLabel,"menu-offset":o.menuOffset,"menu-anchor":o.menuAnchor,"menu-self":o.menuSelf,onBeforeShow:d[0]||(d[0]=i=>r.value=!0),onBeforeHide:d[1]||(d[1]=i=>r.value=!1)},{label:n.withCtx(()=>[o.iconLeft||o.iconMiddle?(n.openBlock(),n.createElementBlock("i",{key:0,class:n.normalizeClass(["icon-kl",o.iconLeft?"icon-kl_left":"icon-kl_middle",`icon-kl-${o.iconLeft||o.iconMiddle}`,o.transparent||o.flat?`text-${o.color}`:"text-secondary"])},null,2)):n.createCommentVNode("",!0),o.label?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(o.label),1)],64)):n.createCommentVNode("",!0),o.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},o.transparent?`text-${o.color}`:"text-secondary"])},null,2))]),default:n.withCtx(()=>[n.createVNode(y,{class:n.normalizeClass(["dropdown-btn-menu",`dropdown-btn-menu_${o.size} ${o.menuClass?o.menuClass:""}`])},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["class"])]),_:3},8,["class","padding","loading","disable","aria-label","menu-offset","menu-anchor","menu-self"]))}}),z=l._export_sfc($,[["__scopeId","data-v-25a6ff66"]]);exports.default=z;
@@ -0,0 +1 @@
1
+ "use strict";const u=require("vue"),B=require("./focusout-DzWGke-4.cjs"),g=require("./index-DCnxIAYv.cjs"),he={dark:{type:Boolean,default:null}};function ve(e,t){return u.computed(()=>e.dark===null?t.dark.isActive:e.dark)}let _,R=0;const b=new Array(256);for(let e=0;e<256;e++)b[e]=(e+256).toString(16).substring(1);const Ie=(()=>{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,_=Ie(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 ze(e){return e??null}function ie(e,t){return e??(t===!0?`f_${j()}`:null)}function Oe({getValue:e,required:t=!0}={}){if(B.isRuntimeSsrPreHydration.value===!0){const o=e!==void 0?u.ref(ze(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 M=[],D=[];function ge(e){D=D.filter(t=>t!==e)}function Ve(e){ge(e),D.push(e)}function ue(e){ge(e),D.length===0&&M.length!==0&&(M[M.length-1](),M=[])}function pe(e){D.length===0?e():M.push(e)}function Ke(e){M=M.filter(t=>t!==e)}function Qe(){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 Ue={target:{type:[Boolean,String,Element],default:!0},noParentEvent:Boolean},_e={...Ue,contextMenu:Boolean};function Ne({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&&Qe()}}),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 s(){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&&(s(),o(r))}),u.watch(()=>n.target,()=>{i.value!==null&&s(),y()}),u.watch(()=>n.noParentEvent,r=>{i.value!==null&&(r===!0?s():o())}),u.onMounted(()=>{y(),t!==!0&&n.modelValue===!0&&i.value===null&&m("update:modelValue",!1)}),u.onBeforeUnmount(()=>{a!==null&&clearTimeout(a),s()}),{anchorEl:i,canShow:h,anchorEvents:d}}function je(e,t){const o=u.ref(null);let n;function l(a,h){const d=`${h!==void 0?"add":"remove"}EventListener`,s=h!==void 0?h:n;a!==window&&a[d]("scroll",s,g.listenOpts.passive),window[d]("scroll",s,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 we={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},ye=["beforeShow","show","beforeHide","hide"];function xe({showing:e,canShow:t,hideOnRouteChange:o,handleShow:n,handleHide:l,processOnMount:m}){const i=u.getCurrentInstance(),{props:a,emit:h,proxy:d}=i;let s;function w(v){e.value===!0?f(v):y(v)}function y(v){if(a.disable===!0||v!==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),s=v,u.nextTick(()=>{s===v&&(s=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),s=v,u.nextTick(()=>{s===v&&(s=void 0)})),(a.modelValue===null||p===!1)&&k(v)}function k(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:k)(s)}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 H={show:y,hide:f,toggle:w};return Object.assign(d,H),H}const re={};let Ge=1,Xe=document.body;function Ye(e,t){const o=document.createElement("div");if(o.id=t!==void 0?`q-portal--${t}--${Ge++}`:e,re.globalNodes!==void 0){const n=re.globalNodes.class;n!==void 0&&(o.className=n)}return Xe.appendChild(o),o}function Ze(e){e.remove()}const L=[];function Je(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!==void 0&&o.$options.name==="QPopupProxy"?(e.hide(t),o):e}e=g.getParentProxy(e)}while(e!=null)}const et=g.createComponent({name:"QPortal",setup(e,{slots:t}){return()=>t.default()}});function tt(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 be(e,t,o,n){const l=u.ref(!1),m=u.ref(!1);let i=null;const a={},h=n==="dialog"&&tt(e);function d(w){if(w===!0){ue(a),m.value=!0;return}m.value=!1,l.value===!1&&(h===!1&&i===null&&(i=Ye(!1,n)),l.value=!0,L.push(e.proxy),Ve(a))}function s(w){if(m.value=!1,w!==!0)return;ue(a),l.value=!1;const y=L.indexOf(e.proxy);y!==-1&&L.splice(y,1),i!==null&&(Ze(i),i=null)}return u.onUnmounted(()=>{s(!0)}),e.proxy.__qPortal=!0,B.injectProp(e.proxy,"contentEl",()=>t.value),{showPortal:d,hidePortal:s,portalIsActive:l,portalIsAccessible:m,renderPortal:()=>h===!0?o():l.value===!0?[u.h(u.Teleport,{to:i},u.h(et,o))]:void 0}}const Te={transitionShow:{type:String,default:"fade"},transitionHide:{type:String,default:"fade"},transitionDuration:{type:[String,Number],default:300}};function Ee(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 Ce(){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 Pe(){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 ot=[Element,String],nt=[null,document,document.body,document.scrollingElement,document.documentElement];function lt(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 nt.includes(o)?window:o}function it(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function ut(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}let I;function rt(){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 at(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 st(e){$=e.keyCode===27}function ct(){$===!0&&($=!1)}function dt(e){$===!0&&($=!1,g.isKeyCode(e,27)===!0&&W[W.length-1](e))}function Se(e){window[e]("keydown",st),window[e]("blur",ct),window[e]("keyup",dt),$=!1}function ke(e){B.client.is.desktop===!0&&(W.push(e),W.length===1&&Se("addEventListener"))}function G(e){const t=W.indexOf(e);t!==-1&&(W.splice(t,1),W.length===0&&Se("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=L.length-1;for(;o>=0;){const n=L[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 ft(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 mt(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 ht(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 vt(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 gt(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 He(e,t=0){if(e.targetEl===null||e.anchorEl===null||t>5)return;if(e.targetEl.offsetHeight===0||e.targetEl.offsetWidth===0){setTimeout(()=>{He(e,t+1)},10);return}const{targetEl:o,offset:n,anchorEl:l,anchorOrigin:m,selfOrigin:i,absoluteOffset:a,fit:h,cover:d,maxHeight:s,maxWidth:w}=e;if(B.client.is.ios===!0&&window.visualViewport!==void 0){const F=document.body.style,{offsetLeft:T,offsetTop:E}=window.visualViewport;T!==se&&(F.setProperty("--q-pe-left",T+"px"),se=T),E!==ce&&(F.setProperty("--q-pe-top",E+"px"),ce=E)}const{scrollLeft:y,scrollTop:r}=o,f=a===void 0?ht(l,d===!0?[0,0]:n):vt(l,a,n);Object.assign(o.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:w,maxHeight:s,visibility:"visible"});const{offsetWidth:k,offsetHeight:C}=o,{elWidth:H,elHeight:v}=h===!0||d===!0?{elWidth:Math.max(f.width,k),elHeight:d===!0?Math.max(f.height,C):C}:{elWidth:k,elHeight:C};let p={maxWidth:w,maxHeight:s};(h===!0||d===!0)&&(p.minWidth=f.width+"px",d===!0&&(p.minHeight=f.height+"px")),Object.assign(o.style,p);const P=gt(H,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:T}=x;N(x,f,P,m,i);let E=!1;if(x.top!==F){E=!0;const S=2*n[1];f.center=f.top-=S,f.bottom-=S+2}if(x.left!==T){E=!0;const S=2*n[0];f.middle=f.left-=S,f.right-=S+2}E===!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=rt(),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 s=Math.min(h,n.vertical==="center"?t.center:n.vertical===l.vertical?t.bottom:t.top);e.maxHeight=Math.min(m,s),e.top=Math.max(0,s-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 s=Math.min(d,n.horizontal==="middle"?t.middle:n.horizontal===l.horizontal?t.right:t.left);e.maxWidth=Math.min(i,s),e.left=Math.max(0,s-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 pt=g.createComponent({name:"QMenu",inheritAttrs:!1,props:{..._e,...we,...he,...Te,persistent:Boolean,autoClose:Boolean,separateClosePopup: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:mt},scrollTarget:ot,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...ye,"click","escapeKey"],setup(e,{slots:t,emit:o,attrs:n}){let l=null,m,i,a;const h=u.getCurrentInstance(),{proxy:d}=h,{$q:s}=d,w=u.ref(null),y=u.ref(!1),r=u.computed(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),f=ve(e,s),{registerTick:k,removeTick:C}=Ce(),{registerTimeout:H}=Pe(),{transitionProps:v,transitionStyle:p}=Ee(e),{localScrollTarget:P,changeScrollEvent:x,unconfigureScrollTarget:F}=je(e,oe),{anchorEl:T,canShow:E}=Ne({showing:y}),{hide:S}=xe({showing:y,canShow:E,handleShow:Fe,handleHide:$e,hideOnRouteChange:r,processOnMount:!0}),{showPortal:Y,hidePortal:Z,renderPortal:Me}=be(h,w,Le,"menu"),V={anchorEl:T,innerRef:w,onClickOutside(c){if(e.persistent!==!0&&y.value===!0)return S(c),(c.type==="touchstart"||c.target.classList.contains("q-dialog__backdrop"))&&g.stopAndPrevent(c),!0}},J=u.computed(()=>fe(e.anchor||(e.cover===!0?"center middle":"bottom start"),s.lang.rtl)),We=u.computed(()=>e.cover===!0?J.value:fe(e.self||"top start",s.lang.rtl)),qe=u.computed(()=>(e.square===!0?" q-menu--square":"")+(f.value===!0?" q-menu--dark q-dark":"")),Be=u.computed(()=>e.autoClose===!0?{onClick:Ae}:{}),ee=u.computed(()=>y.value===!0&&e.persistent!==!0);u.watch(ee,c=>{c===!0?(ke(Q),ft(V)):(G(Q),ae(V))});function K(){pe(()=>{let c=w.value;c&&c.contains(document.activeElement)!==!0&&(c=c.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||c.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||c.querySelector("[autofocus], [data-autofocus]")||c,c.focus({preventScroll:!0}))})}function Fe(c){if(l=e.noRefocus===!1?document.activeElement:null,B.addFocusout(ne),Y(),oe(),m=void 0,c!==void 0&&(e.touchPosition||e.contextMenu)){const U=g.position(c);if(U.left!==void 0){const{top:De,left:Re}=T.value.getBoundingClientRect();m={left:U.left-Re,top:U.top-De}}}i===void 0&&(i=u.watch(()=>s.screen.width+"|"+s.screen.height+"|"+e.self+"|"+e.anchor+"|"+s.lang.rtl,A)),e.noFocus!==!0&&document.activeElement.blur(),k(()=>{A(),e.noFocus!==!0&&K()}),H(()=>{s.platform.is.ios===!0&&(a=e.autoClose,w.value.click()),A(),Y(!0),o("show",c)},e.transitionDuration)}function $e(c){C(),Z(),te(!0),l!==null&&(c===void 0||c.qClickOutside!==!0)&&(((c&&c.type.indexOf("key")===0?l.closest('[tabindex]:not([tabindex^="-"])'):void 0)||l).focus(),l=null),H(()=>{Z(!0),o("hide",c)},e.transitionDuration)}function te(c){m=void 0,i!==void 0&&(i(),i=void 0),(c===!0||y.value===!0)&&(B.removeFocusout(ne),F(),ae(V),G(Q)),c!==!0&&(l=null)}function oe(){(T.value!==null||e.scrollTarget!==void 0)&&(P.value=lt(T.value,e.scrollTarget),x(P.value,A))}function Ae(c){a!==!0?(Je(d,c),o("click",c)):a=!1}function ne(c){ee.value===!0&&e.noFocus!==!0&&g.childHasFocus(w.value,c.target)!==!0&&K()}function Q(c){o("escapeKey"),S(c)}function A(){He({targetEl:w.value,offset:e.offset,anchorEl:T.value,anchorOrigin:J.value,selfOrigin:We.value,absoluteOffset:m,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function Le(){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"+qe.value,n.class],style:[n.style,p.value],...Be.value},g.hSlot(t.default)):null)}return u.onBeforeUnmount(te),Object.assign(d,{focus:K,updatePosition:A}),Me}});exports.QMenu=pt;exports.addEscapeKey=ke;exports.addFocusFn=pe;exports.getHorizontalScrollPosition=ut;exports.getVerticalScrollPosition=it;exports.hasScrollbar=at;exports.removeEscapeKey=G;exports.removeFocusFn=Ke;exports.useDark=ve;exports.useDarkProps=he;exports.useId=Oe;exports.useModelToggle=xe;exports.useModelToggleEmits=ye;exports.useModelToggleProps=we;exports.usePortal=be;exports.useTick=Ce;exports.useTimeout=Pe;exports.useTransition=Ee;exports.useTransitionProps=Te;