@base-framework/ui 1.0.262 → 1.0.264
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms.es.js +36 -36
- package/dist/{empty-state-DowNCqbA.js → empty-state-DqbqL8Wo.js} +328 -319
- package/dist/index.es.js +152 -149
- package/dist/molecules.es.js +41 -38
- package/dist/{tooltip-iKwNah4y.js → tooltip-Pwsjx1Gp.js} +40 -65
- package/dist/types/components/molecules/form/form-card.d.ts +31 -0
- package/dist/types/components/molecules/molecules.d.ts +1 -0
- package/dist/veil-tVDPinrr.js +48 -0
- package/package.json +1 -1
- package/dist/veil-D4dRxILB.js +0 -21
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Div as
|
|
2
|
-
import { Atom as c, Component as
|
|
3
|
-
import { P as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { Div as l, H5 as J, P as m, I as p, Li as U, Span as i, Ul as V, Button as f, OnState as x, Label as R, H2 as v, Form as K, Header as I, Footer as A, A as q, H3 as Q, Checkbox as X, Input as w, Img as Z, Nav as ee, UseParent as H, Time as te, Dialog as se } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as c, Component as C, Html as L, Dom as oe, base as le, Data as $, Builder as Y, Jot as k, Events as ne, DateTime as F } from "@base-framework/base";
|
|
3
|
+
import { P as S, b as re, R as ae } from "./range-calendar-BxLjYfrT.js";
|
|
4
|
+
import { C as ie, F as ce, a as y } from "./veil-tVDPinrr.js";
|
|
5
|
+
import { B as h, I as g } from "./buttons-Cm9etaEG.js";
|
|
6
|
+
import { Icons as u } from "./icons.es.js";
|
|
7
|
+
import { Timer as de, List as ue, DynamicTime as he } from "@base-framework/organisms";
|
|
8
8
|
import { F as P } from "./format-DnofNaaz.js";
|
|
9
9
|
const M = {
|
|
10
10
|
info: {
|
|
@@ -32,20 +32,20 @@ const M = {
|
|
|
32
32
|
bgColor: "bg-muted/10",
|
|
33
33
|
iconColor: "text-muted-foreground"
|
|
34
34
|
}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
]),
|
|
38
|
-
const { borderColor:
|
|
39
|
-
return
|
|
35
|
+
}, fe = (e, t) => l({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
|
|
36
|
+
p({ html: e })
|
|
37
|
+
]), me = (e) => J({ class: "font-semibold" }, e), pe = (e) => m({ 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: a } = M[o] || M.default;
|
|
39
|
+
return l({ class: `flex items-start p-4 border rounded-lg ${r} ${n}` }, [
|
|
40
40
|
// Icon and content
|
|
41
|
-
s &&
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
s && fe(s, a),
|
|
42
|
+
l({ class: "flex flex-col" }, [
|
|
43
|
+
me(e),
|
|
44
|
+
pe(t)
|
|
45
45
|
])
|
|
46
46
|
]);
|
|
47
47
|
});
|
|
48
|
-
class
|
|
48
|
+
class ge extends C {
|
|
49
49
|
/**
|
|
50
50
|
* This will declare the props for the compiler.
|
|
51
51
|
*
|
|
@@ -63,48 +63,48 @@ class me extends v {
|
|
|
63
63
|
this.prepareDestroy(), this.removeContext();
|
|
64
64
|
const t = this.panel, s = this.removingClass;
|
|
65
65
|
if (!s) {
|
|
66
|
-
|
|
66
|
+
L.removeElement(t);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
oe.addClass(t, s),
|
|
69
|
+
oe.addClass(t, s), le.on("animationend", t, (o) => L.removeElement(t));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const be = (e) => i({ class: "ml-auto text-xs tracking-widest opacity-60" }, e), xe = (e) => i({ class: "flex w-4 h-4", html: e }), we = (e) => i({ class: "flex-auto" }, e), ye = (e, t) => U({
|
|
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
|
-
e.icon &&
|
|
77
|
-
|
|
78
|
-
e.shortcut &&
|
|
79
|
-
]),
|
|
80
|
-
e.map((s) =>
|
|
81
|
-
]),
|
|
82
|
-
|
|
76
|
+
e.icon && xe(e.icon),
|
|
77
|
+
we(e.label),
|
|
78
|
+
e.shortcut && be(e.shortcut)
|
|
79
|
+
]), ve = (e, t) => V({ class: "grid gap-2" }, [
|
|
80
|
+
e.map((s) => ye(s, t))
|
|
81
|
+
]), Ce = (e) => l({ class: "w-full z-10" }, [
|
|
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) => ve(t, e)]
|
|
85
85
|
})
|
|
86
|
-
]),
|
|
86
|
+
]), ke = ({ label: e, icon: t, toggleDropdown: s }) => f({
|
|
87
87
|
cache: "button",
|
|
88
88
|
class: `inline-flex items-center justify-between rounded-md border
|
|
89
89
|
px-2 py-2 text-sm font-medium hover:bg-muted
|
|
90
90
|
focus:outline-none transition duration-150 ease-in-out`,
|
|
91
91
|
click: s
|
|
92
92
|
}, [
|
|
93
|
-
e &&
|
|
94
|
-
t &&
|
|
95
|
-
]),
|
|
93
|
+
e && i(e),
|
|
94
|
+
t && p({ html: t })
|
|
95
|
+
]), Se = ({ onSelect: e }) => l([
|
|
96
96
|
x(
|
|
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
|
|
102
102
|
}, [
|
|
103
|
-
|
|
103
|
+
Ce(e)
|
|
104
104
|
]) : null
|
|
105
105
|
)
|
|
106
106
|
]);
|
|
107
|
-
class
|
|
107
|
+
class St extends C {
|
|
108
108
|
/**
|
|
109
109
|
* This will declare the props for the compiler.
|
|
110
110
|
*
|
|
@@ -157,34 +157,40 @@ class Ct extends v {
|
|
|
157
157
|
* @returns {object}
|
|
158
158
|
*/
|
|
159
159
|
render() {
|
|
160
|
-
return
|
|
161
|
-
|
|
160
|
+
return l({ class: "relative" }, [
|
|
161
|
+
ke({
|
|
162
162
|
label: this.label,
|
|
163
163
|
icon: this.icon,
|
|
164
164
|
toggleDropdown: this.toggleDropdown.bind(this)
|
|
165
165
|
}),
|
|
166
|
-
|
|
166
|
+
Se({ onSelect: this.handleSelect.bind(this) })
|
|
167
167
|
]);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const De = c((e, t) => l({ ...e, class: "flex flex-auto flex-col space-y-2" }, t)), Ie = c((e, t) => R({ ...e, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, t)), $e = c((e, t) => m({ ...e, class: "text-sm text-muted-foreground italic" }, t)), Te = c((e, t) => m({ ...e, class: "text-sm text-destructive" }, t)), Dt = c((e, t = []) => ie({ class: "space-y-0", margin: "m-0", padding: "p-0" }, [
|
|
171
|
+
e.title && v({ class: "text-lg font-semibold py-4 px-6" }, e.title),
|
|
172
|
+
e.description && m({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, e.description),
|
|
173
|
+
...t
|
|
174
|
+
])), It = c((e, t = []) => ce({ label: e.label, description: e.description, class: "py-4 px-6", border: e.border }, [
|
|
175
|
+
l({ class: "flex flex-col space-y-6" }, t)
|
|
176
|
+
])), $t = c((e, t = []) => l({ ...e, class: `flex flex-col pb-4 px-6 space-y-4 ${e.class || ""}` }, t)), Be = (e) => e.tag === "input" || e.tag === "select" || e.tag === "textarea", _ = (e, t, s) => e.map((o) => !o || (o.children && o.children.length > 0 && (o.children = _(o.children, t, s)), !o.required) ? o : Be(o) ? {
|
|
171
177
|
...o,
|
|
172
178
|
aria: {
|
|
173
179
|
invalid: ["hasError"]
|
|
174
180
|
},
|
|
175
181
|
invalid: s,
|
|
176
182
|
input: t
|
|
177
|
-
} : o),
|
|
178
|
-
const
|
|
183
|
+
} : o), Fe = c((e, t) => {
|
|
184
|
+
const n = _(t, (r) => {
|
|
179
185
|
r.target.checkValidity() && e.setError(null);
|
|
180
186
|
}, (r) => {
|
|
181
187
|
e.setError(r.target.validationMessage);
|
|
182
188
|
});
|
|
183
|
-
return
|
|
189
|
+
return l({
|
|
184
190
|
...e,
|
|
185
191
|
class: "w-full"
|
|
186
|
-
},
|
|
187
|
-
}),
|
|
192
|
+
}, n);
|
|
193
|
+
}), Tt = y(
|
|
188
194
|
{
|
|
189
195
|
/**
|
|
190
196
|
* The initial state of the FormField.
|
|
@@ -205,57 +211,57 @@ const ke = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
205
211
|
* @returns {object}
|
|
206
212
|
*/
|
|
207
213
|
render() {
|
|
208
|
-
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this,
|
|
214
|
+
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this, n = (r) => {
|
|
209
215
|
this.state.error = r, this.state.hasError = !!r;
|
|
210
216
|
};
|
|
211
|
-
return
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
217
|
+
return l({ class: "flex flex-auto space-y-4" }, [
|
|
218
|
+
De([
|
|
219
|
+
Ie({ htmlFor: t }, s),
|
|
220
|
+
Fe({
|
|
215
221
|
id: t,
|
|
216
222
|
name: e,
|
|
217
223
|
value: this.state.value,
|
|
218
|
-
setError:
|
|
224
|
+
setError: n
|
|
219
225
|
}, this.children),
|
|
220
|
-
o &&
|
|
221
|
-
|
|
226
|
+
o && $e({ id: this.getId("description") }, o),
|
|
227
|
+
l({ onState: ["error", (r) => r && Te(r)] })
|
|
222
228
|
])
|
|
223
229
|
]);
|
|
224
230
|
}
|
|
225
231
|
}
|
|
226
|
-
),
|
|
232
|
+
), Ae = (e, t, s = null) => {
|
|
227
233
|
e.target.checkValidity() && (e.preventDefault(), s && s(e, t));
|
|
228
234
|
}, W = c(
|
|
229
|
-
(e, t) => K({ ...e, submit: (s, o) =>
|
|
230
|
-
),
|
|
231
|
-
e.title &&
|
|
235
|
+
(e, t) => K({ ...e, submit: (s, o) => Ae(s, o, e.submit), class: `w-full ${e.class ?? ""}` }, t)
|
|
236
|
+
), Bt = c((e, t) => l({ ...e, class: `space-y-6 p-4 md:p-6 divide-y ${e.class || ""}` }, t)), Ft = c((e, t = []) => l({ class: "space-y-3 py-4" }, [
|
|
237
|
+
e.title && v({ class: "font-semibold" }, e.title),
|
|
232
238
|
...t
|
|
233
|
-
])),
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
]),
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
]),
|
|
239
|
+
])), At = (e, t) => l({ class: "flex justify-between" }, [
|
|
240
|
+
i({ class: "text-muted-foreground" }, e),
|
|
241
|
+
i(t)
|
|
242
|
+
]), Lt = (e, t) => l({ class: "flex" }, [
|
|
243
|
+
i({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, e),
|
|
244
|
+
i(t)
|
|
245
|
+
]), Le = ({ title: e, description: t, back: s, icon: o, options: n = [] }) => I({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
|
|
240
246
|
/**
|
|
241
247
|
* Back Button
|
|
242
248
|
*/
|
|
243
|
-
s && h({ variant: "icon", icon:
|
|
249
|
+
s && h({ variant: "icon", icon: u.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (r, a) => a.close() }),
|
|
244
250
|
/**
|
|
245
251
|
* Icon
|
|
246
252
|
*/
|
|
247
|
-
o &&
|
|
253
|
+
o && l({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [g(o)]),
|
|
248
254
|
/**
|
|
249
255
|
* Title and Description
|
|
250
256
|
*/
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
t &&
|
|
257
|
+
l({ class: "flex flex-auto flex-row justify-between w-full ml-2 gap-2" }, [
|
|
258
|
+
l({ class: "flex flex-auto flex-col" }, [
|
|
259
|
+
v({ class: "text-lg font-semibold m-0 truncate" }, e),
|
|
260
|
+
t && l({ class: "text-sm text-muted-foreground truncate" }, t)
|
|
255
261
|
]),
|
|
256
|
-
...
|
|
262
|
+
...n
|
|
257
263
|
])
|
|
258
|
-
]),
|
|
264
|
+
]), Pe = c((e, t) => l({
|
|
259
265
|
popover: "manual",
|
|
260
266
|
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}`,
|
|
261
267
|
click: (s, o) => {
|
|
@@ -263,12 +269,12 @@ const ke = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
263
269
|
}
|
|
264
270
|
}, [
|
|
265
271
|
W({ 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
|
-
|
|
267
|
-
|
|
268
|
-
|
|
272
|
+
Le(e),
|
|
273
|
+
l({ class: "modal-body flex flex-grow flex-col overflow-y-auto py-0 px-6 z-0" }, t),
|
|
274
|
+
A({ class: "modal-footer sticky bg-background/80 backdrop-blur-md flex flex-none justify-between py-4 px-6 z-10" }, e.buttons)
|
|
269
275
|
])
|
|
270
|
-
])),
|
|
271
|
-
class
|
|
276
|
+
])), Me = (e) => Y.render(e, app.root);
|
|
277
|
+
class Pt extends C {
|
|
272
278
|
/**
|
|
273
279
|
* This will declare the props for the compiler.
|
|
274
280
|
*
|
|
@@ -284,16 +290,16 @@ class Tt extends v {
|
|
|
284
290
|
*/
|
|
285
291
|
render() {
|
|
286
292
|
const t = this.getMainClass(), s = this.title || "", o = this.description || null;
|
|
287
|
-
return
|
|
293
|
+
return Pe(
|
|
288
294
|
{
|
|
289
295
|
class: t,
|
|
290
296
|
title: s,
|
|
291
297
|
description: o,
|
|
292
298
|
options: this.headerOptions(),
|
|
293
299
|
buttons: this.getButtons(),
|
|
294
|
-
onSubmit: (
|
|
300
|
+
onSubmit: (n) => {
|
|
295
301
|
let r = !0;
|
|
296
|
-
this.onSubmit && (r = this.onSubmit(
|
|
302
|
+
this.onSubmit && (r = this.onSubmit(n)), r !== !1 && this.destroy();
|
|
297
303
|
},
|
|
298
304
|
icon: this.icon,
|
|
299
305
|
back: this.back ?? !1,
|
|
@@ -399,7 +405,7 @@ class Tt extends v {
|
|
|
399
405
|
* @returns {void}
|
|
400
406
|
*/
|
|
401
407
|
open() {
|
|
402
|
-
|
|
408
|
+
Me(this), this.showModal();
|
|
403
409
|
}
|
|
404
410
|
/**
|
|
405
411
|
* This will destroy the modal.
|
|
@@ -454,18 +460,18 @@ const N = {
|
|
|
454
460
|
borderColor: "border",
|
|
455
461
|
iconColor: "text-muted-foreground"
|
|
456
462
|
}
|
|
457
|
-
},
|
|
463
|
+
}, Ne = (e) => I({ class: "flex justify-center" }, [
|
|
458
464
|
Q({ class: "text-lg font-bold mb-0" }, e)
|
|
459
|
-
]),
|
|
465
|
+
]), ze = c(({ href: e, class: t }, s) => q({
|
|
460
466
|
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}`,
|
|
461
467
|
href: e,
|
|
462
468
|
role: "alert"
|
|
463
|
-
}, s)),
|
|
469
|
+
}, s)), Ee = c(({ close: e, class: t }, s) => l({
|
|
464
470
|
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}`,
|
|
465
471
|
click: () => e(),
|
|
466
472
|
role: "alert"
|
|
467
473
|
}, s));
|
|
468
|
-
class
|
|
474
|
+
class je extends ge {
|
|
469
475
|
/**
|
|
470
476
|
* This will declare the props for the compiler.
|
|
471
477
|
*
|
|
@@ -488,11 +494,11 @@ class ze extends me {
|
|
|
488
494
|
* @returns {object}
|
|
489
495
|
*/
|
|
490
496
|
render() {
|
|
491
|
-
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(),
|
|
492
|
-
return
|
|
493
|
-
href:
|
|
497
|
+
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), n = this.href || null, r = this.getChildren(o);
|
|
498
|
+
return n ? ze({
|
|
499
|
+
href: n,
|
|
494
500
|
class: `${t} ${s}`
|
|
495
|
-
}, r) :
|
|
501
|
+
}, r) : Ee({
|
|
496
502
|
close: this.close.bind(this),
|
|
497
503
|
class: `${t} ${s}`
|
|
498
504
|
}, r);
|
|
@@ -504,7 +510,7 @@ class ze extends me {
|
|
|
504
510
|
*/
|
|
505
511
|
afterSetup() {
|
|
506
512
|
const t = this.duration;
|
|
507
|
-
t !== "infinite" && (this.timer = new
|
|
513
|
+
t !== "infinite" && (this.timer = new de(t, this.close.bind(this)), this.timer.start());
|
|
508
514
|
}
|
|
509
515
|
/**
|
|
510
516
|
* This will get the style properties based on the notification type.
|
|
@@ -522,7 +528,7 @@ class ze extends me {
|
|
|
522
528
|
*/
|
|
523
529
|
getButtons() {
|
|
524
530
|
return [
|
|
525
|
-
|
|
531
|
+
l({ class: "flex flex-row mt-6 gap-2" }, [
|
|
526
532
|
this.secondary && h({ variant: "outline", click: () => this.secondaryAction && this.secondaryAction() }, this.secondary),
|
|
527
533
|
this.primary && h({ click: () => this.primaryAction && this.primaryAction() }, this.primary)
|
|
528
534
|
])
|
|
@@ -536,20 +542,20 @@ class ze extends me {
|
|
|
536
542
|
*/
|
|
537
543
|
getChildren(t) {
|
|
538
544
|
return [
|
|
539
|
-
|
|
540
|
-
this.icon &&
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
this.title &&
|
|
545
|
+
l({ class: "flex items-start" }, [
|
|
546
|
+
this.icon && p({ class: `mr-4 ${t}`, html: this.icon }),
|
|
547
|
+
l({ class: "flex flex-auto flex-col" }, [
|
|
548
|
+
l({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
|
|
549
|
+
this.title && Ne(this.title)
|
|
544
550
|
]),
|
|
545
|
-
|
|
546
|
-
(this.primary || this.secondary) &&
|
|
551
|
+
m({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
|
|
552
|
+
(this.primary || this.secondary) && A({ class: "margin-top-24 flex align-center" }, this.getButtons())
|
|
547
553
|
])
|
|
548
554
|
]),
|
|
549
555
|
h({
|
|
550
556
|
class: "absolute top-[12px] right-[12px]",
|
|
551
557
|
variant: "icon",
|
|
552
|
-
icon:
|
|
558
|
+
icon: u.x,
|
|
553
559
|
click: this.close.bind(this)
|
|
554
560
|
})
|
|
555
561
|
];
|
|
@@ -564,20 +570,20 @@ class ze extends me {
|
|
|
564
570
|
t && t.stopPropagation(), this.duration !== "infinite" && this.timer.stop(), this.onClick && this.onClick(), this.destroy();
|
|
565
571
|
}
|
|
566
572
|
}
|
|
567
|
-
let
|
|
568
|
-
class
|
|
573
|
+
let Oe = 0;
|
|
574
|
+
class Mt extends C {
|
|
569
575
|
/**
|
|
570
576
|
* This will render the component.
|
|
571
577
|
*
|
|
572
578
|
* @returns {object}
|
|
573
579
|
*/
|
|
574
580
|
render() {
|
|
575
|
-
return
|
|
576
|
-
new
|
|
581
|
+
return l({ 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" }, [
|
|
582
|
+
new ue({
|
|
577
583
|
cache: "list",
|
|
578
584
|
key: "id",
|
|
579
585
|
role: "list",
|
|
580
|
-
rowItem: (t) => new
|
|
586
|
+
rowItem: (t) => new je(t)
|
|
581
587
|
})
|
|
582
588
|
]);
|
|
583
589
|
}
|
|
@@ -588,7 +594,7 @@ class Bt extends v {
|
|
|
588
594
|
* @returns {void}
|
|
589
595
|
*/
|
|
590
596
|
addNotice(t = {}) {
|
|
591
|
-
t.id =
|
|
597
|
+
t.id = Oe++, t.callBack = () => this.removeNotice(t), this.list.append([t]), this.panel.hidePopover(), this.panel.showPopover();
|
|
592
598
|
}
|
|
593
599
|
/**
|
|
594
600
|
* This will remove a notification.
|
|
@@ -604,13 +610,13 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
604
610
|
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',
|
|
605
611
|
onState: ["method", { active: e }],
|
|
606
612
|
dataSet: ["method", ["state", e, "active"]],
|
|
607
|
-
click: (o, { state:
|
|
608
|
-
|
|
613
|
+
click: (o, { state: n }) => {
|
|
614
|
+
n.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Ue(e);
|
|
609
615
|
}
|
|
610
616
|
}, [
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
])),
|
|
617
|
+
g(s),
|
|
618
|
+
i(t)
|
|
619
|
+
])), Ue = (e) => {
|
|
614
620
|
var o;
|
|
615
621
|
const t = document.documentElement;
|
|
616
622
|
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) {
|
|
@@ -619,7 +625,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
619
625
|
}
|
|
620
626
|
const s = e === "light" ? "dark" : "light";
|
|
621
627
|
t.classList.remove(s);
|
|
622
|
-
},
|
|
628
|
+
}, Nt = k(
|
|
623
629
|
{
|
|
624
630
|
/**
|
|
625
631
|
* This will render the component.
|
|
@@ -627,11 +633,11 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
627
633
|
* @returns {object}
|
|
628
634
|
*/
|
|
629
635
|
render() {
|
|
630
|
-
return
|
|
631
|
-
|
|
632
|
-
T({ label: "System", value: "system", icon:
|
|
633
|
-
T({ label: "Light", value: "light", icon:
|
|
634
|
-
T({ label: "Dark", value: "dark", icon:
|
|
636
|
+
return l({ class: "flex flex-auto flex-col" }, [
|
|
637
|
+
l({ class: "grid grid-cols-3 gap-4" }, [
|
|
638
|
+
T({ label: "System", value: "system", icon: u.adjustments.horizontal }),
|
|
639
|
+
T({ label: "Light", value: "light", icon: u.sun }),
|
|
640
|
+
T({ label: "Dark", value: "dark", icon: u.moon })
|
|
635
641
|
])
|
|
636
642
|
]);
|
|
637
643
|
},
|
|
@@ -646,7 +652,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
646
652
|
};
|
|
647
653
|
}
|
|
648
654
|
}
|
|
649
|
-
),
|
|
655
|
+
), zt = y(
|
|
650
656
|
{
|
|
651
657
|
/**
|
|
652
658
|
* The initial state of the Toggle.
|
|
@@ -691,34 +697,34 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
691
697
|
bind: this.bind,
|
|
692
698
|
required: this.required
|
|
693
699
|
}),
|
|
694
|
-
|
|
700
|
+
i({
|
|
695
701
|
class: "absolute h-5 w-5 bg-background rounded-full shadow-md transform transition-transform",
|
|
696
702
|
onState: ["active", { "translate-x-[22px]": !0, "translate-x-[2px]": !1 }]
|
|
697
703
|
})
|
|
698
704
|
]);
|
|
699
705
|
}
|
|
700
706
|
}
|
|
701
|
-
),
|
|
707
|
+
), D = {
|
|
702
708
|
ONLINE: "online",
|
|
703
709
|
OFFLINE: "offline",
|
|
704
710
|
BUSY: "busy",
|
|
705
711
|
AWAY: "away"
|
|
706
|
-
},
|
|
712
|
+
}, b = {
|
|
707
713
|
ONLINE: "bg-green-500",
|
|
708
714
|
OFFLINE: "bg-gray-500",
|
|
709
715
|
BUSY: "bg-red-500",
|
|
710
716
|
AWAY: "bg-yellow-500"
|
|
711
|
-
},
|
|
712
|
-
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${
|
|
713
|
-
}),
|
|
717
|
+
}, Ve = (e = "") => (e = e.toUpperCase(), b[e] || b.OFFLINE), Et = (e) => l({
|
|
718
|
+
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${Ve(e)}`
|
|
719
|
+
}), jt = ({ propName: e = "status" } = {}) => l({
|
|
714
720
|
class: "absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full",
|
|
715
721
|
onSet: [e, {
|
|
716
|
-
[
|
|
717
|
-
[
|
|
718
|
-
[
|
|
719
|
-
[
|
|
722
|
+
[b.ONLINE]: D.ONLINE,
|
|
723
|
+
[b.OFFLINE]: D.OFFLINE,
|
|
724
|
+
[b.BUSY]: D.BUSY,
|
|
725
|
+
[b.AWAY]: D.AWAY
|
|
720
726
|
}]
|
|
721
|
-
}),
|
|
727
|
+
}), Ot = k(
|
|
722
728
|
{
|
|
723
729
|
/**
|
|
724
730
|
* Get the initial state for the component.
|
|
@@ -738,7 +744,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
738
744
|
*/
|
|
739
745
|
openFileBrowse() {
|
|
740
746
|
const e = this.input;
|
|
741
|
-
e && (e.value = "",
|
|
747
|
+
e && (e.value = "", ne.trigger("click", e));
|
|
742
748
|
},
|
|
743
749
|
/**
|
|
744
750
|
* Get the URL for the uploaded file.
|
|
@@ -756,7 +762,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
756
762
|
*/
|
|
757
763
|
render() {
|
|
758
764
|
const e = "logo-upload", t = this.onChange || null;
|
|
759
|
-
return
|
|
765
|
+
return l({ class: "flex flex-col items-center" }, [
|
|
760
766
|
w({
|
|
761
767
|
id: e,
|
|
762
768
|
cache: "input",
|
|
@@ -764,12 +770,12 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
764
770
|
accept: "image/*",
|
|
765
771
|
class: "hidden",
|
|
766
772
|
change: (s) => {
|
|
767
|
-
var
|
|
768
|
-
const o = (
|
|
773
|
+
var n;
|
|
774
|
+
const o = (n = s.target.files) == null ? void 0 : n[0];
|
|
769
775
|
o && t && (this.state.loaded = !1, t(o, this.parent), this.src = this.getFileUrl(o), this.state.loaded = !0);
|
|
770
776
|
}
|
|
771
777
|
}),
|
|
772
|
-
|
|
778
|
+
l({
|
|
773
779
|
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",
|
|
774
780
|
click: (s) => {
|
|
775
781
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
@@ -785,30 +791,30 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
785
791
|
htmlFor: e,
|
|
786
792
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
787
793
|
}, [
|
|
788
|
-
|
|
789
|
-
|
|
794
|
+
g(u.upload),
|
|
795
|
+
l("Upload logo")
|
|
790
796
|
])
|
|
791
797
|
)
|
|
792
798
|
])
|
|
793
799
|
]);
|
|
794
800
|
}
|
|
795
801
|
}
|
|
796
|
-
),
|
|
802
|
+
), Re = (e, t) => q(
|
|
797
803
|
{
|
|
798
804
|
href: e,
|
|
799
805
|
"aria-current": t === "Breadcrumb" && "page",
|
|
800
806
|
// Only set aria-current on the last item
|
|
801
807
|
class: "text-muted-foreground font-medium hover:text-foreground"
|
|
802
808
|
},
|
|
803
|
-
[
|
|
804
|
-
),
|
|
809
|
+
[i(t)]
|
|
810
|
+
), qe = () => g({
|
|
805
811
|
class: "mx-3 text-muted-foreground",
|
|
806
812
|
"aria-hidden": !0,
|
|
807
813
|
size: "xs"
|
|
808
|
-
},
|
|
809
|
-
e.href ?
|
|
810
|
-
e.separator &&
|
|
811
|
-
]),
|
|
814
|
+
}, u.chevron.single.right), He = (e) => l({ class: "flex items-center" }, [
|
|
815
|
+
e.href ? Re(e.href, e.label) : i(e.label),
|
|
816
|
+
e.separator && qe()
|
|
817
|
+
]), Ut = k(
|
|
812
818
|
{
|
|
813
819
|
/**
|
|
814
820
|
* Set initial data
|
|
@@ -834,10 +840,10 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
834
840
|
class: "flex items-center space-x-1 text-sm"
|
|
835
841
|
},
|
|
836
842
|
[
|
|
837
|
-
|
|
843
|
+
l({
|
|
838
844
|
role: "list",
|
|
839
845
|
class: "flex items-center",
|
|
840
|
-
for: ["items", (t, s) =>
|
|
846
|
+
for: ["items", (t, s) => He({
|
|
841
847
|
href: t.href,
|
|
842
848
|
label: t.label,
|
|
843
849
|
separator: s < e
|
|
@@ -856,21 +862,21 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
856
862
|
"2xl": "h-16 w-16",
|
|
857
863
|
"3xl": "h-24 w-24",
|
|
858
864
|
default: "h-4 w-4"
|
|
859
|
-
},
|
|
860
|
-
|
|
865
|
+
}, Ye = (e) => E[e] || E.default, _e = ({ index: e, size: t }) => l({ class: `${t} rounded-full bg-muted cursor-pointer` }, [
|
|
866
|
+
i({
|
|
861
867
|
class: "block w-full h-full rounded-full transition-colors",
|
|
862
868
|
onSet: ["activeIndex", {
|
|
863
869
|
"bg-primary": e,
|
|
864
870
|
"shadow-md": e
|
|
865
871
|
}],
|
|
866
|
-
click: (s, { data: o, onClick:
|
|
867
|
-
o.activeIndex = e,
|
|
872
|
+
click: (s, { data: o, onClick: n }) => {
|
|
873
|
+
o.activeIndex = e, n && n(e);
|
|
868
874
|
}
|
|
869
875
|
})
|
|
870
|
-
]),
|
|
876
|
+
]), We = (e, t) => Array.from({ length: e }, (s, o) => _e({
|
|
871
877
|
index: o,
|
|
872
878
|
size: t
|
|
873
|
-
})),
|
|
879
|
+
})), Vt = k(
|
|
874
880
|
{
|
|
875
881
|
/**
|
|
876
882
|
* Defines component data (props).
|
|
@@ -892,46 +898,46 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
892
898
|
* @returns {object}
|
|
893
899
|
*/
|
|
894
900
|
render() {
|
|
895
|
-
const e = this.gap || "gap-2", t =
|
|
896
|
-
return
|
|
901
|
+
const e = this.gap || "gap-2", t = Ye(this.size || "sm"), s = We(this.data.count, t);
|
|
902
|
+
return l(
|
|
897
903
|
{ class: "flex justify-center items-center py-2" },
|
|
898
904
|
[
|
|
899
|
-
|
|
905
|
+
l({ class: `flex ${e}` }, s)
|
|
900
906
|
]
|
|
901
907
|
);
|
|
902
908
|
}
|
|
903
909
|
}
|
|
904
|
-
),
|
|
910
|
+
), Ge = ({ toggleDropdown: e }) => f(
|
|
905
911
|
{
|
|
906
912
|
cache: "button",
|
|
907
913
|
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 bg-input hover:bg-muted h-10 px-4 py-2 justify-between",
|
|
908
914
|
click: e
|
|
909
915
|
},
|
|
910
916
|
[
|
|
911
|
-
|
|
912
|
-
|
|
917
|
+
i({ onState: ["selectedLabel", (t) => t || "Select item..."] }),
|
|
918
|
+
p({ html: u.chevron.upDown })
|
|
913
919
|
]
|
|
914
|
-
),
|
|
920
|
+
), Je = (e, t, s) => U({
|
|
915
921
|
class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
|
|
916
922
|
click: () => t(e),
|
|
917
923
|
onState: [s, "selectedValue", { "bg-secondary": e.value }]
|
|
918
924
|
}, [
|
|
919
|
-
e.icon &&
|
|
920
|
-
|
|
921
|
-
]),
|
|
922
|
-
V({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) =>
|
|
923
|
-
]),
|
|
925
|
+
e.icon && i({ class: "mr-2 flex items-baseline" }, [g({ size: "xs" }, e.icon)]),
|
|
926
|
+
i({ class: "text-base font-normal" }, e.label)
|
|
927
|
+
]), Ke = (e, t) => l({ class: "w-full border rounded-md" }, [
|
|
928
|
+
V({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) => Je(s, e, t)] })
|
|
929
|
+
]), Qe = ({ onSelect: e, state: t }) => l({ class: "flex flex-auto flex-col" }, [
|
|
924
930
|
x(
|
|
925
931
|
"open",
|
|
926
|
-
(s, o,
|
|
932
|
+
(s, o, n) => s ? new S({
|
|
927
933
|
cache: "dropdown",
|
|
928
|
-
parent:
|
|
929
|
-
button:
|
|
934
|
+
parent: n,
|
|
935
|
+
button: n.button
|
|
930
936
|
}, [
|
|
931
|
-
|
|
937
|
+
Ke(e, t)
|
|
932
938
|
]) : null
|
|
933
939
|
)
|
|
934
|
-
]),
|
|
940
|
+
]), Rt = k(
|
|
935
941
|
{
|
|
936
942
|
/**
|
|
937
943
|
* This will set up the data.
|
|
@@ -1010,10 +1016,10 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1010
1016
|
*/
|
|
1011
1017
|
render() {
|
|
1012
1018
|
const e = this.class || "", t = this.maxWidth || "max-w-[250px]", s = this.width || "w-full";
|
|
1013
|
-
return
|
|
1019
|
+
return l({ class: `relative ${s} flex flex-auto flex-col ${t} ${e}` }, [
|
|
1014
1020
|
// @ts-ignore
|
|
1015
|
-
|
|
1016
|
-
|
|
1021
|
+
Ge({ toggleDropdown: this.toggleDropdown.bind(this) }),
|
|
1022
|
+
Qe({
|
|
1017
1023
|
// @ts-ignore
|
|
1018
1024
|
state: this.state,
|
|
1019
1025
|
// @ts-ignore
|
|
@@ -1033,26 +1039,26 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1033
1039
|
]);
|
|
1034
1040
|
}
|
|
1035
1041
|
}
|
|
1036
|
-
),
|
|
1042
|
+
), G = ({ icon: e, click: t, ariaLabel: s }) => h({
|
|
1037
1043
|
variant: "icon",
|
|
1038
1044
|
class: "flex flex-none",
|
|
1039
1045
|
click: t,
|
|
1040
1046
|
icon: e,
|
|
1041
1047
|
"aria-label": s
|
|
1042
|
-
}),
|
|
1043
|
-
icon:
|
|
1048
|
+
}), Xe = ({ click: e }) => G({
|
|
1049
|
+
icon: u.circleMinus,
|
|
1044
1050
|
click: e,
|
|
1045
1051
|
ariaLabel: "Decrement"
|
|
1046
|
-
}),
|
|
1047
|
-
icon:
|
|
1052
|
+
}), Ze = ({ click: e }) => G({
|
|
1053
|
+
icon: u.circlePlus,
|
|
1048
1054
|
click: e,
|
|
1049
1055
|
ariaLabel: "Increment"
|
|
1050
|
-
}),
|
|
1051
|
-
value: ["[[count]]",
|
|
1056
|
+
}), et = ({ bind: e, min: t, max: s, readonly: o = !1 }) => H(({ state: n }) => w({
|
|
1057
|
+
value: ["[[count]]", n],
|
|
1052
1058
|
bind: e,
|
|
1053
|
-
blur: (r, { state:
|
|
1054
|
-
let
|
|
1055
|
-
isNaN(
|
|
1059
|
+
blur: (r, { state: a }) => {
|
|
1060
|
+
let d = parseInt(r.target.value, 10);
|
|
1061
|
+
isNaN(d) && (d = t ?? 0), t !== void 0 && (d = Math.max(d, t)), s !== void 0 && (d = Math.min(d, s)), a.count = d;
|
|
1056
1062
|
},
|
|
1057
1063
|
class: "flex flex-auto text-lg font-medium bg-input text-center border min-w-0",
|
|
1058
1064
|
readonly: o,
|
|
@@ -1060,7 +1066,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1060
1066
|
max: s,
|
|
1061
1067
|
type: "number",
|
|
1062
1068
|
"aria-label": "Counter"
|
|
1063
|
-
})),
|
|
1069
|
+
})), qt = y(
|
|
1064
1070
|
{
|
|
1065
1071
|
/**
|
|
1066
1072
|
* Initial state for the counter component.
|
|
@@ -1082,47 +1088,47 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1082
1088
|
*/
|
|
1083
1089
|
render() {
|
|
1084
1090
|
const e = this.class ?? "";
|
|
1085
|
-
return
|
|
1086
|
-
|
|
1087
|
-
|
|
1091
|
+
return l({ class: `flex flex-auto items-center justify-between space-x-4 p-4 ${e}` }, [
|
|
1092
|
+
Xe({ click: () => this.state.decrement("count") }),
|
|
1093
|
+
et({
|
|
1088
1094
|
bind: this.bind,
|
|
1089
1095
|
readonly: this.readonly,
|
|
1090
1096
|
min: this.min,
|
|
1091
1097
|
max: this.max
|
|
1092
1098
|
}),
|
|
1093
|
-
|
|
1099
|
+
Ze({ click: () => this.state.increment("count") })
|
|
1094
1100
|
]);
|
|
1095
1101
|
}
|
|
1096
1102
|
}
|
|
1097
|
-
),
|
|
1103
|
+
), tt = ({ bind: e, required: t }) => w({
|
|
1098
1104
|
cache: "input",
|
|
1099
1105
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1100
1106
|
bind: e,
|
|
1101
1107
|
required: t
|
|
1102
|
-
}),
|
|
1108
|
+
}), st = ({ bind: e, required: t, toggleOpen: s }) => f({
|
|
1103
1109
|
class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 px-4 py-2",
|
|
1104
1110
|
click: s
|
|
1105
1111
|
}, [
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
onState: ["selectedDate", (o) => o ?
|
|
1112
|
+
tt({ bind: e, required: t }),
|
|
1113
|
+
i({
|
|
1114
|
+
onState: ["selectedDate", (o) => o ? F.format("standard", o) : "Pick a date"]
|
|
1109
1115
|
}),
|
|
1110
|
-
|
|
1111
|
-
]),
|
|
1116
|
+
p({ html: u.calendar.days })
|
|
1117
|
+
]), ot = ({ handleDateSelect: e, blockPriorDates: t }) => x(
|
|
1112
1118
|
"open",
|
|
1113
|
-
(s, o,
|
|
1119
|
+
(s, o, n) => s ? new S({
|
|
1114
1120
|
cache: "dropdown",
|
|
1115
|
-
parent:
|
|
1116
|
-
button:
|
|
1121
|
+
parent: n,
|
|
1122
|
+
button: n.panel,
|
|
1117
1123
|
size: "fit"
|
|
1118
1124
|
}, [
|
|
1119
1125
|
new re({
|
|
1120
|
-
selectedDate:
|
|
1126
|
+
selectedDate: n.state.selectedDate,
|
|
1121
1127
|
selectedCallBack: e,
|
|
1122
1128
|
blockPriorDates: t
|
|
1123
1129
|
})
|
|
1124
1130
|
]) : null
|
|
1125
|
-
),
|
|
1131
|
+
), Ht = y(
|
|
1126
1132
|
{
|
|
1127
1133
|
/**
|
|
1128
1134
|
* The initial state of the DatePicker.
|
|
@@ -1153,51 +1159,51 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1153
1159
|
const e = (s, { state: o }) => o.toggle("open"), t = (s) => {
|
|
1154
1160
|
this.state.selectedDate = s, this.state.open = !1, this.input.value = s, typeof this.onChange == "function" && this.onChange(s);
|
|
1155
1161
|
};
|
|
1156
|
-
return
|
|
1157
|
-
|
|
1162
|
+
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1163
|
+
st({
|
|
1158
1164
|
toggleOpen: e,
|
|
1159
1165
|
bind: this.bind,
|
|
1160
1166
|
required: this.required
|
|
1161
1167
|
}),
|
|
1162
|
-
|
|
1168
|
+
ot({
|
|
1163
1169
|
handleDateSelect: t,
|
|
1164
1170
|
blockPriorDates: this.blockPriorDates || !1
|
|
1165
1171
|
})
|
|
1166
1172
|
]);
|
|
1167
1173
|
}
|
|
1168
1174
|
}
|
|
1169
|
-
),
|
|
1175
|
+
), lt = ({ bind: e, required: t }) => w({
|
|
1170
1176
|
cache: "input",
|
|
1171
1177
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1172
1178
|
bind: e,
|
|
1173
1179
|
required: t
|
|
1174
|
-
}),
|
|
1180
|
+
}), nt = ({ bind: e, required: t, toggleOpen: s }) => f({
|
|
1175
1181
|
class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 px-4 py-2",
|
|
1176
1182
|
click: s
|
|
1177
1183
|
}, [
|
|
1178
|
-
|
|
1184
|
+
lt({ bind: e, required: t }),
|
|
1179
1185
|
H(({ state: o }) => [
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1186
|
+
i(P.date(["[[start]]", o], "Start Date")),
|
|
1187
|
+
i(" - "),
|
|
1188
|
+
i(P.date(["[[end]]", o], "End Date"))
|
|
1183
1189
|
]),
|
|
1184
|
-
|
|
1185
|
-
]),
|
|
1190
|
+
p({ html: u.calendar.days })
|
|
1191
|
+
]), rt = ({ handleDateSelect: e, blockPriorDates: t }) => x(
|
|
1186
1192
|
"open",
|
|
1187
|
-
(s, o,
|
|
1193
|
+
(s, o, n) => s ? new S({
|
|
1188
1194
|
cache: "dropdown",
|
|
1189
|
-
parent:
|
|
1190
|
-
button:
|
|
1195
|
+
parent: n,
|
|
1196
|
+
button: n.panel,
|
|
1191
1197
|
size: "xl"
|
|
1192
1198
|
}, [
|
|
1193
|
-
new
|
|
1194
|
-
startDate:
|
|
1195
|
-
endDate:
|
|
1199
|
+
new ae({
|
|
1200
|
+
startDate: n.state.start,
|
|
1201
|
+
endDate: n.state.end,
|
|
1196
1202
|
onRangeSelect: e,
|
|
1197
1203
|
blockPriorDates: t
|
|
1198
1204
|
})
|
|
1199
1205
|
]) : null
|
|
1200
|
-
),
|
|
1206
|
+
), Yt = y(
|
|
1201
1207
|
{
|
|
1202
1208
|
/**
|
|
1203
1209
|
* The initial state of the DateRangePicker.
|
|
@@ -1232,29 +1238,29 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1232
1238
|
const e = (s, { state: o }) => o.toggle("open"), t = (s, o) => {
|
|
1233
1239
|
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 }, this.parent);
|
|
1234
1240
|
};
|
|
1235
|
-
return
|
|
1236
|
-
|
|
1241
|
+
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1242
|
+
nt({
|
|
1237
1243
|
toggleOpen: e,
|
|
1238
1244
|
bind: this.bind,
|
|
1239
1245
|
required: this.required
|
|
1240
1246
|
}),
|
|
1241
|
-
|
|
1247
|
+
rt({
|
|
1242
1248
|
handleDateSelect: t,
|
|
1243
1249
|
blockPriorDates: this.blockPriorDates || !1
|
|
1244
1250
|
})
|
|
1245
1251
|
]);
|
|
1246
1252
|
}
|
|
1247
1253
|
}
|
|
1248
|
-
),
|
|
1249
|
-
new
|
|
1254
|
+
), _t = ({ dateTime: e = "", remoteTimeZone: t = "America/Denver", filter: s = null }) => te([
|
|
1255
|
+
new he({
|
|
1250
1256
|
dateTime: e,
|
|
1251
1257
|
filter: s || ((o) => {
|
|
1252
|
-
const
|
|
1253
|
-
return
|
|
1258
|
+
const n = F.getLocalTime(o, !0, !1, t);
|
|
1259
|
+
return F.getTimeFrame(n);
|
|
1254
1260
|
})
|
|
1255
1261
|
})
|
|
1256
1262
|
]);
|
|
1257
|
-
function
|
|
1263
|
+
function at({ bind: e, required: t }) {
|
|
1258
1264
|
return w({
|
|
1259
1265
|
cache: "input",
|
|
1260
1266
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
@@ -1262,39 +1268,39 @@ function lt({ bind: e, required: t }) {
|
|
|
1262
1268
|
required: t
|
|
1263
1269
|
});
|
|
1264
1270
|
}
|
|
1265
|
-
function
|
|
1271
|
+
function it({ bind: e, required: t, toggleOpen: s }) {
|
|
1266
1272
|
return f(
|
|
1267
1273
|
{
|
|
1268
1274
|
class: "relative flex items-center gap-2 w-full justify-between border bg-background hover:bg-muted rounded-md h-10 px-4 py-2",
|
|
1269
1275
|
click: s
|
|
1270
1276
|
},
|
|
1271
1277
|
[
|
|
1272
|
-
|
|
1273
|
-
|
|
1278
|
+
at({ bind: e, required: t }),
|
|
1279
|
+
i({
|
|
1274
1280
|
onState: ["selectedTime", (o) => o || "Pick a time"]
|
|
1275
1281
|
}),
|
|
1276
|
-
|
|
1282
|
+
p({ html: u.clock })
|
|
1277
1283
|
]
|
|
1278
1284
|
);
|
|
1279
1285
|
}
|
|
1280
|
-
function B({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad:
|
|
1281
|
-
return
|
|
1286
|
+
function B({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: n = !1 }) {
|
|
1287
|
+
return l(
|
|
1282
1288
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1283
1289
|
e.map((r) => {
|
|
1284
|
-
let
|
|
1290
|
+
let a = n ? r.toString().padStart(2, "0") : r.toString();
|
|
1285
1291
|
return f({
|
|
1286
|
-
text:
|
|
1292
|
+
text: a,
|
|
1287
1293
|
class: "hover:bg-muted/50 rounded-md px-2 py-1",
|
|
1288
|
-
click: () => t({ [o]:
|
|
1289
|
-
onState: [s, o, { "bg-muted":
|
|
1294
|
+
click: () => t({ [o]: a }),
|
|
1295
|
+
onState: [s, o, { "bg-muted": a }]
|
|
1290
1296
|
});
|
|
1291
1297
|
})
|
|
1292
1298
|
);
|
|
1293
1299
|
}
|
|
1294
|
-
function
|
|
1300
|
+
function ct({ handleTimeSelect: e }) {
|
|
1295
1301
|
return x(
|
|
1296
1302
|
"open",
|
|
1297
|
-
(t, s, o) => t ? new
|
|
1303
|
+
(t, s, o) => t ? new S(
|
|
1298
1304
|
{
|
|
1299
1305
|
cache: "dropdown",
|
|
1300
1306
|
parent: o,
|
|
@@ -1302,15 +1308,15 @@ function it({ handleTimeSelect: e }) {
|
|
|
1302
1308
|
size: "fit"
|
|
1303
1309
|
},
|
|
1304
1310
|
[
|
|
1305
|
-
|
|
1311
|
+
l(
|
|
1306
1312
|
{ class: "flex flex-auto flex-col border rounded-md shadow-md" },
|
|
1307
1313
|
[
|
|
1308
|
-
|
|
1314
|
+
l(
|
|
1309
1315
|
{ class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
|
|
1310
1316
|
[
|
|
1311
1317
|
// Hours column
|
|
1312
1318
|
B({
|
|
1313
|
-
items: Array.from({ length: 12 }, (
|
|
1319
|
+
items: Array.from({ length: 12 }, (n, r) => r + 1),
|
|
1314
1320
|
handleTimeSelect: e,
|
|
1315
1321
|
state: o.state,
|
|
1316
1322
|
stateValue: "hour",
|
|
@@ -1318,7 +1324,7 @@ function it({ handleTimeSelect: e }) {
|
|
|
1318
1324
|
}),
|
|
1319
1325
|
// Minutes column
|
|
1320
1326
|
B({
|
|
1321
|
-
items: Array.from({ length: 60 }, (
|
|
1327
|
+
items: Array.from({ length: 60 }, (n, r) => r),
|
|
1322
1328
|
handleTimeSelect: e,
|
|
1323
1329
|
state: o.state,
|
|
1324
1330
|
stateValue: "minute",
|
|
@@ -1345,14 +1351,14 @@ function j(e) {
|
|
|
1345
1351
|
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1346
1352
|
if (!s)
|
|
1347
1353
|
return { hour: null, minute: null, meridian: null };
|
|
1348
|
-
let [, o,
|
|
1349
|
-
return
|
|
1350
|
-
hour:
|
|
1351
|
-
minute:
|
|
1354
|
+
let [, o, n, , r] = s, a = parseInt(o, 10), d = parseInt(n, 10);
|
|
1355
|
+
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), {
|
|
1356
|
+
hour: a.toString().padStart(2, "0"),
|
|
1357
|
+
minute: d.toString().padStart(2, "0"),
|
|
1352
1358
|
meridian: r
|
|
1353
1359
|
});
|
|
1354
1360
|
}
|
|
1355
|
-
const
|
|
1361
|
+
const Wt = y(
|
|
1356
1362
|
{
|
|
1357
1363
|
/**
|
|
1358
1364
|
* The initial shallow state of the TimePicker.
|
|
@@ -1391,32 +1397,32 @@ const Rt = y(
|
|
|
1391
1397
|
* @returns {object}
|
|
1392
1398
|
*/
|
|
1393
1399
|
render() {
|
|
1394
|
-
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian:
|
|
1395
|
-
if (s && (this.state.hour = s), o && (this.state.minute = o),
|
|
1400
|
+
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: n }) => {
|
|
1401
|
+
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) {
|
|
1396
1402
|
const r = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1397
1403
|
this.state.selectedTime = r, this.state.open = !1, this.input.value = r, typeof this.change == "function" && this.change(r);
|
|
1398
1404
|
}
|
|
1399
1405
|
};
|
|
1400
|
-
return
|
|
1406
|
+
return l(
|
|
1401
1407
|
{ class: "relative w-full max-w-[320px]" },
|
|
1402
1408
|
[
|
|
1403
|
-
|
|
1409
|
+
it({
|
|
1404
1410
|
toggleOpen: e,
|
|
1405
1411
|
bind: this.bind,
|
|
1406
1412
|
required: this.required
|
|
1407
1413
|
}),
|
|
1408
|
-
|
|
1414
|
+
ct({
|
|
1409
1415
|
handleTimeSelect: t
|
|
1410
1416
|
})
|
|
1411
1417
|
]
|
|
1412
1418
|
);
|
|
1413
1419
|
}
|
|
1414
1420
|
}
|
|
1415
|
-
),
|
|
1416
|
-
|
|
1417
|
-
]),
|
|
1418
|
-
|
|
1419
|
-
]),
|
|
1421
|
+
), dt = (e, t) => l({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${t}` }, [
|
|
1422
|
+
g({ size: "lg" }, e)
|
|
1423
|
+
]), ut = ({ title: e }) => I({ class: "flex flex-auto items-center" }, [
|
|
1424
|
+
v({ class: "text-lg font-semibold" }, e)
|
|
1425
|
+
]), ht = c((e, t) => se(
|
|
1420
1426
|
{
|
|
1421
1427
|
class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
|
|
1422
1428
|
rounded-lg flex flex-auto flex-col
|
|
@@ -1425,20 +1431,20 @@ const Rt = y(
|
|
|
1425
1431
|
aria: { expanded: ["open"] }
|
|
1426
1432
|
},
|
|
1427
1433
|
[
|
|
1428
|
-
|
|
1434
|
+
l({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
|
|
1429
1435
|
// Icon and content
|
|
1430
|
-
e.icon &&
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
e.description &&
|
|
1435
|
-
|
|
1436
|
+
e.icon && dt(e.icon, e.iconColor),
|
|
1437
|
+
l({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1438
|
+
l({ class: "flex flex-auto flex-col space-y-2" }, [
|
|
1439
|
+
ut(e),
|
|
1440
|
+
e.description && m({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e.description),
|
|
1441
|
+
l({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t)
|
|
1436
1442
|
]),
|
|
1437
|
-
e.buttons &&
|
|
1443
|
+
e.buttons && A({ class: "flex flex-col-reverse sm:flex-row sm:justify-end mt-6 gap-2 sm:gap-0 sm:space-x-2" }, e.buttons)
|
|
1438
1444
|
])
|
|
1439
1445
|
])
|
|
1440
1446
|
]
|
|
1441
|
-
)),
|
|
1447
|
+
)), ft = (e) => Y.render(e, app.root), O = {
|
|
1442
1448
|
info: {
|
|
1443
1449
|
borderColor: "border-blue-500",
|
|
1444
1450
|
bgColor: "bg-muted/10",
|
|
@@ -1465,7 +1471,7 @@ const Rt = y(
|
|
|
1465
1471
|
iconColor: "text-muted-foreground"
|
|
1466
1472
|
}
|
|
1467
1473
|
};
|
|
1468
|
-
class
|
|
1474
|
+
class mt extends C {
|
|
1469
1475
|
/**
|
|
1470
1476
|
* This will declare the props for the compiler.
|
|
1471
1477
|
*
|
|
@@ -1480,15 +1486,15 @@ class ht extends v {
|
|
|
1480
1486
|
* @returns {object}
|
|
1481
1487
|
*/
|
|
1482
1488
|
render() {
|
|
1483
|
-
const t = (
|
|
1484
|
-
|
|
1485
|
-
}, { borderColor: s, bgColor: o, iconColor:
|
|
1486
|
-
return
|
|
1489
|
+
const t = (d) => {
|
|
1490
|
+
d.target === this.panel && this.close();
|
|
1491
|
+
}, { borderColor: s, bgColor: o, iconColor: n } = O[this.type] || O.default, r = `${this.getMainClass()} ${o} ${s}`, a = this.title || "Dialog Title";
|
|
1492
|
+
return ht({
|
|
1487
1493
|
class: r,
|
|
1488
|
-
title:
|
|
1494
|
+
title: a,
|
|
1489
1495
|
click: t,
|
|
1490
1496
|
icon: this.icon,
|
|
1491
|
-
iconColor:
|
|
1497
|
+
iconColor: n,
|
|
1492
1498
|
description: this.description,
|
|
1493
1499
|
buttons: this.getButtons()
|
|
1494
1500
|
}, this.children);
|
|
@@ -1527,7 +1533,7 @@ class ht extends v {
|
|
|
1527
1533
|
* @returns {void}
|
|
1528
1534
|
*/
|
|
1529
1535
|
open() {
|
|
1530
|
-
|
|
1536
|
+
ft(this), this.panel.showModal(), this.state.open = !0;
|
|
1531
1537
|
}
|
|
1532
1538
|
/**
|
|
1533
1539
|
* This will close the modal.
|
|
@@ -1538,7 +1544,7 @@ class ht extends v {
|
|
|
1538
1544
|
this.state.open = !1, this.panel.close(), typeof this.onClose == "function" && this.onClose(), this.destroy();
|
|
1539
1545
|
}
|
|
1540
1546
|
}
|
|
1541
|
-
class
|
|
1547
|
+
class Gt extends mt {
|
|
1542
1548
|
/**
|
|
1543
1549
|
* This will declare the props for the compiler.
|
|
1544
1550
|
*
|
|
@@ -1568,63 +1574,66 @@ class qt extends ht {
|
|
|
1568
1574
|
this.confirmed && this.confirmed(), this.close();
|
|
1569
1575
|
}
|
|
1570
1576
|
}
|
|
1571
|
-
const
|
|
1577
|
+
const Jt = c((e, t = []) => l({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
1572
1578
|
W({ class: "flex flex-auto flex-col" }, [
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
e.icon &&
|
|
1576
|
-
|
|
1579
|
+
l({ class: "flex flex-auto flex-col space-y-4" }, [
|
|
1580
|
+
l({ class: "flex flex-auto items-center justify-center" }, [
|
|
1581
|
+
e.icon && l({ class: "w-16 h-16 mb-2 text-primary" }, [
|
|
1582
|
+
g(e.icon)
|
|
1577
1583
|
])
|
|
1578
1584
|
]),
|
|
1579
1585
|
I({ class: "py-4 text-center" }, [
|
|
1580
|
-
|
|
1581
|
-
|
|
1586
|
+
v({ class: "text-xl font-bold" }, e.title),
|
|
1587
|
+
m({ class: "pb-8 text-muted-foreground" }, e.description || ""),
|
|
1582
1588
|
...t
|
|
1583
1589
|
])
|
|
1584
1590
|
])
|
|
1585
1591
|
])
|
|
1586
1592
|
]));
|
|
1587
1593
|
export {
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1594
|
+
kt as A,
|
|
1595
|
+
Ut as B,
|
|
1596
|
+
Lt as C,
|
|
1597
|
+
ge as D,
|
|
1598
|
+
Ht as E,
|
|
1599
|
+
De as F,
|
|
1600
|
+
Yt as G,
|
|
1601
|
+
_t as H,
|
|
1602
|
+
Wt as I,
|
|
1603
|
+
Gt as J,
|
|
1604
|
+
ht as K,
|
|
1605
|
+
Ot as L,
|
|
1606
|
+
Pt as M,
|
|
1607
|
+
Mt as N,
|
|
1608
|
+
mt as O,
|
|
1609
|
+
Ze as P,
|
|
1610
|
+
Jt as Q,
|
|
1611
|
+
At as S,
|
|
1612
|
+
Nt as T,
|
|
1613
|
+
ye as a,
|
|
1614
|
+
St as b,
|
|
1615
|
+
Ce as c,
|
|
1616
|
+
Ie as d,
|
|
1617
|
+
$e as e,
|
|
1618
|
+
Te as f,
|
|
1619
|
+
Dt as g,
|
|
1620
|
+
It as h,
|
|
1621
|
+
$t as i,
|
|
1622
|
+
Fe as j,
|
|
1623
|
+
Tt as k,
|
|
1624
|
+
W as l,
|
|
1625
|
+
Bt as m,
|
|
1617
1626
|
Ft as n,
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1627
|
+
je as o,
|
|
1628
|
+
zt as p,
|
|
1629
|
+
Et as q,
|
|
1630
|
+
jt as r,
|
|
1631
|
+
D as s,
|
|
1632
|
+
b as t,
|
|
1633
|
+
Ve as u,
|
|
1634
|
+
Vt as v,
|
|
1635
|
+
Rt as w,
|
|
1636
|
+
Xe as x,
|
|
1637
|
+
et as y,
|
|
1638
|
+
qt as z
|
|
1630
1639
|
};
|