@validol4ik/uikit 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,873 +0,0 @@
1
- import { computed as u, markRaw as de, defineComponent as X, getCurrentInstance as Z, h as v, ref as ee, onBeforeUnmount as ke, Transition as $e, withDirectives as qe, openBlock as I, createBlock as Ee, unref as Y, normalizeClass as V, withCtx as Le, createElementBlock as F, createCommentVNode as G, renderSlot as Ce, Fragment as Se, createTextVNode as _e, toDisplayString as Re, normalizeStyle as Be, defineAsyncComponent as xe } from "vue";
2
- const we = {
3
- PRIMARY: "primary",
4
- INFO: "info"
5
- }, B = {
6
- SM: "sm",
7
- MD: "md",
8
- LG: "lg"
9
- }, Pe = {
10
- [B.SM]: "3px 9px",
11
- [B.MD]: "5px 12px",
12
- [B.LG]: "9px 20px"
13
- }, U = {
14
- xs: 18,
15
- sm: 24,
16
- md: 32,
17
- lg: 38,
18
- xl: 46
19
- }, fe = {
20
- size: String
21
- };
22
- function ve(e, t = U) {
23
- return u(() => e.size !== void 0 ? { fontSize: e.size in t ? `${t[e.size]}px` : e.size } : null);
24
- }
25
- function J(e) {
26
- return de(X(e));
27
- }
28
- function Me(e) {
29
- return de(e);
30
- }
31
- function Te(e, t) {
32
- return e !== void 0 && e() || t;
33
- }
34
- function D(e, t) {
35
- return e !== void 0 ? t.concat(e()) : t;
36
- }
37
- const te = "0 0 24 24", ne = (e) => e, H = (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": H,
44
- "ion-ios": H,
45
- "ion-logo": H,
46
- "iconfont ": ne,
47
- "ti-": (e) => `themify-icon ${e}`,
48
- "bi-": (e) => `bootstrap-icons ${e}`
49
- }, me = {
50
- o_: "-outlined",
51
- r_: "-round",
52
- s_: "-sharp"
53
- }, pe = {
54
- sym_o_: "-outlined",
55
- sym_r_: "-rounded",
56
- sym_s_: "-sharp"
57
- }, Oe = new RegExp("^(" + Object.keys(ge).join("|") + ")"), ze = new RegExp("^(" + Object.keys(me).join("|") + ")"), ae = new RegExp("^(" + Object.keys(pe).join("|") + ")"), Ae = /^[Mm]\s?[-+]?\.?\d/, je = /^img:/, Ie = /^svguse:/, De = /^ion-/, Ke = /^(fa-(classic|sharp|solid|regular|light|brands|duotone|thin)|[lf]a[srlbdk]?) /, re = J({
58
- name: "QIcon",
59
- props: {
60
- ...fe,
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 } } = Z(), n = ve(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, l = e.name;
75
- if (l === "none" || !l)
76
- return { none: !0 };
77
- if (a.iconMapFn !== null) {
78
- const s = a.iconMapFn(l);
79
- if (s !== void 0)
80
- if (s.icon !== void 0) {
81
- if (l = s.icon, l === "none" || !l)
82
- return { none: !0 };
83
- } else
84
- return {
85
- cls: s.cls,
86
- content: s.content !== void 0 ? s.content : " "
87
- };
88
- }
89
- if (Ae.test(l) === !0) {
90
- const [s, h = te] = l.split("|");
91
- return {
92
- svg: !0,
93
- viewBox: h,
94
- nodes: s.split("&&").map((o) => {
95
- const [y, p, k] = o.split("@@");
96
- return v("path", { style: p, d: y, transform: k });
97
- })
98
- };
99
- }
100
- if (je.test(l) === !0)
101
- return {
102
- img: !0,
103
- src: l.substring(4)
104
- };
105
- if (Ie.test(l) === !0) {
106
- const [s, h = te] = l.split("|");
107
- return {
108
- svguse: !0,
109
- src: s.substring(7),
110
- viewBox: h
111
- };
112
- }
113
- let q = " ";
114
- const b = l.match(Oe);
115
- if (b !== null)
116
- c = ge[b[1]](l);
117
- else if (Ke.test(l) === !0)
118
- c = l;
119
- else if (De.test(l) === !0)
120
- c = `ionicons ion-${a.platform.is.ios === !0 ? "ios" : "md"}${l.substring(3)}`;
121
- else if (ae.test(l) === !0) {
122
- c = "notranslate material-symbols";
123
- const s = l.match(ae);
124
- s !== null && (l = l.substring(6), c += pe[s[1]]), q = l;
125
- } else {
126
- c = "notranslate material-icons";
127
- const s = l.match(ze);
128
- s !== null && (l = l.substring(2), c += me[s[1]]), q = l;
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, Te(t.default)) : d.value.img === !0 ? v(e.tag, c, D(t.default, [
143
- v("img", { src: d.value.src })
144
- ])) : d.value.svg === !0 ? v(e.tag, c, D(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, D(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, D(t.default, [
155
- d.value.content
156
- ])));
157
- };
158
- }
159
- }), Ne = {
160
- size: {
161
- type: [String, Number],
162
- default: "1em"
163
- },
164
- color: String
165
- };
166
- function Ve(e) {
167
- return {
168
- cSize: u(() => e.size in U ? `${U[e.size]}px` : e.size),
169
- classes: u(
170
- () => "q-spinner" + (e.color ? ` text-${e.color}` : "")
171
- )
172
- };
173
- }
174
- const Fe = J({
175
- name: "QSpinner",
176
- props: {
177
- ...Ne,
178
- thickness: {
179
- type: Number,
180
- default: 5
181
- }
182
- },
183
- setup(e) {
184
- const { cSize: t, classes: a } = Ve(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 Qe(e, t) {
205
- const a = e.style;
206
- for (const n in t)
207
- a[n] = t[n];
208
- }
209
- const Q = {
210
- hasPassive: !1,
211
- passiveCapture: !0,
212
- notPassiveCapture: !0
213
- };
214
- try {
215
- const e = Object.defineProperty({}, "passive", {
216
- get() {
217
- Object.assign(Q, {
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 Ye(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 Ge(e) {
239
- e.cancelable !== !1 && e.preventDefault();
240
- }
241
- function M(e) {
242
- e.cancelable !== !1 && e.preventDefault(), e.stopPropagation();
243
- }
244
- function He(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]], Q[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]], Q[n[3]]);
254
- }), e[a] = void 0);
255
- }
256
- function We(e) {
257
- return e !== Object(e) || e.isComposing === !0 || e.qKeyEvent === !0;
258
- }
259
- function W(e, t) {
260
- return We(e) === !0 ? !1 : [].concat(t).includes(e.keyCode);
261
- }
262
- function Xe(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"), l = document.createElement("span"), q = Ye(e), { left: b, top: s, width: h, height: o } = t.getBoundingClientRect(), y = Math.sqrt(h * h + o * o), p = y / 2, k = `${(h - y) / 2}px`, f = d ? k : `${q.left - b - p}px`, $ = `${(o - y) / 2}px`, P = d ? $ : `${q.top - s - p}px`;
276
- l.className = "q-ripple__inner", Qe(l, {
277
- height: `${y}px`,
278
- width: `${y}px`,
279
- transform: `translate3d(${f},${P},0) scale3d(.2,.2,1)`,
280
- opacity: 0
281
- }), c.className = `q-ripple${i ? " text-" + i : ""}`, c.setAttribute("dir", "ltr"), c.appendChild(l), t.appendChild(c);
282
- const x = () => {
283
- c.remove(), clearTimeout(w);
284
- };
285
- a.abort.push(x);
286
- let w = setTimeout(() => {
287
- l.classList.add("q-ripple__inner--enter"), l.style.transform = `translate3d(${k},${$},0) scale3d(1,1,1)`, l.style.opacity = 0.2, w = setTimeout(() => {
288
- l.classList.remove("q-ripple__inner--enter"), l.classList.add("q-ripple__inner--leave"), l.style.opacity = 0, w = setTimeout(() => {
289
- c.remove(), a.abort.splice(a.abort.indexOf(x), 1);
290
- }, 275);
291
- }, 250);
292
- }, 50);
293
- }
294
- function le(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 Ze = Me(
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: Xe((i) => {
320
- n.enabled === !0 && i.qSkipRipple !== !0 && W(i, n.modifiers.keyCodes) === !0 && i.type === `key${n.modifiers.early === !0 ? "down" : "up"}` && ie(i, e, n, !0);
321
- }, 300)
322
- };
323
- le(n, t), e.__qripple = n, He(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 && le(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
- ), he = {
344
- left: "start",
345
- center: "center",
346
- right: "end",
347
- between: "between",
348
- around: "around",
349
- evenly: "evenly",
350
- stretch: "stretch"
351
- }, Je = Object.keys(he), et = {
352
- align: {
353
- type: String,
354
- validator: (e) => Je.includes(e)
355
- }
356
- };
357
- function tt(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"}-${he[t]}`;
361
- });
362
- }
363
- function nt(e) {
364
- return e.appContext.config.globalProperties.$router !== void 0;
365
- }
366
- function oe(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 at(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 rt(e, t) {
387
- return Array.isArray(e) === !0 ? se(e, t) : Array.isArray(t) === !0 ? se(t, e) : e === t;
388
- }
389
- function it(e, t) {
390
- if (Object.keys(e).length !== Object.keys(t).length)
391
- return !1;
392
- for (const a in e)
393
- if (rt(e[a], t[a]) === !1)
394
- return !1;
395
- return !0;
396
- }
397
- const lt = {
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 ot({ fallbackTag: e, useDisableForRouterLinkProps: t = !0 } = {}) {
408
- const a = Z(), { props: n, proxy: i, emit: d } = a, c = nt(a), l = u(() => n.disable !== !0 && n.href !== void 0), q = t === !0 ? u(
409
- () => c === !0 && n.disable !== !0 && l.value !== !0 && n.to !== void 0 && n.to !== null && n.to !== ""
410
- ) : u(
411
- () => c === !0 && l.value !== !0 && n.to !== void 0 && n.to !== null && n.to !== ""
412
- ), b = u(() => q.value === !0 ? P(n.to) : null), s = u(() => b.value !== null), h = u(() => l.value === !0 || s.value === !0), o = u(() => n.type === "a" || h.value === !0 ? "a" : n.tag || e || "div"), y = u(() => l.value === !0 ? {
413
- href: n.href,
414
- target: n.target
415
- } : s.value === !0 ? {
416
- href: b.value.href,
417
- target: n.target
418
- } : {}), p = u(() => {
419
- if (s.value === !1)
420
- return -1;
421
- const { matched: g } = b.value, { length: E } = g, C = g[E - 1];
422
- if (C === void 0)
423
- return -1;
424
- const _ = i.$route.matched;
425
- if (_.length === 0)
426
- return -1;
427
- const R = _.findIndex(
428
- ue.bind(null, C)
429
- );
430
- if (R !== -1)
431
- return R;
432
- const K = oe(g[E - 2]);
433
- return (
434
- // we are dealing with nested routes
435
- E > 1 && oe(C) === K && _[_.length - 1].path !== K ? _.findIndex(
436
- ue.bind(null, g[E - 2])
437
- ) : R
438
- );
439
- }), k = u(
440
- () => s.value === !0 && p.value !== -1 && at(i.$route.params, b.value.params)
441
- ), f = u(
442
- () => k.value === !0 && p.value === i.$route.matched.length - 1 && it(i.$route.params, b.value.params)
443
- ), $ = u(() => s.value === !0 ? f.value === !0 ? ` ${n.exactActiveClass} ${n.activeClass}` : n.exact === !0 ? "" : k.value === !0 ? ` ${n.activeClass}` : "" : "");
444
- function P(g) {
445
- try {
446
- return i.$router.resolve(g);
447
- } catch {
448
- }
449
- return null;
450
- }
451
- function x(g, { returnRouterError: E, to: C = n.to, replace: _ = n.replace } = {}) {
452
- if (n.disable === !0)
453
- return g.preventDefault(), Promise.resolve(!1);
454
- if (
455
- // don't redirect with control keys;
456
- // should match RouterLink from Vue Router
457
- g.metaKey || g.altKey || g.ctrlKey || g.shiftKey || g.button !== void 0 && g.button !== 0 || n.target === "_blank"
458
- )
459
- return Promise.resolve(!1);
460
- g.preventDefault();
461
- const R = i.$router[_ === !0 ? "replace" : "push"](C);
462
- return E === !0 ? R : R.then(() => {
463
- }).catch(() => {
464
- });
465
- }
466
- function w(g) {
467
- if (s.value === !0) {
468
- const E = (C) => x(g, C);
469
- d("click", g, E), g.defaultPrevented !== !0 && E();
470
- } else
471
- d("click", g);
472
- }
473
- return {
474
- hasRouterLink: s,
475
- hasHrefLink: l,
476
- hasLink: h,
477
- linkTag: o,
478
- resolvedLink: b,
479
- linkIsActive: k,
480
- linkIsExactActive: f,
481
- linkClass: $,
482
- linkAttrs: y,
483
- getLink: P,
484
- navigateToRouterLink: x,
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
- }, ut = {
496
- xs: 8,
497
- sm: 10,
498
- md: 14,
499
- lg: 20,
500
- xl: 24
501
- }, st = ["button", "submit", "reset"], ct = /[^\s]\/[^\s]/, dt = ["flat", "outline", "push", "unelevated"];
502
- function ft(e, t) {
503
- return e.flat === !0 ? "flat" : e.outline === !0 ? "outline" : e.push === !0 ? "push" : e.unelevated === !0 ? "unelevated" : t;
504
- }
505
- const vt = {
506
- ...fe,
507
- ...lt,
508
- type: {
509
- type: String,
510
- default: "button"
511
- },
512
- label: [Number, String],
513
- icon: String,
514
- iconRight: String,
515
- ...dt.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
- ...et.align,
538
- default: "center"
539
- },
540
- stack: Boolean,
541
- stretch: Boolean,
542
- loading: {
543
- type: Boolean,
544
- default: null
545
- },
546
- disable: Boolean
547
- }, gt = {
548
- ...vt,
549
- round: Boolean
550
- };
551
- function mt(e) {
552
- const t = ve(e, ut), a = tt(e), { hasRouterLink: n, hasLink: i, linkTag: d, linkAttrs: c, navigateOnClick: l } = ot({
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
- }), b = u(
562
- () => e.rounded === !0 || e.fab === !0 || e.fabMini === !0
563
- ), s = u(
564
- () => e.disable !== !0 && e.loading !== !0
565
- ), h = u(() => s.value === !0 ? e.tabindex || 0 : -1), o = u(() => ft(e, "standard")), y = u(() => {
566
- const f = { tabindex: h.value };
567
- return i.value === !0 ? Object.assign(f, c.value) : st.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 && ct.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${b.value === !0 ? " q-btn--rounded" : e.square === !0 ? " q-btn--square" : ""}`;
577
- return `q-btn--${o.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: l,
589
- isActionable: s
590
- };
591
- }
592
- const { passiveCapture: L } = Q;
593
- let T = null, O = null, z = null;
594
- const pt = J({
595
- name: "QBtn",
596
- props: {
597
- ...gt,
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 } = Z(), {
605
- classes: i,
606
- style: d,
607
- innerClasses: c,
608
- attributes: l,
609
- hasLink: q,
610
- linkTag: b,
611
- navigateOnClick: s,
612
- isActionable: h
613
- } = mt(e), o = ee(null), y = ee(null);
614
- let p = null, k, f = null;
615
- const $ = u(
616
- () => e.label !== void 0 && e.label !== null && e.label !== ""
617
- ), P = u(() => e.disable === !0 || e.ripple === !1 ? !1 : {
618
- keyCodes: q.value === !0 ? [13, 32] : [13],
619
- ...e.ripple === !0 ? {} : e.ripple
620
- }), x = 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
- }), g = u(() => {
624
- if (e.loading === !0)
625
- return {
626
- onMousedown: j,
627
- onTouchstart: j,
628
- onClick: j,
629
- onKeydown: j,
630
- onKeyup: j
631
- };
632
- if (h.value === !0) {
633
- const r = {
634
- onClick: C,
635
- onKeydown: _,
636
- onMousedown: K
637
- };
638
- if (n.$q.platform.has.touch === !0) {
639
- const m = e.onTouchstart !== void 0 ? "" : "Passive";
640
- r[`onTouchstart${m}`] = R;
641
- }
642
- return r;
643
- }
644
- return {
645
- // needed; especially for disabled <a> tags
646
- onClick: M
647
- };
648
- }), E = u(() => ({
649
- ref: o,
650
- class: "q-btn q-btn-item non-selectable no-outline " + i.value,
651
- style: d.value,
652
- ...l.value,
653
- ...g.value
654
- }));
655
- function C(r) {
656
- if (o.value !== null) {
657
- if (r !== void 0) {
658
- if (r.defaultPrevented === !0)
659
- return;
660
- const m = document.activeElement;
661
- if (e.type === "submit" && m !== document.body && o.value.contains(m) === !1 && m.contains(o.value) === !1) {
662
- o.value.focus();
663
- const N = () => {
664
- document.removeEventListener("keydown", M, !0), document.removeEventListener("keyup", N, L), o.value !== null && o.value.removeEventListener("blur", N, L);
665
- };
666
- document.addEventListener("keydown", M, !0), document.addEventListener("keyup", N, L), o.value.addEventListener("blur", N, L);
667
- }
668
- }
669
- s(r);
670
- }
671
- }
672
- function _(r) {
673
- o.value !== null && (a("keydown", r), W(r, [13, 32]) === !0 && O !== o.value && (O !== null && A(), r.defaultPrevented !== !0 && (o.value.focus(), O = o.value, o.value.classList.add("q-btn--active"), document.addEventListener("keyup", S, !0), o.value.addEventListener("blur", S, L)), M(r)));
674
- }
675
- function R(r) {
676
- o.value !== null && (a("touchstart", r), r.defaultPrevented !== !0 && (T !== o.value && (T !== null && A(), T = o.value, p = r.target, p.addEventListener("touchcancel", S, L), p.addEventListener("touchend", S, L)), k = !0, f !== null && clearTimeout(f), f = setTimeout(() => {
677
- f = null, k = !1;
678
- }, 200)));
679
- }
680
- function K(r) {
681
- o.value !== null && (r.qSkipRipple = k === !0, a("mousedown", r), r.defaultPrevented !== !0 && z !== o.value && (z !== null && A(), z = o.value, o.value.classList.add("q-btn--active"), document.addEventListener("mouseup", S, L)));
682
- }
683
- function S(r) {
684
- if (o.value !== null && !(r !== void 0 && r.type === "blur" && document.activeElement === o.value)) {
685
- if (r !== void 0 && r.type === "keyup") {
686
- if (O === o.value && W(r, [13, 32]) === !0) {
687
- const m = new MouseEvent("click", r);
688
- m.qKeyEvent = !0, r.defaultPrevented === !0 && Ge(m), r.cancelBubble === !0 && be(m), o.value.dispatchEvent(m), M(r), r.qKeyEvent = !0;
689
- }
690
- a("keyup", r);
691
- }
692
- A();
693
- }
694
- }
695
- function A(r) {
696
- const m = y.value;
697
- r !== !0 && (T === o.value || z === o.value) && m !== null && m !== document.activeElement && (m.setAttribute("tabindex", -1), m.focus()), T === o.value && (p !== null && (p.removeEventListener("touchcancel", S, L), p.removeEventListener("touchend", S, L)), T = p = null), z === o.value && (document.removeEventListener("mouseup", S, L), z = null), O === o.value && (document.removeEventListener("keyup", S, !0), o.value !== null && o.value.removeEventListener("blur", S, L), O = null), o.value !== null && o.value.classList.remove("q-btn--active");
698
- }
699
- function j(r) {
700
- M(r), r.qSkipRipple = !0;
701
- }
702
- return ke(() => {
703
- A(!0);
704
- }), Object.assign(n, {
705
- click: (r) => {
706
- h.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
- })
716
- ), $.value === !0 && r.push(
717
- v("span", { class: "block" }, [e.label])
718
- ), r = D(t.default, r), e.iconRight !== void 0 && e.round === !1 && r.push(
719
- v(re, {
720
- name: e.iconRight,
721
- right: e.stack !== !0 && $.value === !0,
722
- role: "img"
723
- })
724
- );
725
- const m = [
726
- v("span", {
727
- class: "q-focus-helper",
728
- ref: y
729
- })
730
- ];
731
- return e.loading === !0 && e.percentage !== void 0 && m.push(
732
- v("span", {
733
- class: "q-btn__progress absolute-full overflow-hidden" + (e.darkPercentage === !0 ? " q-btn__progress--dark" : "")
734
- }, [
735
- v("span", {
736
- class: "q-btn__progress-indicator fit block",
737
- style: w.value
738
- })
739
- ])
740
- ), m.push(
741
- v("span", {
742
- class: "q-btn__content text-center col items-center q-anchor--skip " + c.value
743
- }, r)
744
- ), e.loading !== null && m.push(
745
- v($e, {
746
- name: "q-transition--fade"
747
- }, () => e.loading === !0 ? [
748
- v("span", {
749
- key: "loading",
750
- class: "absolute-full flex flex-center"
751
- }, t.loading !== void 0 ? t.loading() : [v(Fe)])
752
- ] : null)
753
- ), qe(
754
- v(
755
- b.value,
756
- E.value,
757
- m
758
- ),
759
- [[
760
- Ze,
761
- P.value,
762
- void 0,
763
- x.value
764
- ]]
765
- );
766
- };
767
- }
768
- }), bt = /* @__PURE__ */ X({
769
- __name: "index",
770
- props: {
771
- size: { default: B.MD },
772
- transparent: { type: Boolean },
773
- flat: { type: Boolean },
774
- rounded: { type: Boolean },
775
- color: { default: we.PRIMARY },
776
- iconLeft: {},
777
- iconRight: {},
778
- iconMiddle: {},
779
- disabled: { type: Boolean },
780
- loading: { type: Boolean },
781
- to: {},
782
- href: {},
783
- target: {},
784
- submit: { type: Boolean },
785
- ariaLabel: {},
786
- label: {}
787
- },
788
- emits: ["click"],
789
- setup(e) {
790
- const t = e, a = u(() => [
791
- "app-btn",
792
- {
793
- "app-btn_default": !t.transparent && !t.flat,
794
- "app-btn_trans": t.transparent,
795
- "app-btn_flat": t.flat,
796
- "app-btn_rounded": t.rounded,
797
- "app-btn_sm": t.size === B.SM,
798
- "app-btn_md": t.size === B.MD,
799
- "app-btn_lg": t.size === B.LG,
800
- "app-btn_icon-left": t.iconLeft,
801
- "app-btn_icon-right": t.iconRight,
802
- "app-btn_icon-middle": t.iconMiddle
803
- },
804
- `app-btn_${t.color}`
805
- ]);
806
- return (n, i) => (I(), Ee(Y(pt), {
807
- "no-caps": "",
808
- unelevated: "",
809
- class: V(a.value),
810
- padding: Y(Pe)[n.size || Y(B).MD],
811
- loading: n.loading,
812
- disable: n.disabled || void 0,
813
- to: n.to,
814
- href: n.href,
815
- target: n.target,
816
- type: n.submit ? "submit" : void 0,
817
- "aria-label": n.ariaLabel,
818
- onClick: i[0] || (i[0] = (d) => n.$emit("click", d))
819
- }, {
820
- default: Le(() => [
821
- n.iconLeft || n.iconMiddle ? (I(), F("i", {
822
- key: 0,
823
- class: V([
824
- "icon-kl",
825
- n.iconLeft ? "icon-kl_left" : "icon-kl_middle",
826
- `icon-kl-${n.iconLeft || n.iconMiddle}`,
827
- n.transparent || n.flat ? `text-${n.color}` : "text-secondary"
828
- ])
829
- }, null, 2)) : G("", !0),
830
- Ce(n.$slots, "default", {}, void 0, !0),
831
- n.label ? (I(), F(Se, { key: 1 }, [
832
- _e(Re(n.label), 1)
833
- ], 64)) : G("", !0),
834
- n.iconRight ? (I(), F("i", {
835
- key: 2,
836
- class: V([
837
- "icon-kl",
838
- "icon-kl_right",
839
- `icon-kl-${n.iconRight}`,
840
- n.transparent ? `text-${n.color}` : "text-secondary"
841
- ])
842
- }, null, 2)) : G("", !0)
843
- ]),
844
- _: 3
845
- }, 8, ["class", "padding", "loading", "disable", "to", "href", "target", "type", "aria-label"]));
846
- }
847
- }), ye = (e, t) => {
848
- const a = e.__vccOpts || e;
849
- for (const [n, i] of t)
850
- a[n] = i;
851
- return a;
852
- }, kt = /* @__PURE__ */ ye(bt, [["__scopeId", "data-v-ac94630a"]]), ht = /* @__PURE__ */ X({
853
- __name: "index",
854
- props: {
855
- name: {},
856
- size: {},
857
- color: {}
858
- },
859
- setup(e) {
860
- return (t, a) => (I(), F("i", {
861
- class: V(["icon-kl", `icon-kl-${t.name}`, t.color ? `text-${t.color}` : ""]),
862
- style: Be(t.size ? `font-size: ${t.size}` : void 0)
863
- }, null, 6));
864
- }
865
- }), $t = /* @__PURE__ */ ye(ht, [["__scopeId", "data-v-73419357"]]), qt = xe(
866
- () => import("./index-ChN-hiVg.js")
867
- );
868
- export {
869
- kt as A,
870
- we as C,
871
- qt as a,
872
- $t as i
873
- };