@validol4ik/uikit 0.3.24 → 0.3.26

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.
@@ -1,3327 +0,0 @@
1
- import { computed as f, ref as T, h, getCurrentInstance as le, toRaw as $e, onMounted as tt, watch as K, onBeforeUpdate as Ml, inject as _o, onBeforeUnmount as ce, nextTick as ue, onDeactivated as Ct, onActivated as Ll, Transition as bt, onUnmounted as Eo, Teleport as Bo, onBeforeMount as Ao, onUpdated as To, defineComponent as Ro, openBlock as de, createElementBlock as ye, normalizeClass as st, toDisplayString as Ue, createCommentVNode as Pe, createVNode as Xe, unref as zo, withCtx as xe, mergeProps as Fo, createBlock as al, createElementVNode as At, createTextVNode as Tt, Fragment as ct, withModifiers as Mo } from "vue";
2
- import { u as Ol, s as ae, h as Il, g as Se, c as Hl, d as be, Q as Ae, a as Lo, i as kt, j as Oo, k as Io, p as pe, f as Ho, m as $o, R as Po, n as Do, o as rl, q as Wo, l as ge, v as jo, r as Rt, t as $l, w as No, x as sl, y as Ko, z as Pl, A as Qo, B as Uo, e as De, D as Xo, S as Yo } from "./use-router-link-BgNwCOFX.js";
3
- import { i as Go, b as Dl, P as Zo, c as we, r as Pt, a as Wl } from "./focusout-DjvPXP_b.js";
4
- import { _ as Jo } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- const lt = {
6
- dark: {
7
- type: Boolean,
8
- default: null
9
- }
10
- };
11
- function ot(e, t) {
12
- return f(() => e.dark === null ? t.dark.isActive : e.dark);
13
- }
14
- function en(e, t) {
15
- const l = T(null), o = f(() => e.disable === !0 ? null : h("span", {
16
- ref: l,
17
- class: "no-outline",
18
- tabindex: -1
19
- }));
20
- function a(i) {
21
- const u = t.value;
22
- i !== void 0 && i.type.indexOf("key") === 0 ? u !== null && document.activeElement !== u && u.contains(document.activeElement) === !0 && u.focus() : l.value !== null && (i === void 0 || u !== null && u.contains(i.target) === !0) && l.value.focus();
23
- }
24
- return {
25
- refocusTargetEl: o,
26
- refocusTarget: a
27
- };
28
- }
29
- const jl = {
30
- name: String
31
- };
32
- function tn(e = {}) {
33
- return (t, l, o) => {
34
- t[l](
35
- h("input", {
36
- class: "hidden" + (o || ""),
37
- ...e.value
38
- })
39
- );
40
- };
41
- }
42
- function ln(e) {
43
- return f(() => e.name || e.for);
44
- }
45
- const on = {
46
- xs: 30,
47
- sm: 35,
48
- md: 40,
49
- lg: 50,
50
- xl: 60
51
- }, nn = {
52
- ...lt,
53
- ...Hl,
54
- ...jl,
55
- modelValue: {
56
- required: !0,
57
- default: null
58
- },
59
- val: {},
60
- trueValue: { default: !0 },
61
- falseValue: { default: !1 },
62
- indeterminateValue: { default: null },
63
- checkedIcon: String,
64
- uncheckedIcon: String,
65
- indeterminateIcon: String,
66
- toggleOrder: {
67
- type: String,
68
- validator: (e) => e === "tf" || e === "ft"
69
- },
70
- toggleIndeterminate: Boolean,
71
- label: String,
72
- leftLabel: Boolean,
73
- color: String,
74
- keepColor: Boolean,
75
- dense: Boolean,
76
- disable: Boolean,
77
- tabindex: [String, Number]
78
- }, un = ["update:modelValue"];
79
- function an(e, t) {
80
- const { props: l, slots: o, emit: a, proxy: i } = le(), { $q: u } = i, d = ot(l, u), v = T(null), { refocusTargetEl: g, refocusTarget: c } = en(l, v), y = Ol(l, on), C = f(
81
- () => l.val !== void 0 && Array.isArray(l.modelValue)
82
- ), r = f(() => {
83
- const A = $e(l.val);
84
- return C.value === !0 ? l.modelValue.findIndex((U) => $e(U) === A) : -1;
85
- }), m = f(() => C.value === !0 ? r.value !== -1 : $e(l.modelValue) === $e(l.trueValue)), _ = f(() => C.value === !0 ? r.value === -1 : $e(l.modelValue) === $e(l.falseValue)), S = f(
86
- () => m.value === !1 && _.value === !1
87
- ), P = f(() => l.disable === !0 ? -1 : l.tabindex || 0), E = f(
88
- () => `q-${e} cursor-pointer no-outline row inline no-wrap items-center` + (l.disable === !0 ? " disabled" : "") + (d.value === !0 ? ` q-${e}--dark` : "") + (l.dense === !0 ? ` q-${e}--dense` : "") + (l.leftLabel === !0 ? " reverse" : "")
89
- ), q = f(() => {
90
- const A = m.value === !0 ? "truthy" : _.value === !0 ? "falsy" : "indet", U = l.color !== void 0 && (l.keepColor === !0 || _.value !== !0) ? ` text-${l.color}` : "";
91
- return `q-${e}__inner relative-position non-selectable q-${e}__inner--${A}${U}`;
92
- }), R = f(() => {
93
- const A = { type: "checkbox" };
94
- return l.name !== void 0 && Object.assign(A, {
95
- // see https://vuejs.org/guide/extras/render-function.html#creating-vnodes (.prop)
96
- ".checked": m.value,
97
- "^checked": m.value === !0 ? "checked" : void 0,
98
- name: l.name,
99
- value: C.value === !0 ? l.val : l.trueValue
100
- }), A;
101
- }), D = tn(R), B = f(() => {
102
- const A = {
103
- tabindex: P.value,
104
- role: "checkbox",
105
- "aria-label": l.label,
106
- "aria-checked": S.value === !0 ? "mixed" : m.value === !0 ? "true" : "false"
107
- };
108
- return l.disable === !0 && (A["aria-disabled"] = "true"), A;
109
- });
110
- function L(A) {
111
- A !== void 0 && (ae(A), c(A)), l.disable !== !0 && a("update:modelValue", H(), A);
112
- }
113
- function H() {
114
- if (C.value === !0) {
115
- if (m.value === !0) {
116
- const A = l.modelValue.slice();
117
- return A.splice(r.value, 1), A;
118
- }
119
- return l.modelValue.concat([l.val]);
120
- }
121
- if (m.value === !0) {
122
- if (l.toggleOrder !== "ft" || l.toggleIndeterminate === !1)
123
- return l.falseValue;
124
- } else if (_.value === !0) {
125
- if (l.toggleOrder === "ft" || l.toggleIndeterminate === !1)
126
- return l.trueValue;
127
- } else
128
- return l.toggleOrder !== "ft" ? l.trueValue : l.falseValue;
129
- return l.indeterminateValue;
130
- }
131
- function Q(A) {
132
- (A.keyCode === 13 || A.keyCode === 32) && ae(A);
133
- }
134
- function G(A) {
135
- (A.keyCode === 13 || A.keyCode === 32) && L(A);
136
- }
137
- const oe = t(m, S);
138
- return Object.assign(i, { toggle: L }), () => {
139
- const A = oe();
140
- l.disable !== !0 && D(
141
- A,
142
- "unshift",
143
- ` q-${e}__native absolute q-ma-none q-pa-none`
144
- );
145
- const U = [
146
- h("div", {
147
- class: q.value,
148
- style: y.value,
149
- "aria-hidden": "true"
150
- }, A)
151
- ];
152
- g.value !== null && U.push(g.value);
153
- const ne = l.label !== void 0 ? Il(o.default, [l.label]) : Se(o.default);
154
- return ne !== void 0 && U.push(
155
- h("div", {
156
- class: `q-${e}__label q-anchor--skip`
157
- }, ne)
158
- ), h("div", {
159
- ref: v,
160
- class: E.value,
161
- ...B.value,
162
- onClick: L,
163
- onKeydown: Q,
164
- onKeyup: G
165
- }, U);
166
- };
167
- }
168
- const rn = () => h("div", {
169
- key: "svg",
170
- class: "q-checkbox__bg absolute"
171
- }, [
172
- h("svg", {
173
- class: "q-checkbox__svg fit absolute-full",
174
- viewBox: "0 0 24 24"
175
- }, [
176
- h("path", {
177
- class: "q-checkbox__truthy",
178
- fill: "none",
179
- d: "M1.73,12.91 8.1,19.28 22.79,4.59"
180
- }),
181
- h("path", {
182
- class: "q-checkbox__indet",
183
- d: "M4,14H20V10H4"
184
- })
185
- ])
186
- ]), sn = be({
187
- name: "QCheckbox",
188
- props: nn,
189
- emits: un,
190
- setup(e) {
191
- const t = rn();
192
- function l(o, a) {
193
- const i = f(
194
- () => (o.value === !0 ? e.checkedIcon : a.value === !0 ? e.indeterminateIcon : e.uncheckedIcon) || null
195
- );
196
- return () => i.value !== null ? [
197
- h("div", {
198
- key: "icon",
199
- class: "q-checkbox__icon-container absolute-full flex flex-center no-wrap"
200
- }, [
201
- h(Ae, {
202
- class: "q-checkbox__icon",
203
- name: i.value
204
- })
205
- ])
206
- ] : [t];
207
- }
208
- return an("checkbox", l);
209
- }
210
- }), pt = be({
211
- name: "QItemSection",
212
- props: {
213
- avatar: Boolean,
214
- thumbnail: Boolean,
215
- side: Boolean,
216
- top: Boolean,
217
- noWrap: Boolean
218
- },
219
- setup(e, { slots: t }) {
220
- const l = f(
221
- () => `q-item__section column q-item__section--${e.avatar === !0 || e.side === !0 || e.thumbnail === !0 ? "side" : "main"}` + (e.top === !0 ? " q-item__section--top justify-start" : " justify-center") + (e.avatar === !0 ? " q-item__section--avatar" : "") + (e.thumbnail === !0 ? " q-item__section--thumbnail" : "") + (e.noWrap === !0 ? " q-item__section--nowrap" : "")
222
- );
223
- return () => h("div", { class: l.value }, Se(t.default));
224
- }
225
- }), Nl = be({
226
- name: "QItemLabel",
227
- props: {
228
- overline: Boolean,
229
- caption: Boolean,
230
- header: Boolean,
231
- lines: [Number, String]
232
- },
233
- setup(e, { slots: t }) {
234
- const l = f(() => parseInt(e.lines, 10)), o = f(
235
- () => "q-item__label" + (e.overline === !0 ? " q-item__label--overline text-overline" : "") + (e.caption === !0 ? " q-item__label--caption text-caption" : "") + (e.header === !0 ? " q-item__label--header" : "") + (l.value === 1 ? " ellipsis" : "")
236
- ), a = f(() => e.lines !== void 0 && l.value > 1 ? {
237
- overflow: "hidden",
238
- display: "-webkit-box",
239
- "-webkit-box-orient": "vertical",
240
- "-webkit-line-clamp": l.value
241
- } : null);
242
- return () => h("div", {
243
- style: a.value,
244
- class: o.value
245
- }, Se(t.default));
246
- }
247
- }), Kl = be({
248
- name: "QItem",
249
- props: {
250
- ...lt,
251
- ...Io,
252
- tag: {
253
- type: String,
254
- default: "div"
255
- },
256
- active: {
257
- type: Boolean,
258
- default: null
259
- },
260
- clickable: Boolean,
261
- dense: Boolean,
262
- insetLevel: Number,
263
- tabindex: [String, Number],
264
- focused: Boolean,
265
- manualFocus: Boolean
266
- },
267
- emits: ["click", "keyup"],
268
- setup(e, { slots: t, emit: l }) {
269
- const { proxy: { $q: o } } = le(), a = ot(e, o), { hasLink: i, linkAttrs: u, linkClass: d, linkTag: v, navigateOnClick: g } = Lo(), c = T(null), y = T(null), C = f(
270
- () => e.clickable === !0 || i.value === !0 || e.tag === "label"
271
- ), r = f(
272
- () => e.disable !== !0 && C.value === !0
273
- ), m = f(
274
- () => "q-item q-item-type row no-wrap" + (e.dense === !0 ? " q-item--dense" : "") + (a.value === !0 ? " q-item--dark" : "") + (i.value === !0 && e.active === null ? d.value : e.active === !0 ? ` q-item--active${e.activeClass !== void 0 ? ` ${e.activeClass}` : ""}` : "") + (e.disable === !0 ? " disabled" : "") + (r.value === !0 ? " q-item--clickable q-link cursor-pointer " + (e.manualFocus === !0 ? "q-manual-focusable" : "q-focusable q-hoverable") + (e.focused === !0 ? " q-manual-focusable--focused" : "") : "")
275
- ), _ = f(() => e.insetLevel === void 0 ? null : {
276
- ["padding" + (o.lang.rtl === !0 ? "Right" : "Left")]: 16 + e.insetLevel * 56 + "px"
277
- });
278
- function S(q) {
279
- r.value === !0 && (y.value !== null && (q.qKeyEvent !== !0 && document.activeElement === c.value ? y.value.focus() : document.activeElement === y.value && c.value.focus()), g(q));
280
- }
281
- function P(q) {
282
- if (r.value === !0 && kt(q, [13, 32]) === !0) {
283
- ae(q), q.qKeyEvent = !0;
284
- const R = new MouseEvent("click", q);
285
- R.qKeyEvent = !0, c.value.dispatchEvent(R);
286
- }
287
- l("keyup", q);
288
- }
289
- function E() {
290
- const q = Oo(t.default, []);
291
- return r.value === !0 && q.unshift(
292
- h("div", { class: "q-focus-helper", tabindex: -1, ref: y })
293
- ), q;
294
- }
295
- return () => {
296
- const q = {
297
- ref: c,
298
- class: m.value,
299
- style: _.value,
300
- role: "listitem",
301
- onClick: S,
302
- onKeyup: P
303
- };
304
- return r.value === !0 ? (q.tabindex = e.tabindex || "0", Object.assign(q, u.value)) : C.value === !0 && (q["aria-disabled"] = "true"), h(
305
- v.value,
306
- q,
307
- E()
308
- );
309
- };
310
- }
311
- }), cl = (e) => e ? !0 : "Обовʼязкове поле";
312
- let zt, dt = 0;
313
- const ee = new Array(256);
314
- for (let e = 0; e < 256; e++)
315
- ee[e] = (e + 256).toString(16).substring(1);
316
- const cn = (() => {
317
- const e = typeof crypto < "u" ? crypto : typeof window < "u" ? window.crypto || window.msCrypto : void 0;
318
- if (e !== void 0) {
319
- if (e.randomBytes !== void 0)
320
- return e.randomBytes;
321
- if (e.getRandomValues !== void 0)
322
- return (t) => {
323
- const l = new Uint8Array(t);
324
- return e.getRandomValues(l), l;
325
- };
326
- }
327
- return (t) => {
328
- const l = [];
329
- for (let o = t; o > 0; o--)
330
- l.push(Math.floor(Math.random() * 256));
331
- return l;
332
- };
333
- })(), dl = 4096;
334
- function Dt() {
335
- (zt === void 0 || dt + 16 > dl) && (dt = 0, zt = cn(dl));
336
- const e = Array.prototype.slice.call(zt, dt, dt += 16);
337
- return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, ee[e[0]] + ee[e[1]] + ee[e[2]] + ee[e[3]] + "-" + ee[e[4]] + ee[e[5]] + "-" + ee[e[6]] + ee[e[7]] + "-" + ee[e[8]] + ee[e[9]] + "-" + ee[e[10]] + ee[e[11]] + ee[e[12]] + ee[e[13]] + ee[e[14]] + ee[e[15]];
338
- }
339
- function dn(e) {
340
- return e ?? null;
341
- }
342
- function fl(e, t) {
343
- return e ?? (t === !0 ? `f_${Dt()}` : null);
344
- }
345
- function fn({ getValue: e, required: t = !0 } = {}) {
346
- if (Go.value === !0) {
347
- const l = e !== void 0 ? T(dn(e())) : T(null);
348
- return t === !0 && l.value === null && tt(() => {
349
- l.value = `f_${Dt()}`;
350
- }), e !== void 0 && K(e, (o) => {
351
- l.value = fl(o, t);
352
- }), l;
353
- }
354
- return e !== void 0 ? f(() => fl(e(), t)) : T(`f_${Dt()}`);
355
- }
356
- const vl = /^on[A-Z]/;
357
- function vn() {
358
- const { attrs: e, vnode: t } = le(), l = {
359
- listeners: T({}),
360
- attributes: T({})
361
- };
362
- function o() {
363
- const a = {}, i = {};
364
- for (const u in e)
365
- u !== "class" && u !== "style" && vl.test(u) === !1 && (a[u] = e[u]);
366
- for (const u in t.props)
367
- vl.test(u) === !0 && (i[u] = t.props[u]);
368
- l.attributes.value = a, l.listeners.value = i;
369
- }
370
- return Ml(o), o(), l;
371
- }
372
- const mn = "_q_fo_";
373
- function hn({ validate: e, resetValidation: t, requiresQForm: l }) {
374
- const o = _o(mn, !1);
375
- if (o !== !1) {
376
- const { props: a, proxy: i } = le();
377
- Object.assign(i, { validate: e, resetValidation: t }), K(() => a.disable, (u) => {
378
- u === !0 ? (typeof t == "function" && t(), o.unbindComponent(i)) : o.bindComponent(i);
379
- }), tt(() => {
380
- a.disable !== !0 && o.bindComponent(i);
381
- }), ce(() => {
382
- a.disable !== !0 && o.unbindComponent(i);
383
- });
384
- } else l === !0 && console.error("Parent QForm not found on useFormChild()!");
385
- }
386
- const ml = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/, hl = /^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/, gl = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, ft = /^rgb\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5])\)$/, vt = /^rgba\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),(0|0\.[0-9]+[1-9]|0\.[1-9]+|1)\)$/, Ft = {
387
- date: (e) => /^-?[\d]+\/[0-1]\d\/[0-3]\d$/.test(e),
388
- time: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d$/.test(e),
389
- fulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(e),
390
- timeOrFulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(e),
391
- // -- RFC 5322 --
392
- // -- Added in v2.6.6 --
393
- // This is a basic helper validation.
394
- // For something more complex (like RFC 822) you should write and use your own rule.
395
- // We won't be accepting PRs to enhance the one below because of the reason above.
396
- // eslint-disable-next-line
397
- email: (e) => /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e),
398
- hexColor: (e) => ml.test(e),
399
- hexaColor: (e) => hl.test(e),
400
- hexOrHexaColor: (e) => gl.test(e),
401
- rgbColor: (e) => ft.test(e),
402
- rgbaColor: (e) => vt.test(e),
403
- rgbOrRgbaColor: (e) => ft.test(e) || vt.test(e),
404
- hexOrRgbColor: (e) => ml.test(e) || ft.test(e),
405
- hexaOrRgbaColor: (e) => hl.test(e) || vt.test(e),
406
- anyColor: (e) => gl.test(e) || ft.test(e) || vt.test(e)
407
- };
408
- function Ql(e, t = 250, l) {
409
- let o = null;
410
- function a() {
411
- const i = arguments, u = () => {
412
- o = null, l !== !0 && e.apply(this, i);
413
- };
414
- o !== null ? clearTimeout(o) : l === !0 && e.apply(this, i), o = setTimeout(u, t);
415
- }
416
- return a.cancel = () => {
417
- o !== null && clearTimeout(o);
418
- }, a;
419
- }
420
- const gn = [!0, !1, "ondemand"], pn = {
421
- modelValue: {},
422
- error: {
423
- type: Boolean,
424
- default: null
425
- },
426
- errorMessage: String,
427
- noErrorIcon: Boolean,
428
- rules: Array,
429
- reactiveRules: Boolean,
430
- lazyRules: {
431
- type: [Boolean, String],
432
- default: !1,
433
- // statement unneeded but avoids future vue implementation changes
434
- validator: (e) => gn.includes(e)
435
- }
436
- };
437
- function bn(e, t) {
438
- const { props: l, proxy: o } = le(), a = T(!1), i = T(null), u = T(!1);
439
- hn({ validate: _, resetValidation: m });
440
- let d = 0, v;
441
- const g = f(
442
- () => l.rules !== void 0 && l.rules !== null && l.rules.length !== 0
443
- ), c = f(() => l.disable !== !0 && g.value === !0 && t.value === !1), y = f(
444
- () => l.error === !0 || a.value === !0
445
- ), C = f(() => typeof l.errorMessage == "string" && l.errorMessage.length !== 0 ? l.errorMessage : i.value);
446
- K(() => l.modelValue, () => {
447
- u.value = !0, c.value === !0 && l.lazyRules === !1 && S();
448
- });
449
- function r() {
450
- l.lazyRules !== "ondemand" && c.value === !0 && u.value === !0 && S();
451
- }
452
- K(() => l.reactiveRules, (P) => {
453
- P === !0 ? v === void 0 && (v = K(() => l.rules, r, { immediate: !0, deep: !0 })) : v !== void 0 && (v(), v = void 0);
454
- }, { immediate: !0 }), K(() => l.lazyRules, r), K(e, (P) => {
455
- P === !0 ? u.value = !0 : c.value === !0 && l.lazyRules !== "ondemand" && S();
456
- });
457
- function m() {
458
- d++, t.value = !1, u.value = !1, a.value = !1, i.value = null, S.cancel();
459
- }
460
- function _(P = l.modelValue) {
461
- if (l.disable === !0 || g.value === !1)
462
- return !0;
463
- const E = ++d, q = t.value !== !0 ? () => {
464
- u.value = !0;
465
- } : () => {
466
- }, R = (B, L) => {
467
- B === !0 && q(), a.value = B, i.value = L || null, t.value = !1;
468
- }, D = [];
469
- for (let B = 0; B < l.rules.length; B++) {
470
- const L = l.rules[B];
471
- let H;
472
- if (typeof L == "function" ? H = L(P, Ft) : typeof L == "string" && Ft[L] !== void 0 && (H = Ft[L](P)), H === !1 || typeof H == "string")
473
- return R(!0, H), !1;
474
- H !== !0 && H !== void 0 && D.push(H);
475
- }
476
- return D.length === 0 ? (R(!1), !0) : (t.value = !0, Promise.all(D).then(
477
- (B) => {
478
- if (B === void 0 || Array.isArray(B) === !1 || B.length === 0)
479
- return E === d && R(!1), !0;
480
- const L = B.find((H) => H === !1 || typeof H == "string");
481
- return E === d && R(L !== void 0, L), L === void 0;
482
- },
483
- (B) => (E === d && (console.error(B), R(!0)), !1)
484
- ));
485
- }
486
- const S = Ql(_, 0);
487
- return ce(() => {
488
- v !== void 0 && v(), S.cancel();
489
- }), Object.assign(o, { resetValidation: m, validate: _ }), Dl(o, "hasError", () => y.value), {
490
- isDirtyModel: u,
491
- hasRules: g,
492
- hasError: y,
493
- errorMessage: C,
494
- validate: _,
495
- resetValidation: m
496
- };
497
- }
498
- let Be = [], et = [];
499
- function Ul(e) {
500
- et = et.filter((t) => t !== e);
501
- }
502
- function yn(e) {
503
- Ul(e), et.push(e);
504
- }
505
- function pl(e) {
506
- Ul(e), et.length === 0 && Be.length !== 0 && (Be[Be.length - 1](), Be = []);
507
- }
508
- function Nt(e) {
509
- et.length === 0 ? e() : Be.push(e);
510
- }
511
- function Sn(e) {
512
- Be = Be.filter((t) => t !== e);
513
- }
514
- function Wt(e) {
515
- return e != null && ("" + e).length !== 0;
516
- }
517
- const wn = {
518
- ...lt,
519
- ...pn,
520
- label: String,
521
- stackLabel: Boolean,
522
- hint: String,
523
- hideHint: Boolean,
524
- prefix: String,
525
- suffix: String,
526
- labelColor: String,
527
- color: String,
528
- bgColor: String,
529
- filled: Boolean,
530
- outlined: Boolean,
531
- borderless: Boolean,
532
- standout: [Boolean, String],
533
- square: Boolean,
534
- loading: Boolean,
535
- labelSlot: Boolean,
536
- bottomSlots: Boolean,
537
- hideBottomSpace: Boolean,
538
- rounded: Boolean,
539
- dense: Boolean,
540
- itemAligned: Boolean,
541
- counter: Boolean,
542
- clearable: Boolean,
543
- clearIcon: String,
544
- disable: Boolean,
545
- readonly: Boolean,
546
- autofocus: Boolean,
547
- for: String
548
- }, Kt = {
549
- ...wn,
550
- maxlength: [Number, String]
551
- }, Xl = ["update:modelValue", "clear", "focus", "blur"];
552
- function Yl({ requiredForAttr: e = !0, tagProp: t, changeEvent: l = !1 } = {}) {
553
- const { props: o, proxy: a } = le(), i = ot(o, a.$q), u = fn({
554
- required: e,
555
- getValue: () => o.for
556
- });
557
- return {
558
- requiredForAttr: e,
559
- changeEvent: l,
560
- tag: t === !0 ? f(() => o.tag) : { value: "label" },
561
- isDark: i,
562
- editable: f(
563
- () => o.disable !== !0 && o.readonly !== !0
564
- ),
565
- innerLoading: T(!1),
566
- focused: T(!1),
567
- hasPopupOpen: !1,
568
- splitAttrs: vn(),
569
- targetUid: u,
570
- rootRef: T(null),
571
- targetRef: T(null),
572
- controlRef: T(null)
573
- /**
574
- * user supplied additionals:
575
-
576
- * innerValue - computed
577
- * floatingLabel - computed
578
- * inputRef - computed
579
-
580
- * fieldClass - computed
581
- * hasShadow - computed
582
-
583
- * controlEvents - Object with fn(e)
584
-
585
- * getControl - fn
586
- * getInnerAppend - fn
587
- * getControlChild - fn
588
- * getShadowControl - fn
589
- * showPopup - fn
590
- */
591
- };
592
- }
593
- function Gl(e) {
594
- const { props: t, emit: l, slots: o, attrs: a, proxy: i } = le(), { $q: u } = i;
595
- let d = null;
596
- e.hasValue === void 0 && (e.hasValue = f(() => Wt(t.modelValue))), e.emitValue === void 0 && (e.emitValue = (k) => {
597
- l("update:modelValue", k);
598
- }), e.controlEvents === void 0 && (e.controlEvents = {
599
- onFocusin: Q,
600
- onFocusout: G
601
- }), Object.assign(e, {
602
- clearValue: oe,
603
- onControlFocusin: Q,
604
- onControlFocusout: G,
605
- focus: L
606
- }), e.computedCounter === void 0 && (e.computedCounter = f(() => {
607
- if (t.counter !== !1) {
608
- const k = typeof t.modelValue == "string" || typeof t.modelValue == "number" ? ("" + t.modelValue).length : Array.isArray(t.modelValue) === !0 ? t.modelValue.length : 0, M = t.maxlength !== void 0 ? t.maxlength : t.maxValues;
609
- return k + (M !== void 0 ? " / " + M : "");
610
- }
611
- }));
612
- const {
613
- isDirtyModel: v,
614
- hasRules: g,
615
- hasError: c,
616
- errorMessage: y,
617
- resetValidation: C
618
- } = bn(e.focused, e.innerLoading), r = e.floatingLabel !== void 0 ? f(() => t.stackLabel === !0 || e.focused.value === !0 || e.floatingLabel.value === !0) : f(() => t.stackLabel === !0 || e.focused.value === !0 || e.hasValue.value === !0), m = f(
619
- () => t.bottomSlots === !0 || t.hint !== void 0 || g.value === !0 || t.counter === !0 || t.error !== null
620
- ), _ = f(() => t.filled === !0 ? "filled" : t.outlined === !0 ? "outlined" : t.borderless === !0 ? "borderless" : t.standout ? "standout" : "standard"), S = f(
621
- () => `q-field row no-wrap items-start q-field--${_.value}` + (e.fieldClass !== void 0 ? ` ${e.fieldClass.value}` : "") + (t.rounded === !0 ? " q-field--rounded" : "") + (t.square === !0 ? " q-field--square" : "") + (r.value === !0 ? " q-field--float" : "") + (E.value === !0 ? " q-field--labeled" : "") + (t.dense === !0 ? " q-field--dense" : "") + (t.itemAligned === !0 ? " q-field--item-aligned q-item-type" : "") + (e.isDark.value === !0 ? " q-field--dark" : "") + (e.getControl === void 0 ? " q-field--auto-height" : "") + (e.focused.value === !0 ? " q-field--focused" : "") + (c.value === !0 ? " q-field--error" : "") + (c.value === !0 || e.focused.value === !0 ? " q-field--highlighted" : "") + (t.hideBottomSpace !== !0 && m.value === !0 ? " q-field--with-bottom" : "") + (t.disable === !0 ? " q-field--disabled" : t.readonly === !0 ? " q-field--readonly" : "")
622
- ), P = f(
623
- () => "q-field__control relative-position row no-wrap" + (t.bgColor !== void 0 ? ` bg-${t.bgColor}` : "") + (c.value === !0 ? " text-negative" : typeof t.standout == "string" && t.standout.length !== 0 && e.focused.value === !0 ? ` ${t.standout}` : t.color !== void 0 ? ` text-${t.color}` : "")
624
- ), E = f(
625
- () => t.labelSlot === !0 || t.label !== void 0
626
- ), q = f(
627
- () => "q-field__label no-pointer-events absolute ellipsis" + (t.labelColor !== void 0 && c.value !== !0 ? ` text-${t.labelColor}` : "")
628
- ), R = f(() => ({
629
- id: e.targetUid.value,
630
- editable: e.editable.value,
631
- focused: e.focused.value,
632
- floatingLabel: r.value,
633
- modelValue: t.modelValue,
634
- emitValue: e.emitValue
635
- })), D = f(() => {
636
- const k = {};
637
- return e.targetUid.value && (k.for = e.targetUid.value), t.disable === !0 && (k["aria-disabled"] = "true"), k;
638
- });
639
- function B() {
640
- const k = document.activeElement;
641
- let M = e.targetRef !== void 0 && e.targetRef.value;
642
- M && (k === null || k.id !== e.targetUid.value) && (M.hasAttribute("tabindex") === !0 || (M = M.querySelector("[tabindex]")), M && M !== k && M.focus({ preventScroll: !0 }));
643
- }
644
- function L() {
645
- Nt(B);
646
- }
647
- function H() {
648
- Sn(B);
649
- const k = document.activeElement;
650
- k !== null && e.rootRef.value.contains(k) && k.blur();
651
- }
652
- function Q(k) {
653
- d !== null && (clearTimeout(d), d = null), e.editable.value === !0 && e.focused.value === !1 && (e.focused.value = !0, l("focus", k));
654
- }
655
- function G(k, M) {
656
- d !== null && clearTimeout(d), d = setTimeout(() => {
657
- d = null, !(document.hasFocus() === !0 && (e.hasPopupOpen === !0 || e.controlRef === void 0 || e.controlRef.value === null || e.controlRef.value.contains(document.activeElement) !== !1)) && (e.focused.value === !0 && (e.focused.value = !1, l("blur", k)), M !== void 0 && M());
658
- });
659
- }
660
- function oe(k) {
661
- ae(k), u.platform.is.mobile !== !0 ? (e.targetRef !== void 0 && e.targetRef.value || e.rootRef.value).focus() : e.rootRef.value.contains(document.activeElement) === !0 && document.activeElement.blur(), t.type === "file" && (e.inputRef.value.value = null), l("update:modelValue", null), e.changeEvent === !0 && l("change", null), l("clear", t.modelValue), ue(() => {
662
- const M = v.value;
663
- C(), v.value = M;
664
- });
665
- }
666
- function A(k) {
667
- [13, 32].includes(k.keyCode) && oe(k);
668
- }
669
- function U() {
670
- const k = [];
671
- return o.prepend !== void 0 && k.push(
672
- h("div", {
673
- class: "q-field__prepend q-field__marginal row no-wrap items-center",
674
- key: "prepend",
675
- onClick: pe
676
- }, o.prepend())
677
- ), k.push(
678
- h("div", {
679
- class: "q-field__control-container col relative-position row no-wrap q-anchor--skip"
680
- }, ne())
681
- ), c.value === !0 && t.noErrorIcon === !1 && k.push(
682
- X("error", [
683
- h(Ae, { name: u.iconSet.field.error, color: "negative" })
684
- ])
685
- ), t.loading === !0 || e.innerLoading.value === !0 ? k.push(
686
- X(
687
- "inner-loading-append",
688
- o.loading !== void 0 ? o.loading() : [h(Ho, { color: t.color })]
689
- )
690
- ) : t.clearable === !0 && e.hasValue.value === !0 && e.editable.value === !0 && k.push(
691
- X("inner-clearable-append", [
692
- h(Ae, {
693
- class: "q-field__focusable-action",
694
- name: t.clearIcon || u.iconSet.field.clear,
695
- tabindex: 0,
696
- role: "button",
697
- "aria-hidden": "false",
698
- "aria-label": u.lang.label.clear,
699
- onKeyup: A,
700
- onClick: oe
701
- })
702
- ])
703
- ), o.append !== void 0 && k.push(
704
- h("div", {
705
- class: "q-field__append q-field__marginal row no-wrap items-center",
706
- key: "append",
707
- onClick: pe
708
- }, o.append())
709
- ), e.getInnerAppend !== void 0 && k.push(
710
- X("inner-append", e.getInnerAppend())
711
- ), e.getControlChild !== void 0 && k.push(
712
- e.getControlChild()
713
- ), k;
714
- }
715
- function ne() {
716
- const k = [];
717
- return t.prefix !== void 0 && t.prefix !== null && k.push(
718
- h("div", {
719
- class: "q-field__prefix no-pointer-events row items-center"
720
- }, t.prefix)
721
- ), e.getShadowControl !== void 0 && e.hasShadow.value === !0 && k.push(
722
- e.getShadowControl()
723
- ), e.getControl !== void 0 ? k.push(e.getControl()) : o.rawControl !== void 0 ? k.push(o.rawControl()) : o.control !== void 0 && k.push(
724
- h("div", {
725
- ref: e.targetRef,
726
- class: "q-field__native row",
727
- tabindex: -1,
728
- ...e.splitAttrs.attributes.value,
729
- "data-autofocus": t.autofocus === !0 || void 0
730
- }, o.control(R.value))
731
- ), E.value === !0 && k.push(
732
- h("div", {
733
- class: q.value
734
- }, Se(o.label, t.label))
735
- ), t.suffix !== void 0 && t.suffix !== null && k.push(
736
- h("div", {
737
- class: "q-field__suffix no-pointer-events row items-center"
738
- }, t.suffix)
739
- ), k.concat(Se(o.default));
740
- }
741
- function te() {
742
- let k, M;
743
- c.value === !0 ? y.value !== null ? (k = [h("div", { role: "alert" }, y.value)], M = `q--slot-error-${y.value}`) : (k = Se(o.error), M = "q--slot-error") : (t.hideHint !== !0 || e.focused.value === !0) && (t.hint !== void 0 ? (k = [h("div", t.hint)], M = `q--slot-hint-${t.hint}`) : (k = Se(o.hint), M = "q--slot-hint"));
744
- const se = t.counter === !0 || o.counter !== void 0;
745
- if (t.hideBottomSpace === !0 && se === !1 && k === void 0)
746
- return;
747
- const s = h("div", {
748
- key: M,
749
- class: "q-field__messages col"
750
- }, k);
751
- return h("div", {
752
- class: "q-field__bottom row items-start q-field__bottom--" + (t.hideBottomSpace !== !0 ? "animated" : "stale"),
753
- onClick: pe
754
- }, [
755
- t.hideBottomSpace === !0 ? s : h(bt, { name: "q-transition--field-message" }, () => s),
756
- se === !0 ? h("div", {
757
- class: "q-field__counter"
758
- }, o.counter !== void 0 ? o.counter() : e.computedCounter.value) : null
759
- ]);
760
- }
761
- function X(k, M) {
762
- return M === null ? null : h("div", {
763
- key: k,
764
- class: "q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"
765
- }, M);
766
- }
767
- let re = !1;
768
- return Ct(() => {
769
- re = !0;
770
- }), Ll(() => {
771
- re === !0 && t.autofocus === !0 && i.focus();
772
- }), t.autofocus === !0 && tt(() => {
773
- i.focus();
774
- }), ce(() => {
775
- d !== null && clearTimeout(d);
776
- }), Object.assign(i, { focus: L, blur: H }), function() {
777
- const M = e.getControl === void 0 && o.control === void 0 ? {
778
- ...e.splitAttrs.attributes.value,
779
- "data-autofocus": t.autofocus === !0 || void 0,
780
- ...D.value
781
- } : D.value;
782
- return h(e.tag.value, {
783
- ref: e.rootRef,
784
- class: [
785
- S.value,
786
- a.class
787
- ],
788
- style: a.style,
789
- ...M
790
- }, [
791
- o.before !== void 0 ? h("div", {
792
- class: "q-field__before q-field__marginal row no-wrap items-center",
793
- onClick: pe
794
- }, o.before()) : null,
795
- h("div", {
796
- class: "q-field__inner relative-position col self-stretch"
797
- }, [
798
- h("div", {
799
- ref: e.controlRef,
800
- class: P.value,
801
- tabindex: -1,
802
- ...e.controlEvents
803
- }, U()),
804
- m.value === !0 ? te() : null
805
- ]),
806
- o.after !== void 0 ? h("div", {
807
- class: "q-field__after q-field__marginal row no-wrap items-center",
808
- onClick: pe
809
- }, o.after()) : null
810
- ]);
811
- };
812
- }
813
- const xn = be({
814
- name: "QField",
815
- inheritAttrs: !1,
816
- props: {
817
- ...Kt,
818
- tag: {
819
- type: String,
820
- default: "label"
821
- }
822
- },
823
- emits: Xl,
824
- setup() {
825
- return Gl(
826
- Yl({ tagProp: !0 })
827
- );
828
- }
829
- }), Cn = {
830
- xs: 8,
831
- sm: 10,
832
- md: 14,
833
- lg: 20,
834
- xl: 24
835
- }, kn = be({
836
- name: "QChip",
837
- props: {
838
- ...lt,
839
- ...Hl,
840
- dense: Boolean,
841
- icon: String,
842
- iconRight: String,
843
- iconRemove: String,
844
- iconSelected: String,
845
- label: [String, Number],
846
- color: String,
847
- textColor: String,
848
- modelValue: {
849
- type: Boolean,
850
- default: !0
851
- },
852
- selected: {
853
- type: Boolean,
854
- default: null
855
- },
856
- square: Boolean,
857
- outline: Boolean,
858
- clickable: Boolean,
859
- removable: Boolean,
860
- removeAriaLabel: String,
861
- tabindex: [String, Number],
862
- disable: Boolean,
863
- ripple: {
864
- type: [Boolean, Object],
865
- default: !0
866
- }
867
- },
868
- emits: ["update:modelValue", "update:selected", "remove", "click"],
869
- setup(e, { slots: t, emit: l }) {
870
- const { proxy: { $q: o } } = le(), a = ot(e, o), i = Ol(e, Cn), u = f(() => e.selected === !0 || e.icon !== void 0), d = f(() => e.selected === !0 ? e.iconSelected || o.iconSet.chip.selected : e.icon), v = f(() => e.iconRemove || o.iconSet.chip.remove), g = f(
871
- () => e.disable === !1 && (e.clickable === !0 || e.selected !== null)
872
- ), c = f(() => {
873
- const S = e.outline === !0 && e.color || e.textColor;
874
- return "q-chip row inline no-wrap items-center" + (e.outline === !1 && e.color !== void 0 ? ` bg-${e.color}` : "") + (S ? ` text-${S} q-chip--colored` : "") + (e.disable === !0 ? " disabled" : "") + (e.dense === !0 ? " q-chip--dense" : "") + (e.outline === !0 ? " q-chip--outline" : "") + (e.selected === !0 ? " q-chip--selected" : "") + (g.value === !0 ? " q-chip--clickable cursor-pointer non-selectable q-hoverable" : "") + (e.square === !0 ? " q-chip--square" : "") + (a.value === !0 ? " q-chip--dark q-dark" : "");
875
- }), y = f(() => {
876
- const S = e.disable === !0 ? { tabindex: -1, "aria-disabled": "true" } : { tabindex: e.tabindex || 0 }, P = {
877
- ...S,
878
- role: "button",
879
- "aria-hidden": "false",
880
- "aria-label": e.removeAriaLabel || o.lang.label.remove
881
- };
882
- return { chip: S, remove: P };
883
- });
884
- function C(S) {
885
- S.keyCode === 13 && r(S);
886
- }
887
- function r(S) {
888
- e.disable || (l("update:selected", !e.selected), l("click", S));
889
- }
890
- function m(S) {
891
- (S.keyCode === void 0 || S.keyCode === 13) && (ae(S), e.disable === !1 && (l("update:modelValue", !1), l("remove")));
892
- }
893
- function _() {
894
- const S = [];
895
- g.value === !0 && S.push(
896
- h("div", { class: "q-focus-helper" })
897
- ), u.value === !0 && S.push(
898
- h(Ae, {
899
- class: "q-chip__icon q-chip__icon--left",
900
- name: d.value
901
- })
902
- );
903
- const P = e.label !== void 0 ? [h("div", { class: "ellipsis" }, [e.label])] : void 0;
904
- return S.push(
905
- h("div", {
906
- class: "q-chip__content col row no-wrap items-center q-anchor--skip"
907
- }, Do(t.default, P))
908
- ), e.iconRight && S.push(
909
- h(Ae, {
910
- class: "q-chip__icon q-chip__icon--right",
911
- name: e.iconRight
912
- })
913
- ), e.removable === !0 && S.push(
914
- h(Ae, {
915
- class: "q-chip__icon q-chip__icon--remove cursor-pointer",
916
- name: v.value,
917
- ...y.value.remove,
918
- onClick: m,
919
- onKeyup: m
920
- })
921
- ), S;
922
- }
923
- return () => {
924
- if (e.modelValue === !1) return;
925
- const S = {
926
- class: c.value,
927
- style: i.value
928
- };
929
- return g.value === !0 && Object.assign(
930
- S,
931
- y.value.chip,
932
- { onClick: r, onKeyup: C }
933
- ), $o(
934
- "div",
935
- S,
936
- _(),
937
- "ripple",
938
- e.ripple !== !1 && e.disable !== !0,
939
- () => [[Po, e.ripple]]
940
- );
941
- };
942
- }
943
- });
944
- function qn() {
945
- if (window.getSelection !== void 0) {
946
- const e = window.getSelection();
947
- e.empty !== void 0 ? e.empty() : e.removeAllRanges !== void 0 && (e.removeAllRanges(), Zo.is.mobile !== !0 && e.addRange(document.createRange()));
948
- } else document.selection !== void 0 && document.selection.empty();
949
- }
950
- const Vn = {
951
- /* SSR does not know about Element */
952
- target: {
953
- type: [Boolean, String, Element],
954
- default: !0
955
- },
956
- noParentEvent: Boolean
957
- }, _n = {
958
- ...Vn,
959
- contextMenu: Boolean
960
- };
961
- function En({
962
- showing: e,
963
- avoidEmit: t,
964
- // required for QPopupProxy (true)
965
- configureAnchorEl: l
966
- // optional
967
- }) {
968
- const { props: o, proxy: a, emit: i } = le(), u = T(null);
969
- let d = null;
970
- function v(r) {
971
- return u.value === null ? !1 : r === void 0 || r.touches === void 0 || r.touches.length <= 1;
972
- }
973
- const g = {};
974
- l === void 0 && (Object.assign(g, {
975
- hide(r) {
976
- a.hide(r);
977
- },
978
- toggle(r) {
979
- a.toggle(r), r.qAnchorHandled = !0;
980
- },
981
- toggleKey(r) {
982
- kt(r, 13) === !0 && g.toggle(r);
983
- },
984
- contextClick(r) {
985
- a.hide(r), pe(r), ue(() => {
986
- a.show(r), r.qAnchorHandled = !0;
987
- });
988
- },
989
- prevent: pe,
990
- mobileTouch(r) {
991
- if (g.mobileCleanup(r), v(r) !== !0)
992
- return;
993
- a.hide(r), u.value.classList.add("non-selectable");
994
- const m = r.target;
995
- rl(g, "anchor", [
996
- [m, "touchmove", "mobileCleanup", "passive"],
997
- [m, "touchend", "mobileCleanup", "passive"],
998
- [m, "touchcancel", "mobileCleanup", "passive"],
999
- [u.value, "contextmenu", "prevent", "notPassive"]
1000
- ]), d = setTimeout(() => {
1001
- d = null, a.show(r), r.qAnchorHandled = !0;
1002
- }, 300);
1003
- },
1004
- mobileCleanup(r) {
1005
- u.value.classList.remove("non-selectable"), d !== null && (clearTimeout(d), d = null), e.value === !0 && r !== void 0 && qn();
1006
- }
1007
- }), l = function(r = o.contextMenu) {
1008
- if (o.noParentEvent === !0 || u.value === null) return;
1009
- let m;
1010
- r === !0 ? a.$q.platform.is.mobile === !0 ? m = [
1011
- [u.value, "touchstart", "mobileTouch", "passive"]
1012
- ] : m = [
1013
- [u.value, "mousedown", "hide", "passive"],
1014
- [u.value, "contextmenu", "contextClick", "notPassive"]
1015
- ] : m = [
1016
- [u.value, "click", "toggle", "passive"],
1017
- [u.value, "keyup", "toggleKey", "passive"]
1018
- ], rl(g, "anchor", m);
1019
- });
1020
- function c() {
1021
- Wo(g, "anchor");
1022
- }
1023
- function y(r) {
1024
- for (u.value = r; u.value.classList.contains("q-anchor--skip"); )
1025
- u.value = u.value.parentNode;
1026
- l();
1027
- }
1028
- function C() {
1029
- if (o.target === !1 || o.target === "" || a.$el.parentNode === null)
1030
- u.value = null;
1031
- else if (o.target === !0)
1032
- y(a.$el.parentNode);
1033
- else {
1034
- let r = o.target;
1035
- if (typeof o.target == "string")
1036
- try {
1037
- r = document.querySelector(o.target);
1038
- } catch {
1039
- r = void 0;
1040
- }
1041
- r != null ? (u.value = r.$el || r, l()) : (u.value = null, console.error(`Anchor: target "${o.target}" not found`));
1042
- }
1043
- }
1044
- return K(() => o.contextMenu, (r) => {
1045
- u.value !== null && (c(), l(r));
1046
- }), K(() => o.target, () => {
1047
- u.value !== null && c(), C();
1048
- }), K(() => o.noParentEvent, (r) => {
1049
- u.value !== null && (r === !0 ? c() : l());
1050
- }), tt(() => {
1051
- C(), t !== !0 && o.modelValue === !0 && u.value === null && i("update:modelValue", !1);
1052
- }), ce(() => {
1053
- d !== null && clearTimeout(d), c();
1054
- }), {
1055
- anchorEl: u,
1056
- canShow: v,
1057
- anchorEvents: g
1058
- };
1059
- }
1060
- function Bn(e, t) {
1061
- const l = T(null);
1062
- let o;
1063
- function a(d, v) {
1064
- const g = `${v !== void 0 ? "add" : "remove"}EventListener`, c = v !== void 0 ? v : o;
1065
- d !== window && d[g]("scroll", c, ge.passive), window[g]("scroll", c, ge.passive), o = v;
1066
- }
1067
- function i() {
1068
- l.value !== null && (a(l.value), l.value = null);
1069
- }
1070
- const u = K(() => e.noParentEvent, () => {
1071
- l.value !== null && (i(), t());
1072
- });
1073
- return ce(u), {
1074
- localScrollTarget: l,
1075
- unconfigureScrollTarget: i,
1076
- changeScrollEvent: a
1077
- };
1078
- }
1079
- const Zl = {
1080
- modelValue: {
1081
- type: Boolean,
1082
- default: null
1083
- },
1084
- "onUpdate:modelValue": [Function, Array]
1085
- }, Jl = [
1086
- "beforeShow",
1087
- "show",
1088
- "beforeHide",
1089
- "hide"
1090
- ];
1091
- function eo({
1092
- showing: e,
1093
- canShow: t,
1094
- // optional
1095
- hideOnRouteChange: l,
1096
- // optional
1097
- handleShow: o,
1098
- // optional
1099
- handleHide: a,
1100
- // optional
1101
- processOnMount: i
1102
- // optional
1103
- }) {
1104
- const u = le(), { props: d, emit: v, proxy: g } = u;
1105
- let c;
1106
- function y(E) {
1107
- e.value === !0 ? m(E) : C(E);
1108
- }
1109
- function C(E) {
1110
- if (d.disable === !0 || E !== void 0 && E.qAnchorHandled === !0 || t !== void 0 && t(E) !== !0)
1111
- return;
1112
- const q = d["onUpdate:modelValue"] !== void 0;
1113
- q === !0 && (v("update:modelValue", !0), c = E, ue(() => {
1114
- c === E && (c = void 0);
1115
- })), (d.modelValue === null || q === !1) && r(E);
1116
- }
1117
- function r(E) {
1118
- e.value !== !0 && (e.value = !0, v("beforeShow", E), o !== void 0 ? o(E) : v("show", E));
1119
- }
1120
- function m(E) {
1121
- if (d.disable === !0)
1122
- return;
1123
- const q = d["onUpdate:modelValue"] !== void 0;
1124
- q === !0 && (v("update:modelValue", !1), c = E, ue(() => {
1125
- c === E && (c = void 0);
1126
- })), (d.modelValue === null || q === !1) && _(E);
1127
- }
1128
- function _(E) {
1129
- e.value !== !1 && (e.value = !1, v("beforeHide", E), a !== void 0 ? a(E) : v("hide", E));
1130
- }
1131
- function S(E) {
1132
- d.disable === !0 && E === !0 ? d["onUpdate:modelValue"] !== void 0 && v("update:modelValue", !1) : E === !0 !== e.value && (E === !0 ? r : _)(c);
1133
- }
1134
- K(() => d.modelValue, S), l !== void 0 && jo(u) === !0 && K(() => g.$route.fullPath, () => {
1135
- l.value === !0 && e.value === !0 && m();
1136
- }), tt(() => {
1137
- S(d.modelValue);
1138
- });
1139
- const P = { show: C, hide: m, toggle: y };
1140
- return Object.assign(g, P), P;
1141
- }
1142
- const bl = {};
1143
- let An = 1, Tn = document.body;
1144
- function Rn(e, t) {
1145
- const l = document.createElement("div");
1146
- if (l.id = t !== void 0 ? `q-portal--${t}--${An++}` : e, bl.globalNodes !== void 0) {
1147
- const o = bl.globalNodes.class;
1148
- o !== void 0 && (l.className = o);
1149
- }
1150
- return Tn.appendChild(l), l;
1151
- }
1152
- function zn(e) {
1153
- e.remove();
1154
- }
1155
- const Je = [];
1156
- function Fn(e, t) {
1157
- do {
1158
- if (e.$options.name === "QMenu") {
1159
- if (e.hide(t), e.$props.separateClosePopup === !0)
1160
- return Rt(e);
1161
- } else if (e.__qPortal === !0) {
1162
- const l = Rt(e);
1163
- return l !== void 0 && l.$options.name === "QPopupProxy" ? (e.hide(t), l) : e;
1164
- }
1165
- e = Rt(e);
1166
- } while (e != null);
1167
- }
1168
- const Mn = be({
1169
- name: "QPortal",
1170
- setup(e, { slots: t }) {
1171
- return () => t.default();
1172
- }
1173
- });
1174
- function Ln(e) {
1175
- for (e = e.parent; e != null; ) {
1176
- if (e.type.name === "QGlobalDialog")
1177
- return !0;
1178
- if (e.type.name === "QDialog" || e.type.name === "QMenu")
1179
- return !1;
1180
- e = e.parent;
1181
- }
1182
- return !1;
1183
- }
1184
- function to(e, t, l, o) {
1185
- const a = T(!1), i = T(!1);
1186
- let u = null;
1187
- const d = {}, v = o === "dialog" && Ln(e);
1188
- function g(y) {
1189
- if (y === !0) {
1190
- pl(d), i.value = !0;
1191
- return;
1192
- }
1193
- i.value = !1, a.value === !1 && (v === !1 && u === null && (u = Rn(!1, o)), a.value = !0, Je.push(e.proxy), yn(d));
1194
- }
1195
- function c(y) {
1196
- if (i.value = !1, y !== !0) return;
1197
- pl(d), a.value = !1;
1198
- const C = Je.indexOf(e.proxy);
1199
- C !== -1 && Je.splice(C, 1), u !== null && (zn(u), u = null);
1200
- }
1201
- return Eo(() => {
1202
- c(!0);
1203
- }), e.proxy.__qPortal = !0, Dl(e.proxy, "contentEl", () => t.value), {
1204
- showPortal: g,
1205
- hidePortal: c,
1206
- portalIsActive: a,
1207
- portalIsAccessible: i,
1208
- renderPortal: () => v === !0 ? l() : a.value === !0 ? [h(Bo, { to: u }, h(Mn, l))] : void 0
1209
- };
1210
- }
1211
- const lo = {
1212
- transitionShow: {
1213
- type: String,
1214
- default: "fade"
1215
- },
1216
- transitionHide: {
1217
- type: String,
1218
- default: "fade"
1219
- },
1220
- transitionDuration: {
1221
- type: [String, Number],
1222
- default: 300
1223
- }
1224
- };
1225
- function oo(e, t = () => {
1226
- }, l = () => {
1227
- }) {
1228
- return {
1229
- transitionProps: f(() => {
1230
- const o = `q-transition--${e.transitionShow || t()}`, a = `q-transition--${e.transitionHide || l()}`;
1231
- return {
1232
- appear: !0,
1233
- enterFromClass: `${o}-enter-from`,
1234
- enterActiveClass: `${o}-enter-active`,
1235
- enterToClass: `${o}-enter-to`,
1236
- leaveFromClass: `${a}-leave-from`,
1237
- leaveActiveClass: `${a}-leave-active`,
1238
- leaveToClass: `${a}-leave-to`
1239
- };
1240
- }),
1241
- transitionStyle: f(() => `--q-transition-duration: ${e.transitionDuration}ms`)
1242
- };
1243
- }
1244
- function no() {
1245
- let e;
1246
- const t = le();
1247
- function l() {
1248
- e = void 0;
1249
- }
1250
- return Ct(l), ce(l), {
1251
- removeTick: l,
1252
- registerTick(o) {
1253
- e = o, ue(() => {
1254
- e === o && ($l(t) === !1 && e(), e = void 0);
1255
- });
1256
- }
1257
- };
1258
- }
1259
- function io() {
1260
- let e = null;
1261
- const t = le();
1262
- function l() {
1263
- e !== null && (clearTimeout(e), e = null);
1264
- }
1265
- return Ct(l), ce(l), {
1266
- removeTimeout: l,
1267
- registerTimeout(o, a) {
1268
- l(), $l(t) === !1 && (e = setTimeout(() => {
1269
- e = null, o();
1270
- }, a));
1271
- }
1272
- };
1273
- }
1274
- const On = [Element, String], In = [null, document, document.body, document.scrollingElement, document.documentElement];
1275
- function Hn(e, t) {
1276
- let l = No(t);
1277
- if (l === void 0) {
1278
- if (e == null)
1279
- return window;
1280
- l = e.closest(".scroll,.scroll-y,.overflow-auto");
1281
- }
1282
- return In.includes(l) ? window : l;
1283
- }
1284
- function $n(e) {
1285
- return e === window ? window.pageYOffset || window.scrollY || document.body.scrollTop || 0 : e.scrollTop;
1286
- }
1287
- function Pn(e) {
1288
- return e === window ? window.pageXOffset || window.scrollX || document.body.scrollLeft || 0 : e.scrollLeft;
1289
- }
1290
- let mt;
1291
- function Dn() {
1292
- if (mt !== void 0)
1293
- return mt;
1294
- const e = document.createElement("p"), t = document.createElement("div");
1295
- sl(e, {
1296
- width: "100%",
1297
- height: "200px"
1298
- }), sl(t, {
1299
- position: "absolute",
1300
- top: "0px",
1301
- left: "0px",
1302
- visibility: "hidden",
1303
- width: "200px",
1304
- height: "150px",
1305
- overflow: "hidden"
1306
- }), t.appendChild(e), document.body.appendChild(t);
1307
- const l = e.offsetWidth;
1308
- t.style.overflow = "scroll";
1309
- let o = e.offsetWidth;
1310
- return l === o && (o = t.clientWidth), t.remove(), mt = l - o, mt;
1311
- }
1312
- function Wn(e, t = !0) {
1313
- 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"]));
1314
- }
1315
- const Te = [];
1316
- let je;
1317
- function jn(e) {
1318
- je = e.keyCode === 27;
1319
- }
1320
- function Nn() {
1321
- je === !0 && (je = !1);
1322
- }
1323
- function Kn(e) {
1324
- je === !0 && (je = !1, kt(e, 27) === !0 && Te[Te.length - 1](e));
1325
- }
1326
- function uo(e) {
1327
- window[e]("keydown", jn), window[e]("blur", Nn), window[e]("keyup", Kn), je = !1;
1328
- }
1329
- function ao(e) {
1330
- we.is.desktop === !0 && (Te.push(e), Te.length === 1 && uo("addEventListener"));
1331
- }
1332
- function yt(e) {
1333
- const t = Te.indexOf(e);
1334
- t !== -1 && (Te.splice(t, 1), Te.length === 0 && uo("removeEventListener"));
1335
- }
1336
- const { notPassiveCapture: St } = ge, Re = [];
1337
- function wt(e) {
1338
- const t = e.target;
1339
- if (t === void 0 || t.nodeType === 8 || t.classList.contains("no-pointer-events") === !0)
1340
- return;
1341
- let l = Je.length - 1;
1342
- for (; l >= 0; ) {
1343
- const o = Je[l].$;
1344
- if (o.type.name === "QTooltip") {
1345
- l--;
1346
- continue;
1347
- }
1348
- if (o.type.name !== "QDialog")
1349
- break;
1350
- if (o.props.seamless !== !0)
1351
- return;
1352
- l--;
1353
- }
1354
- for (let o = Re.length - 1; o >= 0; o--) {
1355
- const a = Re[o];
1356
- if ((a.anchorEl.value === null || a.anchorEl.value.contains(t) === !1) && (t === document.body || a.innerRef.value !== null && a.innerRef.value.contains(t) === !1))
1357
- e.qClickOutside = !0, a.onClickOutside(e);
1358
- else
1359
- return;
1360
- }
1361
- }
1362
- function Qn(e) {
1363
- Re.push(e), Re.length === 1 && (document.addEventListener("mousedown", wt, St), document.addEventListener("touchstart", wt, St));
1364
- }
1365
- function yl(e) {
1366
- const t = Re.findIndex((l) => l === e);
1367
- t !== -1 && (Re.splice(t, 1), Re.length === 0 && (document.removeEventListener("mousedown", wt, St), document.removeEventListener("touchstart", wt, St)));
1368
- }
1369
- let Sl, wl;
1370
- function xl(e) {
1371
- const t = e.split(" ");
1372
- 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;
1373
- }
1374
- function Un(e) {
1375
- return e ? !(e.length !== 2 || typeof e[0] != "number" || typeof e[1] != "number") : !0;
1376
- }
1377
- const jt = {
1378
- "start#ltr": "left",
1379
- "start#rtl": "right",
1380
- "end#ltr": "right",
1381
- "end#rtl": "left"
1382
- };
1383
- ["left", "middle", "right"].forEach((e) => {
1384
- jt[`${e}#ltr`] = e, jt[`${e}#rtl`] = e;
1385
- });
1386
- function Cl(e, t) {
1387
- const l = e.split(" ");
1388
- return {
1389
- vertical: l[0],
1390
- horizontal: jt[`${l[1]}#${t === !0 ? "rtl" : "ltr"}`]
1391
- };
1392
- }
1393
- function Xn(e, t) {
1394
- let { top: l, left: o, right: a, bottom: i, width: u, height: d } = e.getBoundingClientRect();
1395
- return t !== void 0 && (l -= t[1], o -= t[0], i += t[1], a += t[0], u += t[0], d += t[1]), {
1396
- top: l,
1397
- bottom: i,
1398
- height: d,
1399
- left: o,
1400
- right: a,
1401
- width: u,
1402
- middle: o + (a - o) / 2,
1403
- center: l + (i - l) / 2
1404
- };
1405
- }
1406
- function Yn(e, t, l) {
1407
- let { top: o, left: a } = e.getBoundingClientRect();
1408
- return o += t.top, a += t.left, l !== void 0 && (o += l[1], a += l[0]), {
1409
- top: o,
1410
- bottom: o + 1,
1411
- height: 1,
1412
- left: a,
1413
- right: a + 1,
1414
- width: 1,
1415
- middle: a,
1416
- center: o
1417
- };
1418
- }
1419
- function Gn(e, t) {
1420
- return {
1421
- top: 0,
1422
- center: t / 2,
1423
- bottom: t,
1424
- left: 0,
1425
- middle: e / 2,
1426
- right: e
1427
- };
1428
- }
1429
- function kl(e, t, l, o) {
1430
- return {
1431
- top: e[l.vertical] - t[o.vertical],
1432
- left: e[l.horizontal] - t[o.horizontal]
1433
- };
1434
- }
1435
- function ro(e, t = 0) {
1436
- if (e.targetEl === null || e.anchorEl === null || t > 5)
1437
- return;
1438
- if (e.targetEl.offsetHeight === 0 || e.targetEl.offsetWidth === 0) {
1439
- setTimeout(() => {
1440
- ro(e, t + 1);
1441
- }, 10);
1442
- return;
1443
- }
1444
- const {
1445
- targetEl: l,
1446
- offset: o,
1447
- anchorEl: a,
1448
- anchorOrigin: i,
1449
- selfOrigin: u,
1450
- absoluteOffset: d,
1451
- fit: v,
1452
- cover: g,
1453
- maxHeight: c,
1454
- maxWidth: y
1455
- } = e;
1456
- if (we.is.ios === !0 && window.visualViewport !== void 0) {
1457
- const B = document.body.style, { offsetLeft: L, offsetTop: H } = window.visualViewport;
1458
- L !== Sl && (B.setProperty("--q-pe-left", L + "px"), Sl = L), H !== wl && (B.setProperty("--q-pe-top", H + "px"), wl = H);
1459
- }
1460
- const { scrollLeft: C, scrollTop: r } = l, m = d === void 0 ? Xn(a, g === !0 ? [0, 0] : o) : Yn(a, d, o);
1461
- Object.assign(l.style, {
1462
- top: 0,
1463
- left: 0,
1464
- minWidth: null,
1465
- minHeight: null,
1466
- maxWidth: y,
1467
- maxHeight: c,
1468
- visibility: "visible"
1469
- });
1470
- const { offsetWidth: _, offsetHeight: S } = l, { elWidth: P, elHeight: E } = v === !0 || g === !0 ? { elWidth: Math.max(m.width, _), elHeight: g === !0 ? Math.max(m.height, S) : S } : { elWidth: _, elHeight: S };
1471
- let q = { maxWidth: y, maxHeight: c };
1472
- (v === !0 || g === !0) && (q.minWidth = m.width + "px", g === !0 && (q.minHeight = m.height + "px")), Object.assign(l.style, q);
1473
- const R = Gn(P, E);
1474
- let D = kl(m, R, i, u);
1475
- if (d === void 0 || o === void 0)
1476
- Mt(D, m, R, i, u);
1477
- else {
1478
- const { top: B, left: L } = D;
1479
- Mt(D, m, R, i, u);
1480
- let H = !1;
1481
- if (D.top !== B) {
1482
- H = !0;
1483
- const Q = 2 * o[1];
1484
- m.center = m.top -= Q, m.bottom -= Q + 2;
1485
- }
1486
- if (D.left !== L) {
1487
- H = !0;
1488
- const Q = 2 * o[0];
1489
- m.middle = m.left -= Q, m.right -= Q + 2;
1490
- }
1491
- H === !0 && (D = kl(m, R, i, u), Mt(D, m, R, i, u));
1492
- }
1493
- q = {
1494
- top: D.top + "px",
1495
- left: D.left + "px"
1496
- }, D.maxHeight !== void 0 && (q.maxHeight = D.maxHeight + "px", m.height > D.maxHeight && (q.minHeight = q.maxHeight)), D.maxWidth !== void 0 && (q.maxWidth = D.maxWidth + "px", m.width > D.maxWidth && (q.minWidth = q.maxWidth)), Object.assign(l.style, q), l.scrollTop !== r && (l.scrollTop = r), l.scrollLeft !== C && (l.scrollLeft = C);
1497
- }
1498
- function Mt(e, t, l, o, a) {
1499
- const i = l.bottom, u = l.right, d = Dn(), v = window.innerHeight - d, g = document.body.clientWidth;
1500
- if (e.top < 0 || e.top + i > v)
1501
- if (a.vertical === "center")
1502
- e.top = t[o.vertical] > v / 2 ? Math.max(0, v - i) : 0, e.maxHeight = Math.min(i, v);
1503
- else if (t[o.vertical] > v / 2) {
1504
- const c = Math.min(
1505
- v,
1506
- o.vertical === "center" ? t.center : o.vertical === a.vertical ? t.bottom : t.top
1507
- );
1508
- e.maxHeight = Math.min(i, c), e.top = Math.max(0, c - i);
1509
- } else
1510
- e.top = Math.max(
1511
- 0,
1512
- o.vertical === "center" ? t.center : o.vertical === a.vertical ? t.top : t.bottom
1513
- ), e.maxHeight = Math.min(i, v - e.top);
1514
- if (e.left < 0 || e.left + u > g)
1515
- if (e.maxWidth = Math.min(u, g), a.horizontal === "middle")
1516
- e.left = t[o.horizontal] > g / 2 ? Math.max(0, g - u) : 0;
1517
- else if (t[o.horizontal] > g / 2) {
1518
- const c = Math.min(
1519
- g,
1520
- o.horizontal === "middle" ? t.middle : o.horizontal === a.horizontal ? t.right : t.left
1521
- );
1522
- e.maxWidth = Math.min(u, c), e.left = Math.max(0, c - e.maxWidth);
1523
- } else
1524
- e.left = Math.max(
1525
- 0,
1526
- o.horizontal === "middle" ? t.middle : o.horizontal === a.horizontal ? t.left : t.right
1527
- ), e.maxWidth = Math.min(u, g - e.left);
1528
- }
1529
- const Zn = be({
1530
- name: "QMenu",
1531
- inheritAttrs: !1,
1532
- props: {
1533
- ..._n,
1534
- ...Zl,
1535
- ...lt,
1536
- ...lo,
1537
- persistent: Boolean,
1538
- autoClose: Boolean,
1539
- separateClosePopup: Boolean,
1540
- noRouteDismiss: Boolean,
1541
- noRefocus: Boolean,
1542
- noFocus: Boolean,
1543
- fit: Boolean,
1544
- cover: Boolean,
1545
- square: Boolean,
1546
- anchor: {
1547
- type: String,
1548
- validator: xl
1549
- },
1550
- self: {
1551
- type: String,
1552
- validator: xl
1553
- },
1554
- offset: {
1555
- type: Array,
1556
- validator: Un
1557
- },
1558
- scrollTarget: On,
1559
- touchPosition: Boolean,
1560
- maxHeight: {
1561
- type: String,
1562
- default: null
1563
- },
1564
- maxWidth: {
1565
- type: String,
1566
- default: null
1567
- }
1568
- },
1569
- emits: [
1570
- ...Jl,
1571
- "click",
1572
- "escapeKey"
1573
- ],
1574
- setup(e, { slots: t, emit: l, attrs: o }) {
1575
- let a = null, i, u, d;
1576
- const v = le(), { proxy: g } = v, { $q: c } = g, y = T(null), C = T(!1), r = f(
1577
- () => e.persistent !== !0 && e.noRouteDismiss !== !0
1578
- ), m = ot(e, c), { registerTick: _, removeTick: S } = no(), { registerTimeout: P } = io(), { transitionProps: E, transitionStyle: q } = oo(e), { localScrollTarget: R, changeScrollEvent: D, unconfigureScrollTarget: B } = Bn(e, O), { anchorEl: L, canShow: H } = En({ showing: C }), { hide: Q } = eo({
1579
- showing: C,
1580
- canShow: H,
1581
- handleShow: se,
1582
- handleHide: s,
1583
- hideOnRouteChange: r,
1584
- processOnMount: !0
1585
- }), { showPortal: G, hidePortal: oe, renderPortal: A } = to(v, y, N, "menu"), U = {
1586
- anchorEl: L,
1587
- innerRef: y,
1588
- onClickOutside(b) {
1589
- if (e.persistent !== !0 && C.value === !0)
1590
- return Q(b), // always prevent touch event
1591
- (b.type === "touchstart" || b.target.classList.contains("q-dialog__backdrop")) && ae(b), !0;
1592
- }
1593
- }, ne = f(
1594
- () => Cl(
1595
- e.anchor || (e.cover === !0 ? "center middle" : "bottom start"),
1596
- c.lang.rtl
1597
- )
1598
- ), te = f(() => e.cover === !0 ? ne.value : Cl(e.self || "top start", c.lang.rtl)), X = f(
1599
- () => (e.square === !0 ? " q-menu--square" : "") + (m.value === !0 ? " q-menu--dark q-dark" : "")
1600
- ), re = f(() => e.autoClose === !0 ? { onClick: V } : {}), k = f(
1601
- () => C.value === !0 && e.persistent !== !0
1602
- );
1603
- K(k, (b) => {
1604
- b === !0 ? (ao(F), Qn(U)) : (yt(F), yl(U));
1605
- });
1606
- function M() {
1607
- Nt(() => {
1608
- let b = y.value;
1609
- b && b.contains(document.activeElement) !== !0 && (b = b.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || b.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || b.querySelector("[autofocus], [data-autofocus]") || b, b.focus({ preventScroll: !0 }));
1610
- });
1611
- }
1612
- function se(b) {
1613
- if (a = e.noRefocus === !1 ? document.activeElement : null, Wl(I), G(), O(), i = void 0, b !== void 0 && (e.touchPosition || e.contextMenu)) {
1614
- const Z = Ko(b);
1615
- if (Z.left !== void 0) {
1616
- const { top: ve, left: ze } = L.value.getBoundingClientRect();
1617
- i = { left: Z.left - ze, top: Z.top - ve };
1618
- }
1619
- }
1620
- u === void 0 && (u = K(
1621
- () => c.screen.width + "|" + c.screen.height + "|" + e.self + "|" + e.anchor + "|" + c.lang.rtl,
1622
- z
1623
- )), e.noFocus !== !0 && document.activeElement.blur(), _(() => {
1624
- z(), e.noFocus !== !0 && M();
1625
- }), P(() => {
1626
- c.platform.is.ios === !0 && (d = e.autoClose, y.value.click()), z(), G(!0), l("show", b);
1627
- }, e.transitionDuration);
1628
- }
1629
- function s(b) {
1630
- S(), oe(), p(!0), a !== null && // menu was hidden from code or ESC plugin
1631
- (b === void 0 || b.qClickOutside !== !0) && (((b && b.type.indexOf("key") === 0 ? a.closest('[tabindex]:not([tabindex^="-"])') : void 0) || a).focus(), a = null), P(() => {
1632
- oe(!0), l("hide", b);
1633
- }, e.transitionDuration);
1634
- }
1635
- function p(b) {
1636
- i = void 0, u !== void 0 && (u(), u = void 0), (b === !0 || C.value === !0) && (Pt(I), B(), yl(U), yt(F)), b !== !0 && (a = null);
1637
- }
1638
- function O() {
1639
- (L.value !== null || e.scrollTarget !== void 0) && (R.value = Hn(L.value, e.scrollTarget), D(R.value, z));
1640
- }
1641
- function V(b) {
1642
- d !== !0 ? (Fn(g, b), l("click", b)) : d = !1;
1643
- }
1644
- function I(b) {
1645
- k.value === !0 && e.noFocus !== !0 && Pl(y.value, b.target) !== !0 && M();
1646
- }
1647
- function F(b) {
1648
- l("escapeKey"), Q(b);
1649
- }
1650
- function z() {
1651
- ro({
1652
- targetEl: y.value,
1653
- offset: e.offset,
1654
- anchorEl: L.value,
1655
- anchorOrigin: ne.value,
1656
- selfOrigin: te.value,
1657
- absoluteOffset: i,
1658
- fit: e.fit,
1659
- cover: e.cover,
1660
- maxHeight: e.maxHeight,
1661
- maxWidth: e.maxWidth
1662
- });
1663
- }
1664
- function N() {
1665
- return h(
1666
- bt,
1667
- E.value,
1668
- () => C.value === !0 ? h("div", {
1669
- role: "menu",
1670
- ...o,
1671
- ref: y,
1672
- tabindex: -1,
1673
- class: [
1674
- "q-menu q-position-engine scroll" + X.value,
1675
- o.class
1676
- ],
1677
- style: [
1678
- o.style,
1679
- q.value
1680
- ],
1681
- ...re.value
1682
- }, Se(t.default)) : null
1683
- );
1684
- }
1685
- return ce(p), Object.assign(g, { focus: M, updatePosition: z }), A;
1686
- }
1687
- });
1688
- function Jn(e, t, l) {
1689
- function o() {
1690
- }
1691
- return ce(() => {
1692
- e.value === !0 && void 0;
1693
- }), {
1694
- removeFromHistory: o,
1695
- addToHistory() {
1696
- }
1697
- };
1698
- }
1699
- let Ye = 0, Lt, Ot, Ze, It = !1, ql, Vl, _l, Ee = null;
1700
- function ei(e) {
1701
- ti(e) && ae(e);
1702
- }
1703
- function ti(e) {
1704
- if (e.target === document.body || e.target.classList.contains("q-layout__backdrop"))
1705
- return !0;
1706
- const t = Qo(e), l = e.shiftKey && !e.deltaX, o = !l && Math.abs(e.deltaX) <= Math.abs(e.deltaY), a = l || o ? e.deltaY : e.deltaX;
1707
- for (let i = 0; i < t.length; i++) {
1708
- const u = t[i];
1709
- if (Wn(u, o))
1710
- return o ? a < 0 && u.scrollTop === 0 ? !0 : a > 0 && u.scrollTop + u.clientHeight === u.scrollHeight : a < 0 && u.scrollLeft === 0 ? !0 : a > 0 && u.scrollLeft + u.clientWidth === u.scrollWidth;
1711
- }
1712
- return !0;
1713
- }
1714
- function El(e) {
1715
- e.target === document && (document.scrollingElement.scrollTop = document.scrollingElement.scrollTop);
1716
- }
1717
- function ht(e) {
1718
- It !== !0 && (It = !0, requestAnimationFrame(() => {
1719
- It = !1;
1720
- const { height: t } = e.target, { clientHeight: l, scrollTop: o } = document.scrollingElement;
1721
- (Ze === void 0 || t !== window.innerHeight) && (Ze = l - t, document.scrollingElement.scrollTop = o), o > Ze && (document.scrollingElement.scrollTop -= Math.ceil((o - Ze) / 8));
1722
- }));
1723
- }
1724
- function Bl(e) {
1725
- const t = document.body, l = window.visualViewport !== void 0;
1726
- if (e === "add") {
1727
- const { overflowY: o, overflowX: a } = window.getComputedStyle(t);
1728
- Lt = Pn(window), Ot = $n(window), ql = t.style.left, Vl = t.style.top, _l = window.location.href, t.style.left = `-${Lt}px`, t.style.top = `-${Ot}px`, a !== "hidden" && (a === "scroll" || t.scrollWidth > window.innerWidth) && t.classList.add("q-body--force-scrollbar-x"), o !== "hidden" && (o === "scroll" || t.scrollHeight > window.innerHeight) && t.classList.add("q-body--force-scrollbar-y"), t.classList.add("q-body--prevent-scroll"), document.qScrollPrevented = !0, we.is.ios === !0 && (l === !0 ? (window.scrollTo(0, 0), window.visualViewport.addEventListener("resize", ht, ge.passiveCapture), window.visualViewport.addEventListener("scroll", ht, ge.passiveCapture), window.scrollTo(0, 0)) : window.addEventListener("scroll", El, ge.passiveCapture));
1729
- }
1730
- we.is.desktop === !0 && we.is.mac === !0 && window[`${e}EventListener`]("wheel", ei, ge.notPassive), e === "remove" && (we.is.ios === !0 && (l === !0 ? (window.visualViewport.removeEventListener("resize", ht, ge.passiveCapture), window.visualViewport.removeEventListener("scroll", ht, ge.passiveCapture)) : window.removeEventListener("scroll", El, ge.passiveCapture)), t.classList.remove("q-body--prevent-scroll"), t.classList.remove("q-body--force-scrollbar-x"), t.classList.remove("q-body--force-scrollbar-y"), document.qScrollPrevented = !1, t.style.left = ql, t.style.top = Vl, window.location.href === _l && window.scrollTo(Lt, Ot), Ze = void 0);
1731
- }
1732
- function li(e) {
1733
- let t = "add";
1734
- if (e === !0) {
1735
- if (Ye++, Ee !== null) {
1736
- clearTimeout(Ee), Ee = null;
1737
- return;
1738
- }
1739
- if (Ye > 1)
1740
- return;
1741
- } else {
1742
- if (Ye === 0 || (Ye--, Ye > 0))
1743
- return;
1744
- if (t = "remove", we.is.ios === !0 && we.is.nativeMobile === !0) {
1745
- Ee !== null && clearTimeout(Ee), Ee = setTimeout(() => {
1746
- Bl(t), Ee = null;
1747
- }, 100);
1748
- return;
1749
- }
1750
- }
1751
- Bl(t);
1752
- }
1753
- function oi() {
1754
- let e;
1755
- return {
1756
- preventBodyScroll(t) {
1757
- t !== e && (e !== void 0 || t === !0) && (e = t, li(t));
1758
- }
1759
- };
1760
- }
1761
- let gt = 0;
1762
- const ni = {
1763
- standard: "fixed-full flex-center",
1764
- top: "fixed-top justify-center",
1765
- bottom: "fixed-bottom justify-center",
1766
- right: "fixed-right items-center",
1767
- left: "fixed-left items-center"
1768
- }, Al = {
1769
- standard: ["scale", "scale"],
1770
- top: ["slide-down", "slide-up"],
1771
- bottom: ["slide-up", "slide-down"],
1772
- right: ["slide-left", "slide-right"],
1773
- left: ["slide-right", "slide-left"]
1774
- }, ii = be({
1775
- name: "QDialog",
1776
- inheritAttrs: !1,
1777
- props: {
1778
- ...Zl,
1779
- ...lo,
1780
- transitionShow: String,
1781
- // override useTransitionProps
1782
- transitionHide: String,
1783
- // override useTransitionProps
1784
- persistent: Boolean,
1785
- autoClose: Boolean,
1786
- allowFocusOutside: Boolean,
1787
- noEscDismiss: Boolean,
1788
- noBackdropDismiss: Boolean,
1789
- noRouteDismiss: Boolean,
1790
- noRefocus: Boolean,
1791
- noFocus: Boolean,
1792
- noShake: Boolean,
1793
- seamless: Boolean,
1794
- maximized: Boolean,
1795
- fullWidth: Boolean,
1796
- fullHeight: Boolean,
1797
- square: Boolean,
1798
- backdropFilter: String,
1799
- position: {
1800
- type: String,
1801
- default: "standard",
1802
- validator: (e) => ["standard", "top", "bottom", "left", "right"].includes(e)
1803
- }
1804
- },
1805
- emits: [
1806
- ...Jl,
1807
- "shake",
1808
- "click",
1809
- "escapeKey"
1810
- ],
1811
- setup(e, { slots: t, emit: l, attrs: o }) {
1812
- const a = le(), i = T(null), u = T(!1), d = T(!1);
1813
- let v = null, g = null, c, y;
1814
- const C = f(
1815
- () => e.persistent !== !0 && e.noRouteDismiss !== !0 && e.seamless !== !0
1816
- ), { preventBodyScroll: r } = oi(), { registerTimeout: m } = io(), { registerTick: _, removeTick: S } = no(), { transitionProps: P, transitionStyle: E } = oo(
1817
- e,
1818
- () => Al[e.position][0],
1819
- () => Al[e.position][1]
1820
- ), q = f(() => E.value + (e.backdropFilter !== void 0 ? `;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}` : "")), { showPortal: R, hidePortal: D, portalIsAccessible: B, renderPortal: L } = to(
1821
- a,
1822
- i,
1823
- O,
1824
- "dialog"
1825
- ), { hide: H } = eo({
1826
- showing: u,
1827
- hideOnRouteChange: C,
1828
- handleShow: U,
1829
- handleHide: ne,
1830
- processOnMount: !0
1831
- });
1832
- Jn(u);
1833
- const Q = f(
1834
- () => `q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized === !0 ? "maximized" : "minimized"} q-dialog__inner--${e.position} ${ni[e.position]}` + (d.value === !0 ? " q-dialog__inner--animating" : "") + (e.fullWidth === !0 ? " q-dialog__inner--fullwidth" : "") + (e.fullHeight === !0 ? " q-dialog__inner--fullheight" : "") + (e.square === !0 ? " q-dialog__inner--square" : "")
1835
- ), G = f(() => u.value === !0 && e.seamless !== !0), oe = f(() => e.autoClose === !0 ? { onClick: se } : {}), A = f(() => [
1836
- `q-dialog fullscreen no-pointer-events q-dialog--${G.value === !0 ? "modal" : "seamless"}`,
1837
- o.class
1838
- ]);
1839
- K(() => e.maximized, (V) => {
1840
- u.value === !0 && M(V);
1841
- }), K(G, (V) => {
1842
- r(V), V === !0 ? (Wl(p), ao(re)) : (Pt(p), yt(re));
1843
- });
1844
- function U(V) {
1845
- g = e.noRefocus === !1 && document.activeElement !== null ? document.activeElement : null, M(e.maximized), R(), d.value = !0, e.noFocus !== !0 ? (document.activeElement !== null && document.activeElement.blur(), _(te)) : S(), m(() => {
1846
- if (a.proxy.$q.platform.is.ios === !0) {
1847
- if (e.seamless !== !0 && document.activeElement) {
1848
- const { top: I, bottom: F } = document.activeElement.getBoundingClientRect(), { innerHeight: z } = window, N = window.visualViewport !== void 0 ? window.visualViewport.height : z;
1849
- I > 0 && F > N / 2 && (document.scrollingElement.scrollTop = Math.min(
1850
- document.scrollingElement.scrollHeight - N,
1851
- F >= z ? 1 / 0 : Math.ceil(document.scrollingElement.scrollTop + F - N / 2)
1852
- )), document.activeElement.scrollIntoView();
1853
- }
1854
- y = !0, i.value.click(), y = !1;
1855
- }
1856
- R(!0), d.value = !1, l("show", V);
1857
- }, e.transitionDuration);
1858
- }
1859
- function ne(V) {
1860
- S(), k(!0), d.value = !0, D(), g !== null && (((V && V.type.indexOf("key") === 0 ? g.closest('[tabindex]:not([tabindex^="-"])') : void 0) || g).focus(), g = null), m(() => {
1861
- D(!0), d.value = !1, l("hide", V);
1862
- }, e.transitionDuration);
1863
- }
1864
- function te(V) {
1865
- Nt(() => {
1866
- let I = i.value;
1867
- if (I !== null) {
1868
- if (V !== void 0) {
1869
- const F = I.querySelector(V);
1870
- if (F !== null) {
1871
- F.focus({ preventScroll: !0 });
1872
- return;
1873
- }
1874
- }
1875
- I.contains(document.activeElement) !== !0 && (I = I.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || I.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || I.querySelector("[autofocus], [data-autofocus]") || I, I.focus({ preventScroll: !0 }));
1876
- }
1877
- });
1878
- }
1879
- function X(V) {
1880
- V && typeof V.focus == "function" ? V.focus({ preventScroll: !0 }) : te(), l("shake");
1881
- const I = i.value;
1882
- I !== null && (I.classList.remove("q-animate--scale"), I.classList.add("q-animate--scale"), v !== null && clearTimeout(v), v = setTimeout(() => {
1883
- v = null, i.value !== null && (I.classList.remove("q-animate--scale"), te());
1884
- }, 170));
1885
- }
1886
- function re() {
1887
- e.seamless !== !0 && (e.persistent === !0 || e.noEscDismiss === !0 ? e.maximized !== !0 && e.noShake !== !0 && X() : (l("escapeKey"), H()));
1888
- }
1889
- function k(V) {
1890
- v !== null && (clearTimeout(v), v = null), (V === !0 || u.value === !0) && (M(!1), e.seamless !== !0 && (r(!1), Pt(p), yt(re))), V !== !0 && (g = null);
1891
- }
1892
- function M(V) {
1893
- V === !0 ? c !== !0 && (gt < 1 && document.body.classList.add("q-body--dialog"), gt++, c = !0) : c === !0 && (gt < 2 && document.body.classList.remove("q-body--dialog"), gt--, c = !1);
1894
- }
1895
- function se(V) {
1896
- y !== !0 && (H(V), l("click", V));
1897
- }
1898
- function s(V) {
1899
- e.persistent !== !0 && e.noBackdropDismiss !== !0 ? H(V) : e.noShake !== !0 && X();
1900
- }
1901
- function p(V) {
1902
- e.allowFocusOutside !== !0 && B.value === !0 && Pl(i.value, V.target) !== !0 && te('[tabindex]:not([tabindex="-1"])');
1903
- }
1904
- Object.assign(a.proxy, {
1905
- // expose public methods
1906
- focus: te,
1907
- shake: X,
1908
- // private but needed by QSelect
1909
- __updateRefocusTarget(V) {
1910
- g = V || null;
1911
- }
1912
- }), ce(k);
1913
- function O() {
1914
- return h("div", {
1915
- role: "dialog",
1916
- "aria-modal": G.value === !0 ? "true" : "false",
1917
- ...o,
1918
- class: A.value
1919
- }, [
1920
- h(bt, {
1921
- name: "q-transition--fade",
1922
- appear: !0
1923
- }, () => G.value === !0 ? h("div", {
1924
- class: "q-dialog__backdrop fixed-full",
1925
- style: q.value,
1926
- "aria-hidden": "true",
1927
- tabindex: -1,
1928
- onClick: s
1929
- }) : null),
1930
- h(
1931
- bt,
1932
- P.value,
1933
- () => u.value === !0 ? h("div", {
1934
- ref: i,
1935
- class: Q.value,
1936
- style: E.value,
1937
- tabindex: -1,
1938
- ...oe.value
1939
- }, Se(t.default)) : null
1940
- )
1941
- ]);
1942
- }
1943
- return L;
1944
- }
1945
- });
1946
- let xt = !1;
1947
- {
1948
- const e = document.createElement("div");
1949
- e.setAttribute("dir", "rtl"), Object.assign(e.style, {
1950
- width: "1px",
1951
- height: "1px",
1952
- overflow: "auto"
1953
- });
1954
- const t = document.createElement("div");
1955
- Object.assign(t.style, {
1956
- width: "1000px",
1957
- height: "1px"
1958
- }), document.body.appendChild(e), e.appendChild(t), e.scrollLeft = -1e3, xt = e.scrollLeft >= 0, e.remove();
1959
- }
1960
- const fe = 1e3, ui = [
1961
- "start",
1962
- "center",
1963
- "end",
1964
- "start-force",
1965
- "center-force",
1966
- "end-force"
1967
- ], so = Array.prototype.filter, ai = window.getComputedStyle(document.body).overflowAnchor === void 0 ? Uo : function(e, t) {
1968
- e !== null && (e._qOverflowAnimationFrame !== void 0 && cancelAnimationFrame(e._qOverflowAnimationFrame), e._qOverflowAnimationFrame = requestAnimationFrame(() => {
1969
- if (e === null)
1970
- return;
1971
- e._qOverflowAnimationFrame = void 0;
1972
- const l = e.children || [];
1973
- so.call(l, (a) => a.dataset && a.dataset.qVsAnchor !== void 0).forEach((a) => {
1974
- delete a.dataset.qVsAnchor;
1975
- });
1976
- const o = l[t];
1977
- o && o.dataset && (o.dataset.qVsAnchor = "");
1978
- }));
1979
- };
1980
- function We(e, t) {
1981
- return e + t;
1982
- }
1983
- function Ht(e, t, l, o, a, i, u, d) {
1984
- const v = e === window ? document.scrollingElement || document.documentElement : e, g = a === !0 ? "offsetWidth" : "offsetHeight", c = {
1985
- scrollStart: 0,
1986
- scrollViewSize: -u - d,
1987
- scrollMaxSize: 0,
1988
- offsetStart: -u,
1989
- offsetEnd: -d
1990
- };
1991
- if (a === !0 ? (e === window ? (c.scrollStart = window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, c.scrollViewSize += document.documentElement.clientWidth) : (c.scrollStart = v.scrollLeft, c.scrollViewSize += v.clientWidth), c.scrollMaxSize = v.scrollWidth, i === !0 && (c.scrollStart = (xt === !0 ? c.scrollMaxSize - c.scrollViewSize : 0) - c.scrollStart)) : (e === window ? (c.scrollStart = window.pageYOffset || window.scrollY || document.body.scrollTop || 0, c.scrollViewSize += document.documentElement.clientHeight) : (c.scrollStart = v.scrollTop, c.scrollViewSize += v.clientHeight), c.scrollMaxSize = v.scrollHeight), l !== null)
1992
- for (let y = l.previousElementSibling; y !== null; y = y.previousElementSibling)
1993
- y.classList.contains("q-virtual-scroll--skip") === !1 && (c.offsetStart += y[g]);
1994
- if (o !== null)
1995
- for (let y = o.nextElementSibling; y !== null; y = y.nextElementSibling)
1996
- y.classList.contains("q-virtual-scroll--skip") === !1 && (c.offsetEnd += y[g]);
1997
- if (t !== e) {
1998
- const y = v.getBoundingClientRect(), C = t.getBoundingClientRect();
1999
- a === !0 ? (c.offsetStart += C.left - y.left, c.offsetEnd -= C.width) : (c.offsetStart += C.top - y.top, c.offsetEnd -= C.height), e !== window && (c.offsetStart += c.scrollStart), c.offsetEnd += c.scrollMaxSize - c.offsetStart;
2000
- }
2001
- return c;
2002
- }
2003
- function Tl(e, t, l, o) {
2004
- t === "end" && (t = (e === window ? document.body : e)[l === !0 ? "scrollWidth" : "scrollHeight"]), e === window ? l === !0 ? (o === !0 && (t = (xt === !0 ? document.body.scrollWidth - document.documentElement.clientWidth : 0) - t), window.scrollTo(t, window.pageYOffset || window.scrollY || document.body.scrollTop || 0)) : window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, t) : l === !0 ? (o === !0 && (t = (xt === !0 ? e.scrollWidth - e.offsetWidth : 0) - t), e.scrollLeft = t) : e.scrollTop = t;
2005
- }
2006
- function Ge(e, t, l, o) {
2007
- if (l >= o)
2008
- return 0;
2009
- const a = t.length, i = Math.floor(l / fe), u = Math.floor((o - 1) / fe) + 1;
2010
- let d = e.slice(i, u).reduce(We, 0);
2011
- return l % fe !== 0 && (d -= t.slice(i * fe, l).reduce(We, 0)), o % fe !== 0 && o !== a && (d -= t.slice(o, u * fe).reduce(We, 0)), d;
2012
- }
2013
- const ri = {
2014
- virtualScrollSliceSize: {
2015
- type: [Number, String],
2016
- default: 10
2017
- },
2018
- virtualScrollSliceRatioBefore: {
2019
- type: [Number, String],
2020
- default: 1
2021
- },
2022
- virtualScrollSliceRatioAfter: {
2023
- type: [Number, String],
2024
- default: 1
2025
- },
2026
- virtualScrollItemSize: {
2027
- type: [Number, String],
2028
- default: 24
2029
- },
2030
- virtualScrollStickySizeStart: {
2031
- type: [Number, String],
2032
- default: 0
2033
- },
2034
- virtualScrollStickySizeEnd: {
2035
- type: [Number, String],
2036
- default: 0
2037
- },
2038
- tableColspan: [Number, String]
2039
- }, Rl = {
2040
- virtualScrollHorizontal: Boolean,
2041
- onVirtualScroll: Function,
2042
- ...ri
2043
- };
2044
- function si({
2045
- virtualScrollLength: e,
2046
- getVirtualScrollTarget: t,
2047
- getVirtualScrollEl: l,
2048
- virtualScrollItemSizeComputed: o
2049
- // optional
2050
- }) {
2051
- const a = le(), { props: i, emit: u, proxy: d } = a, { $q: v } = d;
2052
- let g, c, y, C = [], r;
2053
- const m = T(0), _ = T(0), S = T({}), P = T(null), E = T(null), q = T(null), R = T({ from: 0, to: 0 }), D = f(() => i.tableColspan !== void 0 ? i.tableColspan : 100);
2054
- o === void 0 && (o = f(() => i.virtualScrollItemSize));
2055
- const B = f(() => o.value + ";" + i.virtualScrollHorizontal), L = f(
2056
- () => B.value + ";" + i.virtualScrollSliceRatioBefore + ";" + i.virtualScrollSliceRatioAfter
2057
- );
2058
- K(L, () => {
2059
- X();
2060
- }), K(B, H);
2061
- function H() {
2062
- te(c, !0);
2063
- }
2064
- function Q(s) {
2065
- te(s === void 0 ? c : s);
2066
- }
2067
- function G(s, p) {
2068
- const O = t();
2069
- if (O == null || O.nodeType === 8)
2070
- return;
2071
- const V = Ht(
2072
- O,
2073
- l(),
2074
- P.value,
2075
- E.value,
2076
- i.virtualScrollHorizontal,
2077
- v.lang.rtl,
2078
- i.virtualScrollStickySizeStart,
2079
- i.virtualScrollStickySizeEnd
2080
- );
2081
- y !== V.scrollViewSize && X(V.scrollViewSize), A(
2082
- O,
2083
- V,
2084
- Math.min(e.value - 1, Math.max(0, parseInt(s, 10) || 0)),
2085
- 0,
2086
- ui.indexOf(p) !== -1 ? p : c !== -1 && s > c ? "end" : "start"
2087
- );
2088
- }
2089
- function oe() {
2090
- const s = t();
2091
- if (s == null || s.nodeType === 8)
2092
- return;
2093
- const p = Ht(
2094
- s,
2095
- l(),
2096
- P.value,
2097
- E.value,
2098
- i.virtualScrollHorizontal,
2099
- v.lang.rtl,
2100
- i.virtualScrollStickySizeStart,
2101
- i.virtualScrollStickySizeEnd
2102
- ), O = e.value - 1, V = p.scrollMaxSize - p.offsetStart - p.offsetEnd - _.value;
2103
- if (g === p.scrollStart)
2104
- return;
2105
- if (p.scrollMaxSize <= 0) {
2106
- A(s, p, 0, 0);
2107
- return;
2108
- }
2109
- y !== p.scrollViewSize && X(p.scrollViewSize), U(R.value.from);
2110
- const I = Math.floor(p.scrollMaxSize - Math.max(p.scrollViewSize, p.offsetEnd) - Math.min(r[O], p.scrollViewSize / 2));
2111
- if (I > 0 && Math.ceil(p.scrollStart) >= I) {
2112
- A(
2113
- s,
2114
- p,
2115
- O,
2116
- p.scrollMaxSize - p.offsetEnd - C.reduce(We, 0)
2117
- );
2118
- return;
2119
- }
2120
- let F = 0, z = p.scrollStart - p.offsetStart, N = z;
2121
- if (z <= V && z + p.scrollViewSize >= m.value)
2122
- z -= m.value, F = R.value.from, N = z;
2123
- else
2124
- for (let b = 0; z >= C[b] && F < O; b++)
2125
- z -= C[b], F += fe;
2126
- for (; z > 0 && F < O; )
2127
- z -= r[F], z > -p.scrollViewSize ? (F++, N = z) : N = r[F] + z;
2128
- A(
2129
- s,
2130
- p,
2131
- F,
2132
- N
2133
- );
2134
- }
2135
- function A(s, p, O, V, I) {
2136
- const F = typeof I == "string" && I.indexOf("-force") !== -1, z = F === !0 ? I.replace("-force", "") : I, N = z !== void 0 ? z : "start";
2137
- let b = Math.max(0, O - S.value[N]), Z = b + S.value.total;
2138
- Z > e.value && (Z = e.value, b = Math.max(0, Z - S.value.total)), g = p.scrollStart;
2139
- const ve = b !== R.value.from || Z !== R.value.to;
2140
- if (ve === !1 && z === void 0) {
2141
- k(O);
2142
- return;
2143
- }
2144
- const { activeElement: ze } = document, me = q.value;
2145
- ve === !0 && me !== null && me !== ze && me.contains(ze) === !0 && (me.addEventListener("focusout", ne), setTimeout(() => {
2146
- me !== null && me.removeEventListener("focusout", ne);
2147
- })), ai(me, O - b);
2148
- const nt = z !== void 0 ? r.slice(b, O).reduce(We, 0) : 0;
2149
- if (ve === !0) {
2150
- const ke = Z >= R.value.from && b <= R.value.to ? R.value.to : Z;
2151
- R.value = { from: b, to: ke }, m.value = Ge(C, r, 0, b), _.value = Ge(C, r, Z, e.value), requestAnimationFrame(() => {
2152
- R.value.to !== Z && g === p.scrollStart && (R.value = { from: R.value.from, to: Z }, _.value = Ge(C, r, Z, e.value));
2153
- });
2154
- }
2155
- requestAnimationFrame(() => {
2156
- if (g !== p.scrollStart)
2157
- return;
2158
- ve === !0 && U(b);
2159
- const ke = r.slice(b, O).reduce(We, 0), qe = ke + p.offsetStart + m.value, it = qe + r[O];
2160
- let Ne = qe + V;
2161
- if (z !== void 0) {
2162
- const qt = ke - nt, Ke = p.scrollStart + qt;
2163
- Ne = F !== !0 && Ke < qe && it < Ke + p.scrollViewSize ? Ke : z === "end" ? it - p.scrollViewSize : qe - (z === "start" ? 0 : Math.round((p.scrollViewSize - r[O]) / 2));
2164
- }
2165
- g = Ne, Tl(
2166
- s,
2167
- Ne,
2168
- i.virtualScrollHorizontal,
2169
- v.lang.rtl
2170
- ), k(O);
2171
- });
2172
- }
2173
- function U(s) {
2174
- const p = q.value;
2175
- if (p) {
2176
- const O = so.call(
2177
- p.children,
2178
- (b) => b.classList && b.classList.contains("q-virtual-scroll--skip") === !1
2179
- ), V = O.length, I = i.virtualScrollHorizontal === !0 ? (b) => b.getBoundingClientRect().width : (b) => b.offsetHeight;
2180
- let F = s, z, N;
2181
- for (let b = 0; b < V; ) {
2182
- for (z = I(O[b]), b++; b < V && O[b].classList.contains("q-virtual-scroll--with-prev") === !0; )
2183
- z += I(O[b]), b++;
2184
- N = z - r[F], N !== 0 && (r[F] += N, C[Math.floor(F / fe)] += N), F++;
2185
- }
2186
- }
2187
- }
2188
- function ne() {
2189
- q.value !== null && q.value !== void 0 && q.value.focus();
2190
- }
2191
- function te(s, p) {
2192
- const O = 1 * o.value;
2193
- (p === !0 || Array.isArray(r) === !1) && (r = []);
2194
- const V = r.length;
2195
- r.length = e.value;
2196
- for (let F = e.value - 1; F >= V; F--)
2197
- r[F] = O;
2198
- const I = Math.floor((e.value - 1) / fe);
2199
- C = [];
2200
- for (let F = 0; F <= I; F++) {
2201
- let z = 0;
2202
- const N = Math.min((F + 1) * fe, e.value);
2203
- for (let b = F * fe; b < N; b++)
2204
- z += r[b];
2205
- C.push(z);
2206
- }
2207
- c = -1, g = void 0, m.value = Ge(C, r, 0, R.value.from), _.value = Ge(C, r, R.value.to, e.value), s >= 0 ? (U(R.value.from), ue(() => {
2208
- G(s);
2209
- })) : M();
2210
- }
2211
- function X(s) {
2212
- if (s === void 0 && typeof window < "u") {
2213
- const z = t();
2214
- z != null && z.nodeType !== 8 && (s = Ht(
2215
- z,
2216
- l(),
2217
- P.value,
2218
- E.value,
2219
- i.virtualScrollHorizontal,
2220
- v.lang.rtl,
2221
- i.virtualScrollStickySizeStart,
2222
- i.virtualScrollStickySizeEnd
2223
- ).scrollViewSize);
2224
- }
2225
- y = s;
2226
- const p = parseFloat(i.virtualScrollSliceRatioBefore) || 0, O = parseFloat(i.virtualScrollSliceRatioAfter) || 0, V = 1 + p + O, I = s === void 0 || s <= 0 ? 1 : Math.ceil(s / o.value), F = Math.max(
2227
- 1,
2228
- I,
2229
- Math.ceil((i.virtualScrollSliceSize > 0 ? i.virtualScrollSliceSize : 10) / V)
2230
- );
2231
- S.value = {
2232
- total: Math.ceil(F * V),
2233
- start: Math.ceil(F * p),
2234
- center: Math.ceil(F * (0.5 + p)),
2235
- end: Math.ceil(F * (1 + p)),
2236
- view: I
2237
- };
2238
- }
2239
- function re(s, p) {
2240
- const O = i.virtualScrollHorizontal === !0 ? "width" : "height", V = {
2241
- ["--q-virtual-scroll-item-" + O]: o.value + "px"
2242
- };
2243
- return [
2244
- s === "tbody" ? h(s, {
2245
- class: "q-virtual-scroll__padding",
2246
- key: "before",
2247
- ref: P
2248
- }, [
2249
- h("tr", [
2250
- h("td", {
2251
- style: { [O]: `${m.value}px`, ...V },
2252
- colspan: D.value
2253
- })
2254
- ])
2255
- ]) : h(s, {
2256
- class: "q-virtual-scroll__padding",
2257
- key: "before",
2258
- ref: P,
2259
- style: { [O]: `${m.value}px`, ...V }
2260
- }),
2261
- h(s, {
2262
- class: "q-virtual-scroll__content",
2263
- key: "content",
2264
- ref: q,
2265
- tabindex: -1
2266
- }, p.flat()),
2267
- s === "tbody" ? h(s, {
2268
- class: "q-virtual-scroll__padding",
2269
- key: "after",
2270
- ref: E
2271
- }, [
2272
- h("tr", [
2273
- h("td", {
2274
- style: { [O]: `${_.value}px`, ...V },
2275
- colspan: D.value
2276
- })
2277
- ])
2278
- ]) : h(s, {
2279
- class: "q-virtual-scroll__padding",
2280
- key: "after",
2281
- ref: E,
2282
- style: { [O]: `${_.value}px`, ...V }
2283
- })
2284
- ];
2285
- }
2286
- function k(s) {
2287
- c !== s && (i.onVirtualScroll !== void 0 && u("virtualScroll", {
2288
- index: s,
2289
- from: R.value.from,
2290
- to: R.value.to - 1,
2291
- direction: s < c ? "decrease" : "increase",
2292
- ref: d
2293
- }), c = s);
2294
- }
2295
- X();
2296
- const M = Ql(
2297
- oe,
2298
- v.platform.is.ios === !0 ? 120 : 35
2299
- );
2300
- Ao(() => {
2301
- X();
2302
- });
2303
- let se = !1;
2304
- return Ct(() => {
2305
- se = !0;
2306
- }), Ll(() => {
2307
- if (se !== !0) return;
2308
- const s = t();
2309
- g !== void 0 && s !== void 0 && s !== null && s.nodeType !== 8 ? Tl(
2310
- s,
2311
- g,
2312
- i.virtualScrollHorizontal,
2313
- v.lang.rtl
2314
- ) : G(c);
2315
- }), ce(() => {
2316
- M.cancel();
2317
- }), Object.assign(d, { scrollTo: G, reset: H, refresh: Q }), {
2318
- virtualScrollSliceRange: R,
2319
- virtualScrollSliceSizeComputed: S,
2320
- setVirtualScrollSize: X,
2321
- onVirtualScrollEvt: M,
2322
- localResetVirtualScroll: te,
2323
- padVirtualScroll: re,
2324
- scrollTo: G,
2325
- reset: H,
2326
- refresh: Q
2327
- };
2328
- }
2329
- const ci = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/, di = /[\u4e00-\u9fff\u3400-\u4dbf\u{20000}-\u{2a6df}\u{2a700}-\u{2b73f}\u{2b740}-\u{2b81f}\u{2b820}-\u{2ceaf}\uf900-\ufaff\u3300-\u33ff\ufe30-\ufe4f\uf900-\ufaff\u{2f800}-\u{2fa1f}]/u, fi = /[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/, vi = /[a-z0-9_ -]$/i;
2330
- function mi(e) {
2331
- return function(l) {
2332
- if (l.type === "compositionend" || l.type === "change") {
2333
- if (l.target.qComposing !== !0) return;
2334
- l.target.qComposing = !1, e(l);
2335
- } else l.type === "compositionupdate" && l.target.qComposing !== !0 && typeof l.data == "string" && (we.is.firefox === !0 ? vi.test(l.data) === !1 : ci.test(l.data) === !0 || di.test(l.data) === !0 || fi.test(l.data) === !0) === !0 && (l.target.qComposing = !0);
2336
- };
2337
- }
2338
- function Ce(e, t) {
2339
- if (e === t)
2340
- return !0;
2341
- if (e !== null && t !== null && typeof e == "object" && typeof t == "object") {
2342
- if (e.constructor !== t.constructor)
2343
- return !1;
2344
- let l, o;
2345
- if (e.constructor === Array) {
2346
- if (l = e.length, l !== t.length)
2347
- return !1;
2348
- for (o = l; o-- !== 0; )
2349
- if (Ce(e[o], t[o]) !== !0)
2350
- return !1;
2351
- return !0;
2352
- }
2353
- if (e.constructor === Map) {
2354
- if (e.size !== t.size)
2355
- return !1;
2356
- let i = e.entries();
2357
- for (o = i.next(); o.done !== !0; ) {
2358
- if (t.has(o.value[0]) !== !0)
2359
- return !1;
2360
- o = i.next();
2361
- }
2362
- for (i = e.entries(), o = i.next(); o.done !== !0; ) {
2363
- if (Ce(o.value[1], t.get(o.value[0])) !== !0)
2364
- return !1;
2365
- o = i.next();
2366
- }
2367
- return !0;
2368
- }
2369
- if (e.constructor === Set) {
2370
- if (e.size !== t.size)
2371
- return !1;
2372
- const i = e.entries();
2373
- for (o = i.next(); o.done !== !0; ) {
2374
- if (t.has(o.value[0]) !== !0)
2375
- return !1;
2376
- o = i.next();
2377
- }
2378
- return !0;
2379
- }
2380
- if (e.buffer != null && e.buffer.constructor === ArrayBuffer) {
2381
- if (l = e.length, l !== t.length)
2382
- return !1;
2383
- for (o = l; o-- !== 0; )
2384
- if (e[o] !== t[o])
2385
- return !1;
2386
- return !0;
2387
- }
2388
- if (e.constructor === RegExp)
2389
- return e.source === t.source && e.flags === t.flags;
2390
- if (e.valueOf !== Object.prototype.valueOf)
2391
- return e.valueOf() === t.valueOf();
2392
- if (e.toString !== Object.prototype.toString)
2393
- return e.toString() === t.toString();
2394
- const a = Object.keys(e).filter((i) => e[i] !== void 0);
2395
- if (l = a.length, l !== Object.keys(t).filter((i) => t[i] !== void 0).length)
2396
- return !1;
2397
- for (o = l; o-- !== 0; ) {
2398
- const i = a[o];
2399
- if (Ce(e[i], t[i]) !== !0)
2400
- return !1;
2401
- }
2402
- return !0;
2403
- }
2404
- return e !== e && t !== t;
2405
- }
2406
- function zl(e, t, l) {
2407
- if (l <= t)
2408
- return t;
2409
- const o = l - t + 1;
2410
- let a = t + (e - t) % o;
2411
- return a < t && (a = o + a), a === 0 ? 0 : a;
2412
- }
2413
- const Fl = (e) => ["add", "add-unique", "toggle"].includes(e), hi = ".*+?^${}()|[]\\", gi = Object.keys(Kt);
2414
- function $t(e, t) {
2415
- if (typeof e == "function") return e;
2416
- const l = e !== void 0 ? e : t;
2417
- return (o) => o !== null && typeof o == "object" && l in o ? o[l] : o;
2418
- }
2419
- const pi = be({
2420
- name: "QSelect",
2421
- inheritAttrs: !1,
2422
- props: {
2423
- ...Rl,
2424
- ...jl,
2425
- ...Kt,
2426
- // override of useFieldProps > modelValue
2427
- modelValue: {
2428
- required: !0
2429
- },
2430
- multiple: Boolean,
2431
- displayValue: [String, Number],
2432
- displayValueHtml: Boolean,
2433
- dropdownIcon: String,
2434
- options: {
2435
- type: Array,
2436
- default: () => []
2437
- },
2438
- optionValue: [Function, String],
2439
- optionLabel: [Function, String],
2440
- optionDisable: [Function, String],
2441
- hideSelected: Boolean,
2442
- hideDropdownIcon: Boolean,
2443
- fillInput: Boolean,
2444
- maxValues: [Number, String],
2445
- optionsDense: Boolean,
2446
- optionsDark: {
2447
- type: Boolean,
2448
- default: null
2449
- },
2450
- optionsSelectedClass: String,
2451
- optionsHtml: Boolean,
2452
- optionsCover: Boolean,
2453
- menuShrink: Boolean,
2454
- menuAnchor: String,
2455
- menuSelf: String,
2456
- menuOffset: Array,
2457
- popupContentClass: String,
2458
- popupContentStyle: [String, Array, Object],
2459
- popupNoRouteDismiss: Boolean,
2460
- useInput: Boolean,
2461
- useChips: Boolean,
2462
- newValueMode: {
2463
- type: String,
2464
- validator: Fl
2465
- },
2466
- mapOptions: Boolean,
2467
- emitValue: Boolean,
2468
- disableTabSelection: Boolean,
2469
- inputDebounce: {
2470
- type: [Number, String],
2471
- default: 500
2472
- },
2473
- inputClass: [Array, String, Object],
2474
- inputStyle: [Array, String, Object],
2475
- tabindex: {
2476
- type: [String, Number],
2477
- default: 0
2478
- },
2479
- autocomplete: String,
2480
- transitionShow: {},
2481
- transitionHide: {},
2482
- transitionDuration: {},
2483
- behavior: {
2484
- type: String,
2485
- validator: (e) => ["default", "menu", "dialog"].includes(e),
2486
- default: "default"
2487
- },
2488
- // override of useVirtualScrollProps > virtualScrollItemSize (no default)
2489
- virtualScrollItemSize: Rl.virtualScrollItemSize.type,
2490
- onNewValue: Function,
2491
- onFilter: Function
2492
- },
2493
- emits: [
2494
- ...Xl,
2495
- "add",
2496
- "remove",
2497
- "inputValue",
2498
- "keyup",
2499
- "keypress",
2500
- "keydown",
2501
- "popupShow",
2502
- "popupHide",
2503
- "filterAbort"
2504
- ],
2505
- setup(e, { slots: t, emit: l }) {
2506
- const { proxy: o } = le(), { $q: a } = o, i = T(!1), u = T(!1), d = T(-1), v = T(""), g = T(!1), c = T(!1);
2507
- let y = null, C = null, r, m, _, S = null, P, E, q, R;
2508
- const D = T(null), B = T(null), L = T(null), H = T(null), Q = T(null), G = ln(e), oe = mi(ll), A = f(() => Array.isArray(e.options) ? e.options.length : 0), U = f(() => e.virtualScrollItemSize === void 0 ? e.optionsDense === !0 ? 24 : 48 : e.virtualScrollItemSize), {
2509
- virtualScrollSliceRange: ne,
2510
- virtualScrollSliceSizeComputed: te,
2511
- localResetVirtualScroll: X,
2512
- padVirtualScroll: re,
2513
- onVirtualScrollEvt: k,
2514
- scrollTo: M,
2515
- setVirtualScrollSize: se
2516
- } = si({
2517
- virtualScrollLength: A,
2518
- getVirtualScrollTarget: mo,
2519
- getVirtualScrollEl: el,
2520
- virtualScrollItemSizeComputed: U
2521
- }), s = Yl(), p = f(() => {
2522
- const n = e.mapOptions === !0 && e.multiple !== !0, w = e.modelValue !== void 0 && (e.modelValue !== null || n === !0) ? e.multiple === !0 && Array.isArray(e.modelValue) ? e.modelValue : [e.modelValue] : [];
2523
- if (e.mapOptions === !0 && Array.isArray(e.options) === !0) {
2524
- const x = e.mapOptions === !0 && r !== void 0 ? r : [], $ = w.map((j) => vo(j, x));
2525
- return e.modelValue === null && n === !0 ? $.filter((j) => j !== null) : $;
2526
- }
2527
- return w;
2528
- }), O = f(() => {
2529
- const n = {};
2530
- return gi.forEach((w) => {
2531
- const x = e[w];
2532
- x !== void 0 && (n[w] = x);
2533
- }), n;
2534
- }), V = f(() => e.optionsDark === null ? s.isDark.value : e.optionsDark), I = f(() => Wt(p.value)), F = f(() => {
2535
- let n = "q-field__input q-placeholder col";
2536
- return e.hideSelected === !0 || p.value.length === 0 ? [n, e.inputClass] : (n += " q-field__input--padding", e.inputClass === void 0 ? n : [n, e.inputClass]);
2537
- }), z = f(
2538
- () => (e.virtualScrollHorizontal === !0 ? "q-virtual-scroll--horizontal" : "") + (e.popupContentClass ? " " + e.popupContentClass : "")
2539
- ), N = f(() => A.value === 0), b = f(
2540
- () => p.value.map((n) => ie.value(n)).join(", ")
2541
- ), Z = f(() => e.displayValue !== void 0 ? e.displayValue : b.value), ve = f(() => e.optionsHtml === !0 ? () => !0 : (n) => n != null && n.html === !0), ze = f(() => e.displayValueHtml === !0 || e.displayValue === void 0 && (e.optionsHtml === !0 || p.value.some(ve.value))), me = f(() => s.focused.value === !0 ? e.tabindex : -1), nt = f(() => {
2542
- const n = {
2543
- tabindex: e.tabindex,
2544
- role: "combobox",
2545
- "aria-label": e.label,
2546
- "aria-readonly": e.readonly === !0 ? "true" : "false",
2547
- "aria-autocomplete": e.useInput === !0 ? "list" : "none",
2548
- "aria-expanded": i.value === !0 ? "true" : "false",
2549
- "aria-controls": `${s.targetUid.value}_lb`
2550
- };
2551
- return d.value >= 0 && (n["aria-activedescendant"] = `${s.targetUid.value}_${d.value}`), n;
2552
- }), ke = f(() => ({
2553
- id: `${s.targetUid.value}_lb`,
2554
- role: "listbox",
2555
- "aria-multiselectable": e.multiple === !0 ? "true" : "false"
2556
- })), qe = f(() => p.value.map((n, w) => ({
2557
- index: w,
2558
- opt: n,
2559
- html: ve.value(n),
2560
- selected: !0,
2561
- removeAtIndex: fo,
2562
- toggleOption: Ve,
2563
- tabindex: me.value
2564
- }))), it = f(() => {
2565
- if (A.value === 0)
2566
- return [];
2567
- const { from: n, to: w } = ne.value;
2568
- return e.options.slice(n, w).map((x, $) => {
2569
- const j = Fe.value(x) === !0, W = _t(x) === !0, J = n + $, Y = {
2570
- clickable: !0,
2571
- active: W,
2572
- activeClass: Ke.value,
2573
- manualFocus: !0,
2574
- focused: !1,
2575
- disable: j,
2576
- tabindex: -1,
2577
- dense: e.optionsDense,
2578
- dark: V.value,
2579
- role: "option",
2580
- "aria-selected": W === !0 ? "true" : "false",
2581
- id: `${s.targetUid.value}_${J}`,
2582
- onClick: () => {
2583
- Ve(x);
2584
- }
2585
- };
2586
- return j !== !0 && (d.value === J && (Y.focused = !0), a.platform.is.desktop === !0 && (Y.onMousemove = () => {
2587
- i.value === !0 && Me(J);
2588
- })), {
2589
- index: J,
2590
- opt: x,
2591
- html: ve.value(x),
2592
- label: ie.value(x),
2593
- selected: Y.active,
2594
- focused: Y.focused,
2595
- toggleOption: Ve,
2596
- setOptionIndex: Me,
2597
- itemProps: Y
2598
- };
2599
- });
2600
- }), Ne = f(() => e.dropdownIcon !== void 0 ? e.dropdownIcon : a.iconSet.arrow.dropdown), qt = f(
2601
- () => e.optionsCover === !1 && e.outlined !== !0 && e.standout !== !0 && e.borderless !== !0 && e.rounded !== !0
2602
- ), Ke = f(() => e.optionsSelectedClass !== void 0 ? e.optionsSelectedClass : e.color !== void 0 ? `text-${e.color}` : ""), he = f(() => $t(e.optionValue, "value")), ie = f(() => $t(e.optionLabel, "label")), Fe = f(() => $t(e.optionDisable, "disable")), ut = f(() => p.value.map(he.value)), co = f(() => {
2603
- const n = {
2604
- onInput: ll,
2605
- // Safari < 10.2 & UIWebView doesn't fire compositionend when
2606
- // switching focus before confirming composition choice
2607
- // this also fixes the issue where some browsers e.g. iOS Chrome
2608
- // fires "change" instead of "input" on autocomplete.
2609
- onChange: oe,
2610
- onKeydown: Jt,
2611
- onKeyup: Gt,
2612
- onKeypress: Zt,
2613
- onFocus: Xt,
2614
- onClick(w) {
2615
- m === !0 && De(w);
2616
- }
2617
- };
2618
- return n.onCompositionstart = n.onCompositionupdate = n.onCompositionend = oe, n;
2619
- });
2620
- K(p, (n) => {
2621
- r = n, e.useInput === !0 && e.fillInput === !0 && e.multiple !== !0 && s.innerLoading.value !== !0 && (u.value !== !0 && i.value !== !0 || I.value !== !0) && (_ !== !0 && He(), (u.value === !0 || i.value === !0) && Le(""));
2622
- }, { immediate: !0 }), K(() => e.fillInput, He), K(i, Et), K(A, Vo);
2623
- function Qt(n) {
2624
- return e.emitValue === !0 ? he.value(n) : n;
2625
- }
2626
- function Vt(n) {
2627
- if (n !== -1 && n < p.value.length)
2628
- if (e.multiple === !0) {
2629
- const w = e.modelValue.slice();
2630
- l("remove", { index: n, value: w.splice(n, 1)[0] }), l("update:modelValue", w);
2631
- } else
2632
- l("update:modelValue", null);
2633
- }
2634
- function fo(n) {
2635
- Vt(n), s.focus();
2636
- }
2637
- function Ut(n, w) {
2638
- const x = Qt(n);
2639
- if (e.multiple !== !0) {
2640
- e.fillInput === !0 && Qe(
2641
- ie.value(n),
2642
- !0,
2643
- !0
2644
- ), l("update:modelValue", x);
2645
- return;
2646
- }
2647
- if (p.value.length === 0) {
2648
- l("add", { index: 0, value: x }), l("update:modelValue", e.multiple === !0 ? [x] : x);
2649
- return;
2650
- }
2651
- if (w === !0 && _t(n) === !0 || e.maxValues !== void 0 && e.modelValue.length >= e.maxValues)
2652
- return;
2653
- const $ = e.modelValue.slice();
2654
- l("add", { index: $.length, value: x }), $.push(x), l("update:modelValue", $);
2655
- }
2656
- function Ve(n, w) {
2657
- if (s.editable.value !== !0 || n === void 0 || Fe.value(n) === !0)
2658
- return;
2659
- const x = he.value(n);
2660
- if (e.multiple !== !0) {
2661
- w !== !0 && (Qe(
2662
- e.fillInput === !0 ? ie.value(n) : "",
2663
- !0,
2664
- !0
2665
- ), _e()), B.value !== null && B.value.focus(), (p.value.length === 0 || Ce(he.value(p.value[0]), x) !== !0) && l("update:modelValue", e.emitValue === !0 ? x : n);
2666
- return;
2667
- }
2668
- if ((m !== !0 || g.value === !0) && s.focus(), Xt(), p.value.length === 0) {
2669
- const W = e.emitValue === !0 ? x : n;
2670
- l("add", { index: 0, value: W }), l("update:modelValue", e.multiple === !0 ? [W] : W);
2671
- return;
2672
- }
2673
- const $ = e.modelValue.slice(), j = ut.value.findIndex((W) => Ce(W, x));
2674
- if (j !== -1)
2675
- l("remove", { index: j, value: $.splice(j, 1)[0] });
2676
- else {
2677
- if (e.maxValues !== void 0 && $.length >= e.maxValues)
2678
- return;
2679
- const W = e.emitValue === !0 ? x : n;
2680
- l("add", { index: $.length, value: W }), $.push(W);
2681
- }
2682
- l("update:modelValue", $);
2683
- }
2684
- function Me(n) {
2685
- if (a.platform.is.desktop !== !0) return;
2686
- const w = n !== -1 && n < A.value ? n : -1;
2687
- d.value !== w && (d.value = w);
2688
- }
2689
- function at(n = 1, w) {
2690
- if (i.value === !0) {
2691
- let x = d.value;
2692
- do
2693
- x = zl(
2694
- x + n,
2695
- -1,
2696
- A.value - 1
2697
- );
2698
- while (x !== -1 && x !== d.value && Fe.value(e.options[x]) === !0);
2699
- d.value !== x && (Me(x), M(x), w !== !0 && e.useInput === !0 && e.fillInput === !0 && rt(
2700
- x >= 0 ? ie.value(e.options[x]) : P,
2701
- !0
2702
- ));
2703
- }
2704
- }
2705
- function vo(n, w) {
2706
- const x = ($) => Ce(he.value($), n);
2707
- return e.options.find(x) || w.find(x) || n;
2708
- }
2709
- function _t(n) {
2710
- const w = he.value(n);
2711
- return ut.value.find((x) => Ce(x, w)) !== void 0;
2712
- }
2713
- function Xt(n) {
2714
- e.useInput === !0 && B.value !== null && (n === void 0 || B.value === n.target && n.target.value === b.value) && B.value.select();
2715
- }
2716
- function Yt(n) {
2717
- kt(n, 27) === !0 && i.value === !0 && (De(n), _e(), He()), l("keyup", n);
2718
- }
2719
- function Gt(n) {
2720
- const { value: w } = n.target;
2721
- if (n.keyCode !== void 0) {
2722
- Yt(n);
2723
- return;
2724
- }
2725
- if (n.target.value = "", y !== null && (clearTimeout(y), y = null), C !== null && (clearTimeout(C), C = null), He(), typeof w == "string" && w.length !== 0) {
2726
- const x = w.toLocaleLowerCase(), $ = (W) => {
2727
- const J = e.options.find((Y) => String(W.value(Y)).toLocaleLowerCase() === x);
2728
- return J === void 0 ? !1 : (p.value.indexOf(J) === -1 ? Ve(J) : _e(), !0);
2729
- }, j = (W) => {
2730
- $(he) !== !0 && W !== !0 && $(ie) !== !0 && Le(w, !0, () => j(!0));
2731
- };
2732
- j();
2733
- } else
2734
- s.clearValue(n);
2735
- }
2736
- function Zt(n) {
2737
- l("keypress", n);
2738
- }
2739
- function Jt(n) {
2740
- if (l("keydown", n), Xo(n) === !0)
2741
- return;
2742
- const w = v.value.length !== 0 && (e.newValueMode !== void 0 || e.onNewValue !== void 0), x = n.shiftKey !== !0 && e.disableTabSelection !== !0 && e.multiple !== !0 && (d.value !== -1 || w === !0);
2743
- if (n.keyCode === 27) {
2744
- pe(n);
2745
- return;
2746
- }
2747
- if (n.keyCode === 9 && x === !1) {
2748
- Oe();
2749
- return;
2750
- }
2751
- if (n.target === void 0 || n.target.id !== s.targetUid.value || s.editable.value !== !0) return;
2752
- if (n.keyCode === 40 && s.innerLoading.value !== !0 && i.value === !1) {
2753
- ae(n), Ie();
2754
- return;
2755
- }
2756
- if (n.keyCode === 8 && (e.useChips === !0 || e.clearable === !0) && e.hideSelected !== !0 && v.value.length === 0) {
2757
- e.multiple === !0 && Array.isArray(e.modelValue) === !0 ? Vt(e.modelValue.length - 1) : e.multiple !== !0 && e.modelValue !== null && l("update:modelValue", null);
2758
- return;
2759
- }
2760
- (n.keyCode === 35 || n.keyCode === 36) && (typeof v.value != "string" || v.value.length === 0) && (ae(n), d.value = -1, at(n.keyCode === 36 ? 1 : -1, e.multiple)), (n.keyCode === 33 || n.keyCode === 34) && te.value !== void 0 && (ae(n), d.value = Math.max(
2761
- -1,
2762
- Math.min(
2763
- A.value,
2764
- d.value + (n.keyCode === 33 ? -1 : 1) * te.value.view
2765
- )
2766
- ), at(n.keyCode === 33 ? 1 : -1, e.multiple)), (n.keyCode === 38 || n.keyCode === 40) && (ae(n), at(n.keyCode === 38 ? -1 : 1, e.multiple));
2767
- const $ = A.value;
2768
- if ((q === void 0 || R < Date.now()) && (q = ""), $ > 0 && e.useInput !== !0 && n.key !== void 0 && n.key.length === 1 && n.altKey === !1 && n.ctrlKey === !1 && n.metaKey === !1 && (n.keyCode !== 32 || q.length !== 0)) {
2769
- i.value !== !0 && Ie(n);
2770
- const j = n.key.toLocaleLowerCase(), W = q.length === 1 && q[0] === j;
2771
- R = Date.now() + 1500, W === !1 && (ae(n), q += j);
2772
- const J = new RegExp("^" + q.split("").map((Bt) => hi.indexOf(Bt) !== -1 ? "\\" + Bt : Bt).join(".*"), "i");
2773
- let Y = d.value;
2774
- if (W === !0 || Y < 0 || J.test(ie.value(e.options[Y])) !== !0)
2775
- do
2776
- Y = zl(Y + 1, -1, $ - 1);
2777
- while (Y !== d.value && (Fe.value(e.options[Y]) === !0 || J.test(ie.value(e.options[Y])) !== !0));
2778
- d.value !== Y && ue(() => {
2779
- Me(Y), M(Y), Y >= 0 && e.useInput === !0 && e.fillInput === !0 && rt(ie.value(e.options[Y]), !0);
2780
- });
2781
- return;
2782
- }
2783
- if (!(n.keyCode !== 13 && (n.keyCode !== 32 || e.useInput === !0 || q !== "") && (n.keyCode !== 9 || x === !1))) {
2784
- if (n.keyCode !== 9 && ae(n), d.value !== -1 && d.value < $) {
2785
- Ve(e.options[d.value]);
2786
- return;
2787
- }
2788
- if (w === !0) {
2789
- const j = (W, J) => {
2790
- if (J) {
2791
- if (Fl(J) !== !0)
2792
- return;
2793
- } else
2794
- J = e.newValueMode;
2795
- if (Qe("", e.multiple !== !0, !0), W == null)
2796
- return;
2797
- (J === "toggle" ? Ve : Ut)(W, J === "add-unique"), e.multiple !== !0 && (B.value !== null && B.value.focus(), _e());
2798
- };
2799
- if (e.onNewValue !== void 0 ? l("newValue", v.value, j) : j(v.value), e.multiple !== !0)
2800
- return;
2801
- }
2802
- i.value === !0 ? Oe() : s.innerLoading.value !== !0 && Ie();
2803
- }
2804
- }
2805
- function el() {
2806
- return m === !0 ? Q.value : L.value !== null && L.value.contentEl !== null ? L.value.contentEl : void 0;
2807
- }
2808
- function mo() {
2809
- return el();
2810
- }
2811
- function ho() {
2812
- return e.hideSelected === !0 ? [] : t["selected-item"] !== void 0 ? qe.value.map((n) => t["selected-item"](n)).slice() : t.selected !== void 0 ? [].concat(t.selected()) : e.useChips === !0 ? qe.value.map((n, w) => h(kn, {
2813
- key: "option-" + w,
2814
- removable: s.editable.value === !0 && Fe.value(n.opt) !== !0,
2815
- dense: !0,
2816
- textColor: e.color,
2817
- tabindex: me.value,
2818
- onRemove() {
2819
- n.removeAtIndex(w);
2820
- }
2821
- }, () => h("span", {
2822
- class: "ellipsis",
2823
- [n.html === !0 ? "innerHTML" : "textContent"]: ie.value(n.opt)
2824
- }))) : [
2825
- h("span", {
2826
- [ze.value === !0 ? "innerHTML" : "textContent"]: Z.value
2827
- })
2828
- ];
2829
- }
2830
- function tl() {
2831
- if (N.value === !0)
2832
- return t["no-option"] !== void 0 ? t["no-option"]({ inputValue: v.value }) : void 0;
2833
- const n = t.option !== void 0 ? t.option : (x) => h(Kl, {
2834
- key: x.index,
2835
- ...x.itemProps
2836
- }, () => h(
2837
- pt,
2838
- () => h(
2839
- Nl,
2840
- () => h("span", {
2841
- [x.html === !0 ? "innerHTML" : "textContent"]: x.label
2842
- })
2843
- )
2844
- ));
2845
- let w = re("div", it.value.map(n));
2846
- return t["before-options"] !== void 0 && (w = t["before-options"]().concat(w)), Il(t["after-options"], w);
2847
- }
2848
- function go(n, w) {
2849
- const x = w === !0 ? { ...nt.value, ...s.splitAttrs.attributes.value } : void 0, $ = {
2850
- ref: w === !0 ? B : void 0,
2851
- key: "i_t",
2852
- class: F.value,
2853
- style: e.inputStyle,
2854
- value: v.value !== void 0 ? v.value : "",
2855
- // required for Android in order to show ENTER key when in form
2856
- type: "search",
2857
- ...x,
2858
- id: w === !0 ? s.targetUid.value : void 0,
2859
- maxlength: e.maxlength,
2860
- autocomplete: e.autocomplete,
2861
- "data-autofocus": n === !0 || e.autofocus === !0 || void 0,
2862
- disabled: e.disable === !0,
2863
- readonly: e.readonly === !0,
2864
- ...co.value
2865
- };
2866
- return n !== !0 && m === !0 && (Array.isArray($.class) === !0 ? $.class = [...$.class, "no-pointer-events"] : $.class += " no-pointer-events"), h("input", $);
2867
- }
2868
- function ll(n) {
2869
- y !== null && (clearTimeout(y), y = null), C !== null && (clearTimeout(C), C = null), !(n && n.target && n.target.qComposing === !0) && (rt(n.target.value || ""), _ = !0, P = v.value, s.focused.value !== !0 && (m !== !0 || g.value === !0) && s.focus(), e.onFilter !== void 0 && (y = setTimeout(() => {
2870
- y = null, Le(v.value);
2871
- }, e.inputDebounce)));
2872
- }
2873
- function rt(n, w) {
2874
- v.value !== n && (v.value = n, w === !0 || e.inputDebounce === 0 || e.inputDebounce === "0" ? l("inputValue", n) : C = setTimeout(() => {
2875
- C = null, l("inputValue", n);
2876
- }, e.inputDebounce));
2877
- }
2878
- function Qe(n, w, x) {
2879
- _ = x !== !0, e.useInput === !0 && (rt(n, !0), (w === !0 || x !== !0) && (P = n), w !== !0 && Le(n));
2880
- }
2881
- function Le(n, w, x) {
2882
- if (e.onFilter === void 0 || w !== !0 && s.focused.value !== !0)
2883
- return;
2884
- s.innerLoading.value === !0 ? l("filterAbort") : (s.innerLoading.value = !0, c.value = !0), n !== "" && e.multiple !== !0 && p.value.length !== 0 && _ !== !0 && n === ie.value(p.value[0]) && (n = "");
2885
- const $ = setTimeout(() => {
2886
- i.value === !0 && (i.value = !1);
2887
- }, 10);
2888
- S !== null && clearTimeout(S), S = $, l(
2889
- "filter",
2890
- n,
2891
- (j, W) => {
2892
- (w === !0 || s.focused.value === !0) && S === $ && (clearTimeout(S), typeof j == "function" && j(), c.value = !1, ue(() => {
2893
- s.innerLoading.value = !1, s.editable.value === !0 && (w === !0 ? i.value === !0 && _e() : i.value === !0 ? Et(!0) : i.value = !0), typeof W == "function" && ue(() => {
2894
- W(o);
2895
- }), typeof x == "function" && ue(() => {
2896
- x(o);
2897
- });
2898
- }));
2899
- },
2900
- () => {
2901
- s.focused.value === !0 && S === $ && (clearTimeout(S), s.innerLoading.value = !1, c.value = !1), i.value === !0 && (i.value = !1);
2902
- }
2903
- );
2904
- }
2905
- function po() {
2906
- return h(Zn, {
2907
- ref: L,
2908
- class: z.value,
2909
- style: e.popupContentStyle,
2910
- modelValue: i.value,
2911
- fit: e.menuShrink !== !0,
2912
- cover: e.optionsCover === !0 && N.value !== !0 && e.useInput !== !0,
2913
- anchor: e.menuAnchor,
2914
- self: e.menuSelf,
2915
- offset: e.menuOffset,
2916
- dark: V.value,
2917
- noParentEvent: !0,
2918
- noRefocus: !0,
2919
- noFocus: !0,
2920
- noRouteDismiss: e.popupNoRouteDismiss,
2921
- square: qt.value,
2922
- transitionShow: e.transitionShow,
2923
- transitionHide: e.transitionHide,
2924
- transitionDuration: e.transitionDuration,
2925
- separateClosePopup: !0,
2926
- ...ke.value,
2927
- onScrollPassive: k,
2928
- onBeforeShow: nl,
2929
- onBeforeHide: bo,
2930
- onShow: yo
2931
- }, tl);
2932
- }
2933
- function bo(n) {
2934
- il(n), Oe();
2935
- }
2936
- function yo() {
2937
- se();
2938
- }
2939
- function So(n) {
2940
- De(n), B.value !== null && B.value.focus(), g.value = !0, window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0);
2941
- }
2942
- function wo(n) {
2943
- De(n), ue(() => {
2944
- g.value = !1;
2945
- });
2946
- }
2947
- function xo() {
2948
- const n = [
2949
- h(xn, {
2950
- class: `col-auto ${s.fieldClass.value}`,
2951
- ...O.value,
2952
- for: s.targetUid.value,
2953
- dark: V.value,
2954
- square: !0,
2955
- loading: c.value,
2956
- itemAligned: !1,
2957
- filled: !0,
2958
- stackLabel: v.value.length !== 0,
2959
- ...s.splitAttrs.listeners.value,
2960
- onFocus: So,
2961
- onBlur: wo
2962
- }, {
2963
- ...t,
2964
- rawControl: () => s.getControl(!0),
2965
- before: void 0,
2966
- after: void 0
2967
- })
2968
- ];
2969
- return i.value === !0 && n.push(
2970
- h("div", {
2971
- ref: Q,
2972
- class: z.value + " scroll",
2973
- style: e.popupContentStyle,
2974
- ...ke.value,
2975
- onClick: pe,
2976
- onScrollPassive: k
2977
- }, tl())
2978
- ), h(ii, {
2979
- ref: H,
2980
- modelValue: u.value,
2981
- position: e.useInput === !0 ? "top" : void 0,
2982
- transitionShow: E,
2983
- transitionHide: e.transitionHide,
2984
- transitionDuration: e.transitionDuration,
2985
- noRouteDismiss: e.popupNoRouteDismiss,
2986
- onBeforeShow: nl,
2987
- onBeforeHide: Co,
2988
- onHide: ko,
2989
- onShow: qo
2990
- }, () => h("div", {
2991
- class: "q-select__dialog" + (V.value === !0 ? " q-select__dialog--dark q-dark" : "") + (g.value === !0 ? " q-select__dialog--focused" : "")
2992
- }, n));
2993
- }
2994
- function Co(n) {
2995
- il(n), H.value !== null && H.value.__updateRefocusTarget(
2996
- s.rootRef.value.querySelector(".q-field__native > [tabindex]:last-child")
2997
- ), s.focused.value = !1;
2998
- }
2999
- function ko(n) {
3000
- _e(), s.focused.value === !1 && l("blur", n), He();
3001
- }
3002
- function qo() {
3003
- const n = document.activeElement;
3004
- (n === null || n.id !== s.targetUid.value) && B.value !== null && B.value !== n && B.value.focus(), se();
3005
- }
3006
- function Oe() {
3007
- u.value !== !0 && (d.value = -1, i.value === !0 && (i.value = !1), s.focused.value === !1 && (S !== null && (clearTimeout(S), S = null), s.innerLoading.value === !0 && (l("filterAbort"), s.innerLoading.value = !1, c.value = !1)));
3008
- }
3009
- function Ie(n) {
3010
- s.editable.value === !0 && (m === !0 ? (s.onControlFocusin(n), u.value = !0, ue(() => {
3011
- s.focus();
3012
- })) : s.focus(), e.onFilter !== void 0 ? Le(v.value) : (N.value !== !0 || t["no-option"] !== void 0) && (i.value = !0));
3013
- }
3014
- function _e() {
3015
- u.value = !1, Oe();
3016
- }
3017
- function He() {
3018
- e.useInput === !0 && Qe(
3019
- e.multiple !== !0 && e.fillInput === !0 && p.value.length !== 0 && ie.value(p.value[0]) || "",
3020
- !0,
3021
- !0
3022
- );
3023
- }
3024
- function Et(n) {
3025
- let w = -1;
3026
- if (n === !0) {
3027
- if (p.value.length !== 0) {
3028
- const x = he.value(p.value[0]);
3029
- w = e.options.findIndex(($) => Ce(he.value($), x));
3030
- }
3031
- X(w);
3032
- }
3033
- Me(w);
3034
- }
3035
- function Vo(n, w) {
3036
- i.value === !0 && s.innerLoading.value === !1 && (X(-1, !0), ue(() => {
3037
- i.value === !0 && s.innerLoading.value === !1 && (n > w ? X() : Et(!0));
3038
- }));
3039
- }
3040
- function ol() {
3041
- u.value === !1 && L.value !== null && L.value.updatePosition();
3042
- }
3043
- function nl(n) {
3044
- n !== void 0 && De(n), l("popupShow", n), s.hasPopupOpen = !0, s.onControlFocusin(n);
3045
- }
3046
- function il(n) {
3047
- n !== void 0 && De(n), l("popupHide", n), s.hasPopupOpen = !1, s.onControlFocusout(n);
3048
- }
3049
- function ul() {
3050
- m = a.platform.is.mobile !== !0 && e.behavior !== "dialog" ? !1 : e.behavior !== "menu" && (e.useInput === !0 ? t["no-option"] !== void 0 || e.onFilter !== void 0 || N.value === !1 : !0), E = a.platform.is.ios === !0 && m === !0 && e.useInput === !0 ? "fade" : e.transitionShow;
3051
- }
3052
- return Ml(ul), To(ol), ul(), ce(() => {
3053
- y !== null && clearTimeout(y), C !== null && clearTimeout(C);
3054
- }), Object.assign(o, {
3055
- showPopup: Ie,
3056
- hidePopup: _e,
3057
- removeAtIndex: Vt,
3058
- add: Ut,
3059
- toggleOption: Ve,
3060
- getOptionIndex: () => d.value,
3061
- setOptionIndex: Me,
3062
- moveOptionSelection: at,
3063
- filter: Le,
3064
- updateMenuPosition: ol,
3065
- updateInputValue: Qe,
3066
- isOptionSelected: _t,
3067
- getEmittingOptionValue: Qt,
3068
- isOptionDisabled: (...n) => Fe.value.apply(null, n) === !0,
3069
- getOptionValue: (...n) => he.value.apply(null, n),
3070
- getOptionLabel: (...n) => ie.value.apply(null, n)
3071
- }), Object.assign(s, {
3072
- innerValue: p,
3073
- fieldClass: f(
3074
- () => `q-select q-field--auto-height q-select--with${e.useInput !== !0 ? "out" : ""}-input q-select--with${e.useChips !== !0 ? "out" : ""}-chips q-select--${e.multiple === !0 ? "multiple" : "single"}`
3075
- ),
3076
- inputRef: D,
3077
- targetRef: B,
3078
- hasValue: I,
3079
- showPopup: Ie,
3080
- floatingLabel: f(
3081
- () => e.hideSelected !== !0 && I.value === !0 || typeof v.value == "number" || v.value.length !== 0 || Wt(e.displayValue)
3082
- ),
3083
- getControlChild: () => {
3084
- if (s.editable.value !== !1 && (u.value === !0 || N.value !== !0 || t["no-option"] !== void 0))
3085
- return m === !0 ? xo() : po();
3086
- s.hasPopupOpen === !0 && (s.hasPopupOpen = !1);
3087
- },
3088
- controlEvents: {
3089
- onFocusin(n) {
3090
- s.onControlFocusin(n);
3091
- },
3092
- onFocusout(n) {
3093
- s.onControlFocusout(n, () => {
3094
- He(), Oe();
3095
- });
3096
- },
3097
- onClick(n) {
3098
- if (pe(n), m !== !0 && i.value === !0) {
3099
- Oe(), B.value !== null && B.value.focus();
3100
- return;
3101
- }
3102
- Ie(n);
3103
- }
3104
- },
3105
- getControl: (n) => {
3106
- const w = ho(), x = n === !0 || u.value !== !0 || m !== !0;
3107
- if (e.useInput === !0)
3108
- w.push(go(n, x));
3109
- else if (s.editable.value === !0) {
3110
- const j = x === !0 ? nt.value : void 0;
3111
- w.push(
3112
- h("input", {
3113
- ref: x === !0 ? B : void 0,
3114
- key: "d_t",
3115
- class: "q-select__focus-target",
3116
- id: x === !0 ? s.targetUid.value : void 0,
3117
- value: Z.value,
3118
- readonly: !0,
3119
- "data-autofocus": n === !0 || e.autofocus === !0 || void 0,
3120
- ...j,
3121
- onKeydown: Jt,
3122
- onKeyup: Yt,
3123
- onKeypress: Zt
3124
- })
3125
- ), x === !0 && typeof e.autocomplete == "string" && e.autocomplete.length !== 0 && w.push(
3126
- h("input", {
3127
- class: "q-select__autocomplete-input",
3128
- autocomplete: e.autocomplete,
3129
- tabindex: -1,
3130
- onKeyup: Gt
3131
- })
3132
- );
3133
- }
3134
- if (G.value !== void 0 && e.disable !== !0 && ut.value.length !== 0) {
3135
- const j = ut.value.map((W) => h("option", { value: W, selected: !0 }));
3136
- w.push(
3137
- h("select", {
3138
- class: "hidden",
3139
- name: G.value,
3140
- multiple: e.multiple
3141
- }, j)
3142
- );
3143
- }
3144
- const $ = e.useInput === !0 || x !== !0 ? void 0 : s.splitAttrs.attributes.value;
3145
- return h("div", {
3146
- class: "q-field__native row items-center",
3147
- ...$,
3148
- ...s.splitAttrs.listeners.value
3149
- }, w);
3150
- },
3151
- getInnerAppend: () => e.loading !== !0 && c.value !== !0 && e.hideDropdownIcon !== !0 ? [
3152
- h(Ae, {
3153
- class: "q-select__dropdown-icon" + (i.value === !0 ? " rotate-180" : ""),
3154
- name: Ne.value
3155
- })
3156
- ] : null
3157
- }), Gl(s);
3158
- }
3159
- }), bi = { class: "app-select__amount" }, yi = /* @__PURE__ */ Ro({
3160
- __name: "AppSelect",
3161
- props: {
3162
- modelValue: {},
3163
- size: { default: Yo.MD },
3164
- options: {},
3165
- multiple: { type: Boolean },
3166
- label: {},
3167
- placeholder: {},
3168
- required: { type: Boolean },
3169
- clearable: { type: Boolean },
3170
- disabled: { type: Boolean },
3171
- loading: { type: Boolean },
3172
- filtering: { type: Boolean },
3173
- autofocus: { type: Boolean },
3174
- rules: {},
3175
- lazyRules: { type: [Boolean, String] }
3176
- },
3177
- emits: ["update:modelValue"],
3178
- setup(e, { emit: t }) {
3179
- const l = e, o = t, a = T(!1), i = T(""), u = f({
3180
- get() {
3181
- return l.modelValue;
3182
- },
3183
- set(r) {
3184
- o("update:modelValue", r);
3185
- }
3186
- }), d = f(() => {
3187
- var r;
3188
- if (Array.isArray(u.value)) {
3189
- if (l.multiple && u.value.length == 0)
3190
- return l.placeholder;
3191
- } else return ((r = u.value) == null ? void 0 : r.label) || l.placeholder || "";
3192
- return "";
3193
- }), v = f(() => !(!l.clearable || !l.modelValue || l.modelValue && Array.isArray(l.modelValue) && !l.modelValue.length)), g = f(() => i.value ? l.options.filter(
3194
- (r) => r.label.toLowerCase().includes(i.value.toLowerCase())
3195
- ) : l.options), c = f(() => {
3196
- if (l.rules)
3197
- return l.required ? [...l.rules, cl] : l.rules;
3198
- if (l.required)
3199
- return [cl];
3200
- }), y = () => {
3201
- u.value = void 0;
3202
- }, C = (r, m) => {
3203
- m(() => {
3204
- i.value = r;
3205
- });
3206
- };
3207
- return (r, m) => (de(), ye("div", {
3208
- class: st(["app-select", [{ "app-select_opened": a.value }, `app-select_${r.size}`]])
3209
- }, [
3210
- r.label ? (de(), ye("label", {
3211
- key: 0,
3212
- class: st(["app-select__label", { "app-select__label_bold": r.required }])
3213
- }, Ue(r.required ? `${r.label} *` : r.label), 3)) : Pe("", !0),
3214
- Xe(zo(pi), {
3215
- standout: "",
3216
- "hide-bottom-space": "",
3217
- "hide-dropdown-icon": "",
3218
- "no-error-icon": "",
3219
- behavior: "menu",
3220
- "popup-content-class": `app-select-menu app-select-menu_${r.size}`,
3221
- placeholder: r.filtering && "Почніть вводити",
3222
- "input-debounce": "50",
3223
- modelValue: u.value,
3224
- "onUpdate:modelValue": m[0] || (m[0] = (_) => u.value = _),
3225
- options: g.value,
3226
- multiple: r.multiple,
3227
- "use-input": r.filtering && (Array.isArray(u.value) || !u.value),
3228
- rules: c.value,
3229
- "lazy-rules": r.lazyRules,
3230
- autofocus: r.autofocus,
3231
- disable: r.disabled,
3232
- loading: r.loading,
3233
- onFilter: C,
3234
- onPopupShow: m[1] || (m[1] = (_) => a.value = !0),
3235
- onPopupHide: m[2] || (m[2] = (_) => a.value = !1)
3236
- }, {
3237
- append: xe(() => [
3238
- v.value ? (de(), ye("i", {
3239
- key: 0,
3240
- class: "icon-kl icon-kl-close app-select__clear",
3241
- onClick: Mo(y, ["stop", "prevent"])
3242
- })) : Pe("", !0),
3243
- m[3] || (m[3] = At("i", { class: "icon-kl icon-kl-arrow-down app-select__drop-icon" }, null, -1))
3244
- ]),
3245
- selected: xe(() => {
3246
- var _, S;
3247
- return [
3248
- Array.isArray(u.value) ? (de(), ye(ct, { key: 0 }, [
3249
- !r.filtering || u.value.length ? (de(), ye("span", {
3250
- key: 0,
3251
- class: st([
3252
- "app-select__selected",
3253
- {
3254
- "app-select__placeholder": !((_ = u.value) != null && _.length) && r.placeholder
3255
- }
3256
- ])
3257
- }, [
3258
- (S = u.value) != null && S.length ? (de(), ye(ct, { key: 0 }, [
3259
- m[4] || (m[4] = Tt(" Вибрано ")),
3260
- At("span", bi, Ue(u.value.length), 1)
3261
- ], 64)) : (de(), ye(ct, { key: 1 }, [
3262
- Tt(Ue(l.placeholder), 1)
3263
- ], 64))
3264
- ], 2)) : Pe("", !0)
3265
- ], 64)) : (de(), ye(ct, { key: 1 }, [
3266
- !r.filtering || u.value ? (de(), ye("span", {
3267
- key: 0,
3268
- class: st([
3269
- "app-select__selected",
3270
- { "app-select__placeholder": !u.value && r.placeholder }
3271
- ])
3272
- }, Ue(d.value), 3)) : Pe("", !0)
3273
- ], 64))
3274
- ];
3275
- }),
3276
- option: xe((_) => [
3277
- Xe(Kl, Fo({
3278
- class: ["app-select__option", { "app-select__option_selected": _.selected }]
3279
- }, _.itemProps), {
3280
- default: xe(() => [
3281
- l.multiple ? (de(), al(pt, {
3282
- key: 0,
3283
- class: "option-multiple",
3284
- avatar: ""
3285
- }, {
3286
- default: xe(() => [
3287
- Xe(sn, {
3288
- size: "30px",
3289
- "model-value": _.selected,
3290
- "onUpdate:modelValue": () => _.toggleOption(_.opt)
3291
- }, null, 8, ["model-value", "onUpdate:modelValue"])
3292
- ]),
3293
- _: 2
3294
- }, 1024)) : Pe("", !0),
3295
- _.opt.done ? (de(), al(pt, {
3296
- key: 1,
3297
- class: "option-done",
3298
- avatar: ""
3299
- }, {
3300
- default: xe(() => m[5] || (m[5] = [
3301
- At("i", { class: "icon-kl icon-kl-check option-done__icon" }, null, -1)
3302
- ])),
3303
- _: 1
3304
- })) : Pe("", !0),
3305
- Xe(pt, null, {
3306
- default: xe(() => [
3307
- Xe(Nl, null, {
3308
- default: xe(() => [
3309
- Tt(Ue(_.opt.label), 1)
3310
- ]),
3311
- _: 2
3312
- }, 1024)
3313
- ]),
3314
- _: 2
3315
- }, 1024)
3316
- ]),
3317
- _: 2
3318
- }, 1040, ["class"])
3319
- ]),
3320
- _: 1
3321
- }, 8, ["popup-content-class", "placeholder", "modelValue", "options", "multiple", "use-input", "rules", "lazy-rules", "autofocus", "disable", "loading"])
3322
- ], 2));
3323
- }
3324
- }), ki = /* @__PURE__ */ Jo(yi, [["__scopeId", "data-v-435de7e5"]]);
3325
- export {
3326
- ki as default
3327
- };