@selfeesas/shared-components 0.1.8

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