@validol4ik/uikit 0.7.1 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2302 @@
1
+ import { getCurrentInstance as re, ref as M, onBeforeUpdate as el, inject as _l, watch as J, onMounted as tl, onBeforeUnmount as Ve, computed as r, nextTick as fe, onDeactivated as ll, onActivated as ol, h as g, Transition as gt, onBeforeMount as Al, onUpdated as Bl, defineComponent as zl, createElementBlock as ce, openBlock as de, normalizeClass as Xe, createCommentVNode as Ye, createVNode as Tt, toDisplayString as Ze, unref as El, withCtx as rt, mergeProps as Rl, Fragment as Je, createTextVNode as Ot, createElementVNode as Mt, withModifiers as Fl } from "vue";
2
+ import { u as pt, s as ae, p as ge, a as bt, Q as Oe, b as Tl, h as qe, c as xe, d as Ol, e as Ml, f as Il, g as Ll, R as Hl, i as Pl, j as $l, k as nl, l as Dl, m as we, n as jl, o as Kl, q as Nl, r as Ul, t as Ql, v as Wl, w as Te, x as Xl, S as Yl, P as Zl, _ as Jl } from "./index-B8rGKrFf.js";
3
+ import { a as ul, u as Gl, r as eo, g as to, b as lo, h as oo, c as no, d as uo, e as io, f as ao, i as ro, j as so, k as co, l as fo, m as It, n as vo, Q as mo } from "./QMenu-CqwHVhVH.js";
4
+ import { b as go, c as ke, r as Lt, a as ho } from "./focusout-DjvPXP_b.js";
5
+ const Ht = (e) => e ? !0 : "Обовʼязкове поле", Pt = /^on[A-Z]/;
6
+ function po() {
7
+ const { attrs: e, vnode: t } = re(), o = {
8
+ listeners: M({}),
9
+ attributes: M({})
10
+ };
11
+ function n() {
12
+ const d = {}, u = {};
13
+ for (const a in e)
14
+ a !== "class" && a !== "style" && Pt.test(a) === !1 && (d[a] = e[a]);
15
+ for (const a in t.props)
16
+ Pt.test(a) === !0 && (u[a] = t.props[a]);
17
+ o.attributes.value = d, o.listeners.value = u;
18
+ }
19
+ return el(n), n(), o;
20
+ }
21
+ const bo = "_q_fo_";
22
+ function So({ validate: e, resetValidation: t, requiresQForm: o }) {
23
+ const n = _l(bo, !1);
24
+ if (n !== !1) {
25
+ const { props: d, proxy: u } = re();
26
+ Object.assign(u, { validate: e, resetValidation: t }), J(() => d.disable, (a) => {
27
+ a === !0 ? (typeof t == "function" && t(), n.unbindComponent(u)) : n.bindComponent(u);
28
+ }), tl(() => {
29
+ d.disable !== !0 && n.bindComponent(u);
30
+ }), Ve(() => {
31
+ d.disable !== !0 && n.unbindComponent(u);
32
+ });
33
+ } else o === !0 && console.error("Parent QForm not found on useFormChild()!");
34
+ }
35
+ const $t = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/, Dt = /^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/, jt = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, Ge = /^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])\)$/, et = /^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)\)$/, st = {
36
+ date: (e) => /^-?[\d]+\/[0-1]\d\/[0-3]\d$/.test(e),
37
+ time: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d$/.test(e),
38
+ fulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(e),
39
+ timeOrFulltime: (e) => /^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(e),
40
+ // -- RFC 5322 --
41
+ // -- Added in v2.6.6 --
42
+ // This is a basic helper validation.
43
+ // For something more complex (like RFC 822) you should write and use your own rule.
44
+ // We won't be accepting PRs to enhance the one below because of the reason above.
45
+ // eslint-disable-next-line
46
+ 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),
47
+ hexColor: (e) => $t.test(e),
48
+ hexaColor: (e) => Dt.test(e),
49
+ hexOrHexaColor: (e) => jt.test(e),
50
+ rgbColor: (e) => Ge.test(e),
51
+ rgbaColor: (e) => et.test(e),
52
+ rgbOrRgbaColor: (e) => Ge.test(e) || et.test(e),
53
+ hexOrRgbColor: (e) => $t.test(e) || Ge.test(e),
54
+ hexaOrRgbaColor: (e) => Dt.test(e) || et.test(e),
55
+ anyColor: (e) => jt.test(e) || Ge.test(e) || et.test(e)
56
+ };
57
+ function il(e, t = 250, o) {
58
+ let n = null;
59
+ function d() {
60
+ const u = arguments, a = () => {
61
+ n = null, e.apply(this, u);
62
+ };
63
+ n !== null ? clearTimeout(n) : o === !0 && e.apply(this, u), n = setTimeout(a, t);
64
+ }
65
+ return d.cancel = () => {
66
+ n !== null && clearTimeout(n);
67
+ }, d;
68
+ }
69
+ const yo = [!0, !1, "ondemand"], wo = {
70
+ modelValue: {},
71
+ error: {
72
+ type: Boolean,
73
+ default: null
74
+ },
75
+ errorMessage: String,
76
+ noErrorIcon: Boolean,
77
+ rules: Array,
78
+ reactiveRules: Boolean,
79
+ lazyRules: {
80
+ type: [Boolean, String],
81
+ default: !1,
82
+ // statement unneeded but avoids future vue implementation changes
83
+ validator: (e) => yo.includes(e)
84
+ }
85
+ };
86
+ function Co(e, t) {
87
+ const { props: o, proxy: n } = re(), d = M(!1), u = M(null), a = M(!1);
88
+ So({ validate: h, resetValidation: T });
89
+ let b = 0, S;
90
+ const _ = r(
91
+ () => o.rules !== void 0 && o.rules !== null && o.rules.length !== 0
92
+ ), f = r(() => o.disable !== !0 && _.value === !0 && t.value === !1), w = r(
93
+ () => o.error === !0 || d.value === !0
94
+ ), k = r(() => typeof o.errorMessage == "string" && o.errorMessage.length !== 0 ? o.errorMessage : u.value);
95
+ J(() => o.modelValue, () => {
96
+ a.value = !0, f.value === !0 && o.lazyRules === !1 && m();
97
+ });
98
+ function C() {
99
+ o.lazyRules !== "ondemand" && f.value === !0 && a.value === !0 && m();
100
+ }
101
+ J(() => o.reactiveRules, (q) => {
102
+ q === !0 ? S === void 0 && (S = J(() => o.rules, C, { immediate: !0, deep: !0 })) : S !== void 0 && (S(), S = void 0);
103
+ }, { immediate: !0 }), J(() => o.lazyRules, C), J(e, (q) => {
104
+ q === !0 ? a.value = !0 : f.value === !0 && o.lazyRules !== "ondemand" && m();
105
+ });
106
+ function T() {
107
+ b++, t.value = !1, a.value = !1, d.value = !1, u.value = null, m.cancel();
108
+ }
109
+ function h(q = o.modelValue) {
110
+ if (o.disable === !0 || _.value === !1)
111
+ return !0;
112
+ const D = ++b, B = t.value !== !0 ? () => {
113
+ a.value = !0;
114
+ } : () => {
115
+ }, I = (O, P) => {
116
+ O === !0 && B(), d.value = O, u.value = P || null, t.value = !1;
117
+ }, Y = [];
118
+ for (let O = 0; O < o.rules.length; O++) {
119
+ const P = o.rules[O];
120
+ let $;
121
+ if (typeof P == "function" ? $ = P(q, st) : typeof P == "string" && st[P] !== void 0 && ($ = st[P](q)), $ === !1 || typeof $ == "string")
122
+ return I(!0, $), !1;
123
+ $ !== !0 && $ !== void 0 && Y.push($);
124
+ }
125
+ return Y.length === 0 ? (I(!1), !0) : (t.value = !0, Promise.all(Y).then(
126
+ (O) => {
127
+ if (O === void 0 || Array.isArray(O) === !1 || O.length === 0)
128
+ return D === b && I(!1), !0;
129
+ const P = O.find(($) => $ === !1 || typeof $ == "string");
130
+ return D === b && I(P !== void 0, P), P === void 0;
131
+ },
132
+ (O) => (D === b && (console.error(O), I(!0)), !1)
133
+ ));
134
+ }
135
+ const m = il(h, 0);
136
+ return Ve(() => {
137
+ S == null || S(), m.cancel();
138
+ }), Object.assign(n, { resetValidation: T, validate: h }), go(n, "hasError", () => w.value), {
139
+ isDirtyModel: a,
140
+ hasRules: _,
141
+ hasError: w,
142
+ errorMessage: k,
143
+ validate: h,
144
+ resetValidation: T
145
+ };
146
+ }
147
+ function ht(e) {
148
+ return e != null && ("" + e).length !== 0;
149
+ }
150
+ const qo = {
151
+ ...pt,
152
+ ...wo,
153
+ label: String,
154
+ stackLabel: Boolean,
155
+ hint: String,
156
+ hideHint: Boolean,
157
+ prefix: String,
158
+ suffix: String,
159
+ labelColor: String,
160
+ color: String,
161
+ bgColor: String,
162
+ filled: Boolean,
163
+ outlined: Boolean,
164
+ borderless: Boolean,
165
+ standout: [Boolean, String],
166
+ square: Boolean,
167
+ loading: Boolean,
168
+ labelSlot: Boolean,
169
+ bottomSlots: Boolean,
170
+ hideBottomSpace: Boolean,
171
+ rounded: Boolean,
172
+ dense: Boolean,
173
+ itemAligned: Boolean,
174
+ counter: Boolean,
175
+ clearable: Boolean,
176
+ clearIcon: String,
177
+ disable: Boolean,
178
+ readonly: Boolean,
179
+ autofocus: Boolean,
180
+ for: String
181
+ }, St = {
182
+ ...qo,
183
+ maxlength: [Number, String]
184
+ }, al = ["update:modelValue", "clear", "focus", "blur"];
185
+ function rl({ requiredForAttr: e = !0, tagProp: t, changeEvent: o = !1 } = {}) {
186
+ const { props: n, proxy: d } = re(), u = bt(n, d.$q), a = Gl({
187
+ required: e,
188
+ getValue: () => n.for
189
+ });
190
+ return {
191
+ requiredForAttr: e,
192
+ changeEvent: o,
193
+ tag: t === !0 ? r(() => n.tag) : { value: "label" },
194
+ isDark: u,
195
+ editable: r(
196
+ () => n.disable !== !0 && n.readonly !== !0
197
+ ),
198
+ innerLoading: M(!1),
199
+ focused: M(!1),
200
+ hasPopupOpen: !1,
201
+ splitAttrs: po(),
202
+ targetUid: a,
203
+ rootRef: M(null),
204
+ targetRef: M(null),
205
+ controlRef: M(null)
206
+ /**
207
+ * user supplied additionals:
208
+
209
+ * innerValue - computed
210
+ * floatingLabel - computed
211
+ * inputRef - computed
212
+
213
+ * fieldClass - computed
214
+ * hasShadow - computed
215
+
216
+ * controlEvents - Object with fn(e)
217
+
218
+ * getControl - fn
219
+ * getInnerAppend - fn
220
+ * getControlChild - fn
221
+ * getShadowControl - fn
222
+ * showPopup - fn
223
+ */
224
+ };
225
+ }
226
+ function sl(e) {
227
+ const { props: t, emit: o, slots: n, attrs: d, proxy: u } = re(), { $q: a } = u;
228
+ let b = null;
229
+ e.hasValue === void 0 && (e.hasValue = r(() => ht(t.modelValue))), e.emitValue === void 0 && (e.emitValue = (p) => {
230
+ o("update:modelValue", p);
231
+ }), e.controlEvents === void 0 && (e.controlEvents = {
232
+ onFocusin: oe,
233
+ onFocusout: X
234
+ }), Object.assign(e, {
235
+ clearValue: ne,
236
+ onControlFocusin: oe,
237
+ onControlFocusout: X,
238
+ focus: P
239
+ }), e.computedCounter === void 0 && (e.computedCounter = r(() => {
240
+ if (t.counter !== !1) {
241
+ const p = typeof t.modelValue == "string" || typeof t.modelValue == "number" ? ("" + t.modelValue).length : Array.isArray(t.modelValue) === !0 ? t.modelValue.length : 0, V = t.maxlength !== void 0 ? t.maxlength : t.maxValues;
242
+ return p + (V !== void 0 ? " / " + V : "");
243
+ }
244
+ }));
245
+ const {
246
+ isDirtyModel: S,
247
+ hasRules: _,
248
+ hasError: f,
249
+ errorMessage: w,
250
+ resetValidation: k
251
+ } = Co(e.focused, e.innerLoading), C = e.floatingLabel !== void 0 ? r(() => t.stackLabel === !0 || e.focused.value === !0 || e.floatingLabel.value === !0) : r(() => t.stackLabel === !0 || e.focused.value === !0 || e.hasValue.value === !0), T = r(
252
+ () => t.bottomSlots === !0 || t.hint !== void 0 || _.value === !0 || t.counter === !0 || t.error !== null
253
+ ), h = r(() => t.filled === !0 ? "filled" : t.outlined === !0 ? "outlined" : t.borderless === !0 ? "borderless" : t.standout ? "standout" : "standard"), m = r(
254
+ () => `q-field row no-wrap items-start q-field--${h.value}` + (e.fieldClass !== void 0 ? ` ${e.fieldClass.value}` : "") + (t.rounded === !0 ? " q-field--rounded" : "") + (t.square === !0 ? " q-field--square" : "") + (C.value === !0 ? " q-field--float" : "") + (D.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" : "") + (f.value === !0 ? " q-field--error" : "") + (f.value === !0 || e.focused.value === !0 ? " q-field--highlighted" : "") + (t.hideBottomSpace !== !0 && T.value === !0 ? " q-field--with-bottom" : "") + (t.disable === !0 ? " q-field--disabled" : t.readonly === !0 ? " q-field--readonly" : "")
255
+ ), q = r(
256
+ () => "q-field__control relative-position row no-wrap" + (t.bgColor !== void 0 ? ` bg-${t.bgColor}` : "") + (f.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}` : "")
257
+ ), D = r(
258
+ () => t.labelSlot === !0 || t.label !== void 0
259
+ ), B = r(
260
+ () => "q-field__label no-pointer-events absolute ellipsis" + (t.labelColor !== void 0 && f.value !== !0 ? ` text-${t.labelColor}` : "")
261
+ ), I = r(() => ({
262
+ id: e.targetUid.value,
263
+ editable: e.editable.value,
264
+ focused: e.focused.value,
265
+ floatingLabel: C.value,
266
+ modelValue: t.modelValue,
267
+ emitValue: e.emitValue
268
+ })), Y = r(() => {
269
+ const p = {};
270
+ return e.targetUid.value && (p.for = e.targetUid.value), t.disable === !0 && (p["aria-disabled"] = "true"), p;
271
+ });
272
+ function O() {
273
+ var W;
274
+ const p = document.activeElement;
275
+ let V = (W = e.targetRef) == null ? void 0 : W.value;
276
+ V && (p === null || p.id !== e.targetUid.value) && (V.hasAttribute("tabindex") === !0 || (V = V.querySelector("[tabindex]")), V !== p && (V == null || V.focus({ preventScroll: !0 })));
277
+ }
278
+ function P() {
279
+ ul(O);
280
+ }
281
+ function $() {
282
+ eo(O);
283
+ const p = document.activeElement;
284
+ p !== null && e.rootRef.value.contains(p) && p.blur();
285
+ }
286
+ function oe(p) {
287
+ b !== null && (clearTimeout(b), b = null), e.editable.value === !0 && e.focused.value === !1 && (e.focused.value = !0, o("focus", p));
288
+ }
289
+ function X(p, V) {
290
+ b !== null && clearTimeout(b), b = setTimeout(() => {
291
+ b = 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, o("blur", p)), V == null || V());
292
+ });
293
+ }
294
+ function ne(p) {
295
+ var V;
296
+ ae(p), a.platform.is.mobile !== !0 ? (((V = e.targetRef) == null ? void 0 : V.value) || e.rootRef.value).focus() : e.rootRef.value.contains(document.activeElement) === !0 && document.activeElement.blur(), t.type === "file" && (e.inputRef.value.value = null), o("update:modelValue", null), e.changeEvent === !0 && o("change", null), o("clear", t.modelValue), fe(() => {
297
+ const W = S.value;
298
+ k(), S.value = W;
299
+ });
300
+ }
301
+ function Q(p) {
302
+ [13, 32].includes(p.keyCode) && ne(p);
303
+ }
304
+ function se() {
305
+ const p = [];
306
+ return n.prepend !== void 0 && p.push(
307
+ g("div", {
308
+ class: "q-field__prepend q-field__marginal row no-wrap items-center",
309
+ key: "prepend",
310
+ onClick: ge
311
+ }, n.prepend())
312
+ ), p.push(
313
+ g("div", {
314
+ class: "q-field__control-container col relative-position row no-wrap q-anchor--skip"
315
+ }, ve())
316
+ ), f.value === !0 && t.noErrorIcon === !1 && p.push(
317
+ U("error", [
318
+ g(Oe, { name: a.iconSet.field.error, color: "negative" })
319
+ ])
320
+ ), t.loading === !0 || e.innerLoading.value === !0 ? p.push(
321
+ U(
322
+ "inner-loading-append",
323
+ n.loading !== void 0 ? n.loading() : [g(Tl, { color: t.color })]
324
+ )
325
+ ) : t.clearable === !0 && e.hasValue.value === !0 && e.editable.value === !0 && p.push(
326
+ U("inner-clearable-append", [
327
+ g(Oe, {
328
+ class: "q-field__focusable-action",
329
+ name: t.clearIcon || a.iconSet.field.clear,
330
+ tabindex: 0,
331
+ role: "button",
332
+ "aria-hidden": "false",
333
+ "aria-label": a.lang.label.clear,
334
+ onKeyup: Q,
335
+ onClick: ne
336
+ })
337
+ ])
338
+ ), n.append !== void 0 && p.push(
339
+ g("div", {
340
+ class: "q-field__append q-field__marginal row no-wrap items-center",
341
+ key: "append",
342
+ onClick: ge
343
+ }, n.append())
344
+ ), e.getInnerAppend !== void 0 && p.push(
345
+ U("inner-append", e.getInnerAppend())
346
+ ), e.getControlChild !== void 0 && p.push(
347
+ e.getControlChild()
348
+ ), p;
349
+ }
350
+ function ve() {
351
+ const p = [];
352
+ return t.prefix !== void 0 && t.prefix !== null && p.push(
353
+ g("div", {
354
+ class: "q-field__prefix no-pointer-events row items-center"
355
+ }, t.prefix)
356
+ ), e.getShadowControl !== void 0 && e.hasShadow.value === !0 && p.push(
357
+ e.getShadowControl()
358
+ ), D.value === !0 && p.push(
359
+ g("div", {
360
+ class: B.value
361
+ }, qe(n.label, t.label))
362
+ ), e.getControl !== void 0 ? p.push(e.getControl()) : n.rawControl !== void 0 ? p.push(n.rawControl()) : n.control !== void 0 && p.push(
363
+ g("div", {
364
+ ref: e.targetRef,
365
+ class: "q-field__native row",
366
+ tabindex: -1,
367
+ ...e.splitAttrs.attributes.value,
368
+ "data-autofocus": t.autofocus === !0 || void 0
369
+ }, n.control(I.value))
370
+ ), t.suffix !== void 0 && t.suffix !== null && p.push(
371
+ g("div", {
372
+ class: "q-field__suffix no-pointer-events row items-center"
373
+ }, t.suffix)
374
+ ), p.concat(qe(n.default));
375
+ }
376
+ function Z() {
377
+ let p, V;
378
+ f.value === !0 ? w.value !== null ? (p = [g("div", { role: "alert" }, w.value)], V = `q--slot-error-${w.value}`) : (p = qe(n.error), V = "q--slot-error") : (t.hideHint !== !0 || e.focused.value === !0) && (t.hint !== void 0 ? (p = [g("div", t.hint)], V = `q--slot-hint-${t.hint}`) : (p = qe(n.hint), V = "q--slot-hint"));
379
+ const W = t.counter === !0 || n.counter !== void 0;
380
+ if (t.hideBottomSpace === !0 && W === !1 && p === void 0) return;
381
+ const i = g("div", {
382
+ key: V,
383
+ class: "q-field__messages col"
384
+ }, p);
385
+ return g("div", {
386
+ class: "q-field__bottom row items-start q-field__bottom--" + (t.hideBottomSpace !== !0 ? "animated" : "stale"),
387
+ onClick: ge
388
+ }, [
389
+ t.hideBottomSpace === !0 ? i : g(gt, { name: "q-transition--field-message" }, () => i),
390
+ W === !0 ? g("div", {
391
+ class: "q-field__counter"
392
+ }, n.counter !== void 0 ? n.counter() : e.computedCounter.value) : null
393
+ ]);
394
+ }
395
+ function U(p, V) {
396
+ return V === null ? null : g("div", {
397
+ key: p,
398
+ class: "q-field__append q-field__marginal row no-wrap items-center q-anchor--skip"
399
+ }, V);
400
+ }
401
+ let ue = !1;
402
+ return ll(() => {
403
+ ue = !0;
404
+ }), ol(() => {
405
+ ue === !0 && t.autofocus === !0 && u.focus();
406
+ }), t.autofocus === !0 && tl(() => {
407
+ u.focus();
408
+ }), Ve(() => {
409
+ b !== null && clearTimeout(b);
410
+ }), Object.assign(u, { focus: P, blur: $ }), function() {
411
+ const V = e.getControl === void 0 && n.control === void 0 ? {
412
+ ...e.splitAttrs.attributes.value,
413
+ "data-autofocus": t.autofocus === !0 || void 0,
414
+ ...Y.value
415
+ } : Y.value;
416
+ return g(e.tag.value, {
417
+ ref: e.rootRef,
418
+ class: [
419
+ m.value,
420
+ d.class
421
+ ],
422
+ style: d.style,
423
+ ...V
424
+ }, [
425
+ n.before !== void 0 ? g("div", {
426
+ class: "q-field__before q-field__marginal row no-wrap items-center",
427
+ onClick: ge
428
+ }, n.before()) : null,
429
+ g("div", {
430
+ class: "q-field__inner relative-position col self-stretch"
431
+ }, [
432
+ g("div", {
433
+ ref: e.controlRef,
434
+ class: q.value,
435
+ tabindex: -1,
436
+ ...e.controlEvents
437
+ }, se()),
438
+ T.value === !0 ? Z() : null
439
+ ]),
440
+ n.after !== void 0 ? g("div", {
441
+ class: "q-field__after q-field__marginal row no-wrap items-center",
442
+ onClick: ge
443
+ }, n.after()) : null
444
+ ]);
445
+ };
446
+ }
447
+ const ko = xe({
448
+ name: "QField",
449
+ inheritAttrs: !1,
450
+ props: {
451
+ ...St,
452
+ tag: {
453
+ type: String,
454
+ default: "label"
455
+ }
456
+ },
457
+ emits: al,
458
+ setup() {
459
+ return sl(
460
+ rl({ tagProp: !0 })
461
+ );
462
+ }
463
+ }), Vo = {
464
+ xs: 8,
465
+ sm: 10,
466
+ md: 14,
467
+ lg: 20,
468
+ xl: 24
469
+ }, xo = xe({
470
+ name: "QChip",
471
+ props: {
472
+ ...pt,
473
+ ...Ol,
474
+ dense: Boolean,
475
+ icon: String,
476
+ iconRight: String,
477
+ iconRemove: String,
478
+ iconSelected: String,
479
+ label: [String, Number],
480
+ color: String,
481
+ textColor: String,
482
+ modelValue: {
483
+ type: Boolean,
484
+ default: !0
485
+ },
486
+ selected: {
487
+ type: Boolean,
488
+ default: null
489
+ },
490
+ square: Boolean,
491
+ outline: Boolean,
492
+ clickable: Boolean,
493
+ removable: Boolean,
494
+ removeAriaLabel: String,
495
+ tabindex: [String, Number],
496
+ disable: Boolean,
497
+ ripple: {
498
+ type: [Boolean, Object],
499
+ default: !0
500
+ }
501
+ },
502
+ emits: ["update:modelValue", "update:selected", "remove", "click"],
503
+ setup(e, { slots: t, emit: o }) {
504
+ const { proxy: { $q: n } } = re(), d = bt(e, n), u = Ml(e, Vo), a = r(() => e.selected === !0 || e.icon !== void 0), b = r(() => e.selected === !0 ? e.iconSelected || n.iconSet.chip.selected : e.icon), S = r(() => e.iconRemove || n.iconSet.chip.remove), _ = r(
505
+ () => e.disable === !1 && (e.clickable === !0 || e.selected !== null)
506
+ ), f = r(() => {
507
+ const m = e.outline === !0 && e.color || e.textColor;
508
+ return "q-chip row inline no-wrap items-center" + (e.outline === !1 && e.color !== void 0 ? ` bg-${e.color}` : "") + (m ? ` text-${m} 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" : "") + (_.value === !0 ? " q-chip--clickable cursor-pointer non-selectable q-hoverable" : "") + (e.square === !0 ? " q-chip--square" : "") + (d.value === !0 ? " q-chip--dark q-dark" : "");
509
+ }), w = r(() => {
510
+ const m = e.disable === !0 ? { tabindex: -1, "aria-disabled": "true" } : { tabindex: e.tabindex || 0 }, q = {
511
+ ...m,
512
+ role: "button",
513
+ "aria-hidden": "false",
514
+ "aria-label": e.removeAriaLabel || n.lang.label.remove
515
+ };
516
+ return { chip: m, remove: q };
517
+ });
518
+ function k(m) {
519
+ m.keyCode === 13 && C(m);
520
+ }
521
+ function C(m) {
522
+ e.disable || (o("update:selected", !e.selected), o("click", m));
523
+ }
524
+ function T(m) {
525
+ (m.keyCode === void 0 || m.keyCode === 13) && (ae(m), e.disable === !1 && (o("update:modelValue", !1), o("remove")));
526
+ }
527
+ function h() {
528
+ const m = [];
529
+ _.value === !0 && m.push(
530
+ g("div", { class: "q-focus-helper" })
531
+ ), a.value === !0 && m.push(
532
+ g(Oe, {
533
+ class: "q-chip__icon q-chip__icon--left",
534
+ name: b.value
535
+ })
536
+ );
537
+ const q = e.label !== void 0 ? [g("div", { class: "ellipsis" }, [e.label])] : void 0;
538
+ return m.push(
539
+ g("div", {
540
+ class: "q-chip__content col row no-wrap items-center q-anchor--skip"
541
+ }, Ll(t.default, q))
542
+ ), e.iconRight && m.push(
543
+ g(Oe, {
544
+ class: "q-chip__icon q-chip__icon--right",
545
+ name: e.iconRight
546
+ })
547
+ ), e.removable === !0 && m.push(
548
+ g(Oe, {
549
+ class: "q-chip__icon q-chip__icon--remove cursor-pointer",
550
+ name: S.value,
551
+ ...w.value.remove,
552
+ onClick: T,
553
+ onKeyup: T
554
+ })
555
+ ), m;
556
+ }
557
+ return () => {
558
+ if (e.modelValue === !1) return;
559
+ const m = {
560
+ class: f.value,
561
+ style: u.value
562
+ };
563
+ return _.value === !0 && Object.assign(
564
+ m,
565
+ w.value.chip,
566
+ { onClick: C, onKeyup: k }
567
+ ), Il(
568
+ "div",
569
+ m,
570
+ h(),
571
+ "ripple",
572
+ e.ripple !== !1 && e.disable !== !0,
573
+ () => [[Hl, e.ripple]]
574
+ );
575
+ };
576
+ }
577
+ }), _o = xe({
578
+ name: "QItem",
579
+ props: {
580
+ ...pt,
581
+ ...Pl,
582
+ tag: {
583
+ type: String,
584
+ default: "div"
585
+ },
586
+ active: {
587
+ type: Boolean,
588
+ default: null
589
+ },
590
+ clickable: Boolean,
591
+ dense: Boolean,
592
+ insetLevel: Number,
593
+ tabindex: [String, Number],
594
+ focused: Boolean,
595
+ manualFocus: Boolean
596
+ },
597
+ emits: ["click", "keyup"],
598
+ setup(e, { slots: t, emit: o }) {
599
+ const { proxy: { $q: n } } = re(), d = bt(e, n), { hasLink: u, linkAttrs: a, linkClass: b, linkTag: S, navigateOnClick: _ } = $l(), f = M(null), w = M(null), k = r(
600
+ () => e.clickable === !0 || u.value === !0 || e.tag === "label"
601
+ ), C = r(
602
+ () => e.disable !== !0 && k.value === !0
603
+ ), T = r(
604
+ () => "q-item q-item-type row no-wrap" + (e.dense === !0 ? " q-item--dense" : "") + (d.value === !0 ? " q-item--dark" : "") + (u.value === !0 && e.active === null ? b.value : e.active === !0 ? ` q-item--active${e.activeClass !== void 0 ? ` ${e.activeClass}` : ""}` : "") + (e.disable === !0 ? " disabled" : "") + (C.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" : "") : "")
605
+ ), h = r(() => e.insetLevel === void 0 ? null : {
606
+ ["padding" + (n.lang.rtl === !0 ? "Right" : "Left")]: 16 + e.insetLevel * 56 + "px"
607
+ });
608
+ function m(B) {
609
+ C.value === !0 && (w.value !== null && B.qAvoidFocus !== !0 && (B.qKeyEvent !== !0 && document.activeElement === f.value ? w.value.focus() : document.activeElement === w.value && f.value.focus()), _(B));
610
+ }
611
+ function q(B) {
612
+ if (C.value === !0 && nl(B, [13, 32]) === !0) {
613
+ ae(B), B.qKeyEvent = !0;
614
+ const I = new MouseEvent("click", B);
615
+ I.qKeyEvent = !0, f.value.dispatchEvent(I);
616
+ }
617
+ o("keyup", B);
618
+ }
619
+ function D() {
620
+ const B = Dl(t.default, []);
621
+ return C.value === !0 && B.unshift(
622
+ g("div", { class: "q-focus-helper", tabindex: -1, ref: w })
623
+ ), B;
624
+ }
625
+ return () => {
626
+ const B = {
627
+ ref: f,
628
+ class: T.value,
629
+ style: h.value,
630
+ role: "listitem",
631
+ onClick: m,
632
+ onKeyup: q
633
+ };
634
+ return C.value === !0 ? (B.tabindex = e.tabindex || "0", Object.assign(B, a.value)) : k.value === !0 && (B["aria-disabled"] = "true"), g(
635
+ S.value,
636
+ B,
637
+ D()
638
+ );
639
+ };
640
+ }
641
+ }), Ao = xe({
642
+ name: "QItemSection",
643
+ props: {
644
+ avatar: Boolean,
645
+ thumbnail: Boolean,
646
+ side: Boolean,
647
+ top: Boolean,
648
+ noWrap: Boolean
649
+ },
650
+ setup(e, { slots: t }) {
651
+ const o = r(
652
+ () => `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" : "")
653
+ );
654
+ return () => g("div", { class: o.value }, qe(t.default));
655
+ }
656
+ }), Bo = xe({
657
+ name: "QItemLabel",
658
+ props: {
659
+ overline: Boolean,
660
+ caption: Boolean,
661
+ header: Boolean,
662
+ lines: [Number, String]
663
+ },
664
+ setup(e, { slots: t }) {
665
+ const o = r(() => parseInt(e.lines, 10)), n = r(
666
+ () => "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" : "") + (o.value === 1 ? " ellipsis" : "")
667
+ ), d = r(() => e.lines !== void 0 && o.value > 1 ? {
668
+ overflow: "hidden",
669
+ display: "-webkit-box",
670
+ "-webkit-box-orient": "vertical",
671
+ "-webkit-line-clamp": o.value
672
+ } : null);
673
+ return () => g("div", {
674
+ style: d.value,
675
+ class: n.value
676
+ }, qe(t.default));
677
+ }
678
+ });
679
+ function zo(e, t, o) {
680
+ function n() {
681
+ }
682
+ return Ve(() => {
683
+ e.value === !0 && void 0;
684
+ }), {
685
+ removeFromHistory: n,
686
+ addToHistory() {
687
+ }
688
+ };
689
+ }
690
+ let Pe = 0, ct, dt, De, ft = !1, Kt, Nt, Ut, Ce = null;
691
+ function Eo(e) {
692
+ Ro(e) && ae(e);
693
+ }
694
+ function Ro(e) {
695
+ if (e.target === document.body || e.target.classList.contains("q-layout__backdrop"))
696
+ return !0;
697
+ const t = jl(e), o = e.shiftKey && !e.deltaX, n = !o && Math.abs(e.deltaX) <= Math.abs(e.deltaY), d = o || n ? e.deltaY : e.deltaX;
698
+ for (let u = 0; u < t.length; u++) {
699
+ const a = t[u];
700
+ if (oo(a, n))
701
+ return n ? d < 0 && a.scrollTop === 0 ? !0 : d > 0 && a.scrollTop + a.clientHeight === a.scrollHeight : d < 0 && a.scrollLeft === 0 ? !0 : d > 0 && a.scrollLeft + a.clientWidth === a.scrollWidth;
702
+ }
703
+ return !0;
704
+ }
705
+ function Qt(e) {
706
+ e.target === document && (document.scrollingElement.scrollTop = document.scrollingElement.scrollTop);
707
+ }
708
+ function tt(e) {
709
+ ft !== !0 && (ft = !0, requestAnimationFrame(() => {
710
+ ft = !1;
711
+ const { height: t } = e.target, { clientHeight: o, scrollTop: n } = document.scrollingElement;
712
+ (De === void 0 || t !== window.innerHeight) && (De = o - t, document.scrollingElement.scrollTop = n), n > De && (document.scrollingElement.scrollTop -= Math.ceil((n - De) / 8));
713
+ }));
714
+ }
715
+ function Wt(e) {
716
+ const t = document.body, o = window.visualViewport !== void 0;
717
+ if (e === "add") {
718
+ const { overflowY: n, overflowX: d } = window.getComputedStyle(t);
719
+ ct = to(window), dt = lo(window), Kt = t.style.left, Nt = t.style.top, Ut = window.location.href, t.style.left = `-${ct}px`, t.style.top = `-${dt}px`, d !== "hidden" && (d === "scroll" || t.scrollWidth > window.innerWidth) && t.classList.add("q-body--force-scrollbar-x"), n !== "hidden" && (n === "scroll" || t.scrollHeight > window.innerHeight) && t.classList.add("q-body--force-scrollbar-y"), t.classList.add("q-body--prevent-scroll"), document.qScrollPrevented = !0, ke.is.ios === !0 && (o === !0 ? (window.scrollTo(0, 0), window.visualViewport.addEventListener("resize", tt, we.passiveCapture), window.visualViewport.addEventListener("scroll", tt, we.passiveCapture), window.scrollTo(0, 0)) : window.addEventListener("scroll", Qt, we.passiveCapture));
720
+ }
721
+ ke.is.desktop === !0 && ke.is.mac === !0 && window[`${e}EventListener`]("wheel", Eo, we.notPassive), e === "remove" && (ke.is.ios === !0 && (o === !0 ? (window.visualViewport.removeEventListener("resize", tt, we.passiveCapture), window.visualViewport.removeEventListener("scroll", tt, we.passiveCapture)) : window.removeEventListener("scroll", Qt, we.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 = Kt, t.style.top = Nt, window.location.href === Ut && window.scrollTo(ct, dt), De = void 0);
722
+ }
723
+ function Fo(e) {
724
+ let t = "add";
725
+ if (e === !0) {
726
+ if (Pe++, Ce !== null) {
727
+ clearTimeout(Ce), Ce = null;
728
+ return;
729
+ }
730
+ if (Pe > 1) return;
731
+ } else {
732
+ if (Pe === 0 || (Pe--, Pe > 0)) return;
733
+ if (t = "remove", ke.is.ios === !0 && ke.is.nativeMobile === !0) {
734
+ Ce !== null && clearTimeout(Ce), Ce = setTimeout(() => {
735
+ Wt(t), Ce = null;
736
+ }, 100);
737
+ return;
738
+ }
739
+ }
740
+ Wt(t);
741
+ }
742
+ function To() {
743
+ let e;
744
+ return {
745
+ preventBodyScroll(t) {
746
+ t !== e && (e !== void 0 || t === !0) && (e = t, Fo(t));
747
+ }
748
+ };
749
+ }
750
+ let lt = 0;
751
+ const Oo = {
752
+ standard: "fixed-full flex-center",
753
+ top: "fixed-top justify-center",
754
+ bottom: "fixed-bottom justify-center",
755
+ right: "fixed-right items-center",
756
+ left: "fixed-left items-center"
757
+ }, Xt = {
758
+ standard: ["scale", "scale"],
759
+ top: ["slide-down", "slide-up"],
760
+ bottom: ["slide-up", "slide-down"],
761
+ right: ["slide-left", "slide-right"],
762
+ left: ["slide-right", "slide-left"]
763
+ }, Mo = xe({
764
+ name: "QDialog",
765
+ inheritAttrs: !1,
766
+ props: {
767
+ ...io,
768
+ ...uo,
769
+ transitionShow: String,
770
+ // override useTransitionProps
771
+ transitionHide: String,
772
+ // override useTransitionProps
773
+ persistent: Boolean,
774
+ autoClose: Boolean,
775
+ allowFocusOutside: Boolean,
776
+ noEscDismiss: Boolean,
777
+ noBackdropDismiss: Boolean,
778
+ noRouteDismiss: Boolean,
779
+ noRefocus: Boolean,
780
+ noFocus: Boolean,
781
+ noShake: Boolean,
782
+ seamless: Boolean,
783
+ maximized: Boolean,
784
+ fullWidth: Boolean,
785
+ fullHeight: Boolean,
786
+ square: Boolean,
787
+ backdropFilter: String,
788
+ position: {
789
+ type: String,
790
+ default: "standard",
791
+ validator: (e) => ["standard", "top", "bottom", "left", "right"].includes(e)
792
+ }
793
+ },
794
+ emits: [
795
+ ...no,
796
+ "shake",
797
+ "click",
798
+ "escapeKey"
799
+ ],
800
+ setup(e, { slots: t, emit: o, attrs: n }) {
801
+ const d = re(), u = M(null), a = M(!1), b = M(!1);
802
+ let S = null, _ = null, f, w;
803
+ const k = r(
804
+ () => e.persistent !== !0 && e.noRouteDismiss !== !0 && e.seamless !== !0
805
+ ), { preventBodyScroll: C } = To(), { registerTimeout: T } = ao(), { registerTick: h, removeTick: m } = ro(), { transitionProps: q, transitionStyle: D } = so(
806
+ e,
807
+ () => Xt[e.position][0],
808
+ () => Xt[e.position][1]
809
+ ), B = r(() => D.value + (e.backdropFilter !== void 0 ? `;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}` : "")), { showPortal: I, hidePortal: Y, portalIsAccessible: O, renderPortal: P } = co(
810
+ d,
811
+ u,
812
+ z,
813
+ "dialog"
814
+ ), { hide: $ } = fo({
815
+ showing: a,
816
+ hideOnRouteChange: k,
817
+ handleShow: se,
818
+ handleHide: ve,
819
+ processOnMount: !0
820
+ });
821
+ zo(a);
822
+ const oe = r(
823
+ () => `q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized === !0 ? "maximized" : "minimized"} q-dialog__inner--${e.position} ${Oo[e.position]}` + (b.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" : "")
824
+ ), X = r(() => a.value === !0 && e.seamless !== !0), ne = r(() => e.autoClose === !0 ? { onClick: W } : {}), Q = r(() => [
825
+ `q-dialog fullscreen no-pointer-events q-dialog--${X.value === !0 ? "modal" : "seamless"}`,
826
+ n.class
827
+ ]);
828
+ J(() => e.maximized, (y) => {
829
+ a.value === !0 && V(y);
830
+ }), J(X, (y) => {
831
+ C(y), y === !0 ? (ho(c), vo(ue)) : (Lt(c), It(ue));
832
+ });
833
+ function se(y) {
834
+ var E;
835
+ _ = e.noRefocus === !1 && document.activeElement !== null ? document.activeElement : null, V(e.maximized), I(), b.value = !0, e.noFocus !== !0 ? ((E = document.activeElement) == null || E.blur(), h(Z)) : m(), T(() => {
836
+ if (d.proxy.$q.platform.is.ios === !0) {
837
+ if (e.seamless !== !0 && document.activeElement) {
838
+ const { top: R, bottom: A } = document.activeElement.getBoundingClientRect(), { innerHeight: j } = window, x = window.visualViewport !== void 0 ? window.visualViewport.height : j;
839
+ R > 0 && A > x / 2 && (document.scrollingElement.scrollTop = Math.min(
840
+ document.scrollingElement.scrollHeight - x,
841
+ A >= j ? 1 / 0 : Math.ceil(document.scrollingElement.scrollTop + A - x / 2)
842
+ )), document.activeElement.scrollIntoView();
843
+ }
844
+ w = !0, u.value.click(), w = !1;
845
+ }
846
+ I(!0), b.value = !1, o("show", y);
847
+ }, e.transitionDuration);
848
+ }
849
+ function ve(y) {
850
+ m(), p(!0), b.value = !0, Y(), _ !== null && ((((y == null ? void 0 : y.type.indexOf("key")) === 0 ? _.closest('[tabindex]:not([tabindex^="-"])') : void 0) || _).focus(), _ = null), T(() => {
851
+ Y(!0), b.value = !1, o("hide", y);
852
+ }, e.transitionDuration);
853
+ }
854
+ function Z(y) {
855
+ ul(() => {
856
+ let E = u.value;
857
+ if (E !== null) {
858
+ if (y !== void 0) {
859
+ const R = E.querySelector(y);
860
+ if (R !== null) {
861
+ R.focus({ preventScroll: !0 });
862
+ return;
863
+ }
864
+ }
865
+ E.contains(document.activeElement) !== !0 && (E = E.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]") || E.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]") || E.querySelector("[autofocus], [data-autofocus]") || E, E.focus({ preventScroll: !0 }));
866
+ }
867
+ });
868
+ }
869
+ function U(y) {
870
+ y && typeof y.focus == "function" ? y.focus({ preventScroll: !0 }) : Z(), o("shake");
871
+ const E = u.value;
872
+ E !== null && (E.classList.remove("q-animate--scale"), E.classList.add("q-animate--scale"), S !== null && clearTimeout(S), S = setTimeout(() => {
873
+ S = null, u.value !== null && (E.classList.remove("q-animate--scale"), Z());
874
+ }, 170));
875
+ }
876
+ function ue() {
877
+ e.seamless !== !0 && (e.persistent === !0 || e.noEscDismiss === !0 ? e.maximized !== !0 && e.noShake !== !0 && U() : (o("escapeKey"), $()));
878
+ }
879
+ function p(y) {
880
+ S !== null && (clearTimeout(S), S = null), (y === !0 || a.value === !0) && (V(!1), e.seamless !== !0 && (C(!1), Lt(c), It(ue))), y !== !0 && (_ = null);
881
+ }
882
+ function V(y) {
883
+ y === !0 ? f !== !0 && (lt < 1 && document.body.classList.add("q-body--dialog"), lt++, f = !0) : f === !0 && (lt < 2 && document.body.classList.remove("q-body--dialog"), lt--, f = !1);
884
+ }
885
+ function W(y) {
886
+ w !== !0 && ($(y), o("click", y));
887
+ }
888
+ function i(y) {
889
+ e.persistent !== !0 && e.noBackdropDismiss !== !0 ? $(y) : e.noShake !== !0 && U();
890
+ }
891
+ function c(y) {
892
+ e.allowFocusOutside !== !0 && O.value === !0 && Kl(u.value, y.target) !== !0 && Z('[tabindex]:not([tabindex="-1"])');
893
+ }
894
+ Object.assign(d.proxy, {
895
+ // expose public methods
896
+ focus: Z,
897
+ shake: U,
898
+ // private but needed by QSelect
899
+ __updateRefocusTarget(y) {
900
+ _ = y || null;
901
+ }
902
+ }), Ve(p);
903
+ function z() {
904
+ return g("div", {
905
+ role: "dialog",
906
+ "aria-modal": X.value === !0 ? "true" : "false",
907
+ ...n,
908
+ class: Q.value
909
+ }, [
910
+ g(gt, {
911
+ name: "q-transition--fade",
912
+ appear: !0
913
+ }, () => X.value === !0 ? g("div", {
914
+ class: "q-dialog__backdrop fixed-full",
915
+ style: B.value,
916
+ "aria-hidden": "true",
917
+ tabindex: -1,
918
+ onClick: i
919
+ }) : null),
920
+ g(
921
+ gt,
922
+ q.value,
923
+ () => a.value === !0 ? g("div", {
924
+ ref: u,
925
+ class: oe.value,
926
+ style: D.value,
927
+ tabindex: -1,
928
+ ...ne.value
929
+ }, qe(t.default)) : null
930
+ )
931
+ ]);
932
+ }
933
+ return P;
934
+ }
935
+ });
936
+ let ot = !1;
937
+ {
938
+ const e = document.createElement("div");
939
+ e.setAttribute("dir", "rtl"), Object.assign(e.style, {
940
+ width: "1px",
941
+ height: "1px",
942
+ overflow: "auto"
943
+ });
944
+ const t = document.createElement("div");
945
+ Object.assign(t.style, {
946
+ width: "1000px",
947
+ height: "1px"
948
+ }), document.body.appendChild(e), e.appendChild(t), e.scrollLeft = -1e3, ot = e.scrollLeft >= 0, e.remove();
949
+ }
950
+ const le = 1e3, Io = [
951
+ "start",
952
+ "center",
953
+ "end",
954
+ "start-force",
955
+ "center-force",
956
+ "end-force"
957
+ ], cl = Array.prototype.filter, Lo = window.getComputedStyle(document.body).overflowAnchor === void 0 ? Nl : function(e, t) {
958
+ e !== null && (e._qOverflowAnimationFrame !== void 0 && cancelAnimationFrame(e._qOverflowAnimationFrame), e._qOverflowAnimationFrame = requestAnimationFrame(() => {
959
+ if (e === null) return;
960
+ e._qOverflowAnimationFrame = void 0;
961
+ const o = e.children || [];
962
+ cl.call(o, (d) => d.dataset && d.dataset.qVsAnchor !== void 0).forEach((d) => {
963
+ delete d.dataset.qVsAnchor;
964
+ });
965
+ const n = o[t];
966
+ n != null && n.dataset && (n.dataset.qVsAnchor = "");
967
+ }));
968
+ };
969
+ function Me(e, t) {
970
+ return e + t;
971
+ }
972
+ function vt(e, t, o, n, d, u, a, b) {
973
+ const S = e === window ? document.scrollingElement || document.documentElement : e, _ = d === !0 ? "offsetWidth" : "offsetHeight", f = {
974
+ scrollStart: 0,
975
+ scrollViewSize: -a - b,
976
+ scrollMaxSize: 0,
977
+ offsetStart: -a,
978
+ offsetEnd: -b
979
+ };
980
+ if (d === !0 ? (e === window ? (f.scrollStart = window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, f.scrollViewSize += document.documentElement.clientWidth) : (f.scrollStart = S.scrollLeft, f.scrollViewSize += S.clientWidth), f.scrollMaxSize = S.scrollWidth, u === !0 && (f.scrollStart = (ot === !0 ? f.scrollMaxSize - f.scrollViewSize : 0) - f.scrollStart)) : (e === window ? (f.scrollStart = window.pageYOffset || window.scrollY || document.body.scrollTop || 0, f.scrollViewSize += document.documentElement.clientHeight) : (f.scrollStart = S.scrollTop, f.scrollViewSize += S.clientHeight), f.scrollMaxSize = S.scrollHeight), o !== null)
981
+ for (let w = o.previousElementSibling; w !== null; w = w.previousElementSibling)
982
+ w.classList.contains("q-virtual-scroll--skip") === !1 && (f.offsetStart += w[_]);
983
+ if (n !== null)
984
+ for (let w = n.nextElementSibling; w !== null; w = w.nextElementSibling)
985
+ w.classList.contains("q-virtual-scroll--skip") === !1 && (f.offsetEnd += w[_]);
986
+ if (t !== e) {
987
+ const w = S.getBoundingClientRect(), k = t.getBoundingClientRect();
988
+ d === !0 ? (f.offsetStart += k.left - w.left, f.offsetEnd -= k.width) : (f.offsetStart += k.top - w.top, f.offsetEnd -= k.height), e !== window && (f.offsetStart += f.scrollStart), f.offsetEnd += f.scrollMaxSize - f.offsetStart;
989
+ }
990
+ return f;
991
+ }
992
+ function Yt(e, t, o, n) {
993
+ t === "end" && (t = (e === window ? document.body : e)[o === !0 ? "scrollWidth" : "scrollHeight"]), e === window ? o === !0 ? (n === !0 && (t = (ot === !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) : o === !0 ? (n === !0 && (t = (ot === !0 ? e.scrollWidth - e.offsetWidth : 0) - t), e.scrollLeft = t) : e.scrollTop = t;
994
+ }
995
+ function $e(e, t, o, n) {
996
+ if (o >= n)
997
+ return 0;
998
+ const d = t.length, u = Math.floor(o / le), a = Math.floor((n - 1) / le) + 1;
999
+ let b = e.slice(u, a).reduce(Me, 0);
1000
+ return o % le !== 0 && (b -= t.slice(u * le, o).reduce(Me, 0)), n % le !== 0 && n !== d && (b -= t.slice(n, a * le).reduce(Me, 0)), b;
1001
+ }
1002
+ const Ho = {
1003
+ virtualScrollSliceSize: {
1004
+ type: [Number, String],
1005
+ default: 10
1006
+ },
1007
+ virtualScrollSliceRatioBefore: {
1008
+ type: [Number, String],
1009
+ default: 1
1010
+ },
1011
+ virtualScrollSliceRatioAfter: {
1012
+ type: [Number, String],
1013
+ default: 1
1014
+ },
1015
+ virtualScrollItemSize: {
1016
+ type: [Number, String],
1017
+ default: 24
1018
+ },
1019
+ virtualScrollStickySizeStart: {
1020
+ type: [Number, String],
1021
+ default: 0
1022
+ },
1023
+ virtualScrollStickySizeEnd: {
1024
+ type: [Number, String],
1025
+ default: 0
1026
+ },
1027
+ tableColspan: [Number, String]
1028
+ }, Zt = {
1029
+ virtualScrollHorizontal: Boolean,
1030
+ onVirtualScroll: Function,
1031
+ ...Ho
1032
+ };
1033
+ function Po({
1034
+ virtualScrollLength: e,
1035
+ getVirtualScrollTarget: t,
1036
+ getVirtualScrollEl: o,
1037
+ virtualScrollItemSizeComputed: n
1038
+ // optional
1039
+ }) {
1040
+ const d = re(), { props: u, emit: a, proxy: b } = d, { $q: S } = b;
1041
+ let _, f, w, k = [], C;
1042
+ const T = M(0), h = M(0), m = M({}), q = M(null), D = M(null), B = M(null), I = M({ from: 0, to: 0 }), Y = r(() => u.tableColspan !== void 0 ? u.tableColspan : 100);
1043
+ n === void 0 && (n = r(() => u.virtualScrollItemSize));
1044
+ const O = r(() => n.value + ";" + u.virtualScrollHorizontal), P = r(
1045
+ () => O.value + ";" + u.virtualScrollSliceRatioBefore + ";" + u.virtualScrollSliceRatioAfter
1046
+ );
1047
+ J(P, () => {
1048
+ U();
1049
+ }), J(O, $);
1050
+ function $() {
1051
+ Z(f, !0);
1052
+ }
1053
+ function oe(i) {
1054
+ Z(i === void 0 ? f : i);
1055
+ }
1056
+ function X(i, c) {
1057
+ const z = t();
1058
+ if (z == null || z.nodeType === 8) return;
1059
+ const y = vt(
1060
+ z,
1061
+ o(),
1062
+ q.value,
1063
+ D.value,
1064
+ u.virtualScrollHorizontal,
1065
+ S.lang.rtl,
1066
+ u.virtualScrollStickySizeStart,
1067
+ u.virtualScrollStickySizeEnd
1068
+ );
1069
+ w !== y.scrollViewSize && U(y.scrollViewSize), Q(
1070
+ z,
1071
+ y,
1072
+ Math.min(e.value - 1, Math.max(0, parseInt(i, 10) || 0)),
1073
+ 0,
1074
+ Io.indexOf(c) !== -1 ? c : f !== -1 && i > f ? "end" : "start"
1075
+ );
1076
+ }
1077
+ function ne() {
1078
+ const i = t();
1079
+ if (i == null || i.nodeType === 8) return;
1080
+ const c = vt(
1081
+ i,
1082
+ o(),
1083
+ q.value,
1084
+ D.value,
1085
+ u.virtualScrollHorizontal,
1086
+ S.lang.rtl,
1087
+ u.virtualScrollStickySizeStart,
1088
+ u.virtualScrollStickySizeEnd
1089
+ ), z = e.value - 1, y = c.scrollMaxSize - c.offsetStart - c.offsetEnd - h.value;
1090
+ if (_ === c.scrollStart) return;
1091
+ if (c.scrollMaxSize <= 0) {
1092
+ Q(i, c, 0, 0);
1093
+ return;
1094
+ }
1095
+ w !== c.scrollViewSize && U(c.scrollViewSize), se(I.value.from);
1096
+ const E = Math.floor(c.scrollMaxSize - Math.max(c.scrollViewSize, c.offsetEnd) - Math.min(C[z], c.scrollViewSize / 2));
1097
+ if (E > 0 && Math.ceil(c.scrollStart) >= E) {
1098
+ Q(
1099
+ i,
1100
+ c,
1101
+ z,
1102
+ c.scrollMaxSize - c.offsetEnd - k.reduce(Me, 0)
1103
+ );
1104
+ return;
1105
+ }
1106
+ let R = 0, A = c.scrollStart - c.offsetStart, j = A;
1107
+ if (A <= y && A + c.scrollViewSize >= T.value)
1108
+ A -= T.value, R = I.value.from, j = A;
1109
+ else
1110
+ for (let x = 0; A >= k[x] && R < z; x++)
1111
+ A -= k[x], R += le;
1112
+ for (; A > 0 && R < z; )
1113
+ A -= C[R], A > -c.scrollViewSize ? (R++, j = A) : j = C[R] + A;
1114
+ Q(
1115
+ i,
1116
+ c,
1117
+ R,
1118
+ j
1119
+ );
1120
+ }
1121
+ function Q(i, c, z, y, E) {
1122
+ const R = typeof E == "string" && E.indexOf("-force") !== -1, A = R === !0 ? E.replace("-force", "") : E, j = A !== void 0 ? A : "start";
1123
+ let x = Math.max(0, z - m.value[j]), G = x + m.value.total;
1124
+ G > e.value && (G = e.value, x = Math.max(0, G - m.value.total)), _ = c.scrollStart;
1125
+ const me = x !== I.value.from || G !== I.value.to;
1126
+ if (me === !1 && A === void 0) {
1127
+ p(z);
1128
+ return;
1129
+ }
1130
+ const { activeElement: je } = document, te = B.value;
1131
+ me === !0 && te !== null && te !== je && te.contains(je) === !0 && (te.addEventListener("focusout", ve), setTimeout(() => {
1132
+ te == null || te.removeEventListener("focusout", ve);
1133
+ })), Lo(te, z - x);
1134
+ const Ke = A !== void 0 ? C.slice(x, z).reduce(Me, 0) : 0;
1135
+ if (me === !0) {
1136
+ const pe = G >= I.value.from && x <= I.value.to ? I.value.to : G;
1137
+ I.value = { from: x, to: pe }, T.value = $e(k, C, 0, x), h.value = $e(k, C, G, e.value), requestAnimationFrame(() => {
1138
+ I.value.to !== G && _ === c.scrollStart && (I.value = { from: I.value.from, to: G }, h.value = $e(k, C, G, e.value));
1139
+ });
1140
+ }
1141
+ requestAnimationFrame(() => {
1142
+ if (_ !== c.scrollStart) return;
1143
+ me === !0 && se(x);
1144
+ const pe = C.slice(x, z).reduce(Me, 0), be = pe + c.offsetStart + T.value, Ne = be + C[z];
1145
+ let Ie = be + y;
1146
+ if (A !== void 0) {
1147
+ const nt = pe - Ke, Le = c.scrollStart + nt;
1148
+ Ie = R !== !0 && Le < be && Ne < Le + c.scrollViewSize ? Le : A === "end" ? Ne - c.scrollViewSize : be - (A === "start" ? 0 : Math.round((c.scrollViewSize - C[z]) / 2));
1149
+ }
1150
+ _ = Ie, Yt(
1151
+ i,
1152
+ Ie,
1153
+ u.virtualScrollHorizontal,
1154
+ S.lang.rtl
1155
+ ), p(z);
1156
+ });
1157
+ }
1158
+ function se(i) {
1159
+ const c = B.value;
1160
+ if (c) {
1161
+ const z = cl.call(
1162
+ c.children,
1163
+ (x) => x.classList && x.classList.contains("q-virtual-scroll--skip") === !1
1164
+ ), y = z.length, E = u.virtualScrollHorizontal === !0 ? (x) => x.getBoundingClientRect().width : (x) => x.offsetHeight;
1165
+ let R = i, A, j;
1166
+ for (let x = 0; x < y; ) {
1167
+ for (A = E(z[x]), x++; x < y && z[x].classList.contains("q-virtual-scroll--with-prev") === !0; )
1168
+ A += E(z[x]), x++;
1169
+ j = A - C[R], j !== 0 && (C[R] += j, k[Math.floor(R / le)] += j), R++;
1170
+ }
1171
+ }
1172
+ }
1173
+ function ve() {
1174
+ var i;
1175
+ (i = B.value) == null || i.focus();
1176
+ }
1177
+ function Z(i, c) {
1178
+ const z = 1 * n.value;
1179
+ (c === !0 || Array.isArray(C) === !1) && (C = []);
1180
+ const y = C.length;
1181
+ C.length = e.value;
1182
+ for (let R = e.value - 1; R >= y; R--)
1183
+ C[R] = z;
1184
+ const E = Math.floor((e.value - 1) / le);
1185
+ k = [];
1186
+ for (let R = 0; R <= E; R++) {
1187
+ let A = 0;
1188
+ const j = Math.min((R + 1) * le, e.value);
1189
+ for (let x = R * le; x < j; x++)
1190
+ A += C[x];
1191
+ k.push(A);
1192
+ }
1193
+ f = -1, _ = void 0, T.value = $e(k, C, 0, I.value.from), h.value = $e(k, C, I.value.to, e.value), i >= 0 ? (se(I.value.from), fe(() => {
1194
+ X(i);
1195
+ })) : V();
1196
+ }
1197
+ function U(i) {
1198
+ if (i === void 0 && typeof window < "u") {
1199
+ const A = t();
1200
+ A != null && A.nodeType !== 8 && (i = vt(
1201
+ A,
1202
+ o(),
1203
+ q.value,
1204
+ D.value,
1205
+ u.virtualScrollHorizontal,
1206
+ S.lang.rtl,
1207
+ u.virtualScrollStickySizeStart,
1208
+ u.virtualScrollStickySizeEnd
1209
+ ).scrollViewSize);
1210
+ }
1211
+ w = i;
1212
+ const c = parseFloat(u.virtualScrollSliceRatioBefore) || 0, z = parseFloat(u.virtualScrollSliceRatioAfter) || 0, y = 1 + c + z, E = i === void 0 || i <= 0 ? 1 : Math.ceil(i / n.value), R = Math.max(
1213
+ 1,
1214
+ E,
1215
+ Math.ceil((u.virtualScrollSliceSize > 0 ? u.virtualScrollSliceSize : 10) / y)
1216
+ );
1217
+ m.value = {
1218
+ total: Math.ceil(R * y),
1219
+ start: Math.ceil(R * c),
1220
+ center: Math.ceil(R * (0.5 + c)),
1221
+ end: Math.ceil(R * (1 + c)),
1222
+ view: E
1223
+ };
1224
+ }
1225
+ function ue(i, c) {
1226
+ const z = u.virtualScrollHorizontal === !0 ? "width" : "height", y = {
1227
+ ["--q-virtual-scroll-item-" + z]: n.value + "px"
1228
+ };
1229
+ return [
1230
+ i === "tbody" ? g(i, {
1231
+ class: "q-virtual-scroll__padding",
1232
+ key: "before",
1233
+ ref: q
1234
+ }, [
1235
+ g("tr", [
1236
+ g("td", {
1237
+ style: { [z]: `${T.value}px`, ...y },
1238
+ colspan: Y.value
1239
+ })
1240
+ ])
1241
+ ]) : g(i, {
1242
+ class: "q-virtual-scroll__padding",
1243
+ key: "before",
1244
+ ref: q,
1245
+ style: { [z]: `${T.value}px`, ...y }
1246
+ }),
1247
+ g(i, {
1248
+ class: "q-virtual-scroll__content",
1249
+ key: "content",
1250
+ ref: B,
1251
+ tabindex: -1
1252
+ }, c.flat()),
1253
+ i === "tbody" ? g(i, {
1254
+ class: "q-virtual-scroll__padding",
1255
+ key: "after",
1256
+ ref: D
1257
+ }, [
1258
+ g("tr", [
1259
+ g("td", {
1260
+ style: { [z]: `${h.value}px`, ...y },
1261
+ colspan: Y.value
1262
+ })
1263
+ ])
1264
+ ]) : g(i, {
1265
+ class: "q-virtual-scroll__padding",
1266
+ key: "after",
1267
+ ref: D,
1268
+ style: { [z]: `${h.value}px`, ...y }
1269
+ })
1270
+ ];
1271
+ }
1272
+ function p(i) {
1273
+ f !== i && (u.onVirtualScroll !== void 0 && a("virtualScroll", {
1274
+ index: i,
1275
+ from: I.value.from,
1276
+ to: I.value.to - 1,
1277
+ direction: i < f ? "decrease" : "increase",
1278
+ ref: b
1279
+ }), f = i);
1280
+ }
1281
+ U();
1282
+ const V = il(
1283
+ ne,
1284
+ S.platform.is.ios === !0 ? 120 : 35
1285
+ );
1286
+ Al(() => {
1287
+ U();
1288
+ });
1289
+ let W = !1;
1290
+ return ll(() => {
1291
+ W = !0;
1292
+ }), ol(() => {
1293
+ if (W !== !0) return;
1294
+ const i = t();
1295
+ _ !== void 0 && i !== void 0 && i !== null && i.nodeType !== 8 ? Yt(
1296
+ i,
1297
+ _,
1298
+ u.virtualScrollHorizontal,
1299
+ S.lang.rtl
1300
+ ) : X(f);
1301
+ }), Ve(() => {
1302
+ V.cancel();
1303
+ }), Object.assign(b, { scrollTo: X, reset: $, refresh: oe }), {
1304
+ virtualScrollSliceRange: I,
1305
+ virtualScrollSliceSizeComputed: m,
1306
+ setVirtualScrollSize: U,
1307
+ onVirtualScrollEvt: V,
1308
+ localResetVirtualScroll: Z,
1309
+ padVirtualScroll: ue,
1310
+ scrollTo: X,
1311
+ reset: $,
1312
+ refresh: oe
1313
+ };
1314
+ }
1315
+ const $o = /[\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]/, Do = /[\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, jo = /[\u3131-\u314e\u314f-\u3163\uac00-\ud7a3]/, Ko = /[a-z0-9_ -]$/i;
1316
+ function No(e) {
1317
+ return function(o) {
1318
+ if (o.type === "compositionend" || o.type === "change") {
1319
+ if (o.target.qComposing !== !0) return;
1320
+ o.target.qComposing = !1, e(o);
1321
+ } else o.type === "compositionupdate" && o.target.qComposing !== !0 && typeof o.data == "string" && (ke.is.firefox === !0 ? Ko.test(o.data) === !1 : $o.test(o.data) === !0 || Do.test(o.data) === !0 || jo.test(o.data) === !0) === !0 && (o.target.qComposing = !0);
1322
+ };
1323
+ }
1324
+ function he(e, t) {
1325
+ if (e === t)
1326
+ return !0;
1327
+ if (e !== null && t !== null && typeof e == "object" && typeof t == "object") {
1328
+ if (e.constructor !== t.constructor)
1329
+ return !1;
1330
+ let o, n;
1331
+ if (e.constructor === Array) {
1332
+ if (o = e.length, o !== t.length)
1333
+ return !1;
1334
+ for (n = o; n-- !== 0; )
1335
+ if (he(e[n], t[n]) !== !0)
1336
+ return !1;
1337
+ return !0;
1338
+ }
1339
+ if (e.constructor === Map) {
1340
+ if (e.size !== t.size)
1341
+ return !1;
1342
+ let u = e.entries();
1343
+ for (n = u.next(); n.done !== !0; ) {
1344
+ if (t.has(n.value[0]) !== !0)
1345
+ return !1;
1346
+ n = u.next();
1347
+ }
1348
+ for (u = e.entries(), n = u.next(); n.done !== !0; ) {
1349
+ if (he(n.value[1], t.get(n.value[0])) !== !0)
1350
+ return !1;
1351
+ n = u.next();
1352
+ }
1353
+ return !0;
1354
+ }
1355
+ if (e.constructor === Set) {
1356
+ if (e.size !== t.size)
1357
+ return !1;
1358
+ const u = e.entries();
1359
+ for (n = u.next(); n.done !== !0; ) {
1360
+ if (t.has(n.value[0]) !== !0)
1361
+ return !1;
1362
+ n = u.next();
1363
+ }
1364
+ return !0;
1365
+ }
1366
+ if (e.buffer != null && e.buffer.constructor === ArrayBuffer) {
1367
+ if (o = e.length, o !== t.length)
1368
+ return !1;
1369
+ for (n = o; n-- !== 0; )
1370
+ if (e[n] !== t[n])
1371
+ return !1;
1372
+ return !0;
1373
+ }
1374
+ if (e.constructor === RegExp)
1375
+ return e.source === t.source && e.flags === t.flags;
1376
+ if (e.valueOf !== Object.prototype.valueOf)
1377
+ return e.valueOf() === t.valueOf();
1378
+ if (e.toString !== Object.prototype.toString)
1379
+ return e.toString() === t.toString();
1380
+ const d = Object.keys(e).filter((u) => e[u] !== void 0);
1381
+ if (o = d.length, o !== Object.keys(t).filter((u) => t[u] !== void 0).length)
1382
+ return !1;
1383
+ for (n = o; n-- !== 0; ) {
1384
+ const u = d[n];
1385
+ if (he(e[u], t[u]) !== !0)
1386
+ return !1;
1387
+ }
1388
+ return !0;
1389
+ }
1390
+ return e !== e && t !== t;
1391
+ }
1392
+ function Jt(e, t, o) {
1393
+ if (o <= t)
1394
+ return t;
1395
+ const n = o - t + 1;
1396
+ let d = t + (e - t) % n;
1397
+ return d < t && (d = n + d), d === 0 ? 0 : d;
1398
+ }
1399
+ const Gt = (e) => ["add", "add-unique", "toggle"].includes(e), Uo = ".*+?^${}()|[]\\", Qo = Object.keys(St);
1400
+ function mt(e, t) {
1401
+ if (typeof e == "function") return e;
1402
+ const o = e !== void 0 ? e : t;
1403
+ return (n) => n !== null && typeof n == "object" && o in n ? n[o] : n;
1404
+ }
1405
+ const Wo = xe({
1406
+ name: "QSelect",
1407
+ inheritAttrs: !1,
1408
+ props: {
1409
+ ...Zt,
1410
+ ...Ul,
1411
+ ...St,
1412
+ // override of useFieldProps > modelValue
1413
+ modelValue: {
1414
+ required: !0
1415
+ },
1416
+ multiple: Boolean,
1417
+ displayValue: [String, Number],
1418
+ displayValueHtml: Boolean,
1419
+ dropdownIcon: String,
1420
+ options: {
1421
+ type: Array,
1422
+ default: () => []
1423
+ },
1424
+ optionValue: [Function, String],
1425
+ optionLabel: [Function, String],
1426
+ optionDisable: [Function, String],
1427
+ hideSelected: Boolean,
1428
+ hideDropdownIcon: Boolean,
1429
+ fillInput: Boolean,
1430
+ maxValues: [Number, String],
1431
+ optionsDense: Boolean,
1432
+ optionsDark: {
1433
+ type: Boolean,
1434
+ default: null
1435
+ },
1436
+ optionsSelectedClass: String,
1437
+ optionsHtml: Boolean,
1438
+ optionsCover: Boolean,
1439
+ menuShrink: Boolean,
1440
+ menuAnchor: String,
1441
+ menuSelf: String,
1442
+ menuOffset: Array,
1443
+ popupContentClass: String,
1444
+ popupContentStyle: [String, Array, Object],
1445
+ popupNoRouteDismiss: Boolean,
1446
+ useInput: Boolean,
1447
+ useChips: Boolean,
1448
+ newValueMode: {
1449
+ type: String,
1450
+ validator: Gt
1451
+ },
1452
+ mapOptions: Boolean,
1453
+ emitValue: Boolean,
1454
+ disableTabSelection: Boolean,
1455
+ inputDebounce: {
1456
+ type: [Number, String],
1457
+ default: 500
1458
+ },
1459
+ inputClass: [Array, String, Object],
1460
+ inputStyle: [Array, String, Object],
1461
+ tabindex: {
1462
+ type: [String, Number],
1463
+ default: 0
1464
+ },
1465
+ autocomplete: String,
1466
+ transitionShow: {},
1467
+ transitionHide: {},
1468
+ transitionDuration: {},
1469
+ behavior: {
1470
+ type: String,
1471
+ validator: (e) => ["default", "menu", "dialog"].includes(e),
1472
+ default: "default"
1473
+ },
1474
+ // override of useVirtualScrollProps > virtualScrollItemSize (no default)
1475
+ virtualScrollItemSize: Zt.virtualScrollItemSize.type,
1476
+ onNewValue: Function,
1477
+ onFilter: Function
1478
+ },
1479
+ emits: [
1480
+ ...al,
1481
+ "add",
1482
+ "remove",
1483
+ "inputValue",
1484
+ "keyup",
1485
+ "keypress",
1486
+ "keydown",
1487
+ "popupShow",
1488
+ "popupHide",
1489
+ "filterAbort"
1490
+ ],
1491
+ setup(e, { slots: t, emit: o }) {
1492
+ const { proxy: n } = re(), { $q: d } = n, u = M(!1), a = M(!1), b = M(-1), S = M(""), _ = M(!1), f = M(!1);
1493
+ let w = null, k = null, C, T, h, m = null, q, D, B, I;
1494
+ const Y = M(null), O = M(null), P = M(null), $ = M(null), oe = M(null), X = Ql(e), ne = No(Bt), Q = r(() => Array.isArray(e.options) ? e.options.length : 0), se = r(() => e.virtualScrollItemSize === void 0 ? e.optionsDense === !0 ? 24 : 48 : e.virtualScrollItemSize), {
1495
+ virtualScrollSliceRange: ve,
1496
+ virtualScrollSliceSizeComputed: Z,
1497
+ localResetVirtualScroll: U,
1498
+ padVirtualScroll: ue,
1499
+ onVirtualScrollEvt: p,
1500
+ scrollTo: V,
1501
+ setVirtualScrollSize: W
1502
+ } = Po({
1503
+ virtualScrollLength: Q,
1504
+ getVirtualScrollTarget: ml,
1505
+ getVirtualScrollEl: _t,
1506
+ virtualScrollItemSizeComputed: se
1507
+ }), i = rl(), c = r(() => {
1508
+ const l = e.mapOptions === !0 && e.multiple !== !0, s = e.modelValue !== void 0 && (e.modelValue !== null || l === !0) ? e.multiple === !0 && Array.isArray(e.modelValue) ? e.modelValue : [e.modelValue] : [];
1509
+ if (e.mapOptions === !0 && Array.isArray(e.options) === !0) {
1510
+ const v = e.mapOptions === !0 && C !== void 0 ? C : [], F = s.map((L) => vl(L, v));
1511
+ return e.modelValue === null && l === !0 ? F.filter((L) => L !== null) : F;
1512
+ }
1513
+ return s;
1514
+ }), z = r(() => {
1515
+ const l = {};
1516
+ return Qo.forEach((s) => {
1517
+ const v = e[s];
1518
+ v !== void 0 && (l[s] = v);
1519
+ }), l;
1520
+ }), y = r(() => e.optionsDark === null ? i.isDark.value : e.optionsDark), E = r(() => ht(c.value)), R = r(() => {
1521
+ let l = "q-field__input q-placeholder col";
1522
+ return e.hideSelected === !0 || c.value.length === 0 ? [l, e.inputClass] : (l += " q-field__input--padding", e.inputClass === void 0 ? l : [l, e.inputClass]);
1523
+ }), A = r(
1524
+ () => (e.virtualScrollHorizontal === !0 ? "q-virtual-scroll--horizontal" : "") + (e.popupContentClass ? " " + e.popupContentClass : "")
1525
+ ), j = r(() => Q.value === 0), x = r(
1526
+ () => c.value.map((l) => ee.value(l)).join(", ")
1527
+ ), G = r(() => e.displayValue !== void 0 ? e.displayValue : x.value), me = r(() => e.optionsHtml === !0 ? () => !0 : (l) => (l == null ? void 0 : l.html) === !0), je = r(() => e.displayValueHtml === !0 || e.displayValue === void 0 && (e.optionsHtml === !0 || c.value.some(me.value))), te = r(() => i.focused.value === !0 ? e.tabindex : -1), Ke = r(() => {
1528
+ const l = {
1529
+ tabindex: e.tabindex,
1530
+ role: "combobox",
1531
+ "aria-label": e.label,
1532
+ "aria-readonly": e.readonly === !0 ? "true" : "false",
1533
+ "aria-autocomplete": e.useInput === !0 ? "list" : "none",
1534
+ "aria-expanded": u.value === !0 ? "true" : "false",
1535
+ "aria-controls": `${i.targetUid.value}_lb`
1536
+ };
1537
+ return b.value >= 0 && (l["aria-activedescendant"] = `${i.targetUid.value}_${b.value}`), l;
1538
+ }), pe = r(() => ({
1539
+ id: `${i.targetUid.value}_lb`,
1540
+ role: "listbox",
1541
+ "aria-multiselectable": e.multiple === !0 ? "true" : "false"
1542
+ })), be = r(() => c.value.map((l, s) => ({
1543
+ index: s,
1544
+ opt: l,
1545
+ html: me.value(l),
1546
+ selected: !0,
1547
+ removeAtIndex: fl,
1548
+ toggleOption: Se,
1549
+ tabindex: te.value
1550
+ }))), Ne = r(() => {
1551
+ if (Q.value === 0)
1552
+ return [];
1553
+ const { from: l, to: s } = ve.value;
1554
+ return e.options.slice(l, s).map((v, F) => {
1555
+ const L = _e.value(v) === !0, K = it(v) === !0, H = l + F, N = {
1556
+ clickable: !0,
1557
+ active: K,
1558
+ activeClass: Le.value,
1559
+ manualFocus: !0,
1560
+ focused: !1,
1561
+ disable: L,
1562
+ tabindex: -1,
1563
+ dense: e.optionsDense,
1564
+ dark: y.value,
1565
+ role: "option",
1566
+ "aria-selected": K === !0 ? "true" : "false",
1567
+ id: `${i.targetUid.value}_${H}`,
1568
+ onClick: () => {
1569
+ Se(v);
1570
+ }
1571
+ };
1572
+ return L !== !0 && (b.value === H && (N.focused = !0), d.platform.is.desktop === !0 && (N.onMousemove = () => {
1573
+ u.value === !0 && Ae(H);
1574
+ })), {
1575
+ index: H,
1576
+ opt: v,
1577
+ html: me.value(v),
1578
+ label: ee.value(v),
1579
+ selected: N.active,
1580
+ focused: N.focused,
1581
+ toggleOption: Se,
1582
+ setOptionIndex: Ae,
1583
+ itemProps: N
1584
+ };
1585
+ });
1586
+ }), Ie = r(() => e.dropdownIcon !== void 0 ? e.dropdownIcon : d.iconSet.arrow.dropdown), nt = r(
1587
+ () => e.optionsCover === !1 && e.outlined !== !0 && e.standout !== !0 && e.borderless !== !0 && e.rounded !== !0
1588
+ ), Le = r(() => e.optionsSelectedClass !== void 0 ? e.optionsSelectedClass : e.color !== void 0 ? `text-${e.color}` : ""), ie = r(() => mt(e.optionValue, "value")), ee = r(() => mt(e.optionLabel, "label")), _e = r(() => mt(e.optionDisable, "disable")), Ue = r(() => c.value.map(ie.value)), dl = r(() => {
1589
+ const l = {
1590
+ onInput: Bt,
1591
+ // Safari < 10.2 & UIWebView doesn't fire compositionend when
1592
+ // switching focus before confirming composition choice
1593
+ // this also fixes the issue where some browsers e.g. iOS Chrome
1594
+ // fires "change" instead of "input" on autocomplete.
1595
+ onChange: ne,
1596
+ onKeydown: xt,
1597
+ onKeyup: kt,
1598
+ onKeypress: Vt,
1599
+ onFocus: Ct,
1600
+ onClick(s) {
1601
+ T === !0 && Te(s);
1602
+ }
1603
+ };
1604
+ return l.onCompositionstart = l.onCompositionupdate = l.onCompositionend = ne, l;
1605
+ });
1606
+ J(c, (l) => {
1607
+ C = l, e.useInput === !0 && e.fillInput === !0 && e.multiple !== !0 && i.innerLoading.value !== !0 && (a.value !== !0 && u.value !== !0 || E.value !== !0) && (h !== !0 && Re(), (a.value === !0 || u.value === !0) && Be(""));
1608
+ }, { immediate: !0 }), J(() => e.fillInput, Re), J(u, at), J(Q, xl);
1609
+ function yt(l) {
1610
+ return e.emitValue === !0 ? ie.value(l) : l;
1611
+ }
1612
+ function ut(l) {
1613
+ if (l !== -1 && l < c.value.length)
1614
+ if (e.multiple === !0) {
1615
+ const s = e.modelValue.slice();
1616
+ o("remove", { index: l, value: s.splice(l, 1)[0] }), o("update:modelValue", s);
1617
+ } else
1618
+ o("update:modelValue", null);
1619
+ }
1620
+ function fl(l) {
1621
+ ut(l), i.focus();
1622
+ }
1623
+ function wt(l, s) {
1624
+ const v = yt(l);
1625
+ if (e.multiple !== !0) {
1626
+ e.fillInput === !0 && He(
1627
+ ee.value(l),
1628
+ !0,
1629
+ !0
1630
+ ), o("update:modelValue", v);
1631
+ return;
1632
+ }
1633
+ if (c.value.length === 0) {
1634
+ o("add", { index: 0, value: v }), o("update:modelValue", e.multiple === !0 ? [v] : v);
1635
+ return;
1636
+ }
1637
+ if (s === !0 && it(l) === !0 || e.maxValues !== void 0 && e.modelValue.length >= e.maxValues) return;
1638
+ const F = e.modelValue.slice();
1639
+ o("add", { index: F.length, value: v }), F.push(v), o("update:modelValue", F);
1640
+ }
1641
+ function Se(l, s) {
1642
+ var K;
1643
+ if (i.editable.value !== !0 || l === void 0 || _e.value(l) === !0) return;
1644
+ const v = ie.value(l);
1645
+ if (e.multiple !== !0) {
1646
+ s !== !0 && (He(
1647
+ e.fillInput === !0 ? ee.value(l) : "",
1648
+ !0,
1649
+ !0
1650
+ ), ye()), (K = O.value) == null || K.focus(), (c.value.length === 0 || he(ie.value(c.value[0]), v) !== !0) && o("update:modelValue", e.emitValue === !0 ? v : l);
1651
+ return;
1652
+ }
1653
+ if ((T !== !0 || _.value === !0) && i.focus(), Ct(), c.value.length === 0) {
1654
+ const H = e.emitValue === !0 ? v : l;
1655
+ o("add", { index: 0, value: H }), o("update:modelValue", e.multiple === !0 ? [H] : H);
1656
+ return;
1657
+ }
1658
+ const F = e.modelValue.slice(), L = Ue.value.findIndex((H) => he(H, v));
1659
+ if (L !== -1)
1660
+ o("remove", { index: L, value: F.splice(L, 1)[0] });
1661
+ else {
1662
+ if (e.maxValues !== void 0 && F.length >= e.maxValues) return;
1663
+ const H = e.emitValue === !0 ? v : l;
1664
+ o("add", { index: F.length, value: H }), F.push(H);
1665
+ }
1666
+ o("update:modelValue", F);
1667
+ }
1668
+ function Ae(l) {
1669
+ if (d.platform.is.desktop !== !0) return;
1670
+ const s = l !== -1 && l < Q.value ? l : -1;
1671
+ b.value !== s && (b.value = s);
1672
+ }
1673
+ function Qe(l = 1, s) {
1674
+ if (u.value === !0) {
1675
+ let v = b.value;
1676
+ do
1677
+ v = Jt(
1678
+ v + l,
1679
+ -1,
1680
+ Q.value - 1
1681
+ );
1682
+ while (v !== -1 && v !== b.value && _e.value(e.options[v]) === !0);
1683
+ b.value !== v && (Ae(v), V(v), s !== !0 && e.useInput === !0 && e.fillInput === !0 && We(
1684
+ v >= 0 ? ee.value(e.options[v]) : q,
1685
+ !0
1686
+ ));
1687
+ }
1688
+ }
1689
+ function vl(l, s) {
1690
+ const v = (F) => he(ie.value(F), l);
1691
+ return e.options.find(v) || s.find(v) || l;
1692
+ }
1693
+ function it(l) {
1694
+ const s = ie.value(l);
1695
+ return Ue.value.find((v) => he(v, s)) !== void 0;
1696
+ }
1697
+ function Ct(l) {
1698
+ e.useInput === !0 && O.value !== null && (l === void 0 || O.value === l.target && l.target.value === x.value) && O.value.select();
1699
+ }
1700
+ function qt(l) {
1701
+ nl(l, 27) === !0 && u.value === !0 && (Te(l), ye(), Re()), o("keyup", l);
1702
+ }
1703
+ function kt(l) {
1704
+ const { value: s } = l.target;
1705
+ if (l.keyCode !== void 0) {
1706
+ qt(l);
1707
+ return;
1708
+ }
1709
+ if (l.target.value = "", w !== null && (clearTimeout(w), w = null), k !== null && (clearTimeout(k), k = null), Re(), typeof s == "string" && s.length !== 0) {
1710
+ const v = s.toLocaleLowerCase(), F = (K) => {
1711
+ const H = e.options.find((N) => String(K.value(N)).toLocaleLowerCase() === v);
1712
+ return H === void 0 ? !1 : (c.value.indexOf(H) === -1 ? Se(H) : ye(), !0);
1713
+ }, L = (K) => {
1714
+ F(ie) !== !0 && K !== !0 && F(ee) !== !0 && Be(s, !0, () => L(!0));
1715
+ };
1716
+ L();
1717
+ } else
1718
+ i.clearValue(l);
1719
+ }
1720
+ function Vt(l) {
1721
+ o("keypress", l);
1722
+ }
1723
+ function xt(l) {
1724
+ if (o("keydown", l), Wl(l) === !0) return;
1725
+ const s = S.value.length !== 0 && (e.newValueMode !== void 0 || e.onNewValue !== void 0), v = l.shiftKey !== !0 && e.disableTabSelection !== !0 && e.multiple !== !0 && (b.value !== -1 || s === !0);
1726
+ if (l.keyCode === 27) {
1727
+ ge(l);
1728
+ return;
1729
+ }
1730
+ if (l.keyCode === 9 && v === !1) {
1731
+ ze();
1732
+ return;
1733
+ }
1734
+ if (l.target === void 0 || l.target.id !== i.targetUid.value || i.editable.value !== !0) return;
1735
+ if (l.keyCode === 40 && i.innerLoading.value !== !0 && u.value === !1) {
1736
+ ae(l), Ee();
1737
+ return;
1738
+ }
1739
+ if (l.keyCode === 8 && (e.useChips === !0 || e.clearable === !0) && e.hideSelected !== !0 && S.value.length === 0) {
1740
+ e.multiple === !0 && Array.isArray(e.modelValue) === !0 ? ut(e.modelValue.length - 1) : e.multiple !== !0 && e.modelValue !== null && o("update:modelValue", null);
1741
+ return;
1742
+ }
1743
+ (l.keyCode === 35 || l.keyCode === 36) && (typeof S.value != "string" || S.value.length === 0) && (ae(l), b.value = -1, Qe(l.keyCode === 36 ? 1 : -1, e.multiple)), (l.keyCode === 33 || l.keyCode === 34) && Z.value !== void 0 && (ae(l), b.value = Math.max(
1744
+ -1,
1745
+ Math.min(
1746
+ Q.value,
1747
+ b.value + (l.keyCode === 33 ? -1 : 1) * Z.value.view
1748
+ )
1749
+ ), Qe(l.keyCode === 33 ? 1 : -1, e.multiple)), (l.keyCode === 38 || l.keyCode === 40) && (ae(l), Qe(l.keyCode === 38 ? -1 : 1, e.multiple));
1750
+ const F = Q.value;
1751
+ if ((B === void 0 || I < Date.now()) && (B = ""), F > 0 && e.useInput !== !0 && l.key !== void 0 && l.key.length === 1 && l.altKey === !1 && l.ctrlKey === !1 && l.metaKey === !1 && (l.keyCode !== 32 || B.length !== 0)) {
1752
+ u.value !== !0 && Ee(l);
1753
+ const L = l.key.toLocaleLowerCase(), K = B.length === 1 && B[0] === L;
1754
+ I = Date.now() + 1500, K === !1 && (ae(l), B += L);
1755
+ const H = new RegExp("^" + B.split("").map((Fe) => Uo.indexOf(Fe) !== -1 ? "\\" + Fe : Fe).join(".*"), "i");
1756
+ let N = b.value;
1757
+ if (K === !0 || N < 0 || H.test(ee.value(e.options[N])) !== !0)
1758
+ do
1759
+ N = Jt(N + 1, -1, F - 1);
1760
+ while (N !== b.value && (_e.value(e.options[N]) === !0 || H.test(ee.value(e.options[N])) !== !0));
1761
+ b.value !== N && fe(() => {
1762
+ Ae(N), V(N), N >= 0 && e.useInput === !0 && e.fillInput === !0 && We(ee.value(e.options[N]), !0);
1763
+ });
1764
+ return;
1765
+ }
1766
+ if (!(l.keyCode !== 13 && (l.keyCode !== 32 || e.useInput === !0 || B !== "") && (l.keyCode !== 9 || v === !1))) {
1767
+ if (l.keyCode !== 9 && ae(l), b.value !== -1 && b.value < F) {
1768
+ Se(e.options[b.value]);
1769
+ return;
1770
+ }
1771
+ if (s === !0) {
1772
+ const L = (K, H) => {
1773
+ var Fe;
1774
+ if (H) {
1775
+ if (Gt(H) !== !0) return;
1776
+ } else
1777
+ H = e.newValueMode;
1778
+ if (He("", e.multiple !== !0, !0), K == null) return;
1779
+ (H === "toggle" ? Se : wt)(K, H === "add-unique"), e.multiple !== !0 && ((Fe = O.value) == null || Fe.focus(), ye());
1780
+ };
1781
+ if (e.onNewValue !== void 0 ? o("newValue", S.value, L) : L(S.value), e.multiple !== !0) return;
1782
+ }
1783
+ u.value === !0 ? ze() : i.innerLoading.value !== !0 && Ee();
1784
+ }
1785
+ }
1786
+ function _t() {
1787
+ return T === !0 ? oe.value : P.value !== null && P.value.contentEl !== null ? P.value.contentEl : void 0;
1788
+ }
1789
+ function ml() {
1790
+ return _t();
1791
+ }
1792
+ function gl() {
1793
+ return e.hideSelected === !0 ? [] : t["selected-item"] !== void 0 ? be.value.map((l) => t["selected-item"](l)).slice() : t.selected !== void 0 ? [].concat(t.selected()) : e.useChips === !0 ? be.value.map((l, s) => g(xo, {
1794
+ key: "option-" + s,
1795
+ removable: i.editable.value === !0 && _e.value(l.opt) !== !0,
1796
+ dense: !0,
1797
+ textColor: e.color,
1798
+ tabindex: te.value,
1799
+ onRemove() {
1800
+ l.removeAtIndex(s);
1801
+ }
1802
+ }, () => g("span", {
1803
+ class: "ellipsis",
1804
+ [l.html === !0 ? "innerHTML" : "textContent"]: ee.value(l.opt)
1805
+ }))) : [
1806
+ g("span", {
1807
+ class: "ellipsis",
1808
+ [je.value === !0 ? "innerHTML" : "textContent"]: G.value
1809
+ })
1810
+ ];
1811
+ }
1812
+ function At() {
1813
+ if (j.value === !0)
1814
+ return t["no-option"] !== void 0 ? t["no-option"]({ inputValue: S.value }) : void 0;
1815
+ const l = t.option !== void 0 ? t.option : (v) => g(_o, {
1816
+ key: v.index,
1817
+ ...v.itemProps
1818
+ }, () => g(
1819
+ Ao,
1820
+ () => g(
1821
+ Bo,
1822
+ () => g("span", {
1823
+ [v.html === !0 ? "innerHTML" : "textContent"]: v.label
1824
+ })
1825
+ )
1826
+ ));
1827
+ let s = ue("div", Ne.value.map(l));
1828
+ return t["before-options"] !== void 0 && (s = t["before-options"]().concat(s)), Xl(t["after-options"], s);
1829
+ }
1830
+ function hl(l, s) {
1831
+ const v = s === !0 ? { ...Ke.value, ...i.splitAttrs.attributes.value } : void 0, F = {
1832
+ ref: s === !0 ? O : void 0,
1833
+ key: "i_t",
1834
+ class: R.value,
1835
+ style: e.inputStyle,
1836
+ value: S.value !== void 0 ? S.value : "",
1837
+ // required for Android in order to show ENTER key when in form
1838
+ type: "search",
1839
+ ...v,
1840
+ id: s === !0 ? i.targetUid.value : void 0,
1841
+ maxlength: e.maxlength,
1842
+ autocomplete: e.autocomplete,
1843
+ "data-autofocus": l === !0 || e.autofocus === !0 || void 0,
1844
+ disabled: e.disable === !0,
1845
+ readonly: e.readonly === !0,
1846
+ ...dl.value
1847
+ };
1848
+ return l !== !0 && T === !0 && (Array.isArray(F.class) === !0 ? F.class = [...F.class, "no-pointer-events"] : F.class += " no-pointer-events"), g("input", F);
1849
+ }
1850
+ function Bt(l) {
1851
+ w !== null && (clearTimeout(w), w = null), k !== null && (clearTimeout(k), k = null), !(l && l.target && l.target.qComposing === !0) && (We(l.target.value || ""), h = !0, q = S.value, i.focused.value !== !0 && (T !== !0 || _.value === !0) && i.focus(), e.onFilter !== void 0 && (w = setTimeout(() => {
1852
+ w = null, Be(S.value);
1853
+ }, e.inputDebounce)));
1854
+ }
1855
+ function We(l, s) {
1856
+ S.value !== l && (S.value = l, s === !0 || e.inputDebounce === 0 || e.inputDebounce === "0" ? o("inputValue", l) : k = setTimeout(() => {
1857
+ k = null, o("inputValue", l);
1858
+ }, e.inputDebounce));
1859
+ }
1860
+ function He(l, s, v) {
1861
+ h = v !== !0, e.useInput === !0 && (We(l, !0), (s === !0 || v !== !0) && (q = l), s !== !0 && Be(l));
1862
+ }
1863
+ function Be(l, s, v) {
1864
+ if (e.onFilter === void 0 || s !== !0 && i.focused.value !== !0) return;
1865
+ i.innerLoading.value === !0 ? o("filterAbort") : (i.innerLoading.value = !0, f.value = !0), l !== "" && e.multiple !== !0 && c.value.length !== 0 && h !== !0 && l === ee.value(c.value[0]) && (l = "");
1866
+ const F = setTimeout(() => {
1867
+ u.value === !0 && (u.value = !1);
1868
+ }, 10);
1869
+ m !== null && clearTimeout(m), m = F, o(
1870
+ "filter",
1871
+ l,
1872
+ (L, K) => {
1873
+ (s === !0 || i.focused.value === !0) && m === F && (clearTimeout(m), typeof L == "function" && L(), f.value = !1, fe(() => {
1874
+ i.innerLoading.value = !1, i.editable.value === !0 && (s === !0 ? u.value === !0 && ye() : u.value === !0 ? at(!0) : u.value = !0), typeof K == "function" && fe(() => {
1875
+ K(n);
1876
+ }), typeof v == "function" && fe(() => {
1877
+ v(n);
1878
+ });
1879
+ }));
1880
+ },
1881
+ () => {
1882
+ i.focused.value === !0 && m === F && (clearTimeout(m), i.innerLoading.value = !1, f.value = !1), u.value === !0 && (u.value = !1);
1883
+ }
1884
+ );
1885
+ }
1886
+ function pl() {
1887
+ return g(mo, {
1888
+ ref: P,
1889
+ class: A.value,
1890
+ style: e.popupContentStyle,
1891
+ modelValue: u.value,
1892
+ fit: e.menuShrink !== !0,
1893
+ cover: e.optionsCover === !0 && j.value !== !0 && e.useInput !== !0,
1894
+ anchor: e.menuAnchor,
1895
+ self: e.menuSelf,
1896
+ offset: e.menuOffset,
1897
+ dark: y.value,
1898
+ noParentEvent: !0,
1899
+ noRefocus: !0,
1900
+ noFocus: !0,
1901
+ noRouteDismiss: e.popupNoRouteDismiss,
1902
+ square: nt.value,
1903
+ transitionShow: e.transitionShow,
1904
+ transitionHide: e.transitionHide,
1905
+ transitionDuration: e.transitionDuration,
1906
+ separateClosePopup: !0,
1907
+ ...pe.value,
1908
+ onScrollPassive: p,
1909
+ onBeforeShow: Et,
1910
+ onBeforeHide: bl,
1911
+ onShow: Sl
1912
+ }, At);
1913
+ }
1914
+ function bl(l) {
1915
+ Rt(l), ze();
1916
+ }
1917
+ function Sl() {
1918
+ W();
1919
+ }
1920
+ function yl(l) {
1921
+ var s;
1922
+ Te(l), (s = O.value) == null || s.focus(), _.value = !0, window.scrollTo(window.pageXOffset || window.scrollX || document.body.scrollLeft || 0, 0);
1923
+ }
1924
+ function wl(l) {
1925
+ Te(l), fe(() => {
1926
+ _.value = !1;
1927
+ });
1928
+ }
1929
+ function Cl() {
1930
+ const l = [
1931
+ g(ko, {
1932
+ class: `col-auto ${i.fieldClass.value}`,
1933
+ ...z.value,
1934
+ for: i.targetUid.value,
1935
+ dark: y.value,
1936
+ square: !0,
1937
+ loading: f.value,
1938
+ itemAligned: !1,
1939
+ filled: !0,
1940
+ stackLabel: S.value.length !== 0,
1941
+ ...i.splitAttrs.listeners.value,
1942
+ onFocus: yl,
1943
+ onBlur: wl
1944
+ }, {
1945
+ ...t,
1946
+ rawControl: () => i.getControl(!0),
1947
+ before: void 0,
1948
+ after: void 0
1949
+ })
1950
+ ];
1951
+ return u.value === !0 && l.push(
1952
+ g("div", {
1953
+ ref: oe,
1954
+ class: A.value + " scroll",
1955
+ style: e.popupContentStyle,
1956
+ ...pe.value,
1957
+ onClick: ge,
1958
+ onScrollPassive: p
1959
+ }, At())
1960
+ ), g(Mo, {
1961
+ ref: $,
1962
+ modelValue: a.value,
1963
+ position: e.useInput === !0 ? "top" : void 0,
1964
+ transitionShow: D,
1965
+ transitionHide: e.transitionHide,
1966
+ transitionDuration: e.transitionDuration,
1967
+ noRouteDismiss: e.popupNoRouteDismiss,
1968
+ onBeforeShow: Et,
1969
+ onBeforeHide: ql,
1970
+ onHide: kl,
1971
+ onShow: Vl
1972
+ }, () => g("div", {
1973
+ class: "q-select__dialog" + (y.value === !0 ? " q-select__dialog--dark q-dark" : "") + (_.value === !0 ? " q-select__dialog--focused" : "")
1974
+ }, l));
1975
+ }
1976
+ function ql(l) {
1977
+ Rt(l), $.value !== null && $.value.__updateRefocusTarget(
1978
+ i.rootRef.value.querySelector(".q-field__native > [tabindex]:last-child")
1979
+ ), i.focused.value = !1;
1980
+ }
1981
+ function kl(l) {
1982
+ ye(), i.focused.value === !1 && o("blur", l), Re();
1983
+ }
1984
+ function Vl() {
1985
+ const l = document.activeElement;
1986
+ (l === null || l.id !== i.targetUid.value) && O.value !== null && O.value !== l && O.value.focus(), W();
1987
+ }
1988
+ function ze() {
1989
+ a.value !== !0 && (b.value = -1, u.value === !0 && (u.value = !1), i.focused.value === !1 && (m !== null && (clearTimeout(m), m = null), i.innerLoading.value === !0 && (o("filterAbort"), i.innerLoading.value = !1, f.value = !1)));
1990
+ }
1991
+ function Ee(l) {
1992
+ i.editable.value === !0 && (T === !0 ? (i.onControlFocusin(l), a.value = !0, fe(() => {
1993
+ i.focus();
1994
+ })) : i.focus(), e.onFilter !== void 0 ? Be(S.value) : (j.value !== !0 || t["no-option"] !== void 0) && (u.value = !0));
1995
+ }
1996
+ function ye() {
1997
+ a.value = !1, ze();
1998
+ }
1999
+ function Re() {
2000
+ e.useInput === !0 && He(
2001
+ e.multiple !== !0 && e.fillInput === !0 && c.value.length !== 0 && ee.value(c.value[0]) || "",
2002
+ !0,
2003
+ !0
2004
+ );
2005
+ }
2006
+ function at(l) {
2007
+ let s = -1;
2008
+ if (l === !0) {
2009
+ if (c.value.length !== 0) {
2010
+ const v = ie.value(c.value[0]);
2011
+ s = e.options.findIndex((F) => he(ie.value(F), v));
2012
+ }
2013
+ U(s);
2014
+ }
2015
+ Ae(s);
2016
+ }
2017
+ function xl(l, s) {
2018
+ u.value === !0 && i.innerLoading.value === !1 && (U(-1, !0), fe(() => {
2019
+ u.value === !0 && i.innerLoading.value === !1 && (l > s ? U() : at(!0));
2020
+ }));
2021
+ }
2022
+ function zt() {
2023
+ a.value === !1 && P.value !== null && P.value.updatePosition();
2024
+ }
2025
+ function Et(l) {
2026
+ l !== void 0 && Te(l), o("popupShow", l), i.hasPopupOpen = !0, i.onControlFocusin(l);
2027
+ }
2028
+ function Rt(l) {
2029
+ l !== void 0 && Te(l), o("popupHide", l), i.hasPopupOpen = !1, i.onControlFocusout(l);
2030
+ }
2031
+ function Ft() {
2032
+ T = d.platform.is.mobile !== !0 && e.behavior !== "dialog" ? !1 : e.behavior !== "menu" && (e.useInput === !0 ? t["no-option"] !== void 0 || e.onFilter !== void 0 || j.value === !1 : !0), D = d.platform.is.ios === !0 && T === !0 && e.useInput === !0 ? "fade" : e.transitionShow;
2033
+ }
2034
+ return el(Ft), Bl(zt), Ft(), Ve(() => {
2035
+ w !== null && clearTimeout(w), k !== null && clearTimeout(k);
2036
+ }), Object.assign(n, {
2037
+ showPopup: Ee,
2038
+ hidePopup: ye,
2039
+ removeAtIndex: ut,
2040
+ add: wt,
2041
+ toggleOption: Se,
2042
+ getOptionIndex: () => b.value,
2043
+ setOptionIndex: Ae,
2044
+ moveOptionSelection: Qe,
2045
+ filter: Be,
2046
+ updateMenuPosition: zt,
2047
+ updateInputValue: He,
2048
+ isOptionSelected: it,
2049
+ getEmittingOptionValue: yt,
2050
+ isOptionDisabled: (...l) => _e.value.apply(null, l) === !0,
2051
+ getOptionValue: (...l) => ie.value.apply(null, l),
2052
+ getOptionLabel: (...l) => ee.value.apply(null, l)
2053
+ }), Object.assign(i, {
2054
+ innerValue: c,
2055
+ fieldClass: r(
2056
+ () => `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"}`
2057
+ ),
2058
+ inputRef: Y,
2059
+ targetRef: O,
2060
+ hasValue: E,
2061
+ showPopup: Ee,
2062
+ floatingLabel: r(
2063
+ () => e.hideSelected !== !0 && E.value === !0 || typeof S.value == "number" || S.value.length !== 0 || ht(e.displayValue)
2064
+ ),
2065
+ getControlChild: () => {
2066
+ if (i.editable.value !== !1 && (a.value === !0 || j.value !== !0 || t["no-option"] !== void 0))
2067
+ return T === !0 ? Cl() : pl();
2068
+ i.hasPopupOpen === !0 && (i.hasPopupOpen = !1);
2069
+ },
2070
+ controlEvents: {
2071
+ onFocusin(l) {
2072
+ i.onControlFocusin(l);
2073
+ },
2074
+ onFocusout(l) {
2075
+ i.onControlFocusout(l, () => {
2076
+ Re(), ze();
2077
+ });
2078
+ },
2079
+ onClick(l) {
2080
+ var s;
2081
+ if (ge(l), T !== !0 && u.value === !0) {
2082
+ ze(), (s = O.value) == null || s.focus();
2083
+ return;
2084
+ }
2085
+ Ee(l);
2086
+ }
2087
+ },
2088
+ getControl: (l) => {
2089
+ const s = gl(), v = l === !0 || a.value !== !0 || T !== !0;
2090
+ if (e.useInput === !0)
2091
+ s.push(hl(l, v));
2092
+ else if (i.editable.value === !0) {
2093
+ const L = v === !0 ? Ke.value : void 0;
2094
+ s.push(
2095
+ g("input", {
2096
+ ref: v === !0 ? O : void 0,
2097
+ key: "d_t",
2098
+ class: "q-select__focus-target",
2099
+ id: v === !0 ? i.targetUid.value : void 0,
2100
+ value: G.value,
2101
+ readonly: !0,
2102
+ "data-autofocus": l === !0 || e.autofocus === !0 || void 0,
2103
+ ...L,
2104
+ onKeydown: xt,
2105
+ onKeyup: qt,
2106
+ onKeypress: Vt
2107
+ })
2108
+ ), v === !0 && typeof e.autocomplete == "string" && e.autocomplete.length !== 0 && s.push(
2109
+ g("input", {
2110
+ class: "q-select__autocomplete-input",
2111
+ autocomplete: e.autocomplete,
2112
+ tabindex: -1,
2113
+ onKeyup: kt
2114
+ })
2115
+ );
2116
+ }
2117
+ if (X.value !== void 0 && e.disable !== !0 && Ue.value.length !== 0) {
2118
+ const L = Ue.value.map((K) => g("option", { value: K, selected: !0 }));
2119
+ s.push(
2120
+ g("select", {
2121
+ class: "hidden",
2122
+ name: X.value,
2123
+ multiple: e.multiple
2124
+ }, L)
2125
+ );
2126
+ }
2127
+ const F = e.useInput === !0 || v !== !0 ? void 0 : i.splitAttrs.attributes.value;
2128
+ return g("div", {
2129
+ class: "q-field__native row items-center",
2130
+ ...F,
2131
+ ...i.splitAttrs.listeners.value
2132
+ }, s);
2133
+ },
2134
+ getInnerAppend: () => e.loading !== !0 && f.value !== !0 && e.hideDropdownIcon !== !0 ? [
2135
+ g(Oe, {
2136
+ class: "q-select__dropdown-icon" + (u.value === !0 ? " rotate-180" : ""),
2137
+ name: Ie.value
2138
+ })
2139
+ ] : null
2140
+ }), sl(i);
2141
+ }
2142
+ }), Xo = { class: "app-select__amount" }, Yo = /* @__PURE__ */ zl({
2143
+ __name: "AppSelect",
2144
+ props: {
2145
+ modelValue: {},
2146
+ size: { default: Yl.MD },
2147
+ options: {},
2148
+ multiple: { type: Boolean },
2149
+ label: {},
2150
+ placeholder: {},
2151
+ required: { type: Boolean },
2152
+ clearable: { type: Boolean },
2153
+ disabled: { type: Boolean },
2154
+ loading: { type: Boolean },
2155
+ filtering: { type: Boolean },
2156
+ autofocus: { type: Boolean },
2157
+ rules: {},
2158
+ lazyRules: { type: [Boolean, String] },
2159
+ menuClass: {},
2160
+ isMobile: { type: Boolean }
2161
+ },
2162
+ emits: ["update:modelValue", "popupShow", "popupHide"],
2163
+ setup(e, { emit: t }) {
2164
+ const o = e, n = t, d = M(!1), u = M(""), a = r({
2165
+ get() {
2166
+ if (o.modelValue) {
2167
+ if (o.multiple && Array.isArray(o.modelValue))
2168
+ return o.options.filter(
2169
+ (h) => o.modelValue.includes(h.value)
2170
+ );
2171
+ if (!Array.isArray(o.modelValue))
2172
+ return o.options.find(
2173
+ (h) => h.value === o.modelValue
2174
+ );
2175
+ }
2176
+ },
2177
+ set(h) {
2178
+ if (!h) {
2179
+ n("update:modelValue", void 0);
2180
+ return;
2181
+ }
2182
+ if (o.multiple && Array.isArray(h)) {
2183
+ const m = h.map((q) => q.value);
2184
+ n("update:modelValue", m);
2185
+ } else Array.isArray(h) || n("update:modelValue", h.value);
2186
+ }
2187
+ }), b = r(() => {
2188
+ var h;
2189
+ if (Array.isArray(a.value)) {
2190
+ if (o.multiple && a.value.length == 0)
2191
+ return o.placeholder;
2192
+ } else return ((h = a.value) == null ? void 0 : h.label) || o.placeholder || "";
2193
+ return "";
2194
+ }), S = r(() => !(!o.clearable || !o.modelValue || o.modelValue && Array.isArray(o.modelValue) && !o.modelValue.length)), _ = r(() => u.value ? o.options.filter(
2195
+ (h) => h.label.toLowerCase().includes(u.value.toLowerCase())
2196
+ ) : o.options), f = r(() => {
2197
+ if (o.rules)
2198
+ return o.required ? [...o.rules, Ht] : o.rules;
2199
+ if (o.required)
2200
+ return [Ht];
2201
+ }), w = () => {
2202
+ d.value = !0, n("popupShow");
2203
+ }, k = () => {
2204
+ d.value = !1, n("popupHide");
2205
+ }, C = () => {
2206
+ a.value = void 0;
2207
+ }, T = (h, m) => {
2208
+ m(() => {
2209
+ u.value = h;
2210
+ });
2211
+ };
2212
+ return (h, m) => (de(), ce("div", {
2213
+ class: Xe(["app-select", [{ "app-select_opened": d.value }, `app-select_${h.size}`]])
2214
+ }, [
2215
+ h.label ? (de(), ce("label", {
2216
+ key: 0,
2217
+ class: Xe(["app-select__label", { "app-select__label_bold": h.required }])
2218
+ }, Ze(h.required ? `${h.label} *` : h.label), 3)) : Ye("", !0),
2219
+ Tt(El(Wo), {
2220
+ standout: "",
2221
+ "hide-bottom-space": "",
2222
+ "hide-dropdown-icon": "",
2223
+ "no-error-icon": "",
2224
+ behavior: "menu",
2225
+ "popup-no-route-dismiss": "",
2226
+ "popup-content-class": `glass-menu app-select-menu app-select-menu_${h.size} ${h.menuClass}`,
2227
+ placeholder: h.filtering && "Почніть вводити",
2228
+ "input-debounce": "50",
2229
+ modelValue: a.value,
2230
+ "onUpdate:modelValue": m[0] || (m[0] = (q) => a.value = q),
2231
+ options: _.value,
2232
+ multiple: h.multiple,
2233
+ "use-input": h.filtering && (Array.isArray(a.value) || !a.value),
2234
+ rules: f.value,
2235
+ "lazy-rules": h.lazyRules,
2236
+ autofocus: h.autofocus,
2237
+ disable: h.disabled,
2238
+ loading: h.loading,
2239
+ onFilter: T,
2240
+ onPopupShow: w,
2241
+ onPopupHide: k
2242
+ }, {
2243
+ append: rt(() => [
2244
+ S.value ? (de(), ce("i", {
2245
+ key: 0,
2246
+ class: "icon-kl icon-kl-circle-close app-select__clear",
2247
+ onClick: Fl(C, ["stop", "prevent"])
2248
+ })) : Ye("", !0),
2249
+ m[1] || (m[1] = Mt("i", { class: "icon-kl icon-kl-arrow-down app-select__drop-icon" }, null, -1))
2250
+ ]),
2251
+ selected: rt(() => {
2252
+ var q, D;
2253
+ return [
2254
+ Array.isArray(a.value) ? (de(), ce(Je, { key: 0 }, [
2255
+ !h.filtering || a.value.length ? (de(), ce("span", {
2256
+ key: 0,
2257
+ class: Xe([
2258
+ "app-select__selected",
2259
+ {
2260
+ "app-select__placeholder": !((q = a.value) != null && q.length) && h.placeholder
2261
+ }
2262
+ ])
2263
+ }, [
2264
+ (D = a.value) != null && D.length ? (de(), ce(Je, { key: 0 }, [
2265
+ m[2] || (m[2] = Ot(" Вибрано ", -1)),
2266
+ Mt("span", Xo, Ze(a.value.length), 1)
2267
+ ], 64)) : (de(), ce(Je, { key: 1 }, [
2268
+ Ot(Ze(o.placeholder), 1)
2269
+ ], 64))
2270
+ ], 2)) : Ye("", !0)
2271
+ ], 64)) : (de(), ce(Je, { key: 1 }, [
2272
+ !h.filtering || a.value ? (de(), ce("span", {
2273
+ key: 0,
2274
+ class: Xe([
2275
+ "app-select__selected",
2276
+ { "app-select__placeholder": !a.value && h.placeholder }
2277
+ ])
2278
+ }, Ze(b.value), 3)) : Ye("", !0)
2279
+ ], 64))
2280
+ ];
2281
+ }),
2282
+ option: rt((q) => [
2283
+ Tt(Zl, Rl({
2284
+ "no-arrow": "",
2285
+ label: q.opt.label,
2286
+ checked: q.opt.done,
2287
+ active: q.selected,
2288
+ "is-mobile": h.isMobile,
2289
+ checkbox: o.multiple,
2290
+ "model-value": q.selected
2291
+ }, q.itemProps, {
2292
+ "onUpdate:modelValue": () => q.toggleOption(q.opt)
2293
+ }), null, 16, ["label", "checked", "active", "is-mobile", "checkbox", "model-value", "onUpdate:modelValue"])
2294
+ ]),
2295
+ _: 1
2296
+ }, 8, ["popup-content-class", "placeholder", "modelValue", "options", "multiple", "use-input", "rules", "lazy-rules", "autofocus", "disable", "loading"])
2297
+ ], 2));
2298
+ }
2299
+ }), tn = /* @__PURE__ */ Jl(Yo, [["__scopeId", "data-v-500837e5"]]);
2300
+ export {
2301
+ tn as default
2302
+ };