@base-framework/ui 1.2.15 → 1.2.17
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/dist/atoms.es.js +43 -45
- package/dist/bside-template-C7AQgQ6H.js +59 -0
- package/dist/confirmation-Dn9GDvhl.js +751 -0
- package/dist/full-page-BJUvF3X2.js +4587 -0
- package/dist/index.es.js +181 -187
- package/dist/molecules.es.js +47 -47
- package/dist/organisms.es.js +62 -63
- package/dist/pages.es.js +8 -8
- package/dist/{sidebar-menu-Dz2oh95a.js → sidebar-menu-BRTZ4oP4.js} +3 -3
- package/dist/{sidebar-menu-page-BImgFKeY.js → sidebar-menu-page-BfPM2fof.js} +14 -15
- package/dist/{signature-panel-h1ranAet.js → signature-panel-Bu-traik.js} +40 -42
- package/dist/templates.es.js +6 -7
- package/dist/types/components/atoms/buttons/toggle-button.d.ts +4 -1
- package/package.json +1 -1
- package/dist/aside-template-B9V-0xle.js +0 -48
- package/dist/bside-template-oLChzjxQ.js +0 -17
- package/dist/buttons-C-_NH7ie.js +0 -254
- package/dist/empty-state-BhxU7rkJ.js +0 -2151
- package/dist/full-page-CgVI1G7F.js +0 -69
- package/dist/image-XjAp5NjV.js +0 -255
- package/dist/mobile-nav-wrapper-C7cKTxaV.js +0 -499
- package/dist/simple-search-input-DBNmoBCn.js +0 -1730
- package/dist/tooltip-F0rUYr5J.js +0 -404
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Div as s } from "@base-framework/atoms";
|
|
2
|
-
import {
|
|
3
|
-
import { F as l, A as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
class p extends a {
|
|
2
|
+
import { d as a, a9 as i, ao as r, ad as n } from "./full-page-BJUvF3X2.js";
|
|
3
|
+
import { F as l, A as d } from "./bside-template-C7AQgQ6H.js";
|
|
4
|
+
import { S as c } from "./sidebar-menu-BRTZ4oP4.js";
|
|
5
|
+
class f extends a {
|
|
7
6
|
/**
|
|
8
7
|
* This will render the page.
|
|
9
8
|
*
|
|
@@ -16,7 +15,7 @@ class p extends a {
|
|
|
16
15
|
]);
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
class
|
|
18
|
+
class p extends a {
|
|
20
19
|
/**
|
|
21
20
|
* This will render the page.
|
|
22
21
|
*
|
|
@@ -42,7 +41,7 @@ class g extends a {
|
|
|
42
41
|
]);
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
class
|
|
44
|
+
class m extends r {
|
|
46
45
|
/**
|
|
47
46
|
* This will render the page.
|
|
48
47
|
*
|
|
@@ -53,7 +52,7 @@ class P extends r {
|
|
|
53
52
|
return s({ class: `flex flex-col flex-auto ${e}` }, this.children);
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
|
-
class
|
|
55
|
+
class P extends a {
|
|
57
56
|
/**
|
|
58
57
|
* This will declare the props for the compiler.
|
|
59
58
|
*
|
|
@@ -73,7 +72,7 @@ class S extends a {
|
|
|
73
72
|
route: this.addRoutes()
|
|
74
73
|
},
|
|
75
74
|
[
|
|
76
|
-
|
|
75
|
+
d({
|
|
77
76
|
left: this.addSidebar(),
|
|
78
77
|
right: this.addBody()
|
|
79
78
|
})
|
|
@@ -125,14 +124,14 @@ class S extends a {
|
|
|
125
124
|
addNavigation() {
|
|
126
125
|
const e = this.getLinks();
|
|
127
126
|
return [
|
|
128
|
-
|
|
127
|
+
c(
|
|
129
128
|
{
|
|
130
129
|
title: this.title,
|
|
131
130
|
options: e,
|
|
132
131
|
class: "hidden lg:flex"
|
|
133
132
|
}
|
|
134
133
|
),
|
|
135
|
-
|
|
134
|
+
n({ title: this.title, options: e })
|
|
136
135
|
];
|
|
137
136
|
}
|
|
138
137
|
/**
|
|
@@ -145,9 +144,9 @@ class S extends a {
|
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
146
|
export {
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
f as B,
|
|
148
|
+
p as C,
|
|
150
149
|
g as F,
|
|
151
|
-
S,
|
|
152
|
-
|
|
150
|
+
P as S,
|
|
151
|
+
m as a
|
|
153
152
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Div as l, Button as b, On as j, Span as T, Nav as f, Ul as p, Section as y, Li as w, Canvas as z } from "@base-framework/atoms";
|
|
2
|
-
import { Component as k, Data as
|
|
3
|
-
import {
|
|
2
|
+
import { Component as k, Data as U, DateTime as I, router as v, NavLink as S, base as L, Dom as B } from "@base-framework/base";
|
|
3
|
+
import { f as C, an as A, aU as u, $ as F } from "./full-page-BJUvF3X2.js";
|
|
4
4
|
import { Icons as D } from "./icons.es.js";
|
|
5
|
-
import { O as A } from "./simple-search-input-DBNmoBCn.js";
|
|
6
|
-
import { V as u, H as F } from "./image-XjAp5NjV.js";
|
|
7
5
|
import { IntervalTimer as O } from "@base-framework/organisms";
|
|
8
|
-
class
|
|
6
|
+
class Lt extends k {
|
|
9
7
|
/**
|
|
10
8
|
* This will declare the props for the compiler.
|
|
11
9
|
*
|
|
@@ -52,7 +50,7 @@ const Y = (s) => {
|
|
|
52
50
|
a.setDate(e.getDate() - i);
|
|
53
51
|
const n = new Date(a);
|
|
54
52
|
return n.setDate(a.getDate() + (s - 1) * 7), n;
|
|
55
|
-
},
|
|
53
|
+
}, Bt = (s, t) => {
|
|
56
54
|
const e = new Date(s, t, 1).getDay(), i = new Date(s, t + 1, 0).getDate(), a = [];
|
|
57
55
|
let n = [];
|
|
58
56
|
for (let o = 1 - e; o <= i; o++) {
|
|
@@ -60,17 +58,17 @@ const Y = (s) => {
|
|
|
60
58
|
n.push(o > 0 ? h : null), (n.length === 7 || o === i) && (a.push([...n]), n = []);
|
|
61
59
|
}
|
|
62
60
|
return a;
|
|
63
|
-
},
|
|
61
|
+
}, Pt = (s, t) => {
|
|
64
62
|
const e = new Date(s, t + 1, 0).getDate(), i = [];
|
|
65
63
|
let a = [];
|
|
66
64
|
for (let n = 1; n <= e; n++)
|
|
67
65
|
a.push(new Date(s, t, n)), a.length === 7 && (i.push(a), a = []);
|
|
68
66
|
return a.length > 0 && i.push(a), i;
|
|
69
|
-
},
|
|
67
|
+
}, X = (s, t, e) => {
|
|
70
68
|
const i = /* @__PURE__ */ new Date();
|
|
71
69
|
return i.getDate() === s && i.getMonth() === t && i.getFullYear() === e;
|
|
72
|
-
},
|
|
73
|
-
const n =
|
|
70
|
+
}, V = ({ day: s, month: t, year: e, weekNumber: i, selectWeek: a }) => {
|
|
71
|
+
const n = X(s, t, e);
|
|
74
72
|
return b({
|
|
75
73
|
text: s || "",
|
|
76
74
|
disabled: !s,
|
|
@@ -81,7 +79,7 @@ const Y = (s) => {
|
|
|
81
79
|
`,
|
|
82
80
|
click: () => a(i, e)
|
|
83
81
|
});
|
|
84
|
-
},
|
|
82
|
+
}, q = (s, t) => {
|
|
85
83
|
const e = new Date(s, t, 1).getDay(), i = new Date(s, t + 1, 0).getDate(), a = E(s, t, e), n = Array.from({ length: i }, (c, m) => new Date(s, t, m + 1)), o = (a.length + n.length) % 7, h = o === 0 ? 0 : 7 - o, r = G(s, t, h), d = [...a, ...n, ...r], g = [];
|
|
86
84
|
for (let c = 0; c < d.length; c += 7) {
|
|
87
85
|
const m = d.slice(c, c + 7), x = m.find((N) => N) || new Date(s, t, 1), { weekNumber: M, year: $ } = R(x);
|
|
@@ -92,8 +90,8 @@ const Y = (s) => {
|
|
|
92
90
|
});
|
|
93
91
|
}
|
|
94
92
|
return g;
|
|
95
|
-
},
|
|
96
|
-
const { year: a, month: n, currentDate: o } = i, h =
|
|
93
|
+
}, H = ({ selectWeek: s }) => j("month", (t, e, { data: i }) => {
|
|
94
|
+
const { year: a, month: n, currentDate: o } = i, h = q(a, n);
|
|
97
95
|
return l(
|
|
98
96
|
{ class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
|
|
99
97
|
[
|
|
@@ -130,7 +128,7 @@ const Y = (s) => {
|
|
|
130
128
|
l(
|
|
131
129
|
{ class: "grid grid-cols-7 col-span-7 text-center" },
|
|
132
130
|
d.map(
|
|
133
|
-
(c) =>
|
|
131
|
+
(c) => V({
|
|
134
132
|
year: c?.getFullYear() || null,
|
|
135
133
|
month: c?.getMonth() || null,
|
|
136
134
|
day: c?.getDate() || null,
|
|
@@ -167,7 +165,7 @@ const Y = (s) => {
|
|
|
167
165
|
click: s
|
|
168
166
|
})
|
|
169
167
|
]);
|
|
170
|
-
class
|
|
168
|
+
class Wt extends k {
|
|
171
169
|
/**
|
|
172
170
|
* This will declare the props for the compiler.
|
|
173
171
|
*
|
|
@@ -183,7 +181,7 @@ class Ct extends k {
|
|
|
183
181
|
*/
|
|
184
182
|
setData() {
|
|
185
183
|
const t = /* @__PURE__ */ new Date(), e = this.selectedWeek || this.calculateCurrentWeek(t), i = P(e, t.getFullYear());
|
|
186
|
-
return new
|
|
184
|
+
return new U({
|
|
187
185
|
monthName: this.getMonthName(i.getMonth()),
|
|
188
186
|
year: i.getFullYear(),
|
|
189
187
|
month: i.getMonth(),
|
|
@@ -220,7 +218,7 @@ class Ct extends k {
|
|
|
220
218
|
* @returns {string}
|
|
221
219
|
*/
|
|
222
220
|
getMonthName(t) {
|
|
223
|
-
return
|
|
221
|
+
return I.monthNames[t];
|
|
224
222
|
}
|
|
225
223
|
/**
|
|
226
224
|
* Updates the calendar to show the previous month.
|
|
@@ -279,7 +277,7 @@ class Ct extends k {
|
|
|
279
277
|
next: () => this.goToNextMonth(),
|
|
280
278
|
previous: () => this.goToPreviousMonth()
|
|
281
279
|
}),
|
|
282
|
-
|
|
280
|
+
H({
|
|
283
281
|
selectWeek: (t, e) => this.selectWeek(t, e)
|
|
284
282
|
})
|
|
285
283
|
]);
|
|
@@ -292,7 +290,7 @@ const J = (s, t) => t.includes(s), K = (s, t, e) => s.exact ? e === t : J(t, e),
|
|
|
292
290
|
dataSet: ["selected", ["state", !0, "active"]],
|
|
293
291
|
class: `${i ? "hidden" : "inline-flex"} items-center justify-center whitespace-nowrap px-3 py-1.5 text-sm font-medium transition-all rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring focus-visible:ring-offset-background hover:bg-primary hover:text-primary-foreground disabled:opacity-50 disabled:pointer-events-none data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm`
|
|
294
292
|
});
|
|
295
|
-
class
|
|
293
|
+
class Tt extends k {
|
|
296
294
|
/**
|
|
297
295
|
* This will declare the props for the compiler.
|
|
298
296
|
*
|
|
@@ -391,7 +389,7 @@ class Mt extends k {
|
|
|
391
389
|
this.links = [];
|
|
392
390
|
}
|
|
393
391
|
}
|
|
394
|
-
class
|
|
392
|
+
class Ct extends A {
|
|
395
393
|
/**
|
|
396
394
|
* This will get the overlay type.
|
|
397
395
|
*
|
|
@@ -425,7 +423,7 @@ const Z = (s) => w(
|
|
|
425
423
|
), tt = (s, t) => (s.callBack = t, Z(s)), et = (s) => f({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${s.class}` }, [
|
|
426
424
|
p({ class: "flex flex-auto flex-row", map: [s.options, (t) => tt(t, s.callBack)] })
|
|
427
425
|
]);
|
|
428
|
-
class
|
|
426
|
+
class Mt extends u {
|
|
429
427
|
/**
|
|
430
428
|
* This will declare the props for the compiler.
|
|
431
429
|
*
|
|
@@ -530,7 +528,7 @@ const st = (s) => w(
|
|
|
530
528
|
), it = (s, t) => (s.callBack = t, st(s)), at = (s) => f({ class: `tab items-center justify-center rounded-md bg-muted p-1 text-muted-foreground ${s.class}` }, [
|
|
531
529
|
p({ class: "flex flex-auto flex-row", map: [s.options, (t) => it(t, s.callBack)] })
|
|
532
530
|
]);
|
|
533
|
-
class
|
|
531
|
+
class $t extends u {
|
|
534
532
|
/**
|
|
535
533
|
* This will declare the props for the compiler.
|
|
536
534
|
*
|
|
@@ -678,7 +676,7 @@ class lt extends u {
|
|
|
678
676
|
this.links = [];
|
|
679
677
|
}
|
|
680
678
|
}
|
|
681
|
-
class
|
|
679
|
+
class Nt extends u {
|
|
682
680
|
/**
|
|
683
681
|
* This will declare the props for the compiler.
|
|
684
682
|
*
|
|
@@ -740,7 +738,7 @@ const ct = (s) => w(
|
|
|
740
738
|
), ht = (s, t) => (s.callBack = t, ct(s)), dt = (s) => f({ class: `border-b border-border ${s.class}` }, [
|
|
741
739
|
p({ class: "flex flex-row items-center", map: [s.options, (t) => ht(t, s.callBack)] })
|
|
742
740
|
]);
|
|
743
|
-
class
|
|
741
|
+
class jt extends u {
|
|
744
742
|
/**
|
|
745
743
|
* This will declare the props for the compiler.
|
|
746
744
|
*
|
|
@@ -836,7 +834,7 @@ const ut = (s) => w(
|
|
|
836
834
|
), ft = (s, t) => (s.callBack = t, ut(s)), pt = (s) => f({ class: `border-b border-border ${s.class}` }, [
|
|
837
835
|
p({ class: "flex flex-row items-center", map: [s.options, (t) => ft(t, s.callBack)] })
|
|
838
836
|
]);
|
|
839
|
-
class
|
|
837
|
+
class zt extends u {
|
|
840
838
|
/**
|
|
841
839
|
* This will declare the props for the compiler.
|
|
842
840
|
*
|
|
@@ -984,7 +982,7 @@ class bt extends u {
|
|
|
984
982
|
this.links = [];
|
|
985
983
|
}
|
|
986
984
|
}
|
|
987
|
-
class
|
|
985
|
+
class Ut extends u {
|
|
988
986
|
/**
|
|
989
987
|
* This will declare the props for the compiler.
|
|
990
988
|
*
|
|
@@ -1257,7 +1255,7 @@ class kt extends k {
|
|
|
1257
1255
|
this.timer.stop(), this.status = "stopped";
|
|
1258
1256
|
}
|
|
1259
1257
|
}
|
|
1260
|
-
class
|
|
1258
|
+
class It extends k {
|
|
1261
1259
|
/**
|
|
1262
1260
|
* Sets up default properties for the signature panel.
|
|
1263
1261
|
*
|
|
@@ -1344,26 +1342,26 @@ class Ft extends k {
|
|
|
1344
1342
|
}
|
|
1345
1343
|
}
|
|
1346
1344
|
export {
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1345
|
+
Mt as B,
|
|
1346
|
+
Ct as I,
|
|
1347
|
+
Tt as N,
|
|
1348
|
+
Lt as P,
|
|
1349
|
+
It as S,
|
|
1350
|
+
Nt as T,
|
|
1351
|
+
jt as U,
|
|
1352
|
+
Wt as W,
|
|
1353
|
+
$t as a,
|
|
1356
1354
|
lt as b,
|
|
1357
|
-
|
|
1358
|
-
|
|
1355
|
+
Ut as c,
|
|
1356
|
+
zt as d,
|
|
1359
1357
|
bt as e,
|
|
1360
|
-
|
|
1361
|
-
|
|
1358
|
+
V as f,
|
|
1359
|
+
H as g,
|
|
1362
1360
|
_ as h,
|
|
1363
1361
|
R as i,
|
|
1364
|
-
|
|
1362
|
+
Bt as j,
|
|
1365
1363
|
P as k,
|
|
1366
|
-
|
|
1364
|
+
Pt as l,
|
|
1367
1365
|
G as m,
|
|
1368
1366
|
E as n
|
|
1369
1367
|
};
|
package/dist/templates.es.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { A as s,
|
|
2
|
-
import { B as T } from "./bside-template-oLChzjxQ.js";
|
|
1
|
+
import { A as s, B as l, F as m, M as p, T, a as t } from "./bside-template-C7AQgQ6H.js";
|
|
3
2
|
export {
|
|
4
3
|
s as AsideTemplate,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
l as BsideTemplate,
|
|
5
|
+
m as FullTemplate,
|
|
6
|
+
p as MainColumn,
|
|
7
|
+
T as Template,
|
|
8
|
+
t as TopBar
|
|
10
9
|
};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* // Reactive value from parent data (watches `likeCount` key)
|
|
15
15
|
* new ToggleButton({ icon: Icons.heart, dataKey: 'likeCount', toggle: (active) => {} })
|
|
16
16
|
*/
|
|
17
|
-
export class ToggleButton extends
|
|
17
|
+
export class ToggleButton extends Veil {
|
|
18
18
|
/** @type {string|null} SVG icon string for the inactive state */
|
|
19
19
|
icon: string | null;
|
|
20
20
|
/** @type {string|null} SVG icon string for the active state. Falls back to `icon` when not set. */
|
|
@@ -29,6 +29,8 @@ export class ToggleButton extends Component {
|
|
|
29
29
|
toggle: Function | null;
|
|
30
30
|
/** @type {string} Icon size: xs | sm | md | lg */
|
|
31
31
|
size: string;
|
|
32
|
+
/** @type {string} the format type for the value: 'number' | 'string' */
|
|
33
|
+
formatType: string;
|
|
32
34
|
/**
|
|
33
35
|
* Set up internal states.
|
|
34
36
|
*
|
|
@@ -101,4 +103,5 @@ export class CircleToggleButton extends Component {
|
|
|
101
103
|
* CircleButton({ icon: Icons.arrows.left, size: 'md', click: () => {} })
|
|
102
104
|
*/
|
|
103
105
|
export const CircleButton: (...args: any[]) => object;
|
|
106
|
+
import { Veil } from '../veil.js';
|
|
104
107
|
import { Component } from '@base-framework/base';
|
package/package.json
CHANGED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Atom as t } from "@base-framework/base";
|
|
2
|
-
import { Header as c, H1 as o } from "@base-framework/atoms";
|
|
3
|
-
const x = t((l, e) => ({
|
|
4
|
-
tag: "section",
|
|
5
|
-
...l,
|
|
6
|
-
children: e
|
|
7
|
-
})), u = t((l, e) => x({
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
class: "body full-container flex flex-auto flex-col " + l.class,
|
|
10
|
-
...l
|
|
11
|
-
}, e)), n = t((l, e) => {
|
|
12
|
-
const a = l.flex ? l.flex : "flex flex-auto flex-col lg:flex-row";
|
|
13
|
-
return l.class = "row " + a + " " + (l.class || ""), {
|
|
14
|
-
...l,
|
|
15
|
-
children: e
|
|
16
|
-
};
|
|
17
|
-
}), m = t((l, e) => c([
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
o({ watch: l.watch }, l.text)
|
|
20
|
-
], e)), f = t((l, e) => {
|
|
21
|
-
const a = l.flex ? "flex flex-none" : "flex flex-auto flex-col";
|
|
22
|
-
return l.class = "col " + a + " " + (l.class || ""), {
|
|
23
|
-
...l,
|
|
24
|
-
children: e
|
|
25
|
-
};
|
|
26
|
-
}), i = t((l, e) => x({ class: "body aside-container flex flex-auto flex-col max-w-[100vw] h-full" }, [
|
|
27
|
-
n([
|
|
28
|
-
f({
|
|
29
|
-
class: "drawer control w-full md:max-w-[320px]",
|
|
30
|
-
flex: "flex flex-none md:flex-auto flex-col"
|
|
31
|
-
}, [
|
|
32
|
-
// @ts-ignore
|
|
33
|
-
l.left
|
|
34
|
-
]),
|
|
35
|
-
f([
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
l.right
|
|
38
|
-
])
|
|
39
|
-
])
|
|
40
|
-
]));
|
|
41
|
-
export {
|
|
42
|
-
i as A,
|
|
43
|
-
u as F,
|
|
44
|
-
f as M,
|
|
45
|
-
n as R,
|
|
46
|
-
x as T,
|
|
47
|
-
m as a
|
|
48
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Atom as t } from "@base-framework/base";
|
|
2
|
-
import { T as a, R as l, M as o } from "./aside-template-B9V-0xle.js";
|
|
3
|
-
const s = t((e, r) => a({ class: "body bside-container flex flex-auto flex-col" }, [
|
|
4
|
-
l([
|
|
5
|
-
o([
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
e.left
|
|
8
|
-
]),
|
|
9
|
-
o([
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
e.right
|
|
12
|
-
])
|
|
13
|
-
])
|
|
14
|
-
]));
|
|
15
|
-
export {
|
|
16
|
-
s as B
|
|
17
|
-
};
|
package/dist/buttons-C-_NH7ie.js
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { I as S, Span as h, Button as r, OnState as y, On as T } from "@base-framework/atoms";
|
|
2
|
-
import { Atom as i, Component as k } from "@base-framework/base";
|
|
3
|
-
import { Icons as C } from "./icons.es.js";
|
|
4
|
-
const V = {
|
|
5
|
-
xs: "w-4 h-4",
|
|
6
|
-
sm: "w-6 h-6",
|
|
7
|
-
md: "w-8 h-8",
|
|
8
|
-
lg: "w-10 h-10",
|
|
9
|
-
xl: "w-12 h-12",
|
|
10
|
-
"2xl": "w-14 h-14",
|
|
11
|
-
"3xl": "w-16 h-16"
|
|
12
|
-
}, f = i((s, t) => {
|
|
13
|
-
const n = V[s.size || "sm"];
|
|
14
|
-
return S({
|
|
15
|
-
...s,
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
class: `stroke-current icon-size ${n} ${s.class || ""}`,
|
|
18
|
-
html: t[0]?.textContent
|
|
19
|
-
});
|
|
20
|
-
}), m = {
|
|
21
|
-
xs: "w-4 h-4",
|
|
22
|
-
// 16px - matches Icon
|
|
23
|
-
sm: "w-6 h-6",
|
|
24
|
-
// 24px - matches Icon
|
|
25
|
-
md: "w-8 h-8",
|
|
26
|
-
// 32px - matches Icon
|
|
27
|
-
lg: "w-10 h-10",
|
|
28
|
-
// 40px - matches Icon
|
|
29
|
-
xl: "w-12 h-12",
|
|
30
|
-
// 48px - matches Icon
|
|
31
|
-
"2xl": "w-14 h-14",
|
|
32
|
-
// 56px - matches Icon
|
|
33
|
-
"3xl": "w-16 h-16"
|
|
34
|
-
// 64px - matches Icon
|
|
35
|
-
}, b = {
|
|
36
|
-
xs: "16px",
|
|
37
|
-
sm: "24px",
|
|
38
|
-
md: "32px",
|
|
39
|
-
lg: "40px",
|
|
40
|
-
xl: "48px",
|
|
41
|
-
"2xl": "56px",
|
|
42
|
-
"3xl": "64px"
|
|
43
|
-
}, v = {
|
|
44
|
-
outlined: "material-symbols-outlined",
|
|
45
|
-
filled: "material-symbols-filled",
|
|
46
|
-
rounded: "material-symbols-rounded",
|
|
47
|
-
sharp: "material-symbols-sharp"
|
|
48
|
-
}, x = i((s) => {
|
|
49
|
-
const t = s.size || "sm", n = s.variant || "outlined", e = m[t] || m.sm, l = b[t] || b.sm, c = v[n] || v.outlined;
|
|
50
|
-
return h({
|
|
51
|
-
...s,
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
class: `inline-flex items-center justify-center ${c} ${e} ${s.class || ""}`,
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
style: `font-size: ${l}; ${s.style || ""}`,
|
|
56
|
-
// Remove props that shouldn't be passed to the DOM element
|
|
57
|
-
size: void 0,
|
|
58
|
-
variant: void 0,
|
|
59
|
-
name: void 0
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
}, s.name);
|
|
62
|
-
}), o = (s = {}, t) => t ? typeof t == "string" && t.includes("<svg") ? f(s, t) : typeof t == "object" && t.name ? x({
|
|
63
|
-
...s,
|
|
64
|
-
name: t.name,
|
|
65
|
-
variant: t.variant || s.variant || "outlined"
|
|
66
|
-
}) : typeof t == "string" ? x({
|
|
67
|
-
...s,
|
|
68
|
-
name: t
|
|
69
|
-
}) : f(s, t) : null, O = (s) => s ? !!(typeof s == "object" && s.name || typeof s == "string" && !s.includes("<svg")) : !1, E = (s) => typeof s == "string" && s.includes("<svg");
|
|
70
|
-
class H extends k {
|
|
71
|
-
/**
|
|
72
|
-
* Declare public props and their defaults.
|
|
73
|
-
*/
|
|
74
|
-
declareProps() {
|
|
75
|
-
this.icon = null, this.activeIcon = null, this.value = null, this.dataKey = null, this.active = !1, this.toggle = null, this.size = "sm";
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Set up internal states.
|
|
79
|
-
*
|
|
80
|
-
* @returns {object}
|
|
81
|
-
*/
|
|
82
|
-
setupStates() {
|
|
83
|
-
return {
|
|
84
|
-
active: this.active ?? !1
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Toggle the active state and fire the callback.
|
|
89
|
-
*
|
|
90
|
-
* @returns {void}
|
|
91
|
-
*/
|
|
92
|
-
handleToggle() {
|
|
93
|
-
this.state.active = !this.state.active, typeof this.toggle == "function" && this.toggle(this.state.active);
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Render the toggle button.
|
|
97
|
-
*
|
|
98
|
-
* @returns {object}
|
|
99
|
-
*/
|
|
100
|
-
render() {
|
|
101
|
-
const t = this.size, n = this.icon, e = this.activeIcon || this.icon, l = this.dataKey ? h({ class: "toggle-btn-value text-sm tabular-nums" }, [
|
|
102
|
-
T(this.dataKey, (c) => String(c))
|
|
103
|
-
]) : this.value !== null && this.value !== void 0 ? h({ class: "toggle-btn-value text-sm tabular-nums" }, String(this.value)) : null;
|
|
104
|
-
return r({
|
|
105
|
-
click: () => this.handleToggle(),
|
|
106
|
-
// @ts-ignore
|
|
107
|
-
class: `toggle-btn inline-flex items-center gap-1.5 bg-transparent border-0 p-0 cursor-pointer text-foreground/70 hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${this.class || ""}`
|
|
108
|
-
}, [
|
|
109
|
-
y(
|
|
110
|
-
"active",
|
|
111
|
-
(c) => o({ size: t }, c ? e : n)
|
|
112
|
-
),
|
|
113
|
-
l
|
|
114
|
-
]);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
const u = {
|
|
118
|
-
xs: "w-6 h-6",
|
|
119
|
-
sm: "w-8 h-8",
|
|
120
|
-
md: "w-10 h-10",
|
|
121
|
-
lg: "w-12 h-12",
|
|
122
|
-
xl: "w-14 h-14",
|
|
123
|
-
"2xl": "w-16 h-16"
|
|
124
|
-
};
|
|
125
|
-
class _ extends k {
|
|
126
|
-
/**
|
|
127
|
-
* Declare public props.
|
|
128
|
-
*/
|
|
129
|
-
declareProps() {
|
|
130
|
-
this.icon = null, this.activeIcon = null, this.active = !1, this.size = "md", this.activeClass = "", this.toggle = null;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Set up internal states.
|
|
134
|
-
*
|
|
135
|
-
* @returns {object}
|
|
136
|
-
*/
|
|
137
|
-
setupStates() {
|
|
138
|
-
return {
|
|
139
|
-
active: this.active ?? !1
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Toggle active state and fire callback.
|
|
144
|
-
*
|
|
145
|
-
* @returns {void}
|
|
146
|
-
*/
|
|
147
|
-
handleToggle() {
|
|
148
|
-
this.state.active = !this.state.active, typeof this.toggle == "function" && this.toggle(this.state.active);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Render the circular toggle button.
|
|
152
|
-
*
|
|
153
|
-
* @returns {object}
|
|
154
|
-
*/
|
|
155
|
-
render() {
|
|
156
|
-
const t = this.icon, n = this.activeIcon || this.icon, e = u[this.size] || u.md, l = ["xs", "sm"].includes(this.size) ? "xs" : "sm", c = this.class ?? "bg-background/40 backdrop-blur-sm", d = "text-foreground", $ = this.activeClass || d, B = this.circle ?? !1;
|
|
157
|
-
return r({
|
|
158
|
-
click: () => this.handleToggle(),
|
|
159
|
-
// @ts-ignore
|
|
160
|
-
class: `circle-toggle-btn inline-flex items-center justify-center rounded-full border-0 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 ${e} ${c}${B ? " rounded-full w-[40px] h-[40px] max-w-[40px]" : ""}`
|
|
161
|
-
}, [
|
|
162
|
-
y("active", (g) => [
|
|
163
|
-
o({
|
|
164
|
-
size: l,
|
|
165
|
-
class: `transition-colors ${g ? $ : d}`
|
|
166
|
-
}, g ? n : t)
|
|
167
|
-
])
|
|
168
|
-
]);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
const R = i((s, t) => {
|
|
172
|
-
const n = s.size || "md", e = u[n] || u.md, l = ["xs", "sm"].includes(n) ? "xs" : "sm";
|
|
173
|
-
return r({
|
|
174
|
-
...s,
|
|
175
|
-
// @ts-ignore
|
|
176
|
-
class: `circle-btn inline-flex items-center justify-center rounded-full border-0 bg-background/40 backdrop-blur-sm text-foreground cursor-pointer transition-colors hover:bg-background/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 ${e} ${s.class || ""}`
|
|
177
|
-
}, [
|
|
178
|
-
// @ts-ignore
|
|
179
|
-
s.icon ? o({ size: l }, s.icon) : null,
|
|
180
|
-
...t || []
|
|
181
|
-
]);
|
|
182
|
-
}), a = (s) => i((t, n) => r({
|
|
183
|
-
...s,
|
|
184
|
-
...t,
|
|
185
|
-
// @ts-ignore
|
|
186
|
-
class: `bttn ${s.class} ${t.class || ""}`
|
|
187
|
-
}, n)), I = i(
|
|
188
|
-
(s, t) => r({
|
|
189
|
-
...s,
|
|
190
|
-
// @ts-ignore
|
|
191
|
-
class: s.class
|
|
192
|
-
}, [
|
|
193
|
-
// @ts-ignore
|
|
194
|
-
s.icon && s.position !== "right" ? o({ size: s.size || "sm", class: s.animation ?? null }, s.icon) : null,
|
|
195
|
-
...t || [],
|
|
196
|
-
// @ts-ignore
|
|
197
|
-
s.icon && s.position === "right" ? o({ size: s.size || "sm", class: s.animation ?? null }, s.icon) : null
|
|
198
|
-
])
|
|
199
|
-
), w = (s) => i((t, n) => I({
|
|
200
|
-
...s,
|
|
201
|
-
...t,
|
|
202
|
-
// @ts-ignore
|
|
203
|
-
class: `bttn ${s.class} ${t.class || ""}`
|
|
204
|
-
}, n)), j = (s) => () => {
|
|
205
|
-
if (s.allowHistory === !0 && globalThis.history.length > 2) {
|
|
206
|
-
globalThis.history.back();
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
s.backUrl && app.navigate(s.backUrl);
|
|
210
|
-
}, U = (s) => i((t, n) => (t.icon = t.icon || C.arrows.left, t.click = t.click || j(t), I({
|
|
211
|
-
...s,
|
|
212
|
-
...t
|
|
213
|
-
}, n))), A = i((s, t) => {
|
|
214
|
-
const n = s.size || "md", e = {
|
|
215
|
-
xs: "w-6 h-6",
|
|
216
|
-
sm: "w-8 h-8",
|
|
217
|
-
md: "w-10 h-10",
|
|
218
|
-
lg: "w-12 h-12",
|
|
219
|
-
xl: "w-14 h-14"
|
|
220
|
-
}, l = s.backgroundClass || "bg-background/30 hover:bg-background/50";
|
|
221
|
-
return r({
|
|
222
|
-
...s,
|
|
223
|
-
// @ts-ignore
|
|
224
|
-
class: `circle-icon-btn inline-flex items-center justify-center rounded-full ${l} text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ring-offset-background transition-colors disabled:pointer-events-none disabled:opacity-50 cursor-pointer ${e[n] || e.md} ${s.class || ""}`
|
|
225
|
-
}, [
|
|
226
|
-
// @ts-ignore
|
|
227
|
-
s.icon ? o({ size: n === "xs" ? "xs" : "sm" }, s.icon) : null,
|
|
228
|
-
...t || []
|
|
229
|
-
]);
|
|
230
|
-
}), z = {
|
|
231
|
-
primary: a({ class: "primary" }),
|
|
232
|
-
secondary: a({ class: "secondary" }),
|
|
233
|
-
destructive: a({ class: "destructive" }),
|
|
234
|
-
warning: a({ class: "warning" }),
|
|
235
|
-
outline: a({ class: "outline" }),
|
|
236
|
-
ghost: a({ class: "ghost" }),
|
|
237
|
-
link: a({ class: "link" }),
|
|
238
|
-
icon: w({ class: "icon" }),
|
|
239
|
-
withIcon: w({ class: "with-icon" }),
|
|
240
|
-
back: U({ class: "with-icon back-button" }),
|
|
241
|
-
circleIcon: A
|
|
242
|
-
}, K = i((s, t) => (z[s.variant] || z.primary)(s, t)), W = i((s, t) => K({ ...s, variant: "withIcon", icon: C.loading, animation: "animate-spin" }, t));
|
|
243
|
-
export {
|
|
244
|
-
K as B,
|
|
245
|
-
R as C,
|
|
246
|
-
f as I,
|
|
247
|
-
W as L,
|
|
248
|
-
x as M,
|
|
249
|
-
H as T,
|
|
250
|
-
o as U,
|
|
251
|
-
_ as a,
|
|
252
|
-
O as b,
|
|
253
|
-
E as i
|
|
254
|
-
};
|