@base-framework/ui 1.0.312 → 1.0.314
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Div as l, H5 as
|
|
2
|
-
import { Atom as
|
|
3
|
-
import { P as
|
|
4
|
-
import { C as
|
|
5
|
-
import { B as h, I as
|
|
6
|
-
import { Icons as
|
|
7
|
-
import { Timer as
|
|
8
|
-
import { F as
|
|
9
|
-
const
|
|
1
|
+
import { Div as l, H5 as se, P as w, I as C, Li as W, Span as c, Ul as G, Button as b, OnState as B, Label as j, H2 as $, Form as oe, Header as L, Footer as N, A as J, H3 as ne, Checkbox as le, Input as f, Img as K, Nav as re, UseParent as Q, OnStateOpen as O, Time as ie, Dialog as ae } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as u, Component as k, Html as z, Dom as ce, base as ue, Data as A, Builder as X, Jot as I, Events as v, DateTime as E } from "@base-framework/base";
|
|
3
|
+
import { P as F, b as de, R as he } from "./range-calendar-BMWSJTE0.js";
|
|
4
|
+
import { C as fe, F as me, a as D } from "./veil-CVCuKSvj.js";
|
|
5
|
+
import { B as h, I as x } from "./buttons-CHEs54Wl.js";
|
|
6
|
+
import { Icons as d } from "./icons.es.js";
|
|
7
|
+
import { Timer as ge, List as pe, DynamicTime as be } from "@base-framework/organisms";
|
|
8
|
+
import { F as U } from "./format-DnofNaaz.js";
|
|
9
|
+
const V = {
|
|
10
10
|
info: {
|
|
11
11
|
borderColor: "border-blue-500",
|
|
12
12
|
bgColor: "bg-muted/10",
|
|
@@ -32,20 +32,20 @@ const E = {
|
|
|
32
32
|
bgColor: "bg-muted/10",
|
|
33
33
|
iconColor: "text-muted-foreground"
|
|
34
34
|
}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
]),
|
|
38
|
-
const { borderColor: n, bgColor: r, iconColor: i } =
|
|
35
|
+
}, xe = (e, t) => l({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
|
|
36
|
+
C({ html: e })
|
|
37
|
+
]), ye = (e) => se({ class: "font-semibold" }, e), ve = (e) => w({ class: "text-sm text-muted-foreground" }, e), Bt = u(({ title: e, description: t, icon: s, type: o = "default" }) => {
|
|
38
|
+
const { borderColor: n, bgColor: r, iconColor: i } = V[o] || V.default;
|
|
39
39
|
return l({ class: `flex items-start p-4 border rounded-lg ${r} ${n}` }, [
|
|
40
40
|
// Icon and content
|
|
41
|
-
s &&
|
|
41
|
+
s && xe(s, i),
|
|
42
42
|
l({ class: "flex flex-col" }, [
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
ye(e),
|
|
44
|
+
ve(t)
|
|
45
45
|
])
|
|
46
46
|
]);
|
|
47
47
|
});
|
|
48
|
-
class
|
|
48
|
+
class Lt extends k {
|
|
49
49
|
/**
|
|
50
50
|
* This will declare the props for the compiler.
|
|
51
51
|
*
|
|
@@ -63,48 +63,48 @@ class St extends w {
|
|
|
63
63
|
this.prepareDestroy(), this.removeContext();
|
|
64
64
|
const t = this.panel, s = this.removingClass;
|
|
65
65
|
if (!s) {
|
|
66
|
-
|
|
66
|
+
z.removeElement(t);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
ce.addClass(t, s), ue.on("animationend", t, (o) => z.removeElement(t));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const we = (e) => c({ class: "ml-auto text-xs tracking-widest opacity-60" }, e), Ce = (e) => c({ class: "flex w-4 h-4", html: e }), Se = (e) => c({ class: "flex-auto" }, e), ke = (e, t) => W({
|
|
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
|
-
]),
|
|
76
|
+
e.icon && Ce(e.icon),
|
|
77
|
+
Se(e.label),
|
|
78
|
+
e.shortcut && we(e.shortcut)
|
|
79
|
+
]), Ie = (e, t) => G({ class: "grid gap-2" }, [
|
|
80
|
+
e.map((s) => ke(s, t))
|
|
81
|
+
]), De = (e) => l({ class: "w-full z-10" }, [
|
|
82
82
|
l({
|
|
83
83
|
class: "max-h-60 border rounded-md overflow-y-auto p-1 grid gap-2 divide-y divide-border",
|
|
84
|
-
for: ["groups", (t) =>
|
|
84
|
+
for: ["groups", (t) => Ie(t, e)]
|
|
85
85
|
})
|
|
86
|
-
]),
|
|
86
|
+
]), $e = ({ label: e, icon: t, toggleDropdown: s }) => b({
|
|
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
|
-
]),
|
|
96
|
-
|
|
93
|
+
e && c(e),
|
|
94
|
+
t && C({ html: t })
|
|
95
|
+
]), Fe = ({ onSelect: e }) => l([
|
|
96
|
+
B(
|
|
97
97
|
"open",
|
|
98
|
-
(t, s, o) => t ? new
|
|
98
|
+
(t, s, o) => t ? new F({
|
|
99
99
|
cache: "dropdown",
|
|
100
100
|
parent: o,
|
|
101
101
|
button: o.button
|
|
102
102
|
}, [
|
|
103
|
-
|
|
103
|
+
De(e)
|
|
104
104
|
]) : null
|
|
105
105
|
)
|
|
106
106
|
]);
|
|
107
|
-
class
|
|
107
|
+
class At extends k {
|
|
108
108
|
/**
|
|
109
109
|
* This will declare the props for the compiler.
|
|
110
110
|
*
|
|
@@ -119,7 +119,7 @@ class Dt extends w {
|
|
|
119
119
|
* @returns {Data}
|
|
120
120
|
*/
|
|
121
121
|
setData() {
|
|
122
|
-
return new
|
|
122
|
+
return new A({
|
|
123
123
|
groups: this.groups || []
|
|
124
124
|
});
|
|
125
125
|
}
|
|
@@ -158,33 +158,33 @@ class Dt extends w {
|
|
|
158
158
|
*/
|
|
159
159
|
render() {
|
|
160
160
|
return l({ class: "relative" }, [
|
|
161
|
-
|
|
161
|
+
$e({
|
|
162
162
|
label: this.label,
|
|
163
163
|
icon: this.icon,
|
|
164
164
|
toggleDropdown: this.toggleDropdown.bind(this)
|
|
165
165
|
}),
|
|
166
|
-
|
|
166
|
+
Fe({ onSelect: this.handleSelect.bind(this) })
|
|
167
167
|
]);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
const
|
|
171
|
-
e.title &&
|
|
172
|
-
e.description &&
|
|
170
|
+
const Te = u((e, t) => l({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t)), Be = u((e, t) => j({ ...e, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, t)), Le = u((e, t) => w({ ...e, class: "text-sm text-muted-foreground italic" }, t)), Ae = u((e, t) => w({ ...e, class: "text-sm text-destructive" }, t)), Mt = u((e, t = []) => fe({ class: "flex flex-auto flex-col gap-y-0", margin: "m-0", padding: "p-0" }, [
|
|
171
|
+
e.title && $({ class: "text-lg font-semibold py-4 px-6" }, e.title),
|
|
172
|
+
e.description && w({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, e.description),
|
|
173
173
|
...t
|
|
174
|
-
])),
|
|
174
|
+
])), Pt = u((e, t = []) => me({ label: e.label, description: e.description, class: "py-4 px-6", border: e.border }, [
|
|
175
175
|
l({ class: "flex flex-col gap-y-6" }, t)
|
|
176
|
-
])),
|
|
176
|
+
])), jt = u((e, t = []) => {
|
|
177
177
|
const s = e.border ? "border-t" : "";
|
|
178
178
|
return l({ ...e, class: `flex flex-col pb-4 px-6 gap-y-4 ${s} ${e.class || ""}` }, t);
|
|
179
|
-
}),
|
|
179
|
+
}), Me = (e) => e.tag === "input" || e.tag === "select" || e.tag === "textarea", Z = (e, t, s) => e.map((o) => !o || (o.children && o.children.length > 0 && (o.children = Z(o.children, t, s)), !o.required) ? o : Me(o) ? {
|
|
180
180
|
...o,
|
|
181
181
|
aria: {
|
|
182
182
|
invalid: ["hasError"]
|
|
183
183
|
},
|
|
184
184
|
invalid: s,
|
|
185
185
|
input: t
|
|
186
|
-
} : o),
|
|
187
|
-
const n =
|
|
186
|
+
} : o), Pe = u((e, t) => {
|
|
187
|
+
const n = Z(t, (r) => {
|
|
188
188
|
r.target.checkValidity() && e.setError(null);
|
|
189
189
|
}, (r) => {
|
|
190
190
|
e.setError(r.target.validationMessage);
|
|
@@ -193,7 +193,7 @@ const De = c((e, t) => l({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t))
|
|
|
193
193
|
...e,
|
|
194
194
|
class: "w-full"
|
|
195
195
|
}, n);
|
|
196
|
-
}),
|
|
196
|
+
}), Nt = D(
|
|
197
197
|
{
|
|
198
198
|
/**
|
|
199
199
|
* The initial state of the FormField.
|
|
@@ -218,66 +218,66 @@ const De = c((e, t) => l({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t))
|
|
|
218
218
|
this.state.error = r, this.state.hasError = !!r;
|
|
219
219
|
};
|
|
220
220
|
return l({ class: "flex flex-auto gap-y-4" }, [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
Te([
|
|
222
|
+
Be({ htmlFor: t }, s),
|
|
223
|
+
Pe({
|
|
224
224
|
id: t,
|
|
225
225
|
name: e,
|
|
226
226
|
value: this.state.value,
|
|
227
227
|
setError: n
|
|
228
228
|
}, this.children),
|
|
229
|
-
o &&
|
|
230
|
-
l({ onState: ["error", (r) => r &&
|
|
229
|
+
o && Le({ id: this.getId("description") }, o),
|
|
230
|
+
l({ onState: ["error", (r) => r && Ae(r)] })
|
|
231
231
|
])
|
|
232
232
|
]);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
),
|
|
235
|
+
), je = (e, t, s = null) => {
|
|
236
236
|
e.target.checkValidity() && (e.preventDefault(), s && s(e, t));
|
|
237
|
-
},
|
|
238
|
-
(e, t) =>
|
|
239
|
-
),
|
|
240
|
-
e.title &&
|
|
237
|
+
}, ee = u(
|
|
238
|
+
(e, t) => oe({ ...e, submit: (s, o) => je(s, o, e.submit), class: `w-full ${e.class ?? ""}` }, t)
|
|
239
|
+
), Ot = u((e, t) => l({ ...e, class: `flex flex-auto flex-col gap-y-6 p-4 md:p-6 divide-y ${e.class || ""}` }, t)), zt = u((e, t = []) => l({ class: "flex flex-col gap-y-3 py-4" }, [
|
|
240
|
+
e.title && $({ class: "font-semibold" }, e.title),
|
|
241
241
|
...t
|
|
242
|
-
])),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
]),
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
]),
|
|
242
|
+
])), Et = (e, t) => l({ class: "flex justify-between" }, [
|
|
243
|
+
c({ class: "text-muted-foreground" }, e),
|
|
244
|
+
c(t)
|
|
245
|
+
]), Ut = (e, t) => l({ class: "flex" }, [
|
|
246
|
+
c({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, e),
|
|
247
|
+
c(t)
|
|
248
|
+
]), Ne = ({ title: e, description: t, back: s, icon: o, options: n = [] }) => L({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
|
|
249
249
|
/**
|
|
250
250
|
* Back Button
|
|
251
251
|
*/
|
|
252
|
-
s && h({ variant: "icon", icon:
|
|
252
|
+
s && h({ variant: "icon", icon: d.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (r, i) => i.close() }),
|
|
253
253
|
/**
|
|
254
254
|
* Icon
|
|
255
255
|
*/
|
|
256
|
-
o && l({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [
|
|
256
|
+
o && l({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [x(o)]),
|
|
257
257
|
/**
|
|
258
258
|
* Title and Description
|
|
259
259
|
*/
|
|
260
260
|
l({ class: "flex flex-auto flex-row justify-between w-full ml-2 gap-2" }, [
|
|
261
261
|
l({ class: "flex flex-auto flex-col" }, [
|
|
262
|
-
|
|
262
|
+
$({ class: "text-lg font-semibold m-0 truncate" }, e),
|
|
263
263
|
t && l({ class: "text-sm text-muted-foreground truncate" }, t)
|
|
264
264
|
]),
|
|
265
265
|
...n
|
|
266
266
|
])
|
|
267
|
-
]),
|
|
267
|
+
]), Oe = u((e, t) => l({
|
|
268
268
|
popover: "manual",
|
|
269
269
|
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}`,
|
|
270
270
|
click: (s, o) => {
|
|
271
271
|
s.target === o.panel && (s.preventDefault(), s.stopPropagation(), o.state.open = !1);
|
|
272
272
|
}
|
|
273
273
|
}, [
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
ee({ class: "modal-content relative bg-background z-[1] flex flex-auto flex-col gap-y-4", submit: (s, o) => e.onSubmit && e.onSubmit(o) }, [
|
|
275
|
+
Ne(e),
|
|
276
276
|
l({ class: "modal-body flex flex-grow flex-col overflow-y-auto py-0 px-6 z-0" }, t),
|
|
277
|
-
|
|
277
|
+
N({ class: "modal-footer sticky bg-background/80 backdrop-blur-md flex flex-none justify-between py-4 px-6 z-10" }, e.buttons)
|
|
278
278
|
])
|
|
279
|
-
])),
|
|
280
|
-
class
|
|
279
|
+
])), ze = (e) => X.render(e, app.root);
|
|
280
|
+
class Vt extends k {
|
|
281
281
|
/**
|
|
282
282
|
* This will declare the props for the compiler.
|
|
283
283
|
*
|
|
@@ -293,7 +293,7 @@ class Mt extends w {
|
|
|
293
293
|
*/
|
|
294
294
|
render() {
|
|
295
295
|
const t = this.getMainClass(), s = this.title || "", o = this.description || null;
|
|
296
|
-
return
|
|
296
|
+
return Oe(
|
|
297
297
|
{
|
|
298
298
|
class: t,
|
|
299
299
|
title: s,
|
|
@@ -408,7 +408,7 @@ class Mt extends w {
|
|
|
408
408
|
* @returns {void}
|
|
409
409
|
*/
|
|
410
410
|
open() {
|
|
411
|
-
|
|
411
|
+
ze(this), this.showModal();
|
|
412
412
|
}
|
|
413
413
|
/**
|
|
414
414
|
* This will destroy the modal.
|
|
@@ -437,7 +437,7 @@ class Mt extends w {
|
|
|
437
437
|
this.panel.hidePopover(), this.state.open = !1, typeof this.onClose == "function" && this.onClose(this), document.documentElement.style.overflowY = "auto";
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
const
|
|
440
|
+
const R = {
|
|
441
441
|
info: {
|
|
442
442
|
bgColor: "bg-muted/10",
|
|
443
443
|
borderColor: "border-blue-500",
|
|
@@ -463,22 +463,22 @@ const N = {
|
|
|
463
463
|
borderColor: "border",
|
|
464
464
|
iconColor: "text-muted-foreground"
|
|
465
465
|
}
|
|
466
|
-
},
|
|
467
|
-
|
|
468
|
-
]),
|
|
466
|
+
}, Ee = (e) => L({ class: "flex justify-center" }, [
|
|
467
|
+
ne({ class: "text-lg font-bold mb-0" }, e)
|
|
468
|
+
]), Ue = u(({ href: e, class: t }, s) => J({
|
|
469
469
|
class: `bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
|
|
470
470
|
href: e,
|
|
471
471
|
animateIn: "pullRightIn",
|
|
472
472
|
animateOut: "pullRight",
|
|
473
473
|
role: "alert"
|
|
474
|
-
}, s)),
|
|
474
|
+
}, s)), Ve = u(({ close: e, class: t }, s) => l({
|
|
475
475
|
class: `pullRightIn bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
|
|
476
476
|
click: () => e(),
|
|
477
477
|
animateIn: "pullRightIn",
|
|
478
478
|
animateOut: "pullRight",
|
|
479
479
|
role: "alert"
|
|
480
480
|
}, s));
|
|
481
|
-
class
|
|
481
|
+
class Re extends k {
|
|
482
482
|
/**
|
|
483
483
|
* This will declare the props for the compiler.
|
|
484
484
|
*
|
|
@@ -502,10 +502,10 @@ class Ne extends w {
|
|
|
502
502
|
*/
|
|
503
503
|
render() {
|
|
504
504
|
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), n = this.href || null, r = this.getChildren(o);
|
|
505
|
-
return n ?
|
|
505
|
+
return n ? Ue({
|
|
506
506
|
href: n,
|
|
507
507
|
class: `${t} ${s}`
|
|
508
|
-
}, r) :
|
|
508
|
+
}, r) : Ve({
|
|
509
509
|
close: this.close.bind(this),
|
|
510
510
|
class: `${t} ${s}`
|
|
511
511
|
}, r);
|
|
@@ -517,7 +517,7 @@ class Ne extends w {
|
|
|
517
517
|
*/
|
|
518
518
|
afterSetup() {
|
|
519
519
|
const t = this.duration;
|
|
520
|
-
t !== "infinite" && (this.timer = new
|
|
520
|
+
t !== "infinite" && (this.timer = new ge(t, this.close.bind(this)), this.timer.start());
|
|
521
521
|
}
|
|
522
522
|
/**
|
|
523
523
|
* This will get the style properties based on the notification type.
|
|
@@ -526,7 +526,7 @@ class Ne extends w {
|
|
|
526
526
|
*/
|
|
527
527
|
getTypeStyles() {
|
|
528
528
|
const t = this.type || "default";
|
|
529
|
-
return
|
|
529
|
+
return R[t] || R.default;
|
|
530
530
|
}
|
|
531
531
|
/**
|
|
532
532
|
* This will get the buttons for the notification.
|
|
@@ -550,19 +550,19 @@ class Ne extends w {
|
|
|
550
550
|
getChildren(t) {
|
|
551
551
|
return [
|
|
552
552
|
l({ class: "flex items-start" }, [
|
|
553
|
-
this.icon &&
|
|
553
|
+
this.icon && C({ class: `mr-4 ${t}`, html: this.icon }),
|
|
554
554
|
l({ class: "flex flex-auto flex-col" }, [
|
|
555
555
|
l({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
|
|
556
|
-
this.title &&
|
|
556
|
+
this.title && Ee(this.title)
|
|
557
557
|
]),
|
|
558
|
-
|
|
559
|
-
(this.primary || this.secondary) &&
|
|
558
|
+
w({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
|
|
559
|
+
(this.primary || this.secondary) && N({ class: "margin-top-24 flex align-center" }, this.getButtons())
|
|
560
560
|
])
|
|
561
561
|
]),
|
|
562
562
|
h({
|
|
563
563
|
class: "absolute top-[12px] right-[12px]",
|
|
564
564
|
variant: "icon",
|
|
565
|
-
icon:
|
|
565
|
+
icon: d.x,
|
|
566
566
|
click: this.close.bind(this)
|
|
567
567
|
})
|
|
568
568
|
];
|
|
@@ -577,8 +577,8 @@ class Ne extends w {
|
|
|
577
577
|
t && t.stopPropagation(), this.duration !== "infinite" && this.timer.stop(), this.onClick && this.onClick(), this.destroy();
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
let
|
|
581
|
-
class
|
|
580
|
+
let He = 0;
|
|
581
|
+
class Rt extends k {
|
|
582
582
|
/**
|
|
583
583
|
* This will render the component.
|
|
584
584
|
*
|
|
@@ -586,11 +586,11 @@ class jt extends w {
|
|
|
586
586
|
*/
|
|
587
587
|
render() {
|
|
588
588
|
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" }, [
|
|
589
|
-
new
|
|
589
|
+
new pe({
|
|
590
590
|
cache: "list",
|
|
591
591
|
key: "id",
|
|
592
592
|
role: "list",
|
|
593
|
-
rowItem: (t) => new
|
|
593
|
+
rowItem: (t) => new Re(t)
|
|
594
594
|
})
|
|
595
595
|
]);
|
|
596
596
|
}
|
|
@@ -601,7 +601,7 @@ class jt extends w {
|
|
|
601
601
|
* @returns {void}
|
|
602
602
|
*/
|
|
603
603
|
addNotice(t = {}) {
|
|
604
|
-
t.id =
|
|
604
|
+
t.id = He++, t.callBack = () => this.removeNotice(t), this.list.append([t]), this.panel.hidePopover(), this.panel.showPopover();
|
|
605
605
|
}
|
|
606
606
|
/**
|
|
607
607
|
* This will remove a notification.
|
|
@@ -613,25 +613,25 @@ class jt extends w {
|
|
|
613
613
|
this.list.delete(t.id), this.list.isEmpty() && this.panel.hidePopover();
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
const
|
|
616
|
+
const H = globalThis.matchMedia, M = u(({ value: e, label: t, icon: s }) => b({
|
|
617
617
|
class: 'text-sm gap-1 font-medium leading-none disabled:cursor-not-allowed disabled:opacity-70 flex flex-col items-center justify-between rounded-md border-2 bg-popover p-4 hover:bg-accent hover:text-accent-foreground data-[state="active"]:border-primary [&:has([data-state="active"])]:border-primary',
|
|
618
618
|
onState: ["method", { active: e }],
|
|
619
619
|
dataSet: ["method", ["state", e, "active"]],
|
|
620
620
|
click: (o, { state: n }) => {
|
|
621
|
-
n.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"),
|
|
621
|
+
n.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Ye(e);
|
|
622
622
|
}
|
|
623
623
|
}, [
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
])),
|
|
624
|
+
x(s),
|
|
625
|
+
c(t)
|
|
626
|
+
])), Ye = (e) => {
|
|
627
627
|
const t = document.documentElement;
|
|
628
|
-
if (e === "system" && (e = globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"),
|
|
628
|
+
if (e === "system" && (e = globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"), H && !H("(prefers-color-scheme: " + e + ")").matches) {
|
|
629
629
|
t.classList.add(e);
|
|
630
630
|
return;
|
|
631
631
|
}
|
|
632
632
|
const s = e === "light" ? "dark" : "light";
|
|
633
633
|
t.classList.remove(s);
|
|
634
|
-
},
|
|
634
|
+
}, Ht = I(
|
|
635
635
|
{
|
|
636
636
|
/**
|
|
637
637
|
* This will render the component.
|
|
@@ -641,9 +641,9 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
641
641
|
render() {
|
|
642
642
|
return l({ class: "flex flex-auto flex-col" }, [
|
|
643
643
|
l({ class: "grid grid-cols-3 gap-4" }, [
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
644
|
+
M({ label: "System", value: "system", icon: d.adjustments.horizontal }),
|
|
645
|
+
M({ label: "Light", value: "light", icon: d.sun }),
|
|
646
|
+
M({ label: "Dark", value: "dark", icon: d.moon })
|
|
647
647
|
])
|
|
648
648
|
]);
|
|
649
649
|
},
|
|
@@ -658,7 +658,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
658
658
|
};
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
),
|
|
661
|
+
), Yt = D(
|
|
662
662
|
{
|
|
663
663
|
/**
|
|
664
664
|
* The initial state of the Toggle.
|
|
@@ -685,14 +685,14 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
685
685
|
* @returns {object}
|
|
686
686
|
*/
|
|
687
687
|
render() {
|
|
688
|
-
return
|
|
688
|
+
return b({
|
|
689
689
|
class: "relative inline-flex h-6 w-11 min-w-11 items-center rounded-full bg-muted transition-colors focus:outline-none",
|
|
690
690
|
onState: ["active", { "bg-primary": !0, "bg-muted": !1 }],
|
|
691
691
|
click: (t, { state: s }) => {
|
|
692
692
|
s.toggle("active"), this.checkbox.checked = s.active, this.change && this.change(s.active, t, this);
|
|
693
693
|
}
|
|
694
694
|
}, [
|
|
695
|
-
|
|
695
|
+
le({
|
|
696
696
|
cache: "checkbox",
|
|
697
697
|
class: "opacity-0 absolute top-0 left-0 bottom-0 right-0 w-full h-full",
|
|
698
698
|
/**
|
|
@@ -703,34 +703,34 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
703
703
|
bind: this.bind,
|
|
704
704
|
required: this.required
|
|
705
705
|
}),
|
|
706
|
-
|
|
706
|
+
c({
|
|
707
707
|
class: "absolute h-5 w-5 bg-background rounded-full shadow-md transform transition-transform",
|
|
708
708
|
onState: ["active", { "translate-x-[22px]": !0, "translate-x-[2px]": !1 }]
|
|
709
709
|
})
|
|
710
710
|
]);
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
-
),
|
|
713
|
+
), T = {
|
|
714
714
|
ONLINE: "online",
|
|
715
715
|
OFFLINE: "offline",
|
|
716
716
|
BUSY: "busy",
|
|
717
717
|
AWAY: "away"
|
|
718
|
-
},
|
|
718
|
+
}, S = {
|
|
719
719
|
ONLINE: "bg-green-500",
|
|
720
720
|
OFFLINE: "bg-gray-500",
|
|
721
721
|
BUSY: "bg-red-500",
|
|
722
722
|
AWAY: "bg-yellow-500"
|
|
723
|
-
},
|
|
724
|
-
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${
|
|
725
|
-
}),
|
|
723
|
+
}, qe = (e = "") => (e = e.toUpperCase(), S[e] || S.OFFLINE), qt = (e) => l({
|
|
724
|
+
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${qe(e)}`
|
|
725
|
+
}), _t = ({ propName: e = "status" } = {}) => l({
|
|
726
726
|
class: "absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full",
|
|
727
727
|
onSet: [e, {
|
|
728
|
-
[
|
|
729
|
-
[
|
|
730
|
-
[
|
|
731
|
-
[
|
|
728
|
+
[S.ONLINE]: T.ONLINE,
|
|
729
|
+
[S.OFFLINE]: T.OFFLINE,
|
|
730
|
+
[S.BUSY]: T.BUSY,
|
|
731
|
+
[S.AWAY]: T.AWAY
|
|
732
732
|
}]
|
|
733
|
-
}),
|
|
733
|
+
}), _e = (e) => e.indexOf(".") === -1 && e.indexOf("[[") === -1, Wt = I(
|
|
734
734
|
{
|
|
735
735
|
/**
|
|
736
736
|
* Get the initial state for the component.
|
|
@@ -750,7 +750,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
750
750
|
*/
|
|
751
751
|
openFileBrowse() {
|
|
752
752
|
const e = this.input;
|
|
753
|
-
e && (e.value = "",
|
|
753
|
+
e && (e.value = "", v.trigger("click", e));
|
|
754
754
|
},
|
|
755
755
|
/**
|
|
756
756
|
* Get the URL for the uploaded file.
|
|
@@ -769,7 +769,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
769
769
|
render() {
|
|
770
770
|
const e = "image-upload", t = this.onChange || null;
|
|
771
771
|
return l({ class: "flex-none items-center" }, [
|
|
772
|
-
|
|
772
|
+
f({
|
|
773
773
|
id: e,
|
|
774
774
|
cache: "input",
|
|
775
775
|
type: "file",
|
|
@@ -786,25 +786,22 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
786
786
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
787
787
|
}
|
|
788
788
|
}, [
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
l("Upload Image")
|
|
801
|
-
])
|
|
802
|
-
)
|
|
789
|
+
B("loaded", (s) => s === !1 || _e(this.src) ? j({
|
|
790
|
+
htmlFor: e,
|
|
791
|
+
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
792
|
+
}, [
|
|
793
|
+
x(d.upload),
|
|
794
|
+
l("Upload Image")
|
|
795
|
+
]) : K({
|
|
796
|
+
// @ts-ignore
|
|
797
|
+
src: this.src,
|
|
798
|
+
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
799
|
+
}))
|
|
803
800
|
])
|
|
804
801
|
]);
|
|
805
802
|
}
|
|
806
803
|
}
|
|
807
|
-
),
|
|
804
|
+
), Gt = I(
|
|
808
805
|
{
|
|
809
806
|
/**
|
|
810
807
|
* Get the initial state for the component.
|
|
@@ -824,7 +821,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
824
821
|
*/
|
|
825
822
|
openFileBrowse() {
|
|
826
823
|
const e = this.input;
|
|
827
|
-
e && (e.value = "",
|
|
824
|
+
e && (e.value = "", v.trigger("click", e));
|
|
828
825
|
},
|
|
829
826
|
/**
|
|
830
827
|
* Get the URL for the uploaded file.
|
|
@@ -843,7 +840,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
843
840
|
render() {
|
|
844
841
|
const e = "logo-upload", t = this.onChange || null;
|
|
845
842
|
return l({ class: "flex-none items-center" }, [
|
|
846
|
-
|
|
843
|
+
f({
|
|
847
844
|
id: e,
|
|
848
845
|
cache: "input",
|
|
849
846
|
type: "file",
|
|
@@ -860,17 +857,17 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
860
857
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
861
858
|
}
|
|
862
859
|
}, [
|
|
863
|
-
|
|
860
|
+
B(
|
|
864
861
|
"loaded",
|
|
865
|
-
(s) => s ?
|
|
862
|
+
(s) => s ? K({
|
|
866
863
|
// @ts-ignore
|
|
867
864
|
src: this.src,
|
|
868
865
|
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
869
|
-
}) :
|
|
866
|
+
}) : j({
|
|
870
867
|
htmlFor: e,
|
|
871
868
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
872
869
|
}, [
|
|
873
|
-
|
|
870
|
+
x(d.upload),
|
|
874
871
|
l("Upload logo")
|
|
875
872
|
])
|
|
876
873
|
)
|
|
@@ -878,22 +875,22 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
878
875
|
]);
|
|
879
876
|
}
|
|
880
877
|
}
|
|
881
|
-
),
|
|
878
|
+
), We = (e, t) => J(
|
|
882
879
|
{
|
|
883
880
|
href: e,
|
|
884
881
|
"aria-current": t === "Breadcrumb" && "page",
|
|
885
882
|
// Only set aria-current on the last item
|
|
886
883
|
class: "text-muted-foreground font-medium hover:text-foreground"
|
|
887
884
|
},
|
|
888
|
-
[
|
|
889
|
-
),
|
|
885
|
+
[c(t)]
|
|
886
|
+
), Ge = () => x({
|
|
890
887
|
class: "mx-3 text-muted-foreground",
|
|
891
888
|
"aria-hidden": !0,
|
|
892
889
|
size: "xs"
|
|
893
|
-
},
|
|
894
|
-
e.href ?
|
|
895
|
-
e.separator &&
|
|
896
|
-
]),
|
|
890
|
+
}, d.chevron.single.right), Je = (e) => l({ class: "flex items-center" }, [
|
|
891
|
+
e.href ? We(e.href, e.label) : c(e.label),
|
|
892
|
+
e.separator && Ge()
|
|
893
|
+
]), Jt = I(
|
|
897
894
|
{
|
|
898
895
|
/**
|
|
899
896
|
* Set initial data
|
|
@@ -901,7 +898,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
901
898
|
* @returns {Data}
|
|
902
899
|
*/
|
|
903
900
|
setData() {
|
|
904
|
-
return new
|
|
901
|
+
return new A({
|
|
905
902
|
// @ts-ignore
|
|
906
903
|
items: this.items || []
|
|
907
904
|
});
|
|
@@ -913,7 +910,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
913
910
|
*/
|
|
914
911
|
render() {
|
|
915
912
|
const e = this.data.items.length - 1;
|
|
916
|
-
return
|
|
913
|
+
return re(
|
|
917
914
|
{
|
|
918
915
|
"aria-label": "Breadcrumb",
|
|
919
916
|
class: "flex items-center gap-x-1 text-sm"
|
|
@@ -922,7 +919,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
922
919
|
l({
|
|
923
920
|
role: "list",
|
|
924
921
|
class: "flex items-center",
|
|
925
|
-
for: ["items", (t, s) =>
|
|
922
|
+
for: ["items", (t, s) => Je({
|
|
926
923
|
href: t.href,
|
|
927
924
|
label: t.label,
|
|
928
925
|
separator: s < e
|
|
@@ -932,7 +929,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
932
929
|
);
|
|
933
930
|
}
|
|
934
931
|
}
|
|
935
|
-
),
|
|
932
|
+
), Y = {
|
|
936
933
|
xs: "h-1 w-1",
|
|
937
934
|
sm: "h-2 w-2",
|
|
938
935
|
md: "h-4 w-4",
|
|
@@ -941,8 +938,8 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
941
938
|
"2xl": "h-16 w-16",
|
|
942
939
|
"3xl": "h-24 w-24",
|
|
943
940
|
default: "h-4 w-4"
|
|
944
|
-
},
|
|
945
|
-
|
|
941
|
+
}, Ke = (e) => Y[e] || Y.default, Qe = ({ index: e, size: t }) => l({ class: `${t} rounded-full bg-muted cursor-pointer` }, [
|
|
942
|
+
c({
|
|
946
943
|
class: "block w-full h-full rounded-full transition-colors",
|
|
947
944
|
onSet: ["activeIndex", {
|
|
948
945
|
"bg-primary": e,
|
|
@@ -952,10 +949,10 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
952
949
|
o.activeIndex = e, n && n(e);
|
|
953
950
|
}
|
|
954
951
|
})
|
|
955
|
-
]),
|
|
952
|
+
]), Xe = (e, t) => Array.from({ length: e }, (s, o) => Qe({
|
|
956
953
|
index: o,
|
|
957
954
|
size: t
|
|
958
|
-
})),
|
|
955
|
+
})), Kt = I(
|
|
959
956
|
{
|
|
960
957
|
/**
|
|
961
958
|
* Defines component data (props).
|
|
@@ -963,7 +960,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
963
960
|
* @returns {Data}
|
|
964
961
|
*/
|
|
965
962
|
setData() {
|
|
966
|
-
return new
|
|
963
|
+
return new A({
|
|
967
964
|
// @ts-ignore
|
|
968
965
|
count: this.count || 4,
|
|
969
966
|
// total dots
|
|
@@ -977,7 +974,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
977
974
|
* @returns {object}
|
|
978
975
|
*/
|
|
979
976
|
render() {
|
|
980
|
-
const e = this.gap || "gap-2", t =
|
|
977
|
+
const e = this.gap || "gap-2", t = Ke(this.size || "sm"), s = Xe(this.data.count, t);
|
|
981
978
|
return l(
|
|
982
979
|
{ class: "flex justify-center items-center py-2" },
|
|
983
980
|
[
|
|
@@ -986,37 +983,37 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
986
983
|
);
|
|
987
984
|
}
|
|
988
985
|
}
|
|
989
|
-
),
|
|
986
|
+
), Ze = ({ toggleDropdown: e }) => b(
|
|
990
987
|
{
|
|
991
988
|
cache: "button",
|
|
992
989
|
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",
|
|
993
990
|
click: e
|
|
994
991
|
},
|
|
995
992
|
[
|
|
996
|
-
|
|
997
|
-
|
|
993
|
+
c({ onState: ["selectedLabel", (t) => t || "Select item..."] }),
|
|
994
|
+
C({ html: d.chevron.upDown })
|
|
998
995
|
]
|
|
999
|
-
),
|
|
996
|
+
), et = (e, t, s) => W({
|
|
1000
997
|
class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
|
|
1001
998
|
click: () => t(e),
|
|
1002
999
|
onState: [s, "selectedValue", { "bg-secondary": e.value }]
|
|
1003
1000
|
}, [
|
|
1004
|
-
e.icon &&
|
|
1005
|
-
|
|
1006
|
-
]),
|
|
1007
|
-
|
|
1008
|
-
]),
|
|
1009
|
-
|
|
1001
|
+
e.icon && c({ class: "mr-2 flex items-baseline" }, [x({ size: "xs" }, e.icon)]),
|
|
1002
|
+
c({ class: "text-base font-normal" }, e.label)
|
|
1003
|
+
]), tt = (e, t) => l({ class: "w-full border rounded-md" }, [
|
|
1004
|
+
G({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) => et(s, e, t)] })
|
|
1005
|
+
]), st = ({ onSelect: e, state: t }) => l({ class: "flex flex-auto flex-col" }, [
|
|
1006
|
+
B(
|
|
1010
1007
|
"open",
|
|
1011
|
-
(s, o, n) => s ? new
|
|
1008
|
+
(s, o, n) => s ? new F({
|
|
1012
1009
|
cache: "dropdown",
|
|
1013
1010
|
parent: n,
|
|
1014
1011
|
button: n.button
|
|
1015
1012
|
}, [
|
|
1016
|
-
|
|
1013
|
+
tt(e, t)
|
|
1017
1014
|
]) : null
|
|
1018
1015
|
)
|
|
1019
|
-
]),
|
|
1016
|
+
]), Qt = I(
|
|
1020
1017
|
{
|
|
1021
1018
|
/**
|
|
1022
1019
|
* This will set up the data.
|
|
@@ -1024,7 +1021,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1024
1021
|
* @returns {Data}
|
|
1025
1022
|
*/
|
|
1026
1023
|
setData() {
|
|
1027
|
-
return new
|
|
1024
|
+
return new A({
|
|
1028
1025
|
// @ts-ignore
|
|
1029
1026
|
items: this.items || []
|
|
1030
1027
|
});
|
|
@@ -1097,8 +1094,8 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1097
1094
|
const e = this.class || "", t = this.maxWidth || "max-w-[250px]", s = this.width || "w-full";
|
|
1098
1095
|
return l({ class: `relative ${s} flex flex-auto flex-col ${t} ${e}` }, [
|
|
1099
1096
|
// @ts-ignore
|
|
1100
|
-
|
|
1101
|
-
|
|
1097
|
+
Ze({ toggleDropdown: this.toggleDropdown.bind(this) }),
|
|
1098
|
+
st({
|
|
1102
1099
|
// @ts-ignore
|
|
1103
1100
|
state: this.state,
|
|
1104
1101
|
// @ts-ignore
|
|
@@ -1106,7 +1103,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1106
1103
|
}),
|
|
1107
1104
|
// Hidden required input for form validation
|
|
1108
1105
|
// @ts-ignore
|
|
1109
|
-
this.required &&
|
|
1106
|
+
this.required && f({
|
|
1110
1107
|
class: "opacity-0 absolute top-0 left-0 z-[1]",
|
|
1111
1108
|
type: "text",
|
|
1112
1109
|
// @ts-ignore
|
|
@@ -1118,26 +1115,26 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1118
1115
|
]);
|
|
1119
1116
|
}
|
|
1120
1117
|
}
|
|
1121
|
-
),
|
|
1118
|
+
), te = ({ icon: e, click: t, ariaLabel: s }) => h({
|
|
1122
1119
|
variant: "icon",
|
|
1123
1120
|
class: "flex flex-none",
|
|
1124
1121
|
click: t,
|
|
1125
1122
|
icon: e,
|
|
1126
1123
|
"aria-label": s
|
|
1127
|
-
}),
|
|
1128
|
-
icon:
|
|
1124
|
+
}), ot = ({ click: e }) => te({
|
|
1125
|
+
icon: d.circleMinus,
|
|
1129
1126
|
click: e,
|
|
1130
1127
|
ariaLabel: "Decrement"
|
|
1131
|
-
}),
|
|
1132
|
-
icon:
|
|
1128
|
+
}), nt = ({ click: e }) => te({
|
|
1129
|
+
icon: d.circlePlus,
|
|
1133
1130
|
click: e,
|
|
1134
1131
|
ariaLabel: "Increment"
|
|
1135
|
-
}),
|
|
1132
|
+
}), lt = ({ bind: e, min: t, max: s, readonly: o = !1 }) => Q(({ state: n }) => f({
|
|
1136
1133
|
value: ["[[count]]", n],
|
|
1137
1134
|
bind: e,
|
|
1138
1135
|
blur: (r, { state: i }) => {
|
|
1139
|
-
let
|
|
1140
|
-
isNaN(
|
|
1136
|
+
let a = parseInt(r.target.value, 10);
|
|
1137
|
+
isNaN(a) && (a = t ?? 0), t !== void 0 && (a = Math.max(a, t)), s !== void 0 && (a = Math.min(a, s)), i.count = a;
|
|
1141
1138
|
},
|
|
1142
1139
|
class: "flex flex-auto text-lg font-medium bg-input text-center border min-w-0",
|
|
1143
1140
|
readonly: o,
|
|
@@ -1145,7 +1142,7 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1145
1142
|
max: s,
|
|
1146
1143
|
type: "number",
|
|
1147
1144
|
"aria-label": "Counter"
|
|
1148
|
-
})),
|
|
1145
|
+
})), Xt = D(
|
|
1149
1146
|
{
|
|
1150
1147
|
/**
|
|
1151
1148
|
* Initial state for the counter component.
|
|
@@ -1168,45 +1165,69 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1168
1165
|
render() {
|
|
1169
1166
|
const e = this.class ?? "";
|
|
1170
1167
|
return l({ class: `flex flex-auto items-center justify-between gap-x-4 p-4 ${e}` }, [
|
|
1171
|
-
|
|
1172
|
-
|
|
1168
|
+
ot({ click: () => this.state.decrement("count") }),
|
|
1169
|
+
lt({
|
|
1173
1170
|
bind: this.bind,
|
|
1174
1171
|
readonly: this.readonly,
|
|
1175
1172
|
min: this.min,
|
|
1176
1173
|
max: this.max
|
|
1177
1174
|
}),
|
|
1178
|
-
|
|
1175
|
+
nt({ click: () => this.state.increment("count") })
|
|
1179
1176
|
]);
|
|
1180
1177
|
}
|
|
1181
1178
|
}
|
|
1182
|
-
),
|
|
1179
|
+
), rt = ({ bind: e, required: t }) => f({
|
|
1183
1180
|
cache: "input",
|
|
1184
1181
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1185
1182
|
bind: e,
|
|
1186
1183
|
required: t
|
|
1187
|
-
}),
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1184
|
+
}), it = ({ placeholder: e, handleInputChange: t, handleInputFocus: s }) => f({
|
|
1185
|
+
cache: "dateInput",
|
|
1186
|
+
class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground",
|
|
1187
|
+
placeholder: e || "mm/dd/yyyy",
|
|
1188
|
+
input: t,
|
|
1189
|
+
focus: s,
|
|
1190
|
+
onState: ["selectedDate", (o) => {
|
|
1191
|
+
if (o) {
|
|
1192
|
+
const n = new Date(o);
|
|
1193
|
+
if (!isNaN(n.getTime())) {
|
|
1194
|
+
const r = (n.getMonth() + 1).toString().padStart(2, "0"), i = n.getDate().toString().padStart(2, "0"), a = n.getFullYear();
|
|
1195
|
+
return `${r}/${i}/${a}`;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
return "";
|
|
1199
|
+
}]
|
|
1200
|
+
}), at = ({ bind: e, required: t, toggleOpen: s, handleInputChange: o, handleInputFocus: n, placeholder: r }) => l(
|
|
1201
|
+
{
|
|
1202
|
+
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"
|
|
1203
|
+
},
|
|
1204
|
+
[
|
|
1205
|
+
rt({ bind: e, required: t }),
|
|
1206
|
+
it({ placeholder: r, handleInputChange: o, handleInputFocus: n }),
|
|
1207
|
+
b(
|
|
1208
|
+
{
|
|
1209
|
+
class: "flex-shrink-0 hover:bg-muted/50 rounded p-1",
|
|
1210
|
+
click: s
|
|
1211
|
+
},
|
|
1212
|
+
[
|
|
1213
|
+
C({ html: d.calendar.days })
|
|
1214
|
+
]
|
|
1215
|
+
)
|
|
1216
|
+
]
|
|
1217
|
+
), ct = ({ handleDateSelect: e, blockPriorDates: t }) => O(
|
|
1218
|
+
(s, o, n) => new F({
|
|
1198
1219
|
cache: "dropdown",
|
|
1199
1220
|
parent: n,
|
|
1200
1221
|
button: n.panel,
|
|
1201
1222
|
size: "fit"
|
|
1202
1223
|
}, [
|
|
1203
|
-
new
|
|
1224
|
+
new de({
|
|
1204
1225
|
selectedDate: n.state.selectedDate,
|
|
1205
1226
|
selectedCallBack: e,
|
|
1206
1227
|
blockPriorDates: t
|
|
1207
1228
|
})
|
|
1208
1229
|
])
|
|
1209
|
-
),
|
|
1230
|
+
), Zt = D(
|
|
1210
1231
|
{
|
|
1211
1232
|
/**
|
|
1212
1233
|
* The initial state of the DatePicker.
|
|
@@ -1234,51 +1255,69 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1234
1255
|
* @returns {object}
|
|
1235
1256
|
*/
|
|
1236
1257
|
render() {
|
|
1237
|
-
const e = (
|
|
1238
|
-
|
|
1258
|
+
const e = (n, { state: r }) => r.toggle("open"), t = (n) => {
|
|
1259
|
+
const i = n.target.value.replace(/\D/g, "");
|
|
1260
|
+
let a = "";
|
|
1261
|
+
if (i.length > 0 && (a = i.substring(0, 2), i.length > 2 && (a += "/" + i.substring(2, 4), i.length > 4 && (a += "/" + i.substring(4, 8)))), n.target.value = a, i.length === 8) {
|
|
1262
|
+
const m = parseInt(i.substring(0, 2), 10), g = parseInt(i.substring(2, 4), 10), y = parseInt(i.substring(4, 8), 10);
|
|
1263
|
+
if (m >= 1 && m <= 12 && g >= 1 && g <= 31 && y >= 1900) {
|
|
1264
|
+
const p = `${y}-${m.toString().padStart(2, "0")}-${g.toString().padStart(2, "0")}`;
|
|
1265
|
+
this.state.selectedDate = p, this.input.value = p, v.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(p);
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
}, s = (n) => {
|
|
1269
|
+
n.target.select();
|
|
1270
|
+
}, o = (n) => {
|
|
1271
|
+
this.state.selectedDate = n, this.state.open = !1, this.input.value = n, v.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(n);
|
|
1239
1272
|
};
|
|
1240
|
-
return l(
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1273
|
+
return l(
|
|
1274
|
+
{ class: "relative w-full max-w-[320px]" },
|
|
1275
|
+
[
|
|
1276
|
+
at({
|
|
1277
|
+
toggleOpen: e,
|
|
1278
|
+
bind: this.bind,
|
|
1279
|
+
required: this.required,
|
|
1280
|
+
handleInputChange: t,
|
|
1281
|
+
handleInputFocus: s,
|
|
1282
|
+
placeholder: this.placeholder
|
|
1283
|
+
}),
|
|
1284
|
+
ct({
|
|
1285
|
+
handleDateSelect: o,
|
|
1286
|
+
blockPriorDates: this.blockPriorDates || !1
|
|
1287
|
+
})
|
|
1288
|
+
]
|
|
1289
|
+
);
|
|
1251
1290
|
}
|
|
1252
1291
|
}
|
|
1253
|
-
),
|
|
1292
|
+
), ut = ({ bind: e, required: t }) => f({
|
|
1254
1293
|
cache: "input",
|
|
1255
1294
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1256
1295
|
bind: e,
|
|
1257
1296
|
required: t
|
|
1258
|
-
}),
|
|
1297
|
+
}), dt = ({ bind: e, required: t, toggleOpen: s }) => b({
|
|
1259
1298
|
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",
|
|
1260
1299
|
click: s
|
|
1261
1300
|
}, [
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1301
|
+
ut({ bind: e, required: t }),
|
|
1302
|
+
Q(({ state: o }) => [
|
|
1303
|
+
c(U.date(["[[start]]", o], "Start Date")),
|
|
1304
|
+
c(" - "),
|
|
1305
|
+
c(U.date(["[[end]]", o], "End Date"))
|
|
1267
1306
|
]),
|
|
1268
|
-
|
|
1269
|
-
]),
|
|
1307
|
+
C({ html: d.calendar.days })
|
|
1308
|
+
]), ht = ({ handleDateSelect: e, blockPriorDates: t }) => O((s, o, n) => new F({
|
|
1270
1309
|
cache: "dropdown",
|
|
1271
1310
|
parent: n,
|
|
1272
1311
|
button: n.panel,
|
|
1273
1312
|
size: "xl"
|
|
1274
1313
|
}, [
|
|
1275
|
-
new
|
|
1314
|
+
new he({
|
|
1276
1315
|
startDate: n.state.start,
|
|
1277
1316
|
endDate: n.state.end,
|
|
1278
1317
|
onRangeSelect: e,
|
|
1279
1318
|
blockPriorDates: t
|
|
1280
1319
|
})
|
|
1281
|
-
])),
|
|
1320
|
+
])), es = D(
|
|
1282
1321
|
{
|
|
1283
1322
|
/**
|
|
1284
1323
|
* The initial state of the DateRangePicker.
|
|
@@ -1311,59 +1350,74 @@ const O = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1311
1350
|
*/
|
|
1312
1351
|
render() {
|
|
1313
1352
|
const e = (s, { state: o }) => o.toggle("open"), t = (s, o) => {
|
|
1314
|
-
this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`,
|
|
1353
|
+
this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`, v.trigger("change", this.input), typeof this.onChange == "function" && this.onChange({ start: s, end: o }, this.parent);
|
|
1315
1354
|
};
|
|
1316
1355
|
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1317
|
-
|
|
1356
|
+
dt({
|
|
1318
1357
|
toggleOpen: e,
|
|
1319
1358
|
bind: this.bind,
|
|
1320
1359
|
required: this.required
|
|
1321
1360
|
}),
|
|
1322
|
-
|
|
1361
|
+
ht({
|
|
1323
1362
|
handleDateSelect: t,
|
|
1324
1363
|
blockPriorDates: this.blockPriorDates || !1
|
|
1325
1364
|
})
|
|
1326
1365
|
]);
|
|
1327
1366
|
}
|
|
1328
1367
|
}
|
|
1329
|
-
),
|
|
1330
|
-
new
|
|
1368
|
+
), ts = ({ dateTime: e = "", remoteTimeZone: t = "America/Denver", filter: s = null }) => ie([
|
|
1369
|
+
new be({
|
|
1331
1370
|
dateTime: e,
|
|
1332
1371
|
filter: s || ((o) => {
|
|
1333
|
-
const n =
|
|
1334
|
-
return
|
|
1372
|
+
const n = E.getLocalTime(o, !0, !1, t);
|
|
1373
|
+
return E.getTimeFrame(n);
|
|
1335
1374
|
})
|
|
1336
1375
|
})
|
|
1337
1376
|
]);
|
|
1338
|
-
function
|
|
1339
|
-
return
|
|
1377
|
+
function ft({ bind: e, required: t }) {
|
|
1378
|
+
return f({
|
|
1340
1379
|
cache: "input",
|
|
1341
1380
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1342
1381
|
bind: e,
|
|
1343
1382
|
required: t
|
|
1344
1383
|
});
|
|
1345
1384
|
}
|
|
1346
|
-
function
|
|
1347
|
-
return f(
|
|
1385
|
+
function mt({ placeholder: e, handleInputChange: t, handleInputFocus: s }) {
|
|
1386
|
+
return f({
|
|
1387
|
+
cache: "timeInput",
|
|
1388
|
+
class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground",
|
|
1389
|
+
placeholder: e || "hh:mm AM/PM",
|
|
1390
|
+
input: t,
|
|
1391
|
+
focus: s,
|
|
1392
|
+
onState: ["selectedTime", (o) => o || ""]
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
function gt({ bind: e, required: t, toggleOpen: s, handleInputChange: o, handleInputFocus: n, placeholder: r }) {
|
|
1396
|
+
return l(
|
|
1348
1397
|
{
|
|
1349
|
-
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"
|
|
1350
|
-
click: s
|
|
1398
|
+
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"
|
|
1351
1399
|
},
|
|
1352
1400
|
[
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1401
|
+
ft({ bind: e, required: t }),
|
|
1402
|
+
mt({ placeholder: r, handleInputChange: o, handleInputFocus: n }),
|
|
1403
|
+
b(
|
|
1404
|
+
{
|
|
1405
|
+
class: "flex-shrink-0 hover:bg-muted/50 rounded p-1",
|
|
1406
|
+
click: s
|
|
1407
|
+
},
|
|
1408
|
+
[
|
|
1409
|
+
C({ html: d.clock })
|
|
1410
|
+
]
|
|
1411
|
+
)
|
|
1358
1412
|
]
|
|
1359
1413
|
);
|
|
1360
1414
|
}
|
|
1361
|
-
function
|
|
1415
|
+
function P({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: n = !1 }) {
|
|
1362
1416
|
return l(
|
|
1363
1417
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1364
1418
|
e.map((r) => {
|
|
1365
1419
|
let i = n ? r.toString().padStart(2, "0") : r.toString();
|
|
1366
|
-
return
|
|
1420
|
+
return b({
|
|
1367
1421
|
text: i,
|
|
1368
1422
|
class: "hover:bg-muted/50 rounded-md px-2 py-1",
|
|
1369
1423
|
click: () => t({ [o]: i }),
|
|
@@ -1372,9 +1426,9 @@ function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: n = !1
|
|
|
1372
1426
|
})
|
|
1373
1427
|
);
|
|
1374
1428
|
}
|
|
1375
|
-
function
|
|
1376
|
-
return
|
|
1377
|
-
(t, s, o) => new
|
|
1429
|
+
function pt({ handleTimeSelect: e }) {
|
|
1430
|
+
return O(
|
|
1431
|
+
(t, s, o) => new F(
|
|
1378
1432
|
{
|
|
1379
1433
|
cache: "dropdown",
|
|
1380
1434
|
parent: o,
|
|
@@ -1389,7 +1443,7 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1389
1443
|
{ class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
|
|
1390
1444
|
[
|
|
1391
1445
|
// Hours column
|
|
1392
|
-
|
|
1446
|
+
P({
|
|
1393
1447
|
items: Array.from({ length: 12 }, (n, r) => r + 1),
|
|
1394
1448
|
handleTimeSelect: e,
|
|
1395
1449
|
state: o.state,
|
|
@@ -1397,7 +1451,7 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1397
1451
|
pad: !0
|
|
1398
1452
|
}),
|
|
1399
1453
|
// Minutes column
|
|
1400
|
-
|
|
1454
|
+
P({
|
|
1401
1455
|
items: Array.from({ length: 60 }, (n, r) => r),
|
|
1402
1456
|
handleTimeSelect: e,
|
|
1403
1457
|
state: o.state,
|
|
@@ -1405,7 +1459,7 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1405
1459
|
pad: !0
|
|
1406
1460
|
}),
|
|
1407
1461
|
// AM/PM column
|
|
1408
|
-
|
|
1462
|
+
P({
|
|
1409
1463
|
items: ["AM", "PM"],
|
|
1410
1464
|
handleTimeSelect: e,
|
|
1411
1465
|
state: o.state,
|
|
@@ -1419,20 +1473,20 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1419
1473
|
)
|
|
1420
1474
|
);
|
|
1421
1475
|
}
|
|
1422
|
-
function
|
|
1476
|
+
function q(e) {
|
|
1423
1477
|
if (!e)
|
|
1424
1478
|
return { hour: null, minute: null, meridian: null };
|
|
1425
1479
|
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1426
1480
|
if (!s)
|
|
1427
1481
|
return { hour: null, minute: null, meridian: null };
|
|
1428
|
-
let [, o, n, , r] = s, i = parseInt(o, 10),
|
|
1429
|
-
return i < 0 || i > 23 ||
|
|
1482
|
+
let [, o, n, , r] = s, i = parseInt(o, 10), a = parseInt(n, 10);
|
|
1483
|
+
return i < 0 || i > 23 || a < 0 || a > 59 ? { hour: null, minute: null, meridian: null } : (r ? (r = r.toUpperCase(), r === "PM" && i < 12 ? i += 12 : r === "AM" && i === 12 && (i = 12)) : i === 0 ? (r = "AM", i = 12) : i < 12 ? r = "AM" : i === 12 ? r = "PM" : (r = "PM", i -= 12), {
|
|
1430
1484
|
hour: i.toString().padStart(2, "0"),
|
|
1431
|
-
minute:
|
|
1485
|
+
minute: a.toString().padStart(2, "0"),
|
|
1432
1486
|
meridian: r
|
|
1433
1487
|
});
|
|
1434
1488
|
}
|
|
1435
|
-
const
|
|
1489
|
+
const ss = D(
|
|
1436
1490
|
{
|
|
1437
1491
|
/**
|
|
1438
1492
|
* The initial shallow state of the TimePicker.
|
|
@@ -1440,7 +1494,7 @@ const Jt = y(
|
|
|
1440
1494
|
* @member {object} state
|
|
1441
1495
|
*/
|
|
1442
1496
|
state() {
|
|
1443
|
-
const e = this.selectedTime ?? null, { hour: t, minute: s, meridian: o } =
|
|
1497
|
+
const e = this.selectedTime ?? null, { hour: t, minute: s, meridian: o } = q(e);
|
|
1444
1498
|
return {
|
|
1445
1499
|
selectedTime: e,
|
|
1446
1500
|
open: !1,
|
|
@@ -1456,7 +1510,7 @@ const Jt = y(
|
|
|
1456
1510
|
*/
|
|
1457
1511
|
after() {
|
|
1458
1512
|
if (this.input.value) {
|
|
1459
|
-
const { hour: e, minute: t, meridian: s } =
|
|
1513
|
+
const { hour: e, minute: t, meridian: s } = q(this.input.value);
|
|
1460
1514
|
this.state.set({
|
|
1461
1515
|
hour: e,
|
|
1462
1516
|
minute: t,
|
|
@@ -1471,32 +1525,54 @@ const Jt = y(
|
|
|
1471
1525
|
* @returns {object}
|
|
1472
1526
|
*/
|
|
1473
1527
|
render() {
|
|
1474
|
-
const e = (
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1528
|
+
const e = (n, { state: r }) => r.toggle("open"), t = (n) => {
|
|
1529
|
+
let r = n.target.value.replace(/[^\d]/g, ""), i = "";
|
|
1530
|
+
if (r.length > 0 && (i = r.substring(0, 2), r.length > 2 && (i += ":" + r.substring(2, 4))), r.length >= 4) {
|
|
1531
|
+
const a = parseInt(r.substring(0, 2), 10), m = parseInt(r.substring(2, 4), 10);
|
|
1532
|
+
if (a >= 0 && a <= 23 && m >= 0 && m <= 59) {
|
|
1533
|
+
let g = a, y = "AM";
|
|
1534
|
+
a === 0 ? g = 12 : a > 12 ? (g = a - 12, y = "PM") : a === 12 && (y = "PM");
|
|
1535
|
+
const p = `${g.toString().padStart(2, "0")}:${m.toString().padStart(2, "0")} ${y}`;
|
|
1536
|
+
i = p, this.state.set({
|
|
1537
|
+
hour: g.toString().padStart(2, "0"),
|
|
1538
|
+
minute: m.toString().padStart(2, "0"),
|
|
1539
|
+
meridian: y,
|
|
1540
|
+
selectedTime: p
|
|
1541
|
+
}), this.input.value = p, v.trigger("change", this.input), typeof this.change == "function" && this.change(p);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
n.target.value = i;
|
|
1545
|
+
}, s = (n) => {
|
|
1546
|
+
n.target.select();
|
|
1547
|
+
}, o = ({ hour: n, minute: r, meridian: i }) => {
|
|
1548
|
+
if (n && (this.state.hour = n), r && (this.state.minute = r), i && (this.state.meridian = i), this.state.hour && this.state.minute && this.state.meridian) {
|
|
1549
|
+
const a = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1550
|
+
this.state.selectedTime = a, this.state.open = !1, this.input.value = a, v.trigger("change", this.input), typeof this.change == "function" && this.change(a);
|
|
1478
1551
|
}
|
|
1479
1552
|
};
|
|
1480
1553
|
return l(
|
|
1481
1554
|
{ class: "relative w-full max-w-[320px]" },
|
|
1482
1555
|
[
|
|
1483
|
-
|
|
1556
|
+
gt({
|
|
1484
1557
|
toggleOpen: e,
|
|
1485
1558
|
bind: this.bind,
|
|
1486
|
-
required: this.required
|
|
1559
|
+
required: this.required,
|
|
1560
|
+
handleInputChange: t,
|
|
1561
|
+
handleInputFocus: s,
|
|
1562
|
+
placeholder: this.placeholder
|
|
1487
1563
|
}),
|
|
1488
|
-
|
|
1489
|
-
handleTimeSelect:
|
|
1564
|
+
pt({
|
|
1565
|
+
handleTimeSelect: o
|
|
1490
1566
|
})
|
|
1491
1567
|
]
|
|
1492
1568
|
);
|
|
1493
1569
|
}
|
|
1494
1570
|
}
|
|
1495
|
-
),
|
|
1496
|
-
|
|
1497
|
-
]),
|
|
1498
|
-
|
|
1499
|
-
]),
|
|
1571
|
+
), bt = (e, t) => l({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${t}` }, [
|
|
1572
|
+
x({ size: "lg" }, e)
|
|
1573
|
+
]), xt = ({ title: e }) => L({ class: "flex flex-auto items-center" }, [
|
|
1574
|
+
$({ class: "text-lg font-semibold" }, e)
|
|
1575
|
+
]), yt = u((e, t) => ae(
|
|
1500
1576
|
{
|
|
1501
1577
|
class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
|
|
1502
1578
|
rounded-lg flex flex-auto flex-col
|
|
@@ -1507,18 +1583,18 @@ const Jt = y(
|
|
|
1507
1583
|
[
|
|
1508
1584
|
l({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
|
|
1509
1585
|
// Icon and content
|
|
1510
|
-
e.icon &&
|
|
1586
|
+
e.icon && bt(e.icon, e.iconColor),
|
|
1511
1587
|
l({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1512
1588
|
l({ class: "flex flex-auto flex-col gap-y-2" }, [
|
|
1513
|
-
|
|
1514
|
-
e.description &&
|
|
1589
|
+
xt(e),
|
|
1590
|
+
e.description && w({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e.description),
|
|
1515
1591
|
l({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t)
|
|
1516
1592
|
]),
|
|
1517
|
-
e.buttons &&
|
|
1593
|
+
e.buttons && N({ class: "flex flex-col-reverse sm:flex-row sm:justify-end mt-6 gap-2 sm:gap-0 sm:gap-x-2" }, e.buttons)
|
|
1518
1594
|
])
|
|
1519
1595
|
])
|
|
1520
1596
|
]
|
|
1521
|
-
)),
|
|
1597
|
+
)), vt = (e) => X.render(e, app.root), _ = {
|
|
1522
1598
|
info: {
|
|
1523
1599
|
borderColor: "border-blue-500",
|
|
1524
1600
|
bgColor: "bg-muted/10",
|
|
@@ -1545,7 +1621,7 @@ const Jt = y(
|
|
|
1545
1621
|
iconColor: "text-muted-foreground"
|
|
1546
1622
|
}
|
|
1547
1623
|
};
|
|
1548
|
-
class
|
|
1624
|
+
class wt extends k {
|
|
1549
1625
|
/**
|
|
1550
1626
|
* This will declare the props for the compiler.
|
|
1551
1627
|
*
|
|
@@ -1560,10 +1636,10 @@ class mt extends w {
|
|
|
1560
1636
|
* @returns {object}
|
|
1561
1637
|
*/
|
|
1562
1638
|
render() {
|
|
1563
|
-
const t = (
|
|
1564
|
-
|
|
1565
|
-
}, { borderColor: s, bgColor: o, iconColor: n } =
|
|
1566
|
-
return
|
|
1639
|
+
const t = (a) => {
|
|
1640
|
+
a.target === this.panel && this.close();
|
|
1641
|
+
}, { borderColor: s, bgColor: o, iconColor: n } = _[this.type] || _.default, r = `${this.getMainClass()} ${o} ${s}`, i = this.title || "Dialog Title";
|
|
1642
|
+
return yt({
|
|
1567
1643
|
class: r,
|
|
1568
1644
|
title: i,
|
|
1569
1645
|
click: t,
|
|
@@ -1607,7 +1683,7 @@ class mt extends w {
|
|
|
1607
1683
|
* @returns {void}
|
|
1608
1684
|
*/
|
|
1609
1685
|
open() {
|
|
1610
|
-
|
|
1686
|
+
vt(this), this.panel.showModal(), this.state.open = !0;
|
|
1611
1687
|
}
|
|
1612
1688
|
/**
|
|
1613
1689
|
* This will close the modal.
|
|
@@ -1618,7 +1694,7 @@ class mt extends w {
|
|
|
1618
1694
|
this.state.open = !1, this.panel.close(), typeof this.onClose == "function" && this.onClose(), this.destroy();
|
|
1619
1695
|
}
|
|
1620
1696
|
}
|
|
1621
|
-
class
|
|
1697
|
+
class os extends wt {
|
|
1622
1698
|
/**
|
|
1623
1699
|
* This will declare the props for the compiler.
|
|
1624
1700
|
*
|
|
@@ -1648,67 +1724,67 @@ class Kt extends mt {
|
|
|
1648
1724
|
this.confirmed && this.confirmed(), this.close();
|
|
1649
1725
|
}
|
|
1650
1726
|
}
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1727
|
+
const ns = u((e, t = []) => l({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
1728
|
+
ee({ class: "flex flex-auto flex-col" }, [
|
|
1653
1729
|
l({ class: "flex flex-auto flex-col gap-y-4" }, [
|
|
1654
1730
|
l({ class: "flex flex-auto items-center justify-center" }, [
|
|
1655
1731
|
e.icon && l({ class: "w-16 h-16 mb-2 text-primary" }, [
|
|
1656
|
-
|
|
1732
|
+
x(e.icon)
|
|
1657
1733
|
])
|
|
1658
1734
|
]),
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1735
|
+
L({ class: "py-4 text-center" }, [
|
|
1736
|
+
$({ class: "text-xl font-bold" }, e.title),
|
|
1737
|
+
w({ class: "pb-8 text-muted-foreground" }, e.description || ""),
|
|
1662
1738
|
...t
|
|
1663
1739
|
])
|
|
1664
1740
|
])
|
|
1665
1741
|
])
|
|
1666
1742
|
]));
|
|
1667
1743
|
export {
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1744
|
+
Bt as A,
|
|
1745
|
+
Jt as B,
|
|
1746
|
+
Ut as C,
|
|
1747
|
+
Lt as D,
|
|
1748
|
+
Zt as E,
|
|
1749
|
+
Te as F,
|
|
1750
|
+
es as G,
|
|
1751
|
+
ts as H,
|
|
1752
|
+
Wt as I,
|
|
1753
|
+
ss as J,
|
|
1754
|
+
os as K,
|
|
1755
|
+
Gt as L,
|
|
1756
|
+
Vt as M,
|
|
1757
|
+
Rt as N,
|
|
1758
|
+
yt as O,
|
|
1759
|
+
nt as P,
|
|
1760
|
+
wt as Q,
|
|
1761
|
+
ns as R,
|
|
1762
|
+
Et as S,
|
|
1763
|
+
Ht as T,
|
|
1764
|
+
ke as a,
|
|
1765
|
+
At as b,
|
|
1766
|
+
De as c,
|
|
1767
|
+
Be as d,
|
|
1768
|
+
Le as e,
|
|
1769
|
+
Ae as f,
|
|
1770
|
+
Mt as g,
|
|
1771
|
+
Pt as h,
|
|
1772
|
+
jt as i,
|
|
1773
|
+
Pe as j,
|
|
1774
|
+
Nt as k,
|
|
1775
|
+
ee as l,
|
|
1776
|
+
Ot as m,
|
|
1777
|
+
zt as n,
|
|
1778
|
+
Re as o,
|
|
1779
|
+
Yt as p,
|
|
1780
|
+
qt as q,
|
|
1781
|
+
_t as r,
|
|
1782
|
+
T as s,
|
|
1783
|
+
S as t,
|
|
1784
|
+
qe as u,
|
|
1785
|
+
Kt as v,
|
|
1786
|
+
Qt as w,
|
|
1787
|
+
ot as x,
|
|
1788
|
+
lt as y,
|
|
1789
|
+
Xt as z
|
|
1714
1790
|
};
|