@base-framework/ui 1.1.14 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/dist/atoms.es.js +37 -34
- package/dist/buttons-snATS4J5.js +118 -0
- package/dist/{empty-state-CuciIYY7.js → empty-state-BR5Aa8lA.js} +324 -321
- package/dist/full-page-DccgwWsM.js +69 -0
- package/dist/icons.es.js +127 -1
- package/dist/image-BhZbKYDj.js +237 -0
- package/dist/index.es.js +179 -173
- package/dist/{mobile-nav-wrapper-C3Lvz7CH.js → mobile-nav-wrapper-1erstN34.js} +77 -84
- package/dist/molecules.es.js +5 -5
- package/dist/organisms.es.js +52 -51
- package/dist/pages.es.js +10 -9
- package/dist/sidebar-menu-CVyJBcHE.js +13 -0
- package/dist/sidebar-menu-page-Db-6HPoS.js +153 -0
- package/dist/signature-panel-CVq5N5M1.js +1364 -0
- package/dist/simple-search-input-CuC8q0fJ.js +1654 -0
- package/dist/skeleton-BlY3opxG.js +7 -0
- package/dist/{tooltip-BlFbB8yL.js → tooltip-BmvjA9XQ.js} +104 -84
- package/dist/types/components/atoms/atoms.d.ts +2 -0
- package/dist/types/components/atoms/material-icon.d.ts +17 -0
- package/dist/types/components/atoms/universal-icon.d.ts +3 -0
- package/dist/types/components/icons/icons.d.ts +1 -0
- package/dist/types/components/icons/material-symbols.d.ts +19 -0
- package/dist/types/components/molecules/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/types/components/molecules/image/image-uploader.d.ts +2 -2
- package/dist/types/components/molecules/image/logo-uploader.d.ts +2 -2
- package/dist/types/components/organisms/navigation/mobile/nav-wrapper/title-header.d.ts +1 -1
- package/package.json +1 -1
- package/dist/buttons-Dr-bViom.js +0 -77
- package/dist/form-group-BB7dLJir.js +0 -29
- package/dist/image-BB__4s0g.js +0 -31
- package/dist/inputs-CcimrM1k.js +0 -210
- package/dist/range-calendar-CzKIBhgb.js +0 -831
- package/dist/sidebar-menu-page-BtuUB_XB.js +0 -217
- package/dist/signature-panel-DmyPbuRi.js +0 -2186
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { P as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Atom as c, Component as y, Html as A, Dom as Z, base as tt, Data as k, Builder as H, Jot as w, Events as g, DateTime as M } from "@base-framework/base";
|
|
2
|
+
import { Div as n, H5 as et, P as b, Li as q, Span as a, Ul as V, Button as p, I as T, OnState as I, Label as P, H2 as v, Form as st, Header as B, Footer as L, A as G, H3 as ot, Checkbox as nt, Input as f, Img as W, Nav as it, UseParent as _, OnStateOpen as O, Time as rt, Dialog as lt } from "@base-framework/atoms";
|
|
3
|
+
import { P as S, C as at, R as ct } from "./simple-search-input-CuC8q0fJ.js";
|
|
4
|
+
import { U as m, B as h, I as dt } from "./buttons-snATS4J5.js";
|
|
5
|
+
import { Timer as ut, List as ht, DynamicTime as mt } from "@base-framework/organisms";
|
|
6
|
+
import { C as ft, b as pt } from "./tooltip-BmvjA9XQ.js";
|
|
7
|
+
import { f as C } from "./image-BhZbKYDj.js";
|
|
6
8
|
import { Icons as u } from "./icons.es.js";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import { F as z } from "./format-BmrNQptv.js";
|
|
10
|
+
import "./mobile-nav-wrapper-1erstN34.js";
|
|
11
|
+
import "./aside-template-BDvEMLnk.js";
|
|
12
|
+
import "./full-page-DccgwWsM.js";
|
|
13
|
+
import "./bside-template-BCP2pJWN.js";
|
|
14
|
+
const Y = {
|
|
11
15
|
info: {
|
|
12
16
|
borderColor: "border-blue-500",
|
|
13
17
|
bgColor: "bg-muted/10",
|
|
@@ -34,19 +38,19 @@ const z = {
|
|
|
34
38
|
iconColor: "text-muted-foreground"
|
|
35
39
|
}
|
|
36
40
|
}, gt = (t, e) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${e}` }, [
|
|
37
|
-
|
|
38
|
-
]),
|
|
39
|
-
const { borderColor:
|
|
40
|
-
return n({ class: `flex items-start p-4 border rounded-lg ${
|
|
41
|
+
m({ size: "sm" }, t)
|
|
42
|
+
]), bt = (t) => et({ class: "font-semibold" }, t), xt = (t) => b({ class: "text-sm text-muted-foreground" }, t), je = c(({ title: t, description: e, icon: s, type: o = "default" }) => {
|
|
43
|
+
const { borderColor: i, bgColor: r, iconColor: l } = Y[o] || Y.default;
|
|
44
|
+
return n({ class: `flex items-start p-4 border rounded-lg ${r} ${i}` }, [
|
|
41
45
|
// Icon and content
|
|
42
46
|
s && gt(s, l),
|
|
43
47
|
n({ class: "flex flex-col" }, [
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
bt(t),
|
|
49
|
+
xt(e)
|
|
46
50
|
])
|
|
47
51
|
]);
|
|
48
52
|
});
|
|
49
|
-
class
|
|
53
|
+
class Ee extends y {
|
|
50
54
|
/**
|
|
51
55
|
* This will declare the props for the compiler.
|
|
52
56
|
*
|
|
@@ -67,24 +71,24 @@ class Oe extends w {
|
|
|
67
71
|
A.removeElement(e);
|
|
68
72
|
return;
|
|
69
73
|
}
|
|
70
|
-
|
|
74
|
+
Z.addClass(e, s), tt.on("animationend", e, (o) => A.removeElement(e));
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
|
-
const
|
|
77
|
+
const yt = (t) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, t), wt = (t) => a({ class: "flex w-4 h-4", html: t }), Ct = (t) => a({ class: "flex-auto" }, t), vt = (t, e) => q({
|
|
74
78
|
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",
|
|
75
79
|
click: () => e(t)
|
|
76
80
|
}, [
|
|
77
|
-
t.icon &&
|
|
78
|
-
|
|
79
|
-
t.shortcut &&
|
|
80
|
-
]),
|
|
81
|
-
t.map((s) =>
|
|
82
|
-
]),
|
|
81
|
+
t.icon && wt(t.icon),
|
|
82
|
+
Ct(t.label),
|
|
83
|
+
t.shortcut && yt(t.shortcut)
|
|
84
|
+
]), St = (t, e) => V({ class: "grid gap-2" }, [
|
|
85
|
+
t.map((s) => vt(s, e))
|
|
86
|
+
]), Dt = (t) => n({ class: "w-full z-10" }, [
|
|
83
87
|
n({
|
|
84
88
|
class: "max-h-60 border rounded-md overflow-y-auto p-1 grid gap-2 divide-y divide-border",
|
|
85
|
-
for: ["groups", (e) =>
|
|
89
|
+
for: ["groups", (e) => St(e, t)]
|
|
86
90
|
})
|
|
87
|
-
]),
|
|
91
|
+
]), kt = ({ label: t, icon: e, toggleDropdown: s }) => p({
|
|
88
92
|
cache: "button",
|
|
89
93
|
class: `inline-flex items-center justify-between rounded-md border
|
|
90
94
|
px-2 py-2 text-sm font-medium hover:bg-muted
|
|
@@ -92,20 +96,20 @@ const xt = (t) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, t),
|
|
|
92
96
|
click: s
|
|
93
97
|
}, [
|
|
94
98
|
t && a(t),
|
|
95
|
-
e &&
|
|
96
|
-
]),
|
|
97
|
-
|
|
99
|
+
e && T({ html: e })
|
|
100
|
+
]), Tt = ({ onSelect: t }) => n([
|
|
101
|
+
I(
|
|
98
102
|
"open",
|
|
99
|
-
(e, s, o) => e ? new
|
|
103
|
+
(e, s, o) => e ? new S({
|
|
100
104
|
cache: "dropdown",
|
|
101
105
|
parent: o,
|
|
102
106
|
button: o.button
|
|
103
107
|
}, [
|
|
104
|
-
|
|
108
|
+
Dt(t)
|
|
105
109
|
]) : null
|
|
106
110
|
)
|
|
107
111
|
]);
|
|
108
|
-
class
|
|
112
|
+
class Ne extends y {
|
|
109
113
|
/**
|
|
110
114
|
* This will declare the props for the compiler.
|
|
111
115
|
*
|
|
@@ -120,7 +124,7 @@ class Ae extends w {
|
|
|
120
124
|
* @returns {Data}
|
|
121
125
|
*/
|
|
122
126
|
setData() {
|
|
123
|
-
return new
|
|
127
|
+
return new k({
|
|
124
128
|
groups: this.groups || []
|
|
125
129
|
});
|
|
126
130
|
}
|
|
@@ -159,42 +163,42 @@ class Ae extends w {
|
|
|
159
163
|
*/
|
|
160
164
|
render() {
|
|
161
165
|
return n({ class: "relative" }, [
|
|
162
|
-
|
|
166
|
+
kt({
|
|
163
167
|
label: this.label,
|
|
164
168
|
icon: this.icon,
|
|
165
169
|
toggleDropdown: this.toggleDropdown.bind(this)
|
|
166
170
|
}),
|
|
167
|
-
|
|
171
|
+
Tt({ onSelect: this.handleSelect.bind(this) })
|
|
168
172
|
]);
|
|
169
173
|
}
|
|
170
174
|
}
|
|
171
|
-
const
|
|
172
|
-
t.title &&
|
|
173
|
-
t.description &&
|
|
175
|
+
const It = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e)), Bt = c((t, e) => P({ ...t, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, e)), Ft = c((t, e) => b({ ...t, class: "text-sm text-muted-foreground italic" }, e)), $t = c((t, e) => b({ ...t, class: "text-sm text-destructive" }, e)), Ue = c((t, e = []) => ft({ class: "flex flex-auto flex-col gap-y-0", margin: "m-0", padding: "p-0" }, [
|
|
176
|
+
t.title && v({ class: "text-lg font-semibold py-4 px-6" }, t.title),
|
|
177
|
+
t.description && b({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, t.description),
|
|
174
178
|
...e
|
|
175
|
-
])),
|
|
179
|
+
])), Re = c((t, e = []) => pt({ label: t.label, description: t.description, class: "py-4 px-6", border: t.border }, [
|
|
176
180
|
n({ class: "flex flex-col gap-y-6" }, e)
|
|
177
|
-
])),
|
|
181
|
+
])), He = c((t, e = []) => {
|
|
178
182
|
const s = t.border ? "border-t" : "";
|
|
179
183
|
return n({ ...t, class: `flex flex-col pb-4 px-6 gap-y-4 ${s} ${t.class || ""}` }, e);
|
|
180
|
-
}),
|
|
184
|
+
}), Mt = (t) => t.tag === "input" || t.tag === "select" || t.tag === "textarea", J = (t, e, s) => t.map((o) => !o || (o.children && o.children.length > 0 && (o.children = J(o.children, e, s)), !o.required) ? o : Mt(o) ? {
|
|
181
185
|
...o,
|
|
182
186
|
aria: {
|
|
183
187
|
invalid: ["hasError"]
|
|
184
188
|
},
|
|
185
189
|
invalid: s,
|
|
186
190
|
input: e
|
|
187
|
-
} : o),
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
}, (
|
|
191
|
-
t.setError(
|
|
191
|
+
} : o), Pt = c((t, e) => {
|
|
192
|
+
const i = J(e, (r) => {
|
|
193
|
+
r.target.checkValidity() && t.setError(null);
|
|
194
|
+
}, (r) => {
|
|
195
|
+
t.setError(r.target.validationMessage);
|
|
192
196
|
});
|
|
193
197
|
return n({
|
|
194
198
|
...t,
|
|
195
199
|
class: "w-full"
|
|
196
|
-
},
|
|
197
|
-
}),
|
|
200
|
+
}, i);
|
|
201
|
+
}), qe = C(
|
|
198
202
|
{
|
|
199
203
|
/**
|
|
200
204
|
* The initial state of the FormField.
|
|
@@ -215,38 +219,38 @@ const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e))
|
|
|
215
219
|
* @returns {object}
|
|
216
220
|
*/
|
|
217
221
|
render() {
|
|
218
|
-
const t = this.name, e = this.getId(`${t}`), { label: s, description: o } = this,
|
|
219
|
-
this.state.error =
|
|
222
|
+
const t = this.name, e = this.getId(`${t}`), { label: s, description: o } = this, i = (r) => {
|
|
223
|
+
this.state.error = r, this.state.hasError = !!r;
|
|
220
224
|
};
|
|
221
225
|
return n({ class: "flex flex-auto gap-y-4" }, [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
It([
|
|
227
|
+
Bt({ htmlFor: e }, s),
|
|
228
|
+
Pt({
|
|
225
229
|
id: e,
|
|
226
230
|
name: t,
|
|
227
231
|
value: this.state.value,
|
|
228
|
-
setError:
|
|
232
|
+
setError: i
|
|
229
233
|
}, this.children),
|
|
230
|
-
o &&
|
|
231
|
-
n({ onState: ["error", (
|
|
234
|
+
o && Ft({ id: this.getId("description") }, o),
|
|
235
|
+
n({ onState: ["error", (r) => r && $t(r)] })
|
|
232
236
|
])
|
|
233
237
|
]);
|
|
234
238
|
}
|
|
235
239
|
}
|
|
236
|
-
),
|
|
240
|
+
), Lt = (t, e, s = null) => {
|
|
237
241
|
t.target.checkValidity() && (t.preventDefault(), s && s(t, e));
|
|
238
242
|
}, K = c(
|
|
239
|
-
(t, e) =>
|
|
240
|
-
),
|
|
241
|
-
t.title &&
|
|
243
|
+
(t, e) => st({ ...t, submit: (s, o) => Lt(s, o, t.submit), class: `w-full ${t.class ?? ""}` }, e)
|
|
244
|
+
), Ve = c((t, e) => n({ ...t, class: `flex flex-auto flex-col gap-y-6 p-4 md:p-6 divide-y ${t.class || ""}` }, e)), Ge = c((t, e = []) => n({ class: "flex flex-col gap-y-3 py-4" }, [
|
|
245
|
+
t.title && v({ class: "font-semibold" }, t.title),
|
|
242
246
|
...e
|
|
243
|
-
])),
|
|
247
|
+
])), We = (t, e) => n({ class: "flex justify-between" }, [
|
|
244
248
|
a({ class: "text-muted-foreground" }, t),
|
|
245
249
|
a(e)
|
|
246
|
-
]),
|
|
250
|
+
]), _e = (t, e) => n({ class: "flex" }, [
|
|
247
251
|
a({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, t),
|
|
248
252
|
a(e)
|
|
249
|
-
]),
|
|
253
|
+
]), Ot = c(({ title: t, description: e, back: s, icon: o, options: i = [] }) => B({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10 min-w-0" }, [
|
|
250
254
|
/**
|
|
251
255
|
* Back Button (Mobile Only)
|
|
252
256
|
*/
|
|
@@ -254,46 +258,43 @@ const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e))
|
|
|
254
258
|
variant: "icon",
|
|
255
259
|
icon: u.arrows.left,
|
|
256
260
|
class: "mr-2 p-0 flex sm:hidden",
|
|
257
|
-
click: (
|
|
261
|
+
click: (r, l) => l.close()
|
|
258
262
|
}),
|
|
259
263
|
/**
|
|
260
264
|
* Icon Container
|
|
261
265
|
*/
|
|
262
266
|
o && n({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [
|
|
263
|
-
|
|
267
|
+
m({ size: "md" }, o)
|
|
264
268
|
]),
|
|
265
|
-
/**
|
|
266
|
-
* Title and Description Container
|
|
267
|
-
*/
|
|
268
269
|
n({ class: "flex flex-auto flex-row justify-between ml-2 gap-2 min-w-0" }, [
|
|
269
270
|
n({ class: "flex flex-auto flex-col min-w-0" }, [
|
|
270
|
-
|
|
271
|
+
v({ class: "text-lg font-semibold m-0 truncate" }, t),
|
|
271
272
|
e && n({ class: "text-sm text-muted-foreground truncate" }, e)
|
|
272
273
|
]),
|
|
273
|
-
n({ class: "flex flex-none items-center gap-2" },
|
|
274
|
+
n({ class: "flex flex-none items-center gap-2" }, i)
|
|
274
275
|
])
|
|
275
276
|
])), Q = c((t, e) => {
|
|
276
277
|
const s = t.class?.includes("drawer");
|
|
277
278
|
return n({
|
|
278
279
|
popover: "manual",
|
|
279
280
|
class: `modal ${s ? "" : "m-auto top-0 right-0 bottom-0 left-0"} ${s ? "" : "h-full max-h-screen"} fixed z-20 grid w-full gap-2 lg:border bg-background text-foreground shadow-xl break-words p-0 overflow-y-auto ${t.class}`,
|
|
280
|
-
click: (
|
|
281
|
-
|
|
281
|
+
click: (r, l) => {
|
|
282
|
+
r.target === l.panel && (r.preventDefault(), r.stopPropagation(), l.state.open = !1);
|
|
282
283
|
}
|
|
283
284
|
}, [
|
|
284
285
|
K({
|
|
285
286
|
class: "modal-content relative bg-background z-[1] flex flex-auto flex-col gap-y-4 min-w-0",
|
|
286
|
-
submit: (
|
|
287
|
+
submit: (r, l) => t.onSubmit && t.onSubmit(l),
|
|
287
288
|
cache: "modalContent",
|
|
288
289
|
...t.gestureHandlers
|
|
289
290
|
}, [
|
|
290
|
-
|
|
291
|
+
Ot(t),
|
|
291
292
|
n({ class: "modal-body flex flex-grow flex-col py-0 px-6 z-0", cache: "modalBody" }, e),
|
|
292
293
|
!t.hideFooter && L({ class: "modal-footer sticky bottom-0 bg-background/80 backdrop-blur-md flex flex-none justify-between py-4 px-6 z-10" }, t.buttons)
|
|
293
294
|
])
|
|
294
295
|
]);
|
|
295
|
-
}),
|
|
296
|
-
class
|
|
296
|
+
}), At = (t) => H.render(t, app.root);
|
|
297
|
+
class zt extends y {
|
|
297
298
|
/**
|
|
298
299
|
* This will declare the props for the compiler.
|
|
299
300
|
*
|
|
@@ -317,9 +318,9 @@ class At extends w {
|
|
|
317
318
|
options: this.headerOptions(),
|
|
318
319
|
buttons: this.getButtons(),
|
|
319
320
|
hideFooter: this.hideFooter,
|
|
320
|
-
onSubmit: (
|
|
321
|
-
let
|
|
322
|
-
this.onSubmit && (
|
|
321
|
+
onSubmit: (i) => {
|
|
322
|
+
let r = !0;
|
|
323
|
+
this.onSubmit && (r = this.onSubmit(i)), r !== !1 && this.destroy();
|
|
323
324
|
},
|
|
324
325
|
icon: this.icon,
|
|
325
326
|
back: this.back ?? !1,
|
|
@@ -427,7 +428,7 @@ class At extends w {
|
|
|
427
428
|
* @returns {void}
|
|
428
429
|
*/
|
|
429
430
|
open() {
|
|
430
|
-
|
|
431
|
+
At(this), this.showModal();
|
|
431
432
|
}
|
|
432
433
|
/**
|
|
433
434
|
* This will destroy the modal.
|
|
@@ -472,12 +473,12 @@ class Yt {
|
|
|
472
473
|
const {
|
|
473
474
|
modal: s = null,
|
|
474
475
|
modalContent: o = null,
|
|
475
|
-
modalBody:
|
|
476
|
-
closeThreshold:
|
|
476
|
+
modalBody: i = null,
|
|
477
|
+
closeThreshold: r = 150,
|
|
477
478
|
snapThreshold: l = 50,
|
|
478
479
|
onClose: d = null
|
|
479
480
|
} = e;
|
|
480
|
-
this.modal = s, this.modalContent = o, this.modalBody =
|
|
481
|
+
this.modal = s, this.modalContent = o, this.modalBody = i, this.closeThreshold = r, this.snapThreshold = l, this.onClose = d, this.reset();
|
|
481
482
|
}
|
|
482
483
|
/**
|
|
483
484
|
* Resets the drag state to initial values
|
|
@@ -527,10 +528,10 @@ class Yt {
|
|
|
527
528
|
const o = this.getDeltaY();
|
|
528
529
|
if (!this.state.isDragging && this.state.canDrag && o > 0 && this.modalBody.scrollTop === 0 && (this.state.isDragging = !0), this.state.isDragging && o > 0) {
|
|
529
530
|
e.preventDefault();
|
|
530
|
-
const
|
|
531
|
-
this.modalContent.style.transform = `translateY(${
|
|
532
|
-
const
|
|
533
|
-
this.updateBackdropOpacity(
|
|
531
|
+
const i = this.calculateTranslateY(o);
|
|
532
|
+
this.modalContent.style.transform = `translateY(${i}px)`, this.modalContent.style.transition = "none";
|
|
533
|
+
const r = this.calculateBackdropOpacity(o);
|
|
534
|
+
this.updateBackdropOpacity(r);
|
|
534
535
|
} else this.modalBody.scrollTop > 0 && (this.state.canDrag = !1);
|
|
535
536
|
}
|
|
536
537
|
/**
|
|
@@ -618,7 +619,7 @@ class Yt {
|
|
|
618
619
|
this.reset(), this.modal = null, this.onClose = null;
|
|
619
620
|
}
|
|
620
621
|
}
|
|
621
|
-
class
|
|
622
|
+
class Je extends zt {
|
|
622
623
|
/**
|
|
623
624
|
* Declares the component props
|
|
624
625
|
*
|
|
@@ -642,7 +643,7 @@ class qe extends At {
|
|
|
642
643
|
* @returns {object}
|
|
643
644
|
*/
|
|
644
645
|
render() {
|
|
645
|
-
const e = this.getMainClass(), s = this.title || "", o = this.description || null,
|
|
646
|
+
const e = this.getMainClass(), s = this.title || "", o = this.description || null, i = this.getContainerProps();
|
|
646
647
|
return Q(
|
|
647
648
|
{
|
|
648
649
|
class: e,
|
|
@@ -651,14 +652,14 @@ class qe extends At {
|
|
|
651
652
|
options: this.headerOptions(),
|
|
652
653
|
buttons: this.getButtons(),
|
|
653
654
|
hideFooter: this.hideFooter,
|
|
654
|
-
onSubmit: (
|
|
655
|
+
onSubmit: (r) => {
|
|
655
656
|
let l = !0;
|
|
656
|
-
this.onSubmit && (l = this.onSubmit(
|
|
657
|
+
this.onSubmit && (l = this.onSubmit(r)), l !== !1 && this.destroy();
|
|
657
658
|
},
|
|
658
659
|
icon: this.icon,
|
|
659
660
|
back: this.back ?? !1,
|
|
660
661
|
aria: { expanded: ["open"] },
|
|
661
|
-
...
|
|
662
|
+
...i
|
|
662
663
|
},
|
|
663
664
|
this.children
|
|
664
665
|
);
|
|
@@ -729,22 +730,22 @@ const j = {
|
|
|
729
730
|
borderColor: "border",
|
|
730
731
|
iconColor: "text-muted-foreground"
|
|
731
732
|
}
|
|
732
|
-
},
|
|
733
|
-
|
|
734
|
-
]),
|
|
733
|
+
}, jt = (t) => B({ class: "flex justify-center" }, [
|
|
734
|
+
ot({ class: "text-lg font-bold mb-0" }, t)
|
|
735
|
+
]), Et = c(({ href: t, class: e }, s) => G({
|
|
735
736
|
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 ${e}`,
|
|
736
737
|
href: t,
|
|
737
738
|
animateIn: "pullRightIn",
|
|
738
739
|
animateOut: "pullRight",
|
|
739
740
|
role: "alert"
|
|
740
|
-
}, s)),
|
|
741
|
+
}, s)), Nt = c(({ close: t, class: e }, s) => n({
|
|
741
742
|
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 ${e}`,
|
|
742
743
|
click: () => t(),
|
|
743
744
|
animateIn: "pullRightIn",
|
|
744
745
|
animateOut: "pullRight",
|
|
745
746
|
role: "alert"
|
|
746
747
|
}, s));
|
|
747
|
-
class
|
|
748
|
+
class Ut extends y {
|
|
748
749
|
/**
|
|
749
750
|
* This will declare the props for the compiler.
|
|
750
751
|
*
|
|
@@ -767,14 +768,14 @@ class Nt extends w {
|
|
|
767
768
|
* @returns {object}
|
|
768
769
|
*/
|
|
769
770
|
render() {
|
|
770
|
-
const { bgColor: e, borderColor: s, iconColor: o } = this.getTypeStyles(),
|
|
771
|
-
return
|
|
772
|
-
href:
|
|
771
|
+
const { bgColor: e, borderColor: s, iconColor: o } = this.getTypeStyles(), i = this.href || null, r = this.getChildren(o);
|
|
772
|
+
return i ? Et({
|
|
773
|
+
href: i,
|
|
773
774
|
class: `${e} ${s}`
|
|
774
|
-
},
|
|
775
|
+
}, r) : Nt({
|
|
775
776
|
close: this.close.bind(this),
|
|
776
777
|
class: `${e} ${s}`
|
|
777
|
-
},
|
|
778
|
+
}, r);
|
|
778
779
|
}
|
|
779
780
|
/**
|
|
780
781
|
* This will be called after the component is set up.
|
|
@@ -783,7 +784,7 @@ class Nt extends w {
|
|
|
783
784
|
*/
|
|
784
785
|
afterSetup() {
|
|
785
786
|
const e = this.duration;
|
|
786
|
-
e !== "infinite" && (this.timer = new
|
|
787
|
+
e !== "infinite" && (this.timer = new ut(e, this.close.bind(this)), this.timer.start());
|
|
787
788
|
}
|
|
788
789
|
/**
|
|
789
790
|
* This will get the style properties based on the notification type.
|
|
@@ -816,12 +817,14 @@ class Nt extends w {
|
|
|
816
817
|
getChildren(e) {
|
|
817
818
|
return [
|
|
818
819
|
n({ class: "flex items-start" }, [
|
|
819
|
-
this.icon &&
|
|
820
|
+
this.icon && n({ class: `mr-4 ${e}` }, [
|
|
821
|
+
m({ size: "md" }, this.icon)
|
|
822
|
+
]),
|
|
820
823
|
n({ class: "flex flex-auto flex-col" }, [
|
|
821
824
|
n({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
|
|
822
|
-
this.title &&
|
|
825
|
+
this.title && jt(this.title)
|
|
823
826
|
]),
|
|
824
|
-
|
|
827
|
+
b({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
|
|
825
828
|
(this.primary || this.secondary) && L({ class: "margin-top-24 flex align-center" }, this.getButtons())
|
|
826
829
|
])
|
|
827
830
|
]),
|
|
@@ -843,8 +846,8 @@ class Nt extends w {
|
|
|
843
846
|
e && e.stopPropagation(), this.duration !== "infinite" && this.timer.stop(), this.onClick && this.onClick(), this.destroy();
|
|
844
847
|
}
|
|
845
848
|
}
|
|
846
|
-
let
|
|
847
|
-
class
|
|
849
|
+
let Rt = 0;
|
|
850
|
+
class Ke extends y {
|
|
848
851
|
/**
|
|
849
852
|
* This will render the component.
|
|
850
853
|
*
|
|
@@ -852,11 +855,11 @@ class Ve extends w {
|
|
|
852
855
|
*/
|
|
853
856
|
render() {
|
|
854
857
|
return n({ class: "notification-container pointer-events-none inset-auto bg-transparent backdrop:bg-transparent overflow-visible fixed bottom-[80px] right-0 z-50 p-5", popover: "manual" }, [
|
|
855
|
-
new
|
|
858
|
+
new ht({
|
|
856
859
|
cache: "list",
|
|
857
860
|
key: "id",
|
|
858
861
|
role: "list",
|
|
859
|
-
rowItem: (e) => new
|
|
862
|
+
rowItem: (e) => new Ut(e)
|
|
860
863
|
})
|
|
861
864
|
]);
|
|
862
865
|
}
|
|
@@ -867,7 +870,7 @@ class Ve extends w {
|
|
|
867
870
|
* @returns {void}
|
|
868
871
|
*/
|
|
869
872
|
addNotice(e = {}) {
|
|
870
|
-
e.id =
|
|
873
|
+
e.id = Rt++, e.callBack = () => this.removeNotice(e), this.list.append([e]), this.panel.hidePopover(), this.panel.showPopover();
|
|
871
874
|
}
|
|
872
875
|
/**
|
|
873
876
|
* This will remove a notification.
|
|
@@ -879,17 +882,17 @@ class Ve extends w {
|
|
|
879
882
|
this.list.delete(e.id), this.list.isEmpty() && this.panel.hidePopover();
|
|
880
883
|
}
|
|
881
884
|
}
|
|
882
|
-
const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) =>
|
|
885
|
+
const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => p({
|
|
883
886
|
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',
|
|
884
887
|
onState: ["method", { active: t }],
|
|
885
888
|
dataSet: ["method", ["state", t, "active"]],
|
|
886
|
-
click: (o, { state:
|
|
887
|
-
|
|
889
|
+
click: (o, { state: i }) => {
|
|
890
|
+
i.method = t, localStorage.setItem("theme", t), t === "system" && localStorage.removeItem("theme"), Ht(t);
|
|
888
891
|
}
|
|
889
892
|
}, [
|
|
890
|
-
|
|
893
|
+
m({}, s),
|
|
891
894
|
a(e)
|
|
892
|
-
])),
|
|
895
|
+
])), Ht = (t) => {
|
|
893
896
|
const e = document.documentElement;
|
|
894
897
|
if (t === "system" && (t = globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"), E && !E("(prefers-color-scheme: " + t + ")").matches) {
|
|
895
898
|
e.classList.add(t);
|
|
@@ -897,7 +900,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
897
900
|
}
|
|
898
901
|
const s = t === "light" ? "dark" : "light";
|
|
899
902
|
e.classList.remove(s);
|
|
900
|
-
},
|
|
903
|
+
}, Qe = w(
|
|
901
904
|
{
|
|
902
905
|
/**
|
|
903
906
|
* This will render the component.
|
|
@@ -924,7 +927,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
924
927
|
};
|
|
925
928
|
}
|
|
926
929
|
}
|
|
927
|
-
),
|
|
930
|
+
), Xe = C(
|
|
928
931
|
{
|
|
929
932
|
/**
|
|
930
933
|
* The initial state of the Toggle.
|
|
@@ -951,14 +954,14 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
951
954
|
* @returns {object}
|
|
952
955
|
*/
|
|
953
956
|
render() {
|
|
954
|
-
return
|
|
957
|
+
return p({
|
|
955
958
|
class: "relative inline-flex h-6 w-11 min-w-11 items-center rounded-full bg-muted transition-colors focus:outline-none",
|
|
956
959
|
onState: ["active", { "bg-primary": !0, "bg-muted": !1 }],
|
|
957
960
|
click: (e, { state: s }) => {
|
|
958
961
|
s.toggle("active"), this.checkbox.checked = s.active, this.change && this.change(s.active, e, this);
|
|
959
962
|
}
|
|
960
963
|
}, [
|
|
961
|
-
|
|
964
|
+
nt({
|
|
962
965
|
cache: "checkbox",
|
|
963
966
|
class: "opacity-0 absolute top-0 left-0 bottom-0 right-0 w-full h-full",
|
|
964
967
|
/**
|
|
@@ -976,27 +979,27 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
976
979
|
]);
|
|
977
980
|
}
|
|
978
981
|
}
|
|
979
|
-
),
|
|
982
|
+
), D = {
|
|
980
983
|
ONLINE: "online",
|
|
981
984
|
OFFLINE: "offline",
|
|
982
985
|
BUSY: "busy",
|
|
983
986
|
AWAY: "away"
|
|
984
|
-
},
|
|
987
|
+
}, x = {
|
|
985
988
|
ONLINE: "bg-green-500",
|
|
986
989
|
OFFLINE: "bg-gray-500",
|
|
987
990
|
BUSY: "bg-red-500",
|
|
988
991
|
AWAY: "bg-yellow-500"
|
|
989
|
-
},
|
|
990
|
-
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${
|
|
991
|
-
}),
|
|
992
|
+
}, qt = (t = "") => (t = t.toUpperCase(), x[t] || x.OFFLINE), Ze = (t) => n({
|
|
993
|
+
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${qt(t)}`
|
|
994
|
+
}), ts = ({ propName: t = "status" } = {}) => n({
|
|
992
995
|
class: "absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full",
|
|
993
996
|
onSet: [t, {
|
|
994
|
-
[
|
|
995
|
-
[
|
|
996
|
-
[
|
|
997
|
-
[
|
|
997
|
+
[x.ONLINE]: D.ONLINE,
|
|
998
|
+
[x.OFFLINE]: D.OFFLINE,
|
|
999
|
+
[x.BUSY]: D.BUSY,
|
|
1000
|
+
[x.AWAY]: D.AWAY
|
|
998
1001
|
}]
|
|
999
|
-
}),
|
|
1002
|
+
}), Vt = (t) => t.indexOf(".") === -1 && t.indexOf("[[") === -1 && t.indexOf("blob:") === -1, es = w(
|
|
1000
1003
|
{
|
|
1001
1004
|
/**
|
|
1002
1005
|
* Get the initial state for the component.
|
|
@@ -1016,7 +1019,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1016
1019
|
*/
|
|
1017
1020
|
openFileBrowse() {
|
|
1018
1021
|
const t = this.input;
|
|
1019
|
-
t && (t.value = "",
|
|
1022
|
+
t && (t.value = "", g.trigger("click", t));
|
|
1020
1023
|
},
|
|
1021
1024
|
/**
|
|
1022
1025
|
* Get the URL for the uploaded file.
|
|
@@ -1035,7 +1038,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1035
1038
|
render() {
|
|
1036
1039
|
const t = "image-upload", e = this.onChange || null;
|
|
1037
1040
|
return n({ class: "flex-none items-center" }, [
|
|
1038
|
-
|
|
1041
|
+
f({
|
|
1039
1042
|
id: t,
|
|
1040
1043
|
cache: "input",
|
|
1041
1044
|
type: "file",
|
|
@@ -1052,13 +1055,13 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1052
1055
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
1053
1056
|
}
|
|
1054
1057
|
}, [
|
|
1055
|
-
|
|
1058
|
+
I("loaded", (s) => s === !1 || Vt(this.src) ? P({
|
|
1056
1059
|
htmlFor: t,
|
|
1057
1060
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
1058
1061
|
}, [
|
|
1059
|
-
|
|
1062
|
+
dt(u.upload),
|
|
1060
1063
|
n("Upload Image")
|
|
1061
|
-
]) :
|
|
1064
|
+
]) : W({
|
|
1062
1065
|
// @ts-ignore
|
|
1063
1066
|
src: this.src,
|
|
1064
1067
|
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
@@ -1067,7 +1070,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1067
1070
|
]);
|
|
1068
1071
|
}
|
|
1069
1072
|
}
|
|
1070
|
-
),
|
|
1073
|
+
), ss = w(
|
|
1071
1074
|
{
|
|
1072
1075
|
/**
|
|
1073
1076
|
* Get the initial state for the component.
|
|
@@ -1087,7 +1090,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1087
1090
|
*/
|
|
1088
1091
|
openFileBrowse() {
|
|
1089
1092
|
const t = this.input;
|
|
1090
|
-
t && (t.value = "",
|
|
1093
|
+
t && (t.value = "", g.trigger("click", t));
|
|
1091
1094
|
},
|
|
1092
1095
|
/**
|
|
1093
1096
|
* Get the URL for the uploaded file.
|
|
@@ -1106,7 +1109,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1106
1109
|
render() {
|
|
1107
1110
|
const t = "logo-upload", e = this.onChange || null;
|
|
1108
1111
|
return n({ class: "flex-none items-center" }, [
|
|
1109
|
-
|
|
1112
|
+
f({
|
|
1110
1113
|
id: t,
|
|
1111
1114
|
cache: "input",
|
|
1112
1115
|
type: "file",
|
|
@@ -1123,9 +1126,9 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1123
1126
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
1124
1127
|
}
|
|
1125
1128
|
}, [
|
|
1126
|
-
|
|
1129
|
+
I(
|
|
1127
1130
|
"loaded",
|
|
1128
|
-
(s) => s ?
|
|
1131
|
+
(s) => s ? W({
|
|
1129
1132
|
// @ts-ignore
|
|
1130
1133
|
src: this.src,
|
|
1131
1134
|
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
@@ -1133,7 +1136,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1133
1136
|
htmlFor: t,
|
|
1134
1137
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
1135
1138
|
}, [
|
|
1136
|
-
|
|
1139
|
+
m({}, u.upload),
|
|
1137
1140
|
n("Upload logo")
|
|
1138
1141
|
])
|
|
1139
1142
|
)
|
|
@@ -1149,7 +1152,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1149
1152
|
this.input = null;
|
|
1150
1153
|
}
|
|
1151
1154
|
}
|
|
1152
|
-
),
|
|
1155
|
+
), Gt = (t, e) => G(
|
|
1153
1156
|
{
|
|
1154
1157
|
href: t,
|
|
1155
1158
|
"aria-current": e === "Breadcrumb" && "page",
|
|
@@ -1157,14 +1160,14 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1157
1160
|
class: "text-muted-foreground font-medium hover:text-foreground"
|
|
1158
1161
|
},
|
|
1159
1162
|
[a(e)]
|
|
1160
|
-
),
|
|
1163
|
+
), Wt = () => m({
|
|
1161
1164
|
class: "mx-3 text-muted-foreground",
|
|
1162
1165
|
"aria-hidden": !0,
|
|
1163
1166
|
size: "xs"
|
|
1164
|
-
}, u.chevron.single.right),
|
|
1165
|
-
t.href ?
|
|
1166
|
-
t.separator &&
|
|
1167
|
-
]),
|
|
1167
|
+
}, u.chevron.single.right), _t = (t) => n({ class: "flex items-center" }, [
|
|
1168
|
+
t.href ? Gt(t.href, t.label) : a(t.label),
|
|
1169
|
+
t.separator && Wt()
|
|
1170
|
+
]), os = w(
|
|
1168
1171
|
{
|
|
1169
1172
|
/**
|
|
1170
1173
|
* Set initial data
|
|
@@ -1172,7 +1175,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1172
1175
|
* @returns {Data}
|
|
1173
1176
|
*/
|
|
1174
1177
|
setData() {
|
|
1175
|
-
return new
|
|
1178
|
+
return new k({
|
|
1176
1179
|
// @ts-ignore
|
|
1177
1180
|
items: this.items || []
|
|
1178
1181
|
});
|
|
@@ -1184,7 +1187,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1184
1187
|
*/
|
|
1185
1188
|
render() {
|
|
1186
1189
|
const t = this.data.items.length - 1;
|
|
1187
|
-
return
|
|
1190
|
+
return it(
|
|
1188
1191
|
{
|
|
1189
1192
|
"aria-label": "Breadcrumb",
|
|
1190
1193
|
class: "flex items-center gap-x-1 text-sm"
|
|
@@ -1193,7 +1196,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1193
1196
|
n({
|
|
1194
1197
|
role: "list",
|
|
1195
1198
|
class: "flex items-center",
|
|
1196
|
-
for: ["items", (e, s) =>
|
|
1199
|
+
for: ["items", (e, s) => _t({
|
|
1197
1200
|
href: e.href,
|
|
1198
1201
|
label: e.label,
|
|
1199
1202
|
separator: s < t
|
|
@@ -1212,21 +1215,21 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1212
1215
|
"2xl": "h-16 w-16",
|
|
1213
1216
|
"3xl": "h-24 w-24",
|
|
1214
1217
|
default: "h-4 w-4"
|
|
1215
|
-
},
|
|
1218
|
+
}, Jt = (t) => N[t] || N.default, Kt = ({ index: t, size: e }) => n({ class: `${e} rounded-full bg-muted cursor-pointer` }, [
|
|
1216
1219
|
a({
|
|
1217
1220
|
class: "block w-full h-full rounded-full transition-colors",
|
|
1218
1221
|
onSet: ["activeIndex", {
|
|
1219
1222
|
"bg-primary": t,
|
|
1220
1223
|
"shadow-md": t
|
|
1221
1224
|
}],
|
|
1222
|
-
click: (s, { data: o, onClick:
|
|
1223
|
-
o.activeIndex = t,
|
|
1225
|
+
click: (s, { data: o, onClick: i }) => {
|
|
1226
|
+
o.activeIndex = t, i && i(t);
|
|
1224
1227
|
}
|
|
1225
1228
|
})
|
|
1226
|
-
]),
|
|
1229
|
+
]), Qt = (t, e) => Array.from({ length: t }, (s, o) => Kt({
|
|
1227
1230
|
index: o,
|
|
1228
1231
|
size: e
|
|
1229
|
-
})),
|
|
1232
|
+
})), ns = w(
|
|
1230
1233
|
{
|
|
1231
1234
|
/**
|
|
1232
1235
|
* Defines component data (props).
|
|
@@ -1234,7 +1237,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1234
1237
|
* @returns {Data}
|
|
1235
1238
|
*/
|
|
1236
1239
|
setData() {
|
|
1237
|
-
return new
|
|
1240
|
+
return new k({
|
|
1238
1241
|
// @ts-ignore
|
|
1239
1242
|
count: this.count || 4,
|
|
1240
1243
|
// total dots
|
|
@@ -1248,7 +1251,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1248
1251
|
* @returns {object}
|
|
1249
1252
|
*/
|
|
1250
1253
|
render() {
|
|
1251
|
-
const t = this.gap || "gap-2", e =
|
|
1254
|
+
const t = this.gap || "gap-2", e = Jt(this.size || "sm"), s = Qt(this.data.count, e);
|
|
1252
1255
|
return n(
|
|
1253
1256
|
{ class: "flex justify-center items-center py-2" },
|
|
1254
1257
|
[
|
|
@@ -1257,7 +1260,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1257
1260
|
);
|
|
1258
1261
|
}
|
|
1259
1262
|
}
|
|
1260
|
-
),
|
|
1263
|
+
), Xt = ({ toggleDropdown: t }) => p(
|
|
1261
1264
|
{
|
|
1262
1265
|
cache: "button",
|
|
1263
1266
|
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",
|
|
@@ -1265,29 +1268,29 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1265
1268
|
},
|
|
1266
1269
|
[
|
|
1267
1270
|
a({ onState: ["selectedLabel", (e) => e || "Select item..."] }),
|
|
1268
|
-
|
|
1271
|
+
m({ size: "sm" }, u.chevron.upDown)
|
|
1269
1272
|
]
|
|
1270
|
-
),
|
|
1273
|
+
), Zt = (t, e, s) => q({
|
|
1271
1274
|
class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
|
|
1272
1275
|
click: () => e(t),
|
|
1273
1276
|
onState: [s, "selectedValue", { "bg-secondary": t.value }]
|
|
1274
1277
|
}, [
|
|
1275
|
-
t.icon && a({ class: "mr-2 flex items-baseline" }, [
|
|
1278
|
+
t.icon && a({ class: "mr-2 flex items-baseline" }, [m({ size: "xs" }, t.icon)]),
|
|
1276
1279
|
a({ class: "text-base font-normal" }, t.label)
|
|
1277
|
-
]),
|
|
1278
|
-
|
|
1279
|
-
]),
|
|
1280
|
-
|
|
1280
|
+
]), te = (t, e) => n({ class: "w-full border rounded-md" }, [
|
|
1281
|
+
V({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) => Zt(s, t, e)] })
|
|
1282
|
+
]), ee = ({ onSelect: t, state: e }) => n({ class: "flex flex-auto flex-col" }, [
|
|
1283
|
+
I(
|
|
1281
1284
|
"open",
|
|
1282
|
-
(s, o,
|
|
1285
|
+
(s, o, i) => s ? new S({
|
|
1283
1286
|
cache: "dropdown",
|
|
1284
|
-
parent:
|
|
1285
|
-
button:
|
|
1287
|
+
parent: i,
|
|
1288
|
+
button: i.button
|
|
1286
1289
|
}, [
|
|
1287
|
-
|
|
1290
|
+
te(t, e)
|
|
1288
1291
|
]) : null
|
|
1289
1292
|
)
|
|
1290
|
-
]),
|
|
1293
|
+
]), is = w(
|
|
1291
1294
|
{
|
|
1292
1295
|
/**
|
|
1293
1296
|
* This will set up the data.
|
|
@@ -1295,7 +1298,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1295
1298
|
* @returns {Data}
|
|
1296
1299
|
*/
|
|
1297
1300
|
setData() {
|
|
1298
|
-
return new
|
|
1301
|
+
return new k({
|
|
1299
1302
|
// @ts-ignore
|
|
1300
1303
|
items: this.items || []
|
|
1301
1304
|
});
|
|
@@ -1368,8 +1371,8 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1368
1371
|
const t = this.class || "", e = this.maxWidth || "max-w-[250px]", s = this.width || "w-full";
|
|
1369
1372
|
return n({ class: `relative ${s} flex flex-auto flex-col ${e} ${t}` }, [
|
|
1370
1373
|
// @ts-ignore
|
|
1371
|
-
|
|
1372
|
-
|
|
1374
|
+
Xt({ toggleDropdown: this.toggleDropdown.bind(this) }),
|
|
1375
|
+
ee({
|
|
1373
1376
|
// @ts-ignore
|
|
1374
1377
|
state: this.state,
|
|
1375
1378
|
// @ts-ignore
|
|
@@ -1377,7 +1380,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1377
1380
|
}),
|
|
1378
1381
|
// Hidden required input for form validation
|
|
1379
1382
|
// @ts-ignore
|
|
1380
|
-
this.required &&
|
|
1383
|
+
this.required && f({
|
|
1381
1384
|
class: "opacity-0 absolute top-0 left-0 z-[1]",
|
|
1382
1385
|
type: "text",
|
|
1383
1386
|
// @ts-ignore
|
|
@@ -1395,19 +1398,19 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1395
1398
|
click: e,
|
|
1396
1399
|
icon: t,
|
|
1397
1400
|
"aria-label": s
|
|
1398
|
-
}),
|
|
1401
|
+
}), se = ({ click: t }) => X({
|
|
1399
1402
|
icon: u.circleMinus,
|
|
1400
1403
|
click: t,
|
|
1401
1404
|
ariaLabel: "Decrement"
|
|
1402
|
-
}),
|
|
1405
|
+
}), oe = ({ click: t }) => X({
|
|
1403
1406
|
icon: u.circlePlus,
|
|
1404
1407
|
click: t,
|
|
1405
1408
|
ariaLabel: "Increment"
|
|
1406
|
-
}),
|
|
1407
|
-
value: ["[[count]]",
|
|
1409
|
+
}), ne = ({ bind: t, min: e, max: s, readonly: o = !1 }) => _(({ state: i }) => f({
|
|
1410
|
+
value: ["[[count]]", i],
|
|
1408
1411
|
bind: t,
|
|
1409
|
-
blur: (
|
|
1410
|
-
let d = parseInt(
|
|
1412
|
+
blur: (r, { state: l }) => {
|
|
1413
|
+
let d = parseInt(r.target.value, 10);
|
|
1411
1414
|
isNaN(d) && (d = e ?? 0), e !== void 0 && (d = Math.max(d, e)), s !== void 0 && (d = Math.min(d, s)), l.count = d;
|
|
1412
1415
|
},
|
|
1413
1416
|
class: "flex flex-auto text-lg font-medium bg-input text-center border min-w-0",
|
|
@@ -1416,7 +1419,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1416
1419
|
max: s,
|
|
1417
1420
|
type: "number",
|
|
1418
1421
|
"aria-label": "Counter"
|
|
1419
|
-
})),
|
|
1422
|
+
})), rs = C(
|
|
1420
1423
|
{
|
|
1421
1424
|
/**
|
|
1422
1425
|
* Initial state for the counter component.
|
|
@@ -1439,18 +1442,18 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1439
1442
|
render() {
|
|
1440
1443
|
const t = this.class ?? "";
|
|
1441
1444
|
return n({ class: `flex flex-auto items-center justify-between gap-x-4 p-4 ${t}` }, [
|
|
1442
|
-
|
|
1443
|
-
|
|
1445
|
+
se({ click: () => this.state.decrement("count") }),
|
|
1446
|
+
ne({
|
|
1444
1447
|
bind: this.bind,
|
|
1445
1448
|
readonly: this.readonly,
|
|
1446
1449
|
min: this.min,
|
|
1447
1450
|
max: this.max
|
|
1448
1451
|
}),
|
|
1449
|
-
|
|
1452
|
+
oe({ click: () => this.state.increment("count") })
|
|
1450
1453
|
]);
|
|
1451
1454
|
}
|
|
1452
1455
|
}
|
|
1453
|
-
),
|
|
1456
|
+
), ie = (t) => {
|
|
1454
1457
|
let e = "";
|
|
1455
1458
|
return t.length > 0 && (e = t.substring(0, 2), t.length > 2 && (e += "/" + t.substring(2, 4), t.length > 4 && (e += "/" + t.substring(4, 8)))), e;
|
|
1456
1459
|
}, re = (t) => {
|
|
@@ -1458,49 +1461,49 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1458
1461
|
return null;
|
|
1459
1462
|
const e = parseInt(t.substring(0, 2), 10), s = parseInt(t.substring(2, 4), 10), o = parseInt(t.substring(4, 8), 10);
|
|
1460
1463
|
return e >= 1 && e <= 12 && s >= 1 && s <= 31 && o >= 1900 ? `${o}-${e.toString().padStart(2, "0")}-${s.toString().padStart(2, "0")}` : null;
|
|
1461
|
-
},
|
|
1464
|
+
}, le = ({ bind: t, required: e }) => f({
|
|
1462
1465
|
cache: "input",
|
|
1463
1466
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1464
1467
|
bind: t,
|
|
1465
1468
|
required: e
|
|
1466
|
-
}),
|
|
1469
|
+
}), ae = ({ placeholder: t, handleInputChange: e, handleInputFocus: s }) => f({
|
|
1467
1470
|
cache: "dateInput",
|
|
1468
1471
|
class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground border-0",
|
|
1469
1472
|
placeholder: t || "mm/dd/yyyy",
|
|
1470
1473
|
input: e,
|
|
1471
1474
|
focus: s,
|
|
1472
1475
|
onState: ["selectedDate", (o) => o ? M.format("standard", o) : ""]
|
|
1473
|
-
}),
|
|
1476
|
+
}), ce = ({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleInputFocus: i, placeholder: r }) => n(
|
|
1474
1477
|
{
|
|
1475
1478
|
class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 pr-4 py-2"
|
|
1476
1479
|
},
|
|
1477
1480
|
[
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
+
le({ bind: t, required: e }),
|
|
1482
|
+
ae({ placeholder: r, handleInputChange: o, handleInputFocus: i }),
|
|
1483
|
+
p(
|
|
1481
1484
|
{
|
|
1482
1485
|
class: "flex-shrink-0 hover:bg-muted/50 rounded p-1 cursor-pointer",
|
|
1483
1486
|
click: s
|
|
1484
1487
|
},
|
|
1485
1488
|
[
|
|
1486
|
-
|
|
1489
|
+
T({ html: u.calendar.days })
|
|
1487
1490
|
]
|
|
1488
1491
|
)
|
|
1489
1492
|
]
|
|
1490
|
-
),
|
|
1491
|
-
(s, o,
|
|
1493
|
+
), de = ({ handleDateSelect: t, blockPriorDates: e }) => O(
|
|
1494
|
+
(s, o, i) => new S({
|
|
1492
1495
|
cache: "dropdown",
|
|
1493
|
-
parent:
|
|
1494
|
-
button:
|
|
1496
|
+
parent: i,
|
|
1497
|
+
button: i.panel,
|
|
1495
1498
|
size: "fit"
|
|
1496
1499
|
}, [
|
|
1497
1500
|
new at({
|
|
1498
|
-
selectedDate:
|
|
1501
|
+
selectedDate: i.state.selectedDate,
|
|
1499
1502
|
selectedCallBack: t,
|
|
1500
1503
|
blockPriorDates: e
|
|
1501
1504
|
})
|
|
1502
1505
|
])
|
|
1503
|
-
),
|
|
1506
|
+
), ls = C(
|
|
1504
1507
|
{
|
|
1505
1508
|
/**
|
|
1506
1509
|
* The initial state of the DatePicker.
|
|
@@ -1529,9 +1532,9 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1529
1532
|
*/
|
|
1530
1533
|
handleInputChange(t) {
|
|
1531
1534
|
const s = t.target.value.replace(/\D/g, "");
|
|
1532
|
-
t.target.value =
|
|
1535
|
+
t.target.value = ie(s);
|
|
1533
1536
|
const o = re(s);
|
|
1534
|
-
o && (this.state.selectedDate = o, this.input.value = o,
|
|
1537
|
+
o && (this.state.selectedDate = o, this.input.value = o, g.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(o));
|
|
1535
1538
|
},
|
|
1536
1539
|
/**
|
|
1537
1540
|
* Handles input focus - select all text for easy editing.
|
|
@@ -1547,7 +1550,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1547
1550
|
* @param {string} date
|
|
1548
1551
|
*/
|
|
1549
1552
|
handleDateSelect(t) {
|
|
1550
|
-
this.state.selectedDate = t, this.state.open = !1, this.input.value = t,
|
|
1553
|
+
this.state.selectedDate = t, this.state.open = !1, this.input.value = t, g.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(t);
|
|
1551
1554
|
},
|
|
1552
1555
|
/**
|
|
1553
1556
|
* Toggles the calendar popover.
|
|
@@ -1567,7 +1570,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1567
1570
|
return n(
|
|
1568
1571
|
{ class: "relative w-full max-w-[320px]" },
|
|
1569
1572
|
[
|
|
1570
|
-
|
|
1573
|
+
ce({
|
|
1571
1574
|
toggleOpen: this.toggleOpen.bind(this),
|
|
1572
1575
|
bind: this.bind,
|
|
1573
1576
|
required: this.required,
|
|
@@ -1575,7 +1578,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1575
1578
|
handleInputFocus: this.handleInputFocus.bind(this),
|
|
1576
1579
|
placeholder: this.placeholder
|
|
1577
1580
|
}),
|
|
1578
|
-
|
|
1581
|
+
de({
|
|
1579
1582
|
handleDateSelect: this.handleDateSelect.bind(this),
|
|
1580
1583
|
blockPriorDates: this.blockPriorDates || !1
|
|
1581
1584
|
})
|
|
@@ -1583,35 +1586,35 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1583
1586
|
);
|
|
1584
1587
|
}
|
|
1585
1588
|
}
|
|
1586
|
-
),
|
|
1589
|
+
), ue = ({ bind: t, required: e }) => f({
|
|
1587
1590
|
cache: "input",
|
|
1588
1591
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1589
1592
|
bind: t,
|
|
1590
1593
|
required: e
|
|
1591
|
-
}),
|
|
1594
|
+
}), he = ({ bind: t, required: e, toggleOpen: s }) => p({
|
|
1592
1595
|
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",
|
|
1593
1596
|
click: s
|
|
1594
1597
|
}, [
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
a(
|
|
1598
|
+
ue({ bind: t, required: e }),
|
|
1599
|
+
_(({ state: o }) => [
|
|
1600
|
+
a(z.date(["[[start]]", o], "Start Date")),
|
|
1598
1601
|
a(" - "),
|
|
1599
|
-
a(
|
|
1602
|
+
a(z.date(["[[end]]", o], "End Date"))
|
|
1600
1603
|
]),
|
|
1601
|
-
|
|
1602
|
-
]),
|
|
1604
|
+
T({ html: u.calendar.days })
|
|
1605
|
+
]), me = ({ handleDateSelect: t, blockPriorDates: e }) => O((s, o, i) => new S({
|
|
1603
1606
|
cache: "dropdown",
|
|
1604
|
-
parent:
|
|
1605
|
-
button:
|
|
1607
|
+
parent: i,
|
|
1608
|
+
button: i.panel,
|
|
1606
1609
|
size: "xl"
|
|
1607
1610
|
}, [
|
|
1608
1611
|
new ct({
|
|
1609
|
-
startDate:
|
|
1610
|
-
endDate:
|
|
1612
|
+
startDate: i.state.start,
|
|
1613
|
+
endDate: i.state.end,
|
|
1611
1614
|
onRangeSelect: t,
|
|
1612
1615
|
blockPriorDates: e
|
|
1613
1616
|
})
|
|
1614
|
-
])),
|
|
1617
|
+
])), as = C(
|
|
1615
1618
|
{
|
|
1616
1619
|
/**
|
|
1617
1620
|
* The initial state of the DateRangePicker.
|
|
@@ -1644,58 +1647,58 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
|
|
|
1644
1647
|
*/
|
|
1645
1648
|
render() {
|
|
1646
1649
|
const t = (s, { state: o }) => o.toggle("open"), e = (s, o) => {
|
|
1647
|
-
this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`,
|
|
1650
|
+
this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`, g.trigger("change", this.input), typeof this.onChange == "function" && this.onChange({ start: s, end: o }, this.parent);
|
|
1648
1651
|
};
|
|
1649
1652
|
return n({ class: "relative w-full max-w-[320px]" }, [
|
|
1650
|
-
|
|
1653
|
+
he({
|
|
1651
1654
|
toggleOpen: t,
|
|
1652
1655
|
bind: this.bind,
|
|
1653
1656
|
required: this.required
|
|
1654
1657
|
}),
|
|
1655
|
-
|
|
1658
|
+
me({
|
|
1656
1659
|
handleDateSelect: e,
|
|
1657
1660
|
blockPriorDates: this.blockPriorDates || !1
|
|
1658
1661
|
})
|
|
1659
1662
|
]);
|
|
1660
1663
|
}
|
|
1661
1664
|
}
|
|
1662
|
-
),
|
|
1663
|
-
new
|
|
1665
|
+
), cs = ({ dateTime: t = "", remoteTimeZone: e = "America/Denver", filter: s = null }) => rt([
|
|
1666
|
+
new mt({
|
|
1664
1667
|
dateTime: t,
|
|
1665
1668
|
filter: s || ((o) => {
|
|
1666
|
-
const
|
|
1667
|
-
return M.getTimeFrame(
|
|
1669
|
+
const i = M.getLocalTime(o, !0, !1, e);
|
|
1670
|
+
return M.getTimeFrame(i);
|
|
1668
1671
|
})
|
|
1669
1672
|
})
|
|
1670
1673
|
]);
|
|
1671
|
-
function
|
|
1674
|
+
function fe(t) {
|
|
1672
1675
|
let e = "";
|
|
1673
1676
|
return t.length > 0 && (e = t.substring(0, 2), t.length > 2 && (e += ":" + t.substring(2, 4))), e;
|
|
1674
1677
|
}
|
|
1675
|
-
function
|
|
1678
|
+
function pe(t) {
|
|
1676
1679
|
if (t.length < 4)
|
|
1677
1680
|
return { formattedTime: null, hour: null, minute: null, meridian: null };
|
|
1678
1681
|
const e = parseInt(t.substring(0, 2), 10), s = parseInt(t.substring(2, 4), 10);
|
|
1679
1682
|
if (e < 0 || e > 23 || s < 0 || s > 59)
|
|
1680
1683
|
return { formattedTime: null, hour: null, minute: null, meridian: null };
|
|
1681
|
-
let o = e,
|
|
1682
|
-
return e === 0 ? o = 12 : e > 12 ? (o = e - 12,
|
|
1683
|
-
formattedTime: `${o.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")} ${
|
|
1684
|
+
let o = e, i = "AM";
|
|
1685
|
+
return e === 0 ? o = 12 : e > 12 ? (o = e - 12, i = "PM") : e === 12 && (i = "PM"), {
|
|
1686
|
+
formattedTime: `${o.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")} ${i}`,
|
|
1684
1687
|
hour: o.toString().padStart(2, "0"),
|
|
1685
1688
|
minute: s.toString().padStart(2, "0"),
|
|
1686
|
-
meridian:
|
|
1689
|
+
meridian: i
|
|
1687
1690
|
};
|
|
1688
1691
|
}
|
|
1689
1692
|
function ge({ bind: t, required: e }) {
|
|
1690
|
-
return
|
|
1693
|
+
return f({
|
|
1691
1694
|
cache: "input",
|
|
1692
1695
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1693
1696
|
bind: t,
|
|
1694
1697
|
required: e
|
|
1695
1698
|
});
|
|
1696
1699
|
}
|
|
1697
|
-
function
|
|
1698
|
-
return
|
|
1700
|
+
function be({ placeholder: t, handleInputChange: e, handleInputFocus: s }) {
|
|
1701
|
+
return f({
|
|
1699
1702
|
cache: "timeInput",
|
|
1700
1703
|
class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground border-0",
|
|
1701
1704
|
placeholder: t || "hh:mm AM/PM",
|
|
@@ -1704,32 +1707,32 @@ function pe({ placeholder: t, handleInputChange: e, handleInputFocus: s }) {
|
|
|
1704
1707
|
onState: ["selectedTime", (o) => o || ""]
|
|
1705
1708
|
});
|
|
1706
1709
|
}
|
|
1707
|
-
function
|
|
1710
|
+
function xe({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleInputFocus: i, placeholder: r }) {
|
|
1708
1711
|
return n(
|
|
1709
1712
|
{
|
|
1710
1713
|
class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 pr-4 py-2"
|
|
1711
1714
|
},
|
|
1712
1715
|
[
|
|
1713
1716
|
ge({ bind: t, required: e }),
|
|
1714
|
-
|
|
1715
|
-
|
|
1717
|
+
be({ placeholder: r, handleInputChange: o, handleInputFocus: i }),
|
|
1718
|
+
p(
|
|
1716
1719
|
{
|
|
1717
1720
|
class: "flex-shrink-0 hover:bg-muted/50 rounded p-1 cursor-pointer",
|
|
1718
1721
|
click: s
|
|
1719
1722
|
},
|
|
1720
1723
|
[
|
|
1721
|
-
|
|
1724
|
+
T({ html: u.clock })
|
|
1722
1725
|
]
|
|
1723
1726
|
)
|
|
1724
1727
|
]
|
|
1725
1728
|
);
|
|
1726
1729
|
}
|
|
1727
|
-
function $({ items: t, handleTimeSelect: e, state: s, stateValue: o, pad:
|
|
1730
|
+
function $({ items: t, handleTimeSelect: e, state: s, stateValue: o, pad: i = !1 }) {
|
|
1728
1731
|
return n(
|
|
1729
1732
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1730
|
-
t.map((
|
|
1731
|
-
let l =
|
|
1732
|
-
return
|
|
1733
|
+
t.map((r) => {
|
|
1734
|
+
let l = i ? r.toString().padStart(2, "0") : r.toString();
|
|
1735
|
+
return p({
|
|
1733
1736
|
text: l,
|
|
1734
1737
|
class: "hover:bg-muted/50 rounded-md pr-2 py-1",
|
|
1735
1738
|
click: () => e({ [o]: l }),
|
|
@@ -1738,9 +1741,9 @@ function $({ items: t, handleTimeSelect: e, state: s, stateValue: o, pad: r = !1
|
|
|
1738
1741
|
})
|
|
1739
1742
|
);
|
|
1740
1743
|
}
|
|
1741
|
-
function
|
|
1744
|
+
function ye({ handleTimeSelect: t }) {
|
|
1742
1745
|
return O(
|
|
1743
|
-
(e, s, o) => new
|
|
1746
|
+
(e, s, o) => new S(
|
|
1744
1747
|
{
|
|
1745
1748
|
cache: "dropdown",
|
|
1746
1749
|
parent: o,
|
|
@@ -1756,7 +1759,7 @@ function xe({ handleTimeSelect: t }) {
|
|
|
1756
1759
|
[
|
|
1757
1760
|
// Hours column
|
|
1758
1761
|
$({
|
|
1759
|
-
items: Array.from({ length: 12 }, (
|
|
1762
|
+
items: Array.from({ length: 12 }, (i, r) => r + 1),
|
|
1760
1763
|
handleTimeSelect: t,
|
|
1761
1764
|
state: o.state,
|
|
1762
1765
|
stateValue: "hour",
|
|
@@ -1764,7 +1767,7 @@ function xe({ handleTimeSelect: t }) {
|
|
|
1764
1767
|
}),
|
|
1765
1768
|
// Minutes column
|
|
1766
1769
|
$({
|
|
1767
|
-
items: Array.from({ length: 60 }, (
|
|
1770
|
+
items: Array.from({ length: 60 }, (i, r) => r),
|
|
1768
1771
|
handleTimeSelect: t,
|
|
1769
1772
|
state: o.state,
|
|
1770
1773
|
stateValue: "minute",
|
|
@@ -1791,14 +1794,14 @@ function U(t) {
|
|
|
1791
1794
|
const e = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = t.match(e);
|
|
1792
1795
|
if (!s)
|
|
1793
1796
|
return { hour: null, minute: null, meridian: null };
|
|
1794
|
-
let [, o,
|
|
1795
|
-
return l < 0 || l > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (
|
|
1797
|
+
let [, o, i, , r] = s, l = parseInt(o, 10), d = parseInt(i, 10);
|
|
1798
|
+
return l < 0 || l > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (r ? (r = r.toUpperCase(), r === "PM" && l < 12 ? l += 12 : r === "AM" && l === 12 && (l = 12)) : l === 0 ? (r = "AM", l = 12) : l < 12 ? r = "AM" : l === 12 ? r = "PM" : (r = "PM", l -= 12), {
|
|
1796
1799
|
hour: l.toString().padStart(2, "0"),
|
|
1797
1800
|
minute: d.toString().padStart(2, "0"),
|
|
1798
|
-
meridian:
|
|
1801
|
+
meridian: r
|
|
1799
1802
|
});
|
|
1800
1803
|
}
|
|
1801
|
-
const
|
|
1804
|
+
const ds = C(
|
|
1802
1805
|
{
|
|
1803
1806
|
/**
|
|
1804
1807
|
* The initial shallow state of the TimePicker.
|
|
@@ -1846,14 +1849,14 @@ const rs = v(
|
|
|
1846
1849
|
* @param {Event} e
|
|
1847
1850
|
*/
|
|
1848
1851
|
handleInputChange(t) {
|
|
1849
|
-
let e = t.target.value.replace(/[^\d]/g, ""), s =
|
|
1850
|
-
const o =
|
|
1852
|
+
let e = t.target.value.replace(/[^\d]/g, ""), s = fe(e);
|
|
1853
|
+
const o = pe(e);
|
|
1851
1854
|
o.formattedTime && (s = o.formattedTime, this.state.set({
|
|
1852
1855
|
hour: o.hour,
|
|
1853
1856
|
minute: o.minute,
|
|
1854
1857
|
meridian: o.meridian,
|
|
1855
1858
|
selectedTime: o.formattedTime
|
|
1856
|
-
}), this.input.value = o.formattedTime,
|
|
1859
|
+
}), this.input.value = o.formattedTime, g.trigger("change", this.input), typeof this.change == "function" && this.change(o.formattedTime)), t.target.value = s;
|
|
1857
1860
|
},
|
|
1858
1861
|
/**
|
|
1859
1862
|
* Handles input focus - select all text for easy editing.
|
|
@@ -1871,7 +1874,7 @@ const rs = v(
|
|
|
1871
1874
|
handleTimeSelect({ hour: t, minute: e, meridian: s }) {
|
|
1872
1875
|
if (t && (this.state.hour = t), e && (this.state.minute = e), s && (this.state.meridian = s), this.state.hour && this.state.minute && this.state.meridian) {
|
|
1873
1876
|
const o = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1874
|
-
this.state.selectedTime = o, this.state.open = !1, this.input.value = o,
|
|
1877
|
+
this.state.selectedTime = o, this.state.open = !1, this.input.value = o, g.trigger("change", this.input), typeof this.change == "function" && this.change(o);
|
|
1875
1878
|
}
|
|
1876
1879
|
},
|
|
1877
1880
|
/**
|
|
@@ -1883,7 +1886,7 @@ const rs = v(
|
|
|
1883
1886
|
return n(
|
|
1884
1887
|
{ class: "relative w-full max-w-[320px]" },
|
|
1885
1888
|
[
|
|
1886
|
-
|
|
1889
|
+
xe({
|
|
1887
1890
|
toggleOpen: this.toggleOpen.bind(this),
|
|
1888
1891
|
bind: this.bind,
|
|
1889
1892
|
required: this.required,
|
|
@@ -1891,18 +1894,18 @@ const rs = v(
|
|
|
1891
1894
|
handleInputFocus: this.handleInputFocus.bind(this),
|
|
1892
1895
|
placeholder: this.placeholder
|
|
1893
1896
|
}),
|
|
1894
|
-
|
|
1897
|
+
ye({
|
|
1895
1898
|
handleTimeSelect: this.handleTimeSelect.bind(this)
|
|
1896
1899
|
})
|
|
1897
1900
|
]
|
|
1898
1901
|
);
|
|
1899
1902
|
}
|
|
1900
1903
|
}
|
|
1901
|
-
),
|
|
1902
|
-
|
|
1903
|
-
]),
|
|
1904
|
-
|
|
1905
|
-
]),
|
|
1904
|
+
), we = (t, e) => n({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${e}` }, [
|
|
1905
|
+
m({ size: "lg" }, t)
|
|
1906
|
+
]), Ce = ({ title: t }) => B({ class: "flex flex-auto items-center" }, [
|
|
1907
|
+
v({ class: "text-lg font-semibold" }, t)
|
|
1908
|
+
]), ve = c((t, e) => lt(
|
|
1906
1909
|
{
|
|
1907
1910
|
class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
|
|
1908
1911
|
rounded-lg flex flex-auto flex-col
|
|
@@ -1913,18 +1916,18 @@ const rs = v(
|
|
|
1913
1916
|
[
|
|
1914
1917
|
n({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
|
|
1915
1918
|
// Icon and content
|
|
1916
|
-
t.icon &&
|
|
1919
|
+
t.icon && we(t.icon, t.iconColor),
|
|
1917
1920
|
n({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1918
1921
|
n({ class: "flex flex-auto flex-col gap-y-2" }, [
|
|
1919
|
-
|
|
1920
|
-
t.description &&
|
|
1922
|
+
Ce(t),
|
|
1923
|
+
t.description && b({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t.description),
|
|
1921
1924
|
n({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e)
|
|
1922
1925
|
]),
|
|
1923
1926
|
t.buttons && L({ class: "flex flex-col-reverse sm:flex-row sm:justify-end mt-6 gap-2 sm:gap-0 sm:gap-x-2" }, t.buttons)
|
|
1924
1927
|
])
|
|
1925
1928
|
])
|
|
1926
1929
|
]
|
|
1927
|
-
)),
|
|
1930
|
+
)), Se = (t) => H.render(t, app.root), R = {
|
|
1928
1931
|
info: {
|
|
1929
1932
|
borderColor: "border-blue-500",
|
|
1930
1933
|
bgColor: "bg-muted/10",
|
|
@@ -1951,7 +1954,7 @@ const rs = v(
|
|
|
1951
1954
|
iconColor: "text-muted-foreground"
|
|
1952
1955
|
}
|
|
1953
1956
|
};
|
|
1954
|
-
class
|
|
1957
|
+
class De extends y {
|
|
1955
1958
|
/**
|
|
1956
1959
|
* This will declare the props for the compiler.
|
|
1957
1960
|
*
|
|
@@ -1968,13 +1971,13 @@ class Se extends w {
|
|
|
1968
1971
|
render() {
|
|
1969
1972
|
const e = (d) => {
|
|
1970
1973
|
d.target === this.panel && this.close();
|
|
1971
|
-
}, { borderColor: s, bgColor: o, iconColor:
|
|
1972
|
-
return
|
|
1973
|
-
class:
|
|
1974
|
+
}, { borderColor: s, bgColor: o, iconColor: i } = R[this.type] || R.default, r = `${this.getMainClass()} ${o} ${s}`, l = this.title || "Dialog Title";
|
|
1975
|
+
return ve({
|
|
1976
|
+
class: r,
|
|
1974
1977
|
title: l,
|
|
1975
1978
|
click: e,
|
|
1976
1979
|
icon: this.icon,
|
|
1977
|
-
iconColor:
|
|
1980
|
+
iconColor: i,
|
|
1978
1981
|
description: this.description,
|
|
1979
1982
|
buttons: this.getButtons()
|
|
1980
1983
|
}, this.children);
|
|
@@ -2013,7 +2016,7 @@ class Se extends w {
|
|
|
2013
2016
|
* @returns {void}
|
|
2014
2017
|
*/
|
|
2015
2018
|
open() {
|
|
2016
|
-
|
|
2019
|
+
Se(this), this.panel.showModal(), this.state.open = !0;
|
|
2017
2020
|
}
|
|
2018
2021
|
/**
|
|
2019
2022
|
* This will close the modal.
|
|
@@ -2024,7 +2027,7 @@ class Se extends w {
|
|
|
2024
2027
|
this.state.open = !1, this.panel.close(), typeof this.onClose == "function" && this.onClose(), this.destroy();
|
|
2025
2028
|
}
|
|
2026
2029
|
}
|
|
2027
|
-
class
|
|
2030
|
+
class us extends De {
|
|
2028
2031
|
/**
|
|
2029
2032
|
* This will declare the props for the compiler.
|
|
2030
2033
|
*
|
|
@@ -2054,68 +2057,68 @@ class is extends Se {
|
|
|
2054
2057
|
this.confirmed && this.confirmed(), this.close();
|
|
2055
2058
|
}
|
|
2056
2059
|
}
|
|
2057
|
-
const
|
|
2060
|
+
const hs = c((t, e = []) => n({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
2058
2061
|
K({ class: "flex flex-auto flex-col" }, [
|
|
2059
2062
|
n({ class: "flex flex-auto flex-col gap-y-4" }, [
|
|
2060
2063
|
n({ class: "flex flex-auto items-center justify-center" }, [
|
|
2061
2064
|
t.icon && n({ class: "w-16 h-16 mb-2 text-primary" }, [
|
|
2062
|
-
|
|
2065
|
+
m({ size: "lg" }, t.icon)
|
|
2063
2066
|
])
|
|
2064
2067
|
]),
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
+
B({ class: "py-4 text-center" }, [
|
|
2069
|
+
v({ class: "text-xl font-bold" }, t.title),
|
|
2070
|
+
b({ class: "pb-8 text-muted-foreground" }, t.description || ""),
|
|
2068
2071
|
...e
|
|
2069
2072
|
])
|
|
2070
2073
|
])
|
|
2071
2074
|
])
|
|
2072
2075
|
]));
|
|
2073
2076
|
export {
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2077
|
+
je as A,
|
|
2078
|
+
os as B,
|
|
2079
|
+
_e as C,
|
|
2080
|
+
ls as D,
|
|
2081
|
+
hs as E,
|
|
2079
2082
|
K as F,
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2083
|
+
x as G,
|
|
2084
|
+
We as H,
|
|
2085
|
+
es as I,
|
|
2086
|
+
Ze as J,
|
|
2087
|
+
ts as K,
|
|
2088
|
+
ss as L,
|
|
2089
|
+
se as M,
|
|
2090
|
+
Ut as N,
|
|
2091
|
+
cs as O,
|
|
2092
|
+
oe as P,
|
|
2093
|
+
ds as Q,
|
|
2094
|
+
Xe as R,
|
|
2095
|
+
D as S,
|
|
2096
|
+
Qe as T,
|
|
2097
|
+
qt as U,
|
|
2098
|
+
is as a,
|
|
2099
|
+
us as b,
|
|
2100
|
+
ne as c,
|
|
2101
|
+
rs as d,
|
|
2102
|
+
as as e,
|
|
2103
|
+
Ee as f,
|
|
2104
|
+
Ve as g,
|
|
2105
|
+
Ge as h,
|
|
2106
|
+
De as i,
|
|
2107
|
+
ve as j,
|
|
2108
|
+
ns as k,
|
|
2109
|
+
Je as l,
|
|
2110
|
+
Dt as m,
|
|
2111
|
+
vt as n,
|
|
2112
|
+
Ne as o,
|
|
2113
|
+
Ue as p,
|
|
2114
|
+
He as q,
|
|
2115
|
+
Re as r,
|
|
2116
|
+
Pt as s,
|
|
2117
|
+
Ft as t,
|
|
2118
|
+
qe as u,
|
|
2119
|
+
It as v,
|
|
2120
|
+
Bt as w,
|
|
2121
|
+
$t as x,
|
|
2122
|
+
zt as y,
|
|
2123
|
+
Ke as z
|
|
2121
2124
|
};
|