@base-framework/ui 1.0.232 → 1.0.234
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-2O1fITpG.js → empty-state-25yJkl5U.js} +367 -288
- package/dist/format-BueUWxwT.js +122 -0
- package/dist/{image-scaler-BQ7WdtlV.js → image-scaler-DNyRgMye.js} +103 -222
- package/dist/index.es.js +123 -121
- package/dist/molecules.es.js +29 -28
- package/dist/organisms.es.js +29 -29
- package/dist/range-calendar-ppUinoRx.js +829 -0
- package/dist/{signature-panel-COreIRN2.js → signature-panel-CoExCJGP.js} +499 -814
- package/dist/types/components/molecules/date-time/date-range-picker.d.ts +10 -0
- package/dist/types/components/molecules/molecules.d.ts +1 -0
- package/dist/utils.es.js +5 -4
- package/package.json +1 -1
- package/dist/calendar-Bn55oWBo.js +0 -510
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Div as n, H5 as
|
|
2
|
-
import { Atom as c, Component as
|
|
3
|
-
import { P as
|
|
4
|
-
import { B as h, I as
|
|
1
|
+
import { Div as n, H5 as W, P as g, I as f, Li as V, Span as i, Ul as q, Button as m, OnState as w, Label as J, Form as G, H2 as S, Header as D, Footer as P, A as H, H3 as K, Checkbox as Q, Nav as X, Input as y, UseParent as Z, Time as ee, Dialog as te } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as c, Component as v, Html as M, Dom as se, base as oe, Data as I, Builder as Y, Jot as $, DateTime as A } from "@base-framework/base";
|
|
3
|
+
import { P as C, b as ne, R as le } from "./range-calendar-ppUinoRx.js";
|
|
4
|
+
import { B as h, I as b } from "./buttons-Cm9etaEG.js";
|
|
5
5
|
import { Icons as u } from "./icons.es.js";
|
|
6
|
-
import { Timer as
|
|
7
|
-
import { a as
|
|
8
|
-
|
|
6
|
+
import { Timer as re, List as ae, DynamicTime as ie } from "@base-framework/organisms";
|
|
7
|
+
import { a as x } from "./veil-D4dRxILB.js";
|
|
8
|
+
import { F as L } from "./format-BueUWxwT.js";
|
|
9
|
+
const F = {
|
|
9
10
|
info: {
|
|
10
11
|
borderColor: "border-blue-500",
|
|
11
12
|
bgColor: "bg-muted/10",
|
|
@@ -31,20 +32,20 @@ const P = {
|
|
|
31
32
|
bgColor: "bg-muted/10",
|
|
32
33
|
iconColor: "text-muted-foreground"
|
|
33
34
|
}
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
]),
|
|
37
|
-
const { borderColor:
|
|
38
|
-
return n({ class: `flex items-start p-4 border rounded-lg ${
|
|
35
|
+
}, ce = (e, t) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
|
|
36
|
+
f({ html: e })
|
|
37
|
+
]), de = (e) => W({ class: "font-semibold" }, e), ue = (e) => g({ class: "text-sm text-muted-foreground" }, e), wt = c(({ title: e, description: t, icon: s, type: o = "default" }) => {
|
|
38
|
+
const { borderColor: l, bgColor: r, iconColor: a } = F[o] || F.default;
|
|
39
|
+
return n({ class: `flex items-start p-4 border rounded-lg ${r} ${l}` }, [
|
|
39
40
|
// Icon and content
|
|
40
|
-
s &&
|
|
41
|
+
s && ce(s, a),
|
|
41
42
|
n({ class: "flex flex-col" }, [
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
de(e),
|
|
44
|
+
ue(t)
|
|
44
45
|
])
|
|
45
46
|
]);
|
|
46
47
|
});
|
|
47
|
-
class
|
|
48
|
+
class he extends v {
|
|
48
49
|
/**
|
|
49
50
|
* This will declare the props for the compiler.
|
|
50
51
|
*
|
|
@@ -62,48 +63,48 @@ class de extends x {
|
|
|
62
63
|
this.prepareDestroy(), this.removeContext();
|
|
63
64
|
const t = this.panel, s = this.removingClass;
|
|
64
65
|
if (!s) {
|
|
65
|
-
|
|
66
|
+
M.removeElement(t);
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
se.addClass(t, s), oe.on("animationend", t, (o) => M.removeElement(t));
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
const
|
|
72
|
+
const me = (e) => i({ class: "ml-auto text-xs tracking-widest opacity-60" }, e), fe = (e) => i({ class: "flex w-4 h-4", html: e }), pe = (e) => i({ class: "flex-auto" }, e), ge = (e, t) => V({
|
|
72
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",
|
|
73
74
|
click: () => t(e)
|
|
74
75
|
}, [
|
|
75
|
-
e.icon &&
|
|
76
|
-
|
|
77
|
-
e.shortcut &&
|
|
78
|
-
]),
|
|
79
|
-
e.map((s) =>
|
|
80
|
-
]),
|
|
76
|
+
e.icon && fe(e.icon),
|
|
77
|
+
pe(e.label),
|
|
78
|
+
e.shortcut && me(e.shortcut)
|
|
79
|
+
]), be = (e, t) => q({ class: "grid gap-2" }, [
|
|
80
|
+
e.map((s) => ge(s, t))
|
|
81
|
+
]), xe = (e) => n({ class: "w-full z-10" }, [
|
|
81
82
|
n({
|
|
82
83
|
class: "max-h-60 border rounded-md overflow-y-auto p-1 grid gap-2 divide-y divide-border",
|
|
83
|
-
for: ["groups", (t) =>
|
|
84
|
+
for: ["groups", (t) => be(t, e)]
|
|
84
85
|
})
|
|
85
|
-
]),
|
|
86
|
+
]), we = ({ label: e, icon: t, toggleDropdown: s }) => m({
|
|
86
87
|
cache: "button",
|
|
87
88
|
class: `inline-flex items-center justify-between rounded-md border border-input
|
|
88
89
|
bg-background px-2 py-2 text-sm font-medium hover:bg-muted
|
|
89
90
|
focus:outline-none transition duration-150 ease-in-out`,
|
|
90
91
|
click: s
|
|
91
92
|
}, [
|
|
92
|
-
e &&
|
|
93
|
-
t &&
|
|
94
|
-
]),
|
|
95
|
-
|
|
93
|
+
e && i(e),
|
|
94
|
+
t && f({ html: t })
|
|
95
|
+
]), ye = ({ onSelect: e }) => n([
|
|
96
|
+
w(
|
|
96
97
|
"open",
|
|
97
|
-
(t, s, o) => t ? new
|
|
98
|
+
(t, s, o) => t ? new C({
|
|
98
99
|
cache: "dropdown",
|
|
99
100
|
parent: o,
|
|
100
101
|
button: o.button
|
|
101
102
|
}, [
|
|
102
|
-
|
|
103
|
+
xe(e)
|
|
103
104
|
]) : null
|
|
104
105
|
)
|
|
105
106
|
]);
|
|
106
|
-
class
|
|
107
|
+
class yt extends v {
|
|
107
108
|
/**
|
|
108
109
|
* This will declare the props for the compiler.
|
|
109
110
|
*
|
|
@@ -118,7 +119,7 @@ class ft extends x {
|
|
|
118
119
|
* @returns {Data}
|
|
119
120
|
*/
|
|
120
121
|
setData() {
|
|
121
|
-
return new
|
|
122
|
+
return new I({
|
|
122
123
|
groups: this.groups || []
|
|
123
124
|
});
|
|
124
125
|
}
|
|
@@ -157,33 +158,33 @@ class ft extends x {
|
|
|
157
158
|
*/
|
|
158
159
|
render() {
|
|
159
160
|
return n({ class: "relative" }, [
|
|
160
|
-
|
|
161
|
+
we({
|
|
161
162
|
label: this.label,
|
|
162
163
|
icon: this.icon,
|
|
163
164
|
toggleDropdown: this.toggleDropdown.bind(this)
|
|
164
165
|
}),
|
|
165
|
-
|
|
166
|
+
ye({ onSelect: this.handleSelect.bind(this) })
|
|
166
167
|
]);
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
|
-
const
|
|
170
|
+
const ve = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t)), Ce = c((e, t) => J({ ...e, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, t)), ke = c((e, t) => g({ ...e, class: "text-sm text-muted-foreground italic" }, t)), Se = c((e, t) => g({ ...e, class: "text-sm text-destructive" }, t)), De = (e) => e.tag === "input" || e.tag === "select" || e.tag === "textarea", U = (e, t, s) => e.map((o) => (o.children && o.children.length > 0 && (o.children = U(o.children, t, s)), o.required && De(o) ? {
|
|
170
171
|
...o,
|
|
171
172
|
aria: {
|
|
172
173
|
invalid: ["hasError"]
|
|
173
174
|
},
|
|
174
175
|
invalid: s,
|
|
175
176
|
input: t
|
|
176
|
-
} : o)),
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
}, (
|
|
180
|
-
e.setError(
|
|
177
|
+
} : o)), Ie = c((e, t) => {
|
|
178
|
+
const l = U(t, (r) => {
|
|
179
|
+
r.target.checkValidity() && e.setError(null);
|
|
180
|
+
}, (r) => {
|
|
181
|
+
e.setError(r.target.validationMessage);
|
|
181
182
|
});
|
|
182
183
|
return n({
|
|
183
184
|
...e,
|
|
184
185
|
class: "w-full"
|
|
185
|
-
},
|
|
186
|
-
}),
|
|
186
|
+
}, l);
|
|
187
|
+
}), vt = x(
|
|
187
188
|
{
|
|
188
189
|
/**
|
|
189
190
|
* The initial state of the FormField.
|
|
@@ -204,70 +205,70 @@ const we = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
204
205
|
* @returns {object}
|
|
205
206
|
*/
|
|
206
207
|
render() {
|
|
207
|
-
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this,
|
|
208
|
-
this.state.error =
|
|
208
|
+
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this, l = (r) => {
|
|
209
|
+
this.state.error = r, this.state.hasError = !!r;
|
|
209
210
|
};
|
|
210
211
|
return n({ class: "flex flex-auto space-y-4" }, [
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
ve([
|
|
213
|
+
Ce({ htmlFor: t }, s),
|
|
214
|
+
Ie({
|
|
214
215
|
id: t,
|
|
215
216
|
name: e,
|
|
216
217
|
value: this.state.value,
|
|
217
|
-
setError:
|
|
218
|
+
setError: l
|
|
218
219
|
}, this.children),
|
|
219
|
-
o &&
|
|
220
|
-
n({ onState: ["error", (
|
|
220
|
+
o && ke({ id: this.getId("description") }, o),
|
|
221
|
+
n({ onState: ["error", (r) => r && Se(r)] })
|
|
221
222
|
])
|
|
222
223
|
]);
|
|
223
224
|
}
|
|
224
225
|
}
|
|
225
|
-
),
|
|
226
|
+
), $e = (e, t, s = null) => {
|
|
226
227
|
e.target.checkValidity() && (e.preventDefault(), s && s(e, t));
|
|
227
|
-
},
|
|
228
|
-
(e, t) => G({ ...e, submit: (s, o) =>
|
|
229
|
-
),
|
|
230
|
-
e.title &&
|
|
228
|
+
}, R = c(
|
|
229
|
+
(e, t) => G({ ...e, submit: (s, o) => $e(s, o, e.submit), class: `w-full ${e.class ?? ""}` }, t)
|
|
230
|
+
), Ct = c((e, t) => n({ ...e, class: `space-y-6 p-4 md:p-6 divide-y ${e.class || ""}` }, t)), kt = c((e, t = []) => n({ class: "space-y-3 py-4" }, [
|
|
231
|
+
e.title && S({ class: "font-semibold" }, e.title),
|
|
231
232
|
...t
|
|
232
|
-
])),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
]),
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
]),
|
|
233
|
+
])), St = (e, t) => n({ class: "flex justify-between" }, [
|
|
234
|
+
i({ class: "text-muted-foreground" }, e),
|
|
235
|
+
i(t)
|
|
236
|
+
]), Dt = (e, t) => n({ class: "flex" }, [
|
|
237
|
+
i({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, e),
|
|
238
|
+
i(t)
|
|
239
|
+
]), Te = ({ title: e, description: t, back: s, icon: o, options: l = [] }) => D({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
|
|
239
240
|
/**
|
|
240
241
|
* Back Button
|
|
241
242
|
*/
|
|
242
|
-
s && h({ variant: "icon", icon: u.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (
|
|
243
|
+
s && h({ variant: "icon", icon: u.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (r, a) => a.close() }),
|
|
243
244
|
/**
|
|
244
245
|
* Icon
|
|
245
246
|
*/
|
|
246
|
-
o && n({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [
|
|
247
|
+
o && n({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [b(o)]),
|
|
247
248
|
/**
|
|
248
249
|
* Title and Description
|
|
249
250
|
*/
|
|
250
251
|
n({ class: "flex flex-auto flex-row justify-between w-full ml-2 gap-2" }, [
|
|
251
252
|
n({ class: "flex flex-auto flex-col" }, [
|
|
252
|
-
|
|
253
|
+
S({ class: "text-lg font-semibold m-0 truncate" }, e),
|
|
253
254
|
t && n({ class: "text-sm text-muted-foreground truncate" }, t)
|
|
254
255
|
]),
|
|
255
|
-
...
|
|
256
|
+
...l
|
|
256
257
|
])
|
|
257
|
-
]),
|
|
258
|
+
]), Be = c((e, t) => n({
|
|
258
259
|
popover: "manual",
|
|
259
260
|
class: `modal m-auto top-0 right-0 bottom-0 left-0 fixed z-20 grid w-full h-full max-h-screen gap-2 lg:border bg-background text-foreground shadow-xl break-words p-0 ${e.class}`,
|
|
260
261
|
click: (s, o) => {
|
|
261
262
|
s.target === o.panel && (s.preventDefault(), s.stopPropagation(), o.state.open = !1);
|
|
262
263
|
}
|
|
263
264
|
}, [
|
|
264
|
-
|
|
265
|
-
|
|
265
|
+
R({ class: "modal-content relative bg-background z-[1] flex flex-auto flex-col space-y-4", submit: (s, o) => e.onSubmit && e.onSubmit(o) }, [
|
|
266
|
+
Te(e),
|
|
266
267
|
n({ class: "modal-body flex flex-grow flex-col overflow-y-auto py-0 px-6 z-0" }, t),
|
|
267
|
-
|
|
268
|
+
P({ class: "modal-footer sticky bg-background/80 backdrop-blur-md flex flex-none justify-between py-4 px-6 z-10" }, e.buttons)
|
|
268
269
|
])
|
|
269
|
-
])),
|
|
270
|
-
class
|
|
270
|
+
])), Ae = (e) => Y.render(e, app.root);
|
|
271
|
+
class It extends v {
|
|
271
272
|
/**
|
|
272
273
|
* This will declare the props for the compiler.
|
|
273
274
|
*
|
|
@@ -283,16 +284,16 @@ class yt extends x {
|
|
|
283
284
|
*/
|
|
284
285
|
render() {
|
|
285
286
|
const t = this.getMainClass(), s = this.title || "", o = this.description || null;
|
|
286
|
-
return
|
|
287
|
+
return Be(
|
|
287
288
|
{
|
|
288
289
|
class: t,
|
|
289
290
|
title: s,
|
|
290
291
|
description: o,
|
|
291
292
|
options: this.headerOptions(),
|
|
292
293
|
buttons: this.getButtons(),
|
|
293
|
-
onSubmit: (
|
|
294
|
-
let
|
|
295
|
-
this.onSubmit && (
|
|
294
|
+
onSubmit: (l) => {
|
|
295
|
+
let r = !0;
|
|
296
|
+
this.onSubmit && (r = this.onSubmit(l)), r !== !1 && this.destroy();
|
|
296
297
|
},
|
|
297
298
|
icon: this.icon,
|
|
298
299
|
back: this.back ?? !1,
|
|
@@ -398,7 +399,7 @@ class yt extends x {
|
|
|
398
399
|
* @returns {void}
|
|
399
400
|
*/
|
|
400
401
|
open() {
|
|
401
|
-
|
|
402
|
+
Ae(this), this.showModal();
|
|
402
403
|
}
|
|
403
404
|
/**
|
|
404
405
|
* This will destroy the modal.
|
|
@@ -427,7 +428,7 @@ class yt extends x {
|
|
|
427
428
|
this.panel.hidePopover(), this.state.open = !1, typeof this.onClose == "function" && this.onClose(this), document.documentElement.style.overflowY = "auto";
|
|
428
429
|
}
|
|
429
430
|
}
|
|
430
|
-
const
|
|
431
|
+
const N = {
|
|
431
432
|
info: {
|
|
432
433
|
bgColor: "bg-muted/10",
|
|
433
434
|
borderColor: "border-blue-500",
|
|
@@ -453,18 +454,18 @@ const F = {
|
|
|
453
454
|
borderColor: "border",
|
|
454
455
|
iconColor: "text-muted-foreground"
|
|
455
456
|
}
|
|
456
|
-
},
|
|
457
|
-
|
|
458
|
-
]),
|
|
457
|
+
}, Pe = (e) => D({ class: "flex justify-center" }, [
|
|
458
|
+
K({ class: "text-lg font-bold mb-0" }, e)
|
|
459
|
+
]), Me = c(({ href: e, class: t }, s) => H({
|
|
459
460
|
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}`,
|
|
460
461
|
href: e,
|
|
461
462
|
role: "alert"
|
|
462
|
-
}, s)),
|
|
463
|
+
}, s)), Le = c(({ close: e, class: t }, s) => n({
|
|
463
464
|
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}`,
|
|
464
465
|
click: () => e(),
|
|
465
466
|
role: "alert"
|
|
466
467
|
}, s));
|
|
467
|
-
class
|
|
468
|
+
class Fe extends he {
|
|
468
469
|
/**
|
|
469
470
|
* This will declare the props for the compiler.
|
|
470
471
|
*
|
|
@@ -487,14 +488,14 @@ class Le extends de {
|
|
|
487
488
|
* @returns {object}
|
|
488
489
|
*/
|
|
489
490
|
render() {
|
|
490
|
-
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(),
|
|
491
|
-
return
|
|
492
|
-
href:
|
|
491
|
+
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), l = this.href || null, r = this.getChildren(o);
|
|
492
|
+
return l ? Me({
|
|
493
|
+
href: l,
|
|
493
494
|
class: `${t} ${s}`
|
|
494
|
-
},
|
|
495
|
+
}, r) : Le({
|
|
495
496
|
close: this.close.bind(this),
|
|
496
497
|
class: `${t} ${s}`
|
|
497
|
-
},
|
|
498
|
+
}, r);
|
|
498
499
|
}
|
|
499
500
|
/**
|
|
500
501
|
* This will be called after the component is set up.
|
|
@@ -503,7 +504,7 @@ class Le extends de {
|
|
|
503
504
|
*/
|
|
504
505
|
afterSetup() {
|
|
505
506
|
const t = this.duration;
|
|
506
|
-
t !== "infinite" && (this.timer = new
|
|
507
|
+
t !== "infinite" && (this.timer = new re(t, this.close.bind(this)), this.timer.start());
|
|
507
508
|
}
|
|
508
509
|
/**
|
|
509
510
|
* This will get the style properties based on the notification type.
|
|
@@ -512,7 +513,7 @@ class Le extends de {
|
|
|
512
513
|
*/
|
|
513
514
|
getTypeStyles() {
|
|
514
515
|
const t = this.type || "default";
|
|
515
|
-
return
|
|
516
|
+
return N[t] || N.default;
|
|
516
517
|
}
|
|
517
518
|
/**
|
|
518
519
|
* This will get the buttons for the notification.
|
|
@@ -536,13 +537,13 @@ class Le extends de {
|
|
|
536
537
|
getChildren(t) {
|
|
537
538
|
return [
|
|
538
539
|
n({ class: "flex items-start" }, [
|
|
539
|
-
this.icon &&
|
|
540
|
+
this.icon && f({ class: `mr-4 ${t}`, html: this.icon }),
|
|
540
541
|
n({ class: "flex flex-auto flex-col" }, [
|
|
541
542
|
n({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
|
|
542
|
-
this.title &&
|
|
543
|
+
this.title && Pe(this.title)
|
|
543
544
|
]),
|
|
544
545
|
g({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
|
|
545
|
-
(this.primary || this.secondary) &&
|
|
546
|
+
(this.primary || this.secondary) && P({ class: "margin-top-24 flex align-center" }, this.getButtons())
|
|
546
547
|
])
|
|
547
548
|
]),
|
|
548
549
|
h({
|
|
@@ -563,8 +564,8 @@ class Le extends de {
|
|
|
563
564
|
t && t.stopPropagation(), this.duration !== "infinite" && this.timer.stop(), this.onClick && this.onClick(), this.destroy();
|
|
564
565
|
}
|
|
565
566
|
}
|
|
566
|
-
let
|
|
567
|
-
class
|
|
567
|
+
let Ne = 0;
|
|
568
|
+
class $t extends v {
|
|
568
569
|
/**
|
|
569
570
|
* This will render the component.
|
|
570
571
|
*
|
|
@@ -572,11 +573,11 @@ class vt extends x {
|
|
|
572
573
|
*/
|
|
573
574
|
render() {
|
|
574
575
|
return n({ class: "notification-container pointer-events-none inset-auto bg-transparent backdrop:bg-transparent overflow-visible fixed bottom-[80px] right-0 z-50 p-5", popover: "manual" }, [
|
|
575
|
-
new
|
|
576
|
+
new ae({
|
|
576
577
|
cache: "list",
|
|
577
578
|
key: "id",
|
|
578
579
|
role: "list",
|
|
579
|
-
rowItem: (t) => new
|
|
580
|
+
rowItem: (t) => new Fe(t)
|
|
580
581
|
})
|
|
581
582
|
]);
|
|
582
583
|
}
|
|
@@ -587,7 +588,7 @@ class vt extends x {
|
|
|
587
588
|
* @returns {void}
|
|
588
589
|
*/
|
|
589
590
|
addNotice(t = {}) {
|
|
590
|
-
t.id =
|
|
591
|
+
t.id = Ne++, t.callBack = () => this.removeNotice(t), this.list.append([t]), this.panel.hidePopover(), this.panel.showPopover();
|
|
591
592
|
}
|
|
592
593
|
/**
|
|
593
594
|
* This will remove a notification.
|
|
@@ -599,26 +600,26 @@ class vt extends x {
|
|
|
599
600
|
this.list.delete(t.id);
|
|
600
601
|
}
|
|
601
602
|
}
|
|
602
|
-
const
|
|
603
|
+
const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => m({
|
|
603
604
|
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',
|
|
604
605
|
onState: ["method", { active: e }],
|
|
605
606
|
dataSet: ["method", ["state", e, "active"]],
|
|
606
|
-
click: (o, { state:
|
|
607
|
-
|
|
607
|
+
click: (o, { state: l }) => {
|
|
608
|
+
l.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), ze(e);
|
|
608
609
|
}
|
|
609
610
|
}, [
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
])),
|
|
611
|
+
b(s),
|
|
612
|
+
i(t)
|
|
613
|
+
])), ze = (e) => {
|
|
613
614
|
var o;
|
|
614
615
|
const t = document.documentElement;
|
|
615
|
-
if (e === "system" && (e = (o = globalThis.matchMedia) != null && o.call(globalThis, "(prefers-color-scheme: dark)").matches ? "dark" : "light"),
|
|
616
|
+
if (e === "system" && (e = (o = globalThis.matchMedia) != null && o.call(globalThis, "(prefers-color-scheme: dark)").matches ? "dark" : "light"), z && !z("(prefers-color-scheme: " + e + ")").matches) {
|
|
616
617
|
t.classList.add(e);
|
|
617
618
|
return;
|
|
618
619
|
}
|
|
619
620
|
const s = e === "light" ? "dark" : "light";
|
|
620
621
|
t.classList.remove(s);
|
|
621
|
-
},
|
|
622
|
+
}, Tt = $(
|
|
622
623
|
{
|
|
623
624
|
/**
|
|
624
625
|
* This will render the component.
|
|
@@ -628,9 +629,9 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
628
629
|
render() {
|
|
629
630
|
return n({ class: "flex flex-auto flex-col" }, [
|
|
630
631
|
n({ class: "grid grid-cols-3 gap-4" }, [
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
632
|
+
T({ label: "System", value: "system", icon: u.adjustments.horizontal }),
|
|
633
|
+
T({ label: "Light", value: "light", icon: u.sun }),
|
|
634
|
+
T({ label: "Dark", value: "dark", icon: u.moon })
|
|
634
635
|
])
|
|
635
636
|
]);
|
|
636
637
|
},
|
|
@@ -645,7 +646,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
645
646
|
};
|
|
646
647
|
}
|
|
647
648
|
}
|
|
648
|
-
),
|
|
649
|
+
), Bt = x(
|
|
649
650
|
{
|
|
650
651
|
/**
|
|
651
652
|
* The initial state of the Toggle.
|
|
@@ -679,7 +680,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
679
680
|
s.toggle("active"), this.checkbox.checked = s.active, this.change && this.change(s.active, t, this);
|
|
680
681
|
}
|
|
681
682
|
}, [
|
|
682
|
-
|
|
683
|
+
Q({
|
|
683
684
|
cache: "checkbox",
|
|
684
685
|
class: "opacity-0 absolute top-0 left-0 bottom-0 right-0 w-full h-full",
|
|
685
686
|
/**
|
|
@@ -690,49 +691,49 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
690
691
|
bind: this.bind,
|
|
691
692
|
required: this.required
|
|
692
693
|
}),
|
|
693
|
-
|
|
694
|
+
i({
|
|
694
695
|
class: "absolute h-5 w-5 bg-background rounded-full shadow-md transform transition-transform",
|
|
695
696
|
onState: ["active", { "translate-x-[22px]": !0, "translate-x-[2px]": !1 }]
|
|
696
697
|
})
|
|
697
698
|
]);
|
|
698
699
|
}
|
|
699
700
|
}
|
|
700
|
-
),
|
|
701
|
+
), k = {
|
|
701
702
|
ONLINE: "online",
|
|
702
703
|
OFFLINE: "offline",
|
|
703
704
|
BUSY: "busy",
|
|
704
705
|
AWAY: "away"
|
|
705
|
-
},
|
|
706
|
+
}, p = {
|
|
706
707
|
ONLINE: "bg-green-500",
|
|
707
708
|
OFFLINE: "bg-gray-500",
|
|
708
709
|
BUSY: "bg-red-500",
|
|
709
710
|
AWAY: "bg-yellow-500"
|
|
710
|
-
},
|
|
711
|
-
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${
|
|
712
|
-
}),
|
|
711
|
+
}, Ee = (e = "") => (e = e.toUpperCase(), p[e] || p.OFFLINE), At = (e) => n({
|
|
712
|
+
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${Ee(e)}`
|
|
713
|
+
}), Pt = ({ propName: e = "status" } = {}) => n({
|
|
713
714
|
class: "absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full",
|
|
714
715
|
onSet: [e, {
|
|
715
|
-
[
|
|
716
|
-
[
|
|
717
|
-
[
|
|
718
|
-
[
|
|
716
|
+
[p.ONLINE]: k.ONLINE,
|
|
717
|
+
[p.OFFLINE]: k.OFFLINE,
|
|
718
|
+
[p.BUSY]: k.BUSY,
|
|
719
|
+
[p.AWAY]: k.AWAY
|
|
719
720
|
}]
|
|
720
|
-
}),
|
|
721
|
+
}), je = (e, t) => H(
|
|
721
722
|
{
|
|
722
723
|
href: e,
|
|
723
724
|
"aria-current": t === "Breadcrumb" && "page",
|
|
724
725
|
// Only set aria-current on the last item
|
|
725
726
|
class: "text-muted-foreground font-medium hover:text-foreground"
|
|
726
727
|
},
|
|
727
|
-
[
|
|
728
|
-
),
|
|
728
|
+
[i(t)]
|
|
729
|
+
), Oe = () => b({
|
|
729
730
|
class: "mx-3 text-muted-foreground",
|
|
730
731
|
"aria-hidden": !0,
|
|
731
732
|
size: "xs"
|
|
732
|
-
}, u.chevron.single.right),
|
|
733
|
-
e.href ?
|
|
734
|
-
e.separator &&
|
|
735
|
-
]),
|
|
733
|
+
}, u.chevron.single.right), Ve = (e) => n({ class: "flex items-center" }, [
|
|
734
|
+
e.href ? je(e.href, e.label) : i(e.label),
|
|
735
|
+
e.separator && Oe()
|
|
736
|
+
]), Mt = $(
|
|
736
737
|
{
|
|
737
738
|
/**
|
|
738
739
|
* Set initial data
|
|
@@ -740,7 +741,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
740
741
|
* @returns {Data}
|
|
741
742
|
*/
|
|
742
743
|
setData() {
|
|
743
|
-
return new
|
|
744
|
+
return new I({
|
|
744
745
|
// @ts-ignore
|
|
745
746
|
items: this.items || []
|
|
746
747
|
});
|
|
@@ -752,7 +753,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
752
753
|
*/
|
|
753
754
|
render() {
|
|
754
755
|
const e = this.data.items.length - 1;
|
|
755
|
-
return
|
|
756
|
+
return X(
|
|
756
757
|
{
|
|
757
758
|
"aria-label": "Breadcrumb",
|
|
758
759
|
class: "flex items-center space-x-1 text-sm"
|
|
@@ -761,7 +762,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
761
762
|
n({
|
|
762
763
|
role: "list",
|
|
763
764
|
class: "flex items-center",
|
|
764
|
-
for: ["items", (t, s) =>
|
|
765
|
+
for: ["items", (t, s) => Ve({
|
|
765
766
|
href: t.href,
|
|
766
767
|
label: t.label,
|
|
767
768
|
separator: s < e
|
|
@@ -771,7 +772,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
771
772
|
);
|
|
772
773
|
}
|
|
773
774
|
}
|
|
774
|
-
),
|
|
775
|
+
), E = {
|
|
775
776
|
xs: "h-1 w-1",
|
|
776
777
|
sm: "h-2 w-2",
|
|
777
778
|
md: "h-4 w-4",
|
|
@@ -780,21 +781,21 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
780
781
|
"2xl": "h-16 w-16",
|
|
781
782
|
"3xl": "h-24 w-24",
|
|
782
783
|
default: "h-4 w-4"
|
|
783
|
-
},
|
|
784
|
-
|
|
784
|
+
}, qe = (e) => E[e] || E.default, He = ({ index: e, size: t }) => n({ class: `${t} rounded-full bg-muted cursor-pointer` }, [
|
|
785
|
+
i({
|
|
785
786
|
class: "block w-full h-full rounded-full transition-colors",
|
|
786
787
|
onSet: ["activeIndex", {
|
|
787
788
|
"bg-primary": e,
|
|
788
789
|
"shadow-md": e
|
|
789
790
|
}],
|
|
790
|
-
click: (s, { data: o, onClick:
|
|
791
|
-
o.activeIndex = e,
|
|
791
|
+
click: (s, { data: o, onClick: l }) => {
|
|
792
|
+
o.activeIndex = e, l && l(e);
|
|
792
793
|
}
|
|
793
794
|
})
|
|
794
|
-
]), Ye = (e, t) => Array.from({ length: e }, (s, o) =>
|
|
795
|
+
]), Ye = (e, t) => Array.from({ length: e }, (s, o) => He({
|
|
795
796
|
index: o,
|
|
796
797
|
size: t
|
|
797
|
-
})),
|
|
798
|
+
})), Lt = $(
|
|
798
799
|
{
|
|
799
800
|
/**
|
|
800
801
|
* Defines component data (props).
|
|
@@ -802,7 +803,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
802
803
|
* @returns {Data}
|
|
803
804
|
*/
|
|
804
805
|
setData() {
|
|
805
|
-
return new
|
|
806
|
+
return new I({
|
|
806
807
|
// @ts-ignore
|
|
807
808
|
count: this.count || 4,
|
|
808
809
|
// total dots
|
|
@@ -816,7 +817,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
816
817
|
* @returns {object}
|
|
817
818
|
*/
|
|
818
819
|
render() {
|
|
819
|
-
const e = this.gap || "gap-2", t =
|
|
820
|
+
const e = this.gap || "gap-2", t = qe(this.size || "sm"), s = Ye(this.data.count, t);
|
|
820
821
|
return n(
|
|
821
822
|
{ class: "flex justify-center items-center py-2" },
|
|
822
823
|
[
|
|
@@ -825,37 +826,37 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
825
826
|
);
|
|
826
827
|
}
|
|
827
828
|
}
|
|
828
|
-
),
|
|
829
|
+
), Ue = ({ toggleDropdown: e }) => m(
|
|
829
830
|
{
|
|
830
831
|
cache: "button",
|
|
831
832
|
class: "relative z-[2] inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-muted h-10 px-4 py-2 justify-between",
|
|
832
833
|
click: e
|
|
833
834
|
},
|
|
834
835
|
[
|
|
835
|
-
|
|
836
|
-
|
|
836
|
+
i({ onState: ["selectedLabel", (t) => t || "Select item..."] }),
|
|
837
|
+
f({ html: u.chevron.upDown })
|
|
837
838
|
]
|
|
838
|
-
),
|
|
839
|
+
), Re = (e, t, s) => V({
|
|
839
840
|
class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
|
|
840
841
|
click: () => t(e),
|
|
841
842
|
onState: [s, "selectedValue", { "bg-secondary": e.value }]
|
|
842
843
|
}, [
|
|
843
|
-
e.icon &&
|
|
844
|
-
|
|
845
|
-
]),
|
|
846
|
-
|
|
847
|
-
]),
|
|
848
|
-
|
|
844
|
+
e.icon && i({ class: "mr-2 flex items-baseline" }, [b({ size: "xs" }, e.icon)]),
|
|
845
|
+
i({ class: "text-base font-normal" }, e.label)
|
|
846
|
+
]), _e = (e, t) => n({ class: "w-full border rounded-md" }, [
|
|
847
|
+
q({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) => Re(s, e, t)] })
|
|
848
|
+
]), We = ({ onSelect: e, state: t }) => n({ class: "flex flex-auto flex-col" }, [
|
|
849
|
+
w(
|
|
849
850
|
"open",
|
|
850
|
-
(s, o,
|
|
851
|
+
(s, o, l) => s ? new C({
|
|
851
852
|
cache: "dropdown",
|
|
852
|
-
parent:
|
|
853
|
-
button:
|
|
853
|
+
parent: l,
|
|
854
|
+
button: l.button
|
|
854
855
|
}, [
|
|
855
|
-
|
|
856
|
+
_e(e, t)
|
|
856
857
|
]) : null
|
|
857
858
|
)
|
|
858
|
-
]),
|
|
859
|
+
]), Ft = $(
|
|
859
860
|
{
|
|
860
861
|
/**
|
|
861
862
|
* This will set up the data.
|
|
@@ -863,7 +864,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
863
864
|
* @returns {Data}
|
|
864
865
|
*/
|
|
865
866
|
setData() {
|
|
866
|
-
return new
|
|
867
|
+
return new I({
|
|
867
868
|
// @ts-ignore
|
|
868
869
|
items: this.items || []
|
|
869
870
|
});
|
|
@@ -936,8 +937,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
936
937
|
const e = this.class || "", t = this.maxWidth || "max-w-[250px]", s = this.width || "w-full";
|
|
937
938
|
return n({ class: `relative ${s} flex flex-auto flex-col ${t} ${e}` }, [
|
|
938
939
|
// @ts-ignore
|
|
939
|
-
|
|
940
|
-
|
|
940
|
+
Ue({ toggleDropdown: this.toggleDropdown.bind(this) }),
|
|
941
|
+
We({
|
|
941
942
|
// @ts-ignore
|
|
942
943
|
state: this.state,
|
|
943
944
|
// @ts-ignore
|
|
@@ -945,7 +946,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
945
946
|
}),
|
|
946
947
|
// Hidden required input for form validation
|
|
947
948
|
// @ts-ignore
|
|
948
|
-
this.required &&
|
|
949
|
+
this.required && y({
|
|
949
950
|
class: "opacity-0 absolute top-0 left-0 z-[1]",
|
|
950
951
|
type: "text",
|
|
951
952
|
// @ts-ignore
|
|
@@ -963,20 +964,20 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
963
964
|
click: t,
|
|
964
965
|
icon: e,
|
|
965
966
|
"aria-label": s
|
|
966
|
-
}),
|
|
967
|
+
}), Je = ({ click: e }) => _({
|
|
967
968
|
icon: u.circleMinus,
|
|
968
969
|
click: e,
|
|
969
970
|
ariaLabel: "Decrement"
|
|
970
|
-
}),
|
|
971
|
+
}), Ge = ({ click: e }) => _({
|
|
971
972
|
icon: u.circlePlus,
|
|
972
973
|
click: e,
|
|
973
974
|
ariaLabel: "Increment"
|
|
974
|
-
}),
|
|
975
|
-
value: ["[[count]]",
|
|
975
|
+
}), Ke = ({ bind: e, min: t, max: s, readonly: o = !1 }) => Z(({ state: l }) => y({
|
|
976
|
+
value: ["[[count]]", l],
|
|
976
977
|
bind: e,
|
|
977
|
-
blur: (
|
|
978
|
-
let d = parseInt(
|
|
979
|
-
isNaN(d) && (d = t ?? 0), t !== void 0 && (d = Math.max(d, t)), s !== void 0 && (d = Math.min(d, s)),
|
|
978
|
+
blur: (r, { state: a }) => {
|
|
979
|
+
let d = parseInt(r.target.value, 10);
|
|
980
|
+
isNaN(d) && (d = t ?? 0), t !== void 0 && (d = Math.max(d, t)), s !== void 0 && (d = Math.min(d, s)), a.count = d;
|
|
980
981
|
},
|
|
981
982
|
class: "flex flex-auto text-lg font-medium bg-transparent text-center border min-w-0",
|
|
982
983
|
readonly: o,
|
|
@@ -984,7 +985,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
984
985
|
max: s,
|
|
985
986
|
type: "number",
|
|
986
987
|
"aria-label": "Counter"
|
|
987
|
-
})),
|
|
988
|
+
})), Nt = x(
|
|
988
989
|
{
|
|
989
990
|
/**
|
|
990
991
|
* Initial state for the counter component.
|
|
@@ -1007,46 +1008,46 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1007
1008
|
render() {
|
|
1008
1009
|
const e = this.class ?? "";
|
|
1009
1010
|
return n({ class: `flex flex-auto items-center justify-between space-x-4 p-4 ${e}` }, [
|
|
1010
|
-
|
|
1011
|
-
|
|
1011
|
+
Je({ click: () => this.state.decrement("count") }),
|
|
1012
|
+
Ke({
|
|
1012
1013
|
bind: this.bind,
|
|
1013
1014
|
readonly: this.readonly,
|
|
1014
1015
|
min: this.min,
|
|
1015
1016
|
max: this.max
|
|
1016
1017
|
}),
|
|
1017
|
-
|
|
1018
|
+
Ge({ click: () => this.state.increment("count") })
|
|
1018
1019
|
]);
|
|
1019
1020
|
}
|
|
1020
1021
|
}
|
|
1021
|
-
),
|
|
1022
|
+
), Qe = ({ bind: e, required: t }) => y({
|
|
1022
1023
|
cache: "input",
|
|
1023
1024
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1024
1025
|
bind: e,
|
|
1025
1026
|
required: t
|
|
1026
|
-
}),
|
|
1027
|
+
}), Xe = ({ bind: e, required: t, toggleOpen: s }) => m({
|
|
1027
1028
|
class: "relative flex items-center gap-2 w-full justify-between border border-input bg-background hover:bg-muted rounded-md h-10 px-4 py-2",
|
|
1028
1029
|
click: s
|
|
1029
1030
|
}, [
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
onState: ["selectedDate", (o) => o ?
|
|
1031
|
+
Qe({ bind: e, required: t }),
|
|
1032
|
+
i({
|
|
1033
|
+
onState: ["selectedDate", (o) => o ? A.format("standard", o) : "Pick a date"]
|
|
1033
1034
|
}),
|
|
1034
|
-
|
|
1035
|
-
]),
|
|
1035
|
+
f({ html: u.calendar.days })
|
|
1036
|
+
]), Ze = ({ handleDateSelect: e, blockPriorDates: t }) => w(
|
|
1036
1037
|
"open",
|
|
1037
|
-
(s, o,
|
|
1038
|
+
(s, o, l) => s ? new C({
|
|
1038
1039
|
cache: "dropdown",
|
|
1039
|
-
parent:
|
|
1040
|
-
button:
|
|
1040
|
+
parent: l,
|
|
1041
|
+
button: l.panel,
|
|
1041
1042
|
size: "fit"
|
|
1042
1043
|
}, [
|
|
1043
|
-
new
|
|
1044
|
-
selectedDate:
|
|
1044
|
+
new ne({
|
|
1045
|
+
selectedDate: l.state.selectedDate,
|
|
1045
1046
|
selectedCallBack: e,
|
|
1046
1047
|
blockPriorDates: t
|
|
1047
1048
|
})
|
|
1048
1049
|
]) : null
|
|
1049
|
-
),
|
|
1050
|
+
), zt = x(
|
|
1050
1051
|
{
|
|
1051
1052
|
/**
|
|
1052
1053
|
* The initial state of the DatePicker.
|
|
@@ -1078,71 +1079,148 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1078
1079
|
this.state.selectedDate = s, this.state.open = !1, this.input.value = s, typeof this.onChange == "function" && this.onChange(s);
|
|
1079
1080
|
};
|
|
1080
1081
|
return n({ class: "relative w-full max-w-[320px]" }, [
|
|
1081
|
-
|
|
1082
|
+
Xe({
|
|
1083
|
+
toggleOpen: e,
|
|
1084
|
+
bind: this.bind,
|
|
1085
|
+
required: this.required
|
|
1086
|
+
}),
|
|
1087
|
+
Ze({
|
|
1088
|
+
handleDateSelect: t,
|
|
1089
|
+
blockPriorDates: this.blockPriorDates || !1
|
|
1090
|
+
})
|
|
1091
|
+
]);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
), et = ({ bind: e, required: t }) => y({
|
|
1095
|
+
cache: "input",
|
|
1096
|
+
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1097
|
+
bind: e,
|
|
1098
|
+
required: t
|
|
1099
|
+
}), tt = ({ bind: e, required: t, toggleOpen: s }) => m({
|
|
1100
|
+
class: "relative flex items-center gap-2 w-full justify-between border border-input bg-background hover:bg-muted rounded-md h-10 px-4 py-2",
|
|
1101
|
+
click: s
|
|
1102
|
+
}, [
|
|
1103
|
+
et({ bind: e, required: t }),
|
|
1104
|
+
i(L.date("[[start]]", "Start Date")),
|
|
1105
|
+
i(" - "),
|
|
1106
|
+
i(L.date("[[end]]", "End Date")),
|
|
1107
|
+
f({ html: u.calendar.days })
|
|
1108
|
+
]), st = ({ handleDateSelect: e, blockPriorDates: t }) => w(
|
|
1109
|
+
"open",
|
|
1110
|
+
(s, o, l) => s ? new C({
|
|
1111
|
+
cache: "dropdown",
|
|
1112
|
+
parent: l,
|
|
1113
|
+
button: l.panel,
|
|
1114
|
+
size: "fit"
|
|
1115
|
+
}, [
|
|
1116
|
+
new le({
|
|
1117
|
+
startDate: l.state.start,
|
|
1118
|
+
endDate: l.state.end,
|
|
1119
|
+
onRangeSelect: e,
|
|
1120
|
+
blockPriorDates: t
|
|
1121
|
+
})
|
|
1122
|
+
]) : null
|
|
1123
|
+
), Et = x(
|
|
1124
|
+
{
|
|
1125
|
+
/**
|
|
1126
|
+
* The initial state of the DateRangePicker.
|
|
1127
|
+
*
|
|
1128
|
+
* @member {object} state
|
|
1129
|
+
*/
|
|
1130
|
+
state() {
|
|
1131
|
+
return {
|
|
1132
|
+
start: this.start ?? null,
|
|
1133
|
+
end: this.end ?? null,
|
|
1134
|
+
open: !1
|
|
1135
|
+
};
|
|
1136
|
+
},
|
|
1137
|
+
/**
|
|
1138
|
+
* This is added to check the input after the component is rendered.
|
|
1139
|
+
* to see if the bind updated the input value.
|
|
1140
|
+
*
|
|
1141
|
+
* @returns {void}
|
|
1142
|
+
*/
|
|
1143
|
+
after() {
|
|
1144
|
+
if (this.input.value) {
|
|
1145
|
+
const e = this.input.value.split("-");
|
|
1146
|
+
this.state.start = e[0], this.state.end = e[1];
|
|
1147
|
+
}
|
|
1148
|
+
},
|
|
1149
|
+
/**
|
|
1150
|
+
* Renders the DatePicker component.
|
|
1151
|
+
*
|
|
1152
|
+
* @returns {object}
|
|
1153
|
+
*/
|
|
1154
|
+
render() {
|
|
1155
|
+
const e = (s, { state: o }) => o.toggle("open"), t = (s, o) => {
|
|
1156
|
+
this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`, typeof this.onChange == "function" && this.onChange({ start: s, end: o });
|
|
1157
|
+
};
|
|
1158
|
+
return n({ class: "relative w-full max-w-[320px]" }, [
|
|
1159
|
+
tt({
|
|
1082
1160
|
toggleOpen: e,
|
|
1083
1161
|
bind: this.bind,
|
|
1084
1162
|
required: this.required
|
|
1085
1163
|
}),
|
|
1086
|
-
|
|
1164
|
+
st({
|
|
1087
1165
|
handleDateSelect: t,
|
|
1088
1166
|
blockPriorDates: this.blockPriorDates || !1
|
|
1089
1167
|
})
|
|
1090
1168
|
]);
|
|
1091
1169
|
}
|
|
1092
1170
|
}
|
|
1093
|
-
),
|
|
1094
|
-
new
|
|
1171
|
+
), jt = ({ dateTime: e = "", remoteTimeZone: t = "America/Denver", filter: s = null }) => ee([
|
|
1172
|
+
new ie({
|
|
1095
1173
|
dateTime: e,
|
|
1096
1174
|
filter: s || ((o) => {
|
|
1097
|
-
const
|
|
1098
|
-
return
|
|
1175
|
+
const l = A.getLocalTime(o, !0, !1, t);
|
|
1176
|
+
return A.getTimeFrame(l);
|
|
1099
1177
|
})
|
|
1100
1178
|
})
|
|
1101
1179
|
]);
|
|
1102
|
-
function
|
|
1103
|
-
return
|
|
1180
|
+
function ot({ bind: e, required: t }) {
|
|
1181
|
+
return y({
|
|
1104
1182
|
cache: "input",
|
|
1105
1183
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1106
1184
|
bind: e,
|
|
1107
1185
|
required: t
|
|
1108
1186
|
});
|
|
1109
1187
|
}
|
|
1110
|
-
function
|
|
1188
|
+
function nt({ bind: e, required: t, toggleOpen: s }) {
|
|
1111
1189
|
return m(
|
|
1112
1190
|
{
|
|
1113
1191
|
class: "relative flex items-center gap-2 w-full justify-between border border-input bg-background hover:bg-muted rounded-md h-10 px-4 py-2",
|
|
1114
1192
|
click: s
|
|
1115
1193
|
},
|
|
1116
1194
|
[
|
|
1117
|
-
|
|
1118
|
-
|
|
1195
|
+
ot({ bind: e, required: t }),
|
|
1196
|
+
i({
|
|
1119
1197
|
onState: ["selectedTime", (o) => o || "Pick a time"]
|
|
1120
1198
|
}),
|
|
1121
|
-
|
|
1199
|
+
f({ html: u.clock })
|
|
1122
1200
|
]
|
|
1123
1201
|
);
|
|
1124
1202
|
}
|
|
1125
|
-
function
|
|
1203
|
+
function B({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: l = !1 }) {
|
|
1126
1204
|
return n(
|
|
1127
1205
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1128
|
-
e.map((
|
|
1129
|
-
let
|
|
1206
|
+
e.map((r) => {
|
|
1207
|
+
let a = l ? r.toString().padStart(2, "0") : r.toString();
|
|
1130
1208
|
return m({
|
|
1131
|
-
text:
|
|
1209
|
+
text: a,
|
|
1132
1210
|
class: "hover:bg-muted/50 rounded-md px-2 py-1",
|
|
1133
|
-
click: () => t({ [o]:
|
|
1134
|
-
onState: [s, o, { "bg-muted":
|
|
1211
|
+
click: () => t({ [o]: a }),
|
|
1212
|
+
onState: [s, o, { "bg-muted": a }]
|
|
1135
1213
|
});
|
|
1136
1214
|
})
|
|
1137
1215
|
);
|
|
1138
1216
|
}
|
|
1139
|
-
function
|
|
1217
|
+
function lt({ handleTimeSelect: e }) {
|
|
1140
1218
|
return n(
|
|
1141
1219
|
{ class: "absolute mt-1 z-10 bg-background rounded-md shadow-lg" },
|
|
1142
1220
|
[
|
|
1143
|
-
|
|
1221
|
+
w(
|
|
1144
1222
|
"open",
|
|
1145
|
-
(t, s, o) => t ? new
|
|
1223
|
+
(t, s, o) => t ? new C(
|
|
1146
1224
|
{
|
|
1147
1225
|
cache: "dropdown",
|
|
1148
1226
|
parent: o,
|
|
@@ -1157,23 +1235,23 @@ function et({ handleTimeSelect: e }) {
|
|
|
1157
1235
|
{ class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
|
|
1158
1236
|
[
|
|
1159
1237
|
// Hours column
|
|
1160
|
-
|
|
1161
|
-
items: Array.from({ length: 12 }, (
|
|
1238
|
+
B({
|
|
1239
|
+
items: Array.from({ length: 12 }, (l, r) => r + 1),
|
|
1162
1240
|
handleTimeSelect: e,
|
|
1163
1241
|
state: o.state,
|
|
1164
1242
|
stateValue: "hour",
|
|
1165
1243
|
pad: !0
|
|
1166
1244
|
}),
|
|
1167
1245
|
// Minutes column
|
|
1168
|
-
|
|
1169
|
-
items: Array.from({ length: 60 }, (
|
|
1246
|
+
B({
|
|
1247
|
+
items: Array.from({ length: 60 }, (l, r) => r),
|
|
1170
1248
|
handleTimeSelect: e,
|
|
1171
1249
|
state: o.state,
|
|
1172
1250
|
stateValue: "minute",
|
|
1173
1251
|
pad: !0
|
|
1174
1252
|
}),
|
|
1175
1253
|
// AM/PM column
|
|
1176
|
-
|
|
1254
|
+
B({
|
|
1177
1255
|
items: ["AM", "PM"],
|
|
1178
1256
|
handleTimeSelect: e,
|
|
1179
1257
|
state: o.state,
|
|
@@ -1189,20 +1267,20 @@ function et({ handleTimeSelect: e }) {
|
|
|
1189
1267
|
]
|
|
1190
1268
|
);
|
|
1191
1269
|
}
|
|
1192
|
-
function
|
|
1270
|
+
function j(e) {
|
|
1193
1271
|
if (!e)
|
|
1194
1272
|
return { hour: null, minute: null, meridian: null };
|
|
1195
1273
|
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1196
1274
|
if (!s)
|
|
1197
1275
|
return { hour: null, minute: null, meridian: null };
|
|
1198
|
-
let [, o,
|
|
1199
|
-
return
|
|
1200
|
-
hour:
|
|
1276
|
+
let [, o, l, , r] = s, a = parseInt(o, 10), d = parseInt(l, 10);
|
|
1277
|
+
return a < 0 || a > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (r ? (r = r.toUpperCase(), r === "PM" && a < 12 ? a += 12 : r === "AM" && a === 12 && (a = 12)) : a === 0 ? (r = "AM", a = 12) : a < 12 ? r = "AM" : a === 12 ? r = "PM" : (r = "PM", a -= 12), {
|
|
1278
|
+
hour: a.toString().padStart(2, "0"),
|
|
1201
1279
|
minute: d.toString().padStart(2, "0"),
|
|
1202
|
-
meridian:
|
|
1280
|
+
meridian: r
|
|
1203
1281
|
});
|
|
1204
1282
|
}
|
|
1205
|
-
const
|
|
1283
|
+
const Ot = x(
|
|
1206
1284
|
{
|
|
1207
1285
|
/**
|
|
1208
1286
|
* The initial shallow state of the TimePicker.
|
|
@@ -1210,7 +1288,7 @@ const Lt = w(
|
|
|
1210
1288
|
* @member {object} state
|
|
1211
1289
|
*/
|
|
1212
1290
|
state() {
|
|
1213
|
-
const e = this.selectedTime ?? null, { hour: t, minute: s, meridian: o } =
|
|
1291
|
+
const e = this.selectedTime ?? null, { hour: t, minute: s, meridian: o } = j(e);
|
|
1214
1292
|
return {
|
|
1215
1293
|
selectedTime: e,
|
|
1216
1294
|
open: !1,
|
|
@@ -1226,7 +1304,7 @@ const Lt = w(
|
|
|
1226
1304
|
*/
|
|
1227
1305
|
after() {
|
|
1228
1306
|
if (this.input.value) {
|
|
1229
|
-
const { hour: e, minute: t, meridian: s } =
|
|
1307
|
+
const { hour: e, minute: t, meridian: s } = j(this.input.value);
|
|
1230
1308
|
this.state.set({
|
|
1231
1309
|
hour: e,
|
|
1232
1310
|
minute: t,
|
|
@@ -1241,32 +1319,32 @@ const Lt = w(
|
|
|
1241
1319
|
* @returns {object}
|
|
1242
1320
|
*/
|
|
1243
1321
|
render() {
|
|
1244
|
-
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian:
|
|
1245
|
-
if (s && (this.state.hour = s), o && (this.state.minute = o),
|
|
1246
|
-
const
|
|
1247
|
-
this.state.selectedTime =
|
|
1322
|
+
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: l }) => {
|
|
1323
|
+
if (s && (this.state.hour = s), o && (this.state.minute = o), l && (this.state.meridian = l), this.state.hour && this.state.minute && this.state.meridian) {
|
|
1324
|
+
const r = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1325
|
+
this.state.selectedTime = r, this.state.open = !1, this.input.value = r, typeof this.change == "function" && this.change(r);
|
|
1248
1326
|
}
|
|
1249
1327
|
};
|
|
1250
1328
|
return n(
|
|
1251
1329
|
{ class: "relative w-full max-w-[320px]" },
|
|
1252
1330
|
[
|
|
1253
|
-
|
|
1331
|
+
nt({
|
|
1254
1332
|
toggleOpen: e,
|
|
1255
1333
|
bind: this.bind,
|
|
1256
1334
|
required: this.required
|
|
1257
1335
|
}),
|
|
1258
|
-
|
|
1336
|
+
lt({
|
|
1259
1337
|
handleTimeSelect: t
|
|
1260
1338
|
})
|
|
1261
1339
|
]
|
|
1262
1340
|
);
|
|
1263
1341
|
}
|
|
1264
1342
|
}
|
|
1265
|
-
),
|
|
1266
|
-
|
|
1267
|
-
]),
|
|
1268
|
-
|
|
1269
|
-
]),
|
|
1343
|
+
), rt = (e, t) => n({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${t}` }, [
|
|
1344
|
+
b({ size: "lg" }, e)
|
|
1345
|
+
]), at = ({ title: e }) => D({ class: "flex flex-auto items-center" }, [
|
|
1346
|
+
S({ class: "text-lg font-semibold" }, e)
|
|
1347
|
+
]), it = c((e, t) => te(
|
|
1270
1348
|
{
|
|
1271
1349
|
class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
|
|
1272
1350
|
rounded-lg flex flex-auto flex-col
|
|
@@ -1277,18 +1355,18 @@ const Lt = w(
|
|
|
1277
1355
|
[
|
|
1278
1356
|
n({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
|
|
1279
1357
|
// Icon and content
|
|
1280
|
-
e.icon &&
|
|
1358
|
+
e.icon && rt(e.icon, e.iconColor),
|
|
1281
1359
|
n({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1282
1360
|
n({ class: "flex flex-auto flex-col space-y-2" }, [
|
|
1283
|
-
|
|
1361
|
+
at(e),
|
|
1284
1362
|
e.description && g({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e.description),
|
|
1285
1363
|
n({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t)
|
|
1286
1364
|
]),
|
|
1287
|
-
e.buttons &&
|
|
1365
|
+
e.buttons && P({ class: "flex flex-col-reverse sm:flex-row sm:justify-end mt-6 gap-2 sm:gap-0 sm:space-x-2" }, e.buttons)
|
|
1288
1366
|
])
|
|
1289
1367
|
])
|
|
1290
1368
|
]
|
|
1291
|
-
)),
|
|
1369
|
+
)), ct = (e) => Y.render(e, app.root), O = {
|
|
1292
1370
|
info: {
|
|
1293
1371
|
borderColor: "border-blue-500",
|
|
1294
1372
|
bgColor: "bg-muted/10",
|
|
@@ -1315,7 +1393,7 @@ const Lt = w(
|
|
|
1315
1393
|
iconColor: "text-muted-foreground"
|
|
1316
1394
|
}
|
|
1317
1395
|
};
|
|
1318
|
-
class
|
|
1396
|
+
class dt extends v {
|
|
1319
1397
|
/**
|
|
1320
1398
|
* This will declare the props for the compiler.
|
|
1321
1399
|
*
|
|
@@ -1332,13 +1410,13 @@ class lt extends x {
|
|
|
1332
1410
|
render() {
|
|
1333
1411
|
const t = (d) => {
|
|
1334
1412
|
d.target === this.panel && this.close();
|
|
1335
|
-
}, { borderColor: s, bgColor: o, iconColor:
|
|
1336
|
-
return
|
|
1337
|
-
class:
|
|
1338
|
-
title:
|
|
1413
|
+
}, { borderColor: s, bgColor: o, iconColor: l } = O[this.type] || O.default, r = `${this.getMainClass()} ${o} ${s}`, a = this.title || "Dialog Title";
|
|
1414
|
+
return it({
|
|
1415
|
+
class: r,
|
|
1416
|
+
title: a,
|
|
1339
1417
|
click: t,
|
|
1340
1418
|
icon: this.icon,
|
|
1341
|
-
iconColor:
|
|
1419
|
+
iconColor: l,
|
|
1342
1420
|
description: this.description,
|
|
1343
1421
|
buttons: this.getButtons()
|
|
1344
1422
|
}, this.children);
|
|
@@ -1377,7 +1455,7 @@ class lt extends x {
|
|
|
1377
1455
|
* @returns {void}
|
|
1378
1456
|
*/
|
|
1379
1457
|
open() {
|
|
1380
|
-
|
|
1458
|
+
ct(this), this.panel.showModal(), this.state.open = !0;
|
|
1381
1459
|
}
|
|
1382
1460
|
/**
|
|
1383
1461
|
* This will close the modal.
|
|
@@ -1388,7 +1466,7 @@ class lt extends x {
|
|
|
1388
1466
|
this.state.open = !1, this.panel.close(), typeof this.onClose == "function" && this.onClose(), this.destroy();
|
|
1389
1467
|
}
|
|
1390
1468
|
}
|
|
1391
|
-
class
|
|
1469
|
+
class Vt extends dt {
|
|
1392
1470
|
/**
|
|
1393
1471
|
* This will declare the props for the compiler.
|
|
1394
1472
|
*
|
|
@@ -1418,16 +1496,16 @@ class Pt extends lt {
|
|
|
1418
1496
|
this.confirmed && this.confirmed(), this.close();
|
|
1419
1497
|
}
|
|
1420
1498
|
}
|
|
1421
|
-
const
|
|
1422
|
-
|
|
1499
|
+
const qt = c((e, t = []) => n({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
1500
|
+
R({ class: "flex flex-auto flex-col" }, [
|
|
1423
1501
|
n({ class: "flex flex-auto flex-col space-y-4" }, [
|
|
1424
1502
|
n({ class: "flex flex-auto items-center justify-center" }, [
|
|
1425
1503
|
e.icon && n({ class: "w-16 h-16 mb-2 text-primary" }, [
|
|
1426
|
-
|
|
1504
|
+
b(e.icon)
|
|
1427
1505
|
])
|
|
1428
1506
|
]),
|
|
1429
|
-
|
|
1430
|
-
|
|
1507
|
+
D({ class: "py-4 text-center" }, [
|
|
1508
|
+
S({ class: "text-xl font-bold" }, e.title),
|
|
1431
1509
|
g({ class: "pb-8 text-muted-foreground" }, e.description || ""),
|
|
1432
1510
|
...t
|
|
1433
1511
|
])
|
|
@@ -1435,44 +1513,45 @@ const Ft = c((e, t = []) => n({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
|
1435
1513
|
])
|
|
1436
1514
|
]));
|
|
1437
1515
|
export {
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
Se as
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1516
|
+
wt as A,
|
|
1517
|
+
Mt as B,
|
|
1518
|
+
Dt as C,
|
|
1519
|
+
he as D,
|
|
1520
|
+
Ot as E,
|
|
1521
|
+
ve as F,
|
|
1522
|
+
Vt as G,
|
|
1523
|
+
it as H,
|
|
1524
|
+
dt as I,
|
|
1525
|
+
qt as J,
|
|
1526
|
+
It as M,
|
|
1527
|
+
$t as N,
|
|
1528
|
+
Ge as P,
|
|
1529
|
+
St as S,
|
|
1530
|
+
Tt as T,
|
|
1531
|
+
ge as a,
|
|
1532
|
+
yt as b,
|
|
1533
|
+
xe as c,
|
|
1534
|
+
Ce as d,
|
|
1535
|
+
ke as e,
|
|
1536
|
+
Se as f,
|
|
1537
|
+
Ie as g,
|
|
1538
|
+
vt as h,
|
|
1539
|
+
R as i,
|
|
1540
|
+
Ct as j,
|
|
1541
|
+
kt as k,
|
|
1542
|
+
Fe as l,
|
|
1543
|
+
Bt as m,
|
|
1544
|
+
At as n,
|
|
1545
|
+
Pt as o,
|
|
1546
|
+
k as p,
|
|
1547
|
+
p as q,
|
|
1548
|
+
Ee as r,
|
|
1549
|
+
Lt as s,
|
|
1550
|
+
Ft as t,
|
|
1551
|
+
Je as u,
|
|
1552
|
+
Ke as v,
|
|
1553
|
+
Nt as w,
|
|
1554
|
+
zt as x,
|
|
1555
|
+
Et as y,
|
|
1556
|
+
jt as z
|
|
1478
1557
|
};
|