@validol4ik/uikit 0.2.11 → 0.2.12

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,869 +0,0 @@
1
- import { computed as u, markRaw as de, defineComponent as W, getCurrentInstance as X, h as v, ref as J, onBeforeUnmount as $e, Transition as qe, withDirectives as Ee, openBlock as N, createBlock as _e, unref as Q, normalizeClass as V, withCtx as Ce, createElementBlock as Y, createCommentVNode as ee, renderSlot as Le, normalizeStyle as xe, defineAsyncComponent as Re } from "vue";
2
- const j = {
3
- SM: "sm",
4
- MD: "md",
5
- LG: "lg"
6
- };
7
- var fe = /* @__PURE__ */ ((e) => (e.sm = "3px 9px", e.md = "5px 12px", e.lg = "9px 20px", e))(fe || {});
8
- const Se = {
9
- PRIMARY: "primary",
10
- INFO: "info",
11
- NEGATIVE: "negative",
12
- POSITIVE: "positive"
13
- }, G = {
14
- xs: 18,
15
- sm: 24,
16
- md: 32,
17
- lg: 38,
18
- xl: 46
19
- }, ve = {
20
- size: String
21
- };
22
- function me(e, t = G) {
23
- return u(() => e.size !== void 0 ? { fontSize: e.size in t ? `${t[e.size]}px` : e.size } : null);
24
- }
25
- function Z(e) {
26
- return de(W(e));
27
- }
28
- function we(e) {
29
- return de(e);
30
- }
31
- function Be(e, t) {
32
- return e !== void 0 && e() || t;
33
- }
34
- function I(e, t) {
35
- return e !== void 0 ? t.concat(e()) : t;
36
- }
37
- const te = "0 0 24 24", ne = (e) => e, U = (e) => `ionicons ${e}`, ge = {
38
- "mdi-": (e) => `mdi ${e}`,
39
- "icon-": ne,
40
- // fontawesome equiv
41
- "bt-": (e) => `bt ${e}`,
42
- "eva-": (e) => `eva ${e}`,
43
- "ion-md": U,
44
- "ion-ios": U,
45
- "ion-logo": U,
46
- "iconfont ": ne,
47
- "ti-": (e) => `themify-icon ${e}`,
48
- "bi-": (e) => `bootstrap-icons ${e}`
49
- }, pe = {
50
- o_: "-outlined",
51
- r_: "-round",
52
- s_: "-sharp"
53
- }, he = {
54
- sym_o_: "-outlined",
55
- sym_r_: "-rounded",
56
- sym_s_: "-sharp"
57
- }, Pe = new RegExp("^(" + Object.keys(ge).join("|") + ")"), Te = new RegExp("^(" + Object.keys(pe).join("|") + ")"), ae = new RegExp("^(" + Object.keys(he).join("|") + ")"), Me = /^[Mm]\s?[-+]?\.?\d/, Oe = /^img:/, ze = /^svguse:/, Ae = /^ion-/, je = /^(fa-(sharp|solid|regular|light|brands|duotone|thin)|[lf]a[srlbdk]?) /, re = Z({
58
- name: "QIcon",
59
- props: {
60
- ...ve,
61
- tag: {
62
- type: String,
63
- default: "i"
64
- },
65
- name: String,
66
- color: String,
67
- left: Boolean,
68
- right: Boolean
69
- },
70
- setup(e, { slots: t }) {
71
- const { proxy: { $q: a } } = X(), n = me(e), i = u(
72
- () => "q-icon" + (e.left === !0 ? " on-left" : "") + (e.right === !0 ? " on-right" : "") + (e.color !== void 0 ? ` text-${e.color}` : "")
73
- ), d = u(() => {
74
- let c, o = e.name;
75
- if (o === "none" || !o)
76
- return { none: !0 };
77
- if (a.iconMapFn !== null) {
78
- const s = a.iconMapFn(o);
79
- if (s !== void 0)
80
- if (s.icon !== void 0) {
81
- if (o = s.icon, o === "none" || !o)
82
- return { none: !0 };
83
- } else
84
- return {
85
- cls: s.cls,
86
- content: s.content !== void 0 ? s.content : " "
87
- };
88
- }
89
- if (Me.test(o) === !0) {
90
- const [s, b = te] = o.split("|");
91
- return {
92
- svg: !0,
93
- viewBox: b,
94
- nodes: s.split("&&").map((l) => {
95
- const [y, p, k] = l.split("@@");
96
- return v("path", { style: p, d: y, transform: k });
97
- })
98
- };
99
- }
100
- if (Oe.test(o) === !0)
101
- return {
102
- img: !0,
103
- src: o.substring(4)
104
- };
105
- if (ze.test(o) === !0) {
106
- const [s, b = te] = o.split("|");
107
- return {
108
- svguse: !0,
109
- src: s.substring(7),
110
- viewBox: b
111
- };
112
- }
113
- let q = " ";
114
- const h = o.match(Pe);
115
- if (h !== null)
116
- c = ge[h[1]](o);
117
- else if (je.test(o) === !0)
118
- c = o;
119
- else if (Ae.test(o) === !0)
120
- c = `ionicons ion-${a.platform.is.ios === !0 ? "ios" : "md"}${o.substring(3)}`;
121
- else if (ae.test(o) === !0) {
122
- c = "notranslate material-symbols";
123
- const s = o.match(ae);
124
- s !== null && (o = o.substring(6), c += he[s[1]]), q = o;
125
- } else {
126
- c = "notranslate material-icons";
127
- const s = o.match(Te);
128
- s !== null && (o = o.substring(2), c += pe[s[1]]), q = o;
129
- }
130
- return {
131
- cls: c,
132
- content: q
133
- };
134
- });
135
- return () => {
136
- const c = {
137
- class: i.value,
138
- style: n.value,
139
- "aria-hidden": "true",
140
- role: "presentation"
141
- };
142
- return d.value.none === !0 ? v(e.tag, c, Be(t.default)) : d.value.img === !0 ? v(e.tag, c, I(t.default, [
143
- v("img", { src: d.value.src })
144
- ])) : d.value.svg === !0 ? v(e.tag, c, I(t.default, [
145
- v("svg", {
146
- viewBox: d.value.viewBox || "0 0 24 24"
147
- }, d.value.nodes)
148
- ])) : d.value.svguse === !0 ? v(e.tag, c, I(t.default, [
149
- v("svg", {
150
- viewBox: d.value.viewBox
151
- }, [
152
- v("use", { "xlink:href": d.value.src })
153
- ])
154
- ])) : (d.value.cls !== void 0 && (c.class += " " + d.value.cls), v(e.tag, c, I(t.default, [
155
- d.value.content
156
- ])));
157
- };
158
- }
159
- }), Ie = {
160
- size: {
161
- type: [String, Number],
162
- default: "1em"
163
- },
164
- color: String
165
- };
166
- function De(e) {
167
- return {
168
- cSize: u(() => e.size in G ? `${G[e.size]}px` : e.size),
169
- classes: u(
170
- () => "q-spinner" + (e.color ? ` text-${e.color}` : "")
171
- )
172
- };
173
- }
174
- const Ke = Z({
175
- name: "QSpinner",
176
- props: {
177
- ...Ie,
178
- thickness: {
179
- type: Number,
180
- default: 5
181
- }
182
- },
183
- setup(e) {
184
- const { cSize: t, classes: a } = De(e);
185
- return () => v("svg", {
186
- class: a.value + " q-spinner-mat",
187
- width: t.value,
188
- height: t.value,
189
- viewBox: "25 25 50 50"
190
- }, [
191
- v("circle", {
192
- class: "path",
193
- cx: "50",
194
- cy: "50",
195
- r: "20",
196
- fill: "none",
197
- stroke: "currentColor",
198
- "stroke-width": e.thickness,
199
- "stroke-miterlimit": "10"
200
- })
201
- ]);
202
- }
203
- });
204
- function Ne(e, t) {
205
- const a = e.style;
206
- for (const n in t)
207
- a[n] = t[n];
208
- }
209
- const F = {
210
- hasPassive: !1,
211
- passiveCapture: !0,
212
- notPassiveCapture: !0
213
- };
214
- try {
215
- const e = Object.defineProperty({}, "passive", {
216
- get() {
217
- Object.assign(F, {
218
- hasPassive: !0,
219
- passive: { passive: !0 },
220
- notPassive: { passive: !1 },
221
- passiveCapture: { passive: !0, capture: !0 },
222
- notPassiveCapture: { passive: !1, capture: !0 }
223
- });
224
- }
225
- });
226
- window.addEventListener("qtest", null, e), window.removeEventListener("qtest", null, e);
227
- } catch {
228
- }
229
- function Ve(e) {
230
- return e.touches && e.touches[0] ? e = e.touches[0] : e.changedTouches && e.changedTouches[0] ? e = e.changedTouches[0] : e.targetTouches && e.targetTouches[0] && (e = e.targetTouches[0]), {
231
- top: e.clientY,
232
- left: e.clientX
233
- };
234
- }
235
- function be(e) {
236
- e.stopPropagation();
237
- }
238
- function Fe(e) {
239
- e.cancelable !== !1 && e.preventDefault();
240
- }
241
- function P(e) {
242
- e.cancelable !== !1 && e.preventDefault(), e.stopPropagation();
243
- }
244
- function Qe(e, t, a) {
245
- const n = `__q_${t}_evt`;
246
- e[n] = e[n] !== void 0 ? e[n].concat(a) : a, a.forEach((i) => {
247
- i[0].addEventListener(i[1], e[i[2]], F[i[3]]);
248
- });
249
- }
250
- function Ue(e, t) {
251
- const a = `__q_${t}_evt`;
252
- e[a] !== void 0 && (e[a].forEach((n) => {
253
- n[0].removeEventListener(n[1], e[n[2]], F[n[3]]);
254
- }), e[a] = void 0);
255
- }
256
- function Ye(e) {
257
- return e !== Object(e) || e.isComposing === !0 || e.qKeyEvent === !0;
258
- }
259
- function H(e, t) {
260
- return Ye(e) === !0 ? !1 : [].concat(t).includes(e.keyCode);
261
- }
262
- function Ge(e, t = 250) {
263
- let a = !1, n;
264
- return function() {
265
- return a === !1 && (a = !0, setTimeout(() => {
266
- a = !1;
267
- }, t), n = e.apply(this, arguments)), n;
268
- };
269
- }
270
- function ie(e, t, a, n) {
271
- a.modifiers.stop === !0 && be(e);
272
- const i = a.modifiers.color;
273
- let d = a.modifiers.center;
274
- d = d === !0 || n === !0;
275
- const c = document.createElement("span"), o = document.createElement("span"), q = Ve(e), { left: h, top: s, width: b, height: l } = t.getBoundingClientRect(), y = Math.sqrt(b * b + l * l), p = y / 2, k = `${(b - y) / 2}px`, f = d ? k : `${q.left - h - p}px`, $ = `${(l - y) / 2}px`, B = d ? $ : `${q.top - s - p}px`;
276
- o.className = "q-ripple__inner", Ne(o, {
277
- height: `${y}px`,
278
- width: `${y}px`,
279
- transform: `translate3d(${f},${B},0) scale3d(.2,.2,1)`,
280
- opacity: 0
281
- }), c.className = `q-ripple${i ? " text-" + i : ""}`, c.setAttribute("dir", "ltr"), c.appendChild(o), t.appendChild(c);
282
- const S = () => {
283
- c.remove(), clearTimeout(w);
284
- };
285
- a.abort.push(S);
286
- let w = setTimeout(() => {
287
- o.classList.add("q-ripple__inner--enter"), o.style.transform = `translate3d(${k},${$},0) scale3d(1,1,1)`, o.style.opacity = 0.2, w = setTimeout(() => {
288
- o.classList.remove("q-ripple__inner--enter"), o.classList.add("q-ripple__inner--leave"), o.style.opacity = 0, w = setTimeout(() => {
289
- c.remove(), a.abort.splice(a.abort.indexOf(S), 1);
290
- }, 275);
291
- }, 250);
292
- }, 50);
293
- }
294
- function oe(e, { modifiers: t, value: a, arg: n }) {
295
- const i = Object.assign({}, e.cfg.ripple, t, a);
296
- e.modifiers = {
297
- early: i.early === !0,
298
- stop: i.stop === !0,
299
- center: i.center === !0,
300
- color: i.color || n,
301
- keyCodes: [].concat(i.keyCodes || 13)
302
- };
303
- }
304
- const He = we(
305
- {
306
- name: "ripple",
307
- beforeMount(e, t) {
308
- const a = t.instance.$.appContext.config.globalProperties.$q.config || {};
309
- if (a.ripple === !1)
310
- return;
311
- const n = {
312
- cfg: a,
313
- enabled: t.value !== !1,
314
- modifiers: {},
315
- abort: [],
316
- start(i) {
317
- n.enabled === !0 && i.qSkipRipple !== !0 && i.type === (n.modifiers.early === !0 ? "pointerdown" : "click") && ie(i, e, n, i.qKeyEvent === !0);
318
- },
319
- keystart: Ge((i) => {
320
- n.enabled === !0 && i.qSkipRipple !== !0 && H(i, n.modifiers.keyCodes) === !0 && i.type === `key${n.modifiers.early === !0 ? "down" : "up"}` && ie(i, e, n, !0);
321
- }, 300)
322
- };
323
- oe(n, t), e.__qripple = n, Qe(n, "main", [
324
- [e, "pointerdown", "start", "passive"],
325
- [e, "click", "start", "passive"],
326
- [e, "keydown", "keystart", "passive"],
327
- [e, "keyup", "keystart", "passive"]
328
- ]);
329
- },
330
- updated(e, t) {
331
- if (t.oldValue !== t.value) {
332
- const a = e.__qripple;
333
- a !== void 0 && (a.enabled = t.value !== !1, a.enabled === !0 && Object(t.value) === t.value && oe(a, t));
334
- }
335
- },
336
- beforeUnmount(e) {
337
- const t = e.__qripple;
338
- t !== void 0 && (t.abort.forEach((a) => {
339
- a();
340
- }), Ue(t, "main"), delete e._qripple);
341
- }
342
- }
343
- ), ye = {
344
- left: "start",
345
- center: "center",
346
- right: "end",
347
- between: "between",
348
- around: "around",
349
- evenly: "evenly",
350
- stretch: "stretch"
351
- }, We = Object.keys(ye), Xe = {
352
- align: {
353
- type: String,
354
- validator: (e) => We.includes(e)
355
- }
356
- };
357
- function Ze(e) {
358
- return u(() => {
359
- const t = e.align === void 0 ? e.vertical === !0 ? "stretch" : "left" : e.align;
360
- return `${e.vertical === !0 ? "items" : "justify"}-${ye[t]}`;
361
- });
362
- }
363
- function Je(e) {
364
- return e.appContext.config.globalProperties.$router !== void 0;
365
- }
366
- function le(e) {
367
- return e ? e.aliasOf ? e.aliasOf.path : e.path : "";
368
- }
369
- function ue(e, t) {
370
- return (e.aliasOf || e) === (t.aliasOf || t);
371
- }
372
- function et(e, t) {
373
- for (const a in t) {
374
- const n = t[a], i = e[a];
375
- if (typeof n == "string") {
376
- if (n !== i)
377
- return !1;
378
- } else if (Array.isArray(i) === !1 || i.length !== n.length || n.some((d, c) => d !== i[c]))
379
- return !1;
380
- }
381
- return !0;
382
- }
383
- function se(e, t) {
384
- return Array.isArray(t) === !0 ? e.length === t.length && e.every((a, n) => a === t[n]) : e.length === 1 && e[0] === t;
385
- }
386
- function tt(e, t) {
387
- return Array.isArray(e) === !0 ? se(e, t) : Array.isArray(t) === !0 ? se(t, e) : e === t;
388
- }
389
- function nt(e, t) {
390
- if (Object.keys(e).length !== Object.keys(t).length)
391
- return !1;
392
- for (const a in e)
393
- if (tt(e[a], t[a]) === !1)
394
- return !1;
395
- return !0;
396
- }
397
- const at = {
398
- // router-link
399
- to: [String, Object],
400
- replace: Boolean,
401
- // regular <a> link
402
- href: String,
403
- target: String,
404
- // state
405
- disable: Boolean
406
- };
407
- function rt({ fallbackTag: e, useDisableForRouterLinkProps: t = !0 } = {}) {
408
- const a = X(), { props: n, proxy: i, emit: d } = a, c = Je(a), o = u(() => n.disable !== !0 && n.href !== void 0), q = t === !0 ? u(
409
- () => c === !0 && n.disable !== !0 && o.value !== !0 && n.to !== void 0 && n.to !== null && n.to !== ""
410
- ) : u(
411
- () => c === !0 && o.value !== !0 && n.to !== void 0 && n.to !== null && n.to !== ""
412
- ), h = u(() => q.value === !0 ? B(n.to) : null), s = u(() => h.value !== null), b = u(() => o.value === !0 || s.value === !0), l = u(() => n.type === "a" || b.value === !0 ? "a" : n.tag || e || "div"), y = u(() => o.value === !0 ? {
413
- href: n.href,
414
- target: n.target
415
- } : s.value === !0 ? {
416
- href: h.value.href,
417
- target: n.target
418
- } : {}), p = u(() => {
419
- if (s.value === !1)
420
- return -1;
421
- const { matched: m } = h.value, { length: E } = m, C = m[E - 1];
422
- if (C === void 0)
423
- return -1;
424
- const x = i.$route.matched;
425
- if (x.length === 0)
426
- return -1;
427
- const R = x.findIndex(
428
- ue.bind(null, C)
429
- );
430
- if (R !== -1)
431
- return R;
432
- const D = le(m[E - 2]);
433
- return (
434
- // we are dealing with nested routes
435
- E > 1 && le(C) === D && x[x.length - 1].path !== D ? x.findIndex(
436
- ue.bind(null, m[E - 2])
437
- ) : R
438
- );
439
- }), k = u(
440
- () => s.value === !0 && p.value !== -1 && et(i.$route.params, h.value.params)
441
- ), f = u(
442
- () => k.value === !0 && p.value === i.$route.matched.length - 1 && nt(i.$route.params, h.value.params)
443
- ), $ = u(() => s.value === !0 ? f.value === !0 ? ` ${n.exactActiveClass} ${n.activeClass}` : n.exact === !0 ? "" : k.value === !0 ? ` ${n.activeClass}` : "" : "");
444
- function B(m) {
445
- try {
446
- return i.$router.resolve(m);
447
- } catch {
448
- }
449
- return null;
450
- }
451
- function S(m, { returnRouterError: E, to: C = n.to, replace: x = n.replace } = {}) {
452
- if (n.disable === !0)
453
- return m.preventDefault(), Promise.resolve(!1);
454
- if (
455
- // don't redirect with control keys;
456
- // should match RouterLink from Vue Router
457
- m.metaKey || m.altKey || m.ctrlKey || m.shiftKey || m.button !== void 0 && m.button !== 0 || n.target === "_blank"
458
- )
459
- return Promise.resolve(!1);
460
- m.preventDefault();
461
- const R = i.$router[x === !0 ? "replace" : "push"](C);
462
- return E === !0 ? R : R.then(() => {
463
- }).catch(() => {
464
- });
465
- }
466
- function w(m) {
467
- if (s.value === !0) {
468
- const E = (C) => S(m, C);
469
- d("click", m, E), m.defaultPrevented !== !0 && E();
470
- } else
471
- d("click", m);
472
- }
473
- return {
474
- hasRouterLink: s,
475
- hasHrefLink: o,
476
- hasLink: b,
477
- linkTag: l,
478
- resolvedLink: h,
479
- linkIsActive: k,
480
- linkIsExactActive: f,
481
- linkClass: $,
482
- linkAttrs: y,
483
- getLink: B,
484
- navigateToRouterLink: S,
485
- navigateOnClick: w
486
- };
487
- }
488
- const ce = {
489
- none: 0,
490
- xs: 4,
491
- sm: 8,
492
- md: 16,
493
- lg: 24,
494
- xl: 32
495
- }, it = {
496
- xs: 8,
497
- sm: 10,
498
- md: 14,
499
- lg: 20,
500
- xl: 24
501
- }, ot = ["button", "submit", "reset"], lt = /[^\s]\/[^\s]/, ut = ["flat", "outline", "push", "unelevated"];
502
- function st(e, t) {
503
- return e.flat === !0 ? "flat" : e.outline === !0 ? "outline" : e.push === !0 ? "push" : e.unelevated === !0 ? "unelevated" : t;
504
- }
505
- const ct = {
506
- ...ve,
507
- ...at,
508
- type: {
509
- type: String,
510
- default: "button"
511
- },
512
- label: [Number, String],
513
- icon: String,
514
- iconRight: String,
515
- ...ut.reduce(
516
- (e, t) => (e[t] = Boolean) && e,
517
- {}
518
- ),
519
- square: Boolean,
520
- rounded: Boolean,
521
- glossy: Boolean,
522
- size: String,
523
- fab: Boolean,
524
- fabMini: Boolean,
525
- padding: String,
526
- color: String,
527
- textColor: String,
528
- noCaps: Boolean,
529
- noWrap: Boolean,
530
- dense: Boolean,
531
- tabindex: [Number, String],
532
- ripple: {
533
- type: [Boolean, Object],
534
- default: !0
535
- },
536
- align: {
537
- ...Xe.align,
538
- default: "center"
539
- },
540
- stack: Boolean,
541
- stretch: Boolean,
542
- loading: {
543
- type: Boolean,
544
- default: null
545
- },
546
- disable: Boolean
547
- }, dt = {
548
- ...ct,
549
- round: Boolean
550
- };
551
- function ft(e) {
552
- const t = me(e, it), a = Ze(e), { hasRouterLink: n, hasLink: i, linkTag: d, linkAttrs: c, navigateOnClick: o } = rt({
553
- fallbackTag: "button"
554
- }), q = u(() => {
555
- const f = e.fab === !1 && e.fabMini === !1 ? t.value : {};
556
- return e.padding !== void 0 ? Object.assign({}, f, {
557
- padding: e.padding.split(/\s+/).map(($) => $ in ce ? ce[$] + "px" : $).join(" "),
558
- minWidth: "0",
559
- minHeight: "0"
560
- }) : f;
561
- }), h = u(
562
- () => e.rounded === !0 || e.fab === !0 || e.fabMini === !0
563
- ), s = u(
564
- () => e.disable !== !0 && e.loading !== !0
565
- ), b = u(() => s.value === !0 ? e.tabindex || 0 : -1), l = u(() => st(e, "standard")), y = u(() => {
566
- const f = { tabindex: b.value };
567
- return i.value === !0 ? Object.assign(f, c.value) : ot.includes(e.type) === !0 && (f.type = e.type), d.value === "a" ? (e.disable === !0 ? f["aria-disabled"] = "true" : f.href === void 0 && (f.role = "button"), n.value !== !0 && lt.test(e.type) === !0 && (f.type = e.type)) : e.disable === !0 && (f.disabled = "", f["aria-disabled"] = "true"), e.loading === !0 && e.percentage !== void 0 && Object.assign(f, {
568
- role: "progressbar",
569
- "aria-valuemin": 0,
570
- "aria-valuemax": 100,
571
- "aria-valuenow": e.percentage
572
- }), f;
573
- }), p = u(() => {
574
- let f;
575
- e.color !== void 0 ? e.flat === !0 || e.outline === !0 ? f = `text-${e.textColor || e.color}` : f = `bg-${e.color} text-${e.textColor || "white"}` : e.textColor && (f = `text-${e.textColor}`);
576
- const $ = e.round === !0 ? "round" : `rectangle${h.value === !0 ? " q-btn--rounded" : e.square === !0 ? " q-btn--square" : ""}`;
577
- return `q-btn--${l.value} q-btn--${$}` + (f !== void 0 ? " " + f : "") + (s.value === !0 ? " q-btn--actionable q-focusable q-hoverable" : e.disable === !0 ? " disabled" : "") + (e.fab === !0 ? " q-btn--fab" : e.fabMini === !0 ? " q-btn--fab-mini" : "") + (e.noCaps === !0 ? " q-btn--no-uppercase" : "") + (e.dense === !0 ? " q-btn--dense" : "") + (e.stretch === !0 ? " no-border-radius self-stretch" : "") + (e.glossy === !0 ? " glossy" : "") + (e.square ? " q-btn--square" : "");
578
- }), k = u(
579
- () => a.value + (e.stack === !0 ? " column" : " row") + (e.noWrap === !0 ? " no-wrap text-no-wrap" : "") + (e.loading === !0 ? " q-btn__content--hidden" : "")
580
- );
581
- return {
582
- classes: p,
583
- style: q,
584
- innerClasses: k,
585
- attributes: y,
586
- hasLink: i,
587
- linkTag: d,
588
- navigateOnClick: o,
589
- isActionable: s
590
- };
591
- }
592
- const { passiveCapture: _ } = F;
593
- let T = null, M = null, O = null;
594
- const vt = Z({
595
- name: "QBtn",
596
- props: {
597
- ...dt,
598
- percentage: Number,
599
- darkPercentage: Boolean,
600
- onTouchstart: [Function, Array]
601
- },
602
- emits: ["click", "keydown", "mousedown", "keyup"],
603
- setup(e, { slots: t, emit: a }) {
604
- const { proxy: n } = X(), {
605
- classes: i,
606
- style: d,
607
- innerClasses: c,
608
- attributes: o,
609
- hasLink: q,
610
- linkTag: h,
611
- navigateOnClick: s,
612
- isActionable: b
613
- } = ft(e), l = J(null), y = J(null);
614
- let p = null, k, f = null;
615
- const $ = u(
616
- () => e.label !== void 0 && e.label !== null && e.label !== ""
617
- ), B = u(() => e.disable === !0 || e.ripple === !1 ? !1 : {
618
- keyCodes: q.value === !0 ? [13, 32] : [13],
619
- ...e.ripple === !0 ? {} : e.ripple
620
- }), S = u(() => ({ center: e.round })), w = u(() => {
621
- const r = Math.max(0, Math.min(100, e.percentage));
622
- return r > 0 ? { transition: "transform 0.6s", transform: `translateX(${r - 100}%)` } : {};
623
- }), m = u(() => {
624
- if (e.loading === !0)
625
- return {
626
- onMousedown: A,
627
- onTouchstart: A,
628
- onClick: A,
629
- onKeydown: A,
630
- onKeyup: A
631
- };
632
- if (b.value === !0) {
633
- const r = {
634
- onClick: C,
635
- onKeydown: x,
636
- onMousedown: D
637
- };
638
- if (n.$q.platform.has.touch === !0) {
639
- const g = e.onTouchstart !== void 0 ? "" : "Passive";
640
- r[`onTouchstart${g}`] = R;
641
- }
642
- return r;
643
- }
644
- return {
645
- // needed; especially for disabled <a> tags
646
- onClick: P
647
- };
648
- }), E = u(() => ({
649
- ref: l,
650
- class: "q-btn q-btn-item non-selectable no-outline " + i.value,
651
- style: d.value,
652
- ...o.value,
653
- ...m.value
654
- }));
655
- function C(r) {
656
- if (l.value !== null) {
657
- if (r !== void 0) {
658
- if (r.defaultPrevented === !0)
659
- return;
660
- const g = document.activeElement;
661
- if (e.type === "submit" && g !== document.body && l.value.contains(g) === !1 && g.contains(l.value) === !1) {
662
- l.value.focus();
663
- const K = () => {
664
- document.removeEventListener("keydown", P, !0), document.removeEventListener("keyup", K, _), l.value !== null && l.value.removeEventListener("blur", K, _);
665
- };
666
- document.addEventListener("keydown", P, !0), document.addEventListener("keyup", K, _), l.value.addEventListener("blur", K, _);
667
- }
668
- }
669
- s(r);
670
- }
671
- }
672
- function x(r) {
673
- l.value !== null && (a("keydown", r), H(r, [13, 32]) === !0 && M !== l.value && (M !== null && z(), r.defaultPrevented !== !0 && (l.value.focus(), M = l.value, l.value.classList.add("q-btn--active"), document.addEventListener("keyup", L, !0), l.value.addEventListener("blur", L, _)), P(r)));
674
- }
675
- function R(r) {
676
- l.value !== null && (a("touchstart", r), r.defaultPrevented !== !0 && (T !== l.value && (T !== null && z(), T = l.value, p = r.target, p.addEventListener("touchcancel", L, _), p.addEventListener("touchend", L, _)), k = !0, f !== null && clearTimeout(f), f = setTimeout(() => {
677
- f = null, k = !1;
678
- }, 200)));
679
- }
680
- function D(r) {
681
- l.value !== null && (r.qSkipRipple = k === !0, a("mousedown", r), r.defaultPrevented !== !0 && O !== l.value && (O !== null && z(), O = l.value, l.value.classList.add("q-btn--active"), document.addEventListener("mouseup", L, _)));
682
- }
683
- function L(r) {
684
- if (l.value !== null && !(r !== void 0 && r.type === "blur" && document.activeElement === l.value)) {
685
- if (r !== void 0 && r.type === "keyup") {
686
- if (M === l.value && H(r, [13, 32]) === !0) {
687
- const g = new MouseEvent("click", r);
688
- g.qKeyEvent = !0, r.defaultPrevented === !0 && Fe(g), r.cancelBubble === !0 && be(g), l.value.dispatchEvent(g), P(r), r.qKeyEvent = !0;
689
- }
690
- a("keyup", r);
691
- }
692
- z();
693
- }
694
- }
695
- function z(r) {
696
- const g = y.value;
697
- r !== !0 && (T === l.value || O === l.value) && g !== null && g !== document.activeElement && (g.setAttribute("tabindex", -1), g.focus()), T === l.value && (p !== null && (p.removeEventListener("touchcancel", L, _), p.removeEventListener("touchend", L, _)), T = p = null), O === l.value && (document.removeEventListener("mouseup", L, _), O = null), M === l.value && (document.removeEventListener("keyup", L, !0), l.value !== null && l.value.removeEventListener("blur", L, _), M = null), l.value !== null && l.value.classList.remove("q-btn--active");
698
- }
699
- function A(r) {
700
- P(r), r.qSkipRipple = !0;
701
- }
702
- return $e(() => {
703
- z(!0);
704
- }), Object.assign(n, {
705
- click: (r) => {
706
- b.value === !0 && C(r);
707
- }
708
- }), () => {
709
- let r = [];
710
- e.icon !== void 0 && r.push(
711
- v(re, {
712
- name: e.icon,
713
- left: e.stack !== !0 && $.value === !0,
714
- role: "img",
715
- "aria-hidden": "true"
716
- })
717
- ), $.value === !0 && r.push(
718
- v("span", { class: "block" }, [e.label])
719
- ), r = I(t.default, r), e.iconRight !== void 0 && e.round === !1 && r.push(
720
- v(re, {
721
- name: e.iconRight,
722
- right: e.stack !== !0 && $.value === !0,
723
- role: "img",
724
- "aria-hidden": "true"
725
- })
726
- );
727
- const g = [
728
- v("span", {
729
- class: "q-focus-helper",
730
- ref: y
731
- })
732
- ];
733
- return e.loading === !0 && e.percentage !== void 0 && g.push(
734
- v("span", {
735
- class: "q-btn__progress absolute-full overflow-hidden" + (e.darkPercentage === !0 ? " q-btn__progress--dark" : "")
736
- }, [
737
- v("span", {
738
- class: "q-btn__progress-indicator fit block",
739
- style: w.value
740
- })
741
- ])
742
- ), g.push(
743
- v("span", {
744
- class: "q-btn__content text-center col items-center q-anchor--skip " + c.value
745
- }, r)
746
- ), e.loading !== null && g.push(
747
- v(qe, {
748
- name: "q-transition--fade"
749
- }, () => e.loading === !0 ? [
750
- v("span", {
751
- key: "loading",
752
- class: "absolute-full flex flex-center"
753
- }, t.loading !== void 0 ? t.loading() : [v(Ke)])
754
- ] : null)
755
- ), Ee(
756
- v(
757
- h.value,
758
- E.value,
759
- g
760
- ),
761
- [[
762
- He,
763
- B.value,
764
- void 0,
765
- S.value
766
- ]]
767
- );
768
- };
769
- }
770
- }), mt = /* @__PURE__ */ W({
771
- __name: "index",
772
- props: {
773
- size: { default: j.MD },
774
- transparent: { type: Boolean },
775
- rounded: { type: Boolean },
776
- color: { default: Se.PRIMARY },
777
- iconLeft: {},
778
- iconRight: {},
779
- iconMiddle: {},
780
- disabled: { type: Boolean },
781
- loading: { type: [Boolean, null] },
782
- to: {},
783
- href: {},
784
- target: {},
785
- submit: { type: Boolean },
786
- ariaLabel: {}
787
- },
788
- emits: ["click"],
789
- setup(e) {
790
- const t = e, a = u(() => [
791
- "app-btn",
792
- {
793
- "app-btn_default": !t.transparent,
794
- "app-btn_trans": t.transparent,
795
- "app-btn_rounded": t.rounded,
796
- "app-btn_sm": t.size === j.SM,
797
- "app-btn_md": t.size === j.MD,
798
- "app-btn_lg": t.size === j.LG,
799
- "app-btn_icon-left": t.iconLeft,
800
- "app-btn_icon-right": t.iconRight,
801
- "app-btn_icon-middle": t.iconMiddle
802
- },
803
- `app-btn_${t.color}`
804
- ]);
805
- return (n, i) => (N(), _e(Q(vt), {
806
- "no-caps": "",
807
- unelevated: "",
808
- class: V(a.value),
809
- padding: Q(fe)[t.size || Q(j).MD],
810
- loading: n.loading,
811
- disabled: n.disabled || void 0,
812
- to: n.to,
813
- href: n.href,
814
- target: n.target,
815
- type: n.submit ? "submit" : void 0,
816
- "aria-label": n.ariaLabel,
817
- onClick: i[0] || (i[0] = (d) => n.$emit("click", d))
818
- }, {
819
- default: Ce(() => [
820
- n.iconLeft || n.iconMiddle ? (N(), Y("i", {
821
- key: 0,
822
- class: V([
823
- "icon-kl",
824
- n.iconLeft ? "icon-kl_left" : "icon-kl_middle",
825
- `icon-kl-${n.iconLeft || n.iconMiddle}`,
826
- n.transparent ? `text-${n.color}` : "text-secondary"
827
- ])
828
- }, null, 2)) : ee("", !0),
829
- Le(n.$slots, "default", {}, void 0, !0),
830
- n.iconRight ? (N(), Y("i", {
831
- key: 1,
832
- class: V([
833
- "icon-kl",
834
- "icon-kl_right",
835
- `icon-kl-${n.iconRight}`,
836
- n.transparent ? `text-${n.color}` : "text-secondary"
837
- ])
838
- }, null, 2)) : ee("", !0)
839
- ]),
840
- _: 3
841
- }, 8, ["class", "padding", "loading", "disabled", "to", "href", "target", "type", "aria-label"]));
842
- }
843
- }), ke = (e, t) => {
844
- const a = e.__vccOpts || e;
845
- for (const [n, i] of t)
846
- a[n] = i;
847
- return a;
848
- }, ht = /* @__PURE__ */ ke(mt, [["__scopeId", "data-v-5b3b0602"]]), gt = /* @__PURE__ */ W({
849
- __name: "index",
850
- props: {
851
- name: {},
852
- size: {},
853
- color: {}
854
- },
855
- setup(e) {
856
- return (t, a) => (N(), Y("i", {
857
- class: V(["icon-kl", `icon-kl-${t.name}`, t.color ? `text-${t.color}` : ""]),
858
- style: xe(t.size ? `font-size: ${t.size}` : void 0)
859
- }, null, 6));
860
- }
861
- }), bt = /* @__PURE__ */ ke(gt, [["__scopeId", "data-v-73419357"]]), yt = Re(
862
- () => import("./index-DpdgtaB8.js")
863
- );
864
- export {
865
- ht as A,
866
- Se as C,
867
- yt as a,
868
- bt as i
869
- };