@base-framework/ui 0.0.10 → 0.0.12
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 +3 -3
- package/dist/{confirmation-BGUg268I.js → confirmation-CYHsLIOn.js} +389 -505
- package/dist/index.es.js +5 -5
- package/dist/{inputs-BF3C3KfF.js → inputs-O_WkdbI3.js} +1 -1
- package/dist/molecules.es.js +1 -1
- package/dist/organisms.es.js +1 -1
- package/dist/{tab-BGR7fWvY.js → tab-BjiQGl_0.js} +1 -1
- package/dist/{tooltip-DCszmsxe.js → tooltip-8F0AEnxf.js} +2 -2
- package/dist/types/components/atoms/veil.d.ts +4 -17
- package/dist/veil-DSQdR6CM.js +30 -0
- package/package.json +1 -1
- package/dist/veil-B9GQfH0d.js +0 -29
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { a as w } from "./veil-B9GQfH0d.js";
|
|
10
|
-
import { Timer as re, List as ae, DynamicTime as ie } from "@base-framework/organisms";
|
|
11
|
-
const z = {
|
|
1
|
+
import { Div as n, I as h, H5 as _, P as p, Li as O, Span as a, Ul as V, Button as m, OnState as y, Label as R, Form as W, H2 as B, Footer as $, Header as M, A as Y, H3 as G, Checkbox as J, Nav as K, Input as v, Time as Q, Dialog as X } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as c, Component as b, Html as L, Dom as Z, base as ee, Data as C, Builder as q, Jot as k, DateTime as A } from "@base-framework/base";
|
|
3
|
+
import { P as S, b as te } from "./calendar-B5TK6tLi.js";
|
|
4
|
+
import { B as u, I as D } from "./icon-B9QUT2NY.js";
|
|
5
|
+
import { Icons as d } from "./icons.es.js";
|
|
6
|
+
import { a as x } from "./veil-DSQdR6CM.js";
|
|
7
|
+
import { Timer as se, List as oe, DynamicTime as ne } from "@base-framework/organisms";
|
|
8
|
+
const P = {
|
|
12
9
|
info: {
|
|
13
10
|
borderColor: "border-blue-500",
|
|
14
11
|
bgColor: "bg-muted/10",
|
|
@@ -34,27 +31,27 @@ const z = {
|
|
|
34
31
|
bgColor: "bg-muted/10",
|
|
35
32
|
iconColor: "text-muted-foreground"
|
|
36
33
|
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
]),
|
|
40
|
-
const { borderColor:
|
|
41
|
-
return n({ class: `flex items-start p-4 border rounded-lg ${
|
|
34
|
+
}, re = (e, t) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
|
|
35
|
+
h({ html: e })
|
|
36
|
+
]), le = (e) => _({ class: "font-semibold" }, e), ie = (e) => p({ class: "text-sm text-muted-foreground" }, e), ht = c(({ title: e, description: t, icon: s, type: o = "default" }) => {
|
|
37
|
+
const { borderColor: l, bgColor: r, iconColor: i } = P[o] || P.default;
|
|
38
|
+
return n({ class: `flex items-start p-4 border rounded-lg ${r} ${l}` }, [
|
|
42
39
|
// Icon and content
|
|
43
|
-
|
|
40
|
+
s && re(s, i),
|
|
44
41
|
n({ class: "flex flex-col" }, [
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
le(e),
|
|
43
|
+
ie(t)
|
|
47
44
|
])
|
|
48
45
|
]);
|
|
49
46
|
});
|
|
50
|
-
class
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
class ae extends b {
|
|
48
|
+
/**
|
|
49
|
+
* This will declare the props for the compiler.
|
|
50
|
+
*
|
|
51
|
+
* @returns {void}
|
|
52
|
+
*/
|
|
53
|
+
declareProps() {
|
|
54
|
+
this.removingClass = "";
|
|
58
55
|
}
|
|
59
56
|
/**
|
|
60
57
|
* This will remove the component from the DOM after a delay.
|
|
@@ -63,69 +60,57 @@ class me extends x {
|
|
|
63
60
|
*/
|
|
64
61
|
remove() {
|
|
65
62
|
this.prepareDestroy(), this.removeContext();
|
|
66
|
-
const
|
|
63
|
+
const t = this.panel, s = this.removingClass;
|
|
67
64
|
if (!s) {
|
|
68
|
-
|
|
65
|
+
L.removeElement(t);
|
|
69
66
|
return;
|
|
70
67
|
}
|
|
71
|
-
|
|
68
|
+
Z.addClass(t, s), ee.on("animationend", t, (o) => L.removeElement(t));
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
|
-
const
|
|
71
|
+
const ce = (e) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, e), de = (e) => a({ class: "flex w-4 h-4", html: e }), ue = (e) => a({ class: "flex-auto" }, e), he = (e, t) => O({
|
|
75
72
|
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",
|
|
76
73
|
click: () => t(e)
|
|
77
74
|
}, [
|
|
78
|
-
e.icon &&
|
|
79
|
-
|
|
80
|
-
e.shortcut &&
|
|
81
|
-
]),
|
|
82
|
-
e.map((
|
|
83
|
-
]),
|
|
75
|
+
e.icon && de(e.icon),
|
|
76
|
+
ue(e.label),
|
|
77
|
+
e.shortcut && ce(e.shortcut)
|
|
78
|
+
]), me = (e, t) => V({ class: "grid gap-2" }, [
|
|
79
|
+
e.map((s) => he(s, t))
|
|
80
|
+
]), fe = (e) => n({ class: "w-full z-10" }, [
|
|
84
81
|
n({
|
|
85
82
|
class: "max-h-60 border rounded-md overflow-y-auto p-1 grid gap-2 divide-y divide-border",
|
|
86
|
-
for: ["groups", (t) =>
|
|
83
|
+
for: ["groups", (t) => me(t, e)]
|
|
87
84
|
})
|
|
88
|
-
]),
|
|
85
|
+
]), ge = ({ label: e, icon: t, toggleDropdown: s }) => m({
|
|
89
86
|
cache: "button",
|
|
90
87
|
class: `inline-flex items-center justify-between rounded-md border border-input
|
|
91
88
|
bg-background px-2 py-2 text-sm font-medium hover:bg-muted
|
|
92
89
|
focus:outline-none transition duration-150 ease-in-out`,
|
|
93
|
-
click:
|
|
90
|
+
click: s
|
|
94
91
|
}, [
|
|
95
|
-
e &&
|
|
96
|
-
t &&
|
|
97
|
-
]),
|
|
98
|
-
|
|
92
|
+
e && a(e),
|
|
93
|
+
t && h({ html: t })
|
|
94
|
+
]), pe = ({ onSelect: e }) => n([
|
|
95
|
+
y(
|
|
99
96
|
"open",
|
|
100
|
-
(t,
|
|
97
|
+
(t, s, o) => t ? new S({
|
|
101
98
|
cache: "dropdown",
|
|
102
|
-
parent:
|
|
103
|
-
button:
|
|
99
|
+
parent: o,
|
|
100
|
+
button: o.button
|
|
104
101
|
}, [
|
|
105
|
-
|
|
102
|
+
fe(e)
|
|
106
103
|
]) : null
|
|
107
104
|
)
|
|
108
105
|
]);
|
|
109
|
-
class
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
* @member {string} icon
|
|
118
|
-
* @default null
|
|
119
|
-
*/
|
|
120
|
-
i(this, "icon", null);
|
|
121
|
-
/**
|
|
122
|
-
* @member {function} onSelect
|
|
123
|
-
*/
|
|
124
|
-
i(this, "onSelect", null);
|
|
125
|
-
/**
|
|
126
|
-
* @member {array} groups
|
|
127
|
-
*/
|
|
128
|
-
i(this, "groups", []);
|
|
106
|
+
class mt extends b {
|
|
107
|
+
/**
|
|
108
|
+
* This will declare the props for the compiler.
|
|
109
|
+
*
|
|
110
|
+
* @returns {void}
|
|
111
|
+
*/
|
|
112
|
+
declareProps() {
|
|
113
|
+
this.label = null, this.icon = null, this.onSelect = null, this.groups = [];
|
|
129
114
|
}
|
|
130
115
|
/**
|
|
131
116
|
* Initializes component data.
|
|
@@ -133,7 +118,7 @@ class xt extends x {
|
|
|
133
118
|
* @returns {Data}
|
|
134
119
|
*/
|
|
135
120
|
setData() {
|
|
136
|
-
return new
|
|
121
|
+
return new C({
|
|
137
122
|
groups: this.groups || []
|
|
138
123
|
});
|
|
139
124
|
}
|
|
@@ -162,8 +147,8 @@ class xt extends x {
|
|
|
162
147
|
* @param {object} item - The selected item object
|
|
163
148
|
* @returns {void}
|
|
164
149
|
*/
|
|
165
|
-
handleSelect(
|
|
166
|
-
this.state.selectedItem =
|
|
150
|
+
handleSelect(t) {
|
|
151
|
+
this.state.selectedItem = t, this.state.open = !1, typeof this.onSelect == "function" && this.onSelect(t);
|
|
167
152
|
}
|
|
168
153
|
/**
|
|
169
154
|
* Renders the Dropdown component.
|
|
@@ -172,33 +157,33 @@ class xt extends x {
|
|
|
172
157
|
*/
|
|
173
158
|
render() {
|
|
174
159
|
return n({ class: "relative" }, [
|
|
175
|
-
|
|
160
|
+
ge({
|
|
176
161
|
label: this.label,
|
|
177
162
|
icon: this.icon,
|
|
178
163
|
toggleDropdown: this.toggleDropdown.bind(this)
|
|
179
164
|
}),
|
|
180
|
-
|
|
165
|
+
pe({ onSelect: this.handleSelect.bind(this) })
|
|
181
166
|
]);
|
|
182
167
|
}
|
|
183
168
|
}
|
|
184
|
-
const
|
|
185
|
-
...
|
|
169
|
+
const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t)), xe = c((e, t) => R({ ...e, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, t)), we = c((e, t) => p({ ...e, class: "text-sm text-muted-foreground italic" }, t)), ye = c((e, t) => p({ ...e, class: "text-sm text-destructive" }, t)), ve = (e) => e.tag === "input" || e.tag === "select" || e.tag === "textarea", H = (e, t, s) => e.map((o) => (o.children && o.children.length > 0 && (o.children = H(o.children, t, s)), o.required && ve(o) ? {
|
|
170
|
+
...o,
|
|
186
171
|
aria: {
|
|
187
172
|
invalid: ["hasError"]
|
|
188
173
|
},
|
|
189
|
-
invalid:
|
|
174
|
+
invalid: s,
|
|
190
175
|
input: t
|
|
191
|
-
} :
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
}, (
|
|
195
|
-
e.setError(
|
|
176
|
+
} : o)), Ce = c((e, t) => {
|
|
177
|
+
const l = H(t, (r) => {
|
|
178
|
+
r.target.checkValidity() && e.setError(null);
|
|
179
|
+
}, (r) => {
|
|
180
|
+
e.setError(r.target.validationMessage);
|
|
196
181
|
});
|
|
197
182
|
return n({
|
|
198
183
|
...e,
|
|
199
184
|
class: "w-full"
|
|
200
|
-
},
|
|
201
|
-
}),
|
|
185
|
+
}, l);
|
|
186
|
+
}), ft = x(
|
|
202
187
|
{
|
|
203
188
|
/**
|
|
204
189
|
* The initial state of the FormField.
|
|
@@ -219,113 +204,74 @@ const ve = d((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
219
204
|
* @returns {object}
|
|
220
205
|
*/
|
|
221
206
|
render() {
|
|
222
|
-
const e = this.name, t = this.getId(`${e}`), { label:
|
|
223
|
-
this.state.error =
|
|
207
|
+
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this, l = (r) => {
|
|
208
|
+
this.state.error = r, this.state.hasError = !!r;
|
|
224
209
|
};
|
|
225
210
|
return n({ class: "flex flex-auto space-y-4" }, [
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
211
|
+
be([
|
|
212
|
+
xe({ htmlFor: t }, s),
|
|
213
|
+
Ce({
|
|
229
214
|
id: t,
|
|
230
215
|
name: e,
|
|
231
216
|
value: this.state.value,
|
|
232
|
-
setError:
|
|
217
|
+
setError: l
|
|
233
218
|
}, this.children),
|
|
234
|
-
|
|
235
|
-
n({ onState: ["error", (
|
|
219
|
+
o && we({ id: this.getId("description") }, o),
|
|
220
|
+
n({ onState: ["error", (r) => r && ye(r)] })
|
|
236
221
|
])
|
|
237
222
|
]);
|
|
238
223
|
}
|
|
239
224
|
}
|
|
240
|
-
),
|
|
225
|
+
), ke = (e, t = null) => {
|
|
241
226
|
e.target.checkValidity() && (e.preventDefault(), t && t(e));
|
|
242
|
-
},
|
|
243
|
-
(e, t) =>
|
|
244
|
-
),
|
|
245
|
-
e.title &&
|
|
227
|
+
}, Se = c(
|
|
228
|
+
(e, t) => W({ ...e, submit: (s) => ke(s, e.submit), class: `w-full ${e.class ?? ""}` }, t)
|
|
229
|
+
), gt = c((e, t) => n({ ...e, class: `space-y-6 p-4 md:p-6 divide-y ${e.class || ""}` }, t)), pt = c((e, t = []) => n({ class: "space-y-3 py-4" }, [
|
|
230
|
+
e.title && B({ class: "font-semibold" }, e.title),
|
|
246
231
|
...t
|
|
247
|
-
])),
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
]),
|
|
232
|
+
])), bt = (e, t) => n({ class: "flex justify-between" }, [
|
|
233
|
+
a({ class: "text-muted-foreground" }, e),
|
|
234
|
+
a(t)
|
|
235
|
+
]), De = ({ title: e, description: t, back: s, icon: o, options: l = [] }) => M({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
|
|
251
236
|
/**
|
|
252
237
|
* Back Button
|
|
253
238
|
*/
|
|
254
|
-
|
|
239
|
+
s && u({ variant: "icon", icon: d.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (r, i) => i.close() }),
|
|
255
240
|
/**
|
|
256
241
|
* Icon
|
|
257
242
|
*/
|
|
258
|
-
|
|
243
|
+
o && n({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [D(o)]),
|
|
259
244
|
/**
|
|
260
245
|
* Title and Description
|
|
261
246
|
*/
|
|
262
247
|
n({ class: "flex flex-auto flex-row justify-between w-full ml-2 gap-2" }, [
|
|
263
248
|
n({ class: "flex flex-auto flex-col" }, [
|
|
264
|
-
|
|
249
|
+
B({ class: "text-lg font-semibold m-0" }, e),
|
|
265
250
|
t && n({ class: "text-sm text-muted-foreground" }, t)
|
|
266
251
|
]),
|
|
267
|
-
...
|
|
252
|
+
...l
|
|
268
253
|
])
|
|
269
|
-
]),
|
|
254
|
+
]), Ie = c((e, t) => n({
|
|
270
255
|
popover: "manual",
|
|
271
256
|
class: `modal m-auto top-0 right-0 bottom-0 left-0 fixed z-20 grid w-full h-full max-h-screen gap-2 lg:border bg-background text-foreground shadow-xl break-words p-0 ${e.class}`,
|
|
272
|
-
click: (
|
|
273
|
-
|
|
257
|
+
click: (s, o) => {
|
|
258
|
+
s.target === o.panel && (s.preventDefault(), s.stopPropagation(), o.state.open = !1);
|
|
274
259
|
}
|
|
275
260
|
}, [
|
|
276
|
-
|
|
277
|
-
|
|
261
|
+
Se({ class: "modal-content relative bg-background z-[1] flex flex-auto flex-col space-y-4", submit: (s) => e.onSubmit && e.onSubmit() }, [
|
|
262
|
+
De(e),
|
|
278
263
|
n({ class: "modal-body flex flex-grow flex-col overflow-y-auto py-0 px-6 z-0" }, t),
|
|
279
|
-
|
|
264
|
+
$({ class: "modal-footer sticky bg-background/80 backdrop-blur-md flex flex-none justify-between py-4 px-6 z-10" }, e.buttons)
|
|
280
265
|
])
|
|
281
|
-
])),
|
|
282
|
-
class
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
* @member {string} description
|
|
291
|
-
*/
|
|
292
|
-
i(this, "description", null);
|
|
293
|
-
/**
|
|
294
|
-
* @member {string} size
|
|
295
|
-
* @default 'md'
|
|
296
|
-
* @values 'sm', 'md', 'lg', 'xl'
|
|
297
|
-
*/
|
|
298
|
-
i(this, "size", "md");
|
|
299
|
-
/**
|
|
300
|
-
* @member {string} type
|
|
301
|
-
* @default ''
|
|
302
|
-
* @values 'right', 'left'
|
|
303
|
-
* @description This will set the type of modal.
|
|
304
|
-
*/
|
|
305
|
-
i(this, "type", "");
|
|
306
|
-
/**
|
|
307
|
-
* @member {boolean} hidePrimaryButton
|
|
308
|
-
* @default false
|
|
309
|
-
* @description This will hide the primary button.
|
|
310
|
-
* @values true, false
|
|
311
|
-
*/
|
|
312
|
-
i(this, "hidePrimaryButton", !1);
|
|
313
|
-
/**
|
|
314
|
-
* @member {string} icon
|
|
315
|
-
*/
|
|
316
|
-
i(this, "icon", null);
|
|
317
|
-
/**
|
|
318
|
-
* @member {function|nll} onSubmit
|
|
319
|
-
*/
|
|
320
|
-
i(this, "onSubmit", null);
|
|
321
|
-
/**
|
|
322
|
-
* @member {function|null} onClose
|
|
323
|
-
*/
|
|
324
|
-
i(this, "onClose", null);
|
|
325
|
-
/**
|
|
326
|
-
* @member {boolean} back
|
|
327
|
-
*/
|
|
328
|
-
i(this, "back", !1);
|
|
266
|
+
])), Te = (e) => q.render(e, app.root);
|
|
267
|
+
class xt extends b {
|
|
268
|
+
/**
|
|
269
|
+
* This will declare the props for the compiler.
|
|
270
|
+
*
|
|
271
|
+
* @returns {void}
|
|
272
|
+
*/
|
|
273
|
+
declareProps() {
|
|
274
|
+
this.title = null, this.description = null, this.size = "md", this.type = "", this.hidePrimaryButton = !1, this.icon = null, this.onSubmit = null, this.onClose = null, this.back = !1;
|
|
329
275
|
}
|
|
330
276
|
/**
|
|
331
277
|
* This will render the modal component.
|
|
@@ -333,12 +279,12 @@ class kt extends x {
|
|
|
333
279
|
* @returns {object}
|
|
334
280
|
*/
|
|
335
281
|
render() {
|
|
336
|
-
const
|
|
337
|
-
return
|
|
282
|
+
const t = this.getMainClass(), s = this.title || "", o = this.description || null;
|
|
283
|
+
return Ie(
|
|
338
284
|
{
|
|
339
|
-
class:
|
|
285
|
+
class: t,
|
|
340
286
|
title: s,
|
|
341
|
-
description:
|
|
287
|
+
description: o,
|
|
342
288
|
options: this.headerOptions(),
|
|
343
289
|
buttons: this.getButtons(),
|
|
344
290
|
onSubmit: () => {
|
|
@@ -360,8 +306,8 @@ class kt extends x {
|
|
|
360
306
|
return {
|
|
361
307
|
open: {
|
|
362
308
|
state: !1,
|
|
363
|
-
callBack: (
|
|
364
|
-
|
|
309
|
+
callBack: (t) => {
|
|
310
|
+
t || this.destroy();
|
|
365
311
|
}
|
|
366
312
|
}
|
|
367
313
|
};
|
|
@@ -381,8 +327,8 @@ class kt extends x {
|
|
|
381
327
|
*/
|
|
382
328
|
getButtons() {
|
|
383
329
|
return [
|
|
384
|
-
|
|
385
|
-
this.hidePrimaryButton !== !0 &&
|
|
330
|
+
u({ variant: "outline", click: () => this.destroy() }, "Cancel"),
|
|
331
|
+
this.hidePrimaryButton !== !0 && u({ variant: "primary", type: "submit" }, "Save")
|
|
386
332
|
];
|
|
387
333
|
}
|
|
388
334
|
/**
|
|
@@ -391,8 +337,8 @@ class kt extends x {
|
|
|
391
337
|
* @param {object} element
|
|
392
338
|
* @returns {boolean}
|
|
393
339
|
*/
|
|
394
|
-
isOutsideClick(
|
|
395
|
-
return !this.panel.contains(
|
|
340
|
+
isOutsideClick(t) {
|
|
341
|
+
return !this.panel.contains(t);
|
|
396
342
|
}
|
|
397
343
|
/**
|
|
398
344
|
* This will get the size class.
|
|
@@ -437,7 +383,7 @@ class kt extends x {
|
|
|
437
383
|
*
|
|
438
384
|
* @param {object} container
|
|
439
385
|
*/
|
|
440
|
-
setContainer(
|
|
386
|
+
setContainer(t) {
|
|
441
387
|
this.container = app.root;
|
|
442
388
|
}
|
|
443
389
|
/**
|
|
@@ -446,7 +392,7 @@ class kt extends x {
|
|
|
446
392
|
* @returns {void}
|
|
447
393
|
*/
|
|
448
394
|
open() {
|
|
449
|
-
|
|
395
|
+
Te(this), this.showModal();
|
|
450
396
|
}
|
|
451
397
|
/**
|
|
452
398
|
* This will show the modal.
|
|
@@ -467,7 +413,7 @@ class kt extends x {
|
|
|
467
413
|
this.panel.hidePopover(), this.state.open = !1, typeof this.onClose == "function" && this.onClose(), document.documentElement.style.overflowY = "auto";
|
|
468
414
|
}
|
|
469
415
|
}
|
|
470
|
-
const
|
|
416
|
+
const N = {
|
|
471
417
|
info: {
|
|
472
418
|
bgColor: "bg-muted/10",
|
|
473
419
|
borderColor: "border-blue-500",
|
|
@@ -493,56 +439,25 @@ const F = {
|
|
|
493
439
|
borderColor: "border",
|
|
494
440
|
iconColor: "text-muted-foreground"
|
|
495
441
|
}
|
|
496
|
-
},
|
|
497
|
-
|
|
498
|
-
]),
|
|
442
|
+
}, Ae = (e) => M({ class: "flex justify-center" }, [
|
|
443
|
+
G({ class: "text-lg font-bold mb-0" }, e)
|
|
444
|
+
]), Be = c(({ href: e, class: t }, s) => Y({
|
|
499
445
|
class: `pullRightIn bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
|
|
500
446
|
href: e,
|
|
501
447
|
role: "alert"
|
|
502
|
-
},
|
|
448
|
+
}, s)), $e = c(({ close: e, class: t }, s) => n({
|
|
503
449
|
class: `pullRightIn bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
|
|
504
450
|
click: () => e(),
|
|
505
451
|
role: "alert"
|
|
506
|
-
},
|
|
507
|
-
class
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
* @member {function|null} secondaryAction
|
|
516
|
-
*/
|
|
517
|
-
i(this, "secondaryAction", null);
|
|
518
|
-
/**
|
|
519
|
-
* @member {function|null} primaryAction
|
|
520
|
-
*/
|
|
521
|
-
i(this, "primaryAction", null);
|
|
522
|
-
/**
|
|
523
|
-
* @member {boolean} primary
|
|
524
|
-
*/
|
|
525
|
-
i(this, "primary", !1);
|
|
526
|
-
/**
|
|
527
|
-
* @member {boolean} secondary
|
|
528
|
-
*/
|
|
529
|
-
i(this, "secondary", !1);
|
|
530
|
-
/**
|
|
531
|
-
* @member {string} title
|
|
532
|
-
*/
|
|
533
|
-
i(this, "title", null);
|
|
534
|
-
/**
|
|
535
|
-
* @member {string} description
|
|
536
|
-
*/
|
|
537
|
-
i(this, "description", null);
|
|
538
|
-
/**
|
|
539
|
-
* @member {string} icon
|
|
540
|
-
*/
|
|
541
|
-
i(this, "icon", null);
|
|
542
|
-
/**
|
|
543
|
-
* @member {function} onClick
|
|
544
|
-
*/
|
|
545
|
-
i(this, "onClick", null);
|
|
452
|
+
}, s));
|
|
453
|
+
class Me extends ae {
|
|
454
|
+
/**
|
|
455
|
+
* This will declare the props for the compiler.
|
|
456
|
+
*
|
|
457
|
+
* @returns {void}
|
|
458
|
+
*/
|
|
459
|
+
declareProps() {
|
|
460
|
+
this.removingClass = "pullRight", this.secondaryAction = null, this.primaryAction = null, this.primary = !1, this.secondary = !1, this.title = null, this.description = null, this.icon = null, this.onClick = null;
|
|
546
461
|
}
|
|
547
462
|
/**
|
|
548
463
|
* This will be called when the component is created.
|
|
@@ -558,13 +473,13 @@ class Fe extends me {
|
|
|
558
473
|
* @returns {object}
|
|
559
474
|
*/
|
|
560
475
|
render() {
|
|
561
|
-
const { bgColor:
|
|
562
|
-
return l ?
|
|
476
|
+
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), l = this.href || null, r = this.getChildren(o);
|
|
477
|
+
return l ? Be({
|
|
563
478
|
href: l,
|
|
564
|
-
class: `${
|
|
565
|
-
}, r) :
|
|
479
|
+
class: `${t} ${s}`
|
|
480
|
+
}, r) : $e({
|
|
566
481
|
close: this.close.bind(this),
|
|
567
|
-
class: `${
|
|
482
|
+
class: `${t} ${s}`
|
|
568
483
|
}, r);
|
|
569
484
|
}
|
|
570
485
|
/**
|
|
@@ -573,8 +488,8 @@ class Fe extends me {
|
|
|
573
488
|
* @returns {void}
|
|
574
489
|
*/
|
|
575
490
|
afterSetup() {
|
|
576
|
-
const
|
|
577
|
-
|
|
491
|
+
const t = this.duration;
|
|
492
|
+
t !== "infinite" && (this.timer = new se(t, this.close.bind(this)), this.timer.start());
|
|
578
493
|
}
|
|
579
494
|
/**
|
|
580
495
|
* This will get the style properties based on the notification type.
|
|
@@ -582,8 +497,8 @@ class Fe extends me {
|
|
|
582
497
|
* @returns {object}
|
|
583
498
|
*/
|
|
584
499
|
getTypeStyles() {
|
|
585
|
-
const
|
|
586
|
-
return
|
|
500
|
+
const t = this.type || "default";
|
|
501
|
+
return N[t] || N.default;
|
|
587
502
|
}
|
|
588
503
|
/**
|
|
589
504
|
* This will get the buttons for the notification.
|
|
@@ -593,8 +508,8 @@ class Fe extends me {
|
|
|
593
508
|
getButtons() {
|
|
594
509
|
return [
|
|
595
510
|
n({ class: "flex flex-row mt-6 gap-2" }, [
|
|
596
|
-
this.secondary &&
|
|
597
|
-
this.primary &&
|
|
511
|
+
this.secondary && u({ variant: "outline", click: () => this.secondaryAction && this.secondaryAction() }, this.secondary),
|
|
512
|
+
this.primary && u({ click: () => this.primaryAction && this.primaryAction() }, this.primary)
|
|
598
513
|
])
|
|
599
514
|
];
|
|
600
515
|
}
|
|
@@ -604,22 +519,22 @@ class Fe extends me {
|
|
|
604
519
|
* @param {string} iconColor
|
|
605
520
|
* @returns {array}
|
|
606
521
|
*/
|
|
607
|
-
getChildren(
|
|
522
|
+
getChildren(t) {
|
|
608
523
|
return [
|
|
609
524
|
n({ class: "flex items-start" }, [
|
|
610
|
-
this.icon &&
|
|
525
|
+
this.icon && h({ class: `mr-4 ${t}`, html: this.icon }),
|
|
611
526
|
n({ class: "flex flex-auto flex-col" }, [
|
|
612
527
|
n({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
|
|
613
|
-
this.title &&
|
|
528
|
+
this.title && Ae(this.title)
|
|
614
529
|
]),
|
|
615
530
|
p({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
|
|
616
|
-
(this.primary || this.secondary) &&
|
|
531
|
+
(this.primary || this.secondary) && $({ class: "margin-top-24 flex align-center" }, this.getButtons())
|
|
617
532
|
])
|
|
618
533
|
]),
|
|
619
|
-
|
|
534
|
+
u({
|
|
620
535
|
class: "absolute top-[12px] right-[12px]",
|
|
621
536
|
variant: "icon",
|
|
622
|
-
icon:
|
|
537
|
+
icon: d.x,
|
|
623
538
|
click: this.close.bind(this)
|
|
624
539
|
})
|
|
625
540
|
];
|
|
@@ -630,12 +545,12 @@ class Fe extends me {
|
|
|
630
545
|
* @param {object} e The event object.
|
|
631
546
|
* @returns {void}
|
|
632
547
|
*/
|
|
633
|
-
close(
|
|
634
|
-
|
|
548
|
+
close(t) {
|
|
549
|
+
t && t.stopPropagation(), this.duration !== "infinite" && this.timer.stop(), this.onClick && this.onClick(), this.destroy();
|
|
635
550
|
}
|
|
636
551
|
}
|
|
637
|
-
let
|
|
638
|
-
class
|
|
552
|
+
let Le = 0;
|
|
553
|
+
class wt extends b {
|
|
639
554
|
/**
|
|
640
555
|
* This will render the component.
|
|
641
556
|
*
|
|
@@ -643,11 +558,11 @@ class St extends x {
|
|
|
643
558
|
*/
|
|
644
559
|
render() {
|
|
645
560
|
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" }, [
|
|
646
|
-
new
|
|
561
|
+
new oe({
|
|
647
562
|
cache: "list",
|
|
648
563
|
key: "id",
|
|
649
564
|
role: "list",
|
|
650
|
-
rowItem: (t) => new
|
|
565
|
+
rowItem: (t) => new Me(t)
|
|
651
566
|
})
|
|
652
567
|
]);
|
|
653
568
|
}
|
|
@@ -658,7 +573,7 @@ class St extends x {
|
|
|
658
573
|
* @returns {void}
|
|
659
574
|
*/
|
|
660
575
|
addNotice(t = {}) {
|
|
661
|
-
t.id =
|
|
576
|
+
t.id = Le++, t.callBack = () => this.removeNotice(t), this.list.append([t]), this.panel.hidePopover(), this.panel.showPopover();
|
|
662
577
|
}
|
|
663
578
|
/**
|
|
664
579
|
* This will remove a notification.
|
|
@@ -670,26 +585,26 @@ class St extends x {
|
|
|
670
585
|
this.list.delete(t.id);
|
|
671
586
|
}
|
|
672
587
|
}
|
|
673
|
-
const
|
|
588
|
+
const z = window.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
674
589
|
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',
|
|
675
590
|
onState: ["method", { active: e }],
|
|
676
591
|
dataSet: ["method", ["state", e, "active"]],
|
|
677
|
-
click: (
|
|
678
|
-
|
|
592
|
+
click: (o, { state: l }) => {
|
|
593
|
+
l.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Pe(e);
|
|
679
594
|
}
|
|
680
595
|
}, [
|
|
681
|
-
|
|
682
|
-
|
|
596
|
+
D(s),
|
|
597
|
+
a(t)
|
|
683
598
|
])), Pe = (e) => {
|
|
684
|
-
var
|
|
599
|
+
var o;
|
|
685
600
|
const t = document.documentElement;
|
|
686
|
-
if (e === "system" && (e = (
|
|
601
|
+
if (e === "system" && (e = (o = window.matchMedia) != null && o.call(window, "(prefers-color-scheme: dark)").matches ? "dark" : "light"), z && !z("(prefers-color-scheme: " + e + ")").matches) {
|
|
687
602
|
t.classList.add(e);
|
|
688
603
|
return;
|
|
689
604
|
}
|
|
690
|
-
const
|
|
691
|
-
t.classList.remove(
|
|
692
|
-
},
|
|
605
|
+
const s = e === "light" ? "dark" : "light";
|
|
606
|
+
t.classList.remove(s);
|
|
607
|
+
}, yt = k(
|
|
693
608
|
{
|
|
694
609
|
/**
|
|
695
610
|
* This will render the component.
|
|
@@ -699,9 +614,9 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
699
614
|
render() {
|
|
700
615
|
return n({ class: "flex flex-auto flex-col" }, [
|
|
701
616
|
n({ class: "grid grid-cols-3 gap-4" }, [
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
617
|
+
I({ label: "System", value: "system", icon: d.adjustments.horizontal }),
|
|
618
|
+
I({ label: "Light", value: "light", icon: d.sun }),
|
|
619
|
+
I({ label: "Dark", value: "dark", icon: d.moon })
|
|
705
620
|
])
|
|
706
621
|
]);
|
|
707
622
|
},
|
|
@@ -716,7 +631,7 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
716
631
|
};
|
|
717
632
|
}
|
|
718
633
|
}
|
|
719
|
-
),
|
|
634
|
+
), vt = x(
|
|
720
635
|
{
|
|
721
636
|
/**
|
|
722
637
|
* The initial state of the Toggle.
|
|
@@ -735,7 +650,7 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
735
650
|
* @returns {void}
|
|
736
651
|
*/
|
|
737
652
|
after() {
|
|
738
|
-
|
|
653
|
+
this.state.active = this.checkbox.checked;
|
|
739
654
|
},
|
|
740
655
|
/**
|
|
741
656
|
* Renders the Toggle component.
|
|
@@ -743,19 +658,16 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
743
658
|
* @returns {object}
|
|
744
659
|
*/
|
|
745
660
|
render() {
|
|
746
|
-
return
|
|
661
|
+
return m({
|
|
747
662
|
class: "relative inline-flex h-6 w-11 min-w-11 items-center rounded-full bg-muted transition-colors focus:outline-none",
|
|
748
663
|
onState: ["active", { "bg-primary": !0, "bg-muted": !1 }],
|
|
749
|
-
click: (t, { state:
|
|
750
|
-
|
|
664
|
+
click: (t, { state: s }) => {
|
|
665
|
+
s.toggle("active"), this.checkbox.checked = s.active;
|
|
751
666
|
}
|
|
752
667
|
}, [
|
|
753
|
-
|
|
668
|
+
J({
|
|
754
669
|
cache: "checkbox",
|
|
755
670
|
class: "opacity-0 absolute top-0 left-0 bottom-0 right-0 w-full h-full",
|
|
756
|
-
onCreated(t, o) {
|
|
757
|
-
console.log("created", t, o);
|
|
758
|
-
},
|
|
759
671
|
/**
|
|
760
672
|
* This will add the default checked before binding.
|
|
761
673
|
* If binding it will override the default checked value.
|
|
@@ -764,49 +676,49 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
764
676
|
bind: this.bind,
|
|
765
677
|
required: this.required
|
|
766
678
|
}),
|
|
767
|
-
|
|
679
|
+
a({
|
|
768
680
|
class: "absolute h-5 w-5 bg-background rounded-full shadow-md transform transition-transform",
|
|
769
681
|
onState: ["active", { "translate-x-[22px]": !0, "translate-x-[2px]": !1 }]
|
|
770
682
|
})
|
|
771
683
|
]);
|
|
772
684
|
}
|
|
773
685
|
}
|
|
774
|
-
),
|
|
686
|
+
), w = {
|
|
775
687
|
ONLINE: "online",
|
|
776
688
|
OFFLINE: "offline",
|
|
777
689
|
BUSY: "busy",
|
|
778
690
|
AWAY: "away"
|
|
779
|
-
},
|
|
691
|
+
}, f = {
|
|
780
692
|
ONLINE: "bg-green-500",
|
|
781
693
|
OFFLINE: "bg-gray-500",
|
|
782
694
|
BUSY: "bg-red-500",
|
|
783
695
|
AWAY: "bg-yellow-500"
|
|
784
|
-
},
|
|
785
|
-
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${
|
|
786
|
-
}),
|
|
696
|
+
}, Ne = (e = "") => (e = e.toUpperCase(), f[e] || f.OFFLINE), Ct = (e) => n({
|
|
697
|
+
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${Ne(e)}`
|
|
698
|
+
}), kt = ({ propName: e = "status" } = {}) => n({
|
|
787
699
|
class: "absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full",
|
|
788
700
|
onSet: [e, {
|
|
789
|
-
[
|
|
790
|
-
[
|
|
791
|
-
[
|
|
792
|
-
[
|
|
701
|
+
[f.ONLINE]: w.ONLINE,
|
|
702
|
+
[f.OFFLINE]: w.OFFLINE,
|
|
703
|
+
[f.BUSY]: w.BUSY,
|
|
704
|
+
[f.AWAY]: w.AWAY
|
|
793
705
|
}]
|
|
794
|
-
}),
|
|
706
|
+
}), ze = (e, t) => Y(
|
|
795
707
|
{
|
|
796
708
|
href: e,
|
|
797
709
|
"aria-current": t === "Breadcrumb" && "page",
|
|
798
710
|
// Only set aria-current on the last item
|
|
799
711
|
class: "text-muted-foreground font-medium hover:text-foreground"
|
|
800
712
|
},
|
|
801
|
-
[
|
|
802
|
-
),
|
|
713
|
+
[a(t)]
|
|
714
|
+
), Fe = () => D({
|
|
803
715
|
class: "mx-3 text-muted-foreground",
|
|
804
716
|
"aria-hidden": !0,
|
|
805
717
|
size: "xs"
|
|
806
|
-
},
|
|
807
|
-
e.href ?
|
|
808
|
-
e.separator &&
|
|
809
|
-
]),
|
|
718
|
+
}, d.chevron.single.right), Ee = (e) => n({ class: "flex items-center" }, [
|
|
719
|
+
e.href ? ze(e.href, e.label) : a(e.label),
|
|
720
|
+
e.separator && Fe()
|
|
721
|
+
]), St = k(
|
|
810
722
|
{
|
|
811
723
|
/**
|
|
812
724
|
* Set initial data
|
|
@@ -814,7 +726,7 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
814
726
|
* @returns {Data}
|
|
815
727
|
*/
|
|
816
728
|
setData() {
|
|
817
|
-
return new
|
|
729
|
+
return new C({
|
|
818
730
|
// @ts-ignore
|
|
819
731
|
items: this.items || []
|
|
820
732
|
});
|
|
@@ -826,7 +738,7 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
826
738
|
*/
|
|
827
739
|
render() {
|
|
828
740
|
const e = this.data.items.length - 1;
|
|
829
|
-
return
|
|
741
|
+
return K(
|
|
830
742
|
{
|
|
831
743
|
"aria-label": "Breadcrumb",
|
|
832
744
|
class: "flex items-center space-x-1 text-sm"
|
|
@@ -835,17 +747,17 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
835
747
|
n({
|
|
836
748
|
role: "list",
|
|
837
749
|
class: "flex items-center",
|
|
838
|
-
for: ["items", (t,
|
|
750
|
+
for: ["items", (t, s) => Ee({
|
|
839
751
|
href: t.href,
|
|
840
752
|
label: t.label,
|
|
841
|
-
separator:
|
|
753
|
+
separator: s < e
|
|
842
754
|
})]
|
|
843
755
|
})
|
|
844
756
|
]
|
|
845
757
|
);
|
|
846
758
|
}
|
|
847
759
|
}
|
|
848
|
-
),
|
|
760
|
+
), F = {
|
|
849
761
|
xs: "h-1 w-1",
|
|
850
762
|
sm: "h-2 w-2",
|
|
851
763
|
md: "h-4 w-4",
|
|
@@ -854,21 +766,21 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
854
766
|
"2xl": "h-16 w-16",
|
|
855
767
|
"3xl": "h-24 w-24",
|
|
856
768
|
default: "h-4 w-4"
|
|
857
|
-
},
|
|
858
|
-
|
|
769
|
+
}, je = (e) => F[e] || F.default, Oe = ({ index: e, size: t }) => n({ class: `${t} rounded-full bg-muted cursor-pointer` }, [
|
|
770
|
+
a({
|
|
859
771
|
class: "block w-full h-full rounded-full transition-colors",
|
|
860
772
|
onSet: ["activeIndex", {
|
|
861
773
|
"bg-primary": e,
|
|
862
774
|
"shadow-md": e
|
|
863
775
|
}],
|
|
864
|
-
click: (
|
|
865
|
-
|
|
776
|
+
click: (s, { data: o, onClick: l }) => {
|
|
777
|
+
o.activeIndex = e, l && l(e);
|
|
866
778
|
}
|
|
867
779
|
})
|
|
868
|
-
]),
|
|
869
|
-
index:
|
|
780
|
+
]), Ve = (e, t) => Array.from({ length: e }, (s, o) => Oe({
|
|
781
|
+
index: o,
|
|
870
782
|
size: t
|
|
871
|
-
})),
|
|
783
|
+
})), Dt = k(
|
|
872
784
|
{
|
|
873
785
|
/**
|
|
874
786
|
* Defines component data (props).
|
|
@@ -876,7 +788,7 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
876
788
|
* @returns {Data}
|
|
877
789
|
*/
|
|
878
790
|
setData() {
|
|
879
|
-
return new
|
|
791
|
+
return new C({
|
|
880
792
|
// @ts-ignore
|
|
881
793
|
count: this.count || 4,
|
|
882
794
|
// total dots
|
|
@@ -890,46 +802,46 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
890
802
|
* @returns {object}
|
|
891
803
|
*/
|
|
892
804
|
render() {
|
|
893
|
-
const e = this.gap || "gap-2", t =
|
|
805
|
+
const e = this.gap || "gap-2", t = je(this.size || "sm"), s = Ve(this.data.count, t);
|
|
894
806
|
return n(
|
|
895
807
|
{ class: "flex justify-center items-center py-2" },
|
|
896
808
|
[
|
|
897
|
-
n({ class: `flex ${e}` },
|
|
809
|
+
n({ class: `flex ${e}` }, s)
|
|
898
810
|
]
|
|
899
811
|
);
|
|
900
812
|
}
|
|
901
813
|
}
|
|
902
|
-
),
|
|
814
|
+
), Ye = ({ toggleDropdown: e }) => m(
|
|
903
815
|
{
|
|
904
816
|
cache: "button",
|
|
905
817
|
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 border-input bg-background hover:bg-muted h-10 px-4 py-2 justify-between",
|
|
906
818
|
click: e
|
|
907
819
|
},
|
|
908
820
|
[
|
|
909
|
-
|
|
910
|
-
|
|
821
|
+
a({ onState: ["selectedLabel", (t) => t || "Select item..."] }),
|
|
822
|
+
h({ html: d.chevron.upDown })
|
|
911
823
|
]
|
|
912
|
-
),
|
|
824
|
+
), qe = (e, t) => O({
|
|
913
825
|
class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
|
|
914
826
|
click: () => t(e),
|
|
915
827
|
onState: ["selectedValue", { "bg-secondary": e.value }]
|
|
916
828
|
}, [
|
|
917
|
-
e.icon &&
|
|
918
|
-
|
|
919
|
-
]),
|
|
920
|
-
|
|
921
|
-
]),
|
|
922
|
-
|
|
829
|
+
e.icon && a({ class: "mr-2 flex items-baseline" }, [h({ class: "flex w-4 h-4", html: e.icon })]),
|
|
830
|
+
a(e.label)
|
|
831
|
+
]), He = (e) => n({ class: "w-full border rounded-md" }, [
|
|
832
|
+
V({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (t) => qe(t, e)] })
|
|
833
|
+
]), Ue = ({ onSelect: e }) => n({ class: "flex flex-auto flex-col" }, [
|
|
834
|
+
y(
|
|
923
835
|
"open",
|
|
924
|
-
(t,
|
|
836
|
+
(t, s, o) => t ? new S({
|
|
925
837
|
cache: "dropdown",
|
|
926
|
-
parent:
|
|
927
|
-
button:
|
|
838
|
+
parent: o,
|
|
839
|
+
button: o.button
|
|
928
840
|
}, [
|
|
929
|
-
|
|
841
|
+
He(e)
|
|
930
842
|
]) : null
|
|
931
843
|
)
|
|
932
|
-
]),
|
|
844
|
+
]), It = k(
|
|
933
845
|
{
|
|
934
846
|
/**
|
|
935
847
|
* This will set up the data.
|
|
@@ -937,7 +849,7 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
937
849
|
* @returns {Data}
|
|
938
850
|
*/
|
|
939
851
|
setData() {
|
|
940
|
-
return new
|
|
852
|
+
return new C({
|
|
941
853
|
// @ts-ignore
|
|
942
854
|
items: this.items || []
|
|
943
855
|
});
|
|
@@ -977,16 +889,16 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
977
889
|
*/
|
|
978
890
|
render() {
|
|
979
891
|
const e = (t) => {
|
|
980
|
-
const
|
|
981
|
-
|
|
892
|
+
const s = this.state;
|
|
893
|
+
s.selectedValue = t.value, s.selectedLabel = t.label, s.open = !1;
|
|
982
894
|
};
|
|
983
895
|
return n({ class: "relative w-full flex flex-auto flex-col max-w-[250px]" }, [
|
|
984
896
|
// @ts-ignore
|
|
985
|
-
|
|
986
|
-
|
|
897
|
+
Ye({ toggleDropdown: this.toggleDropdown.bind(this) }),
|
|
898
|
+
Ue({ onSelect: e }),
|
|
987
899
|
// Hidden required input for form validation
|
|
988
900
|
// @ts-ignore
|
|
989
|
-
this.required &&
|
|
901
|
+
this.required && v({
|
|
990
902
|
class: "opacity-0 absolute top-0 left-0 z-[1]",
|
|
991
903
|
type: "text",
|
|
992
904
|
// @ts-ignore
|
|
@@ -998,34 +910,34 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
998
910
|
]);
|
|
999
911
|
}
|
|
1000
912
|
}
|
|
1001
|
-
),
|
|
913
|
+
), U = ({ icon: e, click: t, ariaLabel: s }) => u({
|
|
1002
914
|
variant: "icon",
|
|
1003
915
|
class: "flex flex-none",
|
|
1004
916
|
click: t,
|
|
1005
917
|
icon: e,
|
|
1006
|
-
"aria-label":
|
|
1007
|
-
}),
|
|
1008
|
-
icon:
|
|
918
|
+
"aria-label": s
|
|
919
|
+
}), _e = ({ click: e }) => U({
|
|
920
|
+
icon: d.circleMinus,
|
|
1009
921
|
click: e,
|
|
1010
922
|
ariaLabel: "Decrement"
|
|
1011
|
-
}),
|
|
1012
|
-
icon:
|
|
923
|
+
}), Re = ({ click: e }) => U({
|
|
924
|
+
icon: d.circlePlus,
|
|
1013
925
|
click: e,
|
|
1014
926
|
ariaLabel: "Increment"
|
|
1015
|
-
}),
|
|
927
|
+
}), We = ({ bind: e, min: t, max: s, readonly: o = !1 }) => v({
|
|
1016
928
|
value: "[[count]]",
|
|
1017
929
|
bind: e,
|
|
1018
|
-
blur: (
|
|
1019
|
-
let
|
|
1020
|
-
isNaN(
|
|
930
|
+
blur: (l, { state: r }) => {
|
|
931
|
+
let i = parseInt(l.target.value, 10);
|
|
932
|
+
isNaN(i) && (i = t ?? 0), t !== void 0 && (i = Math.max(i, t)), s !== void 0 && (i = Math.min(i, s)), r.count = i;
|
|
1021
933
|
},
|
|
1022
934
|
class: "flex flex-auto text-lg font-medium bg-transparent text-center border min-w-0",
|
|
1023
|
-
readonly:
|
|
935
|
+
readonly: o,
|
|
1024
936
|
min: t,
|
|
1025
|
-
max:
|
|
937
|
+
max: s,
|
|
1026
938
|
type: "number",
|
|
1027
939
|
"aria-label": "Counter"
|
|
1028
|
-
}),
|
|
940
|
+
}), Tt = x(
|
|
1029
941
|
{
|
|
1030
942
|
/**
|
|
1031
943
|
* Initial state for the counter component.
|
|
@@ -1048,47 +960,47 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
1048
960
|
render() {
|
|
1049
961
|
const e = this.class ?? "";
|
|
1050
962
|
return n({ class: `flex flex-auto items-center justify-between space-x-4 p-4 ${e}` }, [
|
|
1051
|
-
|
|
1052
|
-
|
|
963
|
+
_e({ click: () => this.state.decrement("count") }),
|
|
964
|
+
We({
|
|
1053
965
|
bind: this.bind,
|
|
1054
966
|
readonly: this.readonly,
|
|
1055
967
|
min: this.min,
|
|
1056
968
|
max: this.max
|
|
1057
969
|
}),
|
|
1058
|
-
|
|
970
|
+
Re({ click: () => this.state.increment("count") })
|
|
1059
971
|
]);
|
|
1060
972
|
}
|
|
1061
973
|
}
|
|
1062
|
-
),
|
|
974
|
+
), Ge = ({ bind: e, required: t }) => v({
|
|
1063
975
|
cache: "input",
|
|
1064
976
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1065
977
|
bind: e,
|
|
1066
978
|
required: t
|
|
1067
|
-
}),
|
|
979
|
+
}), Je = ({ bind: e, required: t, toggleOpen: s }) => m({
|
|
1068
980
|
class: "relative flex items-center gap-2 w-full justify-between border border-input bg-background hover:bg-muted rounded-md h-10 px-4 py-2",
|
|
1069
|
-
click:
|
|
981
|
+
click: s
|
|
1070
982
|
}, [
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
onState: ["selectedDate", (
|
|
983
|
+
Ge({ bind: e, required: t }),
|
|
984
|
+
a({
|
|
985
|
+
onState: ["selectedDate", (o) => o ? A.format("standard", o) : "Pick a date"]
|
|
1074
986
|
}),
|
|
1075
|
-
|
|
1076
|
-
]),
|
|
1077
|
-
|
|
987
|
+
h({ html: d.calendar.days })
|
|
988
|
+
]), Ke = ({ handleDateSelect: e }) => n({ class: "absolute mt-1 z-10 bg-background rounded-md shadow-lg" }, [
|
|
989
|
+
y(
|
|
1078
990
|
"open",
|
|
1079
|
-
(t,
|
|
991
|
+
(t, s, o) => t ? new S({
|
|
1080
992
|
cache: "dropdown",
|
|
1081
|
-
parent:
|
|
1082
|
-
button:
|
|
993
|
+
parent: o,
|
|
994
|
+
button: o.panel,
|
|
1083
995
|
size: "fit"
|
|
1084
996
|
}, [
|
|
1085
|
-
new
|
|
1086
|
-
selectedDate:
|
|
997
|
+
new te({
|
|
998
|
+
selectedDate: o.state.selectedDate,
|
|
1087
999
|
selectedCallBack: e
|
|
1088
1000
|
})
|
|
1089
1001
|
]) : null
|
|
1090
1002
|
)
|
|
1091
|
-
]),
|
|
1003
|
+
]), At = x(
|
|
1092
1004
|
{
|
|
1093
1005
|
/**
|
|
1094
1006
|
* The initial state of the DatePicker.
|
|
@@ -1116,78 +1028,78 @@ const E = window.matchMedia, T = d(({ value: e, label: t, icon: o }) => h({
|
|
|
1116
1028
|
* @returns {object}
|
|
1117
1029
|
*/
|
|
1118
1030
|
render() {
|
|
1119
|
-
const e = (
|
|
1120
|
-
this.state.selectedDate =
|
|
1031
|
+
const e = (s, { state: o }) => o.toggle("open"), t = (s) => {
|
|
1032
|
+
this.state.selectedDate = s, this.state.open = !1, this.input.value = s, typeof this.onChange == "function" && this.onChange(s);
|
|
1121
1033
|
};
|
|
1122
1034
|
return n({ class: "relative w-full max-w-[320px]" }, [
|
|
1123
|
-
|
|
1035
|
+
Je({
|
|
1124
1036
|
toggleOpen: e,
|
|
1125
1037
|
bind: this.bind,
|
|
1126
1038
|
required: this.required
|
|
1127
1039
|
}),
|
|
1128
|
-
|
|
1040
|
+
Ke({
|
|
1129
1041
|
handleDateSelect: t
|
|
1130
1042
|
})
|
|
1131
1043
|
]);
|
|
1132
1044
|
}
|
|
1133
1045
|
}
|
|
1134
|
-
),
|
|
1135
|
-
new
|
|
1046
|
+
), Bt = ({ dateTime: e = "", remoteTimeZone: t = "America/Denver", filter: s = null }) => Q([
|
|
1047
|
+
new ne({
|
|
1136
1048
|
dateTime: e,
|
|
1137
|
-
filter:
|
|
1138
|
-
const
|
|
1139
|
-
return
|
|
1049
|
+
filter: s || ((o) => {
|
|
1050
|
+
const l = A.getLocalTime(o, !0, !1, t);
|
|
1051
|
+
return A.getTimeFrame(l);
|
|
1140
1052
|
})
|
|
1141
1053
|
})
|
|
1142
1054
|
]);
|
|
1143
|
-
function
|
|
1144
|
-
return
|
|
1055
|
+
function Qe({ bind: e, required: t }) {
|
|
1056
|
+
return v({
|
|
1145
1057
|
cache: "input",
|
|
1146
1058
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1147
1059
|
bind: e,
|
|
1148
1060
|
required: t
|
|
1149
1061
|
});
|
|
1150
1062
|
}
|
|
1151
|
-
function
|
|
1152
|
-
return
|
|
1063
|
+
function Xe({ bind: e, required: t, toggleOpen: s }) {
|
|
1064
|
+
return m(
|
|
1153
1065
|
{
|
|
1154
1066
|
class: "relative flex items-center gap-2 w-full justify-between border border-input bg-background hover:bg-muted rounded-md h-10 px-4 py-2",
|
|
1155
|
-
click:
|
|
1067
|
+
click: s
|
|
1156
1068
|
},
|
|
1157
1069
|
[
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
onState: ["selectedTime", (
|
|
1070
|
+
Qe({ bind: e, required: t }),
|
|
1071
|
+
a({
|
|
1072
|
+
onState: ["selectedTime", (o) => o || "Pick a time"]
|
|
1161
1073
|
}),
|
|
1162
|
-
|
|
1074
|
+
h({ html: d.clock })
|
|
1163
1075
|
]
|
|
1164
1076
|
);
|
|
1165
1077
|
}
|
|
1166
|
-
function
|
|
1078
|
+
function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: l = !1 }) {
|
|
1167
1079
|
return n(
|
|
1168
1080
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1169
|
-
e.map((
|
|
1170
|
-
let
|
|
1171
|
-
return
|
|
1172
|
-
text:
|
|
1081
|
+
e.map((r) => {
|
|
1082
|
+
let i = l ? r.toString().padStart(2, "0") : r.toString();
|
|
1083
|
+
return m({
|
|
1084
|
+
text: i,
|
|
1173
1085
|
class: "hover:bg-muted/50 rounded-md px-2 py-1",
|
|
1174
|
-
click: () => t({ [
|
|
1175
|
-
onState: [
|
|
1086
|
+
click: () => t({ [o]: i }),
|
|
1087
|
+
onState: [s, o, { "bg-muted": i }]
|
|
1176
1088
|
});
|
|
1177
1089
|
})
|
|
1178
1090
|
);
|
|
1179
1091
|
}
|
|
1180
|
-
function
|
|
1092
|
+
function Ze({ handleTimeSelect: e }) {
|
|
1181
1093
|
return n(
|
|
1182
1094
|
{ class: "absolute mt-1 z-10 bg-background rounded-md shadow-lg" },
|
|
1183
1095
|
[
|
|
1184
|
-
|
|
1096
|
+
y(
|
|
1185
1097
|
"open",
|
|
1186
|
-
(t,
|
|
1098
|
+
(t, s, o) => t ? new S(
|
|
1187
1099
|
{
|
|
1188
1100
|
cache: "dropdown",
|
|
1189
|
-
parent:
|
|
1190
|
-
button:
|
|
1101
|
+
parent: o,
|
|
1102
|
+
button: o.panel,
|
|
1191
1103
|
size: "fit"
|
|
1192
1104
|
},
|
|
1193
1105
|
[
|
|
@@ -1198,26 +1110,26 @@ function st({ handleTimeSelect: e }) {
|
|
|
1198
1110
|
{ class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
|
|
1199
1111
|
[
|
|
1200
1112
|
// Hours column
|
|
1201
|
-
|
|
1202
|
-
items: Array.from({ length: 12 }, (
|
|
1113
|
+
T({
|
|
1114
|
+
items: Array.from({ length: 12 }, (l, r) => r + 1),
|
|
1203
1115
|
handleTimeSelect: e,
|
|
1204
|
-
state:
|
|
1116
|
+
state: o.state,
|
|
1205
1117
|
stateValue: "hour",
|
|
1206
1118
|
pad: !0
|
|
1207
1119
|
}),
|
|
1208
1120
|
// Minutes column
|
|
1209
|
-
|
|
1210
|
-
items: Array.from({ length: 60 }, (
|
|
1121
|
+
T({
|
|
1122
|
+
items: Array.from({ length: 60 }, (l, r) => r),
|
|
1211
1123
|
handleTimeSelect: e,
|
|
1212
|
-
state:
|
|
1124
|
+
state: o.state,
|
|
1213
1125
|
stateValue: "minute",
|
|
1214
1126
|
pad: !0
|
|
1215
1127
|
}),
|
|
1216
1128
|
// AM/PM column
|
|
1217
|
-
|
|
1129
|
+
T({
|
|
1218
1130
|
items: ["AM", "PM"],
|
|
1219
1131
|
handleTimeSelect: e,
|
|
1220
|
-
state:
|
|
1132
|
+
state: o.state,
|
|
1221
1133
|
stateValue: "meridian"
|
|
1222
1134
|
})
|
|
1223
1135
|
]
|
|
@@ -1230,20 +1142,20 @@ function st({ handleTimeSelect: e }) {
|
|
|
1230
1142
|
]
|
|
1231
1143
|
);
|
|
1232
1144
|
}
|
|
1233
|
-
function
|
|
1145
|
+
function E(e) {
|
|
1234
1146
|
if (!e)
|
|
1235
1147
|
return { hour: null, minute: null, meridian: null };
|
|
1236
|
-
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i,
|
|
1237
|
-
if (!
|
|
1148
|
+
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1149
|
+
if (!s)
|
|
1238
1150
|
return { hour: null, minute: null, meridian: null };
|
|
1239
|
-
let [,
|
|
1240
|
-
return
|
|
1241
|
-
hour:
|
|
1242
|
-
minute:
|
|
1243
|
-
meridian:
|
|
1151
|
+
let [, o, l, , r] = s, i = parseInt(o, 10), g = parseInt(l, 10);
|
|
1152
|
+
return i < 0 || i > 23 || g < 0 || g > 59 ? { hour: null, minute: null, meridian: null } : (r ? (r = r.toUpperCase(), r === "PM" && i < 12 ? i += 12 : r === "AM" && i === 12 && (i = 12)) : i === 0 ? (r = "AM", i = 12) : i < 12 ? r = "AM" : i === 12 ? r = "PM" : (r = "PM", i -= 12), {
|
|
1153
|
+
hour: i.toString().padStart(2, "0"),
|
|
1154
|
+
minute: g.toString().padStart(2, "0"),
|
|
1155
|
+
meridian: r
|
|
1244
1156
|
});
|
|
1245
1157
|
}
|
|
1246
|
-
const
|
|
1158
|
+
const $t = x(
|
|
1247
1159
|
{
|
|
1248
1160
|
/**
|
|
1249
1161
|
* The initial shallow state of the TimePicker.
|
|
@@ -1251,13 +1163,13 @@ const Ft = w(
|
|
|
1251
1163
|
* @member {object} state
|
|
1252
1164
|
*/
|
|
1253
1165
|
state() {
|
|
1254
|
-
const e = this.selectedTime ?? null, { hour: t, minute:
|
|
1166
|
+
const e = this.selectedTime ?? null, { hour: t, minute: s, meridian: o } = E(e);
|
|
1255
1167
|
return {
|
|
1256
1168
|
selectedTime: e,
|
|
1257
1169
|
open: !1,
|
|
1258
1170
|
hour: t,
|
|
1259
|
-
minute:
|
|
1260
|
-
meridian:
|
|
1171
|
+
minute: s,
|
|
1172
|
+
meridian: o
|
|
1261
1173
|
};
|
|
1262
1174
|
},
|
|
1263
1175
|
/**
|
|
@@ -1267,11 +1179,11 @@ const Ft = w(
|
|
|
1267
1179
|
*/
|
|
1268
1180
|
after() {
|
|
1269
1181
|
if (this.input.value) {
|
|
1270
|
-
const { hour: e, minute: t, meridian:
|
|
1182
|
+
const { hour: e, minute: t, meridian: s } = E(this.input.value);
|
|
1271
1183
|
this.state.set({
|
|
1272
1184
|
hour: e,
|
|
1273
1185
|
minute: t,
|
|
1274
|
-
meridian:
|
|
1186
|
+
meridian: s,
|
|
1275
1187
|
selectedTime: this.input.value
|
|
1276
1188
|
});
|
|
1277
1189
|
}
|
|
@@ -1282,32 +1194,32 @@ const Ft = w(
|
|
|
1282
1194
|
* @returns {object}
|
|
1283
1195
|
*/
|
|
1284
1196
|
render() {
|
|
1285
|
-
const e = (
|
|
1286
|
-
if (
|
|
1287
|
-
const
|
|
1288
|
-
this.state.selectedTime =
|
|
1197
|
+
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: l }) => {
|
|
1198
|
+
if (s && (this.state.hour = s), o && (this.state.minute = o), l && (this.state.meridian = l), this.state.hour && this.state.minute && this.state.meridian) {
|
|
1199
|
+
const r = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1200
|
+
this.state.selectedTime = r, this.state.open = !1, this.input.value = r, typeof this.change == "function" && this.change(r);
|
|
1289
1201
|
}
|
|
1290
1202
|
};
|
|
1291
1203
|
return n(
|
|
1292
1204
|
{ class: "relative w-full max-w-[320px]" },
|
|
1293
1205
|
[
|
|
1294
|
-
|
|
1206
|
+
Xe({
|
|
1295
1207
|
toggleOpen: e,
|
|
1296
1208
|
bind: this.bind,
|
|
1297
1209
|
required: this.required
|
|
1298
1210
|
}),
|
|
1299
|
-
|
|
1211
|
+
Ze({
|
|
1300
1212
|
handleTimeSelect: t
|
|
1301
1213
|
})
|
|
1302
1214
|
]
|
|
1303
1215
|
);
|
|
1304
1216
|
}
|
|
1305
1217
|
}
|
|
1306
|
-
),
|
|
1307
|
-
|
|
1308
|
-
]),
|
|
1309
|
-
|
|
1310
|
-
]),
|
|
1218
|
+
), et = (e, t) => n({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${t}` }, [
|
|
1219
|
+
D({ size: "lg" }, e)
|
|
1220
|
+
]), tt = ({ title: e }) => M({ class: "flex flex-auto items-center" }, [
|
|
1221
|
+
B({ class: "text-lg font-semibold" }, e)
|
|
1222
|
+
]), st = c((e, t) => X(
|
|
1311
1223
|
{
|
|
1312
1224
|
class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
|
|
1313
1225
|
rounded-lg flex flex-auto flex-col
|
|
@@ -1318,18 +1230,18 @@ const Ft = w(
|
|
|
1318
1230
|
[
|
|
1319
1231
|
n({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
|
|
1320
1232
|
// Icon and content
|
|
1321
|
-
e.icon &&
|
|
1233
|
+
e.icon && et(e.icon, e.iconColor),
|
|
1322
1234
|
n({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1323
1235
|
n({ class: "flex flex-auto flex-col space-y-2" }, [
|
|
1324
|
-
|
|
1236
|
+
tt(e),
|
|
1325
1237
|
e.description && p({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e.description),
|
|
1326
1238
|
n({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t)
|
|
1327
1239
|
]),
|
|
1328
|
-
e.buttons &&
|
|
1240
|
+
e.buttons && $({ class: "flex flex-col-reverse sm:flex-row sm:justify-end mt-6 gap-2 sm:gap-0 sm:space-x-2" }, e.buttons)
|
|
1329
1241
|
])
|
|
1330
1242
|
])
|
|
1331
1243
|
]
|
|
1332
|
-
)),
|
|
1244
|
+
)), ot = (e) => q.render(e, app.root), j = {
|
|
1333
1245
|
info: {
|
|
1334
1246
|
borderColor: "border-blue-500",
|
|
1335
1247
|
bgColor: "bg-muted/10",
|
|
@@ -1356,39 +1268,14 @@ const Ft = w(
|
|
|
1356
1268
|
iconColor: "text-muted-foreground"
|
|
1357
1269
|
}
|
|
1358
1270
|
};
|
|
1359
|
-
class
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
* @member {string} description
|
|
1368
|
-
*/
|
|
1369
|
-
i(this, "description", null);
|
|
1370
|
-
/**
|
|
1371
|
-
* @member {string} Type
|
|
1372
|
-
* @default ''
|
|
1373
|
-
* @values 'info', 'warning', 'destructive', 'success', 'default'
|
|
1374
|
-
*/
|
|
1375
|
-
i(this, "type", "");
|
|
1376
|
-
/**
|
|
1377
|
-
* @member {string} icon
|
|
1378
|
-
*/
|
|
1379
|
-
i(this, "icon", null);
|
|
1380
|
-
/**
|
|
1381
|
-
* @member {function|null} onClose
|
|
1382
|
-
*/
|
|
1383
|
-
i(this, "onClose", null);
|
|
1384
|
-
/**
|
|
1385
|
-
* @member {boolean} hideFooter
|
|
1386
|
-
*/
|
|
1387
|
-
i(this, "hideFooter", !1);
|
|
1388
|
-
/**
|
|
1389
|
-
* @member {Array|null} buttons
|
|
1390
|
-
*/
|
|
1391
|
-
i(this, "buttons", null);
|
|
1271
|
+
class nt extends b {
|
|
1272
|
+
/**
|
|
1273
|
+
* This will declare the props for the compiler.
|
|
1274
|
+
*
|
|
1275
|
+
* @returns {void}
|
|
1276
|
+
*/
|
|
1277
|
+
declareProps() {
|
|
1278
|
+
this.title = null, this.description = null, this.type = "", this.icon = null, this.onClose = null, this.hideFooter = !1, this.buttons = null;
|
|
1392
1279
|
}
|
|
1393
1280
|
/**
|
|
1394
1281
|
* This will render the modal component.
|
|
@@ -1396,13 +1283,13 @@ class it extends x {
|
|
|
1396
1283
|
* @returns {object}
|
|
1397
1284
|
*/
|
|
1398
1285
|
render() {
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
}, { borderColor: s, bgColor:
|
|
1402
|
-
return
|
|
1286
|
+
const t = (g) => {
|
|
1287
|
+
g.target === this.panel && this.close();
|
|
1288
|
+
}, { borderColor: s, bgColor: o, iconColor: l } = j[this.type] || j.default, r = `${this.getMainClass()} ${o} ${s}`, i = this.title || "Dialog Title";
|
|
1289
|
+
return st({
|
|
1403
1290
|
class: r,
|
|
1404
|
-
title:
|
|
1405
|
-
click:
|
|
1291
|
+
title: i,
|
|
1292
|
+
click: t,
|
|
1406
1293
|
icon: this.icon,
|
|
1407
1294
|
iconColor: l,
|
|
1408
1295
|
description: this.description,
|
|
@@ -1416,7 +1303,7 @@ class it extends x {
|
|
|
1416
1303
|
*/
|
|
1417
1304
|
getButtons() {
|
|
1418
1305
|
return this.hideFooter ? null : this.buttons ? this.buttons : [
|
|
1419
|
-
|
|
1306
|
+
u({ variant: "outline", click: () => this.close() }, "Close")
|
|
1420
1307
|
];
|
|
1421
1308
|
}
|
|
1422
1309
|
/**
|
|
@@ -1443,7 +1330,7 @@ class it extends x {
|
|
|
1443
1330
|
* @returns {void}
|
|
1444
1331
|
*/
|
|
1445
1332
|
open() {
|
|
1446
|
-
|
|
1333
|
+
ot(this), this.panel.showModal(), this.state.open = !0;
|
|
1447
1334
|
}
|
|
1448
1335
|
/**
|
|
1449
1336
|
* This will close the modal.
|
|
@@ -1454,17 +1341,14 @@ class it extends x {
|
|
|
1454
1341
|
this.state.open = !1, this.panel.close(), typeof this.onClose == "function" && this.onClose(), this.destroy();
|
|
1455
1342
|
}
|
|
1456
1343
|
}
|
|
1457
|
-
class
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
* @member {function} confirmed
|
|
1466
|
-
*/
|
|
1467
|
-
i(this, "confirmed", null);
|
|
1344
|
+
class Mt extends nt {
|
|
1345
|
+
/**
|
|
1346
|
+
* This will declare the props for the compiler.
|
|
1347
|
+
*
|
|
1348
|
+
* @returns {void}
|
|
1349
|
+
*/
|
|
1350
|
+
declareProps() {
|
|
1351
|
+
this.confirmTextLabel = null, this.confirmed = null;
|
|
1468
1352
|
}
|
|
1469
1353
|
/**
|
|
1470
1354
|
* This will get the buttons for the modal.
|
|
@@ -1472,10 +1356,10 @@ class Et extends it {
|
|
|
1472
1356
|
* @returns {array}
|
|
1473
1357
|
*/
|
|
1474
1358
|
getButtons() {
|
|
1475
|
-
const
|
|
1359
|
+
const t = this.confirmTextLabel || "Confirm";
|
|
1476
1360
|
return [
|
|
1477
|
-
|
|
1478
|
-
|
|
1361
|
+
u({ variant: "outline", click: () => this.close() }, "Cancel"),
|
|
1362
|
+
u({ variant: "primary", click: () => this.confirm() }, t)
|
|
1479
1363
|
];
|
|
1480
1364
|
}
|
|
1481
1365
|
/**
|
|
@@ -1488,42 +1372,42 @@ class Et extends it {
|
|
|
1488
1372
|
}
|
|
1489
1373
|
}
|
|
1490
1374
|
export {
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1375
|
+
ht as A,
|
|
1376
|
+
St as B,
|
|
1377
|
+
It as C,
|
|
1378
|
+
ae as D,
|
|
1379
|
+
st as E,
|
|
1380
|
+
be as F,
|
|
1381
|
+
nt as G,
|
|
1382
|
+
xt as M,
|
|
1383
|
+
wt as N,
|
|
1384
|
+
Re as P,
|
|
1385
|
+
bt as S,
|
|
1386
|
+
yt as T,
|
|
1387
|
+
he as a,
|
|
1388
|
+
mt as b,
|
|
1389
|
+
fe as c,
|
|
1390
|
+
xe as d,
|
|
1391
|
+
we as e,
|
|
1392
|
+
ye as f,
|
|
1393
|
+
Ce as g,
|
|
1394
|
+
ft as h,
|
|
1395
|
+
Se as i,
|
|
1396
|
+
gt as j,
|
|
1397
|
+
pt as k,
|
|
1398
|
+
Me as l,
|
|
1399
|
+
vt as m,
|
|
1400
|
+
Ct as n,
|
|
1401
|
+
kt as o,
|
|
1402
|
+
w as p,
|
|
1403
|
+
f as q,
|
|
1404
|
+
Ne as r,
|
|
1405
|
+
Dt as s,
|
|
1406
|
+
_e as t,
|
|
1407
|
+
We as u,
|
|
1408
|
+
Tt as v,
|
|
1409
|
+
At as w,
|
|
1410
|
+
Bt as x,
|
|
1411
|
+
$t as y,
|
|
1412
|
+
Mt as z
|
|
1529
1413
|
};
|