@base-framework/ui 1.0.2021 → 1.0.2023
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms.es.js +2 -2
- package/dist/{empty-state-B4_OsXpP.js → empty-state-BJJ3lWNv.js} +717 -474
- package/dist/{image-BDqNm5Gs.js → image-BB__4s0g.js} +6 -6
- package/dist/index.es.js +123 -122
- package/dist/molecules.es.js +36 -35
- package/dist/organisms.es.js +2 -2
- package/dist/{range-calendar-CTskA-vU.js → range-calendar-6CLMTieN.js} +3 -2
- package/dist/{signature-panel-BAkIfppW.js → signature-panel-JSfsTsVc.js} +2 -2
- package/dist/{tooltip-DWWak6Sg.js → tooltip-Czvqmxt3.js} +1 -1
- package/dist/types/components/molecules/modals/drawer-gesture.d.ts +119 -0
- package/dist/types/components/molecules/modals/drawer.d.ts +46 -0
- package/dist/types/components/molecules/modals/modal.d.ts +1 -1
- package/dist/types/components/molecules/molecules.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Div as n, H5 as
|
|
2
|
-
import { Atom as c, Component as
|
|
3
|
-
import { P as
|
|
4
|
-
import { C as
|
|
1
|
+
import { Div as n, H5 as Z, P as b, I as x, Li as H, Span as l, Ul as q, Button as m, OnState as I, Label as P, H2 as S, Form as tt, Header as T, Footer as L, A as V, H3 as et, Checkbox as st, Input as f, Img as G, Nav as ot, UseParent as W, OnStateOpen as O, Time as nt, Dialog as rt } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as c, Component as w, Html as A, Dom as it, base as at, Data as B, Builder as _, Jot as v, Events as p, DateTime as M } from "@base-framework/base";
|
|
3
|
+
import { P as D, b as lt, R as ct } from "./range-calendar-6CLMTieN.js";
|
|
4
|
+
import { C as dt, F as ut } from "./form-group-BB7dLJir.js";
|
|
5
5
|
import { B as h, I as g } from "./buttons-CHEs54Wl.js";
|
|
6
|
-
import { Icons as
|
|
7
|
-
import { Timer as
|
|
8
|
-
import { a as C } from "./image-
|
|
9
|
-
import { F as
|
|
10
|
-
const
|
|
6
|
+
import { Icons as d } from "./icons.es.js";
|
|
7
|
+
import { Timer as ht, List as ft, DynamicTime as mt } from "@base-framework/organisms";
|
|
8
|
+
import { a as C } from "./image-BB__4s0g.js";
|
|
9
|
+
import { F as Y } from "./format-BmrNQptv.js";
|
|
10
|
+
const j = {
|
|
11
11
|
info: {
|
|
12
12
|
borderColor: "border-blue-500",
|
|
13
13
|
bgColor: "bg-muted/10",
|
|
@@ -33,20 +33,20 @@ const z = {
|
|
|
33
33
|
bgColor: "bg-muted/10",
|
|
34
34
|
iconColor: "text-muted-foreground"
|
|
35
35
|
}
|
|
36
|
-
},
|
|
37
|
-
x({ html:
|
|
38
|
-
]),
|
|
39
|
-
const { borderColor: r, bgColor:
|
|
40
|
-
return n({ class: `flex items-start p-4 border rounded-lg ${
|
|
36
|
+
}, gt = (t, e) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${e}` }, [
|
|
37
|
+
x({ html: t })
|
|
38
|
+
]), pt = (t) => Z({ class: "font-semibold" }, t), bt = (t) => b({ class: "text-sm text-muted-foreground" }, t), Le = c(({ title: t, description: e, icon: s, type: o = "default" }) => {
|
|
39
|
+
const { borderColor: r, bgColor: i, iconColor: a } = j[o] || j.default;
|
|
40
|
+
return n({ class: `flex items-start p-4 border rounded-lg ${i} ${r}` }, [
|
|
41
41
|
// Icon and content
|
|
42
|
-
s &&
|
|
42
|
+
s && gt(s, a),
|
|
43
43
|
n({ class: "flex flex-col" }, [
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
pt(t),
|
|
45
|
+
bt(e)
|
|
46
46
|
])
|
|
47
47
|
]);
|
|
48
48
|
});
|
|
49
|
-
class
|
|
49
|
+
class Oe extends w {
|
|
50
50
|
/**
|
|
51
51
|
* This will declare the props for the compiler.
|
|
52
52
|
*
|
|
@@ -62,50 +62,50 @@ class At extends y {
|
|
|
62
62
|
*/
|
|
63
63
|
remove() {
|
|
64
64
|
this.prepareDestroy(), this.removeContext();
|
|
65
|
-
const
|
|
65
|
+
const e = this.panel, s = this.removingClass;
|
|
66
66
|
if (!s) {
|
|
67
|
-
|
|
67
|
+
A.removeElement(e);
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
it.addClass(e, s), at.on("animationend", e, (o) => A.removeElement(e));
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
const
|
|
73
|
+
const xt = (t) => l({ class: "ml-auto text-xs tracking-widest opacity-60" }, t), yt = (t) => l({ class: "flex w-4 h-4", html: t }), wt = (t) => l({ class: "flex-auto" }, t), vt = (t, e) => H({
|
|
74
74
|
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
|
-
click: () => t
|
|
75
|
+
click: () => e(t)
|
|
76
76
|
}, [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
]),
|
|
81
|
-
|
|
82
|
-
]),
|
|
77
|
+
t.icon && yt(t.icon),
|
|
78
|
+
wt(t.label),
|
|
79
|
+
t.shortcut && xt(t.shortcut)
|
|
80
|
+
]), Ct = (t, e) => q({ class: "grid gap-2" }, [
|
|
81
|
+
t.map((s) => vt(s, e))
|
|
82
|
+
]), St = (t) => n({ class: "w-full z-10" }, [
|
|
83
83
|
n({
|
|
84
84
|
class: "max-h-60 border rounded-md overflow-y-auto p-1 grid gap-2 divide-y divide-border",
|
|
85
|
-
for: ["groups", (
|
|
85
|
+
for: ["groups", (e) => Ct(e, t)]
|
|
86
86
|
})
|
|
87
|
-
]),
|
|
87
|
+
]), Dt = ({ label: t, icon: e, toggleDropdown: s }) => m({
|
|
88
88
|
cache: "button",
|
|
89
89
|
class: `inline-flex items-center justify-between rounded-md border
|
|
90
90
|
px-2 py-2 text-sm font-medium hover:bg-muted
|
|
91
91
|
focus:outline-none transition duration-150 ease-in-out`,
|
|
92
92
|
click: s
|
|
93
93
|
}, [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
]),
|
|
97
|
-
|
|
94
|
+
t && l(t),
|
|
95
|
+
e && x({ html: e })
|
|
96
|
+
]), kt = ({ onSelect: t }) => n([
|
|
97
|
+
I(
|
|
98
98
|
"open",
|
|
99
|
-
(
|
|
99
|
+
(e, s, o) => e ? new D({
|
|
100
100
|
cache: "dropdown",
|
|
101
101
|
parent: o,
|
|
102
102
|
button: o.button
|
|
103
103
|
}, [
|
|
104
|
-
|
|
104
|
+
St(t)
|
|
105
105
|
]) : null
|
|
106
106
|
)
|
|
107
107
|
]);
|
|
108
|
-
class
|
|
108
|
+
class Ae extends w {
|
|
109
109
|
/**
|
|
110
110
|
* This will declare the props for the compiler.
|
|
111
111
|
*
|
|
@@ -120,7 +120,7 @@ class Mt extends y {
|
|
|
120
120
|
* @returns {Data}
|
|
121
121
|
*/
|
|
122
122
|
setData() {
|
|
123
|
-
return new
|
|
123
|
+
return new B({
|
|
124
124
|
groups: this.groups || []
|
|
125
125
|
});
|
|
126
126
|
}
|
|
@@ -149,8 +149,8 @@ class Mt extends y {
|
|
|
149
149
|
* @param {object} item - The selected item object
|
|
150
150
|
* @returns {void}
|
|
151
151
|
*/
|
|
152
|
-
handleSelect(
|
|
153
|
-
this.state.selectedItem =
|
|
152
|
+
handleSelect(e) {
|
|
153
|
+
this.state.selectedItem = e, this.state.open = !1, typeof this.onSelect == "function" && this.onSelect(e);
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* Renders the Dropdown component.
|
|
@@ -159,42 +159,42 @@ class Mt extends y {
|
|
|
159
159
|
*/
|
|
160
160
|
render() {
|
|
161
161
|
return n({ class: "relative" }, [
|
|
162
|
-
|
|
162
|
+
Dt({
|
|
163
163
|
label: this.label,
|
|
164
164
|
icon: this.icon,
|
|
165
165
|
toggleDropdown: this.toggleDropdown.bind(this)
|
|
166
166
|
}),
|
|
167
|
-
|
|
167
|
+
kt({ onSelect: this.handleSelect.bind(this) })
|
|
168
168
|
]);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
...
|
|
175
|
-
])),
|
|
176
|
-
n({ class: "flex flex-col gap-y-6" },
|
|
177
|
-
])),
|
|
178
|
-
const s =
|
|
179
|
-
return n({ ...
|
|
180
|
-
}), $
|
|
171
|
+
const It = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e)), Tt = c((t, e) => P({ ...t, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, e)), Bt = c((t, e) => b({ ...t, class: "text-sm text-muted-foreground italic" }, e)), Ft = c((t, e) => b({ ...t, class: "text-sm text-destructive" }, e)), Ye = c((t, e = []) => dt({ class: "flex flex-auto flex-col gap-y-0", margin: "m-0", padding: "p-0" }, [
|
|
172
|
+
t.title && S({ class: "text-lg font-semibold py-4 px-6" }, t.title),
|
|
173
|
+
t.description && b({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, t.description),
|
|
174
|
+
...e
|
|
175
|
+
])), je = c((t, e = []) => ut({ label: t.label, description: t.description, class: "py-4 px-6", border: t.border }, [
|
|
176
|
+
n({ class: "flex flex-col gap-y-6" }, e)
|
|
177
|
+
])), Ee = c((t, e = []) => {
|
|
178
|
+
const s = t.border ? "border-t" : "";
|
|
179
|
+
return n({ ...t, class: `flex flex-col pb-4 px-6 gap-y-4 ${s} ${t.class || ""}` }, e);
|
|
180
|
+
}), $t = (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 : $t(o) ? {
|
|
181
181
|
...o,
|
|
182
182
|
aria: {
|
|
183
183
|
invalid: ["hasError"]
|
|
184
184
|
},
|
|
185
185
|
invalid: s,
|
|
186
|
-
input:
|
|
187
|
-
} : o),
|
|
188
|
-
const r = J(
|
|
189
|
-
|
|
190
|
-
}, (
|
|
191
|
-
|
|
186
|
+
input: e
|
|
187
|
+
} : o), Mt = c((t, e) => {
|
|
188
|
+
const r = J(e, (i) => {
|
|
189
|
+
i.target.checkValidity() && t.setError(null);
|
|
190
|
+
}, (i) => {
|
|
191
|
+
t.setError(i.target.validationMessage);
|
|
192
192
|
});
|
|
193
193
|
return n({
|
|
194
|
-
...
|
|
194
|
+
...t,
|
|
195
195
|
class: "w-full"
|
|
196
196
|
}, r);
|
|
197
|
-
}),
|
|
197
|
+
}), Ne = C(
|
|
198
198
|
{
|
|
199
199
|
/**
|
|
200
200
|
* The initial state of the FormField.
|
|
@@ -215,42 +215,191 @@ const ke = c((e, t) => n({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t))
|
|
|
215
215
|
* @returns {object}
|
|
216
216
|
*/
|
|
217
217
|
render() {
|
|
218
|
-
const
|
|
219
|
-
this.state.error =
|
|
218
|
+
const t = this.name, e = this.getId(`${t}`), { label: s, description: o } = this, r = (i) => {
|
|
219
|
+
this.state.error = i, this.state.hasError = !!i;
|
|
220
220
|
};
|
|
221
221
|
return n({ class: "flex flex-auto gap-y-4" }, [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
id:
|
|
226
|
-
name:
|
|
222
|
+
It([
|
|
223
|
+
Tt({ htmlFor: e }, s),
|
|
224
|
+
Mt({
|
|
225
|
+
id: e,
|
|
226
|
+
name: t,
|
|
227
227
|
value: this.state.value,
|
|
228
228
|
setError: r
|
|
229
229
|
}, this.children),
|
|
230
|
-
o &&
|
|
231
|
-
n({ onState: ["error", (
|
|
230
|
+
o && Bt({ id: this.getId("description") }, o),
|
|
231
|
+
n({ onState: ["error", (i) => i && Ft(i)] })
|
|
232
232
|
])
|
|
233
233
|
]);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
),
|
|
237
|
-
|
|
236
|
+
), Pt = (t, e, s = null) => {
|
|
237
|
+
t.target.checkValidity() && (t.preventDefault(), s && s(t, e));
|
|
238
238
|
}, K = c(
|
|
239
|
-
(
|
|
240
|
-
),
|
|
241
|
-
|
|
242
|
-
...
|
|
243
|
-
])),
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
]),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
])
|
|
239
|
+
(t, e) => tt({ ...t, submit: (s, o) => Pt(s, o, t.submit), class: `w-full ${t.class ?? ""}` }, e)
|
|
240
|
+
), ze = c((t, e) => n({ ...t, class: `flex flex-auto flex-col gap-y-6 p-4 md:p-6 divide-y ${t.class || ""}` }, e)), Ue = c((t, e = []) => n({ class: "flex flex-col gap-y-3 py-4" }, [
|
|
241
|
+
t.title && S({ class: "font-semibold" }, t.title),
|
|
242
|
+
...e
|
|
243
|
+
])), Re = (t, e) => n({ class: "flex justify-between" }, [
|
|
244
|
+
l({ class: "text-muted-foreground" }, t),
|
|
245
|
+
l(e)
|
|
246
|
+
]), He = (t, e) => n({ class: "flex" }, [
|
|
247
|
+
l({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, t),
|
|
248
|
+
l(e)
|
|
249
|
+
]);
|
|
250
|
+
class Lt {
|
|
251
|
+
/**
|
|
252
|
+
* Creates an instance of DrawerGesture.
|
|
253
|
+
*
|
|
254
|
+
* @param {object} [options={}]
|
|
255
|
+
* @param {HTMLElement|null} [options.modal=null] - The modal element (panel) reference
|
|
256
|
+
* @param {number} [options.closeThreshold=150] - Pixels to drag before closing
|
|
257
|
+
* @param {number} [options.snapThreshold=50] - Pixels to drag before snapping
|
|
258
|
+
* @param {Function|null} [options.onClose=null] - Callback when drawer should close
|
|
259
|
+
*/
|
|
260
|
+
constructor(e = {}) {
|
|
261
|
+
const { modal: s = null, closeThreshold: o = 150, snapThreshold: r = 50, onClose: i = null } = e;
|
|
262
|
+
this.modal = s, this.reset();
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Reset drag state
|
|
266
|
+
*
|
|
267
|
+
* @returns {void}
|
|
268
|
+
*/
|
|
269
|
+
reset() {
|
|
270
|
+
this.state = {
|
|
271
|
+
isDragging: !1,
|
|
272
|
+
startY: 0,
|
|
273
|
+
currentY: 0,
|
|
274
|
+
startScrollTop: 0,
|
|
275
|
+
canDrag: !1
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Check if viewport is mobile
|
|
280
|
+
*
|
|
281
|
+
* @returns {boolean}
|
|
282
|
+
*/
|
|
283
|
+
isMobile() {
|
|
284
|
+
return window.innerWidth < 1024;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Handle touch start
|
|
288
|
+
*
|
|
289
|
+
* @param {TouchEvent} e
|
|
290
|
+
* @returns {void}
|
|
291
|
+
*/
|
|
292
|
+
handleTouchStart(e) {
|
|
293
|
+
if (!this.modalBody) return;
|
|
294
|
+
const s = e.touches[0];
|
|
295
|
+
this.state.startY = s.clientY, this.state.currentY = s.clientY, this.state.startScrollTop = this.modalBody.scrollTop, this.state.canDrag = this.modalBody.scrollTop === 0;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Handle touch move
|
|
299
|
+
*
|
|
300
|
+
* @param {TouchEvent} e
|
|
301
|
+
* @returns {void}
|
|
302
|
+
*/
|
|
303
|
+
handleTouchMove(e) {
|
|
304
|
+
if (!this.modalContent || !this.modalBody) return;
|
|
305
|
+
const s = e.touches[0];
|
|
306
|
+
this.state.currentY = s.clientY;
|
|
307
|
+
const o = this.getDeltaY();
|
|
308
|
+
if (!this.state.isDragging && this.state.canDrag && o > 0 && this.modalBody.scrollTop === 0 && (this.state.isDragging = !0), this.state.isDragging && o > 0) {
|
|
309
|
+
e.preventDefault();
|
|
310
|
+
const r = this.calculateTranslateY(o);
|
|
311
|
+
this.modalContent.style.transform = `translateY(${r}px)`, this.modalContent.style.transition = "none";
|
|
312
|
+
const i = this.calculateBackdropOpacity(o);
|
|
313
|
+
this.updateBackdropOpacity(i);
|
|
314
|
+
} else this.modalBody.scrollTop > 0 && (this.state.canDrag = !1);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Handle touch end
|
|
318
|
+
*
|
|
319
|
+
* @param {TouchEvent} e
|
|
320
|
+
* @returns {void}
|
|
321
|
+
*/
|
|
322
|
+
handleTouchEnd(e) {
|
|
323
|
+
if (!this.modalContent) return;
|
|
324
|
+
const s = this.getDeltaY();
|
|
325
|
+
this.state.isDragging && (this.modalContent.style.transition = "transform 0.3s ease-out, opacity 0.3s ease-out", s > this.closeThreshold ? this.animateClose() : this.snapBack()), this.state.isDragging = !1, this.state.canDrag = !1;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Get current drag delta Y
|
|
329
|
+
*
|
|
330
|
+
* @returns {number}
|
|
331
|
+
*/
|
|
332
|
+
getDeltaY() {
|
|
333
|
+
return this.state.currentY - this.state.startY;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Calculate translateY with rubber band damping
|
|
337
|
+
*
|
|
338
|
+
* @param {number} deltaY
|
|
339
|
+
* @returns {number}
|
|
340
|
+
*/
|
|
341
|
+
calculateTranslateY(e) {
|
|
342
|
+
const s = 1 - e / (window.innerHeight * 2);
|
|
343
|
+
return e * Math.max(s, 0.5);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Calculate backdrop opacity based on drag distance
|
|
347
|
+
*
|
|
348
|
+
* @param {number} deltaY
|
|
349
|
+
* @returns {number}
|
|
350
|
+
*/
|
|
351
|
+
calculateBackdropOpacity(e) {
|
|
352
|
+
return Math.max(0, 1 - e / this.closeThreshold);
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Update backdrop opacity
|
|
356
|
+
*
|
|
357
|
+
* @param {number} opacity
|
|
358
|
+
* @returns {void}
|
|
359
|
+
*/
|
|
360
|
+
updateBackdropOpacity(e) {
|
|
361
|
+
this.modal && this.modal.style.setProperty("--backdrop-opacity", e.toString());
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Animate drawer closing
|
|
365
|
+
*
|
|
366
|
+
* @returns {void}
|
|
367
|
+
*/
|
|
368
|
+
animateClose() {
|
|
369
|
+
this.modalContent && (this.modalContent.style.transform = "translateY(100%)", this.updateBackdropOpacity(0), setTimeout(() => {
|
|
370
|
+
this.onClose && this.onClose();
|
|
371
|
+
}, 300));
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Snap drawer back to original position
|
|
375
|
+
*
|
|
376
|
+
* @returns {void}
|
|
377
|
+
*/
|
|
378
|
+
snapBack() {
|
|
379
|
+
this.modalContent && (this.modalContent.style.transform = "translateY(0)", this.updateBackdropOpacity(1));
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Check if currently dragging
|
|
383
|
+
*
|
|
384
|
+
* @returns {boolean}
|
|
385
|
+
*/
|
|
386
|
+
isDragging() {
|
|
387
|
+
return this.state.isDragging;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Cleanup
|
|
391
|
+
*
|
|
392
|
+
* @returns {void}
|
|
393
|
+
*/
|
|
394
|
+
destroy() {
|
|
395
|
+
this.reset(), this.onClose = null;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
const Ot = ({ title: t, description: e, back: s, icon: o, options: r = [] }) => T({ 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
399
|
/**
|
|
251
400
|
* Back Button
|
|
252
401
|
*/
|
|
253
|
-
s && h({ variant: "icon", icon:
|
|
402
|
+
s && h({ variant: "icon", icon: d.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (i, a) => a.close() }),
|
|
254
403
|
/**
|
|
255
404
|
* Icon
|
|
256
405
|
*/
|
|
@@ -260,25 +409,30 @@ const ke = c((e, t) => n({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t))
|
|
|
260
409
|
*/
|
|
261
410
|
n({ class: "flex flex-auto flex-row justify-between ml-2 gap-2 min-w-0" }, [
|
|
262
411
|
n({ class: "flex flex-auto flex-col min-w-0" }, [
|
|
263
|
-
S({ class: "text-lg font-semibold m-0 truncate" },
|
|
264
|
-
|
|
412
|
+
S({ class: "text-lg font-semibold m-0 truncate" }, t),
|
|
413
|
+
e && n({ class: "text-sm text-muted-foreground truncate" }, e)
|
|
265
414
|
]),
|
|
266
415
|
n({ class: "flex flex-none items-center gap-2" }, r)
|
|
267
416
|
])
|
|
268
|
-
]),
|
|
417
|
+
]), Q = c((t, e) => n({
|
|
269
418
|
popover: "manual",
|
|
270
|
-
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 overflow-y-auto ${
|
|
419
|
+
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 overflow-y-auto ${t.class}`,
|
|
271
420
|
click: (s, o) => {
|
|
272
421
|
s.target === o.panel && (s.preventDefault(), s.stopPropagation(), o.state.open = !1);
|
|
273
422
|
}
|
|
274
423
|
}, [
|
|
275
|
-
K({
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
424
|
+
K({
|
|
425
|
+
class: "modal-content relative bg-background z-[1] flex flex-auto flex-col gap-y-4 min-w-0",
|
|
426
|
+
submit: (s, o) => t.onSubmit && t.onSubmit(o),
|
|
427
|
+
cache: "modalContent",
|
|
428
|
+
...t.gestureHandlers
|
|
429
|
+
}, [
|
|
430
|
+
Ot(t),
|
|
431
|
+
n({ class: "modal-body flex flex-grow flex-col py-0 px-6 z-0 overflow-y-auto", cache: "modalBody" }, e),
|
|
432
|
+
!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)
|
|
279
433
|
])
|
|
280
|
-
])),
|
|
281
|
-
class
|
|
434
|
+
])), At = (t) => _.render(t, app.root);
|
|
435
|
+
class Yt extends w {
|
|
282
436
|
/**
|
|
283
437
|
* This will declare the props for the compiler.
|
|
284
438
|
*
|
|
@@ -293,18 +447,18 @@ class Ht extends y {
|
|
|
293
447
|
* @returns {object}
|
|
294
448
|
*/
|
|
295
449
|
render() {
|
|
296
|
-
const
|
|
297
|
-
return
|
|
450
|
+
const e = this.getMainClass(), s = this.title || "", o = this.description || null;
|
|
451
|
+
return Q(
|
|
298
452
|
{
|
|
299
|
-
class:
|
|
453
|
+
class: e,
|
|
300
454
|
title: s,
|
|
301
455
|
description: o,
|
|
302
456
|
options: this.headerOptions(),
|
|
303
457
|
buttons: this.getButtons(),
|
|
304
458
|
hideFooter: this.hideFooter,
|
|
305
459
|
onSubmit: (r) => {
|
|
306
|
-
let
|
|
307
|
-
this.onSubmit && (
|
|
460
|
+
let i = !0;
|
|
461
|
+
this.onSubmit && (i = this.onSubmit(r)), i !== !1 && this.destroy();
|
|
308
462
|
},
|
|
309
463
|
icon: this.icon,
|
|
310
464
|
back: this.back ?? !1,
|
|
@@ -322,8 +476,8 @@ class Ht extends y {
|
|
|
322
476
|
return {
|
|
323
477
|
open: {
|
|
324
478
|
state: !1,
|
|
325
|
-
callBack: (
|
|
326
|
-
|
|
479
|
+
callBack: (e) => {
|
|
480
|
+
e || this.destroy();
|
|
327
481
|
}
|
|
328
482
|
}
|
|
329
483
|
};
|
|
@@ -353,8 +507,8 @@ class Ht extends y {
|
|
|
353
507
|
* @param {object} element
|
|
354
508
|
* @returns {boolean}
|
|
355
509
|
*/
|
|
356
|
-
isOutsideClick(
|
|
357
|
-
return !this.panel.contains(
|
|
510
|
+
isOutsideClick(e) {
|
|
511
|
+
return !this.panel.contains(e);
|
|
358
512
|
}
|
|
359
513
|
/**
|
|
360
514
|
* This will get the size class.
|
|
@@ -384,6 +538,8 @@ class Ht extends y {
|
|
|
384
538
|
return "right right-0";
|
|
385
539
|
case "left":
|
|
386
540
|
return "left left-0";
|
|
541
|
+
case "drawer":
|
|
542
|
+
return "drawer";
|
|
387
543
|
default:
|
|
388
544
|
return "";
|
|
389
545
|
}
|
|
@@ -401,7 +557,7 @@ class Ht extends y {
|
|
|
401
557
|
*
|
|
402
558
|
* @param {object} container
|
|
403
559
|
*/
|
|
404
|
-
setContainer(
|
|
560
|
+
setContainer(e) {
|
|
405
561
|
this.container = app.root;
|
|
406
562
|
}
|
|
407
563
|
/**
|
|
@@ -410,7 +566,7 @@ class Ht extends y {
|
|
|
410
566
|
* @returns {void}
|
|
411
567
|
*/
|
|
412
568
|
open() {
|
|
413
|
-
|
|
569
|
+
At(this), this.showModal();
|
|
414
570
|
}
|
|
415
571
|
/**
|
|
416
572
|
* This will destroy the modal.
|
|
@@ -439,6 +595,92 @@ class Ht extends y {
|
|
|
439
595
|
this.panel.hidePopover(), this.state.open = !1, typeof this.onClose == "function" && this.onClose(this), document.documentElement.style.overflowY = "auto";
|
|
440
596
|
}
|
|
441
597
|
}
|
|
598
|
+
class qe extends Yt {
|
|
599
|
+
/**
|
|
600
|
+
* This will declare the props for the compiler.
|
|
601
|
+
*
|
|
602
|
+
* @returns {void}
|
|
603
|
+
*/
|
|
604
|
+
declareProps() {
|
|
605
|
+
super.declareProps(), this.type = "drawer", this.swipeToClose = !0, this.closeThreshold = 150, this.snapThreshold = 50;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Get extra props for ModalContainer
|
|
609
|
+
*
|
|
610
|
+
* @returns {object}
|
|
611
|
+
*/
|
|
612
|
+
getContainerProps() {
|
|
613
|
+
const e = {};
|
|
614
|
+
return this.swipeToClose && this.gesture && (e.gestureHandlers = this.getGestureHandlers()), e;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Render the drawer with gesture handlers
|
|
618
|
+
*
|
|
619
|
+
* @returns {object}
|
|
620
|
+
*/
|
|
621
|
+
render() {
|
|
622
|
+
const e = this.getMainClass(), s = this.title || "", o = this.description || null, r = this.getContainerProps();
|
|
623
|
+
return Q(
|
|
624
|
+
{
|
|
625
|
+
class: e,
|
|
626
|
+
title: s,
|
|
627
|
+
description: o,
|
|
628
|
+
options: this.headerOptions(),
|
|
629
|
+
buttons: this.getButtons(),
|
|
630
|
+
hideFooter: this.hideFooter,
|
|
631
|
+
onSubmit: (i) => {
|
|
632
|
+
let a = !0;
|
|
633
|
+
this.onSubmit && (a = this.onSubmit(i)), a !== !1 && this.destroy();
|
|
634
|
+
},
|
|
635
|
+
icon: this.icon,
|
|
636
|
+
back: this.back ?? !1,
|
|
637
|
+
aria: { expanded: ["open"] },
|
|
638
|
+
...r
|
|
639
|
+
},
|
|
640
|
+
this.children
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Show the modal
|
|
645
|
+
*
|
|
646
|
+
* @protected
|
|
647
|
+
* @returns {void}
|
|
648
|
+
*/
|
|
649
|
+
showModal() {
|
|
650
|
+
super.showModal(), this.swipeToClose && !this.gesture && (this.gesture = new Lt({
|
|
651
|
+
modal: this.panel,
|
|
652
|
+
// @ts-ignore
|
|
653
|
+
modalContent: this.modalContent,
|
|
654
|
+
// @ts-ignore
|
|
655
|
+
modalBody: this.modalBody,
|
|
656
|
+
closeThreshold: this.closeThreshold,
|
|
657
|
+
snapThreshold: this.snapThreshold,
|
|
658
|
+
onClose: () => this.destroy()
|
|
659
|
+
}));
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Get gesture event handlers for modal content
|
|
663
|
+
* Returns event props to be spread onto the modal-content element
|
|
664
|
+
*
|
|
665
|
+
* @returns {object}
|
|
666
|
+
*/
|
|
667
|
+
getGestureHandlers() {
|
|
668
|
+
return !this.swipeToClose || !this.gesture || !this.gesture.isMobile() ? {} : {
|
|
669
|
+
touchstart: (e) => this.gesture.handleTouchStart(e),
|
|
670
|
+
touchmove: (e) => this.gesture.handleTouchMove(e),
|
|
671
|
+
touchend: (e) => this.gesture.handleTouchEnd(e)
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Clean up before destroy
|
|
676
|
+
*
|
|
677
|
+
* @protected
|
|
678
|
+
* @returns {void}
|
|
679
|
+
*/
|
|
680
|
+
beforeDestroy() {
|
|
681
|
+
this.gesture && (this.gesture.destroy(), this.gesture = null), super.beforeDestroy();
|
|
682
|
+
}
|
|
683
|
+
}
|
|
442
684
|
const E = {
|
|
443
685
|
info: {
|
|
444
686
|
bgColor: "bg-muted/10",
|
|
@@ -465,22 +707,22 @@ const E = {
|
|
|
465
707
|
borderColor: "border",
|
|
466
708
|
iconColor: "text-muted-foreground"
|
|
467
709
|
}
|
|
468
|
-
},
|
|
469
|
-
|
|
470
|
-
]),
|
|
471
|
-
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 ${
|
|
472
|
-
href:
|
|
710
|
+
}, jt = (t) => T({ class: "flex justify-center" }, [
|
|
711
|
+
et({ class: "text-lg font-bold mb-0" }, t)
|
|
712
|
+
]), Et = c(({ href: t, class: e }, s) => V({
|
|
713
|
+
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}`,
|
|
714
|
+
href: t,
|
|
473
715
|
animateIn: "pullRightIn",
|
|
474
716
|
animateOut: "pullRight",
|
|
475
717
|
role: "alert"
|
|
476
|
-
}, s)),
|
|
477
|
-
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 ${
|
|
478
|
-
click: () =>
|
|
718
|
+
}, s)), Nt = c(({ close: t, class: e }, s) => n({
|
|
719
|
+
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}`,
|
|
720
|
+
click: () => t(),
|
|
479
721
|
animateIn: "pullRightIn",
|
|
480
722
|
animateOut: "pullRight",
|
|
481
723
|
role: "alert"
|
|
482
724
|
}, s));
|
|
483
|
-
class
|
|
725
|
+
class zt extends w {
|
|
484
726
|
/**
|
|
485
727
|
* This will declare the props for the compiler.
|
|
486
728
|
*
|
|
@@ -503,14 +745,14 @@ class Ee extends y {
|
|
|
503
745
|
* @returns {object}
|
|
504
746
|
*/
|
|
505
747
|
render() {
|
|
506
|
-
const { bgColor:
|
|
507
|
-
return r ?
|
|
748
|
+
const { bgColor: e, borderColor: s, iconColor: o } = this.getTypeStyles(), r = this.href || null, i = this.getChildren(o);
|
|
749
|
+
return r ? Et({
|
|
508
750
|
href: r,
|
|
509
|
-
class: `${
|
|
510
|
-
},
|
|
751
|
+
class: `${e} ${s}`
|
|
752
|
+
}, i) : Nt({
|
|
511
753
|
close: this.close.bind(this),
|
|
512
|
-
class: `${
|
|
513
|
-
},
|
|
754
|
+
class: `${e} ${s}`
|
|
755
|
+
}, i);
|
|
514
756
|
}
|
|
515
757
|
/**
|
|
516
758
|
* This will be called after the component is set up.
|
|
@@ -518,8 +760,8 @@ class Ee extends y {
|
|
|
518
760
|
* @returns {void}
|
|
519
761
|
*/
|
|
520
762
|
afterSetup() {
|
|
521
|
-
const
|
|
522
|
-
|
|
763
|
+
const e = this.duration;
|
|
764
|
+
e !== "infinite" && (this.timer = new ht(e, this.close.bind(this)), this.timer.start());
|
|
523
765
|
}
|
|
524
766
|
/**
|
|
525
767
|
* This will get the style properties based on the notification type.
|
|
@@ -527,8 +769,8 @@ class Ee extends y {
|
|
|
527
769
|
* @returns {object}
|
|
528
770
|
*/
|
|
529
771
|
getTypeStyles() {
|
|
530
|
-
const
|
|
531
|
-
return E[
|
|
772
|
+
const e = this.type || "default";
|
|
773
|
+
return E[e] || E.default;
|
|
532
774
|
}
|
|
533
775
|
/**
|
|
534
776
|
* This will get the buttons for the notification.
|
|
@@ -549,22 +791,22 @@ class Ee extends y {
|
|
|
549
791
|
* @param {string} iconColor
|
|
550
792
|
* @returns {array}
|
|
551
793
|
*/
|
|
552
|
-
getChildren(
|
|
794
|
+
getChildren(e) {
|
|
553
795
|
return [
|
|
554
796
|
n({ class: "flex items-start" }, [
|
|
555
|
-
this.icon && x({ class: `mr-4 ${
|
|
797
|
+
this.icon && x({ class: `mr-4 ${e}`, html: this.icon }),
|
|
556
798
|
n({ class: "flex flex-auto flex-col" }, [
|
|
557
799
|
n({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
|
|
558
|
-
this.title &&
|
|
800
|
+
this.title && jt(this.title)
|
|
559
801
|
]),
|
|
560
802
|
b({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
|
|
561
|
-
(this.primary || this.secondary) &&
|
|
803
|
+
(this.primary || this.secondary) && L({ class: "margin-top-24 flex align-center" }, this.getButtons())
|
|
562
804
|
])
|
|
563
805
|
]),
|
|
564
806
|
h({
|
|
565
807
|
class: "absolute top-[12px] right-[12px]",
|
|
566
808
|
variant: "icon",
|
|
567
|
-
icon:
|
|
809
|
+
icon: d.x,
|
|
568
810
|
click: this.close.bind(this)
|
|
569
811
|
})
|
|
570
812
|
];
|
|
@@ -575,12 +817,12 @@ class Ee extends y {
|
|
|
575
817
|
* @param {object} e The event object.
|
|
576
818
|
* @returns {void}
|
|
577
819
|
*/
|
|
578
|
-
close(
|
|
579
|
-
|
|
820
|
+
close(e) {
|
|
821
|
+
e && e.stopPropagation(), this.duration !== "infinite" && this.timer.stop(), this.onClick && this.onClick(), this.destroy();
|
|
580
822
|
}
|
|
581
823
|
}
|
|
582
|
-
let
|
|
583
|
-
class
|
|
824
|
+
let Ut = 0;
|
|
825
|
+
class Ve extends w {
|
|
584
826
|
/**
|
|
585
827
|
* This will render the component.
|
|
586
828
|
*
|
|
@@ -588,11 +830,11 @@ class qt extends y {
|
|
|
588
830
|
*/
|
|
589
831
|
render() {
|
|
590
832
|
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" }, [
|
|
591
|
-
new
|
|
833
|
+
new ft({
|
|
592
834
|
cache: "list",
|
|
593
835
|
key: "id",
|
|
594
836
|
role: "list",
|
|
595
|
-
rowItem: (
|
|
837
|
+
rowItem: (e) => new zt(e)
|
|
596
838
|
})
|
|
597
839
|
]);
|
|
598
840
|
}
|
|
@@ -602,8 +844,8 @@ class qt extends y {
|
|
|
602
844
|
* @param {object} props
|
|
603
845
|
* @returns {void}
|
|
604
846
|
*/
|
|
605
|
-
addNotice(
|
|
606
|
-
|
|
847
|
+
addNotice(e = {}) {
|
|
848
|
+
e.id = Ut++, e.callBack = () => this.removeNotice(e), this.list.append([e]), this.panel.hidePopover(), this.panel.showPopover();
|
|
607
849
|
}
|
|
608
850
|
/**
|
|
609
851
|
* This will remove a notification.
|
|
@@ -611,29 +853,29 @@ class qt extends y {
|
|
|
611
853
|
* @param {object} notice
|
|
612
854
|
* @returns {void}
|
|
613
855
|
*/
|
|
614
|
-
removeNotice(
|
|
615
|
-
this.list.delete(
|
|
856
|
+
removeNotice(e) {
|
|
857
|
+
this.list.delete(e.id), this.list.isEmpty() && this.panel.hidePopover();
|
|
616
858
|
}
|
|
617
859
|
}
|
|
618
|
-
const N = globalThis.matchMedia,
|
|
860
|
+
const N = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => m({
|
|
619
861
|
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',
|
|
620
|
-
onState: ["method", { active:
|
|
621
|
-
dataSet: ["method", ["state",
|
|
862
|
+
onState: ["method", { active: t }],
|
|
863
|
+
dataSet: ["method", ["state", t, "active"]],
|
|
622
864
|
click: (o, { state: r }) => {
|
|
623
|
-
r.method =
|
|
865
|
+
r.method = t, localStorage.setItem("theme", t), t === "system" && localStorage.removeItem("theme"), Rt(t);
|
|
624
866
|
}
|
|
625
867
|
}, [
|
|
626
868
|
g(s),
|
|
627
|
-
|
|
628
|
-
])),
|
|
629
|
-
const
|
|
630
|
-
if (
|
|
631
|
-
|
|
869
|
+
l(e)
|
|
870
|
+
])), Rt = (t) => {
|
|
871
|
+
const e = document.documentElement;
|
|
872
|
+
if (t === "system" && (t = globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"), N && !N("(prefers-color-scheme: " + t + ")").matches) {
|
|
873
|
+
e.classList.add(t);
|
|
632
874
|
return;
|
|
633
875
|
}
|
|
634
|
-
const s =
|
|
635
|
-
|
|
636
|
-
},
|
|
876
|
+
const s = t === "light" ? "dark" : "light";
|
|
877
|
+
e.classList.remove(s);
|
|
878
|
+
}, Ge = v(
|
|
637
879
|
{
|
|
638
880
|
/**
|
|
639
881
|
* This will render the component.
|
|
@@ -643,9 +885,9 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
643
885
|
render() {
|
|
644
886
|
return n({ class: "flex flex-auto flex-col" }, [
|
|
645
887
|
n({ class: "grid grid-cols-3 gap-4" }, [
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
888
|
+
F({ label: "System", value: "system", icon: d.adjustments.horizontal }),
|
|
889
|
+
F({ label: "Light", value: "light", icon: d.sun }),
|
|
890
|
+
F({ label: "Dark", value: "dark", icon: d.moon })
|
|
649
891
|
])
|
|
650
892
|
]);
|
|
651
893
|
},
|
|
@@ -660,7 +902,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
660
902
|
};
|
|
661
903
|
}
|
|
662
904
|
}
|
|
663
|
-
),
|
|
905
|
+
), We = C(
|
|
664
906
|
{
|
|
665
907
|
/**
|
|
666
908
|
* The initial state of the Toggle.
|
|
@@ -690,11 +932,11 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
690
932
|
return m({
|
|
691
933
|
class: "relative inline-flex h-6 w-11 min-w-11 items-center rounded-full bg-muted transition-colors focus:outline-none",
|
|
692
934
|
onState: ["active", { "bg-primary": !0, "bg-muted": !1 }],
|
|
693
|
-
click: (
|
|
694
|
-
s.toggle("active"), this.checkbox.checked = s.active, this.change && this.change(s.active,
|
|
935
|
+
click: (e, { state: s }) => {
|
|
936
|
+
s.toggle("active"), this.checkbox.checked = s.active, this.change && this.change(s.active, e, this);
|
|
695
937
|
}
|
|
696
938
|
}, [
|
|
697
|
-
|
|
939
|
+
st({
|
|
698
940
|
cache: "checkbox",
|
|
699
941
|
class: "opacity-0 absolute top-0 left-0 bottom-0 right-0 w-full h-full",
|
|
700
942
|
/**
|
|
@@ -705,7 +947,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
705
947
|
bind: this.bind,
|
|
706
948
|
required: this.required
|
|
707
949
|
}),
|
|
708
|
-
|
|
950
|
+
l({
|
|
709
951
|
class: "absolute h-5 w-5 bg-background rounded-full shadow-md transform transition-transform",
|
|
710
952
|
onState: ["active", { "translate-x-[22px]": !0, "translate-x-[2px]": !1 }]
|
|
711
953
|
})
|
|
@@ -717,22 +959,22 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
717
959
|
OFFLINE: "offline",
|
|
718
960
|
BUSY: "busy",
|
|
719
961
|
AWAY: "away"
|
|
720
|
-
},
|
|
962
|
+
}, y = {
|
|
721
963
|
ONLINE: "bg-green-500",
|
|
722
964
|
OFFLINE: "bg-gray-500",
|
|
723
965
|
BUSY: "bg-red-500",
|
|
724
966
|
AWAY: "bg-yellow-500"
|
|
725
|
-
},
|
|
726
|
-
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${
|
|
727
|
-
}),
|
|
967
|
+
}, Ht = (t = "") => (t = t.toUpperCase(), y[t] || y.OFFLINE), _e = (t) => n({
|
|
968
|
+
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${Ht(t)}`
|
|
969
|
+
}), Je = ({ propName: t = "status" } = {}) => n({
|
|
728
970
|
class: "absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full",
|
|
729
|
-
onSet: [
|
|
730
|
-
[
|
|
731
|
-
[
|
|
732
|
-
[
|
|
733
|
-
[
|
|
971
|
+
onSet: [t, {
|
|
972
|
+
[y.ONLINE]: k.ONLINE,
|
|
973
|
+
[y.OFFLINE]: k.OFFLINE,
|
|
974
|
+
[y.BUSY]: k.BUSY,
|
|
975
|
+
[y.AWAY]: k.AWAY
|
|
734
976
|
}]
|
|
735
|
-
}),
|
|
977
|
+
}), qt = (t) => t.indexOf(".") === -1 && t.indexOf("[[") === -1 && t.indexOf("blob:") === -1, Ke = v(
|
|
736
978
|
{
|
|
737
979
|
/**
|
|
738
980
|
* Get the initial state for the component.
|
|
@@ -751,8 +993,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
751
993
|
* @returns {void}
|
|
752
994
|
*/
|
|
753
995
|
openFileBrowse() {
|
|
754
|
-
const
|
|
755
|
-
|
|
996
|
+
const t = this.input;
|
|
997
|
+
t && (t.value = "", p.trigger("click", t));
|
|
756
998
|
},
|
|
757
999
|
/**
|
|
758
1000
|
* Get the URL for the uploaded file.
|
|
@@ -760,8 +1002,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
760
1002
|
* @param {File} file - The file to get the URL for.
|
|
761
1003
|
* @returns {string} The object URL for the file.
|
|
762
1004
|
*/
|
|
763
|
-
getFileUrl(
|
|
764
|
-
return this.url && URL.revokeObjectURL(this.url), this.url = URL.createObjectURL(
|
|
1005
|
+
getFileUrl(t) {
|
|
1006
|
+
return this.url && URL.revokeObjectURL(this.url), this.url = URL.createObjectURL(t);
|
|
765
1007
|
},
|
|
766
1008
|
/**
|
|
767
1009
|
* Render the component.
|
|
@@ -769,17 +1011,17 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
769
1011
|
* @returns {object} Rendered component
|
|
770
1012
|
*/
|
|
771
1013
|
render() {
|
|
772
|
-
const
|
|
1014
|
+
const t = "image-upload", e = this.onChange || null;
|
|
773
1015
|
return n({ class: "flex-none items-center" }, [
|
|
774
1016
|
f({
|
|
775
|
-
id:
|
|
1017
|
+
id: t,
|
|
776
1018
|
cache: "input",
|
|
777
1019
|
type: "file",
|
|
778
1020
|
accept: "image/*",
|
|
779
1021
|
class: "hidden",
|
|
780
1022
|
change: (s) => {
|
|
781
1023
|
const o = s.target.files?.[0];
|
|
782
|
-
o &&
|
|
1024
|
+
o && e && (this.state.loaded = !1, e(o, this.parent), this.src = this.getFileUrl(o), this.state.loaded = !0);
|
|
783
1025
|
}
|
|
784
1026
|
}),
|
|
785
1027
|
n({
|
|
@@ -788,13 +1030,13 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
788
1030
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
789
1031
|
}
|
|
790
1032
|
}, [
|
|
791
|
-
|
|
792
|
-
htmlFor:
|
|
1033
|
+
I("loaded", (s) => s === !1 || qt(this.src) ? P({
|
|
1034
|
+
htmlFor: t,
|
|
793
1035
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
794
1036
|
}, [
|
|
795
|
-
g(
|
|
1037
|
+
g(d.upload),
|
|
796
1038
|
n("Upload Image")
|
|
797
|
-
]) :
|
|
1039
|
+
]) : G({
|
|
798
1040
|
// @ts-ignore
|
|
799
1041
|
src: this.src,
|
|
800
1042
|
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
@@ -803,7 +1045,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
803
1045
|
]);
|
|
804
1046
|
}
|
|
805
1047
|
}
|
|
806
|
-
),
|
|
1048
|
+
), Qe = v(
|
|
807
1049
|
{
|
|
808
1050
|
/**
|
|
809
1051
|
* Get the initial state for the component.
|
|
@@ -822,8 +1064,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
822
1064
|
* @returns {void}
|
|
823
1065
|
*/
|
|
824
1066
|
openFileBrowse() {
|
|
825
|
-
const
|
|
826
|
-
|
|
1067
|
+
const t = this.input;
|
|
1068
|
+
t && (t.value = "", p.trigger("click", t));
|
|
827
1069
|
},
|
|
828
1070
|
/**
|
|
829
1071
|
* Get the URL for the uploaded file.
|
|
@@ -831,8 +1073,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
831
1073
|
* @param {File} file - The file to get the URL for.
|
|
832
1074
|
* @returns {string} The object URL for the file.
|
|
833
1075
|
*/
|
|
834
|
-
getFileUrl(
|
|
835
|
-
return this.url && URL.revokeObjectURL(this.url), this.url = URL.createObjectURL(
|
|
1076
|
+
getFileUrl(t) {
|
|
1077
|
+
return this.url && URL.revokeObjectURL(this.url), this.url = URL.createObjectURL(t);
|
|
836
1078
|
},
|
|
837
1079
|
/**
|
|
838
1080
|
* Render the component.
|
|
@@ -840,17 +1082,17 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
840
1082
|
* @returns {object} Rendered component
|
|
841
1083
|
*/
|
|
842
1084
|
render() {
|
|
843
|
-
const
|
|
1085
|
+
const t = "logo-upload", e = this.onChange || null;
|
|
844
1086
|
return n({ class: "flex-none items-center" }, [
|
|
845
1087
|
f({
|
|
846
|
-
id:
|
|
1088
|
+
id: t,
|
|
847
1089
|
cache: "input",
|
|
848
1090
|
type: "file",
|
|
849
1091
|
accept: "image/*",
|
|
850
1092
|
class: "hidden",
|
|
851
1093
|
change: (s) => {
|
|
852
1094
|
const o = s.target.files?.[0];
|
|
853
|
-
o &&
|
|
1095
|
+
o && e && (this.state.loaded = !1, e(o, this.parent), this.src = this.getFileUrl(o), this.state.loaded = !0);
|
|
854
1096
|
}
|
|
855
1097
|
}),
|
|
856
1098
|
n({
|
|
@@ -859,17 +1101,17 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
859
1101
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
860
1102
|
}
|
|
861
1103
|
}, [
|
|
862
|
-
|
|
1104
|
+
I(
|
|
863
1105
|
"loaded",
|
|
864
|
-
(s) => s ?
|
|
1106
|
+
(s) => s ? G({
|
|
865
1107
|
// @ts-ignore
|
|
866
1108
|
src: this.src,
|
|
867
1109
|
class: "absolute inset-0 w-full h-full object-cover rounded-full"
|
|
868
|
-
}) :
|
|
869
|
-
htmlFor:
|
|
1110
|
+
}) : P({
|
|
1111
|
+
htmlFor: t,
|
|
870
1112
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
871
1113
|
}, [
|
|
872
|
-
g(
|
|
1114
|
+
g(d.upload),
|
|
873
1115
|
n("Upload logo")
|
|
874
1116
|
])
|
|
875
1117
|
)
|
|
@@ -877,22 +1119,22 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
877
1119
|
]);
|
|
878
1120
|
}
|
|
879
1121
|
}
|
|
880
|
-
),
|
|
1122
|
+
), Vt = (t, e) => V(
|
|
881
1123
|
{
|
|
882
|
-
href:
|
|
883
|
-
"aria-current":
|
|
1124
|
+
href: t,
|
|
1125
|
+
"aria-current": e === "Breadcrumb" && "page",
|
|
884
1126
|
// Only set aria-current on the last item
|
|
885
1127
|
class: "text-muted-foreground font-medium hover:text-foreground"
|
|
886
1128
|
},
|
|
887
|
-
[
|
|
888
|
-
),
|
|
1129
|
+
[l(e)]
|
|
1130
|
+
), Gt = () => g({
|
|
889
1131
|
class: "mx-3 text-muted-foreground",
|
|
890
1132
|
"aria-hidden": !0,
|
|
891
1133
|
size: "xs"
|
|
892
|
-
},
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
]),
|
|
1134
|
+
}, d.chevron.single.right), Wt = (t) => n({ class: "flex items-center" }, [
|
|
1135
|
+
t.href ? Vt(t.href, t.label) : l(t.label),
|
|
1136
|
+
t.separator && Gt()
|
|
1137
|
+
]), Xe = v(
|
|
896
1138
|
{
|
|
897
1139
|
/**
|
|
898
1140
|
* Set initial data
|
|
@@ -900,7 +1142,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
900
1142
|
* @returns {Data}
|
|
901
1143
|
*/
|
|
902
1144
|
setData() {
|
|
903
|
-
return new
|
|
1145
|
+
return new B({
|
|
904
1146
|
// @ts-ignore
|
|
905
1147
|
items: this.items || []
|
|
906
1148
|
});
|
|
@@ -911,8 +1153,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
911
1153
|
* @returns {object}
|
|
912
1154
|
*/
|
|
913
1155
|
render() {
|
|
914
|
-
const
|
|
915
|
-
return
|
|
1156
|
+
const t = this.data.items.length - 1;
|
|
1157
|
+
return ot(
|
|
916
1158
|
{
|
|
917
1159
|
"aria-label": "Breadcrumb",
|
|
918
1160
|
class: "flex items-center gap-x-1 text-sm"
|
|
@@ -921,17 +1163,17 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
921
1163
|
n({
|
|
922
1164
|
role: "list",
|
|
923
1165
|
class: "flex items-center",
|
|
924
|
-
for: ["items", (
|
|
925
|
-
href:
|
|
926
|
-
label:
|
|
927
|
-
separator: s <
|
|
1166
|
+
for: ["items", (e, s) => Wt({
|
|
1167
|
+
href: e.href,
|
|
1168
|
+
label: e.label,
|
|
1169
|
+
separator: s < t
|
|
928
1170
|
})]
|
|
929
1171
|
})
|
|
930
1172
|
]
|
|
931
1173
|
);
|
|
932
1174
|
}
|
|
933
1175
|
}
|
|
934
|
-
),
|
|
1176
|
+
), z = {
|
|
935
1177
|
xs: "h-1 w-1",
|
|
936
1178
|
sm: "h-2 w-2",
|
|
937
1179
|
md: "h-4 w-4",
|
|
@@ -940,21 +1182,21 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
940
1182
|
"2xl": "h-16 w-16",
|
|
941
1183
|
"3xl": "h-24 w-24",
|
|
942
1184
|
default: "h-4 w-4"
|
|
943
|
-
},
|
|
944
|
-
|
|
1185
|
+
}, _t = (t) => z[t] || z.default, Jt = ({ index: t, size: e }) => n({ class: `${e} rounded-full bg-muted cursor-pointer` }, [
|
|
1186
|
+
l({
|
|
945
1187
|
class: "block w-full h-full rounded-full transition-colors",
|
|
946
1188
|
onSet: ["activeIndex", {
|
|
947
|
-
"bg-primary":
|
|
948
|
-
"shadow-md":
|
|
1189
|
+
"bg-primary": t,
|
|
1190
|
+
"shadow-md": t
|
|
949
1191
|
}],
|
|
950
1192
|
click: (s, { data: o, onClick: r }) => {
|
|
951
|
-
o.activeIndex =
|
|
1193
|
+
o.activeIndex = t, r && r(t);
|
|
952
1194
|
}
|
|
953
1195
|
})
|
|
954
|
-
]),
|
|
1196
|
+
]), Kt = (t, e) => Array.from({ length: t }, (s, o) => Jt({
|
|
955
1197
|
index: o,
|
|
956
|
-
size:
|
|
957
|
-
})),
|
|
1198
|
+
size: e
|
|
1199
|
+
})), Ze = v(
|
|
958
1200
|
{
|
|
959
1201
|
/**
|
|
960
1202
|
* Defines component data (props).
|
|
@@ -962,7 +1204,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
962
1204
|
* @returns {Data}
|
|
963
1205
|
*/
|
|
964
1206
|
setData() {
|
|
965
|
-
return new
|
|
1207
|
+
return new B({
|
|
966
1208
|
// @ts-ignore
|
|
967
1209
|
count: this.count || 4,
|
|
968
1210
|
// total dots
|
|
@@ -976,46 +1218,46 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
976
1218
|
* @returns {object}
|
|
977
1219
|
*/
|
|
978
1220
|
render() {
|
|
979
|
-
const
|
|
1221
|
+
const t = this.gap || "gap-2", e = _t(this.size || "sm"), s = Kt(this.data.count, e);
|
|
980
1222
|
return n(
|
|
981
1223
|
{ class: "flex justify-center items-center py-2" },
|
|
982
1224
|
[
|
|
983
|
-
n({ class: `flex ${
|
|
1225
|
+
n({ class: `flex ${t}` }, s)
|
|
984
1226
|
]
|
|
985
1227
|
);
|
|
986
1228
|
}
|
|
987
1229
|
}
|
|
988
|
-
),
|
|
1230
|
+
), Qt = ({ toggleDropdown: t }) => m(
|
|
989
1231
|
{
|
|
990
1232
|
cache: "button",
|
|
991
1233
|
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",
|
|
992
|
-
click:
|
|
1234
|
+
click: t
|
|
993
1235
|
},
|
|
994
1236
|
[
|
|
995
|
-
|
|
996
|
-
x({ html:
|
|
1237
|
+
l({ onState: ["selectedLabel", (e) => e || "Select item..."] }),
|
|
1238
|
+
x({ html: d.chevron.upDown })
|
|
997
1239
|
]
|
|
998
|
-
),
|
|
1240
|
+
), Xt = (t, e, s) => H({
|
|
999
1241
|
class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
|
|
1000
|
-
click: () => t
|
|
1001
|
-
onState: [s, "selectedValue", { "bg-secondary":
|
|
1242
|
+
click: () => e(t),
|
|
1243
|
+
onState: [s, "selectedValue", { "bg-secondary": t.value }]
|
|
1002
1244
|
}, [
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
]),
|
|
1006
|
-
|
|
1007
|
-
]),
|
|
1008
|
-
|
|
1245
|
+
t.icon && l({ class: "mr-2 flex items-baseline" }, [g({ size: "xs" }, t.icon)]),
|
|
1246
|
+
l({ class: "text-base font-normal" }, t.label)
|
|
1247
|
+
]), Zt = (t, e) => n({ class: "w-full border rounded-md" }, [
|
|
1248
|
+
q({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) => Xt(s, t, e)] })
|
|
1249
|
+
]), te = ({ onSelect: t, state: e }) => n({ class: "flex flex-auto flex-col" }, [
|
|
1250
|
+
I(
|
|
1009
1251
|
"open",
|
|
1010
|
-
(s, o, r) => s ? new
|
|
1252
|
+
(s, o, r) => s ? new D({
|
|
1011
1253
|
cache: "dropdown",
|
|
1012
1254
|
parent: r,
|
|
1013
1255
|
button: r.button
|
|
1014
1256
|
}, [
|
|
1015
|
-
|
|
1257
|
+
Zt(t, e)
|
|
1016
1258
|
]) : null
|
|
1017
1259
|
)
|
|
1018
|
-
]),
|
|
1260
|
+
]), ts = v(
|
|
1019
1261
|
{
|
|
1020
1262
|
/**
|
|
1021
1263
|
* This will set up the data.
|
|
@@ -1023,7 +1265,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1023
1265
|
* @returns {Data}
|
|
1024
1266
|
*/
|
|
1025
1267
|
setData() {
|
|
1026
|
-
return new
|
|
1268
|
+
return new B({
|
|
1027
1269
|
// @ts-ignore
|
|
1028
1270
|
items: this.items || []
|
|
1029
1271
|
});
|
|
@@ -1046,9 +1288,9 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1046
1288
|
* @param {object} item
|
|
1047
1289
|
* @returns {void}
|
|
1048
1290
|
*/
|
|
1049
|
-
setStateItem(
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1291
|
+
setStateItem(t) {
|
|
1292
|
+
const e = this.state;
|
|
1293
|
+
e.selectedValue = t.value, e.selectedLabel = t.label, e.open = !1;
|
|
1052
1294
|
},
|
|
1053
1295
|
/**
|
|
1054
1296
|
* Handles the selection of an item.
|
|
@@ -1056,8 +1298,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1056
1298
|
* @param {object} item
|
|
1057
1299
|
* @returns {void}
|
|
1058
1300
|
*/
|
|
1059
|
-
select(
|
|
1060
|
-
this.setStateItem(
|
|
1301
|
+
select(t) {
|
|
1302
|
+
this.setStateItem(t), typeof this.onSelect == "function" && this.onSelect(t, this.parent);
|
|
1061
1303
|
},
|
|
1062
1304
|
/**
|
|
1063
1305
|
* Selects the first item in the list.
|
|
@@ -1065,8 +1307,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1065
1307
|
* @returns {void}
|
|
1066
1308
|
*/
|
|
1067
1309
|
selectFirstItem() {
|
|
1068
|
-
const
|
|
1069
|
-
this.select(
|
|
1310
|
+
const t = this.data.items[0];
|
|
1311
|
+
this.select(t);
|
|
1070
1312
|
},
|
|
1071
1313
|
/**
|
|
1072
1314
|
* Toggles the dropdown open state.
|
|
@@ -1083,8 +1325,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1083
1325
|
*/
|
|
1084
1326
|
after() {
|
|
1085
1327
|
if (this.selectFirst === !0 && this.state.selectedValue === "") {
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1328
|
+
const t = this.data.items[0];
|
|
1329
|
+
t && this.setStateItem(t);
|
|
1088
1330
|
}
|
|
1089
1331
|
},
|
|
1090
1332
|
/**
|
|
@@ -1093,11 +1335,11 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1093
1335
|
* @returns {object}
|
|
1094
1336
|
*/
|
|
1095
1337
|
render() {
|
|
1096
|
-
const
|
|
1097
|
-
return n({ class: `relative ${s} flex flex-auto flex-col ${
|
|
1338
|
+
const t = this.class || "", e = this.maxWidth || "max-w-[250px]", s = this.width || "w-full";
|
|
1339
|
+
return n({ class: `relative ${s} flex flex-auto flex-col ${e} ${t}` }, [
|
|
1098
1340
|
// @ts-ignore
|
|
1099
|
-
|
|
1100
|
-
|
|
1341
|
+
Qt({ toggleDropdown: this.toggleDropdown.bind(this) }),
|
|
1342
|
+
te({
|
|
1101
1343
|
// @ts-ignore
|
|
1102
1344
|
state: this.state,
|
|
1103
1345
|
// @ts-ignore
|
|
@@ -1117,34 +1359,34 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1117
1359
|
]);
|
|
1118
1360
|
}
|
|
1119
1361
|
}
|
|
1120
|
-
),
|
|
1362
|
+
), X = ({ icon: t, click: e, ariaLabel: s }) => h({
|
|
1121
1363
|
variant: "icon",
|
|
1122
1364
|
class: "flex flex-none",
|
|
1123
|
-
click: t,
|
|
1124
|
-
icon: e,
|
|
1125
|
-
"aria-label": s
|
|
1126
|
-
}), Ze = ({ click: e }) => Q({
|
|
1127
|
-
icon: u.circleMinus,
|
|
1128
1365
|
click: e,
|
|
1366
|
+
icon: t,
|
|
1367
|
+
"aria-label": s
|
|
1368
|
+
}), ee = ({ click: t }) => X({
|
|
1369
|
+
icon: d.circleMinus,
|
|
1370
|
+
click: t,
|
|
1129
1371
|
ariaLabel: "Decrement"
|
|
1130
|
-
}),
|
|
1131
|
-
icon:
|
|
1132
|
-
click:
|
|
1372
|
+
}), se = ({ click: t }) => X({
|
|
1373
|
+
icon: d.circlePlus,
|
|
1374
|
+
click: t,
|
|
1133
1375
|
ariaLabel: "Increment"
|
|
1134
|
-
}),
|
|
1376
|
+
}), oe = ({ bind: t, min: e, max: s, readonly: o = !1 }) => W(({ state: r }) => f({
|
|
1135
1377
|
value: ["[[count]]", r],
|
|
1136
|
-
bind:
|
|
1137
|
-
blur: (
|
|
1138
|
-
let
|
|
1139
|
-
isNaN(
|
|
1378
|
+
bind: t,
|
|
1379
|
+
blur: (i, { state: a }) => {
|
|
1380
|
+
let u = parseInt(i.target.value, 10);
|
|
1381
|
+
isNaN(u) && (u = e ?? 0), e !== void 0 && (u = Math.max(u, e)), s !== void 0 && (u = Math.min(u, s)), a.count = u;
|
|
1140
1382
|
},
|
|
1141
1383
|
class: "flex flex-auto text-lg font-medium bg-input text-center border min-w-0",
|
|
1142
1384
|
readonly: o,
|
|
1143
|
-
min:
|
|
1385
|
+
min: e,
|
|
1144
1386
|
max: s,
|
|
1145
1387
|
type: "number",
|
|
1146
1388
|
"aria-label": "Counter"
|
|
1147
|
-
})),
|
|
1389
|
+
})), es = C(
|
|
1148
1390
|
{
|
|
1149
1391
|
/**
|
|
1150
1392
|
* Initial state for the counter component.
|
|
@@ -1155,7 +1397,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1155
1397
|
return {
|
|
1156
1398
|
count: {
|
|
1157
1399
|
state: this.initialCount ?? 0,
|
|
1158
|
-
callBack: (
|
|
1400
|
+
callBack: (t) => this.change && this.change(t)
|
|
1159
1401
|
}
|
|
1160
1402
|
};
|
|
1161
1403
|
},
|
|
@@ -1165,70 +1407,70 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1165
1407
|
* @returns {object}
|
|
1166
1408
|
*/
|
|
1167
1409
|
render() {
|
|
1168
|
-
const
|
|
1169
|
-
return n({ class: `flex flex-auto items-center justify-between gap-x-4 p-4 ${
|
|
1170
|
-
|
|
1171
|
-
|
|
1410
|
+
const t = this.class ?? "";
|
|
1411
|
+
return n({ class: `flex flex-auto items-center justify-between gap-x-4 p-4 ${t}` }, [
|
|
1412
|
+
ee({ click: () => this.state.decrement("count") }),
|
|
1413
|
+
oe({
|
|
1172
1414
|
bind: this.bind,
|
|
1173
1415
|
readonly: this.readonly,
|
|
1174
1416
|
min: this.min,
|
|
1175
1417
|
max: this.max
|
|
1176
1418
|
}),
|
|
1177
|
-
|
|
1419
|
+
se({ click: () => this.state.increment("count") })
|
|
1178
1420
|
]);
|
|
1179
1421
|
}
|
|
1180
1422
|
}
|
|
1181
|
-
),
|
|
1182
|
-
let
|
|
1183
|
-
return
|
|
1184
|
-
},
|
|
1185
|
-
if (
|
|
1423
|
+
), ne = (t) => {
|
|
1424
|
+
let e = "";
|
|
1425
|
+
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;
|
|
1426
|
+
}, re = (t) => {
|
|
1427
|
+
if (t.length !== 8)
|
|
1186
1428
|
return null;
|
|
1187
|
-
const
|
|
1188
|
-
return
|
|
1189
|
-
},
|
|
1429
|
+
const e = parseInt(t.substring(0, 2), 10), s = parseInt(t.substring(2, 4), 10), o = parseInt(t.substring(4, 8), 10);
|
|
1430
|
+
return e >= 1 && e <= 12 && s >= 1 && s <= 31 && o >= 1900 ? `${o}-${e.toString().padStart(2, "0")}-${s.toString().padStart(2, "0")}` : null;
|
|
1431
|
+
}, ie = ({ bind: t, required: e }) => f({
|
|
1190
1432
|
cache: "input",
|
|
1191
1433
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1192
|
-
bind:
|
|
1193
|
-
required:
|
|
1194
|
-
}),
|
|
1434
|
+
bind: t,
|
|
1435
|
+
required: e
|
|
1436
|
+
}), ae = ({ placeholder: t, handleInputChange: e, handleInputFocus: s }) => f({
|
|
1195
1437
|
cache: "dateInput",
|
|
1196
1438
|
class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground border-0",
|
|
1197
|
-
placeholder:
|
|
1198
|
-
input:
|
|
1439
|
+
placeholder: t || "mm/dd/yyyy",
|
|
1440
|
+
input: e,
|
|
1199
1441
|
focus: s,
|
|
1200
|
-
onState: ["selectedDate", (o) => o ?
|
|
1201
|
-
}),
|
|
1442
|
+
onState: ["selectedDate", (o) => o ? M.format("standard", o) : ""]
|
|
1443
|
+
}), le = ({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleInputFocus: r, placeholder: i }) => n(
|
|
1202
1444
|
{
|
|
1203
1445
|
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"
|
|
1204
1446
|
},
|
|
1205
1447
|
[
|
|
1206
|
-
|
|
1207
|
-
|
|
1448
|
+
ie({ bind: t, required: e }),
|
|
1449
|
+
ae({ placeholder: i, handleInputChange: o, handleInputFocus: r }),
|
|
1208
1450
|
m(
|
|
1209
1451
|
{
|
|
1210
1452
|
class: "flex-shrink-0 hover:bg-muted/50 rounded p-1 cursor-pointer",
|
|
1211
1453
|
click: s
|
|
1212
1454
|
},
|
|
1213
1455
|
[
|
|
1214
|
-
x({ html:
|
|
1456
|
+
x({ html: d.calendar.days })
|
|
1215
1457
|
]
|
|
1216
1458
|
)
|
|
1217
1459
|
]
|
|
1218
|
-
),
|
|
1219
|
-
(s, o, r) => new
|
|
1460
|
+
), ce = ({ handleDateSelect: t, blockPriorDates: e }) => O(
|
|
1461
|
+
(s, o, r) => new D({
|
|
1220
1462
|
cache: "dropdown",
|
|
1221
1463
|
parent: r,
|
|
1222
1464
|
button: r.panel,
|
|
1223
1465
|
size: "fit"
|
|
1224
1466
|
}, [
|
|
1225
|
-
new
|
|
1467
|
+
new lt({
|
|
1226
1468
|
selectedDate: r.state.selectedDate,
|
|
1227
|
-
selectedCallBack:
|
|
1228
|
-
blockPriorDates:
|
|
1469
|
+
selectedCallBack: t,
|
|
1470
|
+
blockPriorDates: e
|
|
1229
1471
|
})
|
|
1230
1472
|
])
|
|
1231
|
-
),
|
|
1473
|
+
), ss = C(
|
|
1232
1474
|
{
|
|
1233
1475
|
/**
|
|
1234
1476
|
* The initial state of the DatePicker.
|
|
@@ -1255,10 +1497,10 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1255
1497
|
*
|
|
1256
1498
|
* @param {Event} e
|
|
1257
1499
|
*/
|
|
1258
|
-
handleInputChange(
|
|
1259
|
-
const s =
|
|
1260
|
-
|
|
1261
|
-
const o =
|
|
1500
|
+
handleInputChange(t) {
|
|
1501
|
+
const s = t.target.value.replace(/\D/g, "");
|
|
1502
|
+
t.target.value = ne(s);
|
|
1503
|
+
const o = re(s);
|
|
1262
1504
|
o && (this.state.selectedDate = o, this.input.value = o, p.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(o));
|
|
1263
1505
|
},
|
|
1264
1506
|
/**
|
|
@@ -1266,16 +1508,16 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1266
1508
|
*
|
|
1267
1509
|
* @param {Event} e
|
|
1268
1510
|
*/
|
|
1269
|
-
handleInputFocus(
|
|
1270
|
-
|
|
1511
|
+
handleInputFocus(t) {
|
|
1512
|
+
t.target.select();
|
|
1271
1513
|
},
|
|
1272
1514
|
/**
|
|
1273
1515
|
* Handles date selection from calendar.
|
|
1274
1516
|
*
|
|
1275
1517
|
* @param {string} date
|
|
1276
1518
|
*/
|
|
1277
|
-
handleDateSelect(
|
|
1278
|
-
this.state.selectedDate =
|
|
1519
|
+
handleDateSelect(t) {
|
|
1520
|
+
this.state.selectedDate = t, this.state.open = !1, this.input.value = t, p.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(t);
|
|
1279
1521
|
},
|
|
1280
1522
|
/**
|
|
1281
1523
|
* Toggles the calendar popover.
|
|
@@ -1283,8 +1525,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1283
1525
|
* @param {Event} e
|
|
1284
1526
|
* @param {object} context
|
|
1285
1527
|
*/
|
|
1286
|
-
toggleOpen(
|
|
1287
|
-
|
|
1528
|
+
toggleOpen(t, { state: e }) {
|
|
1529
|
+
e.toggle("open");
|
|
1288
1530
|
},
|
|
1289
1531
|
/**
|
|
1290
1532
|
* Renders the DatePicker component.
|
|
@@ -1295,7 +1537,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1295
1537
|
return n(
|
|
1296
1538
|
{ class: "relative w-full max-w-[320px]" },
|
|
1297
1539
|
[
|
|
1298
|
-
|
|
1540
|
+
le({
|
|
1299
1541
|
toggleOpen: this.toggleOpen.bind(this),
|
|
1300
1542
|
bind: this.bind,
|
|
1301
1543
|
required: this.required,
|
|
@@ -1303,7 +1545,7 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1303
1545
|
handleInputFocus: this.handleInputFocus.bind(this),
|
|
1304
1546
|
placeholder: this.placeholder
|
|
1305
1547
|
}),
|
|
1306
|
-
|
|
1548
|
+
ce({
|
|
1307
1549
|
handleDateSelect: this.handleDateSelect.bind(this),
|
|
1308
1550
|
blockPriorDates: this.blockPriorDates || !1
|
|
1309
1551
|
})
|
|
@@ -1311,35 +1553,35 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1311
1553
|
);
|
|
1312
1554
|
}
|
|
1313
1555
|
}
|
|
1314
|
-
),
|
|
1556
|
+
), de = ({ bind: t, required: e }) => f({
|
|
1315
1557
|
cache: "input",
|
|
1316
1558
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1317
|
-
bind:
|
|
1318
|
-
required:
|
|
1319
|
-
}),
|
|
1559
|
+
bind: t,
|
|
1560
|
+
required: e
|
|
1561
|
+
}), ue = ({ bind: t, required: e, toggleOpen: s }) => m({
|
|
1320
1562
|
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",
|
|
1321
1563
|
click: s
|
|
1322
1564
|
}, [
|
|
1323
|
-
|
|
1565
|
+
de({ bind: t, required: e }),
|
|
1324
1566
|
W(({ state: o }) => [
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1567
|
+
l(Y.date(["[[start]]", o], "Start Date")),
|
|
1568
|
+
l(" - "),
|
|
1569
|
+
l(Y.date(["[[end]]", o], "End Date"))
|
|
1328
1570
|
]),
|
|
1329
|
-
x({ html:
|
|
1330
|
-
]),
|
|
1571
|
+
x({ html: d.calendar.days })
|
|
1572
|
+
]), he = ({ handleDateSelect: t, blockPriorDates: e }) => O((s, o, r) => new D({
|
|
1331
1573
|
cache: "dropdown",
|
|
1332
1574
|
parent: r,
|
|
1333
1575
|
button: r.panel,
|
|
1334
1576
|
size: "xl"
|
|
1335
1577
|
}, [
|
|
1336
|
-
new
|
|
1578
|
+
new ct({
|
|
1337
1579
|
startDate: r.state.start,
|
|
1338
1580
|
endDate: r.state.end,
|
|
1339
|
-
onRangeSelect:
|
|
1340
|
-
blockPriorDates:
|
|
1581
|
+
onRangeSelect: t,
|
|
1582
|
+
blockPriorDates: e
|
|
1341
1583
|
})
|
|
1342
|
-
])),
|
|
1584
|
+
])), os = C(
|
|
1343
1585
|
{
|
|
1344
1586
|
/**
|
|
1345
1587
|
* The initial state of the DateRangePicker.
|
|
@@ -1361,8 +1603,8 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1361
1603
|
*/
|
|
1362
1604
|
after() {
|
|
1363
1605
|
if (this.input.value) {
|
|
1364
|
-
const
|
|
1365
|
-
this.state.start =
|
|
1606
|
+
const t = this.input.value.split("-");
|
|
1607
|
+
this.state.start = t[0], this.state.end = t[1];
|
|
1366
1608
|
}
|
|
1367
1609
|
},
|
|
1368
1610
|
/**
|
|
@@ -1371,104 +1613,104 @@ const N = globalThis.matchMedia, $ = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1371
1613
|
* @returns {object}
|
|
1372
1614
|
*/
|
|
1373
1615
|
render() {
|
|
1374
|
-
const
|
|
1616
|
+
const t = (s, { state: o }) => o.toggle("open"), e = (s, o) => {
|
|
1375
1617
|
this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`, p.trigger("change", this.input), typeof this.onChange == "function" && this.onChange({ start: s, end: o }, this.parent);
|
|
1376
1618
|
};
|
|
1377
1619
|
return n({ class: "relative w-full max-w-[320px]" }, [
|
|
1378
|
-
|
|
1379
|
-
toggleOpen:
|
|
1620
|
+
ue({
|
|
1621
|
+
toggleOpen: t,
|
|
1380
1622
|
bind: this.bind,
|
|
1381
1623
|
required: this.required
|
|
1382
1624
|
}),
|
|
1383
|
-
|
|
1384
|
-
handleDateSelect:
|
|
1625
|
+
he({
|
|
1626
|
+
handleDateSelect: e,
|
|
1385
1627
|
blockPriorDates: this.blockPriorDates || !1
|
|
1386
1628
|
})
|
|
1387
1629
|
]);
|
|
1388
1630
|
}
|
|
1389
1631
|
}
|
|
1390
|
-
),
|
|
1391
|
-
new
|
|
1392
|
-
dateTime:
|
|
1632
|
+
), ns = ({ dateTime: t = "", remoteTimeZone: e = "America/Denver", filter: s = null }) => nt([
|
|
1633
|
+
new mt({
|
|
1634
|
+
dateTime: t,
|
|
1393
1635
|
filter: s || ((o) => {
|
|
1394
|
-
const r =
|
|
1395
|
-
return
|
|
1636
|
+
const r = M.getLocalTime(o, !0, !1, e);
|
|
1637
|
+
return M.getTimeFrame(r);
|
|
1396
1638
|
})
|
|
1397
1639
|
})
|
|
1398
1640
|
]);
|
|
1399
|
-
function
|
|
1400
|
-
let
|
|
1401
|
-
return
|
|
1641
|
+
function fe(t) {
|
|
1642
|
+
let e = "";
|
|
1643
|
+
return t.length > 0 && (e = t.substring(0, 2), t.length > 2 && (e += ":" + t.substring(2, 4))), e;
|
|
1402
1644
|
}
|
|
1403
|
-
function
|
|
1404
|
-
if (
|
|
1645
|
+
function me(t) {
|
|
1646
|
+
if (t.length < 4)
|
|
1405
1647
|
return { formattedTime: null, hour: null, minute: null, meridian: null };
|
|
1406
|
-
const
|
|
1407
|
-
if (
|
|
1648
|
+
const e = parseInt(t.substring(0, 2), 10), s = parseInt(t.substring(2, 4), 10);
|
|
1649
|
+
if (e < 0 || e > 23 || s < 0 || s > 59)
|
|
1408
1650
|
return { formattedTime: null, hour: null, minute: null, meridian: null };
|
|
1409
|
-
let o =
|
|
1410
|
-
return
|
|
1651
|
+
let o = e, r = "AM";
|
|
1652
|
+
return e === 0 ? o = 12 : e > 12 ? (o = e - 12, r = "PM") : e === 12 && (r = "PM"), {
|
|
1411
1653
|
formattedTime: `${o.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")} ${r}`,
|
|
1412
1654
|
hour: o.toString().padStart(2, "0"),
|
|
1413
1655
|
minute: s.toString().padStart(2, "0"),
|
|
1414
1656
|
meridian: r
|
|
1415
1657
|
};
|
|
1416
1658
|
}
|
|
1417
|
-
function
|
|
1659
|
+
function ge({ bind: t, required: e }) {
|
|
1418
1660
|
return f({
|
|
1419
1661
|
cache: "input",
|
|
1420
1662
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1421
|
-
bind:
|
|
1422
|
-
required:
|
|
1663
|
+
bind: t,
|
|
1664
|
+
required: e
|
|
1423
1665
|
});
|
|
1424
1666
|
}
|
|
1425
|
-
function
|
|
1667
|
+
function pe({ placeholder: t, handleInputChange: e, handleInputFocus: s }) {
|
|
1426
1668
|
return f({
|
|
1427
1669
|
cache: "timeInput",
|
|
1428
1670
|
class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground border-0",
|
|
1429
|
-
placeholder:
|
|
1430
|
-
input:
|
|
1671
|
+
placeholder: t || "hh:mm AM/PM",
|
|
1672
|
+
input: e,
|
|
1431
1673
|
focus: s,
|
|
1432
1674
|
onState: ["selectedTime", (o) => o || ""]
|
|
1433
1675
|
});
|
|
1434
1676
|
}
|
|
1435
|
-
function
|
|
1677
|
+
function be({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleInputFocus: r, placeholder: i }) {
|
|
1436
1678
|
return n(
|
|
1437
1679
|
{
|
|
1438
1680
|
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"
|
|
1439
1681
|
},
|
|
1440
1682
|
[
|
|
1441
|
-
|
|
1442
|
-
|
|
1683
|
+
ge({ bind: t, required: e }),
|
|
1684
|
+
pe({ placeholder: i, handleInputChange: o, handleInputFocus: r }),
|
|
1443
1685
|
m(
|
|
1444
1686
|
{
|
|
1445
1687
|
class: "flex-shrink-0 hover:bg-muted/50 rounded p-1 cursor-pointer",
|
|
1446
1688
|
click: s
|
|
1447
1689
|
},
|
|
1448
1690
|
[
|
|
1449
|
-
x({ html:
|
|
1691
|
+
x({ html: d.clock })
|
|
1450
1692
|
]
|
|
1451
1693
|
)
|
|
1452
1694
|
]
|
|
1453
1695
|
);
|
|
1454
1696
|
}
|
|
1455
|
-
function
|
|
1697
|
+
function $({ items: t, handleTimeSelect: e, state: s, stateValue: o, pad: r = !1 }) {
|
|
1456
1698
|
return n(
|
|
1457
1699
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1458
|
-
|
|
1459
|
-
let
|
|
1700
|
+
t.map((i) => {
|
|
1701
|
+
let a = r ? i.toString().padStart(2, "0") : i.toString();
|
|
1460
1702
|
return m({
|
|
1461
|
-
text:
|
|
1703
|
+
text: a,
|
|
1462
1704
|
class: "hover:bg-muted/50 rounded-md pr-2 py-1",
|
|
1463
|
-
click: () =>
|
|
1464
|
-
onState: [s, o, { "bg-muted":
|
|
1705
|
+
click: () => e({ [o]: a }),
|
|
1706
|
+
onState: [s, o, { "bg-muted": a }]
|
|
1465
1707
|
});
|
|
1466
1708
|
})
|
|
1467
1709
|
);
|
|
1468
1710
|
}
|
|
1469
|
-
function
|
|
1470
|
-
return
|
|
1471
|
-
(
|
|
1711
|
+
function xe({ handleTimeSelect: t }) {
|
|
1712
|
+
return O(
|
|
1713
|
+
(e, s, o) => new D(
|
|
1472
1714
|
{
|
|
1473
1715
|
cache: "dropdown",
|
|
1474
1716
|
parent: o,
|
|
@@ -1483,25 +1725,25 @@ function pt({ handleTimeSelect: e }) {
|
|
|
1483
1725
|
{ class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
|
|
1484
1726
|
[
|
|
1485
1727
|
// Hours column
|
|
1486
|
-
|
|
1487
|
-
items: Array.from({ length: 12 }, (r,
|
|
1488
|
-
handleTimeSelect:
|
|
1728
|
+
$({
|
|
1729
|
+
items: Array.from({ length: 12 }, (r, i) => i + 1),
|
|
1730
|
+
handleTimeSelect: t,
|
|
1489
1731
|
state: o.state,
|
|
1490
1732
|
stateValue: "hour",
|
|
1491
1733
|
pad: !0
|
|
1492
1734
|
}),
|
|
1493
1735
|
// Minutes column
|
|
1494
|
-
|
|
1495
|
-
items: Array.from({ length: 60 }, (r,
|
|
1496
|
-
handleTimeSelect:
|
|
1736
|
+
$({
|
|
1737
|
+
items: Array.from({ length: 60 }, (r, i) => i),
|
|
1738
|
+
handleTimeSelect: t,
|
|
1497
1739
|
state: o.state,
|
|
1498
1740
|
stateValue: "minute",
|
|
1499
1741
|
pad: !0
|
|
1500
1742
|
}),
|
|
1501
1743
|
// AM/PM column
|
|
1502
|
-
|
|
1744
|
+
$({
|
|
1503
1745
|
items: ["AM", "PM"],
|
|
1504
|
-
handleTimeSelect:
|
|
1746
|
+
handleTimeSelect: t,
|
|
1505
1747
|
state: o.state,
|
|
1506
1748
|
stateValue: "meridian"
|
|
1507
1749
|
})
|
|
@@ -1513,20 +1755,20 @@ function pt({ handleTimeSelect: e }) {
|
|
|
1513
1755
|
)
|
|
1514
1756
|
);
|
|
1515
1757
|
}
|
|
1516
|
-
function
|
|
1517
|
-
if (!
|
|
1758
|
+
function U(t) {
|
|
1759
|
+
if (!t)
|
|
1518
1760
|
return { hour: null, minute: null, meridian: null };
|
|
1519
|
-
const
|
|
1761
|
+
const e = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = t.match(e);
|
|
1520
1762
|
if (!s)
|
|
1521
1763
|
return { hour: null, minute: null, meridian: null };
|
|
1522
|
-
let [, o, r, ,
|
|
1523
|
-
return
|
|
1524
|
-
hour:
|
|
1525
|
-
minute:
|
|
1526
|
-
meridian:
|
|
1764
|
+
let [, o, r, , i] = s, a = parseInt(o, 10), u = parseInt(r, 10);
|
|
1765
|
+
return a < 0 || a > 23 || u < 0 || u > 59 ? { hour: null, minute: null, meridian: null } : (i ? (i = i.toUpperCase(), i === "PM" && a < 12 ? a += 12 : i === "AM" && a === 12 && (a = 12)) : a === 0 ? (i = "AM", a = 12) : a < 12 ? i = "AM" : a === 12 ? i = "PM" : (i = "PM", a -= 12), {
|
|
1766
|
+
hour: a.toString().padStart(2, "0"),
|
|
1767
|
+
minute: u.toString().padStart(2, "0"),
|
|
1768
|
+
meridian: i
|
|
1527
1769
|
});
|
|
1528
1770
|
}
|
|
1529
|
-
const
|
|
1771
|
+
const rs = C(
|
|
1530
1772
|
{
|
|
1531
1773
|
/**
|
|
1532
1774
|
* The initial shallow state of the TimePicker.
|
|
@@ -1534,11 +1776,11 @@ const os = C(
|
|
|
1534
1776
|
* @member {object} state
|
|
1535
1777
|
*/
|
|
1536
1778
|
state() {
|
|
1537
|
-
const
|
|
1779
|
+
const t = this.selectedTime ?? null, { hour: e, minute: s, meridian: o } = U(t);
|
|
1538
1780
|
return {
|
|
1539
|
-
selectedTime:
|
|
1781
|
+
selectedTime: t,
|
|
1540
1782
|
open: !1,
|
|
1541
|
-
hour:
|
|
1783
|
+
hour: e,
|
|
1542
1784
|
minute: s,
|
|
1543
1785
|
meridian: o
|
|
1544
1786
|
};
|
|
@@ -1550,10 +1792,10 @@ const os = C(
|
|
|
1550
1792
|
*/
|
|
1551
1793
|
after() {
|
|
1552
1794
|
if (this.input.value) {
|
|
1553
|
-
const { hour:
|
|
1795
|
+
const { hour: t, minute: e, meridian: s } = U(this.input.value);
|
|
1554
1796
|
this.state.set({
|
|
1555
|
-
hour:
|
|
1556
|
-
minute:
|
|
1797
|
+
hour: t,
|
|
1798
|
+
minute: e,
|
|
1557
1799
|
meridian: s,
|
|
1558
1800
|
selectedTime: this.input.value
|
|
1559
1801
|
});
|
|
@@ -1565,39 +1807,39 @@ const os = C(
|
|
|
1565
1807
|
* @param {Event} e
|
|
1566
1808
|
* @param {object} context
|
|
1567
1809
|
*/
|
|
1568
|
-
toggleOpen(
|
|
1569
|
-
|
|
1810
|
+
toggleOpen(t, { state: e }) {
|
|
1811
|
+
e.toggle("open");
|
|
1570
1812
|
},
|
|
1571
1813
|
/**
|
|
1572
1814
|
* Handles direct input changes and formats the time.
|
|
1573
1815
|
*
|
|
1574
1816
|
* @param {Event} e
|
|
1575
1817
|
*/
|
|
1576
|
-
handleInputChange(
|
|
1577
|
-
let
|
|
1578
|
-
const o =
|
|
1818
|
+
handleInputChange(t) {
|
|
1819
|
+
let e = t.target.value.replace(/[^\d]/g, ""), s = fe(e);
|
|
1820
|
+
const o = me(e);
|
|
1579
1821
|
o.formattedTime && (s = o.formattedTime, this.state.set({
|
|
1580
1822
|
hour: o.hour,
|
|
1581
1823
|
minute: o.minute,
|
|
1582
1824
|
meridian: o.meridian,
|
|
1583
1825
|
selectedTime: o.formattedTime
|
|
1584
|
-
}), this.input.value = o.formattedTime, p.trigger("change", this.input), typeof this.change == "function" && this.change(o.formattedTime)),
|
|
1826
|
+
}), this.input.value = o.formattedTime, p.trigger("change", this.input), typeof this.change == "function" && this.change(o.formattedTime)), t.target.value = s;
|
|
1585
1827
|
},
|
|
1586
1828
|
/**
|
|
1587
1829
|
* Handles input focus - select all text for easy editing.
|
|
1588
1830
|
*
|
|
1589
1831
|
* @param {Event} e
|
|
1590
1832
|
*/
|
|
1591
|
-
handleInputFocus(
|
|
1592
|
-
|
|
1833
|
+
handleInputFocus(t) {
|
|
1834
|
+
t.target.select();
|
|
1593
1835
|
},
|
|
1594
1836
|
/**
|
|
1595
1837
|
* Handles time selection from the picker columns.
|
|
1596
1838
|
*
|
|
1597
1839
|
* @param {object} params
|
|
1598
1840
|
*/
|
|
1599
|
-
handleTimeSelect({ hour:
|
|
1600
|
-
if (
|
|
1841
|
+
handleTimeSelect({ hour: t, minute: e, meridian: s }) {
|
|
1842
|
+
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) {
|
|
1601
1843
|
const o = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1602
1844
|
this.state.selectedTime = o, this.state.open = !1, this.input.value = o, p.trigger("change", this.input), typeof this.change == "function" && this.change(o);
|
|
1603
1845
|
}
|
|
@@ -1611,7 +1853,7 @@ const os = C(
|
|
|
1611
1853
|
return n(
|
|
1612
1854
|
{ class: "relative w-full max-w-[320px]" },
|
|
1613
1855
|
[
|
|
1614
|
-
|
|
1856
|
+
be({
|
|
1615
1857
|
toggleOpen: this.toggleOpen.bind(this),
|
|
1616
1858
|
bind: this.bind,
|
|
1617
1859
|
required: this.required,
|
|
@@ -1619,40 +1861,40 @@ const os = C(
|
|
|
1619
1861
|
handleInputFocus: this.handleInputFocus.bind(this),
|
|
1620
1862
|
placeholder: this.placeholder
|
|
1621
1863
|
}),
|
|
1622
|
-
|
|
1864
|
+
xe({
|
|
1623
1865
|
handleTimeSelect: this.handleTimeSelect.bind(this)
|
|
1624
1866
|
})
|
|
1625
1867
|
]
|
|
1626
1868
|
);
|
|
1627
1869
|
}
|
|
1628
1870
|
}
|
|
1629
|
-
),
|
|
1630
|
-
g({ size: "lg" },
|
|
1631
|
-
]),
|
|
1632
|
-
S({ class: "text-lg font-semibold" },
|
|
1633
|
-
]),
|
|
1871
|
+
), ye = (t, e) => n({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${e}` }, [
|
|
1872
|
+
g({ size: "lg" }, t)
|
|
1873
|
+
]), we = ({ title: t }) => T({ class: "flex flex-auto items-center" }, [
|
|
1874
|
+
S({ class: "text-lg font-semibold" }, t)
|
|
1875
|
+
]), ve = c((t, e) => rt(
|
|
1634
1876
|
{
|
|
1635
1877
|
class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
|
|
1636
1878
|
rounded-lg flex flex-auto flex-col
|
|
1637
|
-
bottom-4 top-auto inset-auto m-auto md:bottom-0 md:top-0 left-0 right-0 ${
|
|
1638
|
-
click:
|
|
1879
|
+
bottom-4 top-auto inset-auto m-auto md:bottom-0 md:top-0 left-0 right-0 ${t.class}`,
|
|
1880
|
+
click: t.click,
|
|
1639
1881
|
aria: { expanded: ["open"] }
|
|
1640
1882
|
},
|
|
1641
1883
|
[
|
|
1642
1884
|
n({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
|
|
1643
1885
|
// Icon and content
|
|
1644
|
-
|
|
1886
|
+
t.icon && ye(t.icon, t.iconColor),
|
|
1645
1887
|
n({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1646
1888
|
n({ class: "flex flex-auto flex-col gap-y-2" }, [
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
n({ class: "flex flex-auto flex-col text-sm text-muted-foreground" },
|
|
1889
|
+
we(t),
|
|
1890
|
+
t.description && b({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t.description),
|
|
1891
|
+
n({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e)
|
|
1650
1892
|
]),
|
|
1651
|
-
|
|
1893
|
+
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)
|
|
1652
1894
|
])
|
|
1653
1895
|
])
|
|
1654
1896
|
]
|
|
1655
|
-
)),
|
|
1897
|
+
)), Ce = (t) => _.render(t, app.root), R = {
|
|
1656
1898
|
info: {
|
|
1657
1899
|
borderColor: "border-blue-500",
|
|
1658
1900
|
bgColor: "bg-muted/10",
|
|
@@ -1679,7 +1921,7 @@ const os = C(
|
|
|
1679
1921
|
iconColor: "text-muted-foreground"
|
|
1680
1922
|
}
|
|
1681
1923
|
};
|
|
1682
|
-
class
|
|
1924
|
+
class Se extends w {
|
|
1683
1925
|
/**
|
|
1684
1926
|
* This will declare the props for the compiler.
|
|
1685
1927
|
*
|
|
@@ -1694,13 +1936,13 @@ class wt extends y {
|
|
|
1694
1936
|
* @returns {object}
|
|
1695
1937
|
*/
|
|
1696
1938
|
render() {
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1699
|
-
}, { borderColor: s, bgColor: o, iconColor: r } =
|
|
1700
|
-
return
|
|
1701
|
-
class:
|
|
1702
|
-
title:
|
|
1703
|
-
click:
|
|
1939
|
+
const e = (u) => {
|
|
1940
|
+
u.target === this.panel && this.close();
|
|
1941
|
+
}, { borderColor: s, bgColor: o, iconColor: r } = R[this.type] || R.default, i = `${this.getMainClass()} ${o} ${s}`, a = this.title || "Dialog Title";
|
|
1942
|
+
return ve({
|
|
1943
|
+
class: i,
|
|
1944
|
+
title: a,
|
|
1945
|
+
click: e,
|
|
1704
1946
|
icon: this.icon,
|
|
1705
1947
|
iconColor: r,
|
|
1706
1948
|
description: this.description,
|
|
@@ -1741,7 +1983,7 @@ class wt extends y {
|
|
|
1741
1983
|
* @returns {void}
|
|
1742
1984
|
*/
|
|
1743
1985
|
open() {
|
|
1744
|
-
|
|
1986
|
+
Ce(this), this.panel.showModal(), this.state.open = !0;
|
|
1745
1987
|
}
|
|
1746
1988
|
/**
|
|
1747
1989
|
* This will close the modal.
|
|
@@ -1752,7 +1994,7 @@ class wt extends y {
|
|
|
1752
1994
|
this.state.open = !1, this.panel.close(), typeof this.onClose == "function" && this.onClose(), this.destroy();
|
|
1753
1995
|
}
|
|
1754
1996
|
}
|
|
1755
|
-
class
|
|
1997
|
+
class is extends Se {
|
|
1756
1998
|
/**
|
|
1757
1999
|
* This will declare the props for the compiler.
|
|
1758
2000
|
*
|
|
@@ -1767,10 +2009,10 @@ class ns extends wt {
|
|
|
1767
2009
|
* @returns {array}
|
|
1768
2010
|
*/
|
|
1769
2011
|
getButtons() {
|
|
1770
|
-
const
|
|
2012
|
+
const e = this.confirmTextLabel || "Confirm";
|
|
1771
2013
|
return [
|
|
1772
2014
|
h({ variant: "outline", click: () => this.close() }, "Cancel"),
|
|
1773
|
-
h({ variant: "primary", click: () => this.confirm() },
|
|
2015
|
+
h({ variant: "primary", click: () => this.confirm() }, e)
|
|
1774
2016
|
];
|
|
1775
2017
|
}
|
|
1776
2018
|
/**
|
|
@@ -1782,67 +2024,68 @@ class ns extends wt {
|
|
|
1782
2024
|
this.confirmed && this.confirmed(), this.close();
|
|
1783
2025
|
}
|
|
1784
2026
|
}
|
|
1785
|
-
const
|
|
2027
|
+
const as = c((t, e = []) => n({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
1786
2028
|
K({ class: "flex flex-auto flex-col" }, [
|
|
1787
2029
|
n({ class: "flex flex-auto flex-col gap-y-4" }, [
|
|
1788
2030
|
n({ class: "flex flex-auto items-center justify-center" }, [
|
|
1789
|
-
|
|
1790
|
-
g(
|
|
2031
|
+
t.icon && n({ class: "w-16 h-16 mb-2 text-primary" }, [
|
|
2032
|
+
g(t.icon)
|
|
1791
2033
|
])
|
|
1792
2034
|
]),
|
|
1793
|
-
|
|
1794
|
-
S({ class: "text-xl font-bold" },
|
|
1795
|
-
b({ class: "pb-8 text-muted-foreground" },
|
|
1796
|
-
...
|
|
2035
|
+
T({ class: "py-4 text-center" }, [
|
|
2036
|
+
S({ class: "text-xl font-bold" }, t.title),
|
|
2037
|
+
b({ class: "pb-8 text-muted-foreground" }, t.description || ""),
|
|
2038
|
+
...e
|
|
1797
2039
|
])
|
|
1798
2040
|
])
|
|
1799
2041
|
])
|
|
1800
2042
|
]));
|
|
1801
2043
|
export {
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
2044
|
+
Le as A,
|
|
2045
|
+
Xe as B,
|
|
2046
|
+
He as C,
|
|
2047
|
+
Oe as D,
|
|
1806
2048
|
es as E,
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
2049
|
+
It as F,
|
|
2050
|
+
ss as G,
|
|
2051
|
+
os as H,
|
|
2052
|
+
Ke as I,
|
|
2053
|
+
ns as J,
|
|
2054
|
+
rs as K,
|
|
2055
|
+
Qe as L,
|
|
2056
|
+
Yt as M,
|
|
2057
|
+
Ve as N,
|
|
2058
|
+
is as O,
|
|
2059
|
+
se as P,
|
|
2060
|
+
ve as Q,
|
|
2061
|
+
Se as R,
|
|
2062
|
+
Re as S,
|
|
2063
|
+
Ge as T,
|
|
2064
|
+
as as U,
|
|
2065
|
+
vt as a,
|
|
2066
|
+
Ae as b,
|
|
2067
|
+
St as c,
|
|
2068
|
+
Tt as d,
|
|
2069
|
+
Bt as e,
|
|
2070
|
+
Ft as f,
|
|
2071
|
+
Ye as g,
|
|
2072
|
+
je as h,
|
|
2073
|
+
Ee as i,
|
|
2074
|
+
Mt as j,
|
|
2075
|
+
Ne as k,
|
|
1833
2076
|
K as l,
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
2077
|
+
ze as m,
|
|
2078
|
+
Ue as n,
|
|
2079
|
+
qe as o,
|
|
2080
|
+
zt as p,
|
|
2081
|
+
We as q,
|
|
2082
|
+
_e as r,
|
|
2083
|
+
Je as s,
|
|
2084
|
+
k as t,
|
|
2085
|
+
y as u,
|
|
2086
|
+
Ht as v,
|
|
2087
|
+
Ze as w,
|
|
2088
|
+
ts as x,
|
|
2089
|
+
ee as y,
|
|
2090
|
+
oe as z
|
|
1848
2091
|
};
|