@base-framework/ui 1.0.309 → 1.0.311
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/{empty-state-vu_Mhyk4.js → empty-state-KpaoE_8g.js} +260 -185
- package/dist/index.es.js +111 -110
- package/dist/molecules.es.js +35 -34
- package/dist/organisms.es.js +1 -1
- package/dist/{signature-panel-DLdOUJcV.js → signature-panel-CIjDPXqA.js} +147 -147
- package/dist/types/components/molecules/image/image-uploader.d.ts +9 -0
- package/dist/types/components/molecules/molecules.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Div as l, H5 as
|
|
2
|
-
import { Atom as c, Component as w, Html as
|
|
3
|
-
import { P as
|
|
1
|
+
import { Div as l, H5 as X, P as g, I as p, Li as q, Span as a, Ul as H, Button as f, OnState as I, Label as A, H2 as C, Form as Z, Header as $, Footer as P, A as Y, H3 as ee, Checkbox as te, Input as b, Img as _, Nav as se, UseParent as W, OnStateOpen as M, Time as oe, Dialog as le } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as c, Component as w, Html as j, Dom as ne, base as re, Data as F, Builder as G, Jot as v, Events as k, DateTime as L } from "@base-framework/base";
|
|
3
|
+
import { P as S, b as ie, R as ae } from "./range-calendar-CnBylqhu.js";
|
|
4
4
|
import { C as ce, F as ue, a as y } from "./veil-CVCuKSvj.js";
|
|
5
|
-
import { B as h, I as
|
|
6
|
-
import { Icons as
|
|
5
|
+
import { B as h, I as m } from "./buttons-CHEs54Wl.js";
|
|
6
|
+
import { Icons as u } from "./icons.es.js";
|
|
7
7
|
import { Timer as de, List as he, DynamicTime as fe } from "@base-framework/organisms";
|
|
8
|
-
import { F as
|
|
9
|
-
const
|
|
8
|
+
import { F as z } from "./format-DnofNaaz.js";
|
|
9
|
+
const E = {
|
|
10
10
|
info: {
|
|
11
11
|
borderColor: "border-blue-500",
|
|
12
12
|
bgColor: "bg-muted/10",
|
|
@@ -33,9 +33,9 @@ const N = {
|
|
|
33
33
|
iconColor: "text-muted-foreground"
|
|
34
34
|
}
|
|
35
35
|
}, me = (e, t) => l({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
|
|
36
|
-
|
|
37
|
-
]), ge = (e) =>
|
|
38
|
-
const { borderColor: n, bgColor: r, iconColor: i } =
|
|
36
|
+
p({ html: e })
|
|
37
|
+
]), ge = (e) => X({ class: "font-semibold" }, e), pe = (e) => g({ class: "text-sm text-muted-foreground" }, e), kt = c(({ title: e, description: t, icon: s, type: o = "default" }) => {
|
|
38
|
+
const { borderColor: n, bgColor: r, iconColor: i } = E[o] || E.default;
|
|
39
39
|
return l({ class: `flex items-start p-4 border rounded-lg ${r} ${n}` }, [
|
|
40
40
|
// Icon and content
|
|
41
41
|
s && me(s, i),
|
|
@@ -63,25 +63,25 @@ class St extends w {
|
|
|
63
63
|
this.prepareDestroy(), this.removeContext();
|
|
64
64
|
const t = this.panel, s = this.removingClass;
|
|
65
65
|
if (!s) {
|
|
66
|
-
|
|
66
|
+
j.removeElement(t);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
ne.addClass(t, s), re.on("animationend", t, (o) =>
|
|
69
|
+
ne.addClass(t, s), re.on("animationend", t, (o) => j.removeElement(t));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
const be = (e) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, e), xe = (e) => a({ class: "flex w-4 h-4", html: e }), we = (e) => a({ class: "flex-auto" }, e),
|
|
72
|
+
const be = (e) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, e), xe = (e) => a({ class: "flex w-4 h-4", html: e }), we = (e) => a({ class: "flex-auto" }, e), ve = (e, t) => q({
|
|
73
73
|
class: "relative flex cursor-pointer hover:bg-muted/50 select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
74
74
|
click: () => t(e)
|
|
75
75
|
}, [
|
|
76
76
|
e.icon && xe(e.icon),
|
|
77
77
|
we(e.label),
|
|
78
78
|
e.shortcut && be(e.shortcut)
|
|
79
|
-
]),
|
|
80
|
-
e.map((s) =>
|
|
79
|
+
]), ye = (e, t) => H({ class: "grid gap-2" }, [
|
|
80
|
+
e.map((s) => ve(s, t))
|
|
81
81
|
]), Ce = (e) => l({ class: "w-full z-10" }, [
|
|
82
82
|
l({
|
|
83
83
|
class: "max-h-60 border rounded-md overflow-y-auto p-1 grid gap-2 divide-y divide-border",
|
|
84
|
-
for: ["groups", (t) =>
|
|
84
|
+
for: ["groups", (t) => ye(t, e)]
|
|
85
85
|
})
|
|
86
86
|
]), ke = ({ label: e, icon: t, toggleDropdown: s }) => f({
|
|
87
87
|
cache: "button",
|
|
@@ -91,11 +91,11 @@ const be = (e) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, e),
|
|
|
91
91
|
click: s
|
|
92
92
|
}, [
|
|
93
93
|
e && a(e),
|
|
94
|
-
t &&
|
|
94
|
+
t && p({ html: t })
|
|
95
95
|
]), Se = ({ onSelect: e }) => l([
|
|
96
|
-
|
|
96
|
+
I(
|
|
97
97
|
"open",
|
|
98
|
-
(t, s, o) => t ? new
|
|
98
|
+
(t, s, o) => t ? new S({
|
|
99
99
|
cache: "dropdown",
|
|
100
100
|
parent: o,
|
|
101
101
|
button: o.button
|
|
@@ -119,7 +119,7 @@ class Dt extends w {
|
|
|
119
119
|
* @returns {Data}
|
|
120
120
|
*/
|
|
121
121
|
setData() {
|
|
122
|
-
return new
|
|
122
|
+
return new F({
|
|
123
123
|
groups: this.groups || []
|
|
124
124
|
});
|
|
125
125
|
}
|
|
@@ -167,24 +167,24 @@ class Dt extends w {
|
|
|
167
167
|
]);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
const De = c((e, t) => l({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t)), Ie = c((e, t) =>
|
|
171
|
-
e.title &&
|
|
172
|
-
e.description &&
|
|
170
|
+
const De = c((e, t) => l({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t)), Ie = c((e, t) => A({ ...e, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, t)), $e = c((e, t) => g({ ...e, class: "text-sm text-muted-foreground italic" }, t)), Fe = c((e, t) => g({ ...e, class: "text-sm text-destructive" }, t)), It = c((e, t = []) => ce({ class: "flex flex-auto flex-col gap-y-0", margin: "m-0", padding: "p-0" }, [
|
|
171
|
+
e.title && C({ class: "text-lg font-semibold py-4 px-6" }, e.title),
|
|
172
|
+
e.description && g({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, e.description),
|
|
173
173
|
...t
|
|
174
174
|
])), $t = c((e, t = []) => ue({ label: e.label, description: e.description, class: "py-4 px-6", border: e.border }, [
|
|
175
175
|
l({ class: "flex flex-col gap-y-6" }, t)
|
|
176
|
-
])),
|
|
176
|
+
])), Ft = c((e, t = []) => {
|
|
177
177
|
const s = e.border ? "border-t" : "";
|
|
178
178
|
return l({ ...e, class: `flex flex-col pb-4 px-6 gap-y-4 ${s} ${e.class || ""}` }, t);
|
|
179
|
-
}), Be = (e) => e.tag === "input" || e.tag === "select" || e.tag === "textarea",
|
|
179
|
+
}), Be = (e) => e.tag === "input" || e.tag === "select" || e.tag === "textarea", J = (e, t, s) => e.map((o) => !o || (o.children && o.children.length > 0 && (o.children = J(o.children, t, s)), !o.required) ? o : Be(o) ? {
|
|
180
180
|
...o,
|
|
181
181
|
aria: {
|
|
182
182
|
invalid: ["hasError"]
|
|
183
183
|
},
|
|
184
184
|
invalid: s,
|
|
185
185
|
input: t
|
|
186
|
-
} : o),
|
|
187
|
-
const n =
|
|
186
|
+
} : o), Te = c((e, t) => {
|
|
187
|
+
const n = J(t, (r) => {
|
|
188
188
|
r.target.checkValidity() && e.setError(null);
|
|
189
189
|
}, (r) => {
|
|
190
190
|
e.setError(r.target.validationMessage);
|
|
@@ -220,46 +220,46 @@ const De = c((e, t) => l({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t))
|
|
|
220
220
|
return l({ class: "flex flex-auto gap-y-4" }, [
|
|
221
221
|
De([
|
|
222
222
|
Ie({ htmlFor: t }, s),
|
|
223
|
-
|
|
223
|
+
Te({
|
|
224
224
|
id: t,
|
|
225
225
|
name: e,
|
|
226
226
|
value: this.state.value,
|
|
227
227
|
setError: n
|
|
228
228
|
}, this.children),
|
|
229
229
|
o && $e({ id: this.getId("description") }, o),
|
|
230
|
-
l({ onState: ["error", (r) => r &&
|
|
230
|
+
l({ onState: ["error", (r) => r && Fe(r)] })
|
|
231
231
|
])
|
|
232
232
|
]);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
),
|
|
235
|
+
), Le = (e, t, s = null) => {
|
|
236
236
|
e.target.checkValidity() && (e.preventDefault(), s && s(e, t));
|
|
237
|
-
},
|
|
238
|
-
(e, t) =>
|
|
239
|
-
),
|
|
240
|
-
e.title &&
|
|
237
|
+
}, K = c(
|
|
238
|
+
(e, t) => Z({ ...e, submit: (s, o) => Le(s, o, e.submit), class: `w-full ${e.class ?? ""}` }, t)
|
|
239
|
+
), Tt = c((e, t) => l({ ...e, class: `flex flex-auto flex-col gap-y-6 p-4 md:p-6 divide-y ${e.class || ""}` }, t)), Lt = c((e, t = []) => l({ class: "flex flex-col gap-y-3 py-4" }, [
|
|
240
|
+
e.title && C({ class: "font-semibold" }, e.title),
|
|
241
241
|
...t
|
|
242
|
-
])),
|
|
242
|
+
])), At = (e, t) => l({ class: "flex justify-between" }, [
|
|
243
243
|
a({ class: "text-muted-foreground" }, e),
|
|
244
244
|
a(t)
|
|
245
245
|
]), Pt = (e, t) => l({ class: "flex" }, [
|
|
246
246
|
a({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, e),
|
|
247
247
|
a(t)
|
|
248
|
-
]),
|
|
248
|
+
]), Ae = ({ title: e, description: t, back: s, icon: o, options: n = [] }) => $({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
|
|
249
249
|
/**
|
|
250
250
|
* Back Button
|
|
251
251
|
*/
|
|
252
|
-
s && h({ variant: "icon", icon:
|
|
252
|
+
s && h({ variant: "icon", icon: u.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (r, i) => i.close() }),
|
|
253
253
|
/**
|
|
254
254
|
* Icon
|
|
255
255
|
*/
|
|
256
|
-
o && l({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [
|
|
256
|
+
o && l({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [m(o)]),
|
|
257
257
|
/**
|
|
258
258
|
* Title and Description
|
|
259
259
|
*/
|
|
260
260
|
l({ class: "flex flex-auto flex-row justify-between w-full ml-2 gap-2" }, [
|
|
261
261
|
l({ class: "flex flex-auto flex-col" }, [
|
|
262
|
-
|
|
262
|
+
C({ class: "text-lg font-semibold m-0 truncate" }, e),
|
|
263
263
|
t && l({ class: "text-sm text-muted-foreground truncate" }, t)
|
|
264
264
|
]),
|
|
265
265
|
...n
|
|
@@ -271,12 +271,12 @@ const De = c((e, t) => l({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t))
|
|
|
271
271
|
s.target === o.panel && (s.preventDefault(), s.stopPropagation(), o.state.open = !1);
|
|
272
272
|
}
|
|
273
273
|
}, [
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
K({ class: "modal-content relative bg-background z-[1] flex flex-auto flex-col gap-y-4", submit: (s, o) => e.onSubmit && e.onSubmit(o) }, [
|
|
275
|
+
Ae(e),
|
|
276
276
|
l({ class: "modal-body flex flex-grow flex-col overflow-y-auto py-0 px-6 z-0" }, t),
|
|
277
|
-
|
|
277
|
+
P({ class: "modal-footer sticky bg-background/80 backdrop-blur-md flex flex-none justify-between py-4 px-6 z-10" }, e.buttons)
|
|
278
278
|
])
|
|
279
|
-
])), Me = (e) =>
|
|
279
|
+
])), Me = (e) => G.render(e, app.root);
|
|
280
280
|
class Mt extends w {
|
|
281
281
|
/**
|
|
282
282
|
* This will declare the props for the compiler.
|
|
@@ -437,7 +437,7 @@ class Mt extends w {
|
|
|
437
437
|
this.panel.hidePopover(), this.state.open = !1, typeof this.onClose == "function" && this.onClose(this), document.documentElement.style.overflowY = "auto";
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
const
|
|
440
|
+
const N = {
|
|
441
441
|
info: {
|
|
442
442
|
bgColor: "bg-muted/10",
|
|
443
443
|
borderColor: "border-blue-500",
|
|
@@ -463,22 +463,22 @@ const z = {
|
|
|
463
463
|
borderColor: "border",
|
|
464
464
|
iconColor: "text-muted-foreground"
|
|
465
465
|
}
|
|
466
|
-
},
|
|
467
|
-
|
|
468
|
-
]),
|
|
466
|
+
}, je = (e) => $({ class: "flex justify-center" }, [
|
|
467
|
+
ee({ class: "text-lg font-bold mb-0" }, e)
|
|
468
|
+
]), ze = c(({ href: e, class: t }, s) => Y({
|
|
469
469
|
class: `bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
|
|
470
470
|
href: e,
|
|
471
471
|
animateIn: "pullRightIn",
|
|
472
472
|
animateOut: "pullRight",
|
|
473
473
|
role: "alert"
|
|
474
|
-
}, s)),
|
|
474
|
+
}, s)), Ee = c(({ close: e, class: t }, s) => l({
|
|
475
475
|
class: `pullRightIn bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
|
|
476
476
|
click: () => e(),
|
|
477
477
|
animateIn: "pullRightIn",
|
|
478
478
|
animateOut: "pullRight",
|
|
479
479
|
role: "alert"
|
|
480
480
|
}, s));
|
|
481
|
-
class
|
|
481
|
+
class Ne extends w {
|
|
482
482
|
/**
|
|
483
483
|
* This will declare the props for the compiler.
|
|
484
484
|
*
|
|
@@ -502,10 +502,10 @@ class je extends w {
|
|
|
502
502
|
*/
|
|
503
503
|
render() {
|
|
504
504
|
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), n = this.href || null, r = this.getChildren(o);
|
|
505
|
-
return n ?
|
|
505
|
+
return n ? ze({
|
|
506
506
|
href: n,
|
|
507
507
|
class: `${t} ${s}`
|
|
508
|
-
}, r) :
|
|
508
|
+
}, r) : Ee({
|
|
509
509
|
close: this.close.bind(this),
|
|
510
510
|
class: `${t} ${s}`
|
|
511
511
|
}, r);
|
|
@@ -526,7 +526,7 @@ class je extends w {
|
|
|
526
526
|
*/
|
|
527
527
|
getTypeStyles() {
|
|
528
528
|
const t = this.type || "default";
|
|
529
|
-
return
|
|
529
|
+
return N[t] || N.default;
|
|
530
530
|
}
|
|
531
531
|
/**
|
|
532
532
|
* This will get the buttons for the notification.
|
|
@@ -550,19 +550,19 @@ class je extends w {
|
|
|
550
550
|
getChildren(t) {
|
|
551
551
|
return [
|
|
552
552
|
l({ class: "flex items-start" }, [
|
|
553
|
-
this.icon &&
|
|
553
|
+
this.icon && p({ class: `mr-4 ${t}`, html: this.icon }),
|
|
554
554
|
l({ class: "flex flex-auto flex-col" }, [
|
|
555
555
|
l({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
|
|
556
|
-
this.title &&
|
|
556
|
+
this.title && je(this.title)
|
|
557
557
|
]),
|
|
558
|
-
|
|
559
|
-
(this.primary || this.secondary) &&
|
|
558
|
+
g({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
|
|
559
|
+
(this.primary || this.secondary) && P({ class: "margin-top-24 flex align-center" }, this.getButtons())
|
|
560
560
|
])
|
|
561
561
|
]),
|
|
562
562
|
h({
|
|
563
563
|
class: "absolute top-[12px] right-[12px]",
|
|
564
564
|
variant: "icon",
|
|
565
|
-
icon:
|
|
565
|
+
icon: u.x,
|
|
566
566
|
click: this.close.bind(this)
|
|
567
567
|
})
|
|
568
568
|
];
|
|
@@ -578,7 +578,7 @@ class je extends w {
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
let Oe = 0;
|
|
581
|
-
class
|
|
581
|
+
class jt extends w {
|
|
582
582
|
/**
|
|
583
583
|
* This will render the component.
|
|
584
584
|
*
|
|
@@ -590,7 +590,7 @@ class Et extends w {
|
|
|
590
590
|
cache: "list",
|
|
591
591
|
key: "id",
|
|
592
592
|
role: "list",
|
|
593
|
-
rowItem: (t) => new
|
|
593
|
+
rowItem: (t) => new Ne(t)
|
|
594
594
|
})
|
|
595
595
|
]);
|
|
596
596
|
}
|
|
@@ -613,7 +613,7 @@ class Et extends w {
|
|
|
613
613
|
this.list.delete(t.id), this.list.isEmpty() && this.panel.hidePopover();
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
const
|
|
616
|
+
const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
617
617
|
class: 'text-sm gap-1 font-medium leading-none disabled:cursor-not-allowed disabled:opacity-70 flex flex-col items-center justify-between rounded-md border-2 bg-popover p-4 hover:bg-accent hover:text-accent-foreground data-[state="active"]:border-primary [&:has([data-state="active"])]:border-primary',
|
|
618
618
|
onState: ["method", { active: e }],
|
|
619
619
|
dataSet: ["method", ["state", e, "active"]],
|
|
@@ -621,17 +621,17 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
621
621
|
n.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Ue(e);
|
|
622
622
|
}
|
|
623
623
|
}, [
|
|
624
|
-
|
|
624
|
+
m(s),
|
|
625
625
|
a(t)
|
|
626
626
|
])), Ue = (e) => {
|
|
627
627
|
const t = document.documentElement;
|
|
628
|
-
if (e === "system" && (e = globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"),
|
|
628
|
+
if (e === "system" && (e = globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"), O && !O("(prefers-color-scheme: " + e + ")").matches) {
|
|
629
629
|
t.classList.add(e);
|
|
630
630
|
return;
|
|
631
631
|
}
|
|
632
632
|
const s = e === "light" ? "dark" : "light";
|
|
633
633
|
t.classList.remove(s);
|
|
634
|
-
},
|
|
634
|
+
}, zt = v(
|
|
635
635
|
{
|
|
636
636
|
/**
|
|
637
637
|
* This will render the component.
|
|
@@ -641,9 +641,9 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
641
641
|
render() {
|
|
642
642
|
return l({ class: "flex flex-auto flex-col" }, [
|
|
643
643
|
l({ class: "grid grid-cols-3 gap-4" }, [
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
644
|
+
B({ label: "System", value: "system", icon: u.adjustments.horizontal }),
|
|
645
|
+
B({ label: "Light", value: "light", icon: u.sun }),
|
|
646
|
+
B({ label: "Dark", value: "dark", icon: u.moon })
|
|
647
647
|
])
|
|
648
648
|
]);
|
|
649
649
|
},
|
|
@@ -658,7 +658,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
658
658
|
};
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
),
|
|
661
|
+
), Et = y(
|
|
662
662
|
{
|
|
663
663
|
/**
|
|
664
664
|
* The initial state of the Toggle.
|
|
@@ -692,7 +692,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
692
692
|
s.toggle("active"), this.checkbox.checked = s.active, this.change && this.change(s.active, t, this);
|
|
693
693
|
}
|
|
694
694
|
}, [
|
|
695
|
-
|
|
695
|
+
te({
|
|
696
696
|
cache: "checkbox",
|
|
697
697
|
class: "opacity-0 absolute top-0 left-0 bottom-0 right-0 w-full h-full",
|
|
698
698
|
/**
|
|
@@ -710,27 +710,101 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
710
710
|
]);
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
-
),
|
|
713
|
+
), D = {
|
|
714
714
|
ONLINE: "online",
|
|
715
715
|
OFFLINE: "offline",
|
|
716
716
|
BUSY: "busy",
|
|
717
717
|
AWAY: "away"
|
|
718
|
-
},
|
|
718
|
+
}, x = {
|
|
719
719
|
ONLINE: "bg-green-500",
|
|
720
720
|
OFFLINE: "bg-gray-500",
|
|
721
721
|
BUSY: "bg-red-500",
|
|
722
722
|
AWAY: "bg-yellow-500"
|
|
723
|
-
}, Re = (e = "") => (e = e.toUpperCase(),
|
|
723
|
+
}, Re = (e = "") => (e = e.toUpperCase(), x[e] || x.OFFLINE), Nt = (e) => l({
|
|
724
724
|
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${Re(e)}`
|
|
725
725
|
}), Ot = ({ propName: e = "status" } = {}) => l({
|
|
726
726
|
class: "absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full",
|
|
727
727
|
onSet: [e, {
|
|
728
|
-
[
|
|
729
|
-
[
|
|
730
|
-
[
|
|
731
|
-
[
|
|
728
|
+
[x.ONLINE]: D.ONLINE,
|
|
729
|
+
[x.OFFLINE]: D.OFFLINE,
|
|
730
|
+
[x.BUSY]: D.BUSY,
|
|
731
|
+
[x.AWAY]: D.AWAY
|
|
732
732
|
}]
|
|
733
|
-
}), Ut =
|
|
733
|
+
}), Ut = v(
|
|
734
|
+
{
|
|
735
|
+
/**
|
|
736
|
+
* Get the initial state for the component.
|
|
737
|
+
*
|
|
738
|
+
* @returns {object} Initial state for the component
|
|
739
|
+
*/
|
|
740
|
+
state() {
|
|
741
|
+
return {
|
|
742
|
+
// @ts-ignore
|
|
743
|
+
loaded: !!this.src
|
|
744
|
+
};
|
|
745
|
+
},
|
|
746
|
+
/**
|
|
747
|
+
* This will open the file browse dialog.
|
|
748
|
+
*
|
|
749
|
+
* @returns {void}
|
|
750
|
+
*/
|
|
751
|
+
openFileBrowse() {
|
|
752
|
+
const e = this.input;
|
|
753
|
+
e && (e.value = "", k.trigger("click", e));
|
|
754
|
+
},
|
|
755
|
+
/**
|
|
756
|
+
* Get the URL for the uploaded file.
|
|
757
|
+
*
|
|
758
|
+
* @param {File} file - The file to get the URL for.
|
|
759
|
+
* @returns {string} The object URL for the file.
|
|
760
|
+
*/
|
|
761
|
+
getFileUrl(e) {
|
|
762
|
+
return this.url && URL.revokeObjectURL(this.url), this.url = URL.createObjectURL(e);
|
|
763
|
+
},
|
|
764
|
+
/**
|
|
765
|
+
* Render the component.
|
|
766
|
+
*
|
|
767
|
+
* @returns {object} Rendered component
|
|
768
|
+
*/
|
|
769
|
+
render() {
|
|
770
|
+
const e = "image-upload", t = this.onChange || null;
|
|
771
|
+
return l({ class: "flex-none items-center" }, [
|
|
772
|
+
b({
|
|
773
|
+
id: e,
|
|
774
|
+
cache: "input",
|
|
775
|
+
type: "file",
|
|
776
|
+
accept: "image/*",
|
|
777
|
+
class: "hidden",
|
|
778
|
+
change: (s) => {
|
|
779
|
+
const o = s.target.files?.[0];
|
|
780
|
+
o && t && (this.state.loaded = !1, t(o, this.parent), this.src = this.getFileUrl(o), this.state.loaded = !0);
|
|
781
|
+
}
|
|
782
|
+
}),
|
|
783
|
+
l({
|
|
784
|
+
class: "relative w-32 h-32 rounded-full border flex items-center justify-center cursor-pointer hover:bg-muted transition-colors duration-150 overflow-hidden group",
|
|
785
|
+
click: (s) => {
|
|
786
|
+
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
787
|
+
}
|
|
788
|
+
}, [
|
|
789
|
+
I(
|
|
790
|
+
"loaded",
|
|
791
|
+
(s) => s ? _({
|
|
792
|
+
// @ts-ignore
|
|
793
|
+
src: this.src,
|
|
794
|
+
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
795
|
+
}) : A({
|
|
796
|
+
htmlFor: e,
|
|
797
|
+
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
798
|
+
}, [
|
|
799
|
+
m(u.upload),
|
|
800
|
+
l("Upload Image")
|
|
801
|
+
])
|
|
802
|
+
)
|
|
803
|
+
])
|
|
804
|
+
]);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
), Rt = v(
|
|
734
808
|
{
|
|
735
809
|
/**
|
|
736
810
|
* Get the initial state for the component.
|
|
@@ -750,7 +824,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
750
824
|
*/
|
|
751
825
|
openFileBrowse() {
|
|
752
826
|
const e = this.input;
|
|
753
|
-
e && (e.value = "",
|
|
827
|
+
e && (e.value = "", k.trigger("click", e));
|
|
754
828
|
},
|
|
755
829
|
/**
|
|
756
830
|
* Get the URL for the uploaded file.
|
|
@@ -769,7 +843,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
769
843
|
render() {
|
|
770
844
|
const e = "logo-upload", t = this.onChange || null;
|
|
771
845
|
return l({ class: "flex-none items-center" }, [
|
|
772
|
-
|
|
846
|
+
b({
|
|
773
847
|
id: e,
|
|
774
848
|
cache: "input",
|
|
775
849
|
type: "file",
|
|
@@ -786,17 +860,17 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
786
860
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
787
861
|
}
|
|
788
862
|
}, [
|
|
789
|
-
|
|
863
|
+
I(
|
|
790
864
|
"loaded",
|
|
791
|
-
(s) => s ?
|
|
865
|
+
(s) => s ? _({
|
|
792
866
|
// @ts-ignore
|
|
793
867
|
src: this.src,
|
|
794
868
|
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
795
|
-
}) :
|
|
869
|
+
}) : A({
|
|
796
870
|
htmlFor: e,
|
|
797
871
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
798
872
|
}, [
|
|
799
|
-
|
|
873
|
+
m(u.upload),
|
|
800
874
|
l("Upload logo")
|
|
801
875
|
])
|
|
802
876
|
)
|
|
@@ -812,14 +886,14 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
812
886
|
class: "text-muted-foreground font-medium hover:text-foreground"
|
|
813
887
|
},
|
|
814
888
|
[a(t)]
|
|
815
|
-
), qe = () =>
|
|
889
|
+
), qe = () => m({
|
|
816
890
|
class: "mx-3 text-muted-foreground",
|
|
817
891
|
"aria-hidden": !0,
|
|
818
892
|
size: "xs"
|
|
819
|
-
},
|
|
893
|
+
}, u.chevron.single.right), He = (e) => l({ class: "flex items-center" }, [
|
|
820
894
|
e.href ? Ve(e.href, e.label) : a(e.label),
|
|
821
895
|
e.separator && qe()
|
|
822
|
-
]),
|
|
896
|
+
]), Vt = v(
|
|
823
897
|
{
|
|
824
898
|
/**
|
|
825
899
|
* Set initial data
|
|
@@ -827,7 +901,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
827
901
|
* @returns {Data}
|
|
828
902
|
*/
|
|
829
903
|
setData() {
|
|
830
|
-
return new
|
|
904
|
+
return new F({
|
|
831
905
|
// @ts-ignore
|
|
832
906
|
items: this.items || []
|
|
833
907
|
});
|
|
@@ -858,7 +932,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
858
932
|
);
|
|
859
933
|
}
|
|
860
934
|
}
|
|
861
|
-
),
|
|
935
|
+
), U = {
|
|
862
936
|
xs: "h-1 w-1",
|
|
863
937
|
sm: "h-2 w-2",
|
|
864
938
|
md: "h-4 w-4",
|
|
@@ -867,7 +941,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
867
941
|
"2xl": "h-16 w-16",
|
|
868
942
|
"3xl": "h-24 w-24",
|
|
869
943
|
default: "h-4 w-4"
|
|
870
|
-
}, Ye = (e) =>
|
|
944
|
+
}, Ye = (e) => U[e] || U.default, _e = ({ index: e, size: t }) => l({ class: `${t} rounded-full bg-muted cursor-pointer` }, [
|
|
871
945
|
a({
|
|
872
946
|
class: "block w-full h-full rounded-full transition-colors",
|
|
873
947
|
onSet: ["activeIndex", {
|
|
@@ -881,7 +955,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
881
955
|
]), We = (e, t) => Array.from({ length: e }, (s, o) => _e({
|
|
882
956
|
index: o,
|
|
883
957
|
size: t
|
|
884
|
-
})),
|
|
958
|
+
})), qt = v(
|
|
885
959
|
{
|
|
886
960
|
/**
|
|
887
961
|
* Defines component data (props).
|
|
@@ -889,7 +963,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
889
963
|
* @returns {Data}
|
|
890
964
|
*/
|
|
891
965
|
setData() {
|
|
892
|
-
return new
|
|
966
|
+
return new F({
|
|
893
967
|
// @ts-ignore
|
|
894
968
|
count: this.count || 4,
|
|
895
969
|
// total dots
|
|
@@ -920,21 +994,21 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
920
994
|
},
|
|
921
995
|
[
|
|
922
996
|
a({ onState: ["selectedLabel", (t) => t || "Select item..."] }),
|
|
923
|
-
|
|
997
|
+
p({ html: u.chevron.upDown })
|
|
924
998
|
]
|
|
925
|
-
), Je = (e, t, s) =>
|
|
999
|
+
), Je = (e, t, s) => q({
|
|
926
1000
|
class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
|
|
927
1001
|
click: () => t(e),
|
|
928
1002
|
onState: [s, "selectedValue", { "bg-secondary": e.value }]
|
|
929
1003
|
}, [
|
|
930
|
-
e.icon && a({ class: "mr-2 flex items-baseline" }, [
|
|
1004
|
+
e.icon && a({ class: "mr-2 flex items-baseline" }, [m({ size: "xs" }, e.icon)]),
|
|
931
1005
|
a({ class: "text-base font-normal" }, e.label)
|
|
932
1006
|
]), Ke = (e, t) => l({ class: "w-full border rounded-md" }, [
|
|
933
|
-
|
|
1007
|
+
H({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) => Je(s, e, t)] })
|
|
934
1008
|
]), Qe = ({ onSelect: e, state: t }) => l({ class: "flex flex-auto flex-col" }, [
|
|
935
|
-
|
|
1009
|
+
I(
|
|
936
1010
|
"open",
|
|
937
|
-
(s, o, n) => s ? new
|
|
1011
|
+
(s, o, n) => s ? new S({
|
|
938
1012
|
cache: "dropdown",
|
|
939
1013
|
parent: n,
|
|
940
1014
|
button: n.button
|
|
@@ -942,7 +1016,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
942
1016
|
Ke(e, t)
|
|
943
1017
|
]) : null
|
|
944
1018
|
)
|
|
945
|
-
]),
|
|
1019
|
+
]), Ht = v(
|
|
946
1020
|
{
|
|
947
1021
|
/**
|
|
948
1022
|
* This will set up the data.
|
|
@@ -950,7 +1024,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
950
1024
|
* @returns {Data}
|
|
951
1025
|
*/
|
|
952
1026
|
setData() {
|
|
953
|
-
return new
|
|
1027
|
+
return new F({
|
|
954
1028
|
// @ts-ignore
|
|
955
1029
|
items: this.items || []
|
|
956
1030
|
});
|
|
@@ -1032,7 +1106,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1032
1106
|
}),
|
|
1033
1107
|
// Hidden required input for form validation
|
|
1034
1108
|
// @ts-ignore
|
|
1035
|
-
this.required &&
|
|
1109
|
+
this.required && b({
|
|
1036
1110
|
class: "opacity-0 absolute top-0 left-0 z-[1]",
|
|
1037
1111
|
type: "text",
|
|
1038
1112
|
// @ts-ignore
|
|
@@ -1044,26 +1118,26 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1044
1118
|
]);
|
|
1045
1119
|
}
|
|
1046
1120
|
}
|
|
1047
|
-
),
|
|
1121
|
+
), Q = ({ icon: e, click: t, ariaLabel: s }) => h({
|
|
1048
1122
|
variant: "icon",
|
|
1049
1123
|
class: "flex flex-none",
|
|
1050
1124
|
click: t,
|
|
1051
1125
|
icon: e,
|
|
1052
1126
|
"aria-label": s
|
|
1053
|
-
}), Xe = ({ click: e }) =>
|
|
1054
|
-
icon:
|
|
1127
|
+
}), Xe = ({ click: e }) => Q({
|
|
1128
|
+
icon: u.circleMinus,
|
|
1055
1129
|
click: e,
|
|
1056
1130
|
ariaLabel: "Decrement"
|
|
1057
|
-
}), Ze = ({ click: e }) =>
|
|
1058
|
-
icon:
|
|
1131
|
+
}), Ze = ({ click: e }) => Q({
|
|
1132
|
+
icon: u.circlePlus,
|
|
1059
1133
|
click: e,
|
|
1060
1134
|
ariaLabel: "Increment"
|
|
1061
|
-
}), et = ({ bind: e, min: t, max: s, readonly: o = !1 }) =>
|
|
1135
|
+
}), et = ({ bind: e, min: t, max: s, readonly: o = !1 }) => W(({ state: n }) => b({
|
|
1062
1136
|
value: ["[[count]]", n],
|
|
1063
1137
|
bind: e,
|
|
1064
1138
|
blur: (r, { state: i }) => {
|
|
1065
|
-
let
|
|
1066
|
-
isNaN(
|
|
1139
|
+
let d = parseInt(r.target.value, 10);
|
|
1140
|
+
isNaN(d) && (d = t ?? 0), t !== void 0 && (d = Math.max(d, t)), s !== void 0 && (d = Math.min(d, s)), i.count = d;
|
|
1067
1141
|
},
|
|
1068
1142
|
class: "flex flex-auto text-lg font-medium bg-input text-center border min-w-0",
|
|
1069
1143
|
readonly: o,
|
|
@@ -1071,7 +1145,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1071
1145
|
max: s,
|
|
1072
1146
|
type: "number",
|
|
1073
1147
|
"aria-label": "Counter"
|
|
1074
|
-
})),
|
|
1148
|
+
})), Yt = y(
|
|
1075
1149
|
{
|
|
1076
1150
|
/**
|
|
1077
1151
|
* Initial state for the counter component.
|
|
@@ -1105,7 +1179,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1105
1179
|
]);
|
|
1106
1180
|
}
|
|
1107
1181
|
}
|
|
1108
|
-
), tt = ({ bind: e, required: t }) =>
|
|
1182
|
+
), tt = ({ bind: e, required: t }) => b({
|
|
1109
1183
|
cache: "input",
|
|
1110
1184
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1111
1185
|
bind: e,
|
|
@@ -1116,11 +1190,11 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1116
1190
|
}, [
|
|
1117
1191
|
tt({ bind: e, required: t }),
|
|
1118
1192
|
a({
|
|
1119
|
-
onState: ["selectedDate", (o) => o ?
|
|
1193
|
+
onState: ["selectedDate", (o) => o ? L.format("standard", o) : "Pick a date"]
|
|
1120
1194
|
}),
|
|
1121
|
-
|
|
1122
|
-
]), ot = ({ handleDateSelect: e, blockPriorDates: t }) =>
|
|
1123
|
-
(s, o, n) => new
|
|
1195
|
+
p({ html: u.calendar.days })
|
|
1196
|
+
]), ot = ({ handleDateSelect: e, blockPriorDates: t }) => M(
|
|
1197
|
+
(s, o, n) => new S({
|
|
1124
1198
|
cache: "dropdown",
|
|
1125
1199
|
parent: n,
|
|
1126
1200
|
button: n.panel,
|
|
@@ -1132,7 +1206,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1132
1206
|
blockPriorDates: t
|
|
1133
1207
|
})
|
|
1134
1208
|
])
|
|
1135
|
-
),
|
|
1209
|
+
), _t = y(
|
|
1136
1210
|
{
|
|
1137
1211
|
/**
|
|
1138
1212
|
* The initial state of the DatePicker.
|
|
@@ -1161,7 +1235,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1161
1235
|
*/
|
|
1162
1236
|
render() {
|
|
1163
1237
|
const e = (s, { state: o }) => o.toggle("open"), t = (s) => {
|
|
1164
|
-
this.state.selectedDate = s, this.state.open = !1, this.input.value = s,
|
|
1238
|
+
this.state.selectedDate = s, this.state.open = !1, this.input.value = s, k.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(s);
|
|
1165
1239
|
};
|
|
1166
1240
|
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1167
1241
|
st({
|
|
@@ -1176,7 +1250,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1176
1250
|
]);
|
|
1177
1251
|
}
|
|
1178
1252
|
}
|
|
1179
|
-
), lt = ({ bind: e, required: t }) =>
|
|
1253
|
+
), lt = ({ bind: e, required: t }) => b({
|
|
1180
1254
|
cache: "input",
|
|
1181
1255
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1182
1256
|
bind: e,
|
|
@@ -1186,13 +1260,13 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1186
1260
|
click: s
|
|
1187
1261
|
}, [
|
|
1188
1262
|
lt({ bind: e, required: t }),
|
|
1189
|
-
|
|
1190
|
-
a(
|
|
1263
|
+
W(({ state: o }) => [
|
|
1264
|
+
a(z.date(["[[start]]", o], "Start Date")),
|
|
1191
1265
|
a(" - "),
|
|
1192
|
-
a(
|
|
1266
|
+
a(z.date(["[[end]]", o], "End Date"))
|
|
1193
1267
|
]),
|
|
1194
|
-
|
|
1195
|
-
]), rt = ({ handleDateSelect: e, blockPriorDates: t }) =>
|
|
1268
|
+
p({ html: u.calendar.days })
|
|
1269
|
+
]), rt = ({ handleDateSelect: e, blockPriorDates: t }) => M((s, o, n) => new S({
|
|
1196
1270
|
cache: "dropdown",
|
|
1197
1271
|
parent: n,
|
|
1198
1272
|
button: n.panel,
|
|
@@ -1204,7 +1278,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1204
1278
|
onRangeSelect: e,
|
|
1205
1279
|
blockPriorDates: t
|
|
1206
1280
|
})
|
|
1207
|
-
])),
|
|
1281
|
+
])), Wt = y(
|
|
1208
1282
|
{
|
|
1209
1283
|
/**
|
|
1210
1284
|
* The initial state of the DateRangePicker.
|
|
@@ -1237,7 +1311,7 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1237
1311
|
*/
|
|
1238
1312
|
render() {
|
|
1239
1313
|
const e = (s, { state: o }) => o.toggle("open"), t = (s, o) => {
|
|
1240
|
-
this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`,
|
|
1314
|
+
this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`, k.trigger("change", this.input), typeof this.onChange == "function" && this.onChange({ start: s, end: o }, this.parent);
|
|
1241
1315
|
};
|
|
1242
1316
|
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1243
1317
|
nt({
|
|
@@ -1252,17 +1326,17 @@ const j = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1252
1326
|
]);
|
|
1253
1327
|
}
|
|
1254
1328
|
}
|
|
1255
|
-
),
|
|
1329
|
+
), Gt = ({ dateTime: e = "", remoteTimeZone: t = "America/Denver", filter: s = null }) => oe([
|
|
1256
1330
|
new fe({
|
|
1257
1331
|
dateTime: e,
|
|
1258
1332
|
filter: s || ((o) => {
|
|
1259
|
-
const n =
|
|
1260
|
-
return
|
|
1333
|
+
const n = L.getLocalTime(o, !0, !1, t);
|
|
1334
|
+
return L.getTimeFrame(n);
|
|
1261
1335
|
})
|
|
1262
1336
|
})
|
|
1263
1337
|
]);
|
|
1264
1338
|
function it({ bind: e, required: t }) {
|
|
1265
|
-
return
|
|
1339
|
+
return b({
|
|
1266
1340
|
cache: "input",
|
|
1267
1341
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1268
1342
|
bind: e,
|
|
@@ -1280,11 +1354,11 @@ function at({ bind: e, required: t, toggleOpen: s }) {
|
|
|
1280
1354
|
a({
|
|
1281
1355
|
onState: ["selectedTime", (o) => o || "Pick a time"]
|
|
1282
1356
|
}),
|
|
1283
|
-
|
|
1357
|
+
p({ html: u.clock })
|
|
1284
1358
|
]
|
|
1285
1359
|
);
|
|
1286
1360
|
}
|
|
1287
|
-
function
|
|
1361
|
+
function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: n = !1 }) {
|
|
1288
1362
|
return l(
|
|
1289
1363
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1290
1364
|
e.map((r) => {
|
|
@@ -1299,8 +1373,8 @@ function B({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: n = !1
|
|
|
1299
1373
|
);
|
|
1300
1374
|
}
|
|
1301
1375
|
function ct({ handleTimeSelect: e }) {
|
|
1302
|
-
return
|
|
1303
|
-
(t, s, o) => new
|
|
1376
|
+
return M(
|
|
1377
|
+
(t, s, o) => new S(
|
|
1304
1378
|
{
|
|
1305
1379
|
cache: "dropdown",
|
|
1306
1380
|
parent: o,
|
|
@@ -1315,7 +1389,7 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1315
1389
|
{ class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
|
|
1316
1390
|
[
|
|
1317
1391
|
// Hours column
|
|
1318
|
-
|
|
1392
|
+
T({
|
|
1319
1393
|
items: Array.from({ length: 12 }, (n, r) => r + 1),
|
|
1320
1394
|
handleTimeSelect: e,
|
|
1321
1395
|
state: o.state,
|
|
@@ -1323,7 +1397,7 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1323
1397
|
pad: !0
|
|
1324
1398
|
}),
|
|
1325
1399
|
// Minutes column
|
|
1326
|
-
|
|
1400
|
+
T({
|
|
1327
1401
|
items: Array.from({ length: 60 }, (n, r) => r),
|
|
1328
1402
|
handleTimeSelect: e,
|
|
1329
1403
|
state: o.state,
|
|
@@ -1331,7 +1405,7 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1331
1405
|
pad: !0
|
|
1332
1406
|
}),
|
|
1333
1407
|
// AM/PM column
|
|
1334
|
-
|
|
1408
|
+
T({
|
|
1335
1409
|
items: ["AM", "PM"],
|
|
1336
1410
|
handleTimeSelect: e,
|
|
1337
1411
|
state: o.state,
|
|
@@ -1345,20 +1419,20 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1345
1419
|
)
|
|
1346
1420
|
);
|
|
1347
1421
|
}
|
|
1348
|
-
function
|
|
1422
|
+
function R(e) {
|
|
1349
1423
|
if (!e)
|
|
1350
1424
|
return { hour: null, minute: null, meridian: null };
|
|
1351
1425
|
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1352
1426
|
if (!s)
|
|
1353
1427
|
return { hour: null, minute: null, meridian: null };
|
|
1354
|
-
let [, o, n, , r] = s, i = parseInt(o, 10),
|
|
1355
|
-
return i < 0 || i > 23 ||
|
|
1428
|
+
let [, o, n, , r] = s, i = parseInt(o, 10), d = parseInt(n, 10);
|
|
1429
|
+
return i < 0 || i > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (r ? (r = r.toUpperCase(), r === "PM" && i < 12 ? i += 12 : r === "AM" && i === 12 && (i = 12)) : i === 0 ? (r = "AM", i = 12) : i < 12 ? r = "AM" : i === 12 ? r = "PM" : (r = "PM", i -= 12), {
|
|
1356
1430
|
hour: i.toString().padStart(2, "0"),
|
|
1357
|
-
minute:
|
|
1431
|
+
minute: d.toString().padStart(2, "0"),
|
|
1358
1432
|
meridian: r
|
|
1359
1433
|
});
|
|
1360
1434
|
}
|
|
1361
|
-
const
|
|
1435
|
+
const Jt = y(
|
|
1362
1436
|
{
|
|
1363
1437
|
/**
|
|
1364
1438
|
* The initial shallow state of the TimePicker.
|
|
@@ -1366,7 +1440,7 @@ const Gt = y(
|
|
|
1366
1440
|
* @member {object} state
|
|
1367
1441
|
*/
|
|
1368
1442
|
state() {
|
|
1369
|
-
const e = this.selectedTime ?? null, { hour: t, minute: s, meridian: o } =
|
|
1443
|
+
const e = this.selectedTime ?? null, { hour: t, minute: s, meridian: o } = R(e);
|
|
1370
1444
|
return {
|
|
1371
1445
|
selectedTime: e,
|
|
1372
1446
|
open: !1,
|
|
@@ -1382,7 +1456,7 @@ const Gt = y(
|
|
|
1382
1456
|
*/
|
|
1383
1457
|
after() {
|
|
1384
1458
|
if (this.input.value) {
|
|
1385
|
-
const { hour: e, minute: t, meridian: s } =
|
|
1459
|
+
const { hour: e, minute: t, meridian: s } = R(this.input.value);
|
|
1386
1460
|
this.state.set({
|
|
1387
1461
|
hour: e,
|
|
1388
1462
|
minute: t,
|
|
@@ -1400,7 +1474,7 @@ const Gt = y(
|
|
|
1400
1474
|
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: n }) => {
|
|
1401
1475
|
if (s && (this.state.hour = s), o && (this.state.minute = o), n && (this.state.meridian = n), this.state.hour && this.state.minute && this.state.meridian) {
|
|
1402
1476
|
const r = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1403
|
-
this.state.selectedTime = r, this.state.open = !1, this.input.value = r,
|
|
1477
|
+
this.state.selectedTime = r, this.state.open = !1, this.input.value = r, k.trigger("change", this.input), typeof this.change == "function" && this.change(r);
|
|
1404
1478
|
}
|
|
1405
1479
|
};
|
|
1406
1480
|
return l(
|
|
@@ -1419,9 +1493,9 @@ const Gt = y(
|
|
|
1419
1493
|
}
|
|
1420
1494
|
}
|
|
1421
1495
|
), ut = (e, t) => l({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${t}` }, [
|
|
1422
|
-
|
|
1423
|
-
]), dt = ({ title: e }) =>
|
|
1424
|
-
|
|
1496
|
+
m({ size: "lg" }, e)
|
|
1497
|
+
]), dt = ({ title: e }) => $({ class: "flex flex-auto items-center" }, [
|
|
1498
|
+
C({ class: "text-lg font-semibold" }, e)
|
|
1425
1499
|
]), ht = c((e, t) => le(
|
|
1426
1500
|
{
|
|
1427
1501
|
class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
|
|
@@ -1437,14 +1511,14 @@ const Gt = y(
|
|
|
1437
1511
|
l({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1438
1512
|
l({ class: "flex flex-auto flex-col gap-y-2" }, [
|
|
1439
1513
|
dt(e),
|
|
1440
|
-
e.description &&
|
|
1514
|
+
e.description && g({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e.description),
|
|
1441
1515
|
l({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t)
|
|
1442
1516
|
]),
|
|
1443
|
-
e.buttons &&
|
|
1517
|
+
e.buttons && P({ class: "flex flex-col-reverse sm:flex-row sm:justify-end mt-6 gap-2 sm:gap-0 sm:gap-x-2" }, e.buttons)
|
|
1444
1518
|
])
|
|
1445
1519
|
])
|
|
1446
1520
|
]
|
|
1447
|
-
)), ft = (e) =>
|
|
1521
|
+
)), ft = (e) => G.render(e, app.root), V = {
|
|
1448
1522
|
info: {
|
|
1449
1523
|
borderColor: "border-blue-500",
|
|
1450
1524
|
bgColor: "bg-muted/10",
|
|
@@ -1486,9 +1560,9 @@ class mt extends w {
|
|
|
1486
1560
|
* @returns {object}
|
|
1487
1561
|
*/
|
|
1488
1562
|
render() {
|
|
1489
|
-
const t = (
|
|
1490
|
-
|
|
1491
|
-
}, { borderColor: s, bgColor: o, iconColor: n } =
|
|
1563
|
+
const t = (d) => {
|
|
1564
|
+
d.target === this.panel && this.close();
|
|
1565
|
+
}, { borderColor: s, bgColor: o, iconColor: n } = V[this.type] || V.default, r = `${this.getMainClass()} ${o} ${s}`, i = this.title || "Dialog Title";
|
|
1492
1566
|
return ht({
|
|
1493
1567
|
class: r,
|
|
1494
1568
|
title: i,
|
|
@@ -1544,7 +1618,7 @@ class mt extends w {
|
|
|
1544
1618
|
this.state.open = !1, this.panel.close(), typeof this.onClose == "function" && this.onClose(), this.destroy();
|
|
1545
1619
|
}
|
|
1546
1620
|
}
|
|
1547
|
-
class
|
|
1621
|
+
class Kt extends mt {
|
|
1548
1622
|
/**
|
|
1549
1623
|
* This will declare the props for the compiler.
|
|
1550
1624
|
*
|
|
@@ -1574,17 +1648,17 @@ class Jt extends mt {
|
|
|
1574
1648
|
this.confirmed && this.confirmed(), this.close();
|
|
1575
1649
|
}
|
|
1576
1650
|
}
|
|
1577
|
-
const
|
|
1578
|
-
|
|
1651
|
+
const Qt = c((e, t = []) => l({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
1652
|
+
K({ class: "flex flex-auto flex-col" }, [
|
|
1579
1653
|
l({ class: "flex flex-auto flex-col gap-y-4" }, [
|
|
1580
1654
|
l({ class: "flex flex-auto items-center justify-center" }, [
|
|
1581
1655
|
e.icon && l({ class: "w-16 h-16 mb-2 text-primary" }, [
|
|
1582
|
-
|
|
1656
|
+
m(e.icon)
|
|
1583
1657
|
])
|
|
1584
1658
|
]),
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1659
|
+
$({ class: "py-4 text-center" }, [
|
|
1660
|
+
C({ class: "text-xl font-bold" }, e.title),
|
|
1661
|
+
g({ class: "pb-8 text-muted-foreground" }, e.description || ""),
|
|
1588
1662
|
...t
|
|
1589
1663
|
])
|
|
1590
1664
|
])
|
|
@@ -1592,48 +1666,49 @@ const Kt = c((e, t = []) => l({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
|
1592
1666
|
]));
|
|
1593
1667
|
export {
|
|
1594
1668
|
kt as A,
|
|
1595
|
-
|
|
1669
|
+
Vt as B,
|
|
1596
1670
|
Pt as C,
|
|
1597
1671
|
St as D,
|
|
1598
|
-
|
|
1672
|
+
_t as E,
|
|
1599
1673
|
De as F,
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1674
|
+
Wt as G,
|
|
1675
|
+
Gt as H,
|
|
1676
|
+
Ut as I,
|
|
1603
1677
|
Jt as J,
|
|
1604
|
-
|
|
1605
|
-
|
|
1678
|
+
Kt as K,
|
|
1679
|
+
Rt as L,
|
|
1606
1680
|
Mt as M,
|
|
1607
|
-
|
|
1608
|
-
|
|
1681
|
+
jt as N,
|
|
1682
|
+
ht as O,
|
|
1609
1683
|
Ze as P,
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1684
|
+
mt as Q,
|
|
1685
|
+
Qt as R,
|
|
1686
|
+
At as S,
|
|
1687
|
+
zt as T,
|
|
1688
|
+
ve as a,
|
|
1614
1689
|
Dt as b,
|
|
1615
1690
|
Ce as c,
|
|
1616
1691
|
Ie as d,
|
|
1617
1692
|
$e as e,
|
|
1618
|
-
|
|
1693
|
+
Fe as f,
|
|
1619
1694
|
It as g,
|
|
1620
1695
|
$t as h,
|
|
1621
|
-
|
|
1622
|
-
|
|
1696
|
+
Ft as i,
|
|
1697
|
+
Te as j,
|
|
1623
1698
|
Bt as k,
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1699
|
+
K as l,
|
|
1700
|
+
Tt as m,
|
|
1701
|
+
Lt as n,
|
|
1702
|
+
Ne as o,
|
|
1703
|
+
Et as p,
|
|
1704
|
+
Nt as q,
|
|
1630
1705
|
Ot as r,
|
|
1631
|
-
|
|
1632
|
-
|
|
1706
|
+
D as s,
|
|
1707
|
+
x as t,
|
|
1633
1708
|
Re as u,
|
|
1634
|
-
|
|
1635
|
-
|
|
1709
|
+
qt as v,
|
|
1710
|
+
Ht as w,
|
|
1636
1711
|
Xe as x,
|
|
1637
1712
|
et as y,
|
|
1638
|
-
|
|
1713
|
+
Yt as z
|
|
1639
1714
|
};
|