@opencxh/ui-kit 3.20.0 → 3.28.0
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +940 -930
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { clsx as Te } from "clsx";
|
|
2
2
|
import { jsxs as c, jsx as e, Fragment as Me } from "react/jsx-runtime";
|
|
3
|
-
import { VideoOff as Ae, User as Ie, MicOff as je, Mic as Be, ChevronDown as Pe, FileText as
|
|
4
|
-
import se, { useRef as X, useEffect as
|
|
5
|
-
function
|
|
3
|
+
import { VideoOff as Ae, User as Ie, MicOff as je, Mic as Be, ChevronDown as Pe, FileText as xe, HardDrive as Ne, X as Oe, ArrowLeft as Ee, Search as Ve, FolderPlus as _e, Upload as Fe, Folder as we, ChevronDownIcon as We, ChevronRight as Re } from "lucide-react";
|
|
4
|
+
import se, { useRef as X, useEffect as G, forwardRef as ce, useState as _, useCallback as ae, useMemo as ie, createContext as qe, Component as He } from "react";
|
|
5
|
+
function g(...r) {
|
|
6
6
|
return Te(r);
|
|
7
7
|
}
|
|
8
8
|
function Gr(r) {
|
|
@@ -13,12 +13,12 @@ function Kr(r) {
|
|
|
13
13
|
}
|
|
14
14
|
function Jr({ tiles: r, pinned: n, className: t }) {
|
|
15
15
|
if (n)
|
|
16
|
-
return /* @__PURE__ */ c("div", { className:
|
|
16
|
+
return /* @__PURE__ */ c("div", { className: g("flex flex-col md:flex-row gap-2 h-full", t), children: [
|
|
17
17
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-[240px]", children: n }),
|
|
18
18
|
r.length > 0 && /* @__PURE__ */ e("div", { className: "flex md:flex-col gap-2 md:w-48 overflow-auto", children: r.map((o, i) => /* @__PURE__ */ e("div", { className: "min-w-[160px] md:min-w-0", children: o }, i)) })
|
|
19
19
|
] });
|
|
20
20
|
const a = r.length <= 1 ? "grid-cols-1" : r.length <= 4 ? "grid-cols-2" : r.length <= 9 ? "grid-cols-3" : "grid-cols-4";
|
|
21
|
-
return /* @__PURE__ */ e("div", { className:
|
|
21
|
+
return /* @__PURE__ */ e("div", { className: g("grid gap-2 h-full", a, t), children: r.map((o, i) => /* @__PURE__ */ e("div", { children: o }, i)) });
|
|
22
22
|
}
|
|
23
23
|
function Yr({
|
|
24
24
|
name: r,
|
|
@@ -32,7 +32,7 @@ function Yr({
|
|
|
32
32
|
return /* @__PURE__ */ c(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
35
|
+
className: g(
|
|
36
36
|
"relative rounded-lg overflow-hidden bg-gray-800 aspect-video flex items-center justify-center",
|
|
37
37
|
a && "ring-2 ring-emerald-400",
|
|
38
38
|
h
|
|
@@ -49,7 +49,7 @@ function Yr({
|
|
|
49
49
|
}
|
|
50
50
|
function Zr({ attach: r, active: n = !0, mirrored: t = !1, className: a }) {
|
|
51
51
|
const o = X(null);
|
|
52
|
-
return
|
|
52
|
+
return G(() => {
|
|
53
53
|
if (!n || !o.current) return;
|
|
54
54
|
const i = r(o.current);
|
|
55
55
|
return () => {
|
|
@@ -59,7 +59,7 @@ function Zr({ attach: r, active: n = !0, mirrored: t = !1, className: a }) {
|
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
ref: o,
|
|
62
|
-
className:
|
|
62
|
+
className: g(
|
|
63
63
|
"w-full h-full bg-gray-900 overflow-hidden",
|
|
64
64
|
t && "[&>*]:scale-x-[-1]",
|
|
65
65
|
a
|
|
@@ -96,18 +96,18 @@ const Ue = {
|
|
|
96
96
|
leftIcon: o,
|
|
97
97
|
rightIcon: i,
|
|
98
98
|
iconOnly: h = !1,
|
|
99
|
-
className:
|
|
100
|
-
children:
|
|
101
|
-
disabled:
|
|
102
|
-
...
|
|
99
|
+
className: b,
|
|
100
|
+
children: x,
|
|
101
|
+
disabled: y,
|
|
102
|
+
...u
|
|
103
103
|
}, l) => {
|
|
104
|
-
const d =
|
|
104
|
+
const d = y || a;
|
|
105
105
|
return /* @__PURE__ */ c(
|
|
106
106
|
"button",
|
|
107
107
|
{
|
|
108
108
|
ref: l,
|
|
109
109
|
type: "button",
|
|
110
|
-
className:
|
|
110
|
+
className: g(
|
|
111
111
|
// Base styles
|
|
112
112
|
"inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200",
|
|
113
113
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
@@ -120,15 +120,15 @@ const Ue = {
|
|
|
120
120
|
t && "w-full",
|
|
121
121
|
// Loading state
|
|
122
122
|
a && "cursor-wait",
|
|
123
|
-
|
|
123
|
+
b
|
|
124
124
|
),
|
|
125
125
|
disabled: d,
|
|
126
|
-
...
|
|
126
|
+
...u,
|
|
127
127
|
children: [
|
|
128
128
|
a && /* @__PURE__ */ c(
|
|
129
129
|
"svg",
|
|
130
130
|
{
|
|
131
|
-
className:
|
|
131
|
+
className: g(
|
|
132
132
|
"animate-spin",
|
|
133
133
|
h ? "h-4 w-4" : "h-4 w-4 mr-2"
|
|
134
134
|
),
|
|
@@ -157,10 +157,10 @@ const Ue = {
|
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
159
|
),
|
|
160
|
-
!a && o && /* @__PURE__ */ e("span", { className:
|
|
161
|
-
!h &&
|
|
162
|
-
!a && i && /* @__PURE__ */ e("span", { className:
|
|
163
|
-
h && !a && !o && !i &&
|
|
160
|
+
!a && o && /* @__PURE__ */ e("span", { className: g("flex-shrink-0", !h && "mr-2"), children: o }),
|
|
161
|
+
!h && x,
|
|
162
|
+
!a && i && /* @__PURE__ */ e("span", { className: g("flex-shrink-0", !h && "ml-2"), children: i }),
|
|
163
|
+
h && !a && !o && !i && x
|
|
164
164
|
]
|
|
165
165
|
}
|
|
166
166
|
);
|
|
@@ -174,7 +174,7 @@ const Xr = ({
|
|
|
174
174
|
attached: a = !0,
|
|
175
175
|
className: o
|
|
176
176
|
}) => {
|
|
177
|
-
const i =
|
|
177
|
+
const i = g(
|
|
178
178
|
"inline-flex",
|
|
179
179
|
{
|
|
180
180
|
// Orientation
|
|
@@ -205,12 +205,12 @@ const Xr = ({
|
|
|
205
205
|
external: o = !1,
|
|
206
206
|
className: i,
|
|
207
207
|
children: h,
|
|
208
|
-
href:
|
|
209
|
-
target:
|
|
210
|
-
rel:
|
|
211
|
-
...
|
|
208
|
+
href: b,
|
|
209
|
+
target: x,
|
|
210
|
+
rel: y,
|
|
211
|
+
...u
|
|
212
212
|
}) => {
|
|
213
|
-
const l = o ||
|
|
213
|
+
const l = o || b && (b.startsWith("http") || b.startsWith("mailto:")), d = g(
|
|
214
214
|
// Base styles
|
|
215
215
|
"inline-flex items-center gap-1 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
216
216
|
// Size variants
|
|
@@ -264,13 +264,13 @@ const Xr = ({
|
|
|
264
264
|
"opacity-50 cursor-not-allowed pointer-events-none": a
|
|
265
265
|
},
|
|
266
266
|
i
|
|
267
|
-
),
|
|
268
|
-
...
|
|
269
|
-
href: a ? void 0 :
|
|
270
|
-
target: l ? "_blank" :
|
|
271
|
-
rel: l ? "noopener noreferrer" :
|
|
267
|
+
), f = {
|
|
268
|
+
...u,
|
|
269
|
+
href: a ? void 0 : b,
|
|
270
|
+
target: l ? "_blank" : x,
|
|
271
|
+
rel: l ? "noopener noreferrer" : y
|
|
272
272
|
};
|
|
273
|
-
return /* @__PURE__ */ c("a", { className: d, ...
|
|
273
|
+
return /* @__PURE__ */ c("a", { className: d, ...f, children: [
|
|
274
274
|
h,
|
|
275
275
|
l && /* @__PURE__ */ e(
|
|
276
276
|
"svg",
|
|
@@ -309,22 +309,22 @@ function Ye({
|
|
|
309
309
|
options: i,
|
|
310
310
|
disabled: h = !1
|
|
311
311
|
}) {
|
|
312
|
-
const [
|
|
313
|
-
|
|
312
|
+
const [b, x] = _(!1), y = X(null), u = ae(() => {
|
|
313
|
+
x((l) => !l);
|
|
314
314
|
}, []);
|
|
315
|
-
return
|
|
315
|
+
return G(() => {
|
|
316
316
|
const l = (d) => {
|
|
317
|
-
|
|
317
|
+
y.current && !y.current.contains(d.target) && x(!1);
|
|
318
318
|
};
|
|
319
319
|
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
320
|
-
}, []), /* @__PURE__ */ c("div", { ref:
|
|
320
|
+
}, []), /* @__PURE__ */ c("div", { ref: y, className: "relative inline-flex items-center gap-px", children: [
|
|
321
321
|
/* @__PURE__ */ c(
|
|
322
322
|
"button",
|
|
323
323
|
{
|
|
324
324
|
type: "button",
|
|
325
325
|
onClick: n,
|
|
326
326
|
disabled: h,
|
|
327
|
-
className:
|
|
327
|
+
className: g(
|
|
328
328
|
"inline-flex items-center justify-center font-medium transition-colors duration-200",
|
|
329
329
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
330
330
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
@@ -342,9 +342,9 @@ function Ye({
|
|
|
342
342
|
"button",
|
|
343
343
|
{
|
|
344
344
|
type: "button",
|
|
345
|
-
onClick:
|
|
345
|
+
onClick: u,
|
|
346
346
|
disabled: h,
|
|
347
|
-
className:
|
|
347
|
+
className: g(
|
|
348
348
|
"inline-flex items-center justify-center font-medium transition-colors duration-200",
|
|
349
349
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
350
350
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
@@ -355,14 +355,14 @@ function Ye({
|
|
|
355
355
|
children: /* @__PURE__ */ e(Pe, { className: "h-4 w-4" })
|
|
356
356
|
}
|
|
357
357
|
),
|
|
358
|
-
|
|
358
|
+
b && i.length > 0 && /* @__PURE__ */ e("div", { className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg border border-gray-200 bg-white shadow-lg py-1", children: i.map((l) => /* @__PURE__ */ e(
|
|
359
359
|
"button",
|
|
360
360
|
{
|
|
361
361
|
type: "button",
|
|
362
362
|
onClick: () => {
|
|
363
|
-
l.onClick(),
|
|
363
|
+
l.onClick(), x(!1);
|
|
364
364
|
},
|
|
365
|
-
className:
|
|
365
|
+
className: g(
|
|
366
366
|
"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
|
|
367
367
|
l.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "text-gray-700"
|
|
368
368
|
),
|
|
@@ -391,22 +391,22 @@ const Ze = {
|
|
|
391
391
|
indeterminate: o = !1,
|
|
392
392
|
containerClassName: i,
|
|
393
393
|
labelClassName: h,
|
|
394
|
-
className:
|
|
395
|
-
id:
|
|
396
|
-
...
|
|
397
|
-
},
|
|
398
|
-
const l =
|
|
394
|
+
className: b,
|
|
395
|
+
id: x,
|
|
396
|
+
...y
|
|
397
|
+
}, u) => {
|
|
398
|
+
const l = x || `checkbox-${Math.random().toString(36).substr(2, 9)}`, d = !!t;
|
|
399
399
|
return se.useEffect(() => {
|
|
400
|
-
|
|
401
|
-
}, [o,
|
|
400
|
+
u && typeof u == "object" && u.current && (u.current.indeterminate = o);
|
|
401
|
+
}, [o, u]), /* @__PURE__ */ c("div", { className: g("flex flex-col", i), children: [
|
|
402
402
|
/* @__PURE__ */ c("div", { className: "flex items-start", children: [
|
|
403
403
|
/* @__PURE__ */ e("div", { className: "flex items-center h-5", children: /* @__PURE__ */ e(
|
|
404
404
|
"input",
|
|
405
405
|
{
|
|
406
|
-
ref:
|
|
406
|
+
ref: u,
|
|
407
407
|
id: l,
|
|
408
408
|
type: "checkbox",
|
|
409
|
-
className:
|
|
409
|
+
className: g(
|
|
410
410
|
// Base styles
|
|
411
411
|
"rounded border transition-colors duration-200",
|
|
412
412
|
"focus:ring-2 focus:ring-offset-2 focus:outline-none",
|
|
@@ -415,9 +415,9 @@ const Ze = {
|
|
|
415
415
|
Ze[a],
|
|
416
416
|
// State styles
|
|
417
417
|
d ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-primary focus:border-primary focus:ring-primary dark:border-gray-600 dark:bg-secondary-800",
|
|
418
|
-
|
|
418
|
+
b
|
|
419
419
|
),
|
|
420
|
-
...
|
|
420
|
+
...y
|
|
421
421
|
}
|
|
422
422
|
) }),
|
|
423
423
|
r && /* @__PURE__ */ c("div", { className: "ml-3 flex-1", children: [
|
|
@@ -425,7 +425,7 @@ const Ze = {
|
|
|
425
425
|
"label",
|
|
426
426
|
{
|
|
427
427
|
htmlFor: l,
|
|
428
|
-
className:
|
|
428
|
+
className: g(
|
|
429
429
|
"font-medium cursor-pointer",
|
|
430
430
|
d ? "text-error" : "text-secondary-900 dark:text-secondary-100",
|
|
431
431
|
Xe[a],
|
|
@@ -450,47 +450,47 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
450
450
|
required: o = !1,
|
|
451
451
|
size: i = "md",
|
|
452
452
|
className: h,
|
|
453
|
-
minDate:
|
|
454
|
-
maxDate:
|
|
455
|
-
format:
|
|
456
|
-
},
|
|
457
|
-
const [l, d] =
|
|
458
|
-
|
|
459
|
-
const z = (
|
|
460
|
-
|
|
453
|
+
minDate: b,
|
|
454
|
+
maxDate: x,
|
|
455
|
+
format: y = "MM/dd/yyyy"
|
|
456
|
+
}, u) => {
|
|
457
|
+
const [l, d] = _(!1), [f, C] = _(() => r || /* @__PURE__ */ new Date()), N = X(null);
|
|
458
|
+
G(() => {
|
|
459
|
+
const z = (v) => {
|
|
460
|
+
N.current && !N.current.contains(v.target) && d(!1);
|
|
461
461
|
};
|
|
462
462
|
return l && document.addEventListener("mousedown", z), () => {
|
|
463
463
|
document.removeEventListener("mousedown", z);
|
|
464
464
|
};
|
|
465
465
|
}, [l]);
|
|
466
|
-
const
|
|
466
|
+
const k = (z) => {
|
|
467
467
|
if (!z) return "";
|
|
468
|
-
const
|
|
469
|
-
switch (
|
|
468
|
+
const v = z.getDate().toString().padStart(2, "0"), T = (z.getMonth() + 1).toString().padStart(2, "0"), m = z.getFullYear();
|
|
469
|
+
switch (y) {
|
|
470
470
|
case "dd/MM/yyyy":
|
|
471
|
-
return `${
|
|
471
|
+
return `${v}/${T}/${m}`;
|
|
472
472
|
case "yyyy-MM-dd":
|
|
473
|
-
return `${
|
|
473
|
+
return `${m}-${T}-${v}`;
|
|
474
474
|
case "MM/dd/yyyy":
|
|
475
475
|
default:
|
|
476
|
-
return `${T}/${
|
|
476
|
+
return `${T}/${v}/${m}`;
|
|
477
477
|
}
|
|
478
478
|
}, B = () => {
|
|
479
|
-
const z =
|
|
480
|
-
|
|
481
|
-
const $ = [], L = new Date(
|
|
479
|
+
const z = f.getFullYear(), v = f.getMonth(), T = new Date(z, v, 1), m = new Date(T);
|
|
480
|
+
m.setDate(m.getDate() - T.getDay());
|
|
481
|
+
const $ = [], L = new Date(m);
|
|
482
482
|
for (let D = 0; D < 42; D++)
|
|
483
483
|
$.push(new Date(L)), L.setDate(L.getDate() + 1);
|
|
484
484
|
return $;
|
|
485
|
-
},
|
|
486
|
-
z.getMonth() ===
|
|
487
|
-
}, H = () => {
|
|
488
|
-
N(new Date(p.getFullYear(), p.getMonth() - 1, 1));
|
|
489
|
-
}, G = () => {
|
|
490
|
-
N(new Date(p.getFullYear(), p.getMonth() + 1, 1));
|
|
485
|
+
}, p = (z) => {
|
|
486
|
+
z.getMonth() === f.getMonth() && (b && z < b || x && z > x || (n?.(z), d(!1)));
|
|
491
487
|
}, q = () => {
|
|
488
|
+
C(new Date(f.getFullYear(), f.getMonth() - 1, 1));
|
|
489
|
+
}, K = () => {
|
|
490
|
+
C(new Date(f.getFullYear(), f.getMonth() + 1, 1));
|
|
491
|
+
}, H = () => {
|
|
492
492
|
n?.(null), d(!1);
|
|
493
|
-
}, F =
|
|
493
|
+
}, F = g(
|
|
494
494
|
"w-full border border-neutral-100 dark:border-neutral-600 rounded-md transition-colors duration-200",
|
|
495
495
|
"bg-white dark:bg-neutral-800 text-gray-700 dark:text-gray-300",
|
|
496
496
|
"placeholder:text-gray-800 dark:placeholder:text-gray-500",
|
|
@@ -517,20 +517,20 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
517
517
|
"November",
|
|
518
518
|
"December"
|
|
519
519
|
];
|
|
520
|
-
return /* @__PURE__ */ c("div", { ref:
|
|
520
|
+
return /* @__PURE__ */ c("div", { ref: N, className: "relative", children: [
|
|
521
521
|
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
522
522
|
/* @__PURE__ */ e(
|
|
523
523
|
"input",
|
|
524
524
|
{
|
|
525
|
-
ref:
|
|
525
|
+
ref: u,
|
|
526
526
|
type: "text",
|
|
527
|
-
value:
|
|
527
|
+
value: k(r ?? null),
|
|
528
528
|
placeholder: t,
|
|
529
529
|
disabled: a,
|
|
530
530
|
required: o,
|
|
531
531
|
readOnly: !0,
|
|
532
532
|
onClick: () => !a && d(!l),
|
|
533
|
-
className:
|
|
533
|
+
className: g(F, "pr-10 cursor-pointer")
|
|
534
534
|
}
|
|
535
535
|
),
|
|
536
536
|
/* @__PURE__ */ e(
|
|
@@ -549,52 +549,52 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
549
549
|
/* @__PURE__ */ e(
|
|
550
550
|
"button",
|
|
551
551
|
{
|
|
552
|
-
onClick:
|
|
552
|
+
onClick: q,
|
|
553
553
|
className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
|
|
554
554
|
children: /* @__PURE__ */ e(er, {})
|
|
555
555
|
}
|
|
556
556
|
),
|
|
557
557
|
/* @__PURE__ */ c("h3", { className: "text-sm font-medium text-neutral-900 dark:text-neutral-100", children: [
|
|
558
|
-
J[
|
|
558
|
+
J[f.getMonth()],
|
|
559
559
|
" ",
|
|
560
|
-
|
|
560
|
+
f.getFullYear()
|
|
561
561
|
] }),
|
|
562
562
|
/* @__PURE__ */ e(
|
|
563
563
|
"button",
|
|
564
564
|
{
|
|
565
|
-
onClick:
|
|
565
|
+
onClick: K,
|
|
566
566
|
className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
|
|
567
567
|
children: /* @__PURE__ */ e(rr, {})
|
|
568
568
|
}
|
|
569
569
|
)
|
|
570
570
|
] }),
|
|
571
571
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((z) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-neutral-500 dark:text-neutral-400 text-center py-1", children: z }, z)) }),
|
|
572
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: E.map((z,
|
|
573
|
-
const T = z.getMonth() ===
|
|
572
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: E.map((z, v) => {
|
|
573
|
+
const T = z.getMonth() === f.getMonth(), m = r && z.toDateString() === r.toDateString(), $ = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), L = !T || b && z < b || x && z > x;
|
|
574
574
|
return /* @__PURE__ */ e(
|
|
575
575
|
"button",
|
|
576
576
|
{
|
|
577
|
-
onClick: () => !L &&
|
|
577
|
+
onClick: () => !L && p(z),
|
|
578
578
|
disabled: L,
|
|
579
|
-
className:
|
|
579
|
+
className: g(
|
|
580
580
|
"w-8 h-8 text-sm rounded transition-colors duration-200",
|
|
581
581
|
{
|
|
582
|
-
"text-neutral-900 dark:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-700": T && !
|
|
583
|
-
"bg-primary text-white":
|
|
584
|
-
"bg-neutral-100 dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100": $ && !
|
|
582
|
+
"text-neutral-900 dark:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-700": T && !m && !L,
|
|
583
|
+
"bg-primary text-white": m,
|
|
584
|
+
"bg-neutral-100 dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100": $ && !m,
|
|
585
585
|
"text-neutral-300 dark:text-neutral-600 cursor-not-allowed": L
|
|
586
586
|
}
|
|
587
587
|
),
|
|
588
588
|
children: z.getDate()
|
|
589
589
|
},
|
|
590
|
-
|
|
590
|
+
v
|
|
591
591
|
);
|
|
592
592
|
}) }),
|
|
593
593
|
/* @__PURE__ */ c("div", { className: "flex justify-between items-center mt-4 pt-3 border-t border-neutral-200 dark:border-neutral-700", children: [
|
|
594
594
|
/* @__PURE__ */ e(
|
|
595
595
|
"button",
|
|
596
596
|
{
|
|
597
|
-
onClick:
|
|
597
|
+
onClick: H,
|
|
598
598
|
className: "text-sm text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300",
|
|
599
599
|
children: "Clear"
|
|
600
600
|
}
|
|
@@ -651,7 +651,7 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
651
651
|
md: "px-3 py-2 text-sm",
|
|
652
652
|
lg: "px-3 py-2 text-sm",
|
|
653
653
|
full: "px-3 py-2 text-sm"
|
|
654
|
-
},
|
|
654
|
+
}, pe = {
|
|
655
655
|
sm: "h-4 w-4",
|
|
656
656
|
md: "h-5 w-5",
|
|
657
657
|
lg: "h-6 w-6",
|
|
@@ -665,91 +665,91 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
665
665
|
fullWidth: o = !1,
|
|
666
666
|
startIcon: i = /* @__PURE__ */ e(tr, {}),
|
|
667
667
|
loading: h = !1,
|
|
668
|
-
containerClassName:
|
|
669
|
-
labelClassName:
|
|
670
|
-
className:
|
|
671
|
-
id:
|
|
668
|
+
containerClassName: b,
|
|
669
|
+
labelClassName: x,
|
|
670
|
+
className: y,
|
|
671
|
+
id: u,
|
|
672
672
|
options: l,
|
|
673
673
|
onRemoteSearch: d,
|
|
674
|
-
onSelect:
|
|
675
|
-
debounceTime:
|
|
676
|
-
value:
|
|
677
|
-
onChange:
|
|
674
|
+
onSelect: f,
|
|
675
|
+
debounceTime: C = 500,
|
|
676
|
+
value: N,
|
|
677
|
+
onChange: k,
|
|
678
678
|
...B
|
|
679
|
-
},
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}, [
|
|
679
|
+
}, p) => {
|
|
680
|
+
const q = u || `searchfield-${Math.random().toString(36).substr(2, 9)}`, K = !!t, H = X(null), F = X(null), [E, J] = _(N || ""), [z, v] = _(!1), [T, m] = _(!1);
|
|
681
|
+
G(() => {
|
|
682
|
+
N !== void 0 && J(N);
|
|
683
|
+
}, [N]);
|
|
684
684
|
const $ = ie(() => {
|
|
685
685
|
if (!E) return l;
|
|
686
686
|
const W = String(E).toLowerCase();
|
|
687
687
|
return l.filter(
|
|
688
|
-
(
|
|
688
|
+
(S) => String(S.label).toLowerCase().includes(W)
|
|
689
689
|
);
|
|
690
690
|
}, [E, l]);
|
|
691
|
-
|
|
691
|
+
G(() => {
|
|
692
692
|
if (!d || !E) {
|
|
693
|
-
|
|
693
|
+
m(!1);
|
|
694
694
|
return;
|
|
695
695
|
}
|
|
696
696
|
const W = setTimeout(async () => {
|
|
697
|
-
|
|
697
|
+
m(!0);
|
|
698
698
|
try {
|
|
699
699
|
await d(String(E));
|
|
700
|
-
} catch (
|
|
701
|
-
console.error("Remote search failed:",
|
|
700
|
+
} catch (S) {
|
|
701
|
+
console.error("Remote search failed:", S);
|
|
702
702
|
} finally {
|
|
703
|
-
|
|
703
|
+
m(!1);
|
|
704
704
|
}
|
|
705
|
-
},
|
|
705
|
+
}, C);
|
|
706
706
|
return () => {
|
|
707
|
-
clearTimeout(W),
|
|
707
|
+
clearTimeout(W), m(!1);
|
|
708
708
|
};
|
|
709
|
-
}, [E,
|
|
710
|
-
const W = (
|
|
711
|
-
|
|
709
|
+
}, [E, C, d]), G(() => {
|
|
710
|
+
const W = (S) => {
|
|
711
|
+
H.current && !H.current.contains(S.target) && v(!1);
|
|
712
712
|
};
|
|
713
713
|
return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
|
|
714
714
|
}, []);
|
|
715
715
|
const L = (W) => {
|
|
716
|
-
const
|
|
717
|
-
J(
|
|
716
|
+
const S = W.target.value;
|
|
717
|
+
J(S), v(!0), k && k(W);
|
|
718
718
|
}, D = (W) => {
|
|
719
|
-
J(W.label),
|
|
719
|
+
J(W.label), v(!1), f && f(W.value);
|
|
720
720
|
}, P = () => {
|
|
721
|
-
(l.length > 0 || d) &&
|
|
722
|
-
}, M = h || T, re = z && ($.length > 0 || M), ne = ie(() =>
|
|
721
|
+
(l.length > 0 || d) && v(!0);
|
|
722
|
+
}, M = h || T, re = z && ($.length > 0 || M), ne = ie(() => p || F, [p]);
|
|
723
723
|
return /* @__PURE__ */ c(
|
|
724
724
|
"div",
|
|
725
725
|
{
|
|
726
726
|
className: de(
|
|
727
727
|
"flex flex-col",
|
|
728
728
|
o ? "w-full" : "",
|
|
729
|
-
|
|
729
|
+
b || "",
|
|
730
730
|
"relative"
|
|
731
731
|
),
|
|
732
|
-
ref:
|
|
732
|
+
ref: H,
|
|
733
733
|
children: [
|
|
734
734
|
r && /* @__PURE__ */ e(
|
|
735
735
|
"label",
|
|
736
736
|
{
|
|
737
|
-
htmlFor:
|
|
737
|
+
htmlFor: q,
|
|
738
738
|
className: de(
|
|
739
739
|
"block text-sm font-medium mb-1",
|
|
740
|
-
|
|
741
|
-
|
|
740
|
+
K ? "text-red-500" : "text-gray-700 dark:text-gray-300",
|
|
741
|
+
x || ""
|
|
742
742
|
),
|
|
743
743
|
children: r
|
|
744
744
|
}
|
|
745
745
|
),
|
|
746
746
|
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
747
|
-
i && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: de("text-gray-400",
|
|
747
|
+
i && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: de("text-gray-400", pe[a]), children: i }) }),
|
|
748
748
|
/* @__PURE__ */ e(
|
|
749
749
|
"input",
|
|
750
750
|
{
|
|
751
751
|
ref: ne,
|
|
752
|
-
id:
|
|
752
|
+
id: q,
|
|
753
753
|
value: E,
|
|
754
754
|
onChange: L,
|
|
755
755
|
onFocus: P,
|
|
@@ -765,8 +765,8 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
765
765
|
"pr-10",
|
|
766
766
|
// Altijd padding rechts voor de dropdown/loading icon
|
|
767
767
|
// State styles
|
|
768
|
-
|
|
769
|
-
|
|
768
|
+
K ? "border-red-500 text-red-500 focus:border-red-500 focus:ring-red-500" : "border-gray-300 text-gray-900 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",
|
|
769
|
+
y || ""
|
|
770
770
|
),
|
|
771
771
|
...B
|
|
772
772
|
}
|
|
@@ -776,7 +776,7 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
776
776
|
/* @__PURE__ */ c(
|
|
777
777
|
"svg",
|
|
778
778
|
{
|
|
779
|
-
className: de("animate-spin text-blue-500",
|
|
779
|
+
className: de("animate-spin text-blue-500", pe[a]),
|
|
780
780
|
xmlns: "http://www.w3.org/2000/svg",
|
|
781
781
|
fill: "none",
|
|
782
782
|
viewBox: "0 0 24 24",
|
|
@@ -810,10 +810,10 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
810
810
|
{
|
|
811
811
|
className: de(
|
|
812
812
|
"text-gray-400 cursor-pointer transition-transform",
|
|
813
|
-
|
|
813
|
+
pe[a],
|
|
814
814
|
z ? "rotate-180" : "rotate-0"
|
|
815
815
|
),
|
|
816
|
-
onClick: () =>
|
|
816
|
+
onClick: () => v((W) => !W)
|
|
817
817
|
}
|
|
818
818
|
)
|
|
819
819
|
) })
|
|
@@ -841,7 +841,7 @@ const Qe = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
841
841
|
{
|
|
842
842
|
className: de(
|
|
843
843
|
"mt-1 text-xs",
|
|
844
|
-
|
|
844
|
+
K ? "text-red-500" : "text-gray-500"
|
|
845
845
|
),
|
|
846
846
|
children: t || n
|
|
847
847
|
}
|
|
@@ -870,91 +870,91 @@ const sr = {
|
|
|
870
870
|
fullWidth: o = !1,
|
|
871
871
|
options: i,
|
|
872
872
|
placeholder: h,
|
|
873
|
-
containerClassName:
|
|
874
|
-
labelClassName:
|
|
875
|
-
className:
|
|
876
|
-
id:
|
|
873
|
+
containerClassName: b,
|
|
874
|
+
labelClassName: x,
|
|
875
|
+
className: y,
|
|
876
|
+
id: u,
|
|
877
877
|
searchable: l,
|
|
878
878
|
multiple: d,
|
|
879
|
-
value:
|
|
880
|
-
onChange:
|
|
881
|
-
allowCreate:
|
|
882
|
-
onCreateOption:
|
|
879
|
+
value: f,
|
|
880
|
+
onChange: C,
|
|
881
|
+
allowCreate: N,
|
|
882
|
+
onCreateOption: k,
|
|
883
883
|
...B
|
|
884
|
-
},
|
|
885
|
-
const
|
|
886
|
-
se.useImperativeHandle(
|
|
887
|
-
const
|
|
884
|
+
}, p) => {
|
|
885
|
+
const q = u || `select-${Math.random().toString(36).substr(2, 9)}`, K = !!t, [H, F] = se.useState(!1), [E, J] = se.useState(""), z = se.useRef(null), [v, T] = se.useState(i);
|
|
886
|
+
se.useImperativeHandle(p, () => z.current), se.useEffect(() => {
|
|
887
|
+
const S = (I) => {
|
|
888
888
|
z.current && !z.current.contains(I.target) && F(!1);
|
|
889
889
|
};
|
|
890
|
-
return document.addEventListener("mousedown",
|
|
890
|
+
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
891
891
|
}, []);
|
|
892
|
-
const
|
|
893
|
-
(
|
|
894
|
-
(
|
|
892
|
+
const m = se.useCallback(
|
|
893
|
+
(S, I) => S.some(
|
|
894
|
+
(V) => me(V.value) === me(I) || me(V.label) === me(I)
|
|
895
895
|
),
|
|
896
896
|
[]
|
|
897
897
|
), $ = se.useCallback(
|
|
898
|
-
(
|
|
899
|
-
const
|
|
898
|
+
(S, I) => {
|
|
899
|
+
const V = [...S], A = (Q) => {
|
|
900
900
|
const te = (Q ?? "").trim();
|
|
901
|
-
te && (
|
|
901
|
+
te && (m(V, te) || V.push({ value: te, label: te }));
|
|
902
902
|
};
|
|
903
|
-
return Array.isArray(I) ? I.forEach(A) : A(I),
|
|
903
|
+
return Array.isArray(I) ? I.forEach(A) : A(I), V;
|
|
904
904
|
},
|
|
905
|
-
[
|
|
905
|
+
[m]
|
|
906
906
|
);
|
|
907
907
|
se.useEffect(() => {
|
|
908
|
-
T((
|
|
908
|
+
T((S) => {
|
|
909
909
|
const I = [...i];
|
|
910
|
-
return
|
|
911
|
-
!
|
|
912
|
-
}), $(I,
|
|
910
|
+
return S.forEach((V) => {
|
|
911
|
+
!m(I, V.value) && !m(I, V.label) && I.push(V);
|
|
912
|
+
}), $(I, f);
|
|
913
913
|
});
|
|
914
|
-
}, [i,
|
|
915
|
-
const L = (
|
|
914
|
+
}, [i, f, $, m]);
|
|
915
|
+
const L = (S) => {
|
|
916
916
|
if (d) {
|
|
917
|
-
const I = Array.isArray(
|
|
918
|
-
|
|
917
|
+
const I = Array.isArray(f) ? f : [], V = I.includes(S) ? I.filter((A) => A !== S) : [...I, S];
|
|
918
|
+
C?.(V);
|
|
919
919
|
} else
|
|
920
|
-
|
|
921
|
-
}, D = d ? null :
|
|
922
|
-
(
|
|
923
|
-
) : [], M = l && E ?
|
|
924
|
-
(
|
|
925
|
-
) :
|
|
926
|
-
const I =
|
|
920
|
+
C?.(S), F(!1), J("");
|
|
921
|
+
}, D = d ? null : v.find((S) => S.value === f), P = d ? v.filter(
|
|
922
|
+
(S) => Array.isArray(f) && f.includes(S.value)
|
|
923
|
+
) : [], M = l && E ? v.filter(
|
|
924
|
+
(S) => S.label.toLowerCase().includes(E.toLowerCase())
|
|
925
|
+
) : v, re = !!N && !!l && !!E.trim() && !m(v, E), ne = (S) => {
|
|
926
|
+
const I = S.trim();
|
|
927
927
|
if (!I) return;
|
|
928
|
-
const
|
|
928
|
+
const V = k?.(I) ?? {
|
|
929
929
|
value: I,
|
|
930
930
|
label: I
|
|
931
931
|
};
|
|
932
|
-
if (
|
|
933
|
-
L(
|
|
932
|
+
if (m(v, V.value) || m(v, V.label)) {
|
|
933
|
+
L(V.value), J(""), d || F(!1);
|
|
934
934
|
return;
|
|
935
935
|
}
|
|
936
|
-
T((A) => [...A,
|
|
937
|
-
}, W = () => d ? P.length > 0 ? P.map((
|
|
936
|
+
T((A) => [...A, V]), L(V.value), J(""), d || F(!1);
|
|
937
|
+
}, W = () => d ? P.length > 0 ? P.map((S) => S.label).join(", ") : h || "Select options" : D?.label || h || "Select an option";
|
|
938
938
|
return /* @__PURE__ */ c(
|
|
939
939
|
"div",
|
|
940
940
|
{
|
|
941
941
|
ref: z,
|
|
942
|
-
className:
|
|
942
|
+
className: g(
|
|
943
943
|
"relative flex flex-col",
|
|
944
944
|
o && "w-full",
|
|
945
|
-
|
|
945
|
+
b
|
|
946
946
|
),
|
|
947
947
|
...B,
|
|
948
948
|
children: [
|
|
949
949
|
r && /* @__PURE__ */ e(
|
|
950
950
|
"label",
|
|
951
951
|
{
|
|
952
|
-
htmlFor:
|
|
953
|
-
onClick: () => F(!
|
|
954
|
-
className:
|
|
952
|
+
htmlFor: q,
|
|
953
|
+
onClick: () => F(!H),
|
|
954
|
+
className: g(
|
|
955
955
|
"block text-sm font-medium mb-1",
|
|
956
|
-
|
|
957
|
-
|
|
956
|
+
K ? "text-error" : "text-secondary-700 dark:text-secondary-300",
|
|
957
|
+
x
|
|
958
958
|
),
|
|
959
959
|
children: r
|
|
960
960
|
}
|
|
@@ -964,32 +964,32 @@ const sr = {
|
|
|
964
964
|
"button",
|
|
965
965
|
{
|
|
966
966
|
type: "button",
|
|
967
|
-
id:
|
|
968
|
-
onClick: () => F(!
|
|
969
|
-
className:
|
|
967
|
+
id: q,
|
|
968
|
+
onClick: () => F(!H),
|
|
969
|
+
className: g(
|
|
970
970
|
"block w-full rounded-lg border transition-colors duration-200 text-left",
|
|
971
971
|
"focus:outline-none focus:ring-0 focus:ring-offset-0",
|
|
972
972
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
973
973
|
"bg-white dark:bg-secondary-800",
|
|
974
974
|
sr[a],
|
|
975
|
-
|
|
976
|
-
|
|
975
|
+
K ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-secondary-900 dark:border-neutral-700 dark:bg-secondary-800 dark:text-secondary-100",
|
|
976
|
+
y
|
|
977
977
|
),
|
|
978
978
|
children: /* @__PURE__ */ e("span", { className: "block truncate", children: W() })
|
|
979
979
|
}
|
|
980
980
|
),
|
|
981
|
-
|
|
981
|
+
H && /* @__PURE__ */ c("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-white dark:bg-secondary-800 shadow-lg border border-neutral dark:border-neutral-700", children: [
|
|
982
982
|
l && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
983
983
|
"input",
|
|
984
984
|
{
|
|
985
985
|
type: "text",
|
|
986
986
|
placeholder: "Search...",
|
|
987
987
|
value: E,
|
|
988
|
-
onChange: (
|
|
989
|
-
onKeyDown: (
|
|
990
|
-
|
|
988
|
+
onChange: (S) => J(S.target.value),
|
|
989
|
+
onKeyDown: (S) => {
|
|
990
|
+
S.key === "Enter" && re && (S.preventDefault(), ne(E));
|
|
991
991
|
},
|
|
992
|
-
className:
|
|
992
|
+
className: g(
|
|
993
993
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
994
994
|
"text-secondary-900 border-gray-100 dark:border-gray-600 focus:outline-none focus:ring-0"
|
|
995
995
|
)
|
|
@@ -998,7 +998,7 @@ const sr = {
|
|
|
998
998
|
re && /* @__PURE__ */ c(
|
|
999
999
|
"div",
|
|
1000
1000
|
{
|
|
1001
|
-
className:
|
|
1001
|
+
className: g(
|
|
1002
1002
|
"px-4 py-2 text-sm cursor-pointer",
|
|
1003
1003
|
"text-primary hover:bg-gray-100 dark:hover:bg-secondary-700"
|
|
1004
1004
|
),
|
|
@@ -1016,21 +1016,21 @@ const sr = {
|
|
|
1016
1016
|
{
|
|
1017
1017
|
className: "px-4 py-2 text-sm text-secondary-500 cursor-pointer hover:bg-gray-100 dark:hover:bg-secondary-700",
|
|
1018
1018
|
onClick: () => {
|
|
1019
|
-
|
|
1019
|
+
C?.(""), F(!1);
|
|
1020
1020
|
},
|
|
1021
1021
|
children: h
|
|
1022
1022
|
}
|
|
1023
1023
|
),
|
|
1024
|
-
M.map((
|
|
1025
|
-
const I = d ? Array.isArray(
|
|
1024
|
+
M.map((S) => {
|
|
1025
|
+
const I = d ? Array.isArray(f) && f.includes(S.value) : f === S.value;
|
|
1026
1026
|
return /* @__PURE__ */ e(
|
|
1027
1027
|
"li",
|
|
1028
1028
|
{
|
|
1029
|
-
onClick: () => !
|
|
1030
|
-
className:
|
|
1029
|
+
onClick: () => !S.disabled && L(S.value),
|
|
1030
|
+
className: g(
|
|
1031
1031
|
"px-4 py-2 text-sm cursor-pointer",
|
|
1032
1032
|
"text-secondary-900 dark:text-secondary-100",
|
|
1033
|
-
|
|
1033
|
+
S.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-100 dark:hover:bg-secondary-700",
|
|
1034
1034
|
I && "font-semibold"
|
|
1035
1035
|
),
|
|
1036
1036
|
children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
@@ -1043,10 +1043,10 @@ const sr = {
|
|
|
1043
1043
|
className: "mr-3 h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"
|
|
1044
1044
|
}
|
|
1045
1045
|
),
|
|
1046
|
-
/* @__PURE__ */ e("span", { children:
|
|
1046
|
+
/* @__PURE__ */ e("span", { children: S.label })
|
|
1047
1047
|
] })
|
|
1048
1048
|
},
|
|
1049
|
-
|
|
1049
|
+
S.value
|
|
1050
1050
|
);
|
|
1051
1051
|
})
|
|
1052
1052
|
] })
|
|
@@ -1055,9 +1055,9 @@ const sr = {
|
|
|
1055
1055
|
(t || n) && /* @__PURE__ */ e(
|
|
1056
1056
|
"p",
|
|
1057
1057
|
{
|
|
1058
|
-
className:
|
|
1058
|
+
className: g(
|
|
1059
1059
|
"mt-1 text-xs",
|
|
1060
|
-
|
|
1060
|
+
K ? "text-error" : "text-secondary-500"
|
|
1061
1061
|
),
|
|
1062
1062
|
children: t || n
|
|
1063
1063
|
}
|
|
@@ -1082,22 +1082,22 @@ const or = {
|
|
|
1082
1082
|
fullWidth: o = !1,
|
|
1083
1083
|
loading: i = !1,
|
|
1084
1084
|
containerClassName: h,
|
|
1085
|
-
labelClassName:
|
|
1086
|
-
className:
|
|
1087
|
-
id:
|
|
1088
|
-
rows:
|
|
1085
|
+
labelClassName: b,
|
|
1086
|
+
className: x,
|
|
1087
|
+
id: y,
|
|
1088
|
+
rows: u = 4,
|
|
1089
1089
|
...l
|
|
1090
1090
|
}, d) => {
|
|
1091
|
-
const
|
|
1092
|
-
return /* @__PURE__ */ c("div", { className:
|
|
1091
|
+
const f = y || `textarea-${Math.random().toString(36).substr(2, 9)}`, C = !!t;
|
|
1092
|
+
return /* @__PURE__ */ c("div", { className: g("flex flex-col", o && "w-full", h), children: [
|
|
1093
1093
|
r && /* @__PURE__ */ e(
|
|
1094
1094
|
"label",
|
|
1095
1095
|
{
|
|
1096
|
-
htmlFor:
|
|
1097
|
-
className:
|
|
1096
|
+
htmlFor: f,
|
|
1097
|
+
className: g(
|
|
1098
1098
|
"block text-sm font-medium mb-1",
|
|
1099
|
-
|
|
1100
|
-
|
|
1099
|
+
C ? "text-error" : "text-secondary-700 dark:text-secondary-300",
|
|
1100
|
+
b
|
|
1101
1101
|
),
|
|
1102
1102
|
children: r
|
|
1103
1103
|
}
|
|
@@ -1107,9 +1107,9 @@ const or = {
|
|
|
1107
1107
|
"textarea",
|
|
1108
1108
|
{
|
|
1109
1109
|
ref: d,
|
|
1110
|
-
id:
|
|
1111
|
-
rows:
|
|
1112
|
-
className:
|
|
1110
|
+
id: f,
|
|
1111
|
+
rows: u,
|
|
1112
|
+
className: g(
|
|
1113
1113
|
// Base styles
|
|
1114
1114
|
"block w-full rounded-lg border transition-colors duration-200 resize-vertical",
|
|
1115
1115
|
"placeholder-secondary-400 focus:outline-none focus:ring-0",
|
|
@@ -1117,8 +1117,8 @@ const or = {
|
|
|
1117
1117
|
// Size styles
|
|
1118
1118
|
or[a],
|
|
1119
1119
|
// State styles
|
|
1120
|
-
|
|
1121
|
-
|
|
1120
|
+
C ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-secondary-900 dark:border-gray-600 dark:bg-secondary-800 dark:text-secondary-100",
|
|
1121
|
+
x
|
|
1122
1122
|
),
|
|
1123
1123
|
...l
|
|
1124
1124
|
}
|
|
@@ -1156,9 +1156,9 @@ const or = {
|
|
|
1156
1156
|
(t || n) && /* @__PURE__ */ e(
|
|
1157
1157
|
"p",
|
|
1158
1158
|
{
|
|
1159
|
-
className:
|
|
1159
|
+
className: g(
|
|
1160
1160
|
"mt-1 text-xs",
|
|
1161
|
-
|
|
1161
|
+
C ? "text-error" : "text-secondary-500"
|
|
1162
1162
|
),
|
|
1163
1163
|
children: t || n
|
|
1164
1164
|
}
|
|
@@ -1186,36 +1186,36 @@ const cr = {
|
|
|
1186
1186
|
fullWidth: o = !1,
|
|
1187
1187
|
startIcon: i,
|
|
1188
1188
|
endIcon: h,
|
|
1189
|
-
loading:
|
|
1190
|
-
containerClassName:
|
|
1191
|
-
labelClassName:
|
|
1192
|
-
className:
|
|
1189
|
+
loading: b = !1,
|
|
1190
|
+
containerClassName: x,
|
|
1191
|
+
labelClassName: y,
|
|
1192
|
+
className: u,
|
|
1193
1193
|
id: l,
|
|
1194
1194
|
...d
|
|
1195
|
-
},
|
|
1196
|
-
const
|
|
1197
|
-
return /* @__PURE__ */ c("div", { className:
|
|
1195
|
+
}, f) => {
|
|
1196
|
+
const C = l || `textfield-${Math.random().toString(36).substr(2, 9)}`, N = !!t;
|
|
1197
|
+
return /* @__PURE__ */ c("div", { className: g("flex flex-col", o && "w-full", x), children: [
|
|
1198
1198
|
r && /* @__PURE__ */ e(
|
|
1199
1199
|
"label",
|
|
1200
1200
|
{
|
|
1201
|
-
htmlFor:
|
|
1202
|
-
className:
|
|
1201
|
+
htmlFor: C,
|
|
1202
|
+
className: g(
|
|
1203
1203
|
"block text-sm font-medium mb-1",
|
|
1204
|
-
|
|
1205
|
-
|
|
1204
|
+
N ? "text-error" : "text-secondary-700 dark:text-secondary-300",
|
|
1205
|
+
y
|
|
1206
1206
|
),
|
|
1207
1207
|
children: r
|
|
1208
1208
|
}
|
|
1209
1209
|
),
|
|
1210
1210
|
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
1211
1211
|
i && // Todo fix inset not showing correctly on different sizes
|
|
1212
|
-
/* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className:
|
|
1212
|
+
/* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: g("text-secondary-400", ge[a]), children: i }) }),
|
|
1213
1213
|
/* @__PURE__ */ e(
|
|
1214
1214
|
"input",
|
|
1215
1215
|
{
|
|
1216
|
-
ref:
|
|
1217
|
-
id:
|
|
1218
|
-
className:
|
|
1216
|
+
ref: f,
|
|
1217
|
+
id: C,
|
|
1218
|
+
className: g(
|
|
1219
1219
|
// Base styles
|
|
1220
1220
|
"block w-full rounded-lg border dark:border-gray-600 transition-colors duration-200",
|
|
1221
1221
|
"placeholder-gray-500 dark:placeholder-gray-500 focus:outline-none focus:ring-1 focus:ring-offset-0",
|
|
@@ -1226,16 +1226,16 @@ const cr = {
|
|
|
1226
1226
|
i && "pl-10",
|
|
1227
1227
|
h && "pr-10",
|
|
1228
1228
|
// State styles
|
|
1229
|
-
|
|
1230
|
-
|
|
1229
|
+
N ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-secondary-900 focus:border-primary focus:ring-primary dark:border-gray-600 dark:bg-secondary-800 dark:text-secondary-100",
|
|
1230
|
+
u
|
|
1231
1231
|
),
|
|
1232
1232
|
...d
|
|
1233
1233
|
}
|
|
1234
1234
|
),
|
|
1235
|
-
(h ||
|
|
1235
|
+
(h || b) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: b ? /* @__PURE__ */ c(
|
|
1236
1236
|
"svg",
|
|
1237
1237
|
{
|
|
1238
|
-
className:
|
|
1238
|
+
className: g("animate-spin text-secondary-400", ge[a]),
|
|
1239
1239
|
fill: "none",
|
|
1240
1240
|
viewBox: "0 0 24 24",
|
|
1241
1241
|
children: [
|
|
@@ -1260,14 +1260,14 @@ const cr = {
|
|
|
1260
1260
|
)
|
|
1261
1261
|
]
|
|
1262
1262
|
}
|
|
1263
|
-
) : h && /* @__PURE__ */ e("span", { className:
|
|
1263
|
+
) : h && /* @__PURE__ */ e("span", { className: g("text-secondary-400", ge[a]), children: h }) })
|
|
1264
1264
|
] }),
|
|
1265
1265
|
(t || n) && /* @__PURE__ */ e(
|
|
1266
1266
|
"p",
|
|
1267
1267
|
{
|
|
1268
|
-
className:
|
|
1268
|
+
className: g(
|
|
1269
1269
|
"mt-1 text-xs",
|
|
1270
|
-
|
|
1270
|
+
N ? "text-error" : "text-secondary-500"
|
|
1271
1271
|
),
|
|
1272
1272
|
children: t || n
|
|
1273
1273
|
}
|
|
@@ -1284,9 +1284,9 @@ const oe = ({
|
|
|
1284
1284
|
onClick: o,
|
|
1285
1285
|
className: i,
|
|
1286
1286
|
"aria-label": h,
|
|
1287
|
-
...
|
|
1287
|
+
...b
|
|
1288
1288
|
}) => {
|
|
1289
|
-
const
|
|
1289
|
+
const x = typeof n == "number" ? n : dr(n), y = g(
|
|
1290
1290
|
"inline-block",
|
|
1291
1291
|
// Color variants
|
|
1292
1292
|
{
|
|
@@ -1306,9 +1306,9 @@ const oe = ({
|
|
|
1306
1306
|
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/20 rounded": a
|
|
1307
1307
|
},
|
|
1308
1308
|
i
|
|
1309
|
-
),
|
|
1310
|
-
size:
|
|
1311
|
-
className:
|
|
1309
|
+
), u = {
|
|
1310
|
+
size: x,
|
|
1311
|
+
className: y,
|
|
1312
1312
|
onClick: a ? o : void 0,
|
|
1313
1313
|
"aria-label": h,
|
|
1314
1314
|
role: a ? "button" : void 0,
|
|
@@ -1316,9 +1316,9 @@ const oe = ({
|
|
|
1316
1316
|
onKeyDown: a ? (l) => {
|
|
1317
1317
|
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), o?.());
|
|
1318
1318
|
} : void 0,
|
|
1319
|
-
...
|
|
1319
|
+
...b
|
|
1320
1320
|
};
|
|
1321
|
-
return /* @__PURE__ */ e(r, { ...
|
|
1321
|
+
return /* @__PURE__ */ e(r, { ...u });
|
|
1322
1322
|
};
|
|
1323
1323
|
function dr(r) {
|
|
1324
1324
|
return {
|
|
@@ -1355,12 +1355,12 @@ function ir({
|
|
|
1355
1355
|
"div",
|
|
1356
1356
|
{
|
|
1357
1357
|
className: `grid grid-cols-${t} gap-2 p-3 border-t border-gray-100 dark:border-gray-800`,
|
|
1358
|
-
children: Array.from({ length: t }).map((h,
|
|
1358
|
+
children: Array.from({ length: t }).map((h, b) => /* @__PURE__ */ e(
|
|
1359
1359
|
"div",
|
|
1360
1360
|
{
|
|
1361
1361
|
className: "h-4 bg-gray-200 dark:bg-gray-700 rounded w-full"
|
|
1362
1362
|
},
|
|
1363
|
-
`cell-${i}-${
|
|
1363
|
+
`cell-${i}-${b}`
|
|
1364
1364
|
))
|
|
1365
1365
|
},
|
|
1366
1366
|
`row-${i}`
|
|
@@ -1376,53 +1376,53 @@ const ur = ({
|
|
|
1376
1376
|
placement: o = "bottom-start",
|
|
1377
1377
|
disabled: i = !1,
|
|
1378
1378
|
className: h,
|
|
1379
|
-
showCheck:
|
|
1380
|
-
header:
|
|
1379
|
+
showCheck: b = !0,
|
|
1380
|
+
header: x
|
|
1381
1381
|
}) => {
|
|
1382
|
-
const [
|
|
1383
|
-
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1382
|
+
const [y, u] = _(!1), [l, d] = _(null), [f, C] = _({ top: 0, left: 0 }), N = X(null), k = X(null), B = X(null), p = X(null);
|
|
1383
|
+
G(() => {
|
|
1384
|
+
const v = (T) => {
|
|
1385
|
+
N.current && (!N.current.contains(T.target) || B.current && !B.current.contains(T.target)) && (u(!1), d(null), p.current && (clearTimeout(p.current), p.current = null));
|
|
1386
1386
|
};
|
|
1387
|
-
return
|
|
1388
|
-
document.removeEventListener("mousedown",
|
|
1387
|
+
return y && document.addEventListener("mousedown", v), () => {
|
|
1388
|
+
document.removeEventListener("mousedown", v);
|
|
1389
1389
|
};
|
|
1390
|
-
}, [
|
|
1391
|
-
const
|
|
1392
|
-
T.key === "Escape" && (
|
|
1390
|
+
}, [y]), G(() => {
|
|
1391
|
+
const v = (T) => {
|
|
1392
|
+
T.key === "Escape" && (u(!1), d(null), p.current && (clearTimeout(p.current), p.current = null));
|
|
1393
1393
|
};
|
|
1394
|
-
return
|
|
1395
|
-
document.removeEventListener("keydown",
|
|
1394
|
+
return y && document.addEventListener("keydown", v), () => {
|
|
1395
|
+
document.removeEventListener("keydown", v);
|
|
1396
1396
|
};
|
|
1397
|
-
}, [
|
|
1398
|
-
if (l &&
|
|
1399
|
-
const
|
|
1397
|
+
}, [y]), G(() => {
|
|
1398
|
+
if (l && N.current) {
|
|
1399
|
+
const v = N.current.querySelector(
|
|
1400
1400
|
`[data-option-value="${l}"]`
|
|
1401
1401
|
);
|
|
1402
|
-
if (
|
|
1403
|
-
const T =
|
|
1404
|
-
|
|
1402
|
+
if (v) {
|
|
1403
|
+
const T = v.getBoundingClientRect();
|
|
1404
|
+
C({
|
|
1405
1405
|
top: T.top,
|
|
1406
1406
|
left: T.right + 8
|
|
1407
1407
|
});
|
|
1408
1408
|
}
|
|
1409
1409
|
}
|
|
1410
|
-
}, [l]),
|
|
1411
|
-
|
|
1410
|
+
}, [l]), G(() => () => {
|
|
1411
|
+
p.current && clearTimeout(p.current);
|
|
1412
1412
|
}, []);
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1415
|
-
},
|
|
1416
|
-
|
|
1417
|
-
},
|
|
1418
|
-
|
|
1419
|
-
}, F = (
|
|
1420
|
-
|
|
1413
|
+
const q = (v) => {
|
|
1414
|
+
v.stopPropagation(), i || (u(!y), d(null), p.current && (clearTimeout(p.current), p.current = null));
|
|
1415
|
+
}, K = (v, T, m) => {
|
|
1416
|
+
v.stopPropagation(), !T.disabled && !T.divider && (!T.children || T.children.length === 0) && (a?.(T.value, m), u(!1), d(null));
|
|
1417
|
+
}, H = (v) => {
|
|
1418
|
+
p.current && (clearTimeout(p.current), p.current = null), v.children && v.children.length > 0 ? d(v.value) : d(null);
|
|
1419
|
+
}, F = (v) => {
|
|
1420
|
+
v.children && v.children.length > 0 ? p.current = setTimeout(() => {
|
|
1421
1421
|
d(null);
|
|
1422
1422
|
}, 150) : d(null);
|
|
1423
|
-
}, E = (
|
|
1424
|
-
|
|
1425
|
-
}, J =
|
|
1423
|
+
}, E = (v, T, m) => {
|
|
1424
|
+
v.stopPropagation(), !T.disabled && !T.divider && (a?.(T.value, m), u(!1), d(null));
|
|
1425
|
+
}, J = g(
|
|
1426
1426
|
"absolute z-50 min-w-[200px] bg-white dark:bg-gray-800 rounded-md shadow-xs border border-gray-100 dark:border-gray-600",
|
|
1427
1427
|
"max-h-60 overflow-auto",
|
|
1428
1428
|
{
|
|
@@ -1431,15 +1431,15 @@ const ur = ({
|
|
|
1431
1431
|
"bottom-full left-0 mb-2": o === "top-start",
|
|
1432
1432
|
"bottom-full right-0 mb-2": o === "top-end"
|
|
1433
1433
|
}
|
|
1434
|
-
), z =
|
|
1434
|
+
), z = g(
|
|
1435
1435
|
"fixed z-[60] min-w-[200px] bg-white dark:bg-gray-800 rounded-md shadow-lg border border-gray-100 dark:border-gray-600",
|
|
1436
1436
|
"max-h-60 overflow-auto"
|
|
1437
1437
|
);
|
|
1438
1438
|
return /* @__PURE__ */ c(
|
|
1439
1439
|
"div",
|
|
1440
1440
|
{
|
|
1441
|
-
ref:
|
|
1442
|
-
className:
|
|
1441
|
+
ref: N,
|
|
1442
|
+
className: g(
|
|
1443
1443
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
1444
1444
|
h
|
|
1445
1445
|
),
|
|
@@ -1447,19 +1447,19 @@ const ur = ({
|
|
|
1447
1447
|
/* @__PURE__ */ e(
|
|
1448
1448
|
"button",
|
|
1449
1449
|
{
|
|
1450
|
-
ref:
|
|
1451
|
-
onClick:
|
|
1450
|
+
ref: k,
|
|
1451
|
+
onClick: q,
|
|
1452
1452
|
disabled: i,
|
|
1453
|
-
className:
|
|
1453
|
+
className: g("inline-flex items-center justify-center", {
|
|
1454
1454
|
"opacity-50 cursor-not-allowed": i
|
|
1455
1455
|
}),
|
|
1456
1456
|
children: r
|
|
1457
1457
|
}
|
|
1458
1458
|
),
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
n.map((
|
|
1462
|
-
if (
|
|
1459
|
+
y && /* @__PURE__ */ e("div", { className: J, children: /* @__PURE__ */ c("div", { className: "p-2", children: [
|
|
1460
|
+
x && (typeof x == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider px-3 py-2", children: x }) : x),
|
|
1461
|
+
n.map((v, T) => {
|
|
1462
|
+
if (v.divider)
|
|
1463
1463
|
return /* @__PURE__ */ e(
|
|
1464
1464
|
"div",
|
|
1465
1465
|
{
|
|
@@ -1467,56 +1467,56 @@ const ur = ({
|
|
|
1467
1467
|
},
|
|
1468
1468
|
`divider-${T}`
|
|
1469
1469
|
);
|
|
1470
|
-
const
|
|
1470
|
+
const m = v.children && v.children.length > 0, $ = l === v.value;
|
|
1471
1471
|
return /* @__PURE__ */ c("div", { className: "relative group", children: [
|
|
1472
1472
|
/* @__PURE__ */ c(
|
|
1473
1473
|
"button",
|
|
1474
1474
|
{
|
|
1475
|
-
"data-option-value":
|
|
1476
|
-
onClick: (L) =>
|
|
1477
|
-
onMouseEnter: () =>
|
|
1478
|
-
onMouseLeave: () => F(
|
|
1479
|
-
disabled:
|
|
1480
|
-
className:
|
|
1475
|
+
"data-option-value": v.value,
|
|
1476
|
+
onClick: (L) => K(L, v),
|
|
1477
|
+
onMouseEnter: () => H(v),
|
|
1478
|
+
onMouseLeave: () => F(v),
|
|
1479
|
+
disabled: v.disabled,
|
|
1480
|
+
className: g(
|
|
1481
1481
|
"w-full flex items-center justify-between px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",
|
|
1482
1482
|
{
|
|
1483
|
-
"opacity-50 cursor-not-allowed":
|
|
1484
|
-
"bg-gray-100 dark:bg-gray-700": $ &&
|
|
1483
|
+
"opacity-50 cursor-not-allowed": v.disabled,
|
|
1484
|
+
"bg-gray-100 dark:bg-gray-700": $ && m
|
|
1485
1485
|
}
|
|
1486
1486
|
),
|
|
1487
1487
|
children: [
|
|
1488
1488
|
/* @__PURE__ */ c("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1489
|
-
|
|
1489
|
+
v.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: v.icon }),
|
|
1490
1490
|
/* @__PURE__ */ c("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1491
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
1492
|
-
|
|
1491
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: v.label }),
|
|
1492
|
+
v.description && /* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: v.description })
|
|
1493
1493
|
] })
|
|
1494
1494
|
] }),
|
|
1495
1495
|
/* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
|
|
1496
|
-
|
|
1497
|
-
|
|
1496
|
+
b && t === v.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" }),
|
|
1497
|
+
m && /* @__PURE__ */ e("span", { className: "text-gray-400 dark:text-gray-500 text-xs", children: "▶" })
|
|
1498
1498
|
] })
|
|
1499
1499
|
]
|
|
1500
1500
|
}
|
|
1501
1501
|
),
|
|
1502
|
-
|
|
1502
|
+
m && $ && /* @__PURE__ */ e(
|
|
1503
1503
|
"div",
|
|
1504
1504
|
{
|
|
1505
1505
|
ref: B,
|
|
1506
1506
|
className: z,
|
|
1507
1507
|
style: {
|
|
1508
|
-
top: `${
|
|
1509
|
-
left: `${
|
|
1508
|
+
top: `${f.top}px`,
|
|
1509
|
+
left: `${f.left}px`
|
|
1510
1510
|
},
|
|
1511
1511
|
onMouseEnter: () => {
|
|
1512
|
-
|
|
1512
|
+
p.current && (clearTimeout(p.current), p.current = null), d(v.value);
|
|
1513
1513
|
},
|
|
1514
1514
|
onMouseLeave: () => {
|
|
1515
|
-
|
|
1515
|
+
p.current = setTimeout(() => {
|
|
1516
1516
|
d(null);
|
|
1517
1517
|
}, 150);
|
|
1518
1518
|
},
|
|
1519
|
-
children: /* @__PURE__ */ e("div", { className: "p-2", children:
|
|
1519
|
+
children: /* @__PURE__ */ e("div", { className: "p-2", children: v.children.map((L, D) => {
|
|
1520
1520
|
if (L.divider)
|
|
1521
1521
|
return /* @__PURE__ */ e(
|
|
1522
1522
|
"div",
|
|
@@ -1525,7 +1525,7 @@ const ur = ({
|
|
|
1525
1525
|
},
|
|
1526
1526
|
`divider-${D}`
|
|
1527
1527
|
);
|
|
1528
|
-
const P = typeof t == "object" && t[
|
|
1528
|
+
const P = typeof t == "object" && t[v.value] && t[v.value].includes(
|
|
1529
1529
|
L.value
|
|
1530
1530
|
) || t === L.value;
|
|
1531
1531
|
return /* @__PURE__ */ c(
|
|
@@ -1534,10 +1534,10 @@ const ur = ({
|
|
|
1534
1534
|
onClick: (M) => E(
|
|
1535
1535
|
M,
|
|
1536
1536
|
L,
|
|
1537
|
-
|
|
1537
|
+
v.value
|
|
1538
1538
|
),
|
|
1539
1539
|
disabled: L.disabled,
|
|
1540
|
-
className:
|
|
1540
|
+
className: g(
|
|
1541
1541
|
"w-full flex items-center justify-between px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",
|
|
1542
1542
|
{
|
|
1543
1543
|
"opacity-50 cursor-not-allowed": L.disabled
|
|
@@ -1551,7 +1551,7 @@ const ur = ({
|
|
|
1551
1551
|
L.description && /* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: L.description })
|
|
1552
1552
|
] })
|
|
1553
1553
|
] }),
|
|
1554
|
-
|
|
1554
|
+
b && P && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" })
|
|
1555
1555
|
]
|
|
1556
1556
|
},
|
|
1557
1557
|
L.value
|
|
@@ -1559,16 +1559,16 @@ const ur = ({
|
|
|
1559
1559
|
}) })
|
|
1560
1560
|
}
|
|
1561
1561
|
)
|
|
1562
|
-
] },
|
|
1562
|
+
] }, v.value);
|
|
1563
1563
|
}),
|
|
1564
1564
|
(() => {
|
|
1565
|
-
const
|
|
1566
|
-
if (
|
|
1567
|
-
const $ =
|
|
1565
|
+
const v = n.reduce((T, m) => {
|
|
1566
|
+
if (m.divider) return T;
|
|
1567
|
+
const $ = m.children ? m.children.filter((L) => !L.divider).length : 0;
|
|
1568
1568
|
return T + 1 + $;
|
|
1569
1569
|
}, 0);
|
|
1570
|
-
return
|
|
1571
|
-
|
|
1570
|
+
return v > 1 && /* @__PURE__ */ e("div", { className: "border-t border-gray-200 dark:border-gray-600 mt-2 pt-2", children: /* @__PURE__ */ c("div", { className: "text-xs text-gray-500 dark:text-gray-400 px-3 py-1", children: [
|
|
1571
|
+
v,
|
|
1572
1572
|
" options available"
|
|
1573
1573
|
] }) });
|
|
1574
1574
|
})()
|
|
@@ -1596,7 +1596,7 @@ const ur = ({
|
|
|
1596
1596
|
), hr = ({ active: r }) => /* @__PURE__ */ e(
|
|
1597
1597
|
"svg",
|
|
1598
1598
|
{
|
|
1599
|
-
className:
|
|
1599
|
+
className: g(
|
|
1600
1600
|
"h-3 w-3",
|
|
1601
1601
|
r ? "text-neutral-900 dark:text-neutral-100" : "text-neutral-400"
|
|
1602
1602
|
),
|
|
@@ -1616,7 +1616,7 @@ const ur = ({
|
|
|
1616
1616
|
), fr = ({ active: r }) => /* @__PURE__ */ e(
|
|
1617
1617
|
"svg",
|
|
1618
1618
|
{
|
|
1619
|
-
className:
|
|
1619
|
+
className: g(
|
|
1620
1620
|
"h-3 w-3",
|
|
1621
1621
|
r ? "text-neutral-900 dark:text-neutral-100" : "text-neutral-400"
|
|
1622
1622
|
),
|
|
@@ -1633,7 +1633,7 @@ const ur = ({
|
|
|
1633
1633
|
}
|
|
1634
1634
|
)
|
|
1635
1635
|
}
|
|
1636
|
-
),
|
|
1636
|
+
), xr = () => /* @__PURE__ */ e(
|
|
1637
1637
|
"svg",
|
|
1638
1638
|
{
|
|
1639
1639
|
className: "h-4 w-4",
|
|
@@ -1650,7 +1650,7 @@ const ur = ({
|
|
|
1650
1650
|
}
|
|
1651
1651
|
)
|
|
1652
1652
|
}
|
|
1653
|
-
),
|
|
1653
|
+
), pr = () => /* @__PURE__ */ e(
|
|
1654
1654
|
"svg",
|
|
1655
1655
|
{
|
|
1656
1656
|
className: "h-4 w-4",
|
|
@@ -1748,7 +1748,7 @@ const ur = ({
|
|
|
1748
1748
|
children: /* @__PURE__ */ e(
|
|
1749
1749
|
"span",
|
|
1750
1750
|
{
|
|
1751
|
-
className:
|
|
1751
|
+
className: g(n(a.value) && "text-primary-500"),
|
|
1752
1752
|
children: a.label
|
|
1753
1753
|
}
|
|
1754
1754
|
)
|
|
@@ -1773,33 +1773,33 @@ const ur = ({
|
|
|
1773
1773
|
searchPlaceholder: o = "Search...",
|
|
1774
1774
|
filters: i = [],
|
|
1775
1775
|
paginated: h = !1,
|
|
1776
|
-
pageSizeOptions:
|
|
1777
|
-
defaultPageSize:
|
|
1778
|
-
actions:
|
|
1779
|
-
onRowClick:
|
|
1776
|
+
pageSizeOptions: b = [10, 25, 50, 100],
|
|
1777
|
+
defaultPageSize: x = 10,
|
|
1778
|
+
actions: y = [],
|
|
1779
|
+
onRowClick: u,
|
|
1780
1780
|
selectable: l = !1,
|
|
1781
1781
|
selectedRows: d = [],
|
|
1782
|
-
onSelectionChange:
|
|
1783
|
-
getRowKey:
|
|
1784
|
-
emptyContent:
|
|
1785
|
-
hoverable:
|
|
1782
|
+
onSelectionChange: f,
|
|
1783
|
+
getRowKey: C = (H, F) => F,
|
|
1784
|
+
emptyContent: N,
|
|
1785
|
+
hoverable: k = !0,
|
|
1786
1786
|
bordered: B = !1,
|
|
1787
|
-
striped:
|
|
1788
|
-
className:
|
|
1789
|
-
rowClassName:
|
|
1787
|
+
striped: p = !1,
|
|
1788
|
+
className: q,
|
|
1789
|
+
rowClassName: K
|
|
1790
1790
|
}) => {
|
|
1791
|
-
const [
|
|
1791
|
+
const [H, F] = _(""), [E, J] = _({
|
|
1792
1792
|
column: null,
|
|
1793
1793
|
direction: null
|
|
1794
|
-
}), [z,
|
|
1794
|
+
}), [z, v] = _({
|
|
1795
1795
|
page: 0,
|
|
1796
|
-
pageSize:
|
|
1797
|
-
}), T = X(null),
|
|
1796
|
+
pageSize: x
|
|
1797
|
+
}), T = X(null), m = ie(() => {
|
|
1798
1798
|
let s = r;
|
|
1799
|
-
if (a &&
|
|
1799
|
+
if (a && H.trim()) {
|
|
1800
1800
|
const w = n.filter(
|
|
1801
1801
|
(R) => R.searchable !== !1
|
|
1802
|
-
), O =
|
|
1802
|
+
), O = H.toLowerCase();
|
|
1803
1803
|
s = s.filter((R) => w.some((j) => {
|
|
1804
1804
|
const Y = typeof j.accessor == "function" ? j.accessor(R) : R[j.accessor];
|
|
1805
1805
|
return String(Y || "").toLowerCase().includes(O);
|
|
@@ -1813,15 +1813,15 @@ const ur = ({
|
|
|
1813
1813
|
return String(j || "") === w.value;
|
|
1814
1814
|
}));
|
|
1815
1815
|
}), s;
|
|
1816
|
-
}, [r,
|
|
1817
|
-
if (!E.column || !E.direction) return
|
|
1816
|
+
}, [r, H, n, a, i]), $ = ie(() => {
|
|
1817
|
+
if (!E.column || !E.direction) return m;
|
|
1818
1818
|
const s = n.find((w) => w.id === E.column);
|
|
1819
|
-
return s ? [...
|
|
1819
|
+
return s ? [...m].sort((w, O) => {
|
|
1820
1820
|
const R = typeof s.accessor == "function" ? s.accessor(w) : w[s.accessor], j = typeof s.accessor == "function" ? s.accessor(O) : O[s.accessor];
|
|
1821
1821
|
let Y = 0;
|
|
1822
1822
|
return R < j ? Y = -1 : R > j && (Y = 1), E.direction === "desc" ? -Y : Y;
|
|
1823
|
-
}) :
|
|
1824
|
-
}, [
|
|
1823
|
+
}) : m;
|
|
1824
|
+
}, [m, E, n]), L = ie(() => {
|
|
1825
1825
|
if (!h) return $;
|
|
1826
1826
|
const s = z.page * z.pageSize, w = s + z.pageSize;
|
|
1827
1827
|
return $.slice(s, w);
|
|
@@ -1831,47 +1831,47 @@ const ur = ({
|
|
|
1831
1831
|
},
|
|
1832
1832
|
[n]
|
|
1833
1833
|
), P = ae((s) => {
|
|
1834
|
-
|
|
1834
|
+
v((w) => ({ ...w, page: s }));
|
|
1835
1835
|
}, []), M = ae((s) => {
|
|
1836
|
-
|
|
1836
|
+
v({ page: 0, pageSize: s });
|
|
1837
1837
|
}, []), re = ae(
|
|
1838
1838
|
(s, w) => {
|
|
1839
|
-
if (!
|
|
1840
|
-
const O =
|
|
1841
|
-
d.map((R, j) =>
|
|
1842
|
-
(R, j) =>
|
|
1839
|
+
if (!f) return;
|
|
1840
|
+
const O = C(s, 0);
|
|
1841
|
+
d.map((R, j) => C(R, j)), f(w ? [...d, s] : d.filter(
|
|
1842
|
+
(R, j) => C(d[j], j) !== O
|
|
1843
1843
|
));
|
|
1844
1844
|
},
|
|
1845
|
-
[d,
|
|
1845
|
+
[d, f, C]
|
|
1846
1846
|
), ne = ae(
|
|
1847
1847
|
(s) => {
|
|
1848
|
-
|
|
1848
|
+
f && f(s ? [...L] : []);
|
|
1849
1849
|
},
|
|
1850
|
-
[L,
|
|
1850
|
+
[L, f]
|
|
1851
1851
|
);
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
}, [
|
|
1855
|
-
|
|
1852
|
+
G(() => {
|
|
1853
|
+
v((s) => ({ ...s, page: 0 }));
|
|
1854
|
+
}, [H, E]), G(() => {
|
|
1855
|
+
v((s) => ({ ...s, page: 0 }));
|
|
1856
1856
|
}, [i.map((s) => s.value).join(",")]);
|
|
1857
|
-
const W = $.length,
|
|
1858
|
-
const w =
|
|
1857
|
+
const W = $.length, S = Math.ceil(W / z.pageSize), I = z.page * z.pageSize + 1, V = Math.min(I + z.pageSize - 1, W), A = L.length > 0 && L.every((s) => {
|
|
1858
|
+
const w = C(s, 0);
|
|
1859
1859
|
return d.some(
|
|
1860
|
-
(O, R) =>
|
|
1860
|
+
(O, R) => C(O, R) === w
|
|
1861
1861
|
);
|
|
1862
1862
|
}), Q = L.some((s) => {
|
|
1863
|
-
const w =
|
|
1863
|
+
const w = C(s, 0);
|
|
1864
1864
|
return d.some(
|
|
1865
|
-
(O, R) =>
|
|
1865
|
+
(O, R) => C(O, R) === w
|
|
1866
1866
|
);
|
|
1867
|
-
}), te =
|
|
1867
|
+
}), te = g(
|
|
1868
1868
|
"w-full text-sm leading-5 text-[var(--text-default)] border-collapse",
|
|
1869
|
-
|
|
1870
|
-
), U =
|
|
1869
|
+
q
|
|
1870
|
+
), U = g("bg-[var(--base-module)]"), le = g(
|
|
1871
1871
|
"text-[var(--text-default)] dark:text-[var(--text-on-neutral)] p-3 border-b border-[var(--neutral-border)]"
|
|
1872
|
-
), he =
|
|
1873
|
-
"hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]":
|
|
1874
|
-
"cursor-pointer":
|
|
1872
|
+
), he = g("h-12", {
|
|
1873
|
+
"hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]": k,
|
|
1874
|
+
"cursor-pointer": u
|
|
1875
1875
|
});
|
|
1876
1876
|
return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
|
|
1877
1877
|
(a || i.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-4 items-start", children: [
|
|
@@ -1880,7 +1880,7 @@ const ur = ({
|
|
|
1880
1880
|
ue,
|
|
1881
1881
|
{
|
|
1882
1882
|
placeholder: o,
|
|
1883
|
-
value:
|
|
1883
|
+
value: H,
|
|
1884
1884
|
onChange: (s) => F(s.target.value),
|
|
1885
1885
|
startIcon: /* @__PURE__ */ e(mr, {}),
|
|
1886
1886
|
className: "max-w-sm"
|
|
@@ -1896,9 +1896,9 @@ const ur = ({
|
|
|
1896
1896
|
tableColumns: n.length
|
|
1897
1897
|
}
|
|
1898
1898
|
) }),
|
|
1899
|
-
/* @__PURE__ */ c("table", { ref: T, className:
|
|
1899
|
+
/* @__PURE__ */ c("table", { ref: T, className: g(te, "min-w-full"), children: [
|
|
1900
1900
|
/* @__PURE__ */ e("thead", { className: U, children: /* @__PURE__ */ c("tr", { children: [
|
|
1901
|
-
l && /* @__PURE__ */ e("th", { className:
|
|
1901
|
+
l && /* @__PURE__ */ e("th", { className: g(le, "w-12"), children: /* @__PURE__ */ e(
|
|
1902
1902
|
"input",
|
|
1903
1903
|
{
|
|
1904
1904
|
type: "checkbox",
|
|
@@ -1913,7 +1913,7 @@ const ur = ({
|
|
|
1913
1913
|
!t && n.map((s) => /* @__PURE__ */ e(
|
|
1914
1914
|
"th",
|
|
1915
1915
|
{
|
|
1916
|
-
className:
|
|
1916
|
+
className: g(
|
|
1917
1917
|
le,
|
|
1918
1918
|
"font-semibold text-xs text-[var(--text-muted)] dark:text-[var(--text-muted)] uppercase tracking-wider",
|
|
1919
1919
|
"group",
|
|
@@ -1933,7 +1933,7 @@ const ur = ({
|
|
|
1933
1933
|
s.sortable && /* @__PURE__ */ c(
|
|
1934
1934
|
"div",
|
|
1935
1935
|
{
|
|
1936
|
-
className:
|
|
1936
|
+
className: g(
|
|
1937
1937
|
"flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1938
1938
|
E.column === s.id && "opacity-100"
|
|
1939
1939
|
),
|
|
@@ -1957,32 +1957,32 @@ const ur = ({
|
|
|
1957
1957
|
},
|
|
1958
1958
|
s.id
|
|
1959
1959
|
)),
|
|
1960
|
-
|
|
1960
|
+
y.length > 0 && /* @__PURE__ */ e("th", { className: g(le, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
1961
1961
|
] }) }),
|
|
1962
1962
|
/* @__PURE__ */ e("tbody", { children: L.length === 0 || t ? !t && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1963
1963
|
"td",
|
|
1964
1964
|
{
|
|
1965
|
-
colSpan: n.length + (l ? 1 : 0) + (
|
|
1966
|
-
className:
|
|
1965
|
+
colSpan: n.length + (l ? 1 : 0) + (y.length > 0 ? 1 : 0),
|
|
1966
|
+
className: g(
|
|
1967
1967
|
le,
|
|
1968
1968
|
"text-center py-8 text-neutral-500 dark:text-neutral-400"
|
|
1969
1969
|
),
|
|
1970
|
-
children:
|
|
1970
|
+
children: N || "No data available"
|
|
1971
1971
|
}
|
|
1972
1972
|
) }) : L.map((s, w) => {
|
|
1973
|
-
const O =
|
|
1974
|
-
(j, Y) =>
|
|
1973
|
+
const O = C(s, w), R = d.some(
|
|
1974
|
+
(j, Y) => C(j, Y) === O
|
|
1975
1975
|
);
|
|
1976
1976
|
return /* @__PURE__ */ c(
|
|
1977
1977
|
"tr",
|
|
1978
1978
|
{
|
|
1979
|
-
className:
|
|
1979
|
+
className: g(
|
|
1980
1980
|
he,
|
|
1981
1981
|
{ "bg-blue-50 dark:bg-blue-900/20": R },
|
|
1982
|
-
|
|
1982
|
+
K?.(s, w)
|
|
1983
1983
|
),
|
|
1984
1984
|
onClick: (j) => {
|
|
1985
|
-
j.stopPropagation(),
|
|
1985
|
+
j.stopPropagation(), u?.(s, w);
|
|
1986
1986
|
},
|
|
1987
1987
|
children: [
|
|
1988
1988
|
l && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
|
|
@@ -2001,7 +2001,7 @@ const ur = ({
|
|
|
2001
2001
|
return /* @__PURE__ */ e(
|
|
2002
2002
|
"td",
|
|
2003
2003
|
{
|
|
2004
|
-
className:
|
|
2004
|
+
className: g(le, {
|
|
2005
2005
|
"text-left": j.align === "left" || !j.align,
|
|
2006
2006
|
"text-center": j.align === "center",
|
|
2007
2007
|
"text-right": j.align === "right",
|
|
@@ -2013,21 +2013,21 @@ const ur = ({
|
|
|
2013
2013
|
j.id
|
|
2014
2014
|
);
|
|
2015
2015
|
}),
|
|
2016
|
-
|
|
2016
|
+
y.length > 0 && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
|
|
2017
2017
|
ur,
|
|
2018
2018
|
{
|
|
2019
2019
|
trigger: /* @__PURE__ */ c("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100", children: [
|
|
2020
2020
|
/* @__PURE__ */ e("span", { children: "Options" }),
|
|
2021
2021
|
/* @__PURE__ */ e($e, {})
|
|
2022
2022
|
] }),
|
|
2023
|
-
options:
|
|
2023
|
+
options: y.map((j) => ({
|
|
2024
2024
|
value: j.id,
|
|
2025
2025
|
label: j.label,
|
|
2026
2026
|
icon: j.icon,
|
|
2027
2027
|
disabled: j.disabled?.(s)
|
|
2028
2028
|
})),
|
|
2029
2029
|
onSelect: (j) => {
|
|
2030
|
-
const Y =
|
|
2030
|
+
const Y = y.find(
|
|
2031
2031
|
(fe) => fe.id === j
|
|
2032
2032
|
);
|
|
2033
2033
|
Y && Y.onClick(s, w);
|
|
@@ -2048,7 +2048,7 @@ const ur = ({
|
|
|
2048
2048
|
"Showing ",
|
|
2049
2049
|
I,
|
|
2050
2050
|
" to ",
|
|
2051
|
-
|
|
2051
|
+
V,
|
|
2052
2052
|
" of ",
|
|
2053
2053
|
W,
|
|
2054
2054
|
" results"
|
|
@@ -2061,7 +2061,7 @@ const ur = ({
|
|
|
2061
2061
|
value: z.pageSize,
|
|
2062
2062
|
onChange: (s) => M(Number(s.target.value)),
|
|
2063
2063
|
className: "border border-[var(--neutral-border)] text-[var(--text-default)] dark:text-[var(--text-on-neutral)] rounded-md px-2 py-1 text-sm bg-[var(--base-input)] dark:bg-[var(--base-input)] w-16",
|
|
2064
|
-
children:
|
|
2064
|
+
children: b.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
|
|
2065
2065
|
}
|
|
2066
2066
|
)
|
|
2067
2067
|
] })
|
|
@@ -2086,14 +2086,14 @@ const ur = ({
|
|
|
2086
2086
|
onClick: () => P(z.page - 1),
|
|
2087
2087
|
disabled: z.page === 0,
|
|
2088
2088
|
iconOnly: !0,
|
|
2089
|
-
children: /* @__PURE__ */ e(
|
|
2089
|
+
children: /* @__PURE__ */ e(xr, {})
|
|
2090
2090
|
}
|
|
2091
2091
|
),
|
|
2092
2092
|
/* @__PURE__ */ c("span", { className: "px-3 py-1 text-sm text-gray-500 dark:text-gray-400", children: [
|
|
2093
2093
|
"Page ",
|
|
2094
2094
|
z.page + 1,
|
|
2095
2095
|
" of ",
|
|
2096
|
-
|
|
2096
|
+
S
|
|
2097
2097
|
] }),
|
|
2098
2098
|
/* @__PURE__ */ e(
|
|
2099
2099
|
ee,
|
|
@@ -2101,9 +2101,9 @@ const ur = ({
|
|
|
2101
2101
|
size: "sm",
|
|
2102
2102
|
variant: "ghost",
|
|
2103
2103
|
onClick: () => P(z.page + 1),
|
|
2104
|
-
disabled: z.page >=
|
|
2104
|
+
disabled: z.page >= S - 1,
|
|
2105
2105
|
iconOnly: !0,
|
|
2106
|
-
children: /* @__PURE__ */ e(
|
|
2106
|
+
children: /* @__PURE__ */ e(pr, {})
|
|
2107
2107
|
}
|
|
2108
2108
|
),
|
|
2109
2109
|
/* @__PURE__ */ e(
|
|
@@ -2111,8 +2111,8 @@ const ur = ({
|
|
|
2111
2111
|
{
|
|
2112
2112
|
size: "sm",
|
|
2113
2113
|
variant: "ghost",
|
|
2114
|
-
onClick: () => P(
|
|
2115
|
-
disabled: z.page >=
|
|
2114
|
+
onClick: () => P(S - 1),
|
|
2115
|
+
disabled: z.page >= S - 1,
|
|
2116
2116
|
iconOnly: !0,
|
|
2117
2117
|
children: /* @__PURE__ */ e(br, {})
|
|
2118
2118
|
}
|
|
@@ -2120,37 +2120,37 @@ const ur = ({
|
|
|
2120
2120
|
] })
|
|
2121
2121
|
] })
|
|
2122
2122
|
] });
|
|
2123
|
-
}, vr =
|
|
2123
|
+
}, vr = qe(null), et = ({
|
|
2124
2124
|
items: r,
|
|
2125
2125
|
activeTab: n,
|
|
2126
2126
|
onTabChange: t,
|
|
2127
2127
|
className: a
|
|
2128
2128
|
}) => {
|
|
2129
|
-
const [o, i] =
|
|
2130
|
-
t ? t(
|
|
2129
|
+
const [o, i] = _(r[0]?.id || ""), h = n || o, b = (x) => {
|
|
2130
|
+
t ? t(x) : i(x);
|
|
2131
2131
|
};
|
|
2132
|
-
return /* @__PURE__ */ e("div", { className:
|
|
2132
|
+
return /* @__PURE__ */ e("div", { className: g("border-b border-neutral-200 dark:border-neutral-700", a), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: r.map((x) => /* @__PURE__ */ e(
|
|
2133
2133
|
"button",
|
|
2134
2134
|
{
|
|
2135
|
-
onClick: () => !
|
|
2136
|
-
disabled:
|
|
2137
|
-
className:
|
|
2135
|
+
onClick: () => !x.disabled && b(x.id),
|
|
2136
|
+
disabled: x.disabled,
|
|
2137
|
+
className: g(
|
|
2138
2138
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-200",
|
|
2139
2139
|
{
|
|
2140
|
-
"border-primary text-primary": h ===
|
|
2141
|
-
"border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": h !==
|
|
2142
|
-
"border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600":
|
|
2140
|
+
"border-primary text-primary": h === x.id,
|
|
2141
|
+
"border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": h !== x.id && !x.disabled,
|
|
2142
|
+
"border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": x.disabled
|
|
2143
2143
|
}
|
|
2144
2144
|
),
|
|
2145
2145
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
2146
|
-
|
|
2147
|
-
|
|
2146
|
+
x.label,
|
|
2147
|
+
x.badge && /* @__PURE__ */ e("span", { className: g(
|
|
2148
2148
|
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
|
2149
|
-
h ===
|
|
2150
|
-
), children:
|
|
2149
|
+
h === x.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
|
|
2150
|
+
), children: x.badge })
|
|
2151
2151
|
] })
|
|
2152
2152
|
},
|
|
2153
|
-
|
|
2153
|
+
x.id
|
|
2154
2154
|
)) }) });
|
|
2155
2155
|
}, kr = ({
|
|
2156
2156
|
items: r,
|
|
@@ -2161,14 +2161,14 @@ const ur = ({
|
|
|
2161
2161
|
size: i = "md",
|
|
2162
2162
|
className: h
|
|
2163
2163
|
}) => {
|
|
2164
|
-
const [
|
|
2164
|
+
const [b, x] = _(
|
|
2165
2165
|
n || t || r[0]?.id || ""
|
|
2166
|
-
),
|
|
2167
|
-
a ? a(
|
|
2166
|
+
), y = t || b, u = (N) => {
|
|
2167
|
+
a ? a(N) : x(N);
|
|
2168
2168
|
}, l = {
|
|
2169
|
-
activeTab:
|
|
2170
|
-
setActiveTab:
|
|
2171
|
-
}, d = r.find((
|
|
2169
|
+
activeTab: y,
|
|
2170
|
+
setActiveTab: u
|
|
2171
|
+
}, d = r.find((N) => N.id === y), f = g(
|
|
2172
2172
|
"flex",
|
|
2173
2173
|
{
|
|
2174
2174
|
"border-b border-neutral-200 dark:border-neutral-700 px-2": o === "default" || o === "underline",
|
|
@@ -2177,55 +2177,55 @@ const ur = ({
|
|
|
2177
2177
|
"space-x-8": o === "default" || o === "underline"
|
|
2178
2178
|
},
|
|
2179
2179
|
h
|
|
2180
|
-
),
|
|
2181
|
-
const B = "transition-colors duration-200 font-medium",
|
|
2180
|
+
), C = (N, k) => {
|
|
2181
|
+
const B = "transition-colors duration-200 font-medium", p = {
|
|
2182
2182
|
"text-xs px-2 py-1": i === "sm",
|
|
2183
2183
|
"text-sm px-3 py-2": i === "md",
|
|
2184
2184
|
"text-base px-4 py-3": i === "lg"
|
|
2185
|
-
},
|
|
2185
|
+
}, q = {
|
|
2186
2186
|
// Default variant
|
|
2187
2187
|
"border-b-2 -mb-px": o === "default",
|
|
2188
2188
|
// Pills variant
|
|
2189
2189
|
"rounded-md": o === "pills",
|
|
2190
2190
|
// Underline variant
|
|
2191
2191
|
"border-b-2 pb-2": o === "underline"
|
|
2192
|
-
},
|
|
2193
|
-
"opacity-50 cursor-not-allowed":
|
|
2194
|
-
"cursor-pointer": !
|
|
2195
|
-
},
|
|
2192
|
+
}, K = {
|
|
2193
|
+
"opacity-50 cursor-not-allowed": N.disabled,
|
|
2194
|
+
"cursor-pointer": !N.disabled
|
|
2195
|
+
}, H = k ? {
|
|
2196
2196
|
"border-primary text-primary": o === "default" || o === "underline",
|
|
2197
2197
|
"bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": o === "pills"
|
|
2198
|
-
} : {}, F = !
|
|
2198
|
+
} : {}, F = !k && !N.disabled ? {
|
|
2199
2199
|
"border-transparent text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": o === "default",
|
|
2200
2200
|
"text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": o === "pills",
|
|
2201
2201
|
"border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": o === "underline"
|
|
2202
2202
|
} : {};
|
|
2203
|
-
return
|
|
2203
|
+
return g(B, p, q, K, H, F);
|
|
2204
2204
|
};
|
|
2205
2205
|
return /* @__PURE__ */ e(vr.Provider, { value: l, children: /* @__PURE__ */ c("div", { children: [
|
|
2206
|
-
/* @__PURE__ */ e("div", { className:
|
|
2206
|
+
/* @__PURE__ */ e("div", { className: f, role: "tablist", children: r.map((N) => /* @__PURE__ */ e(
|
|
2207
2207
|
"button",
|
|
2208
2208
|
{
|
|
2209
2209
|
type: "button",
|
|
2210
2210
|
role: "tab",
|
|
2211
|
-
"aria-selected":
|
|
2212
|
-
"aria-controls": `tabpanel-${
|
|
2213
|
-
disabled:
|
|
2214
|
-
onClick: () => !
|
|
2215
|
-
className: N
|
|
2211
|
+
"aria-selected": y === N.id,
|
|
2212
|
+
"aria-controls": `tabpanel-${N.id}`,
|
|
2213
|
+
disabled: N.disabled,
|
|
2214
|
+
onClick: () => !N.disabled && u(N.id),
|
|
2215
|
+
className: C(N, y === N.id),
|
|
2216
2216
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
2217
|
-
|
|
2218
|
-
|
|
2217
|
+
N.label,
|
|
2218
|
+
N.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300", children: N.badge })
|
|
2219
2219
|
] })
|
|
2220
2220
|
},
|
|
2221
|
-
|
|
2221
|
+
N.id
|
|
2222
2222
|
)) }),
|
|
2223
2223
|
d?.content && /* @__PURE__ */ e(
|
|
2224
2224
|
"div",
|
|
2225
2225
|
{
|
|
2226
2226
|
role: "tabpanel",
|
|
2227
|
-
id: `tabpanel-${
|
|
2228
|
-
"aria-labelledby": `tab-${
|
|
2227
|
+
id: `tabpanel-${y}`,
|
|
2228
|
+
"aria-labelledby": `tab-${y}`,
|
|
2229
2229
|
className: "mt-4",
|
|
2230
2230
|
children: d.content
|
|
2231
2231
|
}
|
|
@@ -2246,39 +2246,39 @@ function wr({
|
|
|
2246
2246
|
closeOnBackdropClick: o = !0,
|
|
2247
2247
|
closeOnEscape: i = !0,
|
|
2248
2248
|
className: h,
|
|
2249
|
-
backdropClassName:
|
|
2250
|
-
children:
|
|
2251
|
-
footer:
|
|
2252
|
-
showCloseButton:
|
|
2249
|
+
backdropClassName: b,
|
|
2250
|
+
children: x,
|
|
2251
|
+
footer: y,
|
|
2252
|
+
showCloseButton: u = !0
|
|
2253
2253
|
}) {
|
|
2254
2254
|
const l = X(null), d = X(null);
|
|
2255
|
-
|
|
2255
|
+
G(() => {
|
|
2256
2256
|
if (!r || !i) return;
|
|
2257
|
-
const
|
|
2258
|
-
|
|
2257
|
+
const C = (N) => {
|
|
2258
|
+
N.key === "Escape" && n();
|
|
2259
2259
|
};
|
|
2260
|
-
return document.addEventListener("keydown",
|
|
2261
|
-
}, [r, i, n]),
|
|
2260
|
+
return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
|
|
2261
|
+
}, [r, i, n]), G(() => (r ? (d.current = document.activeElement, l.current && l.current.focus(), document.body.style.overflow = "hidden") : (d.current && d.current.focus(), document.body.style.overflow = ""), () => {
|
|
2262
2262
|
document.body.style.overflow = "";
|
|
2263
2263
|
}), [r]);
|
|
2264
|
-
const
|
|
2265
|
-
o &&
|
|
2264
|
+
const f = (C) => {
|
|
2265
|
+
o && C.target === C.currentTarget && n();
|
|
2266
2266
|
};
|
|
2267
2267
|
return r ? /* @__PURE__ */ e(
|
|
2268
2268
|
"div",
|
|
2269
2269
|
{
|
|
2270
|
-
className:
|
|
2270
|
+
className: g(
|
|
2271
2271
|
"fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
2272
2272
|
"bg-black/20",
|
|
2273
2273
|
// 'animate-fade-in',
|
|
2274
|
-
|
|
2274
|
+
b
|
|
2275
2275
|
),
|
|
2276
|
-
onClick:
|
|
2276
|
+
onClick: f,
|
|
2277
2277
|
children: /* @__PURE__ */ c(
|
|
2278
2278
|
"div",
|
|
2279
2279
|
{
|
|
2280
2280
|
ref: l,
|
|
2281
|
-
className:
|
|
2281
|
+
className: g(
|
|
2282
2282
|
"relative w-full bg-white dark:bg-secondary-800 rounded-modal shadow-modal rounded-md",
|
|
2283
2283
|
// 'animate-scale-in',
|
|
2284
2284
|
"focus:outline-none",
|
|
@@ -2290,7 +2290,7 @@ function wr({
|
|
|
2290
2290
|
"aria-labelledby": t ? "modal-title" : void 0,
|
|
2291
2291
|
tabIndex: -1,
|
|
2292
2292
|
children: [
|
|
2293
|
-
(t ||
|
|
2293
|
+
(t || u) && /* @__PURE__ */ c("div", { className: "flex items-center justify-between p-6 pb-0", children: [
|
|
2294
2294
|
t && /* @__PURE__ */ e(
|
|
2295
2295
|
"span",
|
|
2296
2296
|
{
|
|
@@ -2299,7 +2299,7 @@ function wr({
|
|
|
2299
2299
|
children: t
|
|
2300
2300
|
}
|
|
2301
2301
|
),
|
|
2302
|
-
|
|
2302
|
+
u && /* @__PURE__ */ e(
|
|
2303
2303
|
"button",
|
|
2304
2304
|
{
|
|
2305
2305
|
onClick: n,
|
|
@@ -2309,8 +2309,8 @@ function wr({
|
|
|
2309
2309
|
}
|
|
2310
2310
|
)
|
|
2311
2311
|
] }),
|
|
2312
|
-
/* @__PURE__ */ e("div", { className: "p-6", children:
|
|
2313
|
-
|
|
2312
|
+
/* @__PURE__ */ e("div", { className: "p-6", children: x }),
|
|
2313
|
+
y && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: y })
|
|
2314
2314
|
]
|
|
2315
2315
|
}
|
|
2316
2316
|
)
|
|
@@ -2325,14 +2325,14 @@ const Z = ({
|
|
|
2325
2325
|
align: o = "left",
|
|
2326
2326
|
truncate: i = !1,
|
|
2327
2327
|
italic: h = !1,
|
|
2328
|
-
underline:
|
|
2329
|
-
lineHeight:
|
|
2330
|
-
as:
|
|
2331
|
-
className:
|
|
2328
|
+
underline: b = !1,
|
|
2329
|
+
lineHeight: x = "normal",
|
|
2330
|
+
as: y,
|
|
2331
|
+
className: u,
|
|
2332
2332
|
children: l,
|
|
2333
2333
|
...d
|
|
2334
2334
|
}) => {
|
|
2335
|
-
const
|
|
2335
|
+
const f = y || Cr(r), C = g(
|
|
2336
2336
|
// Base styles
|
|
2337
2337
|
"font-primary",
|
|
2338
2338
|
// Variant styles
|
|
@@ -2380,19 +2380,19 @@ const Z = ({
|
|
|
2380
2380
|
},
|
|
2381
2381
|
// Line height (override variant line heights)
|
|
2382
2382
|
r === "body" && {
|
|
2383
|
-
"leading-tight":
|
|
2384
|
-
"leading-normal":
|
|
2385
|
-
"leading-relaxed":
|
|
2383
|
+
"leading-tight": x === "tight",
|
|
2384
|
+
"leading-normal": x === "normal",
|
|
2385
|
+
"leading-relaxed": x === "relaxed"
|
|
2386
2386
|
},
|
|
2387
2387
|
// Text decorations
|
|
2388
2388
|
{
|
|
2389
2389
|
italic: h,
|
|
2390
|
-
underline:
|
|
2390
|
+
underline: b,
|
|
2391
2391
|
truncate: i
|
|
2392
2392
|
},
|
|
2393
|
-
|
|
2393
|
+
u
|
|
2394
2394
|
);
|
|
2395
|
-
return /* @__PURE__ */ e(
|
|
2395
|
+
return /* @__PURE__ */ e(f, { className: C, ...d, children: l });
|
|
2396
2396
|
};
|
|
2397
2397
|
function Cr(r) {
|
|
2398
2398
|
return {
|
|
@@ -2410,36 +2410,36 @@ const Sr = ({
|
|
|
2410
2410
|
error: o,
|
|
2411
2411
|
disabled: i,
|
|
2412
2412
|
accept: h,
|
|
2413
|
-
onListFiles:
|
|
2414
|
-
onListMounts:
|
|
2415
|
-
onUploadFile:
|
|
2416
|
-
onDownloadFile:
|
|
2413
|
+
onListFiles: b,
|
|
2414
|
+
onListMounts: x,
|
|
2415
|
+
onUploadFile: y,
|
|
2416
|
+
onDownloadFile: u,
|
|
2417
2417
|
onRegisterFile: l
|
|
2418
2418
|
}) => {
|
|
2419
|
-
const [d,
|
|
2419
|
+
const [d, f] = _(!1), [C, N] = _([]), [k, B] = _(null), [p, q] = _("/"), [K, H] = _([]), [F, E] = _(!1), [J, z] = _(""), [v, T] = _(
|
|
2420
2420
|
typeof r == "object" ? r : null
|
|
2421
|
-
), [
|
|
2422
|
-
|
|
2421
|
+
), [m, $] = _(!1), [L, D] = _(""), P = X(null);
|
|
2422
|
+
G(() => {
|
|
2423
2423
|
d && M();
|
|
2424
|
-
}, [d]),
|
|
2425
|
-
d &&
|
|
2426
|
-
}, [d,
|
|
2424
|
+
}, [d]), G(() => {
|
|
2425
|
+
d && k && re();
|
|
2426
|
+
}, [d, k, p, J]);
|
|
2427
2427
|
const M = async () => {
|
|
2428
2428
|
E(!0);
|
|
2429
2429
|
try {
|
|
2430
|
-
const s = await
|
|
2431
|
-
s?.data &&
|
|
2430
|
+
const s = await x?.();
|
|
2431
|
+
s?.data && N(s.data);
|
|
2432
2432
|
} catch (s) {
|
|
2433
2433
|
console.error("Failed to load mounts", s);
|
|
2434
2434
|
} finally {
|
|
2435
2435
|
E(!1);
|
|
2436
2436
|
}
|
|
2437
2437
|
}, re = async () => {
|
|
2438
|
-
if (
|
|
2438
|
+
if (k) {
|
|
2439
2439
|
E(!0);
|
|
2440
2440
|
try {
|
|
2441
|
-
const s = await
|
|
2442
|
-
s?.data &&
|
|
2441
|
+
const s = await b?.({ mountId: k.id, name: J, path: p });
|
|
2442
|
+
s?.data && H(s.data);
|
|
2443
2443
|
} catch (s) {
|
|
2444
2444
|
console.error("Failed to load files", s);
|
|
2445
2445
|
} finally {
|
|
@@ -2462,7 +2462,7 @@ const Sr = ({
|
|
|
2462
2462
|
providerKey: w.name,
|
|
2463
2463
|
ownerId: "me"
|
|
2464
2464
|
};
|
|
2465
|
-
T(j), n(j, R),
|
|
2465
|
+
T(j), n(j, R), f(!1);
|
|
2466
2466
|
} catch (O) {
|
|
2467
2467
|
console.error("Local file selection failed", O);
|
|
2468
2468
|
} finally {
|
|
@@ -2471,19 +2471,19 @@ const Sr = ({
|
|
|
2471
2471
|
}
|
|
2472
2472
|
}, W = async (s) => {
|
|
2473
2473
|
const w = s.target.files?.[0];
|
|
2474
|
-
if (!(!w || !
|
|
2474
|
+
if (!(!w || !k)) {
|
|
2475
2475
|
E(!0);
|
|
2476
2476
|
try {
|
|
2477
|
-
const O = await w.arrayBuffer(), R = await
|
|
2477
|
+
const O = await w.arrayBuffer(), R = await y?.({
|
|
2478
2478
|
file: new Uint8Array(O),
|
|
2479
2479
|
filename: w.name,
|
|
2480
2480
|
mimeType: w.type || "application/octet-stream",
|
|
2481
|
-
mountId:
|
|
2482
|
-
path:
|
|
2481
|
+
mountId: k.id,
|
|
2482
|
+
path: p
|
|
2483
2483
|
});
|
|
2484
2484
|
if (R?.data) {
|
|
2485
2485
|
const j = R.data;
|
|
2486
|
-
T(j), n(j, new Uint8Array(O)),
|
|
2486
|
+
T(j), n(j, new Uint8Array(O)), f(!1);
|
|
2487
2487
|
}
|
|
2488
2488
|
} catch (O) {
|
|
2489
2489
|
console.error("Upload failed", O);
|
|
@@ -2491,18 +2491,18 @@ const Sr = ({
|
|
|
2491
2491
|
E(!1);
|
|
2492
2492
|
}
|
|
2493
2493
|
}
|
|
2494
|
-
},
|
|
2495
|
-
if (!(!L || !
|
|
2494
|
+
}, S = async () => {
|
|
2495
|
+
if (!(!L || !k)) {
|
|
2496
2496
|
E(!0);
|
|
2497
2497
|
try {
|
|
2498
|
-
const s = `${
|
|
2498
|
+
const s = `${p}${L}/`;
|
|
2499
2499
|
l && (await l({
|
|
2500
2500
|
name: L,
|
|
2501
2501
|
type: "folder",
|
|
2502
|
-
path:
|
|
2502
|
+
path: p,
|
|
2503
2503
|
mimeType: "application/x-directory",
|
|
2504
2504
|
size: 0,
|
|
2505
|
-
mountId:
|
|
2505
|
+
mountId: k.id,
|
|
2506
2506
|
providerKey: s,
|
|
2507
2507
|
ownerId: "me"
|
|
2508
2508
|
}), await re()), $(!1), D("");
|
|
@@ -2515,33 +2515,33 @@ const Sr = ({
|
|
|
2515
2515
|
}, I = async (s) => {
|
|
2516
2516
|
E(!0);
|
|
2517
2517
|
try {
|
|
2518
|
-
const w = await
|
|
2519
|
-
T(s), n(s, w),
|
|
2518
|
+
const w = await u?.(s.id);
|
|
2519
|
+
T(s), n(s, w), f(!1);
|
|
2520
2520
|
} catch (w) {
|
|
2521
2521
|
console.error("Failed to download file", w);
|
|
2522
2522
|
} finally {
|
|
2523
2523
|
E(!1);
|
|
2524
2524
|
}
|
|
2525
|
-
},
|
|
2525
|
+
}, V = (s) => {
|
|
2526
2526
|
s.stopPropagation(), T(null), n(null);
|
|
2527
2527
|
}, A = ie(() => {
|
|
2528
2528
|
const s = /* @__PURE__ */ new Set(), w = [];
|
|
2529
|
-
return
|
|
2529
|
+
return K.forEach((O) => {
|
|
2530
2530
|
if (O.type === "folder") {
|
|
2531
|
-
O.path ===
|
|
2531
|
+
O.path === p && s.add(O.name);
|
|
2532
2532
|
return;
|
|
2533
2533
|
}
|
|
2534
|
-
const R = O.providerKey || O.name, Y = (
|
|
2534
|
+
const R = O.providerKey || O.name, Y = (p ? R.substring(p.length) : R).split("/").filter((fe) => fe !== "");
|
|
2535
2535
|
Y.length > 1 ? s.add(Y[0]) : Y.length === 1 && w.push(O);
|
|
2536
2536
|
}), {
|
|
2537
2537
|
folders: Array.from(s).sort(),
|
|
2538
2538
|
files: w.sort((O, R) => O.name.localeCompare(R.name))
|
|
2539
2539
|
};
|
|
2540
|
-
}, [
|
|
2541
|
-
|
|
2540
|
+
}, [K, p]), Q = (s) => {
|
|
2541
|
+
q((w) => `${w}${s}/`);
|
|
2542
2542
|
}, te = () => {
|
|
2543
|
-
const s =
|
|
2544
|
-
s.pop(), s.length === 0 ?
|
|
2543
|
+
const s = p.split("/").filter((w) => w !== "");
|
|
2544
|
+
s.pop(), s.length === 0 ? q("/") : q(`${s.join("/")}/`);
|
|
2545
2545
|
}, U = ie(() => {
|
|
2546
2546
|
const s = A.folders.map((w) => ({
|
|
2547
2547
|
id: `folder-${w}`,
|
|
@@ -2563,12 +2563,12 @@ const Sr = ({
|
|
|
2563
2563
|
/* @__PURE__ */ e(
|
|
2564
2564
|
oe,
|
|
2565
2565
|
{
|
|
2566
|
-
icon: w.type === "folder" ? we :
|
|
2566
|
+
icon: w.type === "folder" ? we : xe,
|
|
2567
2567
|
size: "sm",
|
|
2568
2568
|
color: w.type === "folder" ? "warning" : "secondary"
|
|
2569
2569
|
}
|
|
2570
2570
|
),
|
|
2571
|
-
/* @__PURE__ */ e("span", { className:
|
|
2571
|
+
/* @__PURE__ */ e("span", { className: g(w.type === "folder" && "font-medium"), children: s })
|
|
2572
2572
|
] })
|
|
2573
2573
|
},
|
|
2574
2574
|
{
|
|
@@ -2594,7 +2594,7 @@ const Sr = ({
|
|
|
2594
2594
|
onClick: (O) => {
|
|
2595
2595
|
O.stopPropagation(), w.type === "folder" ? Q(w.name) : I(w);
|
|
2596
2596
|
},
|
|
2597
|
-
loading: F && w.type === "file" &&
|
|
2597
|
+
loading: F && w.type === "file" && v?.id === w.id,
|
|
2598
2598
|
children: w.type === "folder" ? "Open" : "Select"
|
|
2599
2599
|
}
|
|
2600
2600
|
)
|
|
@@ -2622,20 +2622,20 @@ const Sr = ({
|
|
|
2622
2622
|
/* @__PURE__ */ c(
|
|
2623
2623
|
"div",
|
|
2624
2624
|
{
|
|
2625
|
-
onClick: () => !i &&
|
|
2626
|
-
className:
|
|
2625
|
+
onClick: () => !i && f(!0),
|
|
2626
|
+
className: g(
|
|
2627
2627
|
"flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
|
|
2628
2628
|
"hover:border-primary-400 bg-white dark:bg-secondary-800",
|
|
2629
2629
|
o ? "border-error" : "border-neutral-200 dark:border-neutral-700",
|
|
2630
2630
|
i && "opacity-50 cursor-not-allowed bg-neutral-50"
|
|
2631
2631
|
),
|
|
2632
2632
|
children: [
|
|
2633
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon:
|
|
2634
|
-
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children:
|
|
2635
|
-
|
|
2633
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: v ? xe : Ne, color: v ? "primary" : "secondary" }) }),
|
|
2634
|
+
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: v ? /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 dark:text-neutral-100 font-medium", children: v.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-neutral-500", children: a }) }),
|
|
2635
|
+
v && !i && /* @__PURE__ */ e(
|
|
2636
2636
|
"button",
|
|
2637
2637
|
{
|
|
2638
|
-
onClick:
|
|
2638
|
+
onClick: V,
|
|
2639
2639
|
className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
|
|
2640
2640
|
children: /* @__PURE__ */ e(oe, { icon: Oe, size: "xs" })
|
|
2641
2641
|
}
|
|
@@ -2649,9 +2649,9 @@ const Sr = ({
|
|
|
2649
2649
|
{
|
|
2650
2650
|
open: d,
|
|
2651
2651
|
onClose: () => {
|
|
2652
|
-
|
|
2652
|
+
f(!1), B(null), q("/"), $(!1);
|
|
2653
2653
|
},
|
|
2654
|
-
title:
|
|
2654
|
+
title: k ? `Explorer: ${k.name}` : "Select Storage Mount",
|
|
2655
2655
|
size: "lg",
|
|
2656
2656
|
children: /* @__PURE__ */ e(
|
|
2657
2657
|
kr,
|
|
@@ -2661,7 +2661,7 @@ const Sr = ({
|
|
|
2661
2661
|
{
|
|
2662
2662
|
id: "remote",
|
|
2663
2663
|
label: "Platform Storage",
|
|
2664
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
2664
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: k ? /* @__PURE__ */ c(Me, { children: [
|
|
2665
2665
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2666
2666
|
/* @__PURE__ */ e(
|
|
2667
2667
|
ee,
|
|
@@ -2669,20 +2669,20 @@ const Sr = ({
|
|
|
2669
2669
|
variant: "ghost",
|
|
2670
2670
|
size: "sm",
|
|
2671
2671
|
onClick: () => {
|
|
2672
|
-
|
|
2672
|
+
p && p !== "/" ? te() : B(null);
|
|
2673
2673
|
},
|
|
2674
2674
|
leftIcon: /* @__PURE__ */ e(oe, { icon: Ee, size: "xs" }),
|
|
2675
|
-
children:
|
|
2675
|
+
children: p ? "Back" : "Back to Mounts"
|
|
2676
2676
|
}
|
|
2677
2677
|
),
|
|
2678
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-neutral-500 overflow-hidden bg-neutral-100 dark:bg-neutral-800 px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2678
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-neutral-500 overflow-hidden bg-neutral-100 dark:bg-neutral-800 px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children: p }) }),
|
|
2679
2679
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-[150px]", children: /* @__PURE__ */ e(
|
|
2680
2680
|
ue,
|
|
2681
2681
|
{
|
|
2682
2682
|
placeholder: "Search...",
|
|
2683
2683
|
value: J,
|
|
2684
2684
|
onChange: (s) => z(s.target.value),
|
|
2685
|
-
startIcon: /* @__PURE__ */ e(
|
|
2685
|
+
startIcon: /* @__PURE__ */ e(Ve, { size: 14 }),
|
|
2686
2686
|
fullWidth: !0,
|
|
2687
2687
|
size: "sm"
|
|
2688
2688
|
}
|
|
@@ -2694,7 +2694,7 @@ const Sr = ({
|
|
|
2694
2694
|
variant: "outline",
|
|
2695
2695
|
size: "sm",
|
|
2696
2696
|
onClick: () => $(!0),
|
|
2697
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2697
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: _e, size: "xs" }),
|
|
2698
2698
|
children: "New Folder"
|
|
2699
2699
|
}
|
|
2700
2700
|
),
|
|
@@ -2721,7 +2721,7 @@ const Sr = ({
|
|
|
2721
2721
|
)
|
|
2722
2722
|
] })
|
|
2723
2723
|
] }),
|
|
2724
|
-
|
|
2724
|
+
m && /* @__PURE__ */ c("div", { className: "flex items-center gap-2 p-3 bg-neutral-50 dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-700", children: [
|
|
2725
2725
|
/* @__PURE__ */ e(oe, { icon: we, size: "sm", color: "warning" }),
|
|
2726
2726
|
/* @__PURE__ */ e(
|
|
2727
2727
|
ue,
|
|
@@ -2733,7 +2733,7 @@ const Sr = ({
|
|
|
2733
2733
|
autoFocus: !0
|
|
2734
2734
|
}
|
|
2735
2735
|
),
|
|
2736
|
-
/* @__PURE__ */ e(ee, { size: "sm", onClick:
|
|
2736
|
+
/* @__PURE__ */ e(ee, { size: "sm", onClick: S, loading: F, children: "Create" }),
|
|
2737
2737
|
/* @__PURE__ */ e(ee, { size: "sm", variant: "ghost", onClick: () => $(!1), children: "Cancel" })
|
|
2738
2738
|
] }),
|
|
2739
2739
|
/* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral-200 dark:border-neutral-700", children: /* @__PURE__ */ e(
|
|
@@ -2749,7 +2749,7 @@ const Sr = ({
|
|
|
2749
2749
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral-200 dark:border-neutral-700", children: /* @__PURE__ */ e(
|
|
2750
2750
|
Se,
|
|
2751
2751
|
{
|
|
2752
|
-
data:
|
|
2752
|
+
data: C,
|
|
2753
2753
|
columns: he,
|
|
2754
2754
|
loading: F,
|
|
2755
2755
|
emptyContent: "No storage mounts configured",
|
|
@@ -2761,7 +2761,7 @@ const Sr = ({
|
|
|
2761
2761
|
id: "local",
|
|
2762
2762
|
label: "Local File",
|
|
2763
2763
|
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-neutral-200 dark:border-neutral-700 rounded-xl bg-neutral-50 dark:bg-secondary-900/50", children: [
|
|
2764
|
-
/* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon:
|
|
2764
|
+
/* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: xe, size: "xl", color: "primary" }) }),
|
|
2765
2765
|
/* @__PURE__ */ e(Z, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
|
|
2766
2766
|
/* @__PURE__ */ c(Z, { variant: "body", size: "sm", className: "text-neutral-500 mt-1 mb-6 text-center max-w-xs", children: [
|
|
2767
2767
|
"This file will be used directly in the form and will ",
|
|
@@ -2769,7 +2769,7 @@ const Sr = ({
|
|
|
2769
2769
|
" be uploaded to platform storage."
|
|
2770
2770
|
] }),
|
|
2771
2771
|
/* @__PURE__ */ c("label", { className: "cursor-pointer", children: [
|
|
2772
|
-
/* @__PURE__ */ c("div", { className:
|
|
2772
|
+
/* @__PURE__ */ c("div", { className: g(
|
|
2773
2773
|
"inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200 px-6 py-3 text-base bg-primary text-white hover:bg-primary-600",
|
|
2774
2774
|
F && "opacity-50 cursor-wait"
|
|
2775
2775
|
), children: [
|
|
@@ -2809,8 +2809,8 @@ function Lr(r, n, t) {
|
|
|
2809
2809
|
const a = n.split("."), o = Array.isArray(r) ? [...r] : { ...r };
|
|
2810
2810
|
let i = o;
|
|
2811
2811
|
for (let h = 0; h < a.length - 1; h++) {
|
|
2812
|
-
const
|
|
2813
|
-
i[
|
|
2812
|
+
const b = a[h], x = i[b];
|
|
2813
|
+
i[b] = x && typeof x == "object" ? Array.isArray(x) ? [...x] : { ...x } : {}, i = i[b];
|
|
2814
2814
|
}
|
|
2815
2815
|
return i[a[a.length - 1]] = t, o;
|
|
2816
2816
|
}
|
|
@@ -2832,23 +2832,23 @@ const rt = ({
|
|
|
2832
2832
|
onChange: o,
|
|
2833
2833
|
transform: i,
|
|
2834
2834
|
validate: h,
|
|
2835
|
-
submitButton:
|
|
2836
|
-
cancelButton:
|
|
2837
|
-
showButtons:
|
|
2838
|
-
layout:
|
|
2835
|
+
submitButton: b = { label: "Submit", variant: "primary" },
|
|
2836
|
+
cancelButton: x = { label: "Cancel", variant: "outline" },
|
|
2837
|
+
showButtons: y = !0,
|
|
2838
|
+
layout: u = "vertical",
|
|
2839
2839
|
size: l = "md",
|
|
2840
2840
|
loading: d = !1,
|
|
2841
|
-
className:
|
|
2842
|
-
ref:
|
|
2843
|
-
sdk:
|
|
2841
|
+
className: f,
|
|
2842
|
+
ref: C,
|
|
2843
|
+
sdk: N
|
|
2844
2844
|
}) => {
|
|
2845
|
-
const [
|
|
2846
|
-
|
|
2845
|
+
const [k, B] = _(n || {}), [p, q] = _({}), [K, H] = _({});
|
|
2846
|
+
G(() => {
|
|
2847
2847
|
n && B({ ...n });
|
|
2848
2848
|
}, [n]);
|
|
2849
2849
|
const F = ae(
|
|
2850
|
-
(
|
|
2851
|
-
const D = r.flatMap((P) => P.items).find((P) => P.name ===
|
|
2850
|
+
(m, $, L) => {
|
|
2851
|
+
const D = r.flatMap((P) => P.items).find((P) => P.name === m);
|
|
2852
2852
|
if (!D) return null;
|
|
2853
2853
|
if (D.required && ($ == null || $ === ""))
|
|
2854
2854
|
return `${D.label} is required`;
|
|
@@ -2862,13 +2862,13 @@ const rt = ({
|
|
|
2862
2862
|
let M = !1;
|
|
2863
2863
|
if ($.forEach((re, ne) => {
|
|
2864
2864
|
const W = {};
|
|
2865
|
-
for (const
|
|
2866
|
-
const I = re?.[
|
|
2867
|
-
if (
|
|
2868
|
-
W[
|
|
2869
|
-
else if (
|
|
2870
|
-
const
|
|
2871
|
-
|
|
2865
|
+
for (const S of D.arrayFields) {
|
|
2866
|
+
const I = re?.[S.name];
|
|
2867
|
+
if (S.required && (I == null || I === ""))
|
|
2868
|
+
W[S.name] = `${S.label} is required`, M = !0;
|
|
2869
|
+
else if (S.validator) {
|
|
2870
|
+
const V = S.validator(I, re);
|
|
2871
|
+
V && (W[S.name] = V, M = !0);
|
|
2872
2872
|
}
|
|
2873
2873
|
}
|
|
2874
2874
|
P[ne] = W;
|
|
@@ -2880,54 +2880,54 @@ const rt = ({
|
|
|
2880
2880
|
},
|
|
2881
2881
|
[r]
|
|
2882
2882
|
), E = ae(
|
|
2883
|
-
(
|
|
2883
|
+
(m, $) => {
|
|
2884
2884
|
let L = Lr(
|
|
2885
|
-
|
|
2886
|
-
|
|
2885
|
+
k,
|
|
2886
|
+
m,
|
|
2887
2887
|
$
|
|
2888
2888
|
);
|
|
2889
|
-
r.flatMap((M) => M.items).find((M) => M.name ===
|
|
2890
|
-
const P = F(
|
|
2891
|
-
|
|
2889
|
+
r.flatMap((M) => M.items).find((M) => M.name === m)?.removeIfEmpty && ($ == null || $ === "") && (L = Mr(L, m)), B(L), H((M) => ({ ...M, [m]: !0 }));
|
|
2890
|
+
const P = F(m, $, L);
|
|
2891
|
+
q((M) => ({
|
|
2892
2892
|
...M,
|
|
2893
|
-
[
|
|
2894
|
-
})), o?.(L,
|
|
2893
|
+
[m]: P || ""
|
|
2894
|
+
})), o?.(L, m);
|
|
2895
2895
|
},
|
|
2896
|
-
[
|
|
2896
|
+
[k, r, F, o]
|
|
2897
2897
|
), J = ae(
|
|
2898
|
-
async (
|
|
2899
|
-
if (console.log("handleSubmit"),
|
|
2898
|
+
async (m) => {
|
|
2899
|
+
if (console.log("handleSubmit"), m.preventDefault(), d) return;
|
|
2900
2900
|
const $ = {}, L = r.flatMap((P) => P.items);
|
|
2901
2901
|
for (const P of L) {
|
|
2902
|
-
if (P.hidden || P.conditional && !P.conditional(
|
|
2902
|
+
if (P.hidden || P.conditional && !P.conditional(k))
|
|
2903
2903
|
continue;
|
|
2904
2904
|
const M = F(
|
|
2905
2905
|
P.name,
|
|
2906
|
-
Le(
|
|
2907
|
-
|
|
2906
|
+
Le(k, P.name),
|
|
2907
|
+
k
|
|
2908
2908
|
);
|
|
2909
2909
|
M && ($[P.name] = M);
|
|
2910
2910
|
}
|
|
2911
2911
|
if (h) {
|
|
2912
|
-
const P = h(
|
|
2912
|
+
const P = h(k);
|
|
2913
2913
|
P && Object.assign($, P);
|
|
2914
2914
|
}
|
|
2915
|
-
if (
|
|
2915
|
+
if (q($), console.log("newErrors", $), Object.keys($).some((P) => $[P]))
|
|
2916
2916
|
return;
|
|
2917
|
-
const D = i ? i(
|
|
2918
|
-
await t?.(
|
|
2917
|
+
const D = i ? i(k) : k;
|
|
2918
|
+
await t?.(k, D);
|
|
2919
2919
|
},
|
|
2920
|
-
[
|
|
2920
|
+
[k, r, F, h, i, t, d]
|
|
2921
2921
|
), z = ae(
|
|
2922
|
-
(
|
|
2923
|
-
const $ = Le(
|
|
2922
|
+
(m) => {
|
|
2923
|
+
const $ = Le(k, m.name), L = K[m.name] ? p[m.name] : void 0, D = m.disabled || d, P = {
|
|
2924
2924
|
value: $ || "",
|
|
2925
2925
|
disabled: D,
|
|
2926
|
-
required:
|
|
2927
|
-
placeholder:
|
|
2928
|
-
...
|
|
2926
|
+
required: m.required,
|
|
2927
|
+
placeholder: m.placeholder,
|
|
2928
|
+
...m.fieldProps
|
|
2929
2929
|
};
|
|
2930
|
-
switch (
|
|
2930
|
+
switch (m.type) {
|
|
2931
2931
|
case "text":
|
|
2932
2932
|
case "email":
|
|
2933
2933
|
case "password":
|
|
@@ -2938,9 +2938,9 @@ const rt = ({
|
|
|
2938
2938
|
ue,
|
|
2939
2939
|
{
|
|
2940
2940
|
...P,
|
|
2941
|
-
onChange: (M) => E(
|
|
2942
|
-
type:
|
|
2943
|
-
autoComplete:
|
|
2941
|
+
onChange: (M) => E(m.name, M.target.value),
|
|
2942
|
+
type: m.textType || m.type,
|
|
2943
|
+
autoComplete: m.autocomplete,
|
|
2944
2944
|
error: L,
|
|
2945
2945
|
size: l
|
|
2946
2946
|
}
|
|
@@ -2950,7 +2950,7 @@ const rt = ({
|
|
|
2950
2950
|
ke,
|
|
2951
2951
|
{
|
|
2952
2952
|
...P,
|
|
2953
|
-
onChange: (M) => E(
|
|
2953
|
+
onChange: (M) => E(m.name, M.target.value),
|
|
2954
2954
|
rows: 4,
|
|
2955
2955
|
error: L,
|
|
2956
2956
|
size: l
|
|
@@ -2961,14 +2961,14 @@ const rt = ({
|
|
|
2961
2961
|
ve,
|
|
2962
2962
|
{
|
|
2963
2963
|
...P,
|
|
2964
|
-
onChange: (M) => E(
|
|
2965
|
-
options: (
|
|
2964
|
+
onChange: (M) => E(m.name, M),
|
|
2965
|
+
options: (m.options || []).map((M) => ({
|
|
2966
2966
|
...M,
|
|
2967
2967
|
value: String(M.value)
|
|
2968
2968
|
})),
|
|
2969
|
-
searchable:
|
|
2970
|
-
multiple:
|
|
2971
|
-
allowCreate:
|
|
2969
|
+
searchable: m.searchable,
|
|
2970
|
+
multiple: m.multiple,
|
|
2971
|
+
allowCreate: m.allowCreate,
|
|
2972
2972
|
error: L,
|
|
2973
2973
|
size: l
|
|
2974
2974
|
}
|
|
@@ -2979,20 +2979,20 @@ const rt = ({
|
|
|
2979
2979
|
{
|
|
2980
2980
|
...P,
|
|
2981
2981
|
checked: !!$,
|
|
2982
|
-
onChange: (M) => E(
|
|
2982
|
+
onChange: (M) => E(m.name, M.target.checked),
|
|
2983
2983
|
size: l
|
|
2984
2984
|
}
|
|
2985
2985
|
);
|
|
2986
2986
|
case "radio":
|
|
2987
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1", children:
|
|
2987
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1", children: m.options?.map((M) => /* @__PURE__ */ c("label", { className: "flex items-center gap-2", children: [
|
|
2988
2988
|
/* @__PURE__ */ e(
|
|
2989
2989
|
"input",
|
|
2990
2990
|
{
|
|
2991
2991
|
type: "radio",
|
|
2992
|
-
name:
|
|
2992
|
+
name: m.name,
|
|
2993
2993
|
value: M.value,
|
|
2994
2994
|
checked: $ === M.value,
|
|
2995
|
-
onChange: () => E(
|
|
2995
|
+
onChange: () => E(m.name, M.value),
|
|
2996
2996
|
disabled: D || M.disabled,
|
|
2997
2997
|
className: "rounded-full border-neutral-100 dark:border-neutral-600"
|
|
2998
2998
|
}
|
|
@@ -3005,7 +3005,7 @@ const rt = ({
|
|
|
3005
3005
|
{
|
|
3006
3006
|
...P,
|
|
3007
3007
|
value: $ ? new Date($) : null,
|
|
3008
|
-
onChange: (M) => E(
|
|
3008
|
+
onChange: (M) => E(m.name, M),
|
|
3009
3009
|
size: l
|
|
3010
3010
|
}
|
|
3011
3011
|
);
|
|
@@ -3015,27 +3015,27 @@ const rt = ({
|
|
|
3015
3015
|
{
|
|
3016
3016
|
...P,
|
|
3017
3017
|
value: $,
|
|
3018
|
-
onChange: (M) => E(
|
|
3018
|
+
onChange: (M) => E(m.name, M),
|
|
3019
3019
|
error: L,
|
|
3020
|
-
onListFiles: (M) =>
|
|
3020
|
+
onListFiles: (M) => N?.http.invoke({
|
|
3021
3021
|
method: "POST",
|
|
3022
3022
|
action: "storage.file.list",
|
|
3023
3023
|
body: M
|
|
3024
3024
|
}),
|
|
3025
|
-
onListMounts: () =>
|
|
3025
|
+
onListMounts: () => N?.http.invoke({
|
|
3026
3026
|
method: "GET",
|
|
3027
3027
|
action: "storage.mount"
|
|
3028
3028
|
}),
|
|
3029
|
-
onUploadFile: (M) =>
|
|
3029
|
+
onUploadFile: (M) => N?.http.invoke({
|
|
3030
3030
|
method: "POST",
|
|
3031
3031
|
action: "storage.file.upload",
|
|
3032
3032
|
body: M
|
|
3033
3033
|
}),
|
|
3034
|
-
onDownloadFile: (M) =>
|
|
3034
|
+
onDownloadFile: (M) => N?.http.invoke({
|
|
3035
3035
|
method: "GET",
|
|
3036
3036
|
action: `storage.file.${M}.download`
|
|
3037
3037
|
}),
|
|
3038
|
-
onRegisterFile: (M) =>
|
|
3038
|
+
onRegisterFile: (M) => N?.http.invoke({
|
|
3039
3039
|
method: "POST",
|
|
3040
3040
|
action: "storage.file.folder",
|
|
3041
3041
|
body: M
|
|
@@ -3043,9 +3043,9 @@ const rt = ({
|
|
|
3043
3043
|
}
|
|
3044
3044
|
);
|
|
3045
3045
|
case "custom":
|
|
3046
|
-
return
|
|
3046
|
+
return m.customComponent?.({
|
|
3047
3047
|
value: $,
|
|
3048
|
-
onChange: (M) => E(
|
|
3048
|
+
onChange: (M) => E(m.name, M),
|
|
3049
3049
|
error: L,
|
|
3050
3050
|
disabled: D
|
|
3051
3051
|
});
|
|
@@ -3058,21 +3058,21 @@ const rt = ({
|
|
|
3058
3058
|
} catch {
|
|
3059
3059
|
}
|
|
3060
3060
|
const ne = () => {
|
|
3061
|
-
E(
|
|
3061
|
+
E(m.name, [...M, {}]);
|
|
3062
3062
|
}, W = (I) => {
|
|
3063
3063
|
E(
|
|
3064
|
-
|
|
3065
|
-
M.filter((
|
|
3064
|
+
m.name,
|
|
3065
|
+
M.filter((V, A) => A !== I)
|
|
3066
3066
|
);
|
|
3067
|
-
},
|
|
3067
|
+
}, S = (I, V, A) => {
|
|
3068
3068
|
const Q = [...M];
|
|
3069
3069
|
Q[I] = {
|
|
3070
3070
|
...Q[I],
|
|
3071
|
-
[
|
|
3072
|
-
}, E(
|
|
3071
|
+
[V]: A
|
|
3072
|
+
}, E(m.name, Q);
|
|
3073
3073
|
};
|
|
3074
3074
|
return /* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
3075
|
-
M.map((I,
|
|
3075
|
+
M.map((I, V) => /* @__PURE__ */ c(
|
|
3076
3076
|
"div",
|
|
3077
3077
|
{
|
|
3078
3078
|
className: "p-4 border rounded-md dark:border-neutral-700 space-y-2 relative",
|
|
@@ -3083,13 +3083,13 @@ const rt = ({
|
|
|
3083
3083
|
type: "button",
|
|
3084
3084
|
variant: "ghost",
|
|
3085
3085
|
size: "sm",
|
|
3086
|
-
onClick: () => W(
|
|
3086
|
+
onClick: () => W(V),
|
|
3087
3087
|
disabled: D,
|
|
3088
3088
|
children: "Remove"
|
|
3089
3089
|
}
|
|
3090
3090
|
) }),
|
|
3091
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
3092
|
-
const Q = re?.[
|
|
3091
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: m.arrayFields?.map((A) => {
|
|
3092
|
+
const Q = re?.[V]?.[A.name];
|
|
3093
3093
|
return /* @__PURE__ */ c(
|
|
3094
3094
|
"div",
|
|
3095
3095
|
{
|
|
@@ -3126,8 +3126,8 @@ const rt = ({
|
|
|
3126
3126
|
ue,
|
|
3127
3127
|
{
|
|
3128
3128
|
...te,
|
|
3129
|
-
onChange: (U) =>
|
|
3130
|
-
|
|
3129
|
+
onChange: (U) => S(
|
|
3130
|
+
V,
|
|
3131
3131
|
A.name,
|
|
3132
3132
|
U.target.value
|
|
3133
3133
|
),
|
|
@@ -3142,8 +3142,8 @@ const rt = ({
|
|
|
3142
3142
|
ke,
|
|
3143
3143
|
{
|
|
3144
3144
|
...te,
|
|
3145
|
-
onChange: (U) =>
|
|
3146
|
-
|
|
3145
|
+
onChange: (U) => S(
|
|
3146
|
+
V,
|
|
3147
3147
|
A.name,
|
|
3148
3148
|
U.target.value
|
|
3149
3149
|
),
|
|
@@ -3157,8 +3157,8 @@ const rt = ({
|
|
|
3157
3157
|
ve,
|
|
3158
3158
|
{
|
|
3159
3159
|
...te,
|
|
3160
|
-
onChange: (U) =>
|
|
3161
|
-
|
|
3160
|
+
onChange: (U) => S(
|
|
3161
|
+
V,
|
|
3162
3162
|
A.name,
|
|
3163
3163
|
U
|
|
3164
3164
|
),
|
|
@@ -3181,8 +3181,8 @@ const rt = ({
|
|
|
3181
3181
|
{
|
|
3182
3182
|
...te,
|
|
3183
3183
|
checked: !!I?.[A.name],
|
|
3184
|
-
onChange: (U) =>
|
|
3185
|
-
|
|
3184
|
+
onChange: (U) => S(
|
|
3185
|
+
V,
|
|
3186
3186
|
A.name,
|
|
3187
3187
|
U.target.checked
|
|
3188
3188
|
),
|
|
@@ -3199,11 +3199,11 @@ const rt = ({
|
|
|
3199
3199
|
"input",
|
|
3200
3200
|
{
|
|
3201
3201
|
type: "radio",
|
|
3202
|
-
name: `${
|
|
3202
|
+
name: `${m.name}.${V}.${A.name}`,
|
|
3203
3203
|
value: U.value,
|
|
3204
3204
|
checked: I?.[A.name] === U.value,
|
|
3205
|
-
onChange: () =>
|
|
3206
|
-
|
|
3205
|
+
onChange: () => S(
|
|
3206
|
+
V,
|
|
3207
3207
|
A.name,
|
|
3208
3208
|
U.value
|
|
3209
3209
|
),
|
|
@@ -3223,8 +3223,8 @@ const rt = ({
|
|
|
3223
3223
|
{
|
|
3224
3224
|
...te,
|
|
3225
3225
|
value: U ? new Date(U) : null,
|
|
3226
|
-
onChange: (le) =>
|
|
3227
|
-
|
|
3226
|
+
onChange: (le) => S(
|
|
3227
|
+
V,
|
|
3228
3228
|
A.name,
|
|
3229
3229
|
le
|
|
3230
3230
|
),
|
|
@@ -3235,8 +3235,8 @@ const rt = ({
|
|
|
3235
3235
|
case "custom":
|
|
3236
3236
|
return A.customComponent?.({
|
|
3237
3237
|
value: I?.[A.name],
|
|
3238
|
-
onChange: (U) =>
|
|
3239
|
-
|
|
3238
|
+
onChange: (U) => S(
|
|
3239
|
+
V,
|
|
3240
3240
|
A.name,
|
|
3241
3241
|
U
|
|
3242
3242
|
),
|
|
@@ -3268,7 +3268,7 @@ const rt = ({
|
|
|
3268
3268
|
}) })
|
|
3269
3269
|
]
|
|
3270
3270
|
},
|
|
3271
|
-
|
|
3271
|
+
V
|
|
3272
3272
|
)),
|
|
3273
3273
|
/* @__PURE__ */ c(
|
|
3274
3274
|
ee,
|
|
@@ -3280,7 +3280,7 @@ const rt = ({
|
|
|
3280
3280
|
disabled: D,
|
|
3281
3281
|
children: [
|
|
3282
3282
|
"Add ",
|
|
3283
|
-
|
|
3283
|
+
m.label
|
|
3284
3284
|
]
|
|
3285
3285
|
}
|
|
3286
3286
|
)
|
|
@@ -3290,26 +3290,26 @@ const rt = ({
|
|
|
3290
3290
|
return null;
|
|
3291
3291
|
}
|
|
3292
3292
|
},
|
|
3293
|
-
[
|
|
3294
|
-
),
|
|
3295
|
-
(
|
|
3296
|
-
if (
|
|
3293
|
+
[k, K, p, d, l, E]
|
|
3294
|
+
), v = ae(
|
|
3295
|
+
(m) => {
|
|
3296
|
+
if (m.conditional && !m.conditional(k))
|
|
3297
3297
|
return null;
|
|
3298
|
-
const $ =
|
|
3298
|
+
const $ = m.items.filter((D) => !(D.hidden || D.conditional && !D.conditional(k)));
|
|
3299
3299
|
if ($.length === 0) return null;
|
|
3300
|
-
const L =
|
|
3300
|
+
const L = g(
|
|
3301
3301
|
"space-y-2",
|
|
3302
3302
|
{
|
|
3303
|
-
"grid gap-2":
|
|
3304
|
-
"flex flex-wrap gap-2":
|
|
3303
|
+
"grid gap-2": m.layout === "grid",
|
|
3304
|
+
"flex flex-wrap gap-2": m.layout === "flex"
|
|
3305
3305
|
},
|
|
3306
|
-
|
|
3307
|
-
"grid-cols-1": !
|
|
3308
|
-
"grid-cols-2":
|
|
3309
|
-
"grid-cols-3":
|
|
3310
|
-
"grid-cols-4":
|
|
3306
|
+
m.layout === "grid" && {
|
|
3307
|
+
"grid-cols-1": !m.columns || m.columns === 1,
|
|
3308
|
+
"grid-cols-2": m.columns === 2,
|
|
3309
|
+
"grid-cols-3": m.columns === 3,
|
|
3310
|
+
"grid-cols-4": m.columns === 4
|
|
3311
3311
|
},
|
|
3312
|
-
|
|
3312
|
+
m.className
|
|
3313
3313
|
);
|
|
3314
3314
|
return /* @__PURE__ */ c(
|
|
3315
3315
|
"div",
|
|
@@ -3324,23 +3324,23 @@ const rt = ({
|
|
|
3324
3324
|
size: "lg",
|
|
3325
3325
|
weight: "semibold",
|
|
3326
3326
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
3327
|
-
children:
|
|
3327
|
+
children: m.title
|
|
3328
3328
|
}
|
|
3329
3329
|
),
|
|
3330
|
-
|
|
3330
|
+
m.description && /* @__PURE__ */ e(
|
|
3331
3331
|
Z,
|
|
3332
3332
|
{
|
|
3333
3333
|
variant: "body",
|
|
3334
3334
|
size: "sm",
|
|
3335
3335
|
className: "text-neutral-600 dark:text-neutral-400 mt-1",
|
|
3336
|
-
children:
|
|
3336
|
+
children: m.description
|
|
3337
3337
|
}
|
|
3338
3338
|
)
|
|
3339
3339
|
] }),
|
|
3340
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: L, children: $.map((D) => (
|
|
3340
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: L, children: $.map((D) => (K[D.name] && p[D.name], /* @__PURE__ */ c(
|
|
3341
3341
|
"div",
|
|
3342
3342
|
{
|
|
3343
|
-
className:
|
|
3343
|
+
className: g(
|
|
3344
3344
|
"space-y-1",
|
|
3345
3345
|
D.width && typeof D.width == "string" && `w-[${D.width}]`,
|
|
3346
3346
|
D.width && typeof D.width == "number" && `col-span-${D.width}`
|
|
@@ -3365,11 +3365,11 @@ const rt = ({
|
|
|
3365
3365
|
))) }) })
|
|
3366
3366
|
]
|
|
3367
3367
|
},
|
|
3368
|
-
|
|
3368
|
+
m.id
|
|
3369
3369
|
);
|
|
3370
3370
|
},
|
|
3371
|
-
[
|
|
3372
|
-
), T =
|
|
3371
|
+
[k, K, p, z]
|
|
3372
|
+
), T = g(
|
|
3373
3373
|
"space-y-6",
|
|
3374
3374
|
{
|
|
3375
3375
|
"max-w-md": l === "sm",
|
|
@@ -3377,33 +3377,33 @@ const rt = ({
|
|
|
3377
3377
|
"max-w-4xl": l === "lg",
|
|
3378
3378
|
"max-w-full": l === "full"
|
|
3379
3379
|
},
|
|
3380
|
-
|
|
3380
|
+
f
|
|
3381
3381
|
);
|
|
3382
|
-
return /* @__PURE__ */ c("form", { ref:
|
|
3383
|
-
/* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(
|
|
3384
|
-
|
|
3382
|
+
return /* @__PURE__ */ c("form", { ref: C, onSubmit: J, className: T, children: [
|
|
3383
|
+
/* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(v) }),
|
|
3384
|
+
y && /* @__PURE__ */ c("div", { className: g("flex gap-3 justify-end pt-8"), children: [
|
|
3385
3385
|
a && /* @__PURE__ */ e(
|
|
3386
3386
|
ee,
|
|
3387
3387
|
{
|
|
3388
3388
|
type: "button",
|
|
3389
|
-
variant:
|
|
3390
|
-
size:
|
|
3391
|
-
disabled:
|
|
3389
|
+
variant: x.variant,
|
|
3390
|
+
size: x.size || l,
|
|
3391
|
+
disabled: x.disabled || d,
|
|
3392
3392
|
onClick: a,
|
|
3393
|
-
className:
|
|
3394
|
-
children:
|
|
3393
|
+
className: x.className,
|
|
3394
|
+
children: x.label
|
|
3395
3395
|
}
|
|
3396
3396
|
),
|
|
3397
3397
|
/* @__PURE__ */ e(
|
|
3398
3398
|
ee,
|
|
3399
3399
|
{
|
|
3400
3400
|
type: "submit",
|
|
3401
|
-
variant:
|
|
3402
|
-
size:
|
|
3403
|
-
disabled:
|
|
3401
|
+
variant: b.variant,
|
|
3402
|
+
size: b.size || l,
|
|
3403
|
+
disabled: b.disabled || d,
|
|
3404
3404
|
loading: d,
|
|
3405
|
-
className:
|
|
3406
|
-
children:
|
|
3405
|
+
className: b.className,
|
|
3406
|
+
children: b.label
|
|
3407
3407
|
}
|
|
3408
3408
|
)
|
|
3409
3409
|
] })
|
|
@@ -3437,13 +3437,13 @@ function tt({
|
|
|
3437
3437
|
dismissible: o = !1,
|
|
3438
3438
|
onDismiss: i,
|
|
3439
3439
|
className: h,
|
|
3440
|
-
children:
|
|
3441
|
-
...
|
|
3440
|
+
children: b,
|
|
3441
|
+
...x
|
|
3442
3442
|
}) {
|
|
3443
3443
|
return /* @__PURE__ */ c(
|
|
3444
3444
|
"span",
|
|
3445
3445
|
{
|
|
3446
|
-
className:
|
|
3446
|
+
className: g(
|
|
3447
3447
|
// Base styles
|
|
3448
3448
|
"inline-flex items-center font-medium rounded-full",
|
|
3449
3449
|
// Variant styles
|
|
@@ -3452,19 +3452,19 @@ function tt({
|
|
|
3452
3452
|
$r[n],
|
|
3453
3453
|
h
|
|
3454
3454
|
),
|
|
3455
|
-
...
|
|
3455
|
+
...x,
|
|
3456
3456
|
children: [
|
|
3457
3457
|
t && /* @__PURE__ */ e(
|
|
3458
3458
|
"span",
|
|
3459
3459
|
{
|
|
3460
|
-
className:
|
|
3460
|
+
className: g(
|
|
3461
3461
|
"w-2 h-2 rounded-full mr-1.5",
|
|
3462
3462
|
zr[r]
|
|
3463
3463
|
)
|
|
3464
3464
|
}
|
|
3465
3465
|
),
|
|
3466
|
-
a && /* @__PURE__ */ e("span", { className:
|
|
3467
|
-
|
|
3466
|
+
a && /* @__PURE__ */ e("span", { className: g("flex-shrink-0", b && "mr-1"), children: a }),
|
|
3467
|
+
b,
|
|
3468
3468
|
o && i && /* @__PURE__ */ e(
|
|
3469
3469
|
"button",
|
|
3470
3470
|
{
|
|
@@ -3514,7 +3514,7 @@ function at({
|
|
|
3514
3514
|
return /* @__PURE__ */ c(
|
|
3515
3515
|
"div",
|
|
3516
3516
|
{
|
|
3517
|
-
className:
|
|
3517
|
+
className: g(
|
|
3518
3518
|
"inline-flex items-center",
|
|
3519
3519
|
a ? "flex-col space-y-2" : "",
|
|
3520
3520
|
o
|
|
@@ -3524,7 +3524,7 @@ function at({
|
|
|
3524
3524
|
/* @__PURE__ */ c(
|
|
3525
3525
|
"svg",
|
|
3526
3526
|
{
|
|
3527
|
-
className:
|
|
3527
|
+
className: g(
|
|
3528
3528
|
"animate-spin",
|
|
3529
3529
|
Dr[r],
|
|
3530
3530
|
Tr[n]
|
|
@@ -3559,7 +3559,7 @@ function at({
|
|
|
3559
3559
|
a && /* @__PURE__ */ e(
|
|
3560
3560
|
"span",
|
|
3561
3561
|
{
|
|
3562
|
-
className:
|
|
3562
|
+
className: g(
|
|
3563
3563
|
"text-secondary-600 dark:text-secondary-400",
|
|
3564
3564
|
Ar[r]
|
|
3565
3565
|
),
|
|
@@ -3579,23 +3579,23 @@ const nt = ({
|
|
|
3579
3579
|
radius: o = "md",
|
|
3580
3580
|
showLoading: i = !0,
|
|
3581
3581
|
showError: h = !0,
|
|
3582
|
-
fallback:
|
|
3583
|
-
loadingContent:
|
|
3584
|
-
errorContent:
|
|
3585
|
-
className:
|
|
3582
|
+
fallback: b,
|
|
3583
|
+
loadingContent: x,
|
|
3584
|
+
errorContent: y,
|
|
3585
|
+
className: u,
|
|
3586
3586
|
onLoad: l,
|
|
3587
3587
|
onError: d,
|
|
3588
|
-
...
|
|
3588
|
+
...f
|
|
3589
3589
|
}) => {
|
|
3590
|
-
const [
|
|
3591
|
-
|
|
3592
|
-
},
|
|
3593
|
-
if (
|
|
3594
|
-
|
|
3590
|
+
const [C, N] = _(!0), [k, B] = _(!1), [p, q] = _(r), K = (T) => {
|
|
3591
|
+
N(!1), B(!1), l?.(T);
|
|
3592
|
+
}, H = (T) => {
|
|
3593
|
+
if (N(!1), B(!0), b && p !== b) {
|
|
3594
|
+
q(b), B(!1), N(!0);
|
|
3595
3595
|
return;
|
|
3596
3596
|
}
|
|
3597
3597
|
d?.(T);
|
|
3598
|
-
}, F =
|
|
3598
|
+
}, F = g(
|
|
3599
3599
|
"relative overflow-hidden bg-neutral-100 dark:bg-neutral-800",
|
|
3600
3600
|
// Size variants
|
|
3601
3601
|
{
|
|
@@ -3622,17 +3622,17 @@ const nt = ({
|
|
|
3622
3622
|
"rounded-xl": o === "xl",
|
|
3623
3623
|
"rounded-full": o === "full"
|
|
3624
3624
|
},
|
|
3625
|
-
|
|
3626
|
-
), E =
|
|
3625
|
+
u
|
|
3626
|
+
), E = g(
|
|
3627
3627
|
"w-full h-full object-cover transition-opacity duration-200",
|
|
3628
3628
|
{
|
|
3629
|
-
"opacity-0":
|
|
3630
|
-
"opacity-100": !
|
|
3629
|
+
"opacity-0": C || k,
|
|
3630
|
+
"opacity-100": !C && !k
|
|
3631
3631
|
}
|
|
3632
|
-
), J =
|
|
3632
|
+
), J = g(
|
|
3633
3633
|
"absolute inset-0 flex items-center justify-center",
|
|
3634
3634
|
"text-neutral-400 dark:text-neutral-500"
|
|
3635
|
-
), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }),
|
|
3635
|
+
), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), v = /* @__PURE__ */ c("div", { className: "text-center", children: [
|
|
3636
3636
|
/* @__PURE__ */ e(
|
|
3637
3637
|
"svg",
|
|
3638
3638
|
{
|
|
@@ -3657,16 +3657,16 @@ const nt = ({
|
|
|
3657
3657
|
/* @__PURE__ */ e(
|
|
3658
3658
|
"img",
|
|
3659
3659
|
{
|
|
3660
|
-
...
|
|
3661
|
-
src:
|
|
3660
|
+
...f,
|
|
3661
|
+
src: p,
|
|
3662
3662
|
alt: n,
|
|
3663
3663
|
className: E,
|
|
3664
|
-
onLoad:
|
|
3665
|
-
onError:
|
|
3664
|
+
onLoad: K,
|
|
3665
|
+
onError: H
|
|
3666
3666
|
}
|
|
3667
3667
|
),
|
|
3668
|
-
|
|
3669
|
-
|
|
3668
|
+
C && i && /* @__PURE__ */ e("div", { className: J, children: x || z }),
|
|
3669
|
+
k && h && /* @__PURE__ */ e("div", { className: J, children: y || v })
|
|
3670
3670
|
] });
|
|
3671
3671
|
}, lt = ({
|
|
3672
3672
|
title: r,
|
|
@@ -3676,101 +3676,101 @@ const nt = ({
|
|
|
3676
3676
|
className: o,
|
|
3677
3677
|
backLabel: i = "Back",
|
|
3678
3678
|
backClassName: h,
|
|
3679
|
-
onBack:
|
|
3680
|
-
editable:
|
|
3681
|
-
onTitleChange:
|
|
3679
|
+
onBack: b,
|
|
3680
|
+
editable: x = !1,
|
|
3681
|
+
onTitleChange: y
|
|
3682
3682
|
}) => {
|
|
3683
|
-
const [
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
}, [r]),
|
|
3687
|
-
|
|
3688
|
-
}, [
|
|
3689
|
-
const
|
|
3690
|
-
|
|
3691
|
-
},
|
|
3692
|
-
l(!1), d.trim() !== "" && d !== r &&
|
|
3693
|
-
}, B = (
|
|
3694
|
-
|
|
3683
|
+
const [u, l] = _(!1), [d, f] = _(r), C = X(null);
|
|
3684
|
+
G(() => {
|
|
3685
|
+
f(r);
|
|
3686
|
+
}, [r]), G(() => {
|
|
3687
|
+
u && C.current && (C.current.focus(), C.current.select());
|
|
3688
|
+
}, [u]);
|
|
3689
|
+
const N = () => {
|
|
3690
|
+
x && l(!0);
|
|
3691
|
+
}, k = () => {
|
|
3692
|
+
l(!1), d.trim() !== "" && d !== r && y ? y(d.trim()) : f(r);
|
|
3693
|
+
}, B = (p) => {
|
|
3694
|
+
p.key === "Enter" ? C.current?.blur() : p.key === "Escape" && (f(r), l(!1));
|
|
3695
3695
|
};
|
|
3696
3696
|
return /* @__PURE__ */ c(
|
|
3697
3697
|
"div",
|
|
3698
3698
|
{
|
|
3699
|
-
className:
|
|
3699
|
+
className: g(
|
|
3700
3700
|
"p-5 pb-3 border-b border-gray-100 dark:border-gray-700",
|
|
3701
3701
|
o
|
|
3702
3702
|
),
|
|
3703
3703
|
children: [
|
|
3704
3704
|
/* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
3705
3705
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2 text-neutral-900 dark:text-neutral-100", children: [
|
|
3706
|
-
|
|
3706
|
+
b && /* @__PURE__ */ e(
|
|
3707
3707
|
"button",
|
|
3708
3708
|
{
|
|
3709
3709
|
type: "button",
|
|
3710
|
-
onClick:
|
|
3711
|
-
className:
|
|
3710
|
+
onClick: b,
|
|
3711
|
+
className: g(
|
|
3712
3712
|
"flex items-center text-sm dark:hover:text-neutral-300 cursor-pointer transition",
|
|
3713
3713
|
h
|
|
3714
3714
|
),
|
|
3715
3715
|
children: /* @__PURE__ */ e(Ee, { size: 16, color: "currentColor" })
|
|
3716
3716
|
}
|
|
3717
3717
|
),
|
|
3718
|
-
|
|
3718
|
+
u ? /* @__PURE__ */ e(
|
|
3719
3719
|
"input",
|
|
3720
3720
|
{
|
|
3721
|
-
ref:
|
|
3721
|
+
ref: C,
|
|
3722
3722
|
type: "text",
|
|
3723
3723
|
value: d,
|
|
3724
|
-
onChange: (
|
|
3725
|
-
onBlur:
|
|
3724
|
+
onChange: (p) => f(p.target.value),
|
|
3725
|
+
onBlur: k,
|
|
3726
3726
|
onKeyDown: B,
|
|
3727
3727
|
className: "text-1xl font-semibold bg-transparent border-b-1 border-gray-200 dark:border-gray-700 rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 flex-1"
|
|
3728
3728
|
}
|
|
3729
3729
|
) : /* @__PURE__ */ e(
|
|
3730
3730
|
"h2",
|
|
3731
3731
|
{
|
|
3732
|
-
onClick:
|
|
3733
|
-
className:
|
|
3732
|
+
onClick: N,
|
|
3733
|
+
className: g(
|
|
3734
3734
|
"text-2xl font-semibold truncate",
|
|
3735
|
-
|
|
3735
|
+
x && "cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
|
|
3736
3736
|
),
|
|
3737
|
-
title:
|
|
3737
|
+
title: x ? "Klik om te bewerken" : void 0,
|
|
3738
3738
|
children: r
|
|
3739
3739
|
}
|
|
3740
3740
|
)
|
|
3741
3741
|
] }) }),
|
|
3742
3742
|
t.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: t.map(
|
|
3743
|
-
(
|
|
3743
|
+
(p) => p.splitOptions && p.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
3744
3744
|
Ye,
|
|
3745
3745
|
{
|
|
3746
|
-
label:
|
|
3747
|
-
onClick:
|
|
3748
|
-
icon:
|
|
3749
|
-
variant:
|
|
3750
|
-
options:
|
|
3751
|
-
disabled:
|
|
3746
|
+
label: p.label,
|
|
3747
|
+
onClick: p.onClick,
|
|
3748
|
+
icon: p.icon,
|
|
3749
|
+
variant: p.variant === "primary" ? "primary" : "secondary",
|
|
3750
|
+
options: p.splitOptions,
|
|
3751
|
+
disabled: p.disabled
|
|
3752
3752
|
},
|
|
3753
|
-
|
|
3753
|
+
p.id
|
|
3754
3754
|
) : /* @__PURE__ */ c(
|
|
3755
3755
|
"button",
|
|
3756
3756
|
{
|
|
3757
3757
|
type: "button",
|
|
3758
|
-
onClick: (
|
|
3759
|
-
|
|
3758
|
+
onClick: (q) => {
|
|
3759
|
+
q.stopPropagation(), q.target.blur(), p.onClick();
|
|
3760
3760
|
},
|
|
3761
|
-
disabled:
|
|
3762
|
-
className:
|
|
3763
|
-
o__primary:
|
|
3764
|
-
o__secondary:
|
|
3765
|
-
o__ghost:
|
|
3766
|
-
o__destructive:
|
|
3761
|
+
disabled: p.disabled,
|
|
3762
|
+
className: g("btn", {
|
|
3763
|
+
o__primary: p.variant === "primary",
|
|
3764
|
+
o__secondary: p.variant === "secondary" || p.variant === "outline",
|
|
3765
|
+
o__ghost: p.variant === "ghost",
|
|
3766
|
+
o__destructive: p.variant === "destructive"
|
|
3767
3767
|
}),
|
|
3768
3768
|
children: [
|
|
3769
|
-
|
|
3770
|
-
|
|
3769
|
+
p.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: p.icon }),
|
|
3770
|
+
p.label
|
|
3771
3771
|
]
|
|
3772
3772
|
},
|
|
3773
|
-
|
|
3773
|
+
p.id
|
|
3774
3774
|
)
|
|
3775
3775
|
) })
|
|
3776
3776
|
] }),
|
|
@@ -3791,27 +3791,27 @@ const st = ({
|
|
|
3791
3791
|
size: t = "md",
|
|
3792
3792
|
className: a
|
|
3793
3793
|
}) => {
|
|
3794
|
-
const o = (
|
|
3795
|
-
if (!
|
|
3794
|
+
const o = (u) => {
|
|
3795
|
+
if (!u) return "-";
|
|
3796
3796
|
try {
|
|
3797
|
-
return new Date(
|
|
3797
|
+
return new Date(u).toLocaleDateString("nl-NL", {
|
|
3798
3798
|
year: "numeric",
|
|
3799
3799
|
month: "long",
|
|
3800
3800
|
day: "numeric"
|
|
3801
3801
|
});
|
|
3802
3802
|
} catch {
|
|
3803
|
-
return String(
|
|
3803
|
+
return String(u);
|
|
3804
3804
|
}
|
|
3805
|
-
}, i = (
|
|
3806
|
-
if (!l) return String(
|
|
3807
|
-
const d = l.find((
|
|
3808
|
-
return d ? d.label : String(
|
|
3809
|
-
},
|
|
3810
|
-
(
|
|
3811
|
-
const l = Ir(n,
|
|
3812
|
-
if (
|
|
3813
|
-
const
|
|
3814
|
-
return !
|
|
3805
|
+
}, i = (u) => u ? "Ja" : "Nee", h = (u, l) => {
|
|
3806
|
+
if (!l) return String(u || "-");
|
|
3807
|
+
const d = l.find((f) => f.value === u);
|
|
3808
|
+
return d ? d.label : String(u || "-");
|
|
3809
|
+
}, b = ae(
|
|
3810
|
+
(u) => {
|
|
3811
|
+
const l = Ir(n, u.name);
|
|
3812
|
+
if (u.type === "array") {
|
|
3813
|
+
const f = l;
|
|
3814
|
+
return !f || f.length === 0 ? /* @__PURE__ */ e(
|
|
3815
3815
|
Z,
|
|
3816
3816
|
{
|
|
3817
3817
|
variant: "body",
|
|
@@ -3819,7 +3819,7 @@ const st = ({
|
|
|
3819
3819
|
className: "text-neutral-500 dark:text-neutral-400",
|
|
3820
3820
|
children: "Geen items"
|
|
3821
3821
|
}
|
|
3822
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
3822
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: f.map((C, N) => /* @__PURE__ */ c(
|
|
3823
3823
|
"div",
|
|
3824
3824
|
{
|
|
3825
3825
|
className: "p-4 border border-neutral-200 dark:border-neutral-700 rounded-lg space-y-3",
|
|
@@ -3832,53 +3832,53 @@ const st = ({
|
|
|
3832
3832
|
weight: "medium",
|
|
3833
3833
|
className: "text-neutral-700 dark:text-neutral-300",
|
|
3834
3834
|
children: [
|
|
3835
|
-
|
|
3835
|
+
u.label,
|
|
3836
3836
|
" ",
|
|
3837
|
-
|
|
3837
|
+
N + 1
|
|
3838
3838
|
]
|
|
3839
3839
|
}
|
|
3840
3840
|
) }),
|
|
3841
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children:
|
|
3842
|
-
const B =
|
|
3843
|
-
let
|
|
3844
|
-
switch (
|
|
3841
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: u.arrayFields?.map((k) => {
|
|
3842
|
+
const B = C?.[k.name];
|
|
3843
|
+
let p = "-";
|
|
3844
|
+
switch (k.type) {
|
|
3845
3845
|
case "text":
|
|
3846
3846
|
case "email":
|
|
3847
3847
|
case "number":
|
|
3848
3848
|
case "tel":
|
|
3849
3849
|
case "url":
|
|
3850
3850
|
case "textarea":
|
|
3851
|
-
|
|
3851
|
+
p = B || "-";
|
|
3852
3852
|
break;
|
|
3853
3853
|
case "select":
|
|
3854
3854
|
case "radio":
|
|
3855
|
-
|
|
3855
|
+
p = h(
|
|
3856
3856
|
B,
|
|
3857
|
-
|
|
3857
|
+
k.options
|
|
3858
3858
|
);
|
|
3859
3859
|
break;
|
|
3860
3860
|
case "checkbox":
|
|
3861
|
-
|
|
3861
|
+
p = i(B);
|
|
3862
3862
|
break;
|
|
3863
3863
|
case "date":
|
|
3864
|
-
|
|
3864
|
+
p = o(B);
|
|
3865
3865
|
break;
|
|
3866
3866
|
case "custom":
|
|
3867
|
-
|
|
3867
|
+
p = k.customComponent?.({
|
|
3868
3868
|
value: B
|
|
3869
3869
|
});
|
|
3870
3870
|
break;
|
|
3871
3871
|
default:
|
|
3872
|
-
|
|
3872
|
+
p = String(B || "-");
|
|
3873
3873
|
}
|
|
3874
|
-
return
|
|
3874
|
+
return k.format && (p = k.format(B, C)), /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
3875
3875
|
/* @__PURE__ */ e(
|
|
3876
3876
|
Z,
|
|
3877
3877
|
{
|
|
3878
3878
|
variant: "label",
|
|
3879
3879
|
size: "xs",
|
|
3880
3880
|
className: "text-neutral-600 dark:text-neutral-400",
|
|
3881
|
-
children:
|
|
3881
|
+
children: k.label
|
|
3882
3882
|
}
|
|
3883
3883
|
),
|
|
3884
3884
|
/* @__PURE__ */ e(
|
|
@@ -3887,32 +3887,32 @@ const st = ({
|
|
|
3887
3887
|
variant: "body",
|
|
3888
3888
|
size: "sm",
|
|
3889
3889
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
3890
|
-
children:
|
|
3890
|
+
children: p
|
|
3891
3891
|
}
|
|
3892
3892
|
)
|
|
3893
|
-
] },
|
|
3893
|
+
] }, k.name);
|
|
3894
3894
|
}) })
|
|
3895
3895
|
]
|
|
3896
3896
|
},
|
|
3897
|
-
|
|
3897
|
+
N
|
|
3898
3898
|
)) });
|
|
3899
3899
|
}
|
|
3900
|
-
if (
|
|
3901
|
-
return
|
|
3902
|
-
if (
|
|
3903
|
-
const
|
|
3900
|
+
if (u.type === "custom" && u.customComponent)
|
|
3901
|
+
return u.customComponent({ value: l });
|
|
3902
|
+
if (u.format) {
|
|
3903
|
+
const f = u.format(l, n);
|
|
3904
3904
|
return /* @__PURE__ */ e(
|
|
3905
3905
|
Z,
|
|
3906
3906
|
{
|
|
3907
3907
|
variant: "body",
|
|
3908
3908
|
size: "sm",
|
|
3909
3909
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
3910
|
-
children:
|
|
3910
|
+
children: f
|
|
3911
3911
|
}
|
|
3912
3912
|
);
|
|
3913
3913
|
}
|
|
3914
3914
|
let d = "-";
|
|
3915
|
-
switch (
|
|
3915
|
+
switch (u.type) {
|
|
3916
3916
|
case "text":
|
|
3917
3917
|
case "email":
|
|
3918
3918
|
case "password":
|
|
@@ -3926,7 +3926,7 @@ const st = ({
|
|
|
3926
3926
|
break;
|
|
3927
3927
|
case "select":
|
|
3928
3928
|
case "radio":
|
|
3929
|
-
d = h(l,
|
|
3929
|
+
d = h(l, u.options);
|
|
3930
3930
|
break;
|
|
3931
3931
|
case "checkbox":
|
|
3932
3932
|
d = i(l);
|
|
@@ -3948,25 +3948,25 @@ const st = ({
|
|
|
3948
3948
|
);
|
|
3949
3949
|
},
|
|
3950
3950
|
[n]
|
|
3951
|
-
),
|
|
3952
|
-
(
|
|
3953
|
-
if (
|
|
3951
|
+
), x = ae(
|
|
3952
|
+
(u) => {
|
|
3953
|
+
if (u.conditional && !u.conditional(n))
|
|
3954
3954
|
return null;
|
|
3955
|
-
const l =
|
|
3955
|
+
const l = u.items.filter((f) => !(f.hidden || f.conditional && !f.conditional(n)));
|
|
3956
3956
|
if (l.length === 0) return null;
|
|
3957
|
-
const d =
|
|
3957
|
+
const d = g(
|
|
3958
3958
|
"space-y-4",
|
|
3959
3959
|
{
|
|
3960
|
-
"grid gap-4":
|
|
3961
|
-
"flex flex-wrap gap-4":
|
|
3960
|
+
"grid gap-4": u.layout === "grid",
|
|
3961
|
+
"flex flex-wrap gap-4": u.layout === "flex"
|
|
3962
3962
|
},
|
|
3963
|
-
|
|
3964
|
-
"grid-cols-1": !
|
|
3965
|
-
"grid-cols-2":
|
|
3966
|
-
"grid-cols-3":
|
|
3967
|
-
"grid-cols-4":
|
|
3963
|
+
u.layout === "grid" && {
|
|
3964
|
+
"grid-cols-1": !u.columns || u.columns === 1,
|
|
3965
|
+
"grid-cols-2": u.columns === 2,
|
|
3966
|
+
"grid-cols-3": u.columns === 3,
|
|
3967
|
+
"grid-cols-4": u.columns === 4
|
|
3968
3968
|
},
|
|
3969
|
-
|
|
3969
|
+
u.className
|
|
3970
3970
|
);
|
|
3971
3971
|
return /* @__PURE__ */ c(
|
|
3972
3972
|
"div",
|
|
@@ -3981,49 +3981,49 @@ const st = ({
|
|
|
3981
3981
|
size: "lg",
|
|
3982
3982
|
weight: "semibold",
|
|
3983
3983
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
3984
|
-
children:
|
|
3984
|
+
children: u.title
|
|
3985
3985
|
}
|
|
3986
3986
|
),
|
|
3987
|
-
|
|
3987
|
+
u.description && /* @__PURE__ */ e(
|
|
3988
3988
|
Z,
|
|
3989
3989
|
{
|
|
3990
3990
|
variant: "body",
|
|
3991
3991
|
size: "sm",
|
|
3992
3992
|
className: "text-neutral-600 dark:text-neutral-400 mt-1",
|
|
3993
|
-
children:
|
|
3993
|
+
children: u.description
|
|
3994
3994
|
}
|
|
3995
3995
|
)
|
|
3996
3996
|
] }),
|
|
3997
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: d, children: l.map((
|
|
3997
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: d, children: l.map((f) => /* @__PURE__ */ c(
|
|
3998
3998
|
"div",
|
|
3999
3999
|
{
|
|
4000
|
-
className:
|
|
4000
|
+
className: g(
|
|
4001
4001
|
"space-y-1",
|
|
4002
|
-
|
|
4003
|
-
|
|
4002
|
+
f.width && typeof f.width == "string" && `w-[${f.width}]`,
|
|
4003
|
+
f.width && typeof f.width == "number" && `col-span-${f.width}`
|
|
4004
4004
|
),
|
|
4005
4005
|
children: [
|
|
4006
|
-
|
|
4006
|
+
f.type !== "custom" && /* @__PURE__ */ e(
|
|
4007
4007
|
Z,
|
|
4008
4008
|
{
|
|
4009
4009
|
variant: "label",
|
|
4010
4010
|
size: "sm",
|
|
4011
4011
|
className: "font-medium text-neutral-700 dark:text-neutral-300",
|
|
4012
|
-
children:
|
|
4012
|
+
children: f.label
|
|
4013
4013
|
}
|
|
4014
4014
|
),
|
|
4015
|
-
|
|
4015
|
+
b(f)
|
|
4016
4016
|
]
|
|
4017
4017
|
},
|
|
4018
|
-
|
|
4018
|
+
f.name
|
|
4019
4019
|
)) }) })
|
|
4020
4020
|
]
|
|
4021
4021
|
},
|
|
4022
|
-
|
|
4022
|
+
u.id
|
|
4023
4023
|
);
|
|
4024
4024
|
},
|
|
4025
|
-
[n,
|
|
4026
|
-
),
|
|
4025
|
+
[n, b]
|
|
4026
|
+
), y = g(
|
|
4027
4027
|
"space-y-6",
|
|
4028
4028
|
{
|
|
4029
4029
|
"max-w-md": t === "sm",
|
|
@@ -4033,21 +4033,21 @@ const st = ({
|
|
|
4033
4033
|
},
|
|
4034
4034
|
a
|
|
4035
4035
|
);
|
|
4036
|
-
return /* @__PURE__ */ e("div", { className:
|
|
4036
|
+
return /* @__PURE__ */ e("div", { className: y, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(x) }) });
|
|
4037
4037
|
}, ze = ({ item: r, isSelectedHandler: n, onClick: t }) => {
|
|
4038
|
-
const [a, o] =
|
|
4038
|
+
const [a, o] = _(!1), i = r.children && r.children.length > 0, h = () => {
|
|
4039
4039
|
i && o(!a);
|
|
4040
|
-
},
|
|
4040
|
+
}, b = n ? n(r.path) : !1;
|
|
4041
4041
|
return /* @__PURE__ */ c("li", { children: [
|
|
4042
4042
|
/* @__PURE__ */ c(
|
|
4043
4043
|
"div",
|
|
4044
4044
|
{
|
|
4045
|
-
className:
|
|
4045
|
+
className: g(
|
|
4046
4046
|
"flex flex-row w-full py-1 rounded-lg items-center h-8 transition-colors cursor-pointer px-3 pr-1 no-underline text-sm",
|
|
4047
4047
|
{
|
|
4048
|
-
"active-nav-item":
|
|
4049
|
-
"shadow-lvl-0":
|
|
4050
|
-
"font-semibold":
|
|
4048
|
+
"active-nav-item": b && !i,
|
|
4049
|
+
"shadow-lvl-0": b && !i,
|
|
4050
|
+
"font-semibold": b || i || r.children !== void 0
|
|
4051
4051
|
}
|
|
4052
4052
|
),
|
|
4053
4053
|
onClick: () => {
|
|
@@ -4061,14 +4061,14 @@ const st = ({
|
|
|
4061
4061
|
]
|
|
4062
4062
|
}
|
|
4063
4063
|
),
|
|
4064
|
-
i && !a && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: r.children?.map((
|
|
4064
|
+
i && !a && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: r.children?.map((x, y) => /* @__PURE__ */ e(
|
|
4065
4065
|
ze,
|
|
4066
4066
|
{
|
|
4067
|
-
item:
|
|
4067
|
+
item: x,
|
|
4068
4068
|
isSelectedHandler: n,
|
|
4069
4069
|
onClick: t
|
|
4070
4070
|
},
|
|
4071
|
-
|
|
4071
|
+
y
|
|
4072
4072
|
)) })
|
|
4073
4073
|
] });
|
|
4074
4074
|
}, ot = ({
|
|
@@ -4081,18 +4081,18 @@ const st = ({
|
|
|
4081
4081
|
}) => /* @__PURE__ */ c("div", { className: "flex flex-col h-screen mb-6", children: [
|
|
4082
4082
|
/* @__PURE__ */ c("div", { className: "sidebar-menu-header", children: [
|
|
4083
4083
|
/* @__PURE__ */ e("span", { className: "text-xl font-semibold text-gray-800 mb-2", children: r }),
|
|
4084
|
-
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: n?.map((h,
|
|
4084
|
+
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: n?.map((h, b) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: h }, b)) })
|
|
4085
4085
|
] }),
|
|
4086
4086
|
i && /* @__PURE__ */ e("div", { className: "sidebar-menu-pre-items mb-4", children: i }),
|
|
4087
4087
|
/* @__PURE__ */ e("ul", { children: t.map(
|
|
4088
|
-
(h,
|
|
4088
|
+
(h, b) => !h.path && !h.label && !h.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, b) : /* @__PURE__ */ e(
|
|
4089
4089
|
ze,
|
|
4090
4090
|
{
|
|
4091
4091
|
item: h,
|
|
4092
4092
|
isSelectedHandler: a,
|
|
4093
4093
|
onClick: o
|
|
4094
4094
|
},
|
|
4095
|
-
|
|
4095
|
+
b
|
|
4096
4096
|
)
|
|
4097
4097
|
) })
|
|
4098
4098
|
] }), ct = ({
|
|
@@ -4103,21 +4103,21 @@ const st = ({
|
|
|
4103
4103
|
align: o = "left",
|
|
4104
4104
|
truncate: i = !1,
|
|
4105
4105
|
className: h,
|
|
4106
|
-
children:
|
|
4107
|
-
...
|
|
4106
|
+
children: b,
|
|
4107
|
+
...x
|
|
4108
4108
|
}) => {
|
|
4109
|
-
const
|
|
4109
|
+
const y = n || jr(r), u = g(
|
|
4110
4110
|
"font-primary",
|
|
4111
4111
|
// Size variants
|
|
4112
4112
|
{
|
|
4113
|
-
"text-xs":
|
|
4114
|
-
"text-sm":
|
|
4115
|
-
"text-base":
|
|
4116
|
-
"text-lg":
|
|
4117
|
-
"text-xl":
|
|
4118
|
-
"text-2xl":
|
|
4119
|
-
"text-3xl":
|
|
4120
|
-
"text-4xl":
|
|
4113
|
+
"text-xs": y === "xs",
|
|
4114
|
+
"text-sm": y === "sm",
|
|
4115
|
+
"text-base": y === "md",
|
|
4116
|
+
"text-lg": y === "lg",
|
|
4117
|
+
"text-xl": y === "xl",
|
|
4118
|
+
"text-2xl": y === "2xl",
|
|
4119
|
+
"text-3xl": y === "3xl",
|
|
4120
|
+
"text-4xl": y === "4xl"
|
|
4121
4121
|
},
|
|
4122
4122
|
// Weight variants
|
|
4123
4123
|
{
|
|
@@ -4151,7 +4151,7 @@ const st = ({
|
|
|
4151
4151
|
},
|
|
4152
4152
|
h
|
|
4153
4153
|
), l = `h${r}`;
|
|
4154
|
-
return /* @__PURE__ */ e(l, { className:
|
|
4154
|
+
return /* @__PURE__ */ e(l, { className: u, ...x, children: b });
|
|
4155
4155
|
};
|
|
4156
4156
|
function jr(r) {
|
|
4157
4157
|
return {
|
|
@@ -4172,7 +4172,7 @@ const dt = ({
|
|
|
4172
4172
|
className: i,
|
|
4173
4173
|
itemClassName: h
|
|
4174
4174
|
}) => {
|
|
4175
|
-
const
|
|
4175
|
+
const b = g(
|
|
4176
4176
|
// Base styles
|
|
4177
4177
|
"space-y-1",
|
|
4178
4178
|
// Variant styles
|
|
@@ -4193,7 +4193,7 @@ const dt = ({
|
|
|
4193
4193
|
"text-lg": a === "lg"
|
|
4194
4194
|
},
|
|
4195
4195
|
i
|
|
4196
|
-
),
|
|
4196
|
+
), x = (l, d) => g(
|
|
4197
4197
|
// Base item styles
|
|
4198
4198
|
"transition-colors duration-200",
|
|
4199
4199
|
// Size-based padding
|
|
@@ -4212,39 +4212,39 @@ const dt = ({
|
|
|
4212
4212
|
"opacity-50 cursor-not-allowed": !0
|
|
4213
4213
|
},
|
|
4214
4214
|
h
|
|
4215
|
-
),
|
|
4215
|
+
), y = (l) => {
|
|
4216
4216
|
o && !l.disabled && l.onClick && l.onClick();
|
|
4217
|
-
},
|
|
4217
|
+
}, u = (l, d) => {
|
|
4218
4218
|
o && !d.disabled && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), d.onClick?.());
|
|
4219
4219
|
};
|
|
4220
|
-
return n === "ordered" ? /* @__PURE__ */ e("ol", { className:
|
|
4220
|
+
return n === "ordered" ? /* @__PURE__ */ e("ol", { className: b, children: r.map((l, d) => /* @__PURE__ */ e(
|
|
4221
4221
|
"li",
|
|
4222
4222
|
{
|
|
4223
|
-
className:
|
|
4224
|
-
onClick: () =>
|
|
4225
|
-
onKeyDown: (
|
|
4223
|
+
className: x(l),
|
|
4224
|
+
onClick: () => y(l),
|
|
4225
|
+
onKeyDown: (f) => u(f, l),
|
|
4226
4226
|
tabIndex: o && !l.disabled ? 0 : void 0,
|
|
4227
4227
|
role: o ? "button" : void 0,
|
|
4228
4228
|
children: l.content
|
|
4229
4229
|
},
|
|
4230
4230
|
l.id || d
|
|
4231
|
-
)) }) : n === "description" ? /* @__PURE__ */ e("dl", { className:
|
|
4231
|
+
)) }) : n === "description" ? /* @__PURE__ */ e("dl", { className: b, children: r.map((l, d) => /* @__PURE__ */ e(
|
|
4232
4232
|
"div",
|
|
4233
4233
|
{
|
|
4234
|
-
className:
|
|
4235
|
-
onClick: () =>
|
|
4236
|
-
onKeyDown: (
|
|
4234
|
+
className: x(l),
|
|
4235
|
+
onClick: () => y(l),
|
|
4236
|
+
onKeyDown: (f) => u(f, l),
|
|
4237
4237
|
tabIndex: o && !l.disabled ? 0 : void 0,
|
|
4238
4238
|
role: o ? "button" : void 0,
|
|
4239
4239
|
children: l.content
|
|
4240
4240
|
},
|
|
4241
4241
|
l.id || d
|
|
4242
|
-
)) }) : /* @__PURE__ */ e("ul", { className:
|
|
4242
|
+
)) }) : /* @__PURE__ */ e("ul", { className: b, children: r.map((l, d) => /* @__PURE__ */ e(
|
|
4243
4243
|
"li",
|
|
4244
4244
|
{
|
|
4245
|
-
className:
|
|
4246
|
-
onClick: () =>
|
|
4247
|
-
onKeyDown: (
|
|
4245
|
+
className: x(l),
|
|
4246
|
+
onClick: () => y(l),
|
|
4247
|
+
onKeyDown: (f) => u(f, l),
|
|
4248
4248
|
tabIndex: o && !l.disabled ? 0 : void 0,
|
|
4249
4249
|
role: o ? "button" : void 0,
|
|
4250
4250
|
children: l.content
|
|
@@ -4259,40 +4259,42 @@ const dt = ({
|
|
|
4259
4259
|
initialCommandPath: o,
|
|
4260
4260
|
initialActiveIndex: i
|
|
4261
4261
|
}) => {
|
|
4262
|
-
const [h,
|
|
4263
|
-
(
|
|
4262
|
+
const [h, b] = _(""), [x, y] = _(o || []), [u, l] = _(i || 0), d = X(null), f = X(null), N = (x.length ? r.find((k) => k.id === x[0])?.subCommands || [] : r).filter(
|
|
4263
|
+
(k) => k.label.toLowerCase().includes(h.toLowerCase())
|
|
4264
4264
|
);
|
|
4265
|
-
return
|
|
4266
|
-
n || (
|
|
4267
|
-
}, [n]),
|
|
4268
|
-
const
|
|
4265
|
+
return G(() => {
|
|
4266
|
+
n || (b(""), y(o || []), l(i || 0));
|
|
4267
|
+
}, [n]), G(() => {
|
|
4268
|
+
const k = (B) => {
|
|
4269
4269
|
if (n) {
|
|
4270
|
-
if (
|
|
4270
|
+
if (B.key === "Escape")
|
|
4271
4271
|
t();
|
|
4272
|
-
else if (
|
|
4272
|
+
else if (B.key === "ArrowUp")
|
|
4273
4273
|
l(
|
|
4274
|
-
(
|
|
4274
|
+
(p) => p > 0 ? p - 1 : N.length - 1
|
|
4275
4275
|
);
|
|
4276
|
-
else if (
|
|
4276
|
+
else if (B.key === "ArrowDown")
|
|
4277
4277
|
l(
|
|
4278
|
-
(
|
|
4278
|
+
(p) => p < N.length - 1 ? p + 1 : 0
|
|
4279
4279
|
);
|
|
4280
|
-
else if (
|
|
4281
|
-
const
|
|
4282
|
-
|
|
4280
|
+
else if (B.key === "Enter") {
|
|
4281
|
+
const p = N[u];
|
|
4282
|
+
p && (p.subCommands ? (y([...x, p.id]), l(0)) : p.action && (p.action(), t()));
|
|
4283
4283
|
}
|
|
4284
4284
|
}
|
|
4285
4285
|
};
|
|
4286
|
-
return document.addEventListener("keydown",
|
|
4287
|
-
}, [n, t, N,
|
|
4288
|
-
const
|
|
4289
|
-
d.current && !d.current.contains(
|
|
4286
|
+
return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
|
|
4287
|
+
}, [n, t, N, u, x]), G(() => {
|
|
4288
|
+
const k = (B) => {
|
|
4289
|
+
d.current && !d.current.contains(B.target) && t();
|
|
4290
4290
|
};
|
|
4291
|
-
return n && document.addEventListener("mousedown",
|
|
4292
|
-
}, [n, t]), n ?
|
|
4291
|
+
return n && document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
4292
|
+
}, [n, t]), n ? (G(() => {
|
|
4293
|
+
f.current?.querySelector(`[data-index="${u}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4294
|
+
}, [u]), /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 flex items-center justify-center shadow-lvl-0", children: /* @__PURE__ */ c(
|
|
4293
4295
|
"div",
|
|
4294
4296
|
{
|
|
4295
|
-
className: "flex flex-col w-full max-w-lg p-2 mx-auto rounded-lg shadow-lg bg-white",
|
|
4297
|
+
className: "flex flex-col w-full max-w-lg max-h-[80vh] p-2 mx-auto rounded-lg shadow-lg bg-white",
|
|
4296
4298
|
ref: d,
|
|
4297
4299
|
children: [
|
|
4298
4300
|
/* @__PURE__ */ e(
|
|
@@ -4301,29 +4303,37 @@ const dt = ({
|
|
|
4301
4303
|
type: "text",
|
|
4302
4304
|
placeholder: a?.searchPlaceholder || "Search commands...",
|
|
4303
4305
|
value: h,
|
|
4304
|
-
onChange: (
|
|
4305
|
-
className: "w-full px-4 py-2 text-gray-800 border-none border-b border-gray-200 focus:outline-none focus:ring-0 rounded-lg bg-transparent"
|
|
4306
|
+
onChange: (k) => b(k.target.value),
|
|
4307
|
+
className: "w-full px-4 py-2 text-gray-800 border-none border-b border-gray-200 focus:outline-none focus:ring-0 rounded-lg bg-transparent flex-shrink-0"
|
|
4308
|
+
}
|
|
4309
|
+
),
|
|
4310
|
+
/* @__PURE__ */ c(
|
|
4311
|
+
"div",
|
|
4312
|
+
{
|
|
4313
|
+
ref: f,
|
|
4314
|
+
className: "mt-2 pt-2 text-sm border-t border-gray-200 max-h-[50vh] overflow-y-auto",
|
|
4315
|
+
children: [
|
|
4316
|
+
N.length === 0 && /* @__PURE__ */ e("div", { className: "text-gray-500 text-center text-sm", children: a?.noCommandsFound || "No commands found" }),
|
|
4317
|
+
N.map((k, B) => /* @__PURE__ */ c(
|
|
4318
|
+
"div",
|
|
4319
|
+
{
|
|
4320
|
+
"data-index": B,
|
|
4321
|
+
className: `flex items-center p-2 cursor-pointer rounded-md text-secondary-800 ${B === u ? "bg-gray-100" : ""}`,
|
|
4322
|
+
onClick: () => {
|
|
4323
|
+
k.subCommands ? (y([...x, k.id]), l(0)) : k.action && (k.action(), t());
|
|
4324
|
+
},
|
|
4325
|
+
onMouseEnter: () => l(B),
|
|
4326
|
+
children: [
|
|
4327
|
+
k.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: k.icon }),
|
|
4328
|
+
/* @__PURE__ */ e("span", { className: "flex-grow", children: k.label }),
|
|
4329
|
+
k.subCommands && /* @__PURE__ */ e("span", { className: "text-gray-400", children: /* @__PURE__ */ e(Re, { className: "w-4 h-4" }) })
|
|
4330
|
+
]
|
|
4331
|
+
},
|
|
4332
|
+
k.id
|
|
4333
|
+
))
|
|
4334
|
+
]
|
|
4306
4335
|
}
|
|
4307
4336
|
),
|
|
4308
|
-
/* @__PURE__ */ c("div", { className: "mt-2 pt-2 text-sm border-t border-gray-200", children: [
|
|
4309
|
-
N.length === 0 && /* @__PURE__ */ e("div", { className: "text-gray-500 text-center text-sm", children: a?.noCommandsFound || "No commands found" }),
|
|
4310
|
-
N.map((v, S) => /* @__PURE__ */ c(
|
|
4311
|
-
"div",
|
|
4312
|
-
{
|
|
4313
|
-
className: `flex items-center p-2 cursor-pointer rounded-md text-secondary-800 ${S === m ? "bg-gray-100" : ""}`,
|
|
4314
|
-
onClick: () => {
|
|
4315
|
-
v.subCommands ? (b([...f, v.id]), l(0)) : v.action && (v.action(), t());
|
|
4316
|
-
},
|
|
4317
|
-
onMouseEnter: () => l(S),
|
|
4318
|
-
children: [
|
|
4319
|
-
v.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: v.icon }),
|
|
4320
|
-
/* @__PURE__ */ e("span", { className: "flex-grow", children: v.label }),
|
|
4321
|
-
v.subCommands && /* @__PURE__ */ e("span", { className: "text-gray-400", children: /* @__PURE__ */ e(Re, { className: "w-4 h-4" }) })
|
|
4322
|
-
]
|
|
4323
|
-
},
|
|
4324
|
-
v.id
|
|
4325
|
-
))
|
|
4326
|
-
] }),
|
|
4327
4337
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-2 mt-2 text-xs text-gray-500 border-t border-gray-200", children: [
|
|
4328
4338
|
/* @__PURE__ */ c("span", { children: [
|
|
4329
4339
|
/* @__PURE__ */ e("span", { className: "font-bold", children: "↑↓" }),
|
|
@@ -4343,7 +4353,7 @@ const dt = ({
|
|
|
4343
4353
|
] })
|
|
4344
4354
|
]
|
|
4345
4355
|
}
|
|
4346
|
-
) }) : null;
|
|
4356
|
+
) })) : null;
|
|
4347
4357
|
}, Br = {
|
|
4348
4358
|
none: "p-0",
|
|
4349
4359
|
xs: "p-1",
|
|
@@ -4372,14 +4382,14 @@ const dt = ({
|
|
|
4372
4382
|
neutral: "bg-neutral",
|
|
4373
4383
|
white: "bg-white",
|
|
4374
4384
|
module: "bg-module"
|
|
4375
|
-
},
|
|
4385
|
+
}, Vr = {
|
|
4376
4386
|
none: "rounded-none",
|
|
4377
4387
|
sm: "rounded-sm",
|
|
4378
4388
|
md: "rounded-md",
|
|
4379
4389
|
lg: "rounded-lg",
|
|
4380
4390
|
xl: "rounded-xl",
|
|
4381
4391
|
full: "rounded-full"
|
|
4382
|
-
},
|
|
4392
|
+
}, _r = {
|
|
4383
4393
|
none: "shadow-none",
|
|
4384
4394
|
sm: "shadow-sm shadow-lvl-0",
|
|
4385
4395
|
md: "shadow-md shadow-lvl-0",
|
|
@@ -4410,25 +4420,25 @@ const dt = ({
|
|
|
4410
4420
|
shadow: o,
|
|
4411
4421
|
border: i,
|
|
4412
4422
|
borderColor: h,
|
|
4413
|
-
className:
|
|
4414
|
-
children:
|
|
4415
|
-
...
|
|
4416
|
-
},
|
|
4423
|
+
className: b,
|
|
4424
|
+
children: x,
|
|
4425
|
+
...y
|
|
4426
|
+
}, u) => /* @__PURE__ */ e(
|
|
4417
4427
|
"div",
|
|
4418
4428
|
{
|
|
4419
|
-
ref:
|
|
4420
|
-
className:
|
|
4429
|
+
ref: u,
|
|
4430
|
+
className: g(
|
|
4421
4431
|
r && Br[r],
|
|
4422
4432
|
n && Pr[n],
|
|
4423
4433
|
t && Or[t],
|
|
4424
|
-
a &&
|
|
4425
|
-
o &&
|
|
4434
|
+
a && Vr[a],
|
|
4435
|
+
o && _r[o],
|
|
4426
4436
|
i && Fr[i],
|
|
4427
4437
|
h && Wr[h],
|
|
4428
|
-
|
|
4438
|
+
b
|
|
4429
4439
|
),
|
|
4430
|
-
...
|
|
4431
|
-
children:
|
|
4440
|
+
...y,
|
|
4441
|
+
children: x
|
|
4432
4442
|
}
|
|
4433
4443
|
)
|
|
4434
4444
|
);
|
|
@@ -4445,47 +4455,47 @@ function mt({
|
|
|
4445
4455
|
componentProps: o,
|
|
4446
4456
|
className: i
|
|
4447
4457
|
}) {
|
|
4448
|
-
const h = X(null), [
|
|
4449
|
-
return X(null),
|
|
4458
|
+
const h = X(null), [b, x] = _(!0), [y, u] = _(null), l = X(null);
|
|
4459
|
+
return X(null), G(() => {
|
|
4450
4460
|
let d = !0;
|
|
4451
4461
|
return (async () => {
|
|
4452
|
-
|
|
4462
|
+
x(!0);
|
|
4453
4463
|
try {
|
|
4454
|
-
const
|
|
4464
|
+
const C = await n();
|
|
4455
4465
|
if (!d) return;
|
|
4456
|
-
const
|
|
4457
|
-
|
|
4458
|
-
} catch (
|
|
4459
|
-
console.error(`[FederatedResource] Load failed: ${r}`,
|
|
4466
|
+
const N = C.component || C.default || C;
|
|
4467
|
+
u(t === "react" ? () => N : () => C);
|
|
4468
|
+
} catch (C) {
|
|
4469
|
+
console.error(`[FederatedResource] Load failed: ${r}`, C);
|
|
4460
4470
|
} finally {
|
|
4461
|
-
d &&
|
|
4471
|
+
d && x(!1);
|
|
4462
4472
|
}
|
|
4463
4473
|
})(), () => {
|
|
4464
4474
|
d = !1;
|
|
4465
4475
|
};
|
|
4466
|
-
}, [r, n]),
|
|
4467
|
-
if (
|
|
4476
|
+
}, [r, n]), G(() => {
|
|
4477
|
+
if (b || !y || t === "react") return;
|
|
4468
4478
|
const d = h.current;
|
|
4469
4479
|
if (d) {
|
|
4470
4480
|
if (t === "svelte") {
|
|
4471
|
-
const
|
|
4472
|
-
return l.current =
|
|
4481
|
+
const f = y.default || y, C = new f({ target: d, props: o || {} });
|
|
4482
|
+
return l.current = C, () => C.$destroy();
|
|
4473
4483
|
}
|
|
4474
|
-
if (
|
|
4475
|
-
const
|
|
4484
|
+
if (y.mount) {
|
|
4485
|
+
const f = y.mount({ container: d, props: o || {} });
|
|
4476
4486
|
return () => {
|
|
4477
|
-
typeof
|
|
4487
|
+
typeof f == "function" ? f() : y.unmount?.(d);
|
|
4478
4488
|
};
|
|
4479
4489
|
}
|
|
4480
4490
|
}
|
|
4481
|
-
}, [
|
|
4491
|
+
}, [y, t, b]), G(() => {
|
|
4482
4492
|
t === "svelte" && l.current && l.current.$set?.(o);
|
|
4483
4493
|
}, [o, t]), /* @__PURE__ */ c("div", { ref: h, className: i, style: { display: "contents" }, children: [
|
|
4484
|
-
|
|
4485
|
-
t === "react" &&
|
|
4494
|
+
b && a,
|
|
4495
|
+
t === "react" && y && /* @__PURE__ */ e(y, { ...o })
|
|
4486
4496
|
] });
|
|
4487
4497
|
}
|
|
4488
|
-
class ht extends
|
|
4498
|
+
class ht extends He {
|
|
4489
4499
|
constructor() {
|
|
4490
4500
|
super(...arguments), this.state = {
|
|
4491
4501
|
hasError: !1,
|
|
@@ -4550,7 +4560,7 @@ export {
|
|
|
4550
4560
|
ue as TextField,
|
|
4551
4561
|
Zr as VideoSurface,
|
|
4552
4562
|
st as View,
|
|
4553
|
-
|
|
4563
|
+
g as cn,
|
|
4554
4564
|
Kr as createSizes,
|
|
4555
4565
|
Gr as createVariants
|
|
4556
4566
|
};
|