@base-framework/ui 1.0.313 → 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 z = {
|
|
|
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 Dt 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 It 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 It 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 jt 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 jt 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 jt 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 E = {
|
|
|
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 Ee 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 Ee 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 Ee 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 Ee 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 Ee 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 Ot 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 Ot 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 Ot 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 N = 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 N = 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 N = 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 N = 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 N = 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 N = 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,13 +786,13 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
786
786
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
787
787
|
}
|
|
788
788
|
}, [
|
|
789
|
-
|
|
789
|
+
B("loaded", (s) => s === !1 || _e(this.src) ? j({
|
|
790
790
|
htmlFor: e,
|
|
791
791
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
792
792
|
}, [
|
|
793
|
-
|
|
793
|
+
x(d.upload),
|
|
794
794
|
l("Upload Image")
|
|
795
|
-
]) :
|
|
795
|
+
]) : K({
|
|
796
796
|
// @ts-ignore
|
|
797
797
|
src: this.src,
|
|
798
798
|
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
@@ -801,7 +801,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
801
801
|
]);
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
-
),
|
|
804
|
+
), Gt = I(
|
|
805
805
|
{
|
|
806
806
|
/**
|
|
807
807
|
* Get the initial state for the component.
|
|
@@ -821,7 +821,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
821
821
|
*/
|
|
822
822
|
openFileBrowse() {
|
|
823
823
|
const e = this.input;
|
|
824
|
-
e && (e.value = "",
|
|
824
|
+
e && (e.value = "", v.trigger("click", e));
|
|
825
825
|
},
|
|
826
826
|
/**
|
|
827
827
|
* Get the URL for the uploaded file.
|
|
@@ -840,7 +840,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
840
840
|
render() {
|
|
841
841
|
const e = "logo-upload", t = this.onChange || null;
|
|
842
842
|
return l({ class: "flex-none items-center" }, [
|
|
843
|
-
|
|
843
|
+
f({
|
|
844
844
|
id: e,
|
|
845
845
|
cache: "input",
|
|
846
846
|
type: "file",
|
|
@@ -857,17 +857,17 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
857
857
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
858
858
|
}
|
|
859
859
|
}, [
|
|
860
|
-
|
|
860
|
+
B(
|
|
861
861
|
"loaded",
|
|
862
|
-
(s) => s ?
|
|
862
|
+
(s) => s ? K({
|
|
863
863
|
// @ts-ignore
|
|
864
864
|
src: this.src,
|
|
865
865
|
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
866
|
-
}) :
|
|
866
|
+
}) : j({
|
|
867
867
|
htmlFor: e,
|
|
868
868
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
869
869
|
}, [
|
|
870
|
-
|
|
870
|
+
x(d.upload),
|
|
871
871
|
l("Upload logo")
|
|
872
872
|
])
|
|
873
873
|
)
|
|
@@ -875,22 +875,22 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
875
875
|
]);
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
|
-
),
|
|
878
|
+
), We = (e, t) => J(
|
|
879
879
|
{
|
|
880
880
|
href: e,
|
|
881
881
|
"aria-current": t === "Breadcrumb" && "page",
|
|
882
882
|
// Only set aria-current on the last item
|
|
883
883
|
class: "text-muted-foreground font-medium hover:text-foreground"
|
|
884
884
|
},
|
|
885
|
-
[
|
|
886
|
-
),
|
|
885
|
+
[c(t)]
|
|
886
|
+
), Ge = () => x({
|
|
887
887
|
class: "mx-3 text-muted-foreground",
|
|
888
888
|
"aria-hidden": !0,
|
|
889
889
|
size: "xs"
|
|
890
|
-
},
|
|
891
|
-
e.href ?
|
|
892
|
-
e.separator &&
|
|
893
|
-
]),
|
|
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(
|
|
894
894
|
{
|
|
895
895
|
/**
|
|
896
896
|
* Set initial data
|
|
@@ -898,7 +898,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
898
898
|
* @returns {Data}
|
|
899
899
|
*/
|
|
900
900
|
setData() {
|
|
901
|
-
return new
|
|
901
|
+
return new A({
|
|
902
902
|
// @ts-ignore
|
|
903
903
|
items: this.items || []
|
|
904
904
|
});
|
|
@@ -910,7 +910,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
910
910
|
*/
|
|
911
911
|
render() {
|
|
912
912
|
const e = this.data.items.length - 1;
|
|
913
|
-
return
|
|
913
|
+
return re(
|
|
914
914
|
{
|
|
915
915
|
"aria-label": "Breadcrumb",
|
|
916
916
|
class: "flex items-center gap-x-1 text-sm"
|
|
@@ -919,7 +919,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
919
919
|
l({
|
|
920
920
|
role: "list",
|
|
921
921
|
class: "flex items-center",
|
|
922
|
-
for: ["items", (t, s) =>
|
|
922
|
+
for: ["items", (t, s) => Je({
|
|
923
923
|
href: t.href,
|
|
924
924
|
label: t.label,
|
|
925
925
|
separator: s < e
|
|
@@ -929,7 +929,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
929
929
|
);
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
|
-
),
|
|
932
|
+
), Y = {
|
|
933
933
|
xs: "h-1 w-1",
|
|
934
934
|
sm: "h-2 w-2",
|
|
935
935
|
md: "h-4 w-4",
|
|
@@ -938,8 +938,8 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
938
938
|
"2xl": "h-16 w-16",
|
|
939
939
|
"3xl": "h-24 w-24",
|
|
940
940
|
default: "h-4 w-4"
|
|
941
|
-
},
|
|
942
|
-
|
|
941
|
+
}, Ke = (e) => Y[e] || Y.default, Qe = ({ index: e, size: t }) => l({ class: `${t} rounded-full bg-muted cursor-pointer` }, [
|
|
942
|
+
c({
|
|
943
943
|
class: "block w-full h-full rounded-full transition-colors",
|
|
944
944
|
onSet: ["activeIndex", {
|
|
945
945
|
"bg-primary": e,
|
|
@@ -949,10 +949,10 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
949
949
|
o.activeIndex = e, n && n(e);
|
|
950
950
|
}
|
|
951
951
|
})
|
|
952
|
-
]),
|
|
952
|
+
]), Xe = (e, t) => Array.from({ length: e }, (s, o) => Qe({
|
|
953
953
|
index: o,
|
|
954
954
|
size: t
|
|
955
|
-
})),
|
|
955
|
+
})), Kt = I(
|
|
956
956
|
{
|
|
957
957
|
/**
|
|
958
958
|
* Defines component data (props).
|
|
@@ -960,7 +960,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
960
960
|
* @returns {Data}
|
|
961
961
|
*/
|
|
962
962
|
setData() {
|
|
963
|
-
return new
|
|
963
|
+
return new A({
|
|
964
964
|
// @ts-ignore
|
|
965
965
|
count: this.count || 4,
|
|
966
966
|
// total dots
|
|
@@ -974,7 +974,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
974
974
|
* @returns {object}
|
|
975
975
|
*/
|
|
976
976
|
render() {
|
|
977
|
-
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);
|
|
978
978
|
return l(
|
|
979
979
|
{ class: "flex justify-center items-center py-2" },
|
|
980
980
|
[
|
|
@@ -983,37 +983,37 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
983
983
|
);
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
|
-
),
|
|
986
|
+
), Ze = ({ toggleDropdown: e }) => b(
|
|
987
987
|
{
|
|
988
988
|
cache: "button",
|
|
989
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",
|
|
990
990
|
click: e
|
|
991
991
|
},
|
|
992
992
|
[
|
|
993
|
-
|
|
994
|
-
|
|
993
|
+
c({ onState: ["selectedLabel", (t) => t || "Select item..."] }),
|
|
994
|
+
C({ html: d.chevron.upDown })
|
|
995
995
|
]
|
|
996
|
-
),
|
|
996
|
+
), et = (e, t, s) => W({
|
|
997
997
|
class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
|
|
998
998
|
click: () => t(e),
|
|
999
999
|
onState: [s, "selectedValue", { "bg-secondary": e.value }]
|
|
1000
1000
|
}, [
|
|
1001
|
-
e.icon &&
|
|
1002
|
-
|
|
1003
|
-
]),
|
|
1004
|
-
|
|
1005
|
-
]),
|
|
1006
|
-
|
|
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(
|
|
1007
1007
|
"open",
|
|
1008
|
-
(s, o, n) => s ? new
|
|
1008
|
+
(s, o, n) => s ? new F({
|
|
1009
1009
|
cache: "dropdown",
|
|
1010
1010
|
parent: n,
|
|
1011
1011
|
button: n.button
|
|
1012
1012
|
}, [
|
|
1013
|
-
|
|
1013
|
+
tt(e, t)
|
|
1014
1014
|
]) : null
|
|
1015
1015
|
)
|
|
1016
|
-
]),
|
|
1016
|
+
]), Qt = I(
|
|
1017
1017
|
{
|
|
1018
1018
|
/**
|
|
1019
1019
|
* This will set up the data.
|
|
@@ -1021,7 +1021,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1021
1021
|
* @returns {Data}
|
|
1022
1022
|
*/
|
|
1023
1023
|
setData() {
|
|
1024
|
-
return new
|
|
1024
|
+
return new A({
|
|
1025
1025
|
// @ts-ignore
|
|
1026
1026
|
items: this.items || []
|
|
1027
1027
|
});
|
|
@@ -1094,8 +1094,8 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1094
1094
|
const e = this.class || "", t = this.maxWidth || "max-w-[250px]", s = this.width || "w-full";
|
|
1095
1095
|
return l({ class: `relative ${s} flex flex-auto flex-col ${t} ${e}` }, [
|
|
1096
1096
|
// @ts-ignore
|
|
1097
|
-
|
|
1098
|
-
|
|
1097
|
+
Ze({ toggleDropdown: this.toggleDropdown.bind(this) }),
|
|
1098
|
+
st({
|
|
1099
1099
|
// @ts-ignore
|
|
1100
1100
|
state: this.state,
|
|
1101
1101
|
// @ts-ignore
|
|
@@ -1103,7 +1103,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1103
1103
|
}),
|
|
1104
1104
|
// Hidden required input for form validation
|
|
1105
1105
|
// @ts-ignore
|
|
1106
|
-
this.required &&
|
|
1106
|
+
this.required && f({
|
|
1107
1107
|
class: "opacity-0 absolute top-0 left-0 z-[1]",
|
|
1108
1108
|
type: "text",
|
|
1109
1109
|
// @ts-ignore
|
|
@@ -1115,26 +1115,26 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1115
1115
|
]);
|
|
1116
1116
|
}
|
|
1117
1117
|
}
|
|
1118
|
-
),
|
|
1118
|
+
), te = ({ icon: e, click: t, ariaLabel: s }) => h({
|
|
1119
1119
|
variant: "icon",
|
|
1120
1120
|
class: "flex flex-none",
|
|
1121
1121
|
click: t,
|
|
1122
1122
|
icon: e,
|
|
1123
1123
|
"aria-label": s
|
|
1124
|
-
}),
|
|
1125
|
-
icon:
|
|
1124
|
+
}), ot = ({ click: e }) => te({
|
|
1125
|
+
icon: d.circleMinus,
|
|
1126
1126
|
click: e,
|
|
1127
1127
|
ariaLabel: "Decrement"
|
|
1128
|
-
}),
|
|
1129
|
-
icon:
|
|
1128
|
+
}), nt = ({ click: e }) => te({
|
|
1129
|
+
icon: d.circlePlus,
|
|
1130
1130
|
click: e,
|
|
1131
1131
|
ariaLabel: "Increment"
|
|
1132
|
-
}),
|
|
1132
|
+
}), lt = ({ bind: e, min: t, max: s, readonly: o = !1 }) => Q(({ state: n }) => f({
|
|
1133
1133
|
value: ["[[count]]", n],
|
|
1134
1134
|
bind: e,
|
|
1135
1135
|
blur: (r, { state: i }) => {
|
|
1136
|
-
let
|
|
1137
|
-
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;
|
|
1138
1138
|
},
|
|
1139
1139
|
class: "flex flex-auto text-lg font-medium bg-input text-center border min-w-0",
|
|
1140
1140
|
readonly: o,
|
|
@@ -1142,7 +1142,7 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1142
1142
|
max: s,
|
|
1143
1143
|
type: "number",
|
|
1144
1144
|
"aria-label": "Counter"
|
|
1145
|
-
})),
|
|
1145
|
+
})), Xt = D(
|
|
1146
1146
|
{
|
|
1147
1147
|
/**
|
|
1148
1148
|
* Initial state for the counter component.
|
|
@@ -1165,45 +1165,69 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1165
1165
|
render() {
|
|
1166
1166
|
const e = this.class ?? "";
|
|
1167
1167
|
return l({ class: `flex flex-auto items-center justify-between gap-x-4 p-4 ${e}` }, [
|
|
1168
|
-
|
|
1169
|
-
|
|
1168
|
+
ot({ click: () => this.state.decrement("count") }),
|
|
1169
|
+
lt({
|
|
1170
1170
|
bind: this.bind,
|
|
1171
1171
|
readonly: this.readonly,
|
|
1172
1172
|
min: this.min,
|
|
1173
1173
|
max: this.max
|
|
1174
1174
|
}),
|
|
1175
|
-
|
|
1175
|
+
nt({ click: () => this.state.increment("count") })
|
|
1176
1176
|
]);
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
|
-
),
|
|
1179
|
+
), rt = ({ bind: e, required: t }) => f({
|
|
1180
1180
|
cache: "input",
|
|
1181
1181
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1182
1182
|
bind: e,
|
|
1183
1183
|
required: t
|
|
1184
|
-
}),
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
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({
|
|
1195
1219
|
cache: "dropdown",
|
|
1196
1220
|
parent: n,
|
|
1197
1221
|
button: n.panel,
|
|
1198
1222
|
size: "fit"
|
|
1199
1223
|
}, [
|
|
1200
|
-
new
|
|
1224
|
+
new de({
|
|
1201
1225
|
selectedDate: n.state.selectedDate,
|
|
1202
1226
|
selectedCallBack: e,
|
|
1203
1227
|
blockPriorDates: t
|
|
1204
1228
|
})
|
|
1205
1229
|
])
|
|
1206
|
-
),
|
|
1230
|
+
), Zt = D(
|
|
1207
1231
|
{
|
|
1208
1232
|
/**
|
|
1209
1233
|
* The initial state of the DatePicker.
|
|
@@ -1231,51 +1255,69 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1231
1255
|
* @returns {object}
|
|
1232
1256
|
*/
|
|
1233
1257
|
render() {
|
|
1234
|
-
const e = (
|
|
1235
|
-
|
|
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);
|
|
1236
1272
|
};
|
|
1237
|
-
return l(
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
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
|
+
);
|
|
1248
1290
|
}
|
|
1249
1291
|
}
|
|
1250
|
-
),
|
|
1292
|
+
), ut = ({ bind: e, required: t }) => f({
|
|
1251
1293
|
cache: "input",
|
|
1252
1294
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1253
1295
|
bind: e,
|
|
1254
1296
|
required: t
|
|
1255
|
-
}),
|
|
1297
|
+
}), dt = ({ bind: e, required: t, toggleOpen: s }) => b({
|
|
1256
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",
|
|
1257
1299
|
click: s
|
|
1258
1300
|
}, [
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
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"))
|
|
1264
1306
|
]),
|
|
1265
|
-
|
|
1266
|
-
]),
|
|
1307
|
+
C({ html: d.calendar.days })
|
|
1308
|
+
]), ht = ({ handleDateSelect: e, blockPriorDates: t }) => O((s, o, n) => new F({
|
|
1267
1309
|
cache: "dropdown",
|
|
1268
1310
|
parent: n,
|
|
1269
1311
|
button: n.panel,
|
|
1270
1312
|
size: "xl"
|
|
1271
1313
|
}, [
|
|
1272
|
-
new
|
|
1314
|
+
new he({
|
|
1273
1315
|
startDate: n.state.start,
|
|
1274
1316
|
endDate: n.state.end,
|
|
1275
1317
|
onRangeSelect: e,
|
|
1276
1318
|
blockPriorDates: t
|
|
1277
1319
|
})
|
|
1278
|
-
])),
|
|
1320
|
+
])), es = D(
|
|
1279
1321
|
{
|
|
1280
1322
|
/**
|
|
1281
1323
|
* The initial state of the DateRangePicker.
|
|
@@ -1308,59 +1350,74 @@ const N = globalThis.matchMedia, B = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1308
1350
|
*/
|
|
1309
1351
|
render() {
|
|
1310
1352
|
const e = (s, { state: o }) => o.toggle("open"), t = (s, o) => {
|
|
1311
|
-
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);
|
|
1312
1354
|
};
|
|
1313
1355
|
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1314
|
-
|
|
1356
|
+
dt({
|
|
1315
1357
|
toggleOpen: e,
|
|
1316
1358
|
bind: this.bind,
|
|
1317
1359
|
required: this.required
|
|
1318
1360
|
}),
|
|
1319
|
-
|
|
1361
|
+
ht({
|
|
1320
1362
|
handleDateSelect: t,
|
|
1321
1363
|
blockPriorDates: this.blockPriorDates || !1
|
|
1322
1364
|
})
|
|
1323
1365
|
]);
|
|
1324
1366
|
}
|
|
1325
1367
|
}
|
|
1326
|
-
),
|
|
1327
|
-
new
|
|
1368
|
+
), ts = ({ dateTime: e = "", remoteTimeZone: t = "America/Denver", filter: s = null }) => ie([
|
|
1369
|
+
new be({
|
|
1328
1370
|
dateTime: e,
|
|
1329
1371
|
filter: s || ((o) => {
|
|
1330
|
-
const n =
|
|
1331
|
-
return
|
|
1372
|
+
const n = E.getLocalTime(o, !0, !1, t);
|
|
1373
|
+
return E.getTimeFrame(n);
|
|
1332
1374
|
})
|
|
1333
1375
|
})
|
|
1334
1376
|
]);
|
|
1335
|
-
function
|
|
1336
|
-
return
|
|
1377
|
+
function ft({ bind: e, required: t }) {
|
|
1378
|
+
return f({
|
|
1337
1379
|
cache: "input",
|
|
1338
1380
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1339
1381
|
bind: e,
|
|
1340
1382
|
required: t
|
|
1341
1383
|
});
|
|
1342
1384
|
}
|
|
1343
|
-
function
|
|
1344
|
-
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(
|
|
1345
1397
|
{
|
|
1346
|
-
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"
|
|
1347
|
-
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"
|
|
1348
1399
|
},
|
|
1349
1400
|
[
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
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
|
+
)
|
|
1355
1412
|
]
|
|
1356
1413
|
);
|
|
1357
1414
|
}
|
|
1358
|
-
function
|
|
1415
|
+
function P({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: n = !1 }) {
|
|
1359
1416
|
return l(
|
|
1360
1417
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1361
1418
|
e.map((r) => {
|
|
1362
1419
|
let i = n ? r.toString().padStart(2, "0") : r.toString();
|
|
1363
|
-
return
|
|
1420
|
+
return b({
|
|
1364
1421
|
text: i,
|
|
1365
1422
|
class: "hover:bg-muted/50 rounded-md px-2 py-1",
|
|
1366
1423
|
click: () => t({ [o]: i }),
|
|
@@ -1369,9 +1426,9 @@ function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: n = !1
|
|
|
1369
1426
|
})
|
|
1370
1427
|
);
|
|
1371
1428
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return
|
|
1374
|
-
(t, s, o) => new
|
|
1429
|
+
function pt({ handleTimeSelect: e }) {
|
|
1430
|
+
return O(
|
|
1431
|
+
(t, s, o) => new F(
|
|
1375
1432
|
{
|
|
1376
1433
|
cache: "dropdown",
|
|
1377
1434
|
parent: o,
|
|
@@ -1386,7 +1443,7 @@ function ut({ handleTimeSelect: e }) {
|
|
|
1386
1443
|
{ class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
|
|
1387
1444
|
[
|
|
1388
1445
|
// Hours column
|
|
1389
|
-
|
|
1446
|
+
P({
|
|
1390
1447
|
items: Array.from({ length: 12 }, (n, r) => r + 1),
|
|
1391
1448
|
handleTimeSelect: e,
|
|
1392
1449
|
state: o.state,
|
|
@@ -1394,7 +1451,7 @@ function ut({ handleTimeSelect: e }) {
|
|
|
1394
1451
|
pad: !0
|
|
1395
1452
|
}),
|
|
1396
1453
|
// Minutes column
|
|
1397
|
-
|
|
1454
|
+
P({
|
|
1398
1455
|
items: Array.from({ length: 60 }, (n, r) => r),
|
|
1399
1456
|
handleTimeSelect: e,
|
|
1400
1457
|
state: o.state,
|
|
@@ -1402,7 +1459,7 @@ function ut({ handleTimeSelect: e }) {
|
|
|
1402
1459
|
pad: !0
|
|
1403
1460
|
}),
|
|
1404
1461
|
// AM/PM column
|
|
1405
|
-
|
|
1462
|
+
P({
|
|
1406
1463
|
items: ["AM", "PM"],
|
|
1407
1464
|
handleTimeSelect: e,
|
|
1408
1465
|
state: o.state,
|
|
@@ -1416,20 +1473,20 @@ function ut({ handleTimeSelect: e }) {
|
|
|
1416
1473
|
)
|
|
1417
1474
|
);
|
|
1418
1475
|
}
|
|
1419
|
-
function
|
|
1476
|
+
function q(e) {
|
|
1420
1477
|
if (!e)
|
|
1421
1478
|
return { hour: null, minute: null, meridian: null };
|
|
1422
1479
|
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1423
1480
|
if (!s)
|
|
1424
1481
|
return { hour: null, minute: null, meridian: null };
|
|
1425
|
-
let [, o, n, , r] = s, i = parseInt(o, 10),
|
|
1426
|
-
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), {
|
|
1427
1484
|
hour: i.toString().padStart(2, "0"),
|
|
1428
|
-
minute:
|
|
1485
|
+
minute: a.toString().padStart(2, "0"),
|
|
1429
1486
|
meridian: r
|
|
1430
1487
|
});
|
|
1431
1488
|
}
|
|
1432
|
-
const
|
|
1489
|
+
const ss = D(
|
|
1433
1490
|
{
|
|
1434
1491
|
/**
|
|
1435
1492
|
* The initial shallow state of the TimePicker.
|
|
@@ -1437,7 +1494,7 @@ const Kt = y(
|
|
|
1437
1494
|
* @member {object} state
|
|
1438
1495
|
*/
|
|
1439
1496
|
state() {
|
|
1440
|
-
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);
|
|
1441
1498
|
return {
|
|
1442
1499
|
selectedTime: e,
|
|
1443
1500
|
open: !1,
|
|
@@ -1453,7 +1510,7 @@ const Kt = y(
|
|
|
1453
1510
|
*/
|
|
1454
1511
|
after() {
|
|
1455
1512
|
if (this.input.value) {
|
|
1456
|
-
const { hour: e, minute: t, meridian: s } =
|
|
1513
|
+
const { hour: e, minute: t, meridian: s } = q(this.input.value);
|
|
1457
1514
|
this.state.set({
|
|
1458
1515
|
hour: e,
|
|
1459
1516
|
minute: t,
|
|
@@ -1468,32 +1525,54 @@ const Kt = y(
|
|
|
1468
1525
|
* @returns {object}
|
|
1469
1526
|
*/
|
|
1470
1527
|
render() {
|
|
1471
|
-
const e = (
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
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);
|
|
1475
1551
|
}
|
|
1476
1552
|
};
|
|
1477
1553
|
return l(
|
|
1478
1554
|
{ class: "relative w-full max-w-[320px]" },
|
|
1479
1555
|
[
|
|
1480
|
-
|
|
1556
|
+
gt({
|
|
1481
1557
|
toggleOpen: e,
|
|
1482
1558
|
bind: this.bind,
|
|
1483
|
-
required: this.required
|
|
1559
|
+
required: this.required,
|
|
1560
|
+
handleInputChange: t,
|
|
1561
|
+
handleInputFocus: s,
|
|
1562
|
+
placeholder: this.placeholder
|
|
1484
1563
|
}),
|
|
1485
|
-
|
|
1486
|
-
handleTimeSelect:
|
|
1564
|
+
pt({
|
|
1565
|
+
handleTimeSelect: o
|
|
1487
1566
|
})
|
|
1488
1567
|
]
|
|
1489
1568
|
);
|
|
1490
1569
|
}
|
|
1491
1570
|
}
|
|
1492
|
-
),
|
|
1493
|
-
|
|
1494
|
-
]),
|
|
1495
|
-
|
|
1496
|
-
]),
|
|
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(
|
|
1497
1576
|
{
|
|
1498
1577
|
class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
|
|
1499
1578
|
rounded-lg flex flex-auto flex-col
|
|
@@ -1504,18 +1583,18 @@ const Kt = y(
|
|
|
1504
1583
|
[
|
|
1505
1584
|
l({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
|
|
1506
1585
|
// Icon and content
|
|
1507
|
-
e.icon &&
|
|
1586
|
+
e.icon && bt(e.icon, e.iconColor),
|
|
1508
1587
|
l({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1509
1588
|
l({ class: "flex flex-auto flex-col gap-y-2" }, [
|
|
1510
|
-
|
|
1511
|
-
e.description &&
|
|
1589
|
+
xt(e),
|
|
1590
|
+
e.description && w({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e.description),
|
|
1512
1591
|
l({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t)
|
|
1513
1592
|
]),
|
|
1514
|
-
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)
|
|
1515
1594
|
])
|
|
1516
1595
|
])
|
|
1517
1596
|
]
|
|
1518
|
-
)),
|
|
1597
|
+
)), vt = (e) => X.render(e, app.root), _ = {
|
|
1519
1598
|
info: {
|
|
1520
1599
|
borderColor: "border-blue-500",
|
|
1521
1600
|
bgColor: "bg-muted/10",
|
|
@@ -1542,7 +1621,7 @@ const Kt = y(
|
|
|
1542
1621
|
iconColor: "text-muted-foreground"
|
|
1543
1622
|
}
|
|
1544
1623
|
};
|
|
1545
|
-
class
|
|
1624
|
+
class wt extends k {
|
|
1546
1625
|
/**
|
|
1547
1626
|
* This will declare the props for the compiler.
|
|
1548
1627
|
*
|
|
@@ -1557,10 +1636,10 @@ class gt extends w {
|
|
|
1557
1636
|
* @returns {object}
|
|
1558
1637
|
*/
|
|
1559
1638
|
render() {
|
|
1560
|
-
const t = (
|
|
1561
|
-
|
|
1562
|
-
}, { borderColor: s, bgColor: o, iconColor: n } =
|
|
1563
|
-
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({
|
|
1564
1643
|
class: r,
|
|
1565
1644
|
title: i,
|
|
1566
1645
|
click: t,
|
|
@@ -1604,7 +1683,7 @@ class gt extends w {
|
|
|
1604
1683
|
* @returns {void}
|
|
1605
1684
|
*/
|
|
1606
1685
|
open() {
|
|
1607
|
-
|
|
1686
|
+
vt(this), this.panel.showModal(), this.state.open = !0;
|
|
1608
1687
|
}
|
|
1609
1688
|
/**
|
|
1610
1689
|
* This will close the modal.
|
|
@@ -1615,7 +1694,7 @@ class gt extends w {
|
|
|
1615
1694
|
this.state.open = !1, this.panel.close(), typeof this.onClose == "function" && this.onClose(), this.destroy();
|
|
1616
1695
|
}
|
|
1617
1696
|
}
|
|
1618
|
-
class
|
|
1697
|
+
class os extends wt {
|
|
1619
1698
|
/**
|
|
1620
1699
|
* This will declare the props for the compiler.
|
|
1621
1700
|
*
|
|
@@ -1645,67 +1724,67 @@ class Qt extends gt {
|
|
|
1645
1724
|
this.confirmed && this.confirmed(), this.close();
|
|
1646
1725
|
}
|
|
1647
1726
|
}
|
|
1648
|
-
const
|
|
1649
|
-
|
|
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" }, [
|
|
1650
1729
|
l({ class: "flex flex-auto flex-col gap-y-4" }, [
|
|
1651
1730
|
l({ class: "flex flex-auto items-center justify-center" }, [
|
|
1652
1731
|
e.icon && l({ class: "w-16 h-16 mb-2 text-primary" }, [
|
|
1653
|
-
|
|
1732
|
+
x(e.icon)
|
|
1654
1733
|
])
|
|
1655
1734
|
]),
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
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 || ""),
|
|
1659
1738
|
...t
|
|
1660
1739
|
])
|
|
1661
1740
|
])
|
|
1662
1741
|
])
|
|
1663
1742
|
]));
|
|
1664
1743
|
export {
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
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
|
-
|
|
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
|
|
1711
1790
|
};
|