@opencxh/ui-kit 3.57.7 → 3.57.9
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 +1076 -1073
- 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 Ie } from "clsx";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { VideoOff as je, User as Be, MicOff as Pe, Mic as _e, ChevronDown as Oe, FileText as pe, HardDrive as ke, X as Ve, ArrowLeft as we, Search as $e, FolderPlus as Fe, Upload as We, Folder as Ce, Pencil as Re, ChevronDownIcon as
|
|
4
|
-
import se, { useRef as X, useEffect as
|
|
5
|
-
function
|
|
2
|
+
import { jsxs as d, jsx as e, Fragment as Ee } from "react/jsx-runtime";
|
|
3
|
+
import { VideoOff as je, User as Be, MicOff as Pe, Mic as _e, ChevronDown as Oe, FileText as pe, HardDrive as ke, X as Ve, ArrowLeft as we, Search as $e, FolderPlus as Fe, Upload as We, Folder as Ce, Pencil as Re, ChevronDownIcon as He, ChevronRight as qe } from "lucide-react";
|
|
4
|
+
import se, { useRef as X, useEffect as K, forwardRef as ce, useState as V, useCallback as ae, useMemo as de, createContext as Ue, Component as Ge } from "react";
|
|
5
|
+
function x(...t) {
|
|
6
6
|
return Ie(t);
|
|
7
7
|
}
|
|
8
8
|
function Kt(t) {
|
|
@@ -13,12 +13,12 @@ function Jt(t) {
|
|
|
13
13
|
}
|
|
14
14
|
function Yt({ tiles: t, pinned: a, className: r }) {
|
|
15
15
|
if (a)
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ d("div", { className: x("flex flex-col md:flex-row gap-2 h-full", r), children: [
|
|
17
17
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-[240px]", children: a }),
|
|
18
18
|
t.length > 0 && /* @__PURE__ */ e("div", { className: "flex md:flex-col gap-2 md:w-48 overflow-auto", children: t.map((s, c) => /* @__PURE__ */ e("div", { className: "min-w-[160px] md:min-w-0", children: s }, c)) })
|
|
19
19
|
] });
|
|
20
20
|
const n = t.length <= 1 ? "grid-cols-1" : t.length <= 4 ? "grid-cols-2" : t.length <= 9 ? "grid-cols-3" : "grid-cols-4";
|
|
21
|
-
return /* @__PURE__ */ e("div", { className:
|
|
21
|
+
return /* @__PURE__ */ e("div", { className: x("grid gap-2 h-full", n, r), children: t.map((s, c) => /* @__PURE__ */ e("div", { children: s }, c)) });
|
|
22
22
|
}
|
|
23
23
|
function Zt({
|
|
24
24
|
name: t,
|
|
@@ -29,17 +29,17 @@ function Zt({
|
|
|
29
29
|
videoSlot: c,
|
|
30
30
|
className: f
|
|
31
31
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ d(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
35
|
+
className: x(
|
|
36
36
|
"relative rounded-lg overflow-hidden bg-gray-800 aspect-video flex items-center justify-center",
|
|
37
37
|
n && "ring-2 ring-emerald-400",
|
|
38
38
|
f
|
|
39
39
|
),
|
|
40
40
|
children: [
|
|
41
41
|
s && c ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: c }) : /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: a ? /* @__PURE__ */ e("img", { src: a, alt: t, className: "w-16 h-16 rounded-full object-cover" }) : /* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-gray-700 flex items-center justify-center", children: s ? /* @__PURE__ */ e(je, { className: "w-8 h-8" }) : /* @__PURE__ */ e(Be, { className: "w-8 h-8" }) }) }),
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ d("div", { className: "absolute bottom-2 left-2 flex items-center gap-1.5 px-2 py-1 rounded bg-black/50 text-white text-xs", children: [
|
|
43
43
|
r ? /* @__PURE__ */ e(Pe, { className: "w-3 h-3" }) : /* @__PURE__ */ e(_e, { className: "w-3 h-3" }),
|
|
44
44
|
/* @__PURE__ */ e("span", { className: "truncate max-w-[140px]", children: t })
|
|
45
45
|
] })
|
|
@@ -49,7 +49,7 @@ function Zt({
|
|
|
49
49
|
}
|
|
50
50
|
function Xt({ attach: t, active: a = !0, mirrored: r = !1, className: n }) {
|
|
51
51
|
const s = X(null);
|
|
52
|
-
return
|
|
52
|
+
return K(() => {
|
|
53
53
|
if (!a || !s.current) return;
|
|
54
54
|
const c = t(s.current);
|
|
55
55
|
return () => {
|
|
@@ -59,7 +59,7 @@ function Xt({ attach: t, active: a = !0, mirrored: r = !1, className: n }) {
|
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
ref: s,
|
|
62
|
-
className:
|
|
62
|
+
className: x(
|
|
63
63
|
"w-full h-full bg-gray-900 overflow-hidden",
|
|
64
64
|
r && "[&>*]:scale-x-[-1]",
|
|
65
65
|
n
|
|
@@ -87,7 +87,7 @@ const Ke = {
|
|
|
87
87
|
lg: "p-3",
|
|
88
88
|
xl: "p-4",
|
|
89
89
|
full: "p-4"
|
|
90
|
-
},
|
|
90
|
+
}, te = ce(
|
|
91
91
|
({
|
|
92
92
|
variant: t = "primary",
|
|
93
93
|
size: a = "md",
|
|
@@ -96,18 +96,18 @@ const Ke = {
|
|
|
96
96
|
leftIcon: s,
|
|
97
97
|
rightIcon: c,
|
|
98
98
|
iconOnly: f = !1,
|
|
99
|
-
className:
|
|
99
|
+
className: b,
|
|
100
100
|
children: p,
|
|
101
|
-
disabled:
|
|
102
|
-
...
|
|
101
|
+
disabled: g,
|
|
102
|
+
...m
|
|
103
103
|
}, l) => {
|
|
104
|
-
const
|
|
105
|
-
return /* @__PURE__ */
|
|
104
|
+
const u = g || n;
|
|
105
|
+
return /* @__PURE__ */ d(
|
|
106
106
|
"button",
|
|
107
107
|
{
|
|
108
108
|
ref: l,
|
|
109
109
|
type: "button",
|
|
110
|
-
className:
|
|
110
|
+
className: x(
|
|
111
111
|
// Base styles — radius/focus/colors come from the token-driven `.btn o__*` CSS
|
|
112
112
|
"inline-flex items-center justify-center transition-colors duration-200",
|
|
113
113
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
@@ -119,15 +119,15 @@ const Ke = {
|
|
|
119
119
|
r && "w-full",
|
|
120
120
|
// Loading state
|
|
121
121
|
n && "cursor-wait",
|
|
122
|
-
|
|
122
|
+
b
|
|
123
123
|
),
|
|
124
|
-
disabled:
|
|
125
|
-
...
|
|
124
|
+
disabled: u,
|
|
125
|
+
...m,
|
|
126
126
|
children: [
|
|
127
|
-
n && /* @__PURE__ */
|
|
127
|
+
n && /* @__PURE__ */ d(
|
|
128
128
|
"svg",
|
|
129
129
|
{
|
|
130
|
-
className:
|
|
130
|
+
className: x(
|
|
131
131
|
"animate-spin",
|
|
132
132
|
f ? "h-4 w-4" : "h-4 w-4 mr-2"
|
|
133
133
|
),
|
|
@@ -156,16 +156,16 @@ const Ke = {
|
|
|
156
156
|
]
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
|
-
!n && s && /* @__PURE__ */ e("span", { className:
|
|
159
|
+
!n && s && /* @__PURE__ */ e("span", { className: x("flex-shrink-0", !f && "mr-2"), children: s }),
|
|
160
160
|
!f && p,
|
|
161
|
-
!n && c && /* @__PURE__ */ e("span", { className:
|
|
161
|
+
!n && c && /* @__PURE__ */ e("span", { className: x("flex-shrink-0", !f && "ml-2"), children: c }),
|
|
162
162
|
f && !n && !s && !c && p
|
|
163
163
|
]
|
|
164
164
|
}
|
|
165
165
|
);
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
|
-
|
|
168
|
+
te.displayName = "Button";
|
|
169
169
|
const Qt = ({
|
|
170
170
|
children: t,
|
|
171
171
|
size: a = "md",
|
|
@@ -173,7 +173,7 @@ const Qt = ({
|
|
|
173
173
|
attached: n = !0,
|
|
174
174
|
className: s
|
|
175
175
|
}) => {
|
|
176
|
-
const c =
|
|
176
|
+
const c = x(
|
|
177
177
|
"inline-flex",
|
|
178
178
|
{
|
|
179
179
|
// Orientation
|
|
@@ -204,12 +204,12 @@ const Qt = ({
|
|
|
204
204
|
external: s = !1,
|
|
205
205
|
className: c,
|
|
206
206
|
children: f,
|
|
207
|
-
href:
|
|
207
|
+
href: b,
|
|
208
208
|
target: p,
|
|
209
|
-
rel:
|
|
210
|
-
...
|
|
209
|
+
rel: g,
|
|
210
|
+
...m
|
|
211
211
|
}) => {
|
|
212
|
-
const l = s ||
|
|
212
|
+
const l = s || b && (b.startsWith("http") || b.startsWith("mailto:")), u = x(
|
|
213
213
|
// Base styles
|
|
214
214
|
"inline-flex items-center gap-1 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
215
215
|
// Size variants
|
|
@@ -264,12 +264,12 @@ const Qt = ({
|
|
|
264
264
|
},
|
|
265
265
|
c
|
|
266
266
|
), h = {
|
|
267
|
-
...
|
|
268
|
-
href: n ? void 0 :
|
|
267
|
+
...m,
|
|
268
|
+
href: n ? void 0 : b,
|
|
269
269
|
target: l ? "_blank" : p,
|
|
270
|
-
rel: l ? "noopener noreferrer" :
|
|
270
|
+
rel: l ? "noopener noreferrer" : g
|
|
271
271
|
};
|
|
272
|
-
return /* @__PURE__ */
|
|
272
|
+
return /* @__PURE__ */ d("a", { className: u, ...h, children: [
|
|
273
273
|
f,
|
|
274
274
|
l && /* @__PURE__ */ e(
|
|
275
275
|
"svg",
|
|
@@ -308,22 +308,22 @@ function ze({
|
|
|
308
308
|
options: c,
|
|
309
309
|
disabled: f = !1
|
|
310
310
|
}) {
|
|
311
|
-
const [
|
|
311
|
+
const [b, p] = V(!1), g = X(null), m = ae(() => {
|
|
312
312
|
p((l) => !l);
|
|
313
313
|
}, []);
|
|
314
|
-
return
|
|
315
|
-
const l = (
|
|
316
|
-
|
|
314
|
+
return K(() => {
|
|
315
|
+
const l = (u) => {
|
|
316
|
+
g.current && !g.current.contains(u.target) && p(!1);
|
|
317
317
|
};
|
|
318
318
|
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
319
|
-
}, []), /* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */
|
|
319
|
+
}, []), /* @__PURE__ */ d("div", { ref: g, className: "relative inline-flex items-center gap-px", children: [
|
|
320
|
+
/* @__PURE__ */ d(
|
|
321
321
|
"button",
|
|
322
322
|
{
|
|
323
323
|
type: "button",
|
|
324
324
|
onClick: a,
|
|
325
325
|
disabled: f,
|
|
326
|
-
className:
|
|
326
|
+
className: x(
|
|
327
327
|
"inline-flex items-center justify-center font-medium transition-colors duration-200",
|
|
328
328
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
329
329
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
@@ -341,9 +341,9 @@ function ze({
|
|
|
341
341
|
"button",
|
|
342
342
|
{
|
|
343
343
|
type: "button",
|
|
344
|
-
onClick:
|
|
344
|
+
onClick: m,
|
|
345
345
|
disabled: f,
|
|
346
|
-
className:
|
|
346
|
+
className: x(
|
|
347
347
|
"inline-flex items-center justify-center font-medium transition-colors duration-200",
|
|
348
348
|
"focus:outline-none focus:ring-1 focus:ring-offset-1",
|
|
349
349
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
@@ -354,14 +354,14 @@ function ze({
|
|
|
354
354
|
children: /* @__PURE__ */ e(Oe, { className: "h-4 w-4" })
|
|
355
355
|
}
|
|
356
356
|
),
|
|
357
|
-
|
|
357
|
+
b && c.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: c.map((l) => /* @__PURE__ */ e(
|
|
358
358
|
"button",
|
|
359
359
|
{
|
|
360
360
|
type: "button",
|
|
361
361
|
onClick: () => {
|
|
362
362
|
l.onClick(), p(!1);
|
|
363
363
|
},
|
|
364
|
-
className:
|
|
364
|
+
className: x(
|
|
365
365
|
"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
|
|
366
366
|
l.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "text-gray-700"
|
|
367
367
|
),
|
|
@@ -390,22 +390,22 @@ const Xe = {
|
|
|
390
390
|
indeterminate: s = !1,
|
|
391
391
|
containerClassName: c,
|
|
392
392
|
labelClassName: f,
|
|
393
|
-
className:
|
|
393
|
+
className: b,
|
|
394
394
|
id: p,
|
|
395
|
-
...
|
|
396
|
-
},
|
|
397
|
-
const l = p || `checkbox-${Math.random().toString(36).substr(2, 9)}`,
|
|
395
|
+
...g
|
|
396
|
+
}, m) => {
|
|
397
|
+
const l = p || `checkbox-${Math.random().toString(36).substr(2, 9)}`, u = !!r;
|
|
398
398
|
return se.useEffect(() => {
|
|
399
|
-
|
|
400
|
-
}, [s,
|
|
401
|
-
/* @__PURE__ */
|
|
399
|
+
m && typeof m == "object" && m.current && (m.current.indeterminate = s);
|
|
400
|
+
}, [s, m]), /* @__PURE__ */ d("div", { className: x("flex flex-col", c), children: [
|
|
401
|
+
/* @__PURE__ */ d("div", { className: "flex items-start", children: [
|
|
402
402
|
/* @__PURE__ */ e("div", { className: "flex items-center h-5", children: /* @__PURE__ */ e(
|
|
403
403
|
"input",
|
|
404
404
|
{
|
|
405
|
-
ref:
|
|
405
|
+
ref: m,
|
|
406
406
|
id: l,
|
|
407
407
|
type: "checkbox",
|
|
408
|
-
className:
|
|
408
|
+
className: x(
|
|
409
409
|
// Base styles
|
|
410
410
|
"rounded border transition-colors duration-200",
|
|
411
411
|
"focus:ring-2 focus:ring-offset-2 focus:outline-none",
|
|
@@ -416,20 +416,20 @@ const Xe = {
|
|
|
416
416
|
// checked fill is the forms-plugin `currentColor`. The plugin's
|
|
417
417
|
// check glyph is white, so the fill must stay dark in both modes
|
|
418
418
|
// (accent-fill would invert to near-white in dark → invisible check).
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
u ? "border-error bg-[var(--base-input)] text-error focus:border-error focus:ring-error" : "border-neutral bg-[var(--base-input)] text-[#1a1a1a] focus:border-primary focus:ring-primary",
|
|
420
|
+
b
|
|
421
421
|
),
|
|
422
|
-
...
|
|
422
|
+
...g
|
|
423
423
|
}
|
|
424
424
|
) }),
|
|
425
|
-
t && /* @__PURE__ */
|
|
425
|
+
t && /* @__PURE__ */ d("div", { className: "ml-3 flex-1", children: [
|
|
426
426
|
/* @__PURE__ */ e(
|
|
427
427
|
"label",
|
|
428
428
|
{
|
|
429
429
|
htmlFor: l,
|
|
430
|
-
className:
|
|
430
|
+
className: x(
|
|
431
431
|
"font-medium cursor-pointer",
|
|
432
|
-
|
|
432
|
+
u ? "text-error" : "text-default",
|
|
433
433
|
Qe[n],
|
|
434
434
|
f
|
|
435
435
|
),
|
|
@@ -452,14 +452,14 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
452
452
|
required: s = !1,
|
|
453
453
|
size: c = "md",
|
|
454
454
|
className: f,
|
|
455
|
-
minDate:
|
|
455
|
+
minDate: b,
|
|
456
456
|
maxDate: p,
|
|
457
|
-
format:
|
|
458
|
-
},
|
|
459
|
-
const [l,
|
|
460
|
-
|
|
461
|
-
const z = (
|
|
462
|
-
w.current && !w.current.contains(
|
|
457
|
+
format: g = "MM/dd/yyyy"
|
|
458
|
+
}, m) => {
|
|
459
|
+
const [l, u] = V(!1), [h, C] = V(() => t || /* @__PURE__ */ new Date()), w = X(null);
|
|
460
|
+
K(() => {
|
|
461
|
+
const z = (P) => {
|
|
462
|
+
w.current && !w.current.contains(P.target) && u(!1);
|
|
463
463
|
};
|
|
464
464
|
return l && document.addEventListener("mousedown", z), () => {
|
|
465
465
|
document.removeEventListener("mousedown", z);
|
|
@@ -467,32 +467,32 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
467
467
|
}, [l]);
|
|
468
468
|
const N = (z) => {
|
|
469
469
|
if (!z) return "";
|
|
470
|
-
const
|
|
471
|
-
switch (
|
|
470
|
+
const P = z.getDate().toString().padStart(2, "0"), H = (z.getMonth() + 1).toString().padStart(2, "0"), i = z.getFullYear();
|
|
471
|
+
switch (g) {
|
|
472
472
|
case "dd/MM/yyyy":
|
|
473
|
-
return `${
|
|
473
|
+
return `${P}/${H}/${i}`;
|
|
474
474
|
case "yyyy-MM-dd":
|
|
475
|
-
return `${
|
|
475
|
+
return `${i}-${H}-${P}`;
|
|
476
476
|
case "MM/dd/yyyy":
|
|
477
477
|
default:
|
|
478
|
-
return `${
|
|
478
|
+
return `${H}/${P}/${i}`;
|
|
479
479
|
}
|
|
480
|
-
},
|
|
481
|
-
const z = h.getFullYear(),
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
for (let
|
|
485
|
-
|
|
486
|
-
return
|
|
487
|
-
},
|
|
488
|
-
z.getMonth() === h.getMonth() && (
|
|
480
|
+
}, I = () => {
|
|
481
|
+
const z = h.getFullYear(), P = h.getMonth(), H = new Date(z, P, 1), i = new Date(H);
|
|
482
|
+
i.setDate(i.getDate() - H.getDay());
|
|
483
|
+
const y = [], $ = new Date(i);
|
|
484
|
+
for (let L = 0; L < 42; L++)
|
|
485
|
+
y.push(new Date($)), $.setDate($.getDate() + 1);
|
|
486
|
+
return y;
|
|
487
|
+
}, v = (z) => {
|
|
488
|
+
z.getMonth() === h.getMonth() && (b && z < b || p && z > p || (a?.(z), u(!1)));
|
|
489
489
|
}, q = () => {
|
|
490
490
|
C(new Date(h.getFullYear(), h.getMonth() - 1, 1));
|
|
491
|
-
},
|
|
491
|
+
}, B = () => {
|
|
492
492
|
C(new Date(h.getFullYear(), h.getMonth() + 1, 1));
|
|
493
|
-
},
|
|
494
|
-
a?.(null),
|
|
495
|
-
}, F =
|
|
493
|
+
}, U = () => {
|
|
494
|
+
a?.(null), u(!1);
|
|
495
|
+
}, F = x(
|
|
496
496
|
"w-full border border-neutral rounded-md transition-colors duration-200",
|
|
497
497
|
"bg-module text-default",
|
|
498
498
|
"placeholder:text-default dark:placeholder:text-muted",
|
|
@@ -505,7 +505,7 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
505
505
|
"px-4 py-3 text-base": c === "full"
|
|
506
506
|
},
|
|
507
507
|
f
|
|
508
|
-
), E =
|
|
508
|
+
), E = I(), J = [
|
|
509
509
|
"January",
|
|
510
510
|
"February",
|
|
511
511
|
"March",
|
|
@@ -519,35 +519,35 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
519
519
|
"November",
|
|
520
520
|
"December"
|
|
521
521
|
];
|
|
522
|
-
return /* @__PURE__ */
|
|
523
|
-
/* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ d("div", { ref: w, className: "relative", children: [
|
|
523
|
+
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
524
524
|
/* @__PURE__ */ e(
|
|
525
525
|
"input",
|
|
526
526
|
{
|
|
527
|
-
ref:
|
|
527
|
+
ref: m,
|
|
528
528
|
type: "text",
|
|
529
529
|
value: N(t ?? null),
|
|
530
530
|
placeholder: r,
|
|
531
531
|
disabled: n,
|
|
532
532
|
required: s,
|
|
533
533
|
readOnly: !0,
|
|
534
|
-
onClick: () => !n &&
|
|
535
|
-
className:
|
|
534
|
+
onClick: () => !n && u(!l),
|
|
535
|
+
className: x(F, "pr-10 cursor-pointer")
|
|
536
536
|
}
|
|
537
537
|
),
|
|
538
538
|
/* @__PURE__ */ e(
|
|
539
539
|
"button",
|
|
540
540
|
{
|
|
541
541
|
type: "button",
|
|
542
|
-
onClick: () => !n &&
|
|
542
|
+
onClick: () => !n && u(!l),
|
|
543
543
|
disabled: n,
|
|
544
544
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-muted hover:text-muted",
|
|
545
545
|
children: /* @__PURE__ */ e(et, {})
|
|
546
546
|
}
|
|
547
547
|
)
|
|
548
548
|
] }),
|
|
549
|
-
l && /* @__PURE__ */
|
|
550
|
-
/* @__PURE__ */
|
|
549
|
+
l && /* @__PURE__ */ d("div", { className: "absolute z-50 mt-1 bg-module border border-neutral rounded-md shadow-lg p-4 min-w-[280px]", children: [
|
|
550
|
+
/* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-4", children: [
|
|
551
551
|
/* @__PURE__ */ e(
|
|
552
552
|
"button",
|
|
553
553
|
{
|
|
@@ -556,7 +556,7 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
556
556
|
children: /* @__PURE__ */ e(tt, {})
|
|
557
557
|
}
|
|
558
558
|
),
|
|
559
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ d("h3", { className: "text-sm font-medium text-default", children: [
|
|
560
560
|
J[h.getMonth()],
|
|
561
561
|
" ",
|
|
562
562
|
h.getFullYear()
|
|
@@ -564,39 +564,39 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
564
564
|
/* @__PURE__ */ e(
|
|
565
565
|
"button",
|
|
566
566
|
{
|
|
567
|
-
onClick:
|
|
567
|
+
onClick: B,
|
|
568
568
|
className: "p-1 hover:bg-neutral-container rounded",
|
|
569
569
|
children: /* @__PURE__ */ e(rt, {})
|
|
570
570
|
}
|
|
571
571
|
)
|
|
572
572
|
] }),
|
|
573
573
|
/* @__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-muted text-center py-1", children: z }, z)) }),
|
|
574
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: E.map((z,
|
|
575
|
-
const
|
|
574
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: E.map((z, P) => {
|
|
575
|
+
const H = z.getMonth() === h.getMonth(), i = t && z.toDateString() === t.toDateString(), y = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), $ = !H || b && z < b || p && z > p;
|
|
576
576
|
return /* @__PURE__ */ e(
|
|
577
577
|
"button",
|
|
578
578
|
{
|
|
579
|
-
onClick: () =>
|
|
580
|
-
disabled:
|
|
581
|
-
className:
|
|
579
|
+
onClick: () => !$ && v(z),
|
|
580
|
+
disabled: $,
|
|
581
|
+
className: x(
|
|
582
582
|
"w-8 h-8 text-sm rounded transition-colors duration-200",
|
|
583
583
|
{
|
|
584
|
-
"text-default hover:bg-neutral-container":
|
|
585
|
-
"bg-primary text-white":
|
|
586
|
-
"bg-neutral-container text-default":
|
|
587
|
-
"text-muted cursor-not-allowed":
|
|
584
|
+
"text-default hover:bg-neutral-container": H && !i && !$,
|
|
585
|
+
"bg-primary text-white": i,
|
|
586
|
+
"bg-neutral-container text-default": y && !i,
|
|
587
|
+
"text-muted cursor-not-allowed": $
|
|
588
588
|
}
|
|
589
589
|
),
|
|
590
590
|
children: z.getDate()
|
|
591
591
|
},
|
|
592
|
-
|
|
592
|
+
P
|
|
593
593
|
);
|
|
594
594
|
}) }),
|
|
595
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ d("div", { className: "flex justify-between items-center mt-4 pt-3 border-t border-neutral", children: [
|
|
596
596
|
/* @__PURE__ */ e(
|
|
597
597
|
"button",
|
|
598
598
|
{
|
|
599
|
-
onClick:
|
|
599
|
+
onClick: U,
|
|
600
600
|
className: "text-sm text-muted hover:text-default",
|
|
601
601
|
children: "Clear"
|
|
602
602
|
}
|
|
@@ -604,7 +604,7 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
604
604
|
/* @__PURE__ */ e(
|
|
605
605
|
"button",
|
|
606
606
|
{
|
|
607
|
-
onClick: () =>
|
|
607
|
+
onClick: () => u(!1),
|
|
608
608
|
className: "text-sm text-primary hover:text-primary/80",
|
|
609
609
|
children: "Close"
|
|
610
610
|
}
|
|
@@ -667,71 +667,71 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
667
667
|
fullWidth: s = !1,
|
|
668
668
|
startIcon: c = /* @__PURE__ */ e(nt, {}),
|
|
669
669
|
loading: f = !1,
|
|
670
|
-
containerClassName:
|
|
670
|
+
containerClassName: b,
|
|
671
671
|
labelClassName: p,
|
|
672
|
-
className:
|
|
673
|
-
id:
|
|
672
|
+
className: g,
|
|
673
|
+
id: m,
|
|
674
674
|
options: l,
|
|
675
|
-
onRemoteSearch:
|
|
675
|
+
onRemoteSearch: u,
|
|
676
676
|
onSelect: h,
|
|
677
677
|
debounceTime: C = 500,
|
|
678
678
|
value: w,
|
|
679
679
|
onChange: N,
|
|
680
|
-
...
|
|
681
|
-
},
|
|
682
|
-
const q =
|
|
683
|
-
|
|
680
|
+
...I
|
|
681
|
+
}, v) => {
|
|
682
|
+
const q = m || `searchfield-${Math.random().toString(36).substr(2, 9)}`, B = !!r, U = X(null), F = X(null), [E, J] = V(w || ""), [z, P] = V(!1), [H, i] = V(!1);
|
|
683
|
+
K(() => {
|
|
684
684
|
w !== void 0 && J(w);
|
|
685
685
|
}, [w]);
|
|
686
|
-
const
|
|
686
|
+
const y = de(() => {
|
|
687
687
|
if (!E) return l;
|
|
688
688
|
const W = String(E).toLowerCase();
|
|
689
689
|
return l.filter(
|
|
690
690
|
(S) => String(S.label).toLowerCase().includes(W)
|
|
691
691
|
);
|
|
692
692
|
}, [E, l]);
|
|
693
|
-
|
|
694
|
-
if (!
|
|
695
|
-
|
|
693
|
+
K(() => {
|
|
694
|
+
if (!u || !E) {
|
|
695
|
+
i(!1);
|
|
696
696
|
return;
|
|
697
697
|
}
|
|
698
698
|
const W = setTimeout(async () => {
|
|
699
|
-
|
|
699
|
+
i(!0);
|
|
700
700
|
try {
|
|
701
|
-
await
|
|
701
|
+
await u(String(E));
|
|
702
702
|
} catch (S) {
|
|
703
703
|
console.error("Remote search failed:", S);
|
|
704
704
|
} finally {
|
|
705
|
-
|
|
705
|
+
i(!1);
|
|
706
706
|
}
|
|
707
707
|
}, C);
|
|
708
708
|
return () => {
|
|
709
|
-
clearTimeout(W),
|
|
709
|
+
clearTimeout(W), i(!1);
|
|
710
710
|
};
|
|
711
|
-
}, [E, C,
|
|
711
|
+
}, [E, C, u]), K(() => {
|
|
712
712
|
const W = (S) => {
|
|
713
|
-
|
|
713
|
+
U.current && !U.current.contains(S.target) && P(!1);
|
|
714
714
|
};
|
|
715
715
|
return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
|
|
716
716
|
}, []);
|
|
717
|
-
const
|
|
717
|
+
const $ = (W) => {
|
|
718
718
|
const S = W.target.value;
|
|
719
|
-
J(S),
|
|
720
|
-
},
|
|
721
|
-
J(W.label),
|
|
722
|
-
},
|
|
723
|
-
(l.length > 0 ||
|
|
724
|
-
}, M = f ||
|
|
725
|
-
return /* @__PURE__ */
|
|
719
|
+
J(S), P(!0), N && N(W);
|
|
720
|
+
}, L = (W) => {
|
|
721
|
+
J(W.label), P(!1), h && h(W.value);
|
|
722
|
+
}, D = () => {
|
|
723
|
+
(l.length > 0 || u) && P(!0);
|
|
724
|
+
}, M = f || H, Q = z && (y.length > 0 || M), re = de(() => v || F, [v]);
|
|
725
|
+
return /* @__PURE__ */ d(
|
|
726
726
|
"div",
|
|
727
727
|
{
|
|
728
728
|
className: ie(
|
|
729
729
|
"flex flex-col",
|
|
730
730
|
s ? "w-full" : "",
|
|
731
|
-
|
|
731
|
+
b || "",
|
|
732
732
|
"relative"
|
|
733
733
|
),
|
|
734
|
-
ref:
|
|
734
|
+
ref: U,
|
|
735
735
|
children: [
|
|
736
736
|
t && /* @__PURE__ */ e(
|
|
737
737
|
"label",
|
|
@@ -739,22 +739,22 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
739
739
|
htmlFor: q,
|
|
740
740
|
className: ie(
|
|
741
741
|
"block text-sm font-medium mb-1",
|
|
742
|
-
|
|
742
|
+
B ? "text-error" : "text-default",
|
|
743
743
|
p || ""
|
|
744
744
|
),
|
|
745
745
|
children: t
|
|
746
746
|
}
|
|
747
747
|
),
|
|
748
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
749
749
|
c && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: ie("text-muted", xe[n]), children: c }) }),
|
|
750
750
|
/* @__PURE__ */ e(
|
|
751
751
|
"input",
|
|
752
752
|
{
|
|
753
|
-
ref:
|
|
753
|
+
ref: re,
|
|
754
754
|
id: q,
|
|
755
755
|
value: E,
|
|
756
|
-
onChange:
|
|
757
|
-
onFocus:
|
|
756
|
+
onChange: $,
|
|
757
|
+
onFocus: D,
|
|
758
758
|
className: ie(
|
|
759
759
|
// Base styles
|
|
760
760
|
"block w-full rounded-lg border transition-colors duration-200 bg-input",
|
|
@@ -767,15 +767,15 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
767
767
|
"pr-10",
|
|
768
768
|
// Altijd padding rechts voor de dropdown/loading icon
|
|
769
769
|
// State styles
|
|
770
|
-
|
|
771
|
-
|
|
770
|
+
B ? "border-red-500 text-error focus:border-red-500 focus:ring-red-500" : "border-neutral text-default",
|
|
771
|
+
g || ""
|
|
772
772
|
),
|
|
773
|
-
...
|
|
773
|
+
...I
|
|
774
774
|
}
|
|
775
775
|
),
|
|
776
776
|
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: M || f ? (
|
|
777
777
|
// Loading Spinner
|
|
778
|
-
/* @__PURE__ */
|
|
778
|
+
/* @__PURE__ */ d(
|
|
779
779
|
"svg",
|
|
780
780
|
{
|
|
781
781
|
className: ie("animate-spin text-link", xe[n]),
|
|
@@ -815,21 +815,21 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
815
815
|
xe[n],
|
|
816
816
|
z ? "rotate-180" : "rotate-0"
|
|
817
817
|
),
|
|
818
|
-
onClick: () =>
|
|
818
|
+
onClick: () => P((W) => !W)
|
|
819
819
|
}
|
|
820
820
|
)
|
|
821
821
|
) })
|
|
822
822
|
] }),
|
|
823
|
-
|
|
823
|
+
Q && /* @__PURE__ */ e(
|
|
824
824
|
"ul",
|
|
825
825
|
{
|
|
826
826
|
className: "absolute z-10 mt-1 w-full bg-module border border-neutral rounded-lg shadow-lg max-h-60 overflow-auto top-full",
|
|
827
827
|
role: "listbox",
|
|
828
|
-
children:
|
|
828
|
+
children: y.length > 0 ? y.map((W) => /* @__PURE__ */ e(
|
|
829
829
|
"li",
|
|
830
830
|
{
|
|
831
831
|
className: "px-4 py-2 cursor-pointer text-default hover:bg-accent-container hover:text-accent transition-colors",
|
|
832
|
-
onClick: () =>
|
|
832
|
+
onClick: () => L(W),
|
|
833
833
|
role: "option",
|
|
834
834
|
"aria-selected": E === W.label,
|
|
835
835
|
children: W.label
|
|
@@ -843,12 +843,12 @@ const et = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
843
843
|
{
|
|
844
844
|
className: ie(
|
|
845
845
|
"mt-1 text-xs",
|
|
846
|
-
|
|
846
|
+
B ? "text-error" : "text-muted"
|
|
847
847
|
),
|
|
848
848
|
children: r || a
|
|
849
849
|
}
|
|
850
850
|
),
|
|
851
|
-
|
|
851
|
+
u && /* @__PURE__ */ d("p", { className: "mt-2 text-xs text-success dark:text-success", children: [
|
|
852
852
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
853
853
|
String(E)
|
|
854
854
|
] })
|
|
@@ -872,115 +872,115 @@ const ot = {
|
|
|
872
872
|
fullWidth: s = !1,
|
|
873
873
|
options: c,
|
|
874
874
|
placeholder: f,
|
|
875
|
-
containerClassName:
|
|
875
|
+
containerClassName: b,
|
|
876
876
|
labelClassName: p,
|
|
877
|
-
className:
|
|
878
|
-
id:
|
|
877
|
+
className: g,
|
|
878
|
+
id: m,
|
|
879
879
|
searchable: l,
|
|
880
|
-
multiple:
|
|
880
|
+
multiple: u,
|
|
881
881
|
value: h,
|
|
882
882
|
onChange: C,
|
|
883
883
|
allowCreate: w,
|
|
884
884
|
onCreateOption: N,
|
|
885
|
-
...
|
|
886
|
-
},
|
|
887
|
-
const q =
|
|
888
|
-
se.useImperativeHandle(
|
|
889
|
-
const S = (
|
|
890
|
-
z.current && !z.current.contains(
|
|
885
|
+
...I
|
|
886
|
+
}, v) => {
|
|
887
|
+
const q = m || `select-${Math.random().toString(36).substr(2, 9)}`, B = !!r, [U, F] = se.useState(!1), [E, J] = se.useState(""), z = se.useRef(null), [P, H] = se.useState(c);
|
|
888
|
+
se.useImperativeHandle(v, () => z.current), se.useEffect(() => {
|
|
889
|
+
const S = (A) => {
|
|
890
|
+
z.current && !z.current.contains(A.target) && F(!1);
|
|
891
891
|
};
|
|
892
892
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
893
893
|
}, []);
|
|
894
|
-
const
|
|
895
|
-
(S,
|
|
896
|
-
(O) => me(O.value) === me(
|
|
894
|
+
const i = se.useCallback(
|
|
895
|
+
(S, A) => S.some(
|
|
896
|
+
(O) => me(O.value) === me(A) || me(O.label) === me(A)
|
|
897
897
|
),
|
|
898
898
|
[]
|
|
899
|
-
),
|
|
900
|
-
(S,
|
|
901
|
-
const O = [...S],
|
|
902
|
-
const
|
|
903
|
-
|
|
899
|
+
), y = se.useCallback(
|
|
900
|
+
(S, A) => {
|
|
901
|
+
const O = [...S], T = (ee) => {
|
|
902
|
+
const ne = (ee ?? "").trim();
|
|
903
|
+
ne && (i(O, ne) || O.push({ value: ne, label: ne }));
|
|
904
904
|
};
|
|
905
|
-
return Array.isArray(
|
|
905
|
+
return Array.isArray(A) ? A.forEach(T) : T(A), O;
|
|
906
906
|
},
|
|
907
|
-
[
|
|
907
|
+
[i]
|
|
908
908
|
);
|
|
909
909
|
se.useEffect(() => {
|
|
910
|
-
|
|
911
|
-
const
|
|
910
|
+
H((S) => {
|
|
911
|
+
const A = [...c];
|
|
912
912
|
return S.forEach((O) => {
|
|
913
|
-
!
|
|
914
|
-
}),
|
|
913
|
+
!i(A, O.value) && !i(A, O.label) && A.push(O);
|
|
914
|
+
}), y(A, h);
|
|
915
915
|
});
|
|
916
|
-
}, [c, h,
|
|
917
|
-
const
|
|
918
|
-
if (
|
|
919
|
-
const
|
|
916
|
+
}, [c, h, y, i]);
|
|
917
|
+
const $ = (S) => {
|
|
918
|
+
if (u) {
|
|
919
|
+
const A = Array.isArray(h) ? h : [], O = A.includes(S) ? A.filter((T) => T !== S) : [...A, S];
|
|
920
920
|
C?.(O);
|
|
921
921
|
} else
|
|
922
922
|
C?.(S), F(!1), J("");
|
|
923
|
-
},
|
|
923
|
+
}, L = u ? null : P.find((S) => S.value === h), D = u ? P.filter(
|
|
924
924
|
(S) => Array.isArray(h) && h.includes(S.value)
|
|
925
|
-
) : [], M = l && E ?
|
|
925
|
+
) : [], M = l && E ? P.filter(
|
|
926
926
|
(S) => S.label.toLowerCase().includes(E.toLowerCase())
|
|
927
|
-
) :
|
|
928
|
-
const
|
|
929
|
-
if (!
|
|
930
|
-
const O = N?.(
|
|
931
|
-
value:
|
|
932
|
-
label:
|
|
927
|
+
) : P, Q = !!w && !!l && !!E.trim() && !i(P, E), re = (S) => {
|
|
928
|
+
const A = S.trim();
|
|
929
|
+
if (!A) return;
|
|
930
|
+
const O = N?.(A) ?? {
|
|
931
|
+
value: A,
|
|
932
|
+
label: A
|
|
933
933
|
};
|
|
934
|
-
if (
|
|
935
|
-
|
|
934
|
+
if (i(P, O.value) || i(P, O.label)) {
|
|
935
|
+
$(O.value), J(""), u || F(!1);
|
|
936
936
|
return;
|
|
937
937
|
}
|
|
938
|
-
|
|
939
|
-
}, W = () =>
|
|
940
|
-
return /* @__PURE__ */
|
|
938
|
+
H((T) => [...T, O]), $(O.value), J(""), u || F(!1);
|
|
939
|
+
}, W = () => u ? D.length > 0 ? D.map((S) => S.label).join(", ") : f || "Select options" : L?.label || f || "Select an option";
|
|
940
|
+
return /* @__PURE__ */ d(
|
|
941
941
|
"div",
|
|
942
942
|
{
|
|
943
943
|
ref: z,
|
|
944
|
-
className:
|
|
944
|
+
className: x(
|
|
945
945
|
"relative flex flex-col",
|
|
946
946
|
s && "w-full",
|
|
947
|
-
|
|
947
|
+
b
|
|
948
948
|
),
|
|
949
|
-
...
|
|
949
|
+
...I,
|
|
950
950
|
children: [
|
|
951
951
|
t && /* @__PURE__ */ e(
|
|
952
952
|
"label",
|
|
953
953
|
{
|
|
954
954
|
htmlFor: q,
|
|
955
|
-
onClick: () => F(!
|
|
956
|
-
className:
|
|
955
|
+
onClick: () => F(!U),
|
|
956
|
+
className: x(
|
|
957
957
|
"block text-sm font-medium mb-1",
|
|
958
|
-
|
|
958
|
+
B ? "text-error" : "text-default",
|
|
959
959
|
p
|
|
960
960
|
),
|
|
961
961
|
children: t
|
|
962
962
|
}
|
|
963
963
|
),
|
|
964
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
965
965
|
/* @__PURE__ */ e(
|
|
966
966
|
"button",
|
|
967
967
|
{
|
|
968
968
|
type: "button",
|
|
969
969
|
id: q,
|
|
970
|
-
onClick: () => F(!
|
|
971
|
-
className:
|
|
970
|
+
onClick: () => F(!U),
|
|
971
|
+
className: x(
|
|
972
972
|
"block w-full rounded-lg border transition-colors duration-200 text-left",
|
|
973
973
|
"focus:outline-none focus:ring-0 focus:ring-offset-0",
|
|
974
974
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
975
975
|
"bg-module",
|
|
976
976
|
ot[n],
|
|
977
|
-
|
|
978
|
-
|
|
977
|
+
B ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
|
|
978
|
+
g
|
|
979
979
|
),
|
|
980
980
|
children: /* @__PURE__ */ e("span", { className: "block truncate", children: W() })
|
|
981
981
|
}
|
|
982
982
|
),
|
|
983
|
-
|
|
983
|
+
U && /* @__PURE__ */ d("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-module shadow-lg border border-neutral", children: [
|
|
984
984
|
l && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
985
985
|
"input",
|
|
986
986
|
{
|
|
@@ -989,22 +989,22 @@ const ot = {
|
|
|
989
989
|
value: E,
|
|
990
990
|
onChange: (S) => J(S.target.value),
|
|
991
991
|
onKeyDown: (S) => {
|
|
992
|
-
S.key === "Enter" &&
|
|
992
|
+
S.key === "Enter" && Q && (S.preventDefault(), re(E));
|
|
993
993
|
},
|
|
994
|
-
className:
|
|
994
|
+
className: x(
|
|
995
995
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
996
996
|
"text-default border-neutral focus:outline-none focus:ring-0"
|
|
997
997
|
)
|
|
998
998
|
}
|
|
999
999
|
) }),
|
|
1000
|
-
|
|
1000
|
+
Q && /* @__PURE__ */ d(
|
|
1001
1001
|
"div",
|
|
1002
1002
|
{
|
|
1003
|
-
className:
|
|
1003
|
+
className: x(
|
|
1004
1004
|
"px-4 py-2 text-sm cursor-pointer",
|
|
1005
1005
|
"text-primary hover:bg-neutral-container"
|
|
1006
1006
|
),
|
|
1007
|
-
onClick: () =>
|
|
1007
|
+
onClick: () => re(E),
|
|
1008
1008
|
children: [
|
|
1009
1009
|
"+: “",
|
|
1010
1010
|
E.trim(),
|
|
@@ -1012,8 +1012,8 @@ const ot = {
|
|
|
1012
1012
|
]
|
|
1013
1013
|
}
|
|
1014
1014
|
),
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
f && !
|
|
1015
|
+
/* @__PURE__ */ d("ul", { className: "max-h-60 overflow-auto py-1", children: [
|
|
1016
|
+
f && !u && /* @__PURE__ */ e(
|
|
1017
1017
|
"li",
|
|
1018
1018
|
{
|
|
1019
1019
|
className: "px-4 py-2 text-sm text-muted cursor-pointer hover:bg-neutral-container",
|
|
@@ -1024,23 +1024,23 @@ const ot = {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
),
|
|
1026
1026
|
M.map((S) => {
|
|
1027
|
-
const
|
|
1027
|
+
const A = u ? Array.isArray(h) && h.includes(S.value) : h === S.value;
|
|
1028
1028
|
return /* @__PURE__ */ e(
|
|
1029
1029
|
"li",
|
|
1030
1030
|
{
|
|
1031
|
-
onClick: () => !S.disabled &&
|
|
1032
|
-
className:
|
|
1031
|
+
onClick: () => !S.disabled && $(S.value),
|
|
1032
|
+
className: x(
|
|
1033
1033
|
"px-4 py-2 text-sm cursor-pointer",
|
|
1034
1034
|
"text-default",
|
|
1035
1035
|
S.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-neutral-container",
|
|
1036
|
-
|
|
1036
|
+
A && "font-semibold"
|
|
1037
1037
|
),
|
|
1038
|
-
children: /* @__PURE__ */
|
|
1039
|
-
|
|
1038
|
+
children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
|
|
1039
|
+
u && /* @__PURE__ */ e(
|
|
1040
1040
|
"input",
|
|
1041
1041
|
{
|
|
1042
1042
|
type: "checkbox",
|
|
1043
|
-
checked:
|
|
1043
|
+
checked: A,
|
|
1044
1044
|
readOnly: !0,
|
|
1045
1045
|
className: "mr-3 h-4 w-4 rounded border-neutral text-primary focus:ring-primary"
|
|
1046
1046
|
}
|
|
@@ -1057,9 +1057,9 @@ const ot = {
|
|
|
1057
1057
|
(r || a) && /* @__PURE__ */ e(
|
|
1058
1058
|
"p",
|
|
1059
1059
|
{
|
|
1060
|
-
className:
|
|
1060
|
+
className: x(
|
|
1061
1061
|
"mt-1 text-xs",
|
|
1062
|
-
|
|
1062
|
+
B ? "text-error" : "text-muted"
|
|
1063
1063
|
),
|
|
1064
1064
|
children: r || a
|
|
1065
1065
|
}
|
|
@@ -1084,34 +1084,34 @@ const ct = {
|
|
|
1084
1084
|
fullWidth: s = !1,
|
|
1085
1085
|
loading: c = !1,
|
|
1086
1086
|
containerClassName: f,
|
|
1087
|
-
labelClassName:
|
|
1087
|
+
labelClassName: b,
|
|
1088
1088
|
className: p,
|
|
1089
|
-
id:
|
|
1090
|
-
rows:
|
|
1089
|
+
id: g,
|
|
1090
|
+
rows: m = 4,
|
|
1091
1091
|
...l
|
|
1092
|
-
},
|
|
1093
|
-
const h =
|
|
1094
|
-
return /* @__PURE__ */
|
|
1092
|
+
}, u) => {
|
|
1093
|
+
const h = g || `textarea-${Math.random().toString(36).substr(2, 9)}`, C = !!r;
|
|
1094
|
+
return /* @__PURE__ */ d("div", { className: x("flex flex-col", s && "w-full", f), children: [
|
|
1095
1095
|
t && /* @__PURE__ */ e(
|
|
1096
1096
|
"label",
|
|
1097
1097
|
{
|
|
1098
1098
|
htmlFor: h,
|
|
1099
|
-
className:
|
|
1099
|
+
className: x(
|
|
1100
1100
|
"block text-sm font-medium mb-1",
|
|
1101
1101
|
C ? "text-error" : "text-default",
|
|
1102
|
-
|
|
1102
|
+
b
|
|
1103
1103
|
),
|
|
1104
1104
|
children: t
|
|
1105
1105
|
}
|
|
1106
1106
|
),
|
|
1107
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
1108
1108
|
/* @__PURE__ */ e(
|
|
1109
1109
|
"textarea",
|
|
1110
1110
|
{
|
|
1111
|
-
ref:
|
|
1111
|
+
ref: u,
|
|
1112
1112
|
id: h,
|
|
1113
|
-
rows:
|
|
1114
|
-
className:
|
|
1113
|
+
rows: m,
|
|
1114
|
+
className: x(
|
|
1115
1115
|
// Base styles
|
|
1116
1116
|
"block w-full rounded-lg border transition-colors duration-200 resize-vertical bg-input",
|
|
1117
1117
|
"placeholder:text-[var(--text-muted)] focus:outline-none focus:ring-0",
|
|
@@ -1125,7 +1125,7 @@ const ct = {
|
|
|
1125
1125
|
...l
|
|
1126
1126
|
}
|
|
1127
1127
|
),
|
|
1128
|
-
c && /* @__PURE__ */ e("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */
|
|
1128
|
+
c && /* @__PURE__ */ e("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ d(
|
|
1129
1129
|
"svg",
|
|
1130
1130
|
{
|
|
1131
1131
|
className: "animate-spin h-4 w-4 text-muted",
|
|
@@ -1158,7 +1158,7 @@ const ct = {
|
|
|
1158
1158
|
(r || a) && /* @__PURE__ */ e(
|
|
1159
1159
|
"p",
|
|
1160
1160
|
{
|
|
1161
|
-
className:
|
|
1161
|
+
className: x(
|
|
1162
1162
|
"mt-1 text-xs",
|
|
1163
1163
|
C ? "text-error" : "text-muted"
|
|
1164
1164
|
),
|
|
@@ -1188,36 +1188,36 @@ const it = {
|
|
|
1188
1188
|
fullWidth: s = !1,
|
|
1189
1189
|
startIcon: c,
|
|
1190
1190
|
endIcon: f,
|
|
1191
|
-
loading:
|
|
1191
|
+
loading: b = !1,
|
|
1192
1192
|
containerClassName: p,
|
|
1193
|
-
labelClassName:
|
|
1194
|
-
className:
|
|
1193
|
+
labelClassName: g,
|
|
1194
|
+
className: m,
|
|
1195
1195
|
id: l,
|
|
1196
|
-
...
|
|
1196
|
+
...u
|
|
1197
1197
|
}, h) => {
|
|
1198
1198
|
const C = l || `textfield-${Math.random().toString(36).substr(2, 9)}`, w = !!r;
|
|
1199
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ d("div", { className: x("flex flex-col", s && "w-full", p), children: [
|
|
1200
1200
|
t && /* @__PURE__ */ e(
|
|
1201
1201
|
"label",
|
|
1202
1202
|
{
|
|
1203
1203
|
htmlFor: C,
|
|
1204
|
-
className:
|
|
1204
|
+
className: x(
|
|
1205
1205
|
"block text-sm font-medium mb-1",
|
|
1206
1206
|
w ? "text-error" : "text-default",
|
|
1207
|
-
|
|
1207
|
+
g
|
|
1208
1208
|
),
|
|
1209
1209
|
children: t
|
|
1210
1210
|
}
|
|
1211
1211
|
),
|
|
1212
|
-
/* @__PURE__ */
|
|
1212
|
+
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
1213
1213
|
c && // Todo fix inset not showing correctly on different sizes
|
|
1214
|
-
/* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className:
|
|
1214
|
+
/* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: x("text-muted", be[n]), children: c }) }),
|
|
1215
1215
|
/* @__PURE__ */ e(
|
|
1216
1216
|
"input",
|
|
1217
1217
|
{
|
|
1218
1218
|
ref: h,
|
|
1219
1219
|
id: C,
|
|
1220
|
-
className:
|
|
1220
|
+
className: x(
|
|
1221
1221
|
// Base styles
|
|
1222
1222
|
"block w-full rounded-lg border transition-colors duration-200 bg-input",
|
|
1223
1223
|
"placeholder:text-[var(--text-muted)] focus:outline-none focus:ring-1 focus:ring-offset-0",
|
|
@@ -1229,15 +1229,15 @@ const it = {
|
|
|
1229
1229
|
f && "pr-10",
|
|
1230
1230
|
// State styles
|
|
1231
1231
|
w ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default focus:border-primary focus:ring-primary",
|
|
1232
|
-
|
|
1232
|
+
m
|
|
1233
1233
|
),
|
|
1234
|
-
...
|
|
1234
|
+
...u
|
|
1235
1235
|
}
|
|
1236
1236
|
),
|
|
1237
|
-
(f ||
|
|
1237
|
+
(f || b) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: b ? /* @__PURE__ */ d(
|
|
1238
1238
|
"svg",
|
|
1239
1239
|
{
|
|
1240
|
-
className:
|
|
1240
|
+
className: x("animate-spin text-muted", be[n]),
|
|
1241
1241
|
fill: "none",
|
|
1242
1242
|
viewBox: "0 0 24 24",
|
|
1243
1243
|
children: [
|
|
@@ -1262,12 +1262,12 @@ const it = {
|
|
|
1262
1262
|
)
|
|
1263
1263
|
]
|
|
1264
1264
|
}
|
|
1265
|
-
) : f && /* @__PURE__ */ e("span", { className:
|
|
1265
|
+
) : f && /* @__PURE__ */ e("span", { className: x("text-muted", be[n]), children: f }) })
|
|
1266
1266
|
] }),
|
|
1267
1267
|
(r || a) && /* @__PURE__ */ e(
|
|
1268
1268
|
"p",
|
|
1269
1269
|
{
|
|
1270
|
-
className:
|
|
1270
|
+
className: x(
|
|
1271
1271
|
"mt-1 text-xs",
|
|
1272
1272
|
w ? "text-error" : "text-muted"
|
|
1273
1273
|
),
|
|
@@ -1286,9 +1286,9 @@ const oe = ({
|
|
|
1286
1286
|
onClick: s,
|
|
1287
1287
|
className: c,
|
|
1288
1288
|
"aria-label": f,
|
|
1289
|
-
...
|
|
1289
|
+
...b
|
|
1290
1290
|
}) => {
|
|
1291
|
-
const p = typeof a == "number" ? a : dt(a),
|
|
1291
|
+
const p = typeof a == "number" ? a : dt(a), g = x(
|
|
1292
1292
|
"inline-block",
|
|
1293
1293
|
// Color variants
|
|
1294
1294
|
{
|
|
@@ -1308,9 +1308,9 @@ const oe = ({
|
|
|
1308
1308
|
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/20 rounded": n
|
|
1309
1309
|
},
|
|
1310
1310
|
c
|
|
1311
|
-
),
|
|
1311
|
+
), m = {
|
|
1312
1312
|
size: p,
|
|
1313
|
-
className:
|
|
1313
|
+
className: g,
|
|
1314
1314
|
onClick: n ? s : void 0,
|
|
1315
1315
|
"aria-label": f,
|
|
1316
1316
|
role: n ? "button" : void 0,
|
|
@@ -1318,9 +1318,9 @@ const oe = ({
|
|
|
1318
1318
|
onKeyDown: n ? (l) => {
|
|
1319
1319
|
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), s?.());
|
|
1320
1320
|
} : void 0,
|
|
1321
|
-
...
|
|
1321
|
+
...b
|
|
1322
1322
|
};
|
|
1323
|
-
return /* @__PURE__ */ e(t, { ...
|
|
1323
|
+
return /* @__PURE__ */ e(t, { ...m });
|
|
1324
1324
|
};
|
|
1325
1325
|
function dt(t) {
|
|
1326
1326
|
return {
|
|
@@ -1337,15 +1337,15 @@ function ut({
|
|
|
1337
1337
|
tableColumns: r = 6,
|
|
1338
1338
|
tableRows: n = 8
|
|
1339
1339
|
}) {
|
|
1340
|
-
return t ? /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */ e("div", { className: "w-full max-w-6xl mx-auto animate-pulse", children: t }) }) : /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */
|
|
1341
|
-
!a && /* @__PURE__ */
|
|
1340
|
+
return t ? /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */ e("div", { className: "w-full max-w-6xl mx-auto animate-pulse", children: t }) }) : /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */ d("div", { className: "w-full mx-auto space-y-6 animate-pulse", children: [
|
|
1341
|
+
!a && /* @__PURE__ */ d(Ee, { children: [
|
|
1342
1342
|
/* @__PURE__ */ e("div", { className: "h-6 bg-neutral-container-emphasis rounded w-1/4" }),
|
|
1343
|
-
/* @__PURE__ */
|
|
1343
|
+
/* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
1344
1344
|
/* @__PURE__ */ e("div", { className: "h-4 bg-neutral-container-emphasis rounded w-3/4" }),
|
|
1345
1345
|
/* @__PURE__ */ e("div", { className: "h-4 bg-neutral-container-emphasis rounded w-1/2" })
|
|
1346
1346
|
] })
|
|
1347
1347
|
] }),
|
|
1348
|
-
a && /* @__PURE__ */
|
|
1348
|
+
a && /* @__PURE__ */ d("div", { className: "rounded-lg overflow-hidden", children: [
|
|
1349
1349
|
/* @__PURE__ */ e("div", { className: `grid grid-cols-${r} gap-2 bg-neutral-container p-3`, children: Array.from({ length: r }).map((s, c) => /* @__PURE__ */ e(
|
|
1350
1350
|
"div",
|
|
1351
1351
|
{
|
|
@@ -1357,12 +1357,12 @@ function ut({
|
|
|
1357
1357
|
"div",
|
|
1358
1358
|
{
|
|
1359
1359
|
className: `grid grid-cols-${r} gap-2 p-3 border-t border-neutral`,
|
|
1360
|
-
children: Array.from({ length: r }).map((f,
|
|
1360
|
+
children: Array.from({ length: r }).map((f, b) => /* @__PURE__ */ e(
|
|
1361
1361
|
"div",
|
|
1362
1362
|
{
|
|
1363
1363
|
className: "h-4 bg-neutral-container-emphasis rounded w-full"
|
|
1364
1364
|
},
|
|
1365
|
-
`cell-${c}-${
|
|
1365
|
+
`cell-${c}-${b}`
|
|
1366
1366
|
))
|
|
1367
1367
|
},
|
|
1368
1368
|
`row-${c}`
|
|
@@ -1378,70 +1378,73 @@ const mt = ({
|
|
|
1378
1378
|
placement: s = "bottom-start",
|
|
1379
1379
|
disabled: c = !1,
|
|
1380
1380
|
className: f,
|
|
1381
|
-
showCheck:
|
|
1381
|
+
showCheck: b = !0,
|
|
1382
1382
|
header: p
|
|
1383
1383
|
}) => {
|
|
1384
|
-
const [
|
|
1385
|
-
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1384
|
+
const [g, m] = V(!1), [l, u] = V(null), [h, C] = V({ top: 0, left: 0 }), [w, N] = V({}), I = X(null), v = X(null), q = X(null), B = X(null);
|
|
1385
|
+
K(() => {
|
|
1386
|
+
const i = (y) => {
|
|
1387
|
+
I.current && (!I.current.contains(y.target) || q.current && !q.current.contains(y.target)) && (m(!1), u(null), B.current && (clearTimeout(B.current), B.current = null));
|
|
1388
1388
|
};
|
|
1389
|
-
return
|
|
1390
|
-
document.removeEventListener("mousedown",
|
|
1389
|
+
return g && document.addEventListener("mousedown", i), () => {
|
|
1390
|
+
document.removeEventListener("mousedown", i);
|
|
1391
1391
|
};
|
|
1392
|
-
}, [
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1392
|
+
}, [g]), K(() => {
|
|
1393
|
+
const i = (y) => {
|
|
1394
|
+
y.key === "Escape" && (m(!1), u(null), B.current && (clearTimeout(B.current), B.current = null));
|
|
1395
1395
|
};
|
|
1396
|
-
return
|
|
1397
|
-
document.removeEventListener("keydown",
|
|
1396
|
+
return g && document.addEventListener("keydown", i), () => {
|
|
1397
|
+
document.removeEventListener("keydown", i);
|
|
1398
1398
|
};
|
|
1399
|
-
}, [
|
|
1400
|
-
if (l &&
|
|
1401
|
-
const
|
|
1399
|
+
}, [g]), K(() => {
|
|
1400
|
+
if (l && I.current) {
|
|
1401
|
+
const i = I.current.querySelector(
|
|
1402
1402
|
`[data-option-value="${l}"]`
|
|
1403
1403
|
);
|
|
1404
|
-
if (
|
|
1405
|
-
const
|
|
1404
|
+
if (i) {
|
|
1405
|
+
const y = i.getBoundingClientRect();
|
|
1406
1406
|
C({
|
|
1407
|
-
top:
|
|
1408
|
-
left:
|
|
1407
|
+
top: y.top,
|
|
1408
|
+
left: y.right + 8
|
|
1409
1409
|
});
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
}, [l]),
|
|
1413
|
-
|
|
1412
|
+
}, [l]), K(() => () => {
|
|
1413
|
+
B.current && clearTimeout(B.current);
|
|
1414
1414
|
}, []);
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
}, E = (v, T, m) => {
|
|
1426
|
-
v.stopPropagation(), !T.disabled && !T.divider && (n?.(T.value, m), u(!1), d(null));
|
|
1427
|
-
}, J = b(
|
|
1428
|
-
"absolute z-50 min-w-[200px] bg-module rounded-md shadow-xs border border-neutral",
|
|
1429
|
-
"max-h-60 overflow-auto",
|
|
1430
|
-
{
|
|
1431
|
-
"top-full left-0 mt-2": s === "bottom-start",
|
|
1432
|
-
"top-full right-0 mt-2": s === "bottom-end",
|
|
1433
|
-
"bottom-full left-0 mb-2": s === "top-start",
|
|
1434
|
-
"bottom-full right-0 mb-2": s === "top-end"
|
|
1415
|
+
const U = (i) => {
|
|
1416
|
+
if (i.stopPropagation(), !c) {
|
|
1417
|
+
if (!g) {
|
|
1418
|
+
const y = v.current?.getBoundingClientRect();
|
|
1419
|
+
if (y) {
|
|
1420
|
+
const L = {};
|
|
1421
|
+
s.startsWith("bottom") ? L.top = y.bottom + 6 : L.bottom = window.innerHeight - y.top + 6, s.endsWith("start") ? L.left = y.left : L.right = window.innerWidth - y.right, N(L);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
m(!g), u(null), B.current && (clearTimeout(B.current), B.current = null);
|
|
1435
1425
|
}
|
|
1436
|
-
|
|
1426
|
+
}, F = (i, y, $) => {
|
|
1427
|
+
i.stopPropagation(), !y.disabled && !y.divider && (!y.children || y.children.length === 0) && (n?.(y.value, $), m(!1), u(null));
|
|
1428
|
+
}, E = (i) => {
|
|
1429
|
+
B.current && (clearTimeout(B.current), B.current = null), i.children && i.children.length > 0 ? u(i.value) : u(null);
|
|
1430
|
+
}, J = (i) => {
|
|
1431
|
+
i.children && i.children.length > 0 ? B.current = setTimeout(() => {
|
|
1432
|
+
u(null);
|
|
1433
|
+
}, 150) : u(null);
|
|
1434
|
+
}, z = (i, y, $) => {
|
|
1435
|
+
i.stopPropagation(), !y.disabled && !y.divider && (n?.(y.value, $), m(!1), u(null));
|
|
1436
|
+
}, P = x(
|
|
1437
|
+
"fixed z-[60] min-w-[200px] bg-module rounded-md shadow-lg border border-neutral",
|
|
1438
|
+
"max-h-60 overflow-auto"
|
|
1439
|
+
), H = x(
|
|
1437
1440
|
"fixed z-[60] min-w-[200px] bg-module rounded-md shadow-lg border border-neutral",
|
|
1438
1441
|
"max-h-60 overflow-auto"
|
|
1439
1442
|
);
|
|
1440
|
-
return /* @__PURE__ */
|
|
1443
|
+
return /* @__PURE__ */ d(
|
|
1441
1444
|
"div",
|
|
1442
1445
|
{
|
|
1443
|
-
ref:
|
|
1444
|
-
className:
|
|
1446
|
+
ref: I,
|
|
1447
|
+
className: x(
|
|
1445
1448
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-neutral-container",
|
|
1446
1449
|
f
|
|
1447
1450
|
),
|
|
@@ -1449,128 +1452,128 @@ const mt = ({
|
|
|
1449
1452
|
/* @__PURE__ */ e(
|
|
1450
1453
|
"button",
|
|
1451
1454
|
{
|
|
1452
|
-
ref:
|
|
1453
|
-
onClick:
|
|
1455
|
+
ref: v,
|
|
1456
|
+
onClick: U,
|
|
1454
1457
|
disabled: c,
|
|
1455
|
-
className:
|
|
1458
|
+
className: x("inline-flex items-center justify-center", {
|
|
1456
1459
|
"opacity-50 cursor-not-allowed": c
|
|
1457
1460
|
}),
|
|
1458
1461
|
children: t
|
|
1459
1462
|
}
|
|
1460
1463
|
),
|
|
1461
|
-
|
|
1464
|
+
g && /* @__PURE__ */ e("div", { className: P, style: w, children: /* @__PURE__ */ d("div", { className: "p-2", children: [
|
|
1462
1465
|
p && (typeof p == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted uppercase tracking-wider px-3 py-2", children: p }) : p),
|
|
1463
|
-
a.map((
|
|
1464
|
-
if (
|
|
1466
|
+
a.map((i, y) => {
|
|
1467
|
+
if (i.divider)
|
|
1465
1468
|
return /* @__PURE__ */ e(
|
|
1466
1469
|
"div",
|
|
1467
1470
|
{
|
|
1468
1471
|
className: "border-t border-neutral my-2"
|
|
1469
1472
|
},
|
|
1470
|
-
`divider-${
|
|
1473
|
+
`divider-${y}`
|
|
1471
1474
|
);
|
|
1472
|
-
const
|
|
1473
|
-
return /* @__PURE__ */
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
+
const $ = i.children && i.children.length > 0, L = l === i.value;
|
|
1476
|
+
return /* @__PURE__ */ d("div", { className: "relative group", children: [
|
|
1477
|
+
/* @__PURE__ */ d(
|
|
1475
1478
|
"button",
|
|
1476
1479
|
{
|
|
1477
|
-
"data-option-value":
|
|
1478
|
-
onClick: (
|
|
1479
|
-
onMouseEnter: () =>
|
|
1480
|
-
onMouseLeave: () =>
|
|
1481
|
-
disabled:
|
|
1482
|
-
className:
|
|
1480
|
+
"data-option-value": i.value,
|
|
1481
|
+
onClick: (D) => F(D, i),
|
|
1482
|
+
onMouseEnter: () => E(i),
|
|
1483
|
+
onMouseLeave: () => J(i),
|
|
1484
|
+
disabled: i.disabled,
|
|
1485
|
+
className: x(
|
|
1483
1486
|
"w-full flex items-center justify-between px-3 py-2 text-sm text-default hover:bg-neutral-container rounded-md transition-colors",
|
|
1484
1487
|
{
|
|
1485
|
-
"opacity-50 cursor-not-allowed":
|
|
1486
|
-
"bg-neutral-container":
|
|
1488
|
+
"opacity-50 cursor-not-allowed": i.disabled,
|
|
1489
|
+
"bg-neutral-container": L && $
|
|
1487
1490
|
}
|
|
1488
1491
|
),
|
|
1489
1492
|
children: [
|
|
1490
|
-
/* @__PURE__ */
|
|
1491
|
-
|
|
1492
|
-
/* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
1494
|
-
|
|
1493
|
+
/* @__PURE__ */ d("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1494
|
+
i.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: i.icon }),
|
|
1495
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1496
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: i.label }),
|
|
1497
|
+
i.description && /* @__PURE__ */ e("span", { className: "text-xs text-muted", children: i.description })
|
|
1495
1498
|
] })
|
|
1496
1499
|
] }),
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
+
/* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
|
|
1501
|
+
b && r === i.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" }),
|
|
1502
|
+
$ && /* @__PURE__ */ e("span", { className: "text-muted text-xs", children: "▶" })
|
|
1500
1503
|
] })
|
|
1501
1504
|
]
|
|
1502
1505
|
}
|
|
1503
1506
|
),
|
|
1504
|
-
|
|
1507
|
+
$ && L && /* @__PURE__ */ e(
|
|
1505
1508
|
"div",
|
|
1506
1509
|
{
|
|
1507
|
-
ref:
|
|
1508
|
-
className:
|
|
1510
|
+
ref: q,
|
|
1511
|
+
className: H,
|
|
1509
1512
|
style: {
|
|
1510
1513
|
top: `${h.top}px`,
|
|
1511
1514
|
left: `${h.left}px`
|
|
1512
1515
|
},
|
|
1513
1516
|
onMouseEnter: () => {
|
|
1514
|
-
|
|
1517
|
+
B.current && (clearTimeout(B.current), B.current = null), u(i.value);
|
|
1515
1518
|
},
|
|
1516
1519
|
onMouseLeave: () => {
|
|
1517
|
-
|
|
1518
|
-
|
|
1520
|
+
B.current = setTimeout(() => {
|
|
1521
|
+
u(null);
|
|
1519
1522
|
}, 150);
|
|
1520
1523
|
},
|
|
1521
|
-
children: /* @__PURE__ */ e("div", { className: "p-2", children:
|
|
1522
|
-
if (
|
|
1524
|
+
children: /* @__PURE__ */ e("div", { className: "p-2", children: i.children.map((D, M) => {
|
|
1525
|
+
if (D.divider)
|
|
1523
1526
|
return /* @__PURE__ */ e(
|
|
1524
1527
|
"div",
|
|
1525
1528
|
{
|
|
1526
1529
|
className: "border-t border-neutral my-2"
|
|
1527
1530
|
},
|
|
1528
|
-
`divider-${
|
|
1531
|
+
`divider-${M}`
|
|
1529
1532
|
);
|
|
1530
|
-
const
|
|
1531
|
-
|
|
1532
|
-
) || r ===
|
|
1533
|
-
return /* @__PURE__ */
|
|
1533
|
+
const Q = typeof r == "object" && r[i.value] && r[i.value].includes(
|
|
1534
|
+
D.value
|
|
1535
|
+
) || r === D.value;
|
|
1536
|
+
return /* @__PURE__ */ d(
|
|
1534
1537
|
"button",
|
|
1535
1538
|
{
|
|
1536
|
-
onClick: (
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1539
|
+
onClick: (re) => z(
|
|
1540
|
+
re,
|
|
1541
|
+
D,
|
|
1542
|
+
i.value
|
|
1540
1543
|
),
|
|
1541
|
-
disabled:
|
|
1542
|
-
className:
|
|
1544
|
+
disabled: D.disabled,
|
|
1545
|
+
className: x(
|
|
1543
1546
|
"w-full flex items-center justify-between px-3 py-2 text-sm text-default hover:bg-neutral-container rounded-md transition-colors",
|
|
1544
1547
|
{
|
|
1545
|
-
"opacity-50 cursor-not-allowed":
|
|
1548
|
+
"opacity-50 cursor-not-allowed": D.disabled
|
|
1546
1549
|
}
|
|
1547
1550
|
),
|
|
1548
1551
|
children: [
|
|
1549
|
-
/* @__PURE__ */
|
|
1550
|
-
|
|
1551
|
-
/* @__PURE__ */
|
|
1552
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
1553
|
-
|
|
1552
|
+
/* @__PURE__ */ d("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1553
|
+
D.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: D.icon }),
|
|
1554
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1555
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: D.label }),
|
|
1556
|
+
D.description && /* @__PURE__ */ e("span", { className: "text-xs text-muted", children: D.description })
|
|
1554
1557
|
] })
|
|
1555
1558
|
] }),
|
|
1556
|
-
|
|
1559
|
+
b && Q && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" })
|
|
1557
1560
|
]
|
|
1558
1561
|
},
|
|
1559
|
-
|
|
1562
|
+
D.value
|
|
1560
1563
|
);
|
|
1561
1564
|
}) })
|
|
1562
1565
|
}
|
|
1563
1566
|
)
|
|
1564
|
-
] },
|
|
1567
|
+
] }, i.value);
|
|
1565
1568
|
}),
|
|
1566
1569
|
(() => {
|
|
1567
|
-
const
|
|
1568
|
-
if (
|
|
1569
|
-
const
|
|
1570
|
-
return
|
|
1570
|
+
const i = a.reduce((y, $) => {
|
|
1571
|
+
if ($.divider) return y;
|
|
1572
|
+
const L = $.children ? $.children.filter((D) => !D.divider).length : 0;
|
|
1573
|
+
return y + 1 + L;
|
|
1571
1574
|
}, 0);
|
|
1572
|
-
return
|
|
1573
|
-
|
|
1575
|
+
return i > 1 && /* @__PURE__ */ e("div", { className: "border-t border-neutral mt-2 pt-2", children: /* @__PURE__ */ d("div", { className: "text-xs text-muted px-3 py-1", children: [
|
|
1576
|
+
i,
|
|
1574
1577
|
" options available"
|
|
1575
1578
|
] }) });
|
|
1576
1579
|
})()
|
|
@@ -1598,7 +1601,7 @@ const mt = ({
|
|
|
1598
1601
|
), ht = ({ active: t }) => /* @__PURE__ */ e(
|
|
1599
1602
|
"svg",
|
|
1600
1603
|
{
|
|
1601
|
-
className:
|
|
1604
|
+
className: x(
|
|
1602
1605
|
"h-3 w-3",
|
|
1603
1606
|
t ? "text-default" : "text-muted"
|
|
1604
1607
|
),
|
|
@@ -1618,7 +1621,7 @@ const mt = ({
|
|
|
1618
1621
|
), pt = ({ active: t }) => /* @__PURE__ */ e(
|
|
1619
1622
|
"svg",
|
|
1620
1623
|
{
|
|
1621
|
-
className:
|
|
1624
|
+
className: x(
|
|
1622
1625
|
"h-3 w-3",
|
|
1623
1626
|
t ? "text-default" : "text-muted"
|
|
1624
1627
|
),
|
|
@@ -1733,15 +1736,15 @@ const mt = ({
|
|
|
1733
1736
|
placeholder: t.placeholder || `Select ${t.label.toLowerCase()}`,
|
|
1734
1737
|
className: "min-w-[160px] btn btn o__secondary"
|
|
1735
1738
|
}
|
|
1736
|
-
) }) : /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-[240px]", children: /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */
|
|
1737
|
-
/* @__PURE__ */
|
|
1739
|
+
) }) : /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-[240px]", children: /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ d("details", { className: "group", children: [
|
|
1740
|
+
/* @__PURE__ */ d("summary", { className: "flex items-center space-x-2 cursor-pointer rounded-full px-3 py-2 text-sm btn btn o__secondary", children: [
|
|
1738
1741
|
/* @__PURE__ */ e("span", { children: t.label }),
|
|
1739
1742
|
/* @__PURE__ */ e("span", { className: "text-default", children: t.multiSelect && Array.isArray(t.value) ? t.value?.map(
|
|
1740
1743
|
(n) => t.options?.find((s) => s.value === n)?.label
|
|
1741
1744
|
).join(", ") : t.options?.find((n) => n.value === t.value)?.label }),
|
|
1742
1745
|
/* @__PURE__ */ e("span", { className: "text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(De, {}) })
|
|
1743
1746
|
] }),
|
|
1744
|
-
/* @__PURE__ */
|
|
1747
|
+
/* @__PURE__ */ d("div", { className: "absolute z-10 left-0 mt-1 bg-module border border-neutral rounded-lg shadow-lvl-0 p-2 w-48", children: [
|
|
1745
1748
|
t.options?.map((n) => /* @__PURE__ */ e(
|
|
1746
1749
|
"button",
|
|
1747
1750
|
{
|
|
@@ -1750,7 +1753,7 @@ const mt = ({
|
|
|
1750
1753
|
children: /* @__PURE__ */ e(
|
|
1751
1754
|
"span",
|
|
1752
1755
|
{
|
|
1753
|
-
className:
|
|
1756
|
+
className: x(a(n.value) && "text-primary-500"),
|
|
1754
1757
|
children: n.label
|
|
1755
1758
|
}
|
|
1756
1759
|
)
|
|
@@ -1775,33 +1778,33 @@ const mt = ({
|
|
|
1775
1778
|
searchPlaceholder: s = "Search...",
|
|
1776
1779
|
filters: c = [],
|
|
1777
1780
|
paginated: f = !1,
|
|
1778
|
-
pageSizeOptions:
|
|
1781
|
+
pageSizeOptions: b = [10, 25, 50, 100],
|
|
1779
1782
|
defaultPageSize: p = 10,
|
|
1780
|
-
actions:
|
|
1781
|
-
onRowClick:
|
|
1783
|
+
actions: g = [],
|
|
1784
|
+
onRowClick: m,
|
|
1782
1785
|
selectable: l = !1,
|
|
1783
|
-
selectedRows:
|
|
1786
|
+
selectedRows: u = [],
|
|
1784
1787
|
onSelectionChange: h,
|
|
1785
|
-
getRowKey: C = (
|
|
1788
|
+
getRowKey: C = (U, F) => F,
|
|
1786
1789
|
emptyContent: w,
|
|
1787
1790
|
hoverable: N = !0,
|
|
1788
|
-
bordered:
|
|
1789
|
-
striped:
|
|
1791
|
+
bordered: I = !1,
|
|
1792
|
+
striped: v = !1,
|
|
1790
1793
|
className: q,
|
|
1791
|
-
rowClassName:
|
|
1794
|
+
rowClassName: B
|
|
1792
1795
|
}) => {
|
|
1793
|
-
const [
|
|
1796
|
+
const [U, F] = V(""), [E, J] = V({
|
|
1794
1797
|
column: null,
|
|
1795
1798
|
direction: null
|
|
1796
|
-
}), [z,
|
|
1799
|
+
}), [z, P] = V({
|
|
1797
1800
|
page: 0,
|
|
1798
1801
|
pageSize: p
|
|
1799
|
-
}),
|
|
1802
|
+
}), H = X(null), i = de(() => {
|
|
1800
1803
|
let o = t;
|
|
1801
|
-
if (n &&
|
|
1804
|
+
if (n && U.trim()) {
|
|
1802
1805
|
const k = a.filter(
|
|
1803
1806
|
(R) => R.searchable !== !1
|
|
1804
|
-
), _ =
|
|
1807
|
+
), _ = U.toLowerCase();
|
|
1805
1808
|
o = o.filter((R) => k.some((j) => {
|
|
1806
1809
|
const Y = typeof j.accessor == "function" ? j.accessor(R) : R[j.accessor];
|
|
1807
1810
|
return String(Y || "").toLowerCase().includes(_);
|
|
@@ -1815,81 +1818,81 @@ const mt = ({
|
|
|
1815
1818
|
return String(j || "") === k.value;
|
|
1816
1819
|
}));
|
|
1817
1820
|
}), o;
|
|
1818
|
-
}, [t,
|
|
1819
|
-
if (!E.column || !E.direction) return
|
|
1821
|
+
}, [t, U, a, n, c]), y = de(() => {
|
|
1822
|
+
if (!E.column || !E.direction) return i;
|
|
1820
1823
|
const o = a.find((k) => k.id === E.column);
|
|
1821
|
-
return o ? [...
|
|
1824
|
+
return o ? [...i].sort((k, _) => {
|
|
1822
1825
|
const R = typeof o.accessor == "function" ? o.accessor(k) : k[o.accessor], j = typeof o.accessor == "function" ? o.accessor(_) : _[o.accessor];
|
|
1823
1826
|
let Y = 0;
|
|
1824
1827
|
return R < j ? Y = -1 : R > j && (Y = 1), E.direction === "desc" ? -Y : Y;
|
|
1825
|
-
}) :
|
|
1826
|
-
}, [
|
|
1827
|
-
if (!f) return
|
|
1828
|
+
}) : i;
|
|
1829
|
+
}, [i, E, a]), $ = de(() => {
|
|
1830
|
+
if (!f) return y;
|
|
1828
1831
|
const o = z.page * z.pageSize, k = o + z.pageSize;
|
|
1829
|
-
return
|
|
1830
|
-
}, [
|
|
1832
|
+
return y.slice(o, k);
|
|
1833
|
+
}, [y, z, f]), L = ae(
|
|
1831
1834
|
(o) => {
|
|
1832
1835
|
a.find((_) => _.id === o)?.sortable && J((_) => _.column !== o ? { column: o, direction: "asc" } : _.direction === "asc" ? { column: o, direction: "desc" } : { column: null, direction: null });
|
|
1833
1836
|
},
|
|
1834
1837
|
[a]
|
|
1835
|
-
),
|
|
1836
|
-
|
|
1837
|
-
}, []), M =
|
|
1838
|
-
|
|
1839
|
-
}, []),
|
|
1838
|
+
), D = ae((o) => {
|
|
1839
|
+
P((k) => ({ ...k, page: o }));
|
|
1840
|
+
}, []), M = ae((o) => {
|
|
1841
|
+
P({ page: 0, pageSize: o });
|
|
1842
|
+
}, []), Q = ae(
|
|
1840
1843
|
(o, k) => {
|
|
1841
1844
|
if (!h) return;
|
|
1842
1845
|
const _ = C(o, 0);
|
|
1843
|
-
|
|
1844
|
-
(R, j) => C(
|
|
1846
|
+
u.map((R, j) => C(R, j)), h(k ? [...u, o] : u.filter(
|
|
1847
|
+
(R, j) => C(u[j], j) !== _
|
|
1845
1848
|
));
|
|
1846
1849
|
},
|
|
1847
|
-
[
|
|
1848
|
-
),
|
|
1850
|
+
[u, h, C]
|
|
1851
|
+
), re = ae(
|
|
1849
1852
|
(o) => {
|
|
1850
|
-
h && h(o ? [
|
|
1853
|
+
h && h(o ? [...$] : []);
|
|
1851
1854
|
},
|
|
1852
|
-
[
|
|
1855
|
+
[$, h]
|
|
1853
1856
|
);
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
}, [
|
|
1857
|
-
|
|
1857
|
+
K(() => {
|
|
1858
|
+
P((o) => ({ ...o, page: 0 }));
|
|
1859
|
+
}, [U, E]), K(() => {
|
|
1860
|
+
P((o) => ({ ...o, page: 0 }));
|
|
1858
1861
|
}, [c.map((o) => o.value).join(",")]);
|
|
1859
|
-
const W =
|
|
1862
|
+
const W = y.length, S = Math.ceil(W / z.pageSize), A = z.page * z.pageSize + 1, O = Math.min(A + z.pageSize - 1, W), T = $.length > 0 && $.every((o) => {
|
|
1860
1863
|
const k = C(o, 0);
|
|
1861
|
-
return
|
|
1864
|
+
return u.some(
|
|
1862
1865
|
(_, R) => C(_, R) === k
|
|
1863
1866
|
);
|
|
1864
|
-
}),
|
|
1867
|
+
}), ee = $.some((o) => {
|
|
1865
1868
|
const k = C(o, 0);
|
|
1866
|
-
return
|
|
1869
|
+
return u.some(
|
|
1867
1870
|
(_, R) => C(_, R) === k
|
|
1868
1871
|
);
|
|
1869
|
-
}),
|
|
1872
|
+
}), ne = x(
|
|
1870
1873
|
"w-full text-sm leading-5 text-[var(--text-default)] border-collapse",
|
|
1871
1874
|
q
|
|
1872
|
-
),
|
|
1875
|
+
), G = x("bg-[var(--base-module)]"), le = x(
|
|
1873
1876
|
"text-[var(--text-default)] p-3 border-b border-[var(--neutral-border)]"
|
|
1874
|
-
), fe =
|
|
1877
|
+
), fe = x("h-12", {
|
|
1875
1878
|
"hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]": N,
|
|
1876
|
-
"cursor-pointer":
|
|
1879
|
+
"cursor-pointer": m
|
|
1877
1880
|
});
|
|
1878
|
-
return /* @__PURE__ */
|
|
1879
|
-
(n || c.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */
|
|
1881
|
+
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
1882
|
+
(n || c.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */ d("div", { className: "flex flex-wrap gap-4 items-start", children: [
|
|
1880
1883
|
c.map((o) => /* @__PURE__ */ e(vt, { ...o }, o.id)),
|
|
1881
1884
|
/* @__PURE__ */ e("div", { className: "w-full sm:w-auto sm:ml-auto min-w-[200px]", children: /* @__PURE__ */ e(
|
|
1882
1885
|
ue,
|
|
1883
1886
|
{
|
|
1884
1887
|
placeholder: s,
|
|
1885
|
-
value:
|
|
1888
|
+
value: U,
|
|
1886
1889
|
onChange: (o) => F(o.target.value),
|
|
1887
1890
|
startIcon: /* @__PURE__ */ e(ft, {}),
|
|
1888
1891
|
className: "max-w-sm"
|
|
1889
1892
|
}
|
|
1890
1893
|
) })
|
|
1891
1894
|
] }) }),
|
|
1892
|
-
/* @__PURE__ */
|
|
1895
|
+
/* @__PURE__ */ d("div", { className: "relative w-full overflow-x-auto min-h-[400px]", children: [
|
|
1893
1896
|
r && /* @__PURE__ */ e("div", { className: "flex items-center justify-center z-10", children: /* @__PURE__ */ e(
|
|
1894
1897
|
ut,
|
|
1895
1898
|
{
|
|
@@ -1898,24 +1901,24 @@ const mt = ({
|
|
|
1898
1901
|
tableColumns: a.length
|
|
1899
1902
|
}
|
|
1900
1903
|
) }),
|
|
1901
|
-
/* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */ e("thead", { className:
|
|
1903
|
-
l && /* @__PURE__ */ e("th", { className:
|
|
1904
|
+
/* @__PURE__ */ d("table", { ref: H, className: x(ne, "min-w-full"), children: [
|
|
1905
|
+
/* @__PURE__ */ e("thead", { className: G, children: /* @__PURE__ */ d("tr", { children: [
|
|
1906
|
+
l && /* @__PURE__ */ e("th", { className: x(le, "w-12"), children: /* @__PURE__ */ e(
|
|
1904
1907
|
"input",
|
|
1905
1908
|
{
|
|
1906
1909
|
type: "checkbox",
|
|
1907
|
-
checked:
|
|
1910
|
+
checked: T,
|
|
1908
1911
|
ref: (o) => {
|
|
1909
|
-
o && (o.indeterminate =
|
|
1912
|
+
o && (o.indeterminate = ee && !T);
|
|
1910
1913
|
},
|
|
1911
|
-
onChange: (o) =>
|
|
1914
|
+
onChange: (o) => re(o.target.checked),
|
|
1912
1915
|
className: "rounded border-neutral"
|
|
1913
1916
|
}
|
|
1914
1917
|
) }),
|
|
1915
1918
|
!r && a.map((o) => /* @__PURE__ */ e(
|
|
1916
1919
|
"th",
|
|
1917
1920
|
{
|
|
1918
|
-
className:
|
|
1921
|
+
className: x(
|
|
1919
1922
|
le,
|
|
1920
1923
|
"font-semibold text-xs text-[var(--text-muted)] dark:text-[var(--text-muted)] uppercase tracking-wider",
|
|
1921
1924
|
"group",
|
|
@@ -1929,13 +1932,13 @@ const mt = ({
|
|
|
1929
1932
|
}
|
|
1930
1933
|
),
|
|
1931
1934
|
style: { width: o.width },
|
|
1932
|
-
onClick: () => o.sortable &&
|
|
1933
|
-
children: /* @__PURE__ */
|
|
1935
|
+
onClick: () => o.sortable && L(o.id),
|
|
1936
|
+
children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
1934
1937
|
o.headerCell ? o.headerCell() : o.header,
|
|
1935
|
-
o.sortable && /* @__PURE__ */
|
|
1938
|
+
o.sortable && /* @__PURE__ */ d(
|
|
1936
1939
|
"div",
|
|
1937
1940
|
{
|
|
1938
|
-
className:
|
|
1941
|
+
className: x(
|
|
1939
1942
|
"flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1940
1943
|
E.column === o.id && "opacity-100"
|
|
1941
1944
|
),
|
|
@@ -1959,32 +1962,32 @@ const mt = ({
|
|
|
1959
1962
|
},
|
|
1960
1963
|
o.id
|
|
1961
1964
|
)),
|
|
1962
|
-
|
|
1965
|
+
g.length > 0 && /* @__PURE__ */ e("th", { className: x(le, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
1963
1966
|
] }) }),
|
|
1964
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
1967
|
+
/* @__PURE__ */ e("tbody", { children: $.length === 0 || r ? !r && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1965
1968
|
"td",
|
|
1966
1969
|
{
|
|
1967
|
-
colSpan: a.length + (l ? 1 : 0) + (
|
|
1968
|
-
className:
|
|
1970
|
+
colSpan: a.length + (l ? 1 : 0) + (g.length > 0 ? 1 : 0),
|
|
1971
|
+
className: x(
|
|
1969
1972
|
le,
|
|
1970
1973
|
"text-center py-8 text-muted"
|
|
1971
1974
|
),
|
|
1972
1975
|
children: w || "No data available"
|
|
1973
1976
|
}
|
|
1974
|
-
) }) :
|
|
1975
|
-
const _ = C(o, k), R =
|
|
1977
|
+
) }) : $.map((o, k) => {
|
|
1978
|
+
const _ = C(o, k), R = u.some(
|
|
1976
1979
|
(j, Y) => C(j, Y) === _
|
|
1977
1980
|
);
|
|
1978
|
-
return /* @__PURE__ */
|
|
1981
|
+
return /* @__PURE__ */ d(
|
|
1979
1982
|
"tr",
|
|
1980
1983
|
{
|
|
1981
|
-
className:
|
|
1984
|
+
className: x(
|
|
1982
1985
|
fe,
|
|
1983
1986
|
{ "bg-accent-container": R },
|
|
1984
|
-
|
|
1987
|
+
B?.(o, k)
|
|
1985
1988
|
),
|
|
1986
1989
|
onClick: (j) => {
|
|
1987
|
-
j.stopPropagation(),
|
|
1990
|
+
j.stopPropagation(), m?.(o, k);
|
|
1988
1991
|
},
|
|
1989
1992
|
children: [
|
|
1990
1993
|
l && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
|
|
@@ -1993,7 +1996,7 @@ const mt = ({
|
|
|
1993
1996
|
type: "checkbox",
|
|
1994
1997
|
checked: R,
|
|
1995
1998
|
onChange: (j) => {
|
|
1996
|
-
j.stopPropagation(),
|
|
1999
|
+
j.stopPropagation(), Q(o, j.target.checked);
|
|
1997
2000
|
},
|
|
1998
2001
|
className: "rounded border-neutral"
|
|
1999
2002
|
}
|
|
@@ -2003,7 +2006,7 @@ const mt = ({
|
|
|
2003
2006
|
return /* @__PURE__ */ e(
|
|
2004
2007
|
"td",
|
|
2005
2008
|
{
|
|
2006
|
-
className:
|
|
2009
|
+
className: x(le, {
|
|
2007
2010
|
"text-left": j.align === "left" || !j.align,
|
|
2008
2011
|
"text-center": j.align === "center",
|
|
2009
2012
|
"text-right": j.align === "right",
|
|
@@ -2015,21 +2018,21 @@ const mt = ({
|
|
|
2015
2018
|
j.id
|
|
2016
2019
|
);
|
|
2017
2020
|
}),
|
|
2018
|
-
|
|
2021
|
+
g.length > 0 && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
|
|
2019
2022
|
mt,
|
|
2020
2023
|
{
|
|
2021
|
-
trigger: /* @__PURE__ */
|
|
2024
|
+
trigger: /* @__PURE__ */ d("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-muted hover:text-default", children: [
|
|
2022
2025
|
/* @__PURE__ */ e("span", { children: "Options" }),
|
|
2023
2026
|
/* @__PURE__ */ e(De, {})
|
|
2024
2027
|
] }),
|
|
2025
|
-
options:
|
|
2028
|
+
options: g.map((j) => ({
|
|
2026
2029
|
value: j.id,
|
|
2027
2030
|
label: j.label,
|
|
2028
2031
|
icon: j.icon,
|
|
2029
2032
|
disabled: j.disabled?.(o)
|
|
2030
2033
|
})),
|
|
2031
2034
|
onSelect: (j) => {
|
|
2032
|
-
const Y =
|
|
2035
|
+
const Y = g.find(
|
|
2033
2036
|
(he) => he.id === j
|
|
2034
2037
|
);
|
|
2035
2038
|
Y && Y.onClick(o, k);
|
|
@@ -2044,18 +2047,18 @@ const mt = ({
|
|
|
2044
2047
|
}) })
|
|
2045
2048
|
] })
|
|
2046
2049
|
] }),
|
|
2047
|
-
f && W > 0 && /* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2050
|
+
f && W > 0 && /* @__PURE__ */ d("div", { className: "flex items-center justify-between px-6", children: [
|
|
2051
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-4", children: [
|
|
2052
|
+
/* @__PURE__ */ d("span", { className: "text-sm text-muted", children: [
|
|
2050
2053
|
"Showing ",
|
|
2051
|
-
|
|
2054
|
+
A,
|
|
2052
2055
|
" to ",
|
|
2053
2056
|
O,
|
|
2054
2057
|
" of ",
|
|
2055
2058
|
W,
|
|
2056
2059
|
" results"
|
|
2057
2060
|
] }),
|
|
2058
|
-
/* @__PURE__ */
|
|
2061
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
2059
2062
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted", children: "Rows per page:" }),
|
|
2060
2063
|
/* @__PURE__ */ e(
|
|
2061
2064
|
"select",
|
|
@@ -2063,57 +2066,57 @@ const mt = ({
|
|
|
2063
2066
|
value: z.pageSize,
|
|
2064
2067
|
onChange: (o) => M(Number(o.target.value)),
|
|
2065
2068
|
className: "border border-[var(--neutral-border)] text-[var(--text-default)] rounded-md px-2 py-1 text-sm bg-[var(--base-input)] w-16",
|
|
2066
|
-
children:
|
|
2069
|
+
children: b.map((o) => /* @__PURE__ */ e("option", { value: o, children: o }, o))
|
|
2067
2070
|
}
|
|
2068
2071
|
)
|
|
2069
2072
|
] })
|
|
2070
2073
|
] }),
|
|
2071
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
|
|
2072
2075
|
/* @__PURE__ */ e(
|
|
2073
|
-
|
|
2076
|
+
te,
|
|
2074
2077
|
{
|
|
2075
2078
|
size: "sm",
|
|
2076
2079
|
variant: "ghost",
|
|
2077
|
-
onClick: () =>
|
|
2080
|
+
onClick: () => D(0),
|
|
2078
2081
|
disabled: z.page === 0,
|
|
2079
2082
|
iconOnly: !0,
|
|
2080
2083
|
children: /* @__PURE__ */ e(gt, {})
|
|
2081
2084
|
}
|
|
2082
2085
|
),
|
|
2083
2086
|
/* @__PURE__ */ e(
|
|
2084
|
-
|
|
2087
|
+
te,
|
|
2085
2088
|
{
|
|
2086
2089
|
size: "sm",
|
|
2087
2090
|
variant: "ghost",
|
|
2088
|
-
onClick: () =>
|
|
2091
|
+
onClick: () => D(z.page - 1),
|
|
2089
2092
|
disabled: z.page === 0,
|
|
2090
2093
|
iconOnly: !0,
|
|
2091
2094
|
children: /* @__PURE__ */ e(xt, {})
|
|
2092
2095
|
}
|
|
2093
2096
|
),
|
|
2094
|
-
/* @__PURE__ */
|
|
2097
|
+
/* @__PURE__ */ d("span", { className: "px-3 py-1 text-sm text-muted", children: [
|
|
2095
2098
|
"Page ",
|
|
2096
2099
|
z.page + 1,
|
|
2097
2100
|
" of ",
|
|
2098
2101
|
S
|
|
2099
2102
|
] }),
|
|
2100
2103
|
/* @__PURE__ */ e(
|
|
2101
|
-
|
|
2104
|
+
te,
|
|
2102
2105
|
{
|
|
2103
2106
|
size: "sm",
|
|
2104
2107
|
variant: "ghost",
|
|
2105
|
-
onClick: () =>
|
|
2108
|
+
onClick: () => D(z.page + 1),
|
|
2106
2109
|
disabled: z.page >= S - 1,
|
|
2107
2110
|
iconOnly: !0,
|
|
2108
2111
|
children: /* @__PURE__ */ e(bt, {})
|
|
2109
2112
|
}
|
|
2110
2113
|
),
|
|
2111
2114
|
/* @__PURE__ */ e(
|
|
2112
|
-
|
|
2115
|
+
te,
|
|
2113
2116
|
{
|
|
2114
2117
|
size: "sm",
|
|
2115
2118
|
variant: "ghost",
|
|
2116
|
-
onClick: () =>
|
|
2119
|
+
onClick: () => D(S - 1),
|
|
2117
2120
|
disabled: z.page >= S - 1,
|
|
2118
2121
|
iconOnly: !0,
|
|
2119
2122
|
children: /* @__PURE__ */ e(yt, {})
|
|
@@ -2128,15 +2131,15 @@ const mt = ({
|
|
|
2128
2131
|
onTabChange: r,
|
|
2129
2132
|
className: n
|
|
2130
2133
|
}) => {
|
|
2131
|
-
const [s, c] = V(t[0]?.id || ""), f = a || s,
|
|
2134
|
+
const [s, c] = V(t[0]?.id || ""), f = a || s, b = (p) => {
|
|
2132
2135
|
r ? r(p) : c(p);
|
|
2133
2136
|
};
|
|
2134
|
-
return /* @__PURE__ */ e("div", { className:
|
|
2137
|
+
return /* @__PURE__ */ e("div", { className: x("border-b border-neutral-200 dark:border-neutral-700", n), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((p) => /* @__PURE__ */ e(
|
|
2135
2138
|
"button",
|
|
2136
2139
|
{
|
|
2137
|
-
onClick: () => !p.disabled &&
|
|
2140
|
+
onClick: () => !p.disabled && b(p.id),
|
|
2138
2141
|
disabled: p.disabled,
|
|
2139
|
-
className:
|
|
2142
|
+
className: x(
|
|
2140
2143
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-200",
|
|
2141
2144
|
{
|
|
2142
2145
|
"border-primary text-primary": f === p.id,
|
|
@@ -2144,9 +2147,9 @@ const mt = ({
|
|
|
2144
2147
|
"border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": p.disabled
|
|
2145
2148
|
}
|
|
2146
2149
|
),
|
|
2147
|
-
children: /* @__PURE__ */
|
|
2150
|
+
children: /* @__PURE__ */ d("span", { className: "flex items-center gap-2", children: [
|
|
2148
2151
|
p.label,
|
|
2149
|
-
p.badge && /* @__PURE__ */ e("span", { className:
|
|
2152
|
+
p.badge && /* @__PURE__ */ e("span", { className: x(
|
|
2150
2153
|
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
|
2151
2154
|
f === p.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
|
|
2152
2155
|
), children: p.badge })
|
|
@@ -2163,14 +2166,14 @@ const mt = ({
|
|
|
2163
2166
|
size: c = "md",
|
|
2164
2167
|
className: f
|
|
2165
2168
|
}) => {
|
|
2166
|
-
const [
|
|
2169
|
+
const [b, p] = V(
|
|
2167
2170
|
a || r || t[0]?.id || ""
|
|
2168
|
-
),
|
|
2171
|
+
), g = r || b, m = (w) => {
|
|
2169
2172
|
n ? n(w) : p(w);
|
|
2170
2173
|
}, l = {
|
|
2171
|
-
activeTab:
|
|
2172
|
-
setActiveTab:
|
|
2173
|
-
},
|
|
2174
|
+
activeTab: g,
|
|
2175
|
+
setActiveTab: m
|
|
2176
|
+
}, u = t.find((w) => w.id === g), h = x(
|
|
2174
2177
|
"flex",
|
|
2175
2178
|
{
|
|
2176
2179
|
"border-b border-neutral-200 dark:border-neutral-700 px-2": s === "default" || s === "underline",
|
|
@@ -2180,7 +2183,7 @@ const mt = ({
|
|
|
2180
2183
|
},
|
|
2181
2184
|
f
|
|
2182
2185
|
), C = (w, N) => {
|
|
2183
|
-
const
|
|
2186
|
+
const I = "transition-colors duration-200 font-medium", v = {
|
|
2184
2187
|
"text-xs px-2 py-1": c === "sm",
|
|
2185
2188
|
"text-sm px-3 py-2": c === "md",
|
|
2186
2189
|
"text-base px-4 py-3": c === "lg"
|
|
@@ -2191,10 +2194,10 @@ const mt = ({
|
|
|
2191
2194
|
"rounded-md": s === "pills",
|
|
2192
2195
|
// Underline variant
|
|
2193
2196
|
"border-b-2 pb-2": s === "underline"
|
|
2194
|
-
},
|
|
2197
|
+
}, B = {
|
|
2195
2198
|
"opacity-50 cursor-not-allowed": w.disabled,
|
|
2196
2199
|
"cursor-pointer": !w.disabled
|
|
2197
|
-
},
|
|
2200
|
+
}, U = N ? {
|
|
2198
2201
|
"border-primary text-primary": s === "default" || s === "underline",
|
|
2199
2202
|
"bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": s === "pills"
|
|
2200
2203
|
} : {}, F = !N && !w.disabled ? {
|
|
@@ -2202,34 +2205,34 @@ const mt = ({
|
|
|
2202
2205
|
"text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "pills",
|
|
2203
2206
|
"border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": s === "underline"
|
|
2204
2207
|
} : {};
|
|
2205
|
-
return
|
|
2208
|
+
return x(I, v, q, B, U, F);
|
|
2206
2209
|
};
|
|
2207
|
-
return /* @__PURE__ */ e(Nt.Provider, { value: l, children: /* @__PURE__ */
|
|
2210
|
+
return /* @__PURE__ */ e(Nt.Provider, { value: l, children: /* @__PURE__ */ d("div", { children: [
|
|
2208
2211
|
/* @__PURE__ */ e("div", { className: h, role: "tablist", children: t.map((w) => /* @__PURE__ */ e(
|
|
2209
2212
|
"button",
|
|
2210
2213
|
{
|
|
2211
2214
|
type: "button",
|
|
2212
2215
|
role: "tab",
|
|
2213
|
-
"aria-selected":
|
|
2216
|
+
"aria-selected": g === w.id,
|
|
2214
2217
|
"aria-controls": `tabpanel-${w.id}`,
|
|
2215
2218
|
disabled: w.disabled,
|
|
2216
|
-
onClick: () => !w.disabled &&
|
|
2217
|
-
className: C(w,
|
|
2218
|
-
children: /* @__PURE__ */
|
|
2219
|
+
onClick: () => !w.disabled && m(w.id),
|
|
2220
|
+
className: C(w, g === w.id),
|
|
2221
|
+
children: /* @__PURE__ */ d("span", { className: "flex items-center gap-2", children: [
|
|
2219
2222
|
w.label,
|
|
2220
2223
|
w.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: w.badge })
|
|
2221
2224
|
] })
|
|
2222
2225
|
},
|
|
2223
2226
|
w.id
|
|
2224
2227
|
)) }),
|
|
2225
|
-
|
|
2228
|
+
u?.content && /* @__PURE__ */ e(
|
|
2226
2229
|
"div",
|
|
2227
2230
|
{
|
|
2228
2231
|
role: "tabpanel",
|
|
2229
|
-
id: `tabpanel-${
|
|
2230
|
-
"aria-labelledby": `tab-${
|
|
2232
|
+
id: `tabpanel-${g}`,
|
|
2233
|
+
"aria-labelledby": `tab-${g}`,
|
|
2231
2234
|
className: "mt-4",
|
|
2232
|
-
children:
|
|
2235
|
+
children: u.content
|
|
2233
2236
|
}
|
|
2234
2237
|
)
|
|
2235
2238
|
] }) });
|
|
@@ -2248,19 +2251,19 @@ function Ct({
|
|
|
2248
2251
|
closeOnBackdropClick: s = !0,
|
|
2249
2252
|
closeOnEscape: c = !0,
|
|
2250
2253
|
className: f,
|
|
2251
|
-
backdropClassName:
|
|
2254
|
+
backdropClassName: b,
|
|
2252
2255
|
children: p,
|
|
2253
|
-
footer:
|
|
2254
|
-
showCloseButton:
|
|
2256
|
+
footer: g,
|
|
2257
|
+
showCloseButton: m = !0
|
|
2255
2258
|
}) {
|
|
2256
|
-
const l = X(null),
|
|
2257
|
-
|
|
2259
|
+
const l = X(null), u = X(null);
|
|
2260
|
+
K(() => {
|
|
2258
2261
|
if (!t || !c) return;
|
|
2259
2262
|
const C = (w) => {
|
|
2260
2263
|
w.key === "Escape" && a();
|
|
2261
2264
|
};
|
|
2262
2265
|
return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
|
|
2263
|
-
}, [t, c, a]),
|
|
2266
|
+
}, [t, c, a]), K(() => (t ? (u.current = document.activeElement, l.current && l.current.focus(), document.body.style.overflow = "hidden") : (u.current && u.current.focus(), document.body.style.overflow = ""), () => {
|
|
2264
2267
|
document.body.style.overflow = "";
|
|
2265
2268
|
}), [t]);
|
|
2266
2269
|
const h = (C) => {
|
|
@@ -2269,18 +2272,18 @@ function Ct({
|
|
|
2269
2272
|
return t ? /* @__PURE__ */ e(
|
|
2270
2273
|
"div",
|
|
2271
2274
|
{
|
|
2272
|
-
className:
|
|
2275
|
+
className: x(
|
|
2273
2276
|
"fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
2274
2277
|
"bg-black/20",
|
|
2275
2278
|
// 'animate-fade-in',
|
|
2276
|
-
|
|
2279
|
+
b
|
|
2277
2280
|
),
|
|
2278
2281
|
onClick: h,
|
|
2279
|
-
children: /* @__PURE__ */
|
|
2282
|
+
children: /* @__PURE__ */ d(
|
|
2280
2283
|
"div",
|
|
2281
2284
|
{
|
|
2282
2285
|
ref: l,
|
|
2283
|
-
className:
|
|
2286
|
+
className: x(
|
|
2284
2287
|
"relative w-full bg-module rounded-modal shadow-modal rounded-md",
|
|
2285
2288
|
// 'animate-scale-in',
|
|
2286
2289
|
"focus:outline-none",
|
|
@@ -2292,7 +2295,7 @@ function Ct({
|
|
|
2292
2295
|
"aria-labelledby": r ? "modal-title" : void 0,
|
|
2293
2296
|
tabIndex: -1,
|
|
2294
2297
|
children: [
|
|
2295
|
-
(r ||
|
|
2298
|
+
(r || m) && /* @__PURE__ */ d("div", { className: "flex items-center justify-between p-6 pb-0", children: [
|
|
2296
2299
|
r && /* @__PURE__ */ e(
|
|
2297
2300
|
"span",
|
|
2298
2301
|
{
|
|
@@ -2301,7 +2304,7 @@ function Ct({
|
|
|
2301
2304
|
children: r
|
|
2302
2305
|
}
|
|
2303
2306
|
),
|
|
2304
|
-
|
|
2307
|
+
m && /* @__PURE__ */ e(
|
|
2305
2308
|
"button",
|
|
2306
2309
|
{
|
|
2307
2310
|
onClick: a,
|
|
@@ -2312,7 +2315,7 @@ function Ct({
|
|
|
2312
2315
|
)
|
|
2313
2316
|
] }),
|
|
2314
2317
|
/* @__PURE__ */ e("div", { className: "p-6", children: p }),
|
|
2315
|
-
|
|
2318
|
+
g && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: g })
|
|
2316
2319
|
]
|
|
2317
2320
|
}
|
|
2318
2321
|
)
|
|
@@ -2327,14 +2330,14 @@ const Z = ({
|
|
|
2327
2330
|
align: s = "left",
|
|
2328
2331
|
truncate: c = !1,
|
|
2329
2332
|
italic: f = !1,
|
|
2330
|
-
underline:
|
|
2333
|
+
underline: b = !1,
|
|
2331
2334
|
lineHeight: p = "normal",
|
|
2332
|
-
as:
|
|
2333
|
-
className:
|
|
2335
|
+
as: g,
|
|
2336
|
+
className: m,
|
|
2334
2337
|
children: l,
|
|
2335
|
-
...
|
|
2338
|
+
...u
|
|
2336
2339
|
}) => {
|
|
2337
|
-
const h =
|
|
2340
|
+
const h = g || St(t), C = x(
|
|
2338
2341
|
// Base styles
|
|
2339
2342
|
"font-primary",
|
|
2340
2343
|
// Variant styles
|
|
@@ -2392,12 +2395,12 @@ const Z = ({
|
|
|
2392
2395
|
// Text decorations
|
|
2393
2396
|
{
|
|
2394
2397
|
italic: f,
|
|
2395
|
-
underline:
|
|
2398
|
+
underline: b,
|
|
2396
2399
|
truncate: c
|
|
2397
2400
|
},
|
|
2398
|
-
|
|
2401
|
+
m
|
|
2399
2402
|
);
|
|
2400
|
-
return /* @__PURE__ */ e(h, { className: C, ...
|
|
2403
|
+
return /* @__PURE__ */ e(h, { className: C, ...u, children: l });
|
|
2401
2404
|
};
|
|
2402
2405
|
function St(t) {
|
|
2403
2406
|
return {
|
|
@@ -2415,20 +2418,20 @@ const Lt = ({
|
|
|
2415
2418
|
error: s,
|
|
2416
2419
|
disabled: c,
|
|
2417
2420
|
accept: f,
|
|
2418
|
-
onListFiles:
|
|
2421
|
+
onListFiles: b,
|
|
2419
2422
|
onListMounts: p,
|
|
2420
|
-
onUploadFile:
|
|
2421
|
-
onDownloadFile:
|
|
2423
|
+
onUploadFile: g,
|
|
2424
|
+
onDownloadFile: m,
|
|
2422
2425
|
onRegisterFile: l
|
|
2423
2426
|
}) => {
|
|
2424
|
-
const [
|
|
2427
|
+
const [u, h] = V(!1), [C, w] = V([]), [N, I] = V(null), [v, q] = V("/"), [B, U] = V([]), [F, E] = V(!1), [J, z] = V(""), [P, H] = V(
|
|
2425
2428
|
typeof t == "object" ? t : null
|
|
2426
|
-
), [
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
}, [
|
|
2430
|
-
|
|
2431
|
-
}, [
|
|
2429
|
+
), [i, y] = V(!1), [$, L] = V(""), D = X(null);
|
|
2430
|
+
K(() => {
|
|
2431
|
+
u && M();
|
|
2432
|
+
}, [u]), K(() => {
|
|
2433
|
+
u && N && Q();
|
|
2434
|
+
}, [u, N, v, J]);
|
|
2432
2435
|
const M = async () => {
|
|
2433
2436
|
E(!0);
|
|
2434
2437
|
try {
|
|
@@ -2439,19 +2442,19 @@ const Lt = ({
|
|
|
2439
2442
|
} finally {
|
|
2440
2443
|
E(!1);
|
|
2441
2444
|
}
|
|
2442
|
-
},
|
|
2445
|
+
}, Q = async () => {
|
|
2443
2446
|
if (N) {
|
|
2444
2447
|
E(!0);
|
|
2445
2448
|
try {
|
|
2446
|
-
const o = await
|
|
2447
|
-
o?.data &&
|
|
2449
|
+
const o = await b?.({ mountId: N.id, name: J, path: v });
|
|
2450
|
+
o?.data && U(o.data);
|
|
2448
2451
|
} catch (o) {
|
|
2449
2452
|
console.error("Failed to load files", o);
|
|
2450
2453
|
} finally {
|
|
2451
2454
|
E(!1);
|
|
2452
2455
|
}
|
|
2453
2456
|
}
|
|
2454
|
-
},
|
|
2457
|
+
}, re = async (o) => {
|
|
2455
2458
|
const k = o.target.files?.[0];
|
|
2456
2459
|
if (k) {
|
|
2457
2460
|
E(!0);
|
|
@@ -2467,7 +2470,7 @@ const Lt = ({
|
|
|
2467
2470
|
providerKey: k.name,
|
|
2468
2471
|
ownerId: "me"
|
|
2469
2472
|
};
|
|
2470
|
-
|
|
2473
|
+
H(j), a(j, R), h(!1);
|
|
2471
2474
|
} catch (_) {
|
|
2472
2475
|
console.error("Local file selection failed", _);
|
|
2473
2476
|
} finally {
|
|
@@ -2479,16 +2482,16 @@ const Lt = ({
|
|
|
2479
2482
|
if (!(!k || !N)) {
|
|
2480
2483
|
E(!0);
|
|
2481
2484
|
try {
|
|
2482
|
-
const _ = await k.arrayBuffer(), R = await
|
|
2485
|
+
const _ = await k.arrayBuffer(), R = await g?.({
|
|
2483
2486
|
file: new Uint8Array(_),
|
|
2484
2487
|
filename: k.name,
|
|
2485
2488
|
mimeType: k.type || "application/octet-stream",
|
|
2486
2489
|
mountId: N.id,
|
|
2487
|
-
path:
|
|
2490
|
+
path: v
|
|
2488
2491
|
});
|
|
2489
2492
|
if (R?.data) {
|
|
2490
2493
|
const j = R.data;
|
|
2491
|
-
|
|
2494
|
+
H(j), a(j, new Uint8Array(_)), h(!1);
|
|
2492
2495
|
}
|
|
2493
2496
|
} catch (_) {
|
|
2494
2497
|
console.error("Upload failed", _);
|
|
@@ -2497,74 +2500,74 @@ const Lt = ({
|
|
|
2497
2500
|
}
|
|
2498
2501
|
}
|
|
2499
2502
|
}, S = async () => {
|
|
2500
|
-
if (!(
|
|
2503
|
+
if (!(!$ || !N)) {
|
|
2501
2504
|
E(!0);
|
|
2502
2505
|
try {
|
|
2503
|
-
const o = `${
|
|
2506
|
+
const o = `${v}${$}/`;
|
|
2504
2507
|
l && (await l({
|
|
2505
|
-
name:
|
|
2508
|
+
name: $,
|
|
2506
2509
|
type: "folder",
|
|
2507
|
-
path:
|
|
2510
|
+
path: v,
|
|
2508
2511
|
mimeType: "application/x-directory",
|
|
2509
2512
|
size: 0,
|
|
2510
2513
|
mountId: N.id,
|
|
2511
2514
|
providerKey: o,
|
|
2512
2515
|
ownerId: "me"
|
|
2513
|
-
}), await
|
|
2516
|
+
}), await Q()), y(!1), L("");
|
|
2514
2517
|
} catch (o) {
|
|
2515
2518
|
console.error("Failed to create folder", o);
|
|
2516
2519
|
} finally {
|
|
2517
2520
|
E(!1);
|
|
2518
2521
|
}
|
|
2519
2522
|
}
|
|
2520
|
-
},
|
|
2523
|
+
}, A = async (o) => {
|
|
2521
2524
|
E(!0);
|
|
2522
2525
|
try {
|
|
2523
|
-
const k = await
|
|
2524
|
-
|
|
2526
|
+
const k = await m?.(o.id);
|
|
2527
|
+
H(o), a(o, k), h(!1);
|
|
2525
2528
|
} catch (k) {
|
|
2526
2529
|
console.error("Failed to download file", k);
|
|
2527
2530
|
} finally {
|
|
2528
2531
|
E(!1);
|
|
2529
2532
|
}
|
|
2530
2533
|
}, O = (o) => {
|
|
2531
|
-
o.stopPropagation(),
|
|
2532
|
-
},
|
|
2534
|
+
o.stopPropagation(), H(null), a(null);
|
|
2535
|
+
}, T = de(() => {
|
|
2533
2536
|
const o = /* @__PURE__ */ new Set(), k = [];
|
|
2534
|
-
return
|
|
2537
|
+
return B.forEach((_) => {
|
|
2535
2538
|
if (_.type === "folder") {
|
|
2536
|
-
_.path ===
|
|
2539
|
+
_.path === v && o.add(_.name);
|
|
2537
2540
|
return;
|
|
2538
2541
|
}
|
|
2539
|
-
const R = _.providerKey || _.name, Y = (
|
|
2542
|
+
const R = _.providerKey || _.name, Y = (v ? R.substring(v.length) : R).split("/").filter((he) => he !== "");
|
|
2540
2543
|
Y.length > 1 ? o.add(Y[0]) : Y.length === 1 && k.push(_);
|
|
2541
2544
|
}), {
|
|
2542
2545
|
folders: Array.from(o).sort(),
|
|
2543
2546
|
files: k.sort((_, R) => _.name.localeCompare(R.name))
|
|
2544
2547
|
};
|
|
2545
|
-
}, [
|
|
2548
|
+
}, [B, v]), ee = (o) => {
|
|
2546
2549
|
q((k) => `${k}${o}/`);
|
|
2547
|
-
},
|
|
2548
|
-
const o =
|
|
2550
|
+
}, ne = () => {
|
|
2551
|
+
const o = v.split("/").filter((k) => k !== "");
|
|
2549
2552
|
o.pop(), o.length === 0 ? q("/") : q(`${o.join("/")}/`);
|
|
2550
|
-
},
|
|
2551
|
-
const o =
|
|
2553
|
+
}, G = de(() => {
|
|
2554
|
+
const o = T.folders.map((k) => ({
|
|
2552
2555
|
id: `folder-${k}`,
|
|
2553
2556
|
name: k,
|
|
2554
2557
|
type: "folder"
|
|
2555
2558
|
}));
|
|
2556
|
-
return
|
|
2559
|
+
return T.files.forEach((k) => {
|
|
2557
2560
|
o.push({
|
|
2558
2561
|
...k,
|
|
2559
2562
|
type: "file"
|
|
2560
2563
|
});
|
|
2561
2564
|
}), o;
|
|
2562
|
-
}, [
|
|
2565
|
+
}, [T]), le = [
|
|
2563
2566
|
{
|
|
2564
2567
|
id: "name",
|
|
2565
2568
|
header: "Name",
|
|
2566
2569
|
accessor: "name",
|
|
2567
|
-
cell: (o, k) => /* @__PURE__ */
|
|
2570
|
+
cell: (o, k) => /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
2568
2571
|
/* @__PURE__ */ e(
|
|
2569
2572
|
oe,
|
|
2570
2573
|
{
|
|
@@ -2573,7 +2576,7 @@ const Lt = ({
|
|
|
2573
2576
|
color: k.type === "folder" ? "warning" : "secondary"
|
|
2574
2577
|
}
|
|
2575
2578
|
),
|
|
2576
|
-
/* @__PURE__ */ e("span", { className:
|
|
2579
|
+
/* @__PURE__ */ e("span", { className: x(k.type === "folder" && "font-medium"), children: o })
|
|
2577
2580
|
] })
|
|
2578
2581
|
},
|
|
2579
2582
|
{
|
|
@@ -2592,14 +2595,14 @@ const Lt = ({
|
|
|
2592
2595
|
accessor: "id",
|
|
2593
2596
|
align: "right",
|
|
2594
2597
|
cell: (o, k) => /* @__PURE__ */ e(
|
|
2595
|
-
|
|
2598
|
+
te,
|
|
2596
2599
|
{
|
|
2597
2600
|
size: "sm",
|
|
2598
2601
|
variant: "outline",
|
|
2599
2602
|
onClick: (_) => {
|
|
2600
|
-
_.stopPropagation(), k.type === "folder" ?
|
|
2603
|
+
_.stopPropagation(), k.type === "folder" ? ee(k.name) : A(k);
|
|
2601
2604
|
},
|
|
2602
|
-
loading: F && k.type === "file" &&
|
|
2605
|
+
loading: F && k.type === "file" && P?.id === k.id,
|
|
2603
2606
|
children: k.type === "folder" ? "Open" : "Select"
|
|
2604
2607
|
}
|
|
2605
2608
|
)
|
|
@@ -2609,7 +2612,7 @@ const Lt = ({
|
|
|
2609
2612
|
id: "name",
|
|
2610
2613
|
header: "Mount Name",
|
|
2611
2614
|
accessor: "name",
|
|
2612
|
-
cell: (o) => /* @__PURE__ */
|
|
2615
|
+
cell: (o) => /* @__PURE__ */ d("div", { className: "flex items-center gap-2 font-medium", children: [
|
|
2613
2616
|
/* @__PURE__ */ e(oe, { icon: ke, size: "sm", color: "primary" }),
|
|
2614
2617
|
/* @__PURE__ */ e("span", { children: o })
|
|
2615
2618
|
] })
|
|
@@ -2619,25 +2622,25 @@ const Lt = ({
|
|
|
2619
2622
|
header: "",
|
|
2620
2623
|
accessor: "id",
|
|
2621
2624
|
align: "right",
|
|
2622
|
-
cell: (o, k) => /* @__PURE__ */ e(
|
|
2625
|
+
cell: (o, k) => /* @__PURE__ */ e(te, { size: "sm", variant: "outline", onClick: () => I(k), children: "Open" })
|
|
2623
2626
|
}
|
|
2624
2627
|
];
|
|
2625
|
-
return /* @__PURE__ */
|
|
2628
|
+
return /* @__PURE__ */ d("div", { className: "space-y-1", children: [
|
|
2626
2629
|
r && /* @__PURE__ */ e(Z, { variant: "label", size: "sm", weight: "medium", children: r }),
|
|
2627
|
-
/* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ d(
|
|
2628
2631
|
"div",
|
|
2629
2632
|
{
|
|
2630
2633
|
onClick: () => !c && h(!0),
|
|
2631
|
-
className:
|
|
2634
|
+
className: x(
|
|
2632
2635
|
"flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
|
|
2633
2636
|
"hover:border-primary-400 bg-module",
|
|
2634
2637
|
s ? "border-error" : "border-neutral",
|
|
2635
2638
|
c && "opacity-50 cursor-not-allowed bg-module-subtle"
|
|
2636
2639
|
),
|
|
2637
2640
|
children: [
|
|
2638
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon:
|
|
2639
|
-
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children:
|
|
2640
|
-
|
|
2641
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: P ? pe : ke, color: P ? "primary" : "secondary" }) }),
|
|
2642
|
+
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: P ? /* @__PURE__ */ e("span", { className: "text-sm text-default font-medium", children: P.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-muted", children: n }) }),
|
|
2643
|
+
P && !c && /* @__PURE__ */ e(
|
|
2641
2644
|
"button",
|
|
2642
2645
|
{
|
|
2643
2646
|
onClick: O,
|
|
@@ -2652,9 +2655,9 @@ const Lt = ({
|
|
|
2652
2655
|
/* @__PURE__ */ e(
|
|
2653
2656
|
Ct,
|
|
2654
2657
|
{
|
|
2655
|
-
open:
|
|
2658
|
+
open: u,
|
|
2656
2659
|
onClose: () => {
|
|
2657
|
-
h(!1),
|
|
2660
|
+
h(!1), I(null), q("/"), y(!1);
|
|
2658
2661
|
},
|
|
2659
2662
|
title: N ? `Explorer: ${N.name}` : "Select Storage Mount",
|
|
2660
2663
|
size: "lg",
|
|
@@ -2666,21 +2669,21 @@ const Lt = ({
|
|
|
2666
2669
|
{
|
|
2667
2670
|
id: "remote",
|
|
2668
2671
|
label: "Platform Storage",
|
|
2669
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: N ? /* @__PURE__ */
|
|
2670
|
-
/* @__PURE__ */
|
|
2672
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: N ? /* @__PURE__ */ d(Ee, { children: [
|
|
2673
|
+
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2671
2674
|
/* @__PURE__ */ e(
|
|
2672
|
-
|
|
2675
|
+
te,
|
|
2673
2676
|
{
|
|
2674
2677
|
variant: "ghost",
|
|
2675
2678
|
size: "sm",
|
|
2676
2679
|
onClick: () => {
|
|
2677
|
-
|
|
2680
|
+
v && v !== "/" ? ne() : I(null);
|
|
2678
2681
|
},
|
|
2679
2682
|
leftIcon: /* @__PURE__ */ e(oe, { icon: we, size: "xs" }),
|
|
2680
|
-
children:
|
|
2683
|
+
children: v ? "Back" : "Back to Mounts"
|
|
2681
2684
|
}
|
|
2682
2685
|
),
|
|
2683
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-muted overflow-hidden bg-neutral-container px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2686
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-muted overflow-hidden bg-neutral-container px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children: v }) }),
|
|
2684
2687
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-[150px]", children: /* @__PURE__ */ e(
|
|
2685
2688
|
ue,
|
|
2686
2689
|
{
|
|
@@ -2692,23 +2695,23 @@ const Lt = ({
|
|
|
2692
2695
|
size: "sm"
|
|
2693
2696
|
}
|
|
2694
2697
|
) }),
|
|
2695
|
-
/* @__PURE__ */
|
|
2698
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
|
|
2696
2699
|
/* @__PURE__ */ e(
|
|
2697
|
-
|
|
2700
|
+
te,
|
|
2698
2701
|
{
|
|
2699
2702
|
variant: "outline",
|
|
2700
2703
|
size: "sm",
|
|
2701
|
-
onClick: () =>
|
|
2704
|
+
onClick: () => y(!0),
|
|
2702
2705
|
leftIcon: /* @__PURE__ */ e(oe, { icon: Fe, size: "xs" }),
|
|
2703
2706
|
children: "New Folder"
|
|
2704
2707
|
}
|
|
2705
2708
|
),
|
|
2706
2709
|
/* @__PURE__ */ e(
|
|
2707
|
-
|
|
2710
|
+
te,
|
|
2708
2711
|
{
|
|
2709
2712
|
variant: "primary",
|
|
2710
2713
|
size: "sm",
|
|
2711
|
-
onClick: () =>
|
|
2714
|
+
onClick: () => D.current?.click(),
|
|
2712
2715
|
leftIcon: /* @__PURE__ */ e(oe, { icon: We, size: "xs" }),
|
|
2713
2716
|
loading: F,
|
|
2714
2717
|
children: "Upload"
|
|
@@ -2719,36 +2722,36 @@ const Lt = ({
|
|
|
2719
2722
|
{
|
|
2720
2723
|
type: "file",
|
|
2721
2724
|
className: "hidden",
|
|
2722
|
-
ref:
|
|
2725
|
+
ref: D,
|
|
2723
2726
|
onChange: W,
|
|
2724
2727
|
accept: f
|
|
2725
2728
|
}
|
|
2726
2729
|
)
|
|
2727
2730
|
] })
|
|
2728
2731
|
] }),
|
|
2729
|
-
|
|
2732
|
+
i && /* @__PURE__ */ d("div", { className: "flex items-center gap-2 p-3 bg-module-subtle rounded-lg border border-neutral", children: [
|
|
2730
2733
|
/* @__PURE__ */ e(oe, { icon: Ce, size: "sm", color: "warning" }),
|
|
2731
2734
|
/* @__PURE__ */ e(
|
|
2732
2735
|
ue,
|
|
2733
2736
|
{
|
|
2734
2737
|
size: "sm",
|
|
2735
2738
|
placeholder: "Folder name",
|
|
2736
|
-
value:
|
|
2737
|
-
onChange: (o) =>
|
|
2739
|
+
value: $,
|
|
2740
|
+
onChange: (o) => L(o.target.value),
|
|
2738
2741
|
autoFocus: !0
|
|
2739
2742
|
}
|
|
2740
2743
|
),
|
|
2741
|
-
/* @__PURE__ */ e(
|
|
2742
|
-
/* @__PURE__ */ e(
|
|
2744
|
+
/* @__PURE__ */ e(te, { size: "sm", onClick: S, loading: F, children: "Create" }),
|
|
2745
|
+
/* @__PURE__ */ e(te, { size: "sm", variant: "ghost", onClick: () => y(!1), children: "Cancel" })
|
|
2743
2746
|
] }),
|
|
2744
2747
|
/* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral", children: /* @__PURE__ */ e(
|
|
2745
2748
|
Le,
|
|
2746
2749
|
{
|
|
2747
|
-
data:
|
|
2750
|
+
data: G,
|
|
2748
2751
|
columns: le,
|
|
2749
2752
|
loading: F,
|
|
2750
2753
|
emptyContent: "This folder is empty",
|
|
2751
|
-
onRowClick: (o) => o.type === "folder" ?
|
|
2754
|
+
onRowClick: (o) => o.type === "folder" ? ee(o.name) : A(o)
|
|
2752
2755
|
}
|
|
2753
2756
|
) })
|
|
2754
2757
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral", children: /* @__PURE__ */ e(
|
|
@@ -2758,27 +2761,27 @@ const Lt = ({
|
|
|
2758
2761
|
columns: fe,
|
|
2759
2762
|
loading: F,
|
|
2760
2763
|
emptyContent: "No storage mounts configured",
|
|
2761
|
-
onRowClick: (o) =>
|
|
2764
|
+
onRowClick: (o) => I(o)
|
|
2762
2765
|
}
|
|
2763
2766
|
) }) })
|
|
2764
2767
|
},
|
|
2765
2768
|
{
|
|
2766
2769
|
id: "local",
|
|
2767
2770
|
label: "Local File",
|
|
2768
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */
|
|
2771
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-neutral rounded-xl bg-module-subtle/50", children: [
|
|
2769
2772
|
/* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: pe, size: "xl", color: "primary" }) }),
|
|
2770
2773
|
/* @__PURE__ */ e(Z, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
|
|
2771
|
-
/* @__PURE__ */
|
|
2774
|
+
/* @__PURE__ */ d(Z, { variant: "body", size: "sm", className: "text-muted mt-1 mb-6 text-center max-w-xs", children: [
|
|
2772
2775
|
"This file will be used directly in the form and will ",
|
|
2773
2776
|
/* @__PURE__ */ e("strong", { children: "not" }),
|
|
2774
2777
|
" be uploaded to platform storage."
|
|
2775
2778
|
] }),
|
|
2776
|
-
/* @__PURE__ */
|
|
2777
|
-
/* @__PURE__ */
|
|
2779
|
+
/* @__PURE__ */ d("label", { className: "cursor-pointer", children: [
|
|
2780
|
+
/* @__PURE__ */ d("div", { className: x(
|
|
2778
2781
|
"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",
|
|
2779
2782
|
F && "opacity-50 cursor-wait"
|
|
2780
2783
|
), children: [
|
|
2781
|
-
F && /* @__PURE__ */
|
|
2784
|
+
F && /* @__PURE__ */ d("svg", { className: "animate-spin h-4 w-4 mr-2", fill: "none", viewBox: "0 0 24 24", children: [
|
|
2782
2785
|
/* @__PURE__ */ e("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
2783
2786
|
/* @__PURE__ */ e("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
2784
2787
|
] }),
|
|
@@ -2789,7 +2792,7 @@ const Lt = ({
|
|
|
2789
2792
|
{
|
|
2790
2793
|
type: "file",
|
|
2791
2794
|
className: "hidden",
|
|
2792
|
-
onChange:
|
|
2795
|
+
onChange: re,
|
|
2793
2796
|
accept: f,
|
|
2794
2797
|
disabled: F
|
|
2795
2798
|
}
|
|
@@ -2814,8 +2817,8 @@ function Mt(t, a, r) {
|
|
|
2814
2817
|
const n = a.split("."), s = Array.isArray(t) ? [...t] : { ...t };
|
|
2815
2818
|
let c = s;
|
|
2816
2819
|
for (let f = 0; f < n.length - 1; f++) {
|
|
2817
|
-
const
|
|
2818
|
-
c[
|
|
2820
|
+
const b = n[f], p = c[b];
|
|
2821
|
+
c[b] = p && typeof p == "object" ? Array.isArray(p) ? [...p] : { ...p } : {}, c = c[b];
|
|
2819
2822
|
}
|
|
2820
2823
|
return c[n[n.length - 1]] = r, s;
|
|
2821
2824
|
}
|
|
@@ -2837,102 +2840,102 @@ const rr = ({
|
|
|
2837
2840
|
onChange: s,
|
|
2838
2841
|
transform: c,
|
|
2839
2842
|
validate: f,
|
|
2840
|
-
submitButton:
|
|
2843
|
+
submitButton: b = { label: "Submit", variant: "primary" },
|
|
2841
2844
|
cancelButton: p = { label: "Cancel", variant: "outline" },
|
|
2842
|
-
showButtons:
|
|
2843
|
-
layout:
|
|
2845
|
+
showButtons: g = !0,
|
|
2846
|
+
layout: m = "vertical",
|
|
2844
2847
|
size: l = "md",
|
|
2845
|
-
loading:
|
|
2848
|
+
loading: u = !1,
|
|
2846
2849
|
className: h,
|
|
2847
2850
|
ref: C,
|
|
2848
2851
|
sdk: w
|
|
2849
2852
|
}) => {
|
|
2850
|
-
const [N,
|
|
2851
|
-
|
|
2852
|
-
a &&
|
|
2853
|
+
const [N, I] = V(a || {}), [v, q] = V({}), [B, U] = V({});
|
|
2854
|
+
K(() => {
|
|
2855
|
+
a && I({ ...a });
|
|
2853
2856
|
}, [a]);
|
|
2854
|
-
const F =
|
|
2855
|
-
(
|
|
2856
|
-
const
|
|
2857
|
-
if (!
|
|
2858
|
-
if (
|
|
2859
|
-
return `${
|
|
2860
|
-
if (
|
|
2861
|
-
if (
|
|
2862
|
-
return `${
|
|
2863
|
-
if (
|
|
2864
|
-
return `${
|
|
2865
|
-
if (Array.isArray(
|
|
2866
|
-
const
|
|
2857
|
+
const F = ae(
|
|
2858
|
+
(i, y, $) => {
|
|
2859
|
+
const L = t.flatMap((D) => D.items).find((D) => D.name === i);
|
|
2860
|
+
if (!L) return null;
|
|
2861
|
+
if (L.required && (y == null || y === ""))
|
|
2862
|
+
return `${L.label} is required`;
|
|
2863
|
+
if (L.type === "array") {
|
|
2864
|
+
if (L.required && (!y || y.length === 0))
|
|
2865
|
+
return `${L.label} cannot be empty.`;
|
|
2866
|
+
if (y && !Array.isArray(y))
|
|
2867
|
+
return `${L.label} must be an array.`;
|
|
2868
|
+
if (Array.isArray(y) && L.arrayFields) {
|
|
2869
|
+
const D = [];
|
|
2867
2870
|
let M = !1;
|
|
2868
|
-
if (
|
|
2871
|
+
if (y.forEach((Q, re) => {
|
|
2869
2872
|
const W = {};
|
|
2870
|
-
for (const S of
|
|
2871
|
-
const
|
|
2872
|
-
if (S.required && (
|
|
2873
|
+
for (const S of L.arrayFields) {
|
|
2874
|
+
const A = Q?.[S.name];
|
|
2875
|
+
if (S.required && (A == null || A === ""))
|
|
2873
2876
|
W[S.name] = `${S.label} is required`, M = !0;
|
|
2874
2877
|
else if (S.validator) {
|
|
2875
|
-
const O = S.validator(
|
|
2878
|
+
const O = S.validator(A, Q);
|
|
2876
2879
|
O && (W[S.name] = O, M = !0);
|
|
2877
2880
|
}
|
|
2878
2881
|
}
|
|
2879
|
-
|
|
2882
|
+
D[re] = W;
|
|
2880
2883
|
}), M)
|
|
2881
|
-
return JSON.stringify(
|
|
2884
|
+
return JSON.stringify(D);
|
|
2882
2885
|
}
|
|
2883
2886
|
}
|
|
2884
|
-
return
|
|
2887
|
+
return L.validator ? L.validator(y, $) : null;
|
|
2885
2888
|
},
|
|
2886
2889
|
[t]
|
|
2887
|
-
), E =
|
|
2888
|
-
(
|
|
2889
|
-
let
|
|
2890
|
+
), E = ae(
|
|
2891
|
+
(i, y) => {
|
|
2892
|
+
let $ = Mt(
|
|
2890
2893
|
N,
|
|
2891
|
-
|
|
2892
|
-
|
|
2894
|
+
i,
|
|
2895
|
+
y
|
|
2893
2896
|
);
|
|
2894
|
-
t.flatMap((M) => M.items).find((M) => M.name ===
|
|
2895
|
-
const
|
|
2897
|
+
t.flatMap((M) => M.items).find((M) => M.name === i)?.removeIfEmpty && (y == null || y === "") && ($ = Et($, i)), I($), U((M) => ({ ...M, [i]: !0 }));
|
|
2898
|
+
const D = F(i, y, $);
|
|
2896
2899
|
q((M) => ({
|
|
2897
2900
|
...M,
|
|
2898
|
-
[
|
|
2899
|
-
})), s?.(
|
|
2901
|
+
[i]: D || ""
|
|
2902
|
+
})), s?.($, i);
|
|
2900
2903
|
},
|
|
2901
2904
|
[N, t, F, s]
|
|
2902
|
-
), J =
|
|
2903
|
-
async (
|
|
2904
|
-
if (console.log("handleSubmit"),
|
|
2905
|
-
const
|
|
2906
|
-
for (const
|
|
2907
|
-
if (
|
|
2905
|
+
), J = ae(
|
|
2906
|
+
async (i) => {
|
|
2907
|
+
if (console.log("handleSubmit"), i.preventDefault(), u) return;
|
|
2908
|
+
const y = {}, $ = t.flatMap((D) => D.items);
|
|
2909
|
+
for (const D of $) {
|
|
2910
|
+
if (D.hidden || D.conditional && !D.conditional(N))
|
|
2908
2911
|
continue;
|
|
2909
2912
|
const M = F(
|
|
2910
|
-
|
|
2911
|
-
Me(N,
|
|
2913
|
+
D.name,
|
|
2914
|
+
Me(N, D.name),
|
|
2912
2915
|
N
|
|
2913
2916
|
);
|
|
2914
|
-
M && (
|
|
2917
|
+
M && (y[D.name] = M);
|
|
2915
2918
|
}
|
|
2916
2919
|
if (f) {
|
|
2917
|
-
const
|
|
2918
|
-
|
|
2920
|
+
const D = f(N);
|
|
2921
|
+
D && Object.assign(y, D);
|
|
2919
2922
|
}
|
|
2920
|
-
if (q(
|
|
2923
|
+
if (q(y), console.log("newErrors", y), Object.keys(y).some((D) => y[D]))
|
|
2921
2924
|
return;
|
|
2922
|
-
const
|
|
2923
|
-
await r?.(N,
|
|
2925
|
+
const L = c ? c(N) : N;
|
|
2926
|
+
await r?.(N, L);
|
|
2924
2927
|
},
|
|
2925
|
-
[N, t, F, f, c, r,
|
|
2926
|
-
), z =
|
|
2927
|
-
(
|
|
2928
|
-
const
|
|
2929
|
-
value:
|
|
2930
|
-
disabled:
|
|
2931
|
-
required:
|
|
2932
|
-
placeholder:
|
|
2933
|
-
...
|
|
2928
|
+
[N, t, F, f, c, r, u]
|
|
2929
|
+
), z = ae(
|
|
2930
|
+
(i) => {
|
|
2931
|
+
const y = Me(N, i.name), $ = B[i.name] ? v[i.name] : void 0, L = i.disabled || u, D = {
|
|
2932
|
+
value: y || "",
|
|
2933
|
+
disabled: L,
|
|
2934
|
+
required: i.required,
|
|
2935
|
+
placeholder: i.placeholder,
|
|
2936
|
+
...i.fieldProps
|
|
2934
2937
|
};
|
|
2935
|
-
switch (
|
|
2938
|
+
switch (i.type) {
|
|
2936
2939
|
case "text":
|
|
2937
2940
|
case "email":
|
|
2938
2941
|
case "password":
|
|
@@ -2942,11 +2945,11 @@ const rr = ({
|
|
|
2942
2945
|
return /* @__PURE__ */ e(
|
|
2943
2946
|
ue,
|
|
2944
2947
|
{
|
|
2945
|
-
...
|
|
2946
|
-
onChange: (M) => E(
|
|
2947
|
-
type:
|
|
2948
|
-
autoComplete:
|
|
2949
|
-
error:
|
|
2948
|
+
...D,
|
|
2949
|
+
onChange: (M) => E(i.name, M.target.value),
|
|
2950
|
+
type: i.textType || i.type,
|
|
2951
|
+
autoComplete: i.autocomplete,
|
|
2952
|
+
error: $,
|
|
2950
2953
|
size: l
|
|
2951
2954
|
}
|
|
2952
2955
|
);
|
|
@@ -2954,10 +2957,10 @@ const rr = ({
|
|
|
2954
2957
|
return /* @__PURE__ */ e(
|
|
2955
2958
|
Ne,
|
|
2956
2959
|
{
|
|
2957
|
-
...
|
|
2958
|
-
onChange: (M) => E(
|
|
2960
|
+
...D,
|
|
2961
|
+
onChange: (M) => E(i.name, M.target.value),
|
|
2959
2962
|
rows: 4,
|
|
2960
|
-
error:
|
|
2963
|
+
error: $,
|
|
2961
2964
|
size: l
|
|
2962
2965
|
}
|
|
2963
2966
|
);
|
|
@@ -2965,16 +2968,16 @@ const rr = ({
|
|
|
2965
2968
|
return /* @__PURE__ */ e(
|
|
2966
2969
|
ve,
|
|
2967
2970
|
{
|
|
2968
|
-
...
|
|
2969
|
-
onChange: (M) => E(
|
|
2970
|
-
options: (
|
|
2971
|
+
...D,
|
|
2972
|
+
onChange: (M) => E(i.name, M),
|
|
2973
|
+
options: (i.options || []).map((M) => ({
|
|
2971
2974
|
...M,
|
|
2972
2975
|
value: String(M.value)
|
|
2973
2976
|
})),
|
|
2974
|
-
searchable:
|
|
2975
|
-
multiple:
|
|
2976
|
-
allowCreate:
|
|
2977
|
-
error:
|
|
2977
|
+
searchable: i.searchable,
|
|
2978
|
+
multiple: i.multiple,
|
|
2979
|
+
allowCreate: i.allowCreate,
|
|
2980
|
+
error: $,
|
|
2978
2981
|
size: l
|
|
2979
2982
|
}
|
|
2980
2983
|
);
|
|
@@ -2982,23 +2985,23 @@ const rr = ({
|
|
|
2982
2985
|
return /* @__PURE__ */ e(
|
|
2983
2986
|
ge,
|
|
2984
2987
|
{
|
|
2985
|
-
...
|
|
2986
|
-
checked:
|
|
2987
|
-
onChange: (M) => E(
|
|
2988
|
+
...D,
|
|
2989
|
+
checked: !!y,
|
|
2990
|
+
onChange: (M) => E(i.name, M.target.checked),
|
|
2988
2991
|
size: l
|
|
2989
2992
|
}
|
|
2990
2993
|
);
|
|
2991
2994
|
case "radio":
|
|
2992
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1", children:
|
|
2995
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1", children: i.options?.map((M) => /* @__PURE__ */ d("label", { className: "flex items-center gap-2", children: [
|
|
2993
2996
|
/* @__PURE__ */ e(
|
|
2994
2997
|
"input",
|
|
2995
2998
|
{
|
|
2996
2999
|
type: "radio",
|
|
2997
|
-
name:
|
|
3000
|
+
name: i.name,
|
|
2998
3001
|
value: M.value,
|
|
2999
|
-
checked:
|
|
3000
|
-
onChange: () => E(
|
|
3001
|
-
disabled:
|
|
3002
|
+
checked: y === M.value,
|
|
3003
|
+
onChange: () => E(i.name, M.value),
|
|
3004
|
+
disabled: L || M.disabled,
|
|
3002
3005
|
className: "rounded-full border-neutral-100 dark:border-neutral-600"
|
|
3003
3006
|
}
|
|
3004
3007
|
),
|
|
@@ -3008,9 +3011,9 @@ const rr = ({
|
|
|
3008
3011
|
return /* @__PURE__ */ e(
|
|
3009
3012
|
ye,
|
|
3010
3013
|
{
|
|
3011
|
-
...
|
|
3012
|
-
value:
|
|
3013
|
-
onChange: (M) => E(
|
|
3014
|
+
...D,
|
|
3015
|
+
value: y ? new Date(y) : null,
|
|
3016
|
+
onChange: (M) => E(i.name, M),
|
|
3014
3017
|
size: l
|
|
3015
3018
|
}
|
|
3016
3019
|
);
|
|
@@ -3018,10 +3021,10 @@ const rr = ({
|
|
|
3018
3021
|
return /* @__PURE__ */ e(
|
|
3019
3022
|
Lt,
|
|
3020
3023
|
{
|
|
3021
|
-
...
|
|
3022
|
-
value:
|
|
3023
|
-
onChange: (M) => E(
|
|
3024
|
-
error:
|
|
3024
|
+
...D,
|
|
3025
|
+
value: y,
|
|
3026
|
+
onChange: (M) => E(i.name, M),
|
|
3027
|
+
error: $,
|
|
3025
3028
|
onListFiles: (M) => w?.http.invoke({
|
|
3026
3029
|
method: "POST",
|
|
3027
3030
|
action: "storage.file.list",
|
|
@@ -3048,79 +3051,79 @@ const rr = ({
|
|
|
3048
3051
|
}
|
|
3049
3052
|
);
|
|
3050
3053
|
case "custom":
|
|
3051
|
-
return
|
|
3052
|
-
value:
|
|
3053
|
-
onChange: (M) => E(
|
|
3054
|
-
error:
|
|
3055
|
-
disabled:
|
|
3054
|
+
return i.customComponent?.({
|
|
3055
|
+
value: y,
|
|
3056
|
+
onChange: (M) => E(i.name, M),
|
|
3057
|
+
error: $,
|
|
3058
|
+
disabled: L
|
|
3056
3059
|
});
|
|
3057
3060
|
case "array": {
|
|
3058
|
-
const M =
|
|
3059
|
-
let
|
|
3060
|
-
if (typeof
|
|
3061
|
+
const M = y || [];
|
|
3062
|
+
let Q = [];
|
|
3063
|
+
if (typeof $ == "string" && $.startsWith("["))
|
|
3061
3064
|
try {
|
|
3062
|
-
|
|
3065
|
+
Q = JSON.parse($);
|
|
3063
3066
|
} catch {
|
|
3064
3067
|
}
|
|
3065
|
-
const
|
|
3066
|
-
E(
|
|
3067
|
-
}, W = (
|
|
3068
|
+
const re = () => {
|
|
3069
|
+
E(i.name, [...M, {}]);
|
|
3070
|
+
}, W = (A) => {
|
|
3068
3071
|
E(
|
|
3069
|
-
|
|
3070
|
-
M.filter((O,
|
|
3072
|
+
i.name,
|
|
3073
|
+
M.filter((O, T) => T !== A)
|
|
3071
3074
|
);
|
|
3072
|
-
}, S = (
|
|
3073
|
-
const
|
|
3074
|
-
|
|
3075
|
-
...
|
|
3076
|
-
[O]:
|
|
3077
|
-
}, E(
|
|
3075
|
+
}, S = (A, O, T) => {
|
|
3076
|
+
const ee = [...M];
|
|
3077
|
+
ee[A] = {
|
|
3078
|
+
...ee[A],
|
|
3079
|
+
[O]: T
|
|
3080
|
+
}, E(i.name, ee);
|
|
3078
3081
|
};
|
|
3079
|
-
return /* @__PURE__ */
|
|
3080
|
-
M.map((
|
|
3082
|
+
return /* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
3083
|
+
M.map((A, O) => /* @__PURE__ */ d(
|
|
3081
3084
|
"div",
|
|
3082
3085
|
{
|
|
3083
3086
|
className: "p-4 border rounded-md dark:border-neutral-700 space-y-2 relative",
|
|
3084
3087
|
children: [
|
|
3085
3088
|
/* @__PURE__ */ e("div", { className: "absolute top-2 right-2", children: /* @__PURE__ */ e(
|
|
3086
|
-
|
|
3089
|
+
te,
|
|
3087
3090
|
{
|
|
3088
3091
|
type: "button",
|
|
3089
3092
|
variant: "ghost",
|
|
3090
3093
|
size: "sm",
|
|
3091
3094
|
onClick: () => W(O),
|
|
3092
|
-
disabled:
|
|
3095
|
+
disabled: L,
|
|
3093
3096
|
children: "Remove"
|
|
3094
3097
|
}
|
|
3095
3098
|
) }),
|
|
3096
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
3097
|
-
const
|
|
3098
|
-
return /* @__PURE__ */
|
|
3099
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: i.arrayFields?.map((T) => {
|
|
3100
|
+
const ee = Q?.[O]?.[T.name];
|
|
3101
|
+
return /* @__PURE__ */ d(
|
|
3099
3102
|
"div",
|
|
3100
3103
|
{
|
|
3101
3104
|
className: "space-y-1",
|
|
3102
3105
|
children: [
|
|
3103
|
-
/* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */ d(
|
|
3104
3107
|
Z,
|
|
3105
3108
|
{
|
|
3106
3109
|
variant: "label",
|
|
3107
3110
|
size: "sm",
|
|
3108
3111
|
className: "font-semibold text-neutral-700 dark:text-neutral-300",
|
|
3109
3112
|
children: [
|
|
3110
|
-
|
|
3111
|
-
|
|
3113
|
+
T.label,
|
|
3114
|
+
T.required && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
|
|
3112
3115
|
]
|
|
3113
3116
|
}
|
|
3114
3117
|
) }),
|
|
3115
3118
|
(() => {
|
|
3116
|
-
const
|
|
3117
|
-
value:
|
|
3118
|
-
disabled:
|
|
3119
|
-
required:
|
|
3120
|
-
placeholder:
|
|
3121
|
-
...
|
|
3119
|
+
const ne = {
|
|
3120
|
+
value: A?.[T.name] || "",
|
|
3121
|
+
disabled: L,
|
|
3122
|
+
required: T.required,
|
|
3123
|
+
placeholder: T.placeholder,
|
|
3124
|
+
...T.fieldProps
|
|
3122
3125
|
};
|
|
3123
|
-
switch (
|
|
3126
|
+
switch (T.type) {
|
|
3124
3127
|
case "text":
|
|
3125
3128
|
case "email":
|
|
3126
3129
|
case "password":
|
|
@@ -3130,15 +3133,15 @@ const rr = ({
|
|
|
3130
3133
|
return /* @__PURE__ */ e(
|
|
3131
3134
|
ue,
|
|
3132
3135
|
{
|
|
3133
|
-
...
|
|
3134
|
-
onChange: (
|
|
3136
|
+
...ne,
|
|
3137
|
+
onChange: (G) => S(
|
|
3135
3138
|
O,
|
|
3136
|
-
|
|
3137
|
-
|
|
3139
|
+
T.name,
|
|
3140
|
+
G.target.value
|
|
3138
3141
|
),
|
|
3139
|
-
type:
|
|
3140
|
-
autoComplete:
|
|
3141
|
-
error:
|
|
3142
|
+
type: T.textType || T.type,
|
|
3143
|
+
autoComplete: T.autocomplete,
|
|
3144
|
+
error: ee,
|
|
3142
3145
|
size: l
|
|
3143
3146
|
}
|
|
3144
3147
|
);
|
|
@@ -3146,14 +3149,14 @@ const rr = ({
|
|
|
3146
3149
|
return /* @__PURE__ */ e(
|
|
3147
3150
|
Ne,
|
|
3148
3151
|
{
|
|
3149
|
-
...
|
|
3150
|
-
onChange: (
|
|
3152
|
+
...ne,
|
|
3153
|
+
onChange: (G) => S(
|
|
3151
3154
|
O,
|
|
3152
|
-
|
|
3153
|
-
|
|
3155
|
+
T.name,
|
|
3156
|
+
G.target.value
|
|
3154
3157
|
),
|
|
3155
3158
|
rows: 4,
|
|
3156
|
-
error:
|
|
3159
|
+
error: ee,
|
|
3157
3160
|
size: l
|
|
3158
3161
|
}
|
|
3159
3162
|
);
|
|
@@ -3161,22 +3164,22 @@ const rr = ({
|
|
|
3161
3164
|
return /* @__PURE__ */ e(
|
|
3162
3165
|
ve,
|
|
3163
3166
|
{
|
|
3164
|
-
...
|
|
3165
|
-
onChange: (
|
|
3167
|
+
...ne,
|
|
3168
|
+
onChange: (G) => S(
|
|
3166
3169
|
O,
|
|
3167
|
-
|
|
3168
|
-
|
|
3170
|
+
T.name,
|
|
3171
|
+
G
|
|
3169
3172
|
),
|
|
3170
|
-
options: (
|
|
3171
|
-
(
|
|
3172
|
-
...
|
|
3173
|
-
value: String(
|
|
3173
|
+
options: (T.options || []).map(
|
|
3174
|
+
(G) => ({
|
|
3175
|
+
...G,
|
|
3176
|
+
value: String(G.value)
|
|
3174
3177
|
})
|
|
3175
3178
|
),
|
|
3176
|
-
searchable:
|
|
3177
|
-
multiple:
|
|
3178
|
-
allowCreate:
|
|
3179
|
-
error:
|
|
3179
|
+
searchable: T.searchable,
|
|
3180
|
+
multiple: T.multiple,
|
|
3181
|
+
allowCreate: T.allowCreate,
|
|
3182
|
+
error: ee,
|
|
3180
3183
|
size: l
|
|
3181
3184
|
}
|
|
3182
3185
|
);
|
|
@@ -3184,18 +3187,18 @@ const rr = ({
|
|
|
3184
3187
|
return /* @__PURE__ */ e(
|
|
3185
3188
|
ge,
|
|
3186
3189
|
{
|
|
3187
|
-
...
|
|
3188
|
-
checked: !!
|
|
3189
|
-
onChange: (
|
|
3190
|
+
...ne,
|
|
3191
|
+
checked: !!A?.[T.name],
|
|
3192
|
+
onChange: (G) => S(
|
|
3190
3193
|
O,
|
|
3191
|
-
|
|
3192
|
-
|
|
3194
|
+
T.name,
|
|
3195
|
+
G.target.checked
|
|
3193
3196
|
),
|
|
3194
3197
|
size: l
|
|
3195
3198
|
}
|
|
3196
3199
|
);
|
|
3197
3200
|
case "radio":
|
|
3198
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1", children:
|
|
3201
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1", children: T.options?.map((G) => /* @__PURE__ */ d(
|
|
3199
3202
|
"label",
|
|
3200
3203
|
{
|
|
3201
3204
|
className: "flex items-center gap-2",
|
|
@@ -3204,33 +3207,33 @@ const rr = ({
|
|
|
3204
3207
|
"input",
|
|
3205
3208
|
{
|
|
3206
3209
|
type: "radio",
|
|
3207
|
-
name: `${
|
|
3208
|
-
value:
|
|
3209
|
-
checked:
|
|
3210
|
+
name: `${i.name}.${O}.${T.name}`,
|
|
3211
|
+
value: G.value,
|
|
3212
|
+
checked: A?.[T.name] === G.value,
|
|
3210
3213
|
onChange: () => S(
|
|
3211
3214
|
O,
|
|
3212
|
-
|
|
3213
|
-
|
|
3215
|
+
T.name,
|
|
3216
|
+
G.value
|
|
3214
3217
|
),
|
|
3215
|
-
disabled:
|
|
3218
|
+
disabled: L || G.disabled,
|
|
3216
3219
|
className: "rounded-full border-neutral-100 dark:border-neutral-600"
|
|
3217
3220
|
}
|
|
3218
3221
|
),
|
|
3219
|
-
/* @__PURE__ */ e(Z, { variant: "label", size: "sm", children:
|
|
3222
|
+
/* @__PURE__ */ e(Z, { variant: "label", size: "sm", children: G.label })
|
|
3220
3223
|
]
|
|
3221
3224
|
},
|
|
3222
|
-
|
|
3225
|
+
G.value
|
|
3223
3226
|
)) });
|
|
3224
3227
|
case "date": {
|
|
3225
|
-
const
|
|
3228
|
+
const G = A?.[T.name];
|
|
3226
3229
|
return /* @__PURE__ */ e(
|
|
3227
3230
|
ye,
|
|
3228
3231
|
{
|
|
3229
|
-
...
|
|
3230
|
-
value:
|
|
3232
|
+
...ne,
|
|
3233
|
+
value: G ? new Date(G) : null,
|
|
3231
3234
|
onChange: (le) => S(
|
|
3232
3235
|
O,
|
|
3233
|
-
|
|
3236
|
+
T.name,
|
|
3234
3237
|
le
|
|
3235
3238
|
),
|
|
3236
3239
|
size: l
|
|
@@ -3238,54 +3241,54 @@ const rr = ({
|
|
|
3238
3241
|
);
|
|
3239
3242
|
}
|
|
3240
3243
|
case "custom":
|
|
3241
|
-
return
|
|
3242
|
-
value:
|
|
3243
|
-
onChange: (
|
|
3244
|
+
return T.customComponent?.({
|
|
3245
|
+
value: A?.[T.name],
|
|
3246
|
+
onChange: (G) => S(
|
|
3244
3247
|
O,
|
|
3245
|
-
|
|
3246
|
-
|
|
3248
|
+
T.name,
|
|
3249
|
+
G
|
|
3247
3250
|
),
|
|
3248
|
-
error:
|
|
3249
|
-
disabled:
|
|
3251
|
+
error: ee,
|
|
3252
|
+
disabled: L
|
|
3250
3253
|
});
|
|
3251
3254
|
// Add other field types here as needed
|
|
3252
3255
|
default:
|
|
3253
|
-
return /* @__PURE__ */
|
|
3256
|
+
return /* @__PURE__ */ d("p", { children: [
|
|
3254
3257
|
"Unsupported field type in array:",
|
|
3255
3258
|
" ",
|
|
3256
|
-
|
|
3259
|
+
T.type
|
|
3257
3260
|
] });
|
|
3258
3261
|
}
|
|
3259
3262
|
})(),
|
|
3260
|
-
|
|
3263
|
+
ee && /* @__PURE__ */ e(
|
|
3261
3264
|
Z,
|
|
3262
3265
|
{
|
|
3263
3266
|
variant: "body",
|
|
3264
3267
|
size: "sm",
|
|
3265
3268
|
className: "text-red-600 dark:text-red-400",
|
|
3266
|
-
children:
|
|
3269
|
+
children: ee
|
|
3267
3270
|
}
|
|
3268
3271
|
)
|
|
3269
3272
|
]
|
|
3270
3273
|
},
|
|
3271
|
-
|
|
3274
|
+
T.name
|
|
3272
3275
|
);
|
|
3273
3276
|
}) })
|
|
3274
3277
|
]
|
|
3275
3278
|
},
|
|
3276
3279
|
O
|
|
3277
3280
|
)),
|
|
3278
|
-
/* @__PURE__ */
|
|
3279
|
-
|
|
3281
|
+
/* @__PURE__ */ d(
|
|
3282
|
+
te,
|
|
3280
3283
|
{
|
|
3281
3284
|
type: "button",
|
|
3282
3285
|
variant: "outline",
|
|
3283
3286
|
size: "sm",
|
|
3284
|
-
onClick:
|
|
3285
|
-
disabled:
|
|
3287
|
+
onClick: re,
|
|
3288
|
+
disabled: L,
|
|
3286
3289
|
children: [
|
|
3287
3290
|
"Add ",
|
|
3288
|
-
|
|
3291
|
+
i.label
|
|
3289
3292
|
]
|
|
3290
3293
|
}
|
|
3291
3294
|
)
|
|
@@ -3295,33 +3298,33 @@ const rr = ({
|
|
|
3295
3298
|
return null;
|
|
3296
3299
|
}
|
|
3297
3300
|
},
|
|
3298
|
-
[N,
|
|
3299
|
-
),
|
|
3300
|
-
(
|
|
3301
|
-
if (
|
|
3301
|
+
[N, B, v, u, l, E]
|
|
3302
|
+
), P = ae(
|
|
3303
|
+
(i) => {
|
|
3304
|
+
if (i.conditional && !i.conditional(N))
|
|
3302
3305
|
return null;
|
|
3303
|
-
const
|
|
3304
|
-
if (
|
|
3305
|
-
const
|
|
3306
|
+
const y = i.items.filter((L) => !(L.hidden || L.conditional && !L.conditional(N)));
|
|
3307
|
+
if (y.length === 0) return null;
|
|
3308
|
+
const $ = x(
|
|
3306
3309
|
"space-y-2",
|
|
3307
3310
|
{
|
|
3308
|
-
"grid gap-2":
|
|
3309
|
-
"flex flex-wrap gap-2":
|
|
3311
|
+
"grid gap-2": i.layout === "grid",
|
|
3312
|
+
"flex flex-wrap gap-2": i.layout === "flex"
|
|
3310
3313
|
},
|
|
3311
|
-
|
|
3312
|
-
"grid-cols-1": !
|
|
3313
|
-
"grid-cols-2":
|
|
3314
|
-
"grid-cols-3":
|
|
3315
|
-
"grid-cols-4":
|
|
3314
|
+
i.layout === "grid" && {
|
|
3315
|
+
"grid-cols-1": !i.columns || i.columns === 1,
|
|
3316
|
+
"grid-cols-2": i.columns === 2,
|
|
3317
|
+
"grid-cols-3": i.columns === 3,
|
|
3318
|
+
"grid-cols-4": i.columns === 4
|
|
3316
3319
|
},
|
|
3317
|
-
|
|
3320
|
+
i.className
|
|
3318
3321
|
);
|
|
3319
|
-
return /* @__PURE__ */
|
|
3322
|
+
return /* @__PURE__ */ d(
|
|
3320
3323
|
"div",
|
|
3321
3324
|
{
|
|
3322
3325
|
className: "grid grid-cols-1 md:grid-cols-3 gap-8 p-6 border border-neutral dark:border-neutral-700 rounded-xl",
|
|
3323
3326
|
children: [
|
|
3324
|
-
/* @__PURE__ */
|
|
3327
|
+
/* @__PURE__ */ d("div", { className: "md:col-span-1", children: [
|
|
3325
3328
|
/* @__PURE__ */ e(
|
|
3326
3329
|
Z,
|
|
3327
3330
|
{
|
|
@@ -3329,52 +3332,52 @@ const rr = ({
|
|
|
3329
3332
|
size: "lg",
|
|
3330
3333
|
weight: "semibold",
|
|
3331
3334
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
3332
|
-
children:
|
|
3335
|
+
children: i.title
|
|
3333
3336
|
}
|
|
3334
3337
|
),
|
|
3335
|
-
|
|
3338
|
+
i.description && /* @__PURE__ */ e(
|
|
3336
3339
|
Z,
|
|
3337
3340
|
{
|
|
3338
3341
|
variant: "body",
|
|
3339
3342
|
size: "sm",
|
|
3340
3343
|
className: "text-neutral-600 dark:text-neutral-400 mt-1",
|
|
3341
|
-
children:
|
|
3344
|
+
children: i.description
|
|
3342
3345
|
}
|
|
3343
3346
|
)
|
|
3344
3347
|
] }),
|
|
3345
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className:
|
|
3348
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: $, children: y.map((L) => (B[L.name] && v[L.name], /* @__PURE__ */ d(
|
|
3346
3349
|
"div",
|
|
3347
3350
|
{
|
|
3348
|
-
className:
|
|
3351
|
+
className: x(
|
|
3349
3352
|
"space-y-1",
|
|
3350
|
-
|
|
3351
|
-
|
|
3353
|
+
L.width && typeof L.width == "string" && `w-[${L.width}]`,
|
|
3354
|
+
L.width && typeof L.width == "number" && `col-span-${L.width}`
|
|
3352
3355
|
),
|
|
3353
3356
|
children: [
|
|
3354
|
-
|
|
3357
|
+
L.type !== "custom" && /* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */ d(
|
|
3355
3358
|
Z,
|
|
3356
3359
|
{
|
|
3357
3360
|
variant: "label",
|
|
3358
3361
|
size: "sm",
|
|
3359
3362
|
className: "font-medium text-neutral-700 dark:text-neutral-300",
|
|
3360
3363
|
children: [
|
|
3361
|
-
|
|
3362
|
-
|
|
3364
|
+
L.label,
|
|
3365
|
+
L.required && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
|
|
3363
3366
|
]
|
|
3364
3367
|
}
|
|
3365
3368
|
) }),
|
|
3366
|
-
z(
|
|
3369
|
+
z(L)
|
|
3367
3370
|
]
|
|
3368
3371
|
},
|
|
3369
|
-
|
|
3372
|
+
L.name
|
|
3370
3373
|
))) }) })
|
|
3371
3374
|
]
|
|
3372
3375
|
},
|
|
3373
|
-
|
|
3376
|
+
i.id
|
|
3374
3377
|
);
|
|
3375
3378
|
},
|
|
3376
|
-
[N,
|
|
3377
|
-
),
|
|
3379
|
+
[N, B, v, z]
|
|
3380
|
+
), H = x(
|
|
3378
3381
|
"space-y-6",
|
|
3379
3382
|
{
|
|
3380
3383
|
"max-w-md": l === "sm",
|
|
@@ -3384,31 +3387,31 @@ const rr = ({
|
|
|
3384
3387
|
},
|
|
3385
3388
|
h
|
|
3386
3389
|
);
|
|
3387
|
-
return /* @__PURE__ */
|
|
3388
|
-
/* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(
|
|
3389
|
-
|
|
3390
|
+
return /* @__PURE__ */ d("form", { ref: C, onSubmit: J, className: H, children: [
|
|
3391
|
+
/* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(P) }),
|
|
3392
|
+
g && /* @__PURE__ */ d("div", { className: x("flex gap-3 justify-end pt-8"), children: [
|
|
3390
3393
|
n && /* @__PURE__ */ e(
|
|
3391
|
-
|
|
3394
|
+
te,
|
|
3392
3395
|
{
|
|
3393
3396
|
type: "button",
|
|
3394
3397
|
variant: p.variant,
|
|
3395
3398
|
size: p.size || l,
|
|
3396
|
-
disabled: p.disabled ||
|
|
3399
|
+
disabled: p.disabled || u,
|
|
3397
3400
|
onClick: n,
|
|
3398
3401
|
className: p.className,
|
|
3399
3402
|
children: p.label
|
|
3400
3403
|
}
|
|
3401
3404
|
),
|
|
3402
3405
|
/* @__PURE__ */ e(
|
|
3403
|
-
|
|
3406
|
+
te,
|
|
3404
3407
|
{
|
|
3405
3408
|
type: "submit",
|
|
3406
|
-
variant:
|
|
3407
|
-
size:
|
|
3408
|
-
disabled:
|
|
3409
|
-
loading:
|
|
3410
|
-
className:
|
|
3411
|
-
children:
|
|
3409
|
+
variant: b.variant,
|
|
3410
|
+
size: b.size || l,
|
|
3411
|
+
disabled: b.disabled || u,
|
|
3412
|
+
loading: u,
|
|
3413
|
+
className: b.className,
|
|
3414
|
+
children: b.label
|
|
3412
3415
|
}
|
|
3413
3416
|
)
|
|
3414
3417
|
] })
|
|
@@ -3442,13 +3445,13 @@ function nr({
|
|
|
3442
3445
|
dismissible: s = !1,
|
|
3443
3446
|
onDismiss: c,
|
|
3444
3447
|
className: f,
|
|
3445
|
-
children:
|
|
3448
|
+
children: b,
|
|
3446
3449
|
...p
|
|
3447
3450
|
}) {
|
|
3448
|
-
return /* @__PURE__ */
|
|
3451
|
+
return /* @__PURE__ */ d(
|
|
3449
3452
|
"span",
|
|
3450
3453
|
{
|
|
3451
|
-
className:
|
|
3454
|
+
className: x(
|
|
3452
3455
|
// Base styles
|
|
3453
3456
|
"inline-flex items-center font-medium rounded-full",
|
|
3454
3457
|
// Variant styles
|
|
@@ -3462,14 +3465,14 @@ function nr({
|
|
|
3462
3465
|
r && /* @__PURE__ */ e(
|
|
3463
3466
|
"span",
|
|
3464
3467
|
{
|
|
3465
|
-
className:
|
|
3468
|
+
className: x(
|
|
3466
3469
|
"w-2 h-2 rounded-full mr-1.5",
|
|
3467
3470
|
Dt[t]
|
|
3468
3471
|
)
|
|
3469
3472
|
}
|
|
3470
3473
|
),
|
|
3471
|
-
n && /* @__PURE__ */ e("span", { className:
|
|
3472
|
-
|
|
3474
|
+
n && /* @__PURE__ */ e("span", { className: x("flex-shrink-0", b && "mr-1"), children: n }),
|
|
3475
|
+
b,
|
|
3473
3476
|
s && c && /* @__PURE__ */ e(
|
|
3474
3477
|
"button",
|
|
3475
3478
|
{
|
|
@@ -3516,20 +3519,20 @@ function ar({
|
|
|
3516
3519
|
className: s,
|
|
3517
3520
|
...c
|
|
3518
3521
|
}) {
|
|
3519
|
-
return /* @__PURE__ */
|
|
3522
|
+
return /* @__PURE__ */ d(
|
|
3520
3523
|
"div",
|
|
3521
3524
|
{
|
|
3522
|
-
className:
|
|
3525
|
+
className: x(
|
|
3523
3526
|
"inline-flex items-center",
|
|
3524
3527
|
n ? "flex-col space-y-2" : "",
|
|
3525
3528
|
s
|
|
3526
3529
|
),
|
|
3527
3530
|
...c,
|
|
3528
3531
|
children: [
|
|
3529
|
-
/* @__PURE__ */
|
|
3532
|
+
/* @__PURE__ */ d(
|
|
3530
3533
|
"svg",
|
|
3531
3534
|
{
|
|
3532
|
-
className:
|
|
3535
|
+
className: x(
|
|
3533
3536
|
"animate-spin",
|
|
3534
3537
|
Tt[t],
|
|
3535
3538
|
At[a]
|
|
@@ -3564,7 +3567,7 @@ function ar({
|
|
|
3564
3567
|
n && /* @__PURE__ */ e(
|
|
3565
3568
|
"span",
|
|
3566
3569
|
{
|
|
3567
|
-
className:
|
|
3570
|
+
className: x(
|
|
3568
3571
|
"text-secondary-600 dark:text-secondary-400",
|
|
3569
3572
|
It[t]
|
|
3570
3573
|
),
|
|
@@ -3584,23 +3587,23 @@ const lr = ({
|
|
|
3584
3587
|
radius: s = "md",
|
|
3585
3588
|
showLoading: c = !0,
|
|
3586
3589
|
showError: f = !0,
|
|
3587
|
-
fallback:
|
|
3590
|
+
fallback: b,
|
|
3588
3591
|
loadingContent: p,
|
|
3589
|
-
errorContent:
|
|
3590
|
-
className:
|
|
3592
|
+
errorContent: g,
|
|
3593
|
+
className: m,
|
|
3591
3594
|
onLoad: l,
|
|
3592
|
-
onError:
|
|
3595
|
+
onError: u,
|
|
3593
3596
|
...h
|
|
3594
3597
|
}) => {
|
|
3595
|
-
const [C, w] = V(!0), [N,
|
|
3596
|
-
w(!1),
|
|
3597
|
-
},
|
|
3598
|
-
if (w(!1),
|
|
3599
|
-
q(
|
|
3598
|
+
const [C, w] = V(!0), [N, I] = V(!1), [v, q] = V(t), B = (H) => {
|
|
3599
|
+
w(!1), I(!1), l?.(H);
|
|
3600
|
+
}, U = (H) => {
|
|
3601
|
+
if (w(!1), I(!0), b && v !== b) {
|
|
3602
|
+
q(b), I(!1), w(!0);
|
|
3600
3603
|
return;
|
|
3601
3604
|
}
|
|
3602
|
-
|
|
3603
|
-
}, F =
|
|
3605
|
+
u?.(H);
|
|
3606
|
+
}, F = x(
|
|
3604
3607
|
"relative overflow-hidden bg-neutral-100 dark:bg-neutral-800",
|
|
3605
3608
|
// Size variants
|
|
3606
3609
|
{
|
|
@@ -3627,17 +3630,17 @@ const lr = ({
|
|
|
3627
3630
|
"rounded-xl": s === "xl",
|
|
3628
3631
|
"rounded-full": s === "full"
|
|
3629
3632
|
},
|
|
3630
|
-
|
|
3631
|
-
), E =
|
|
3633
|
+
m
|
|
3634
|
+
), E = x(
|
|
3632
3635
|
"w-full h-full object-cover transition-opacity duration-200",
|
|
3633
3636
|
{
|
|
3634
3637
|
"opacity-0": C || N,
|
|
3635
3638
|
"opacity-100": !C && !N
|
|
3636
3639
|
}
|
|
3637
|
-
), J =
|
|
3640
|
+
), J = x(
|
|
3638
3641
|
"absolute inset-0 flex items-center justify-center",
|
|
3639
3642
|
"text-neutral-400 dark:text-neutral-500"
|
|
3640
|
-
), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }),
|
|
3643
|
+
), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), P = /* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
3641
3644
|
/* @__PURE__ */ e(
|
|
3642
3645
|
"svg",
|
|
3643
3646
|
{
|
|
@@ -3658,20 +3661,20 @@ const lr = ({
|
|
|
3658
3661
|
),
|
|
3659
3662
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
3660
3663
|
] });
|
|
3661
|
-
return /* @__PURE__ */
|
|
3664
|
+
return /* @__PURE__ */ d("div", { className: F, children: [
|
|
3662
3665
|
/* @__PURE__ */ e(
|
|
3663
3666
|
"img",
|
|
3664
3667
|
{
|
|
3665
3668
|
...h,
|
|
3666
|
-
src:
|
|
3669
|
+
src: v,
|
|
3667
3670
|
alt: a,
|
|
3668
3671
|
className: E,
|
|
3669
|
-
onLoad:
|
|
3670
|
-
onError:
|
|
3672
|
+
onLoad: B,
|
|
3673
|
+
onError: U
|
|
3671
3674
|
}
|
|
3672
3675
|
),
|
|
3673
3676
|
C && c && /* @__PURE__ */ e("div", { className: J, children: p || z }),
|
|
3674
|
-
N && f && /* @__PURE__ */ e("div", { className: J, children:
|
|
3677
|
+
N && f && /* @__PURE__ */ e("div", { className: J, children: g || P })
|
|
3675
3678
|
] });
|
|
3676
3679
|
}, sr = ({
|
|
3677
3680
|
title: t,
|
|
@@ -3681,62 +3684,62 @@ const lr = ({
|
|
|
3681
3684
|
className: s,
|
|
3682
3685
|
backLabel: c = "Back",
|
|
3683
3686
|
backClassName: f,
|
|
3684
|
-
onBack:
|
|
3687
|
+
onBack: b,
|
|
3685
3688
|
editable: p = !1,
|
|
3686
|
-
onTitleChange:
|
|
3689
|
+
onTitleChange: g
|
|
3687
3690
|
}) => {
|
|
3688
|
-
const [
|
|
3689
|
-
|
|
3691
|
+
const [m, l] = V(!1), [u, h] = V(t), C = X(null);
|
|
3692
|
+
K(() => {
|
|
3690
3693
|
h(t);
|
|
3691
|
-
}, [t]),
|
|
3692
|
-
|
|
3693
|
-
}, [
|
|
3694
|
+
}, [t]), K(() => {
|
|
3695
|
+
m && C.current && (C.current.focus(), C.current.select());
|
|
3696
|
+
}, [m]);
|
|
3694
3697
|
const w = () => {
|
|
3695
3698
|
p && l(!0);
|
|
3696
3699
|
}, N = () => {
|
|
3697
|
-
l(!1),
|
|
3698
|
-
},
|
|
3699
|
-
|
|
3700
|
+
l(!1), u.trim() !== "" && u !== t && g ? g(u.trim()) : h(t);
|
|
3701
|
+
}, I = (v) => {
|
|
3702
|
+
v.key === "Enter" ? C.current?.blur() : v.key === "Escape" && (h(t), l(!1));
|
|
3700
3703
|
};
|
|
3701
|
-
return /* @__PURE__ */
|
|
3704
|
+
return /* @__PURE__ */ d(
|
|
3702
3705
|
"div",
|
|
3703
3706
|
{
|
|
3704
|
-
className:
|
|
3707
|
+
className: x(
|
|
3705
3708
|
"p-5 pb-3 border-b border-neutral",
|
|
3706
3709
|
s
|
|
3707
3710
|
),
|
|
3708
3711
|
children: [
|
|
3709
|
-
/* @__PURE__ */
|
|
3710
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */
|
|
3711
|
-
|
|
3712
|
+
/* @__PURE__ */ d("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
3713
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2 text-default", children: [
|
|
3714
|
+
b && /* @__PURE__ */ e(
|
|
3712
3715
|
"button",
|
|
3713
3716
|
{
|
|
3714
3717
|
type: "button",
|
|
3715
|
-
onClick:
|
|
3716
|
-
className:
|
|
3718
|
+
onClick: b,
|
|
3719
|
+
className: x(
|
|
3717
3720
|
"flex items-center text-sm cursor-pointer transition",
|
|
3718
3721
|
f
|
|
3719
3722
|
),
|
|
3720
3723
|
children: /* @__PURE__ */ e(we, { size: 16, color: "currentColor" })
|
|
3721
3724
|
}
|
|
3722
3725
|
),
|
|
3723
|
-
|
|
3726
|
+
m ? /* @__PURE__ */ e(
|
|
3724
3727
|
"input",
|
|
3725
3728
|
{
|
|
3726
3729
|
ref: C,
|
|
3727
3730
|
type: "text",
|
|
3728
|
-
value:
|
|
3729
|
-
onChange: (
|
|
3731
|
+
value: u,
|
|
3732
|
+
onChange: (v) => h(v.target.value),
|
|
3730
3733
|
onBlur: N,
|
|
3731
|
-
onKeyDown:
|
|
3734
|
+
onKeyDown: I,
|
|
3732
3735
|
className: "text-1xl font-semibold bg-transparent border-b-1 border-neutral rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 flex-1"
|
|
3733
3736
|
}
|
|
3734
|
-
) : /* @__PURE__ */
|
|
3737
|
+
) : /* @__PURE__ */ d("div", { className: "group flex items-center gap-1.5 min-w-0", children: [
|
|
3735
3738
|
/* @__PURE__ */ e(
|
|
3736
3739
|
"h2",
|
|
3737
3740
|
{
|
|
3738
3741
|
onClick: w,
|
|
3739
|
-
className:
|
|
3742
|
+
className: x(
|
|
3740
3743
|
"text-2xl font-semibold truncate",
|
|
3741
3744
|
p && "cursor-pointer"
|
|
3742
3745
|
),
|
|
@@ -3755,37 +3758,37 @@ const lr = ({
|
|
|
3755
3758
|
] })
|
|
3756
3759
|
] }) }),
|
|
3757
3760
|
r.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: r.map(
|
|
3758
|
-
(
|
|
3761
|
+
(v) => v.splitOptions && v.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
3759
3762
|
ze,
|
|
3760
3763
|
{
|
|
3761
|
-
label:
|
|
3762
|
-
onClick:
|
|
3763
|
-
icon:
|
|
3764
|
-
variant:
|
|
3765
|
-
options:
|
|
3766
|
-
disabled:
|
|
3764
|
+
label: v.label,
|
|
3765
|
+
onClick: v.onClick,
|
|
3766
|
+
icon: v.icon,
|
|
3767
|
+
variant: v.variant === "primary" ? "primary" : "secondary",
|
|
3768
|
+
options: v.splitOptions,
|
|
3769
|
+
disabled: v.disabled
|
|
3767
3770
|
},
|
|
3768
|
-
|
|
3769
|
-
) : /* @__PURE__ */
|
|
3771
|
+
v.id
|
|
3772
|
+
) : /* @__PURE__ */ d(
|
|
3770
3773
|
"button",
|
|
3771
3774
|
{
|
|
3772
3775
|
type: "button",
|
|
3773
3776
|
onClick: (q) => {
|
|
3774
|
-
q.stopPropagation(), q.target.blur(),
|
|
3777
|
+
q.stopPropagation(), q.target.blur(), v.onClick();
|
|
3775
3778
|
},
|
|
3776
|
-
disabled:
|
|
3777
|
-
className:
|
|
3778
|
-
o__primary:
|
|
3779
|
-
o__secondary:
|
|
3780
|
-
o__ghost:
|
|
3781
|
-
o__destructive:
|
|
3779
|
+
disabled: v.disabled,
|
|
3780
|
+
className: x("btn", {
|
|
3781
|
+
o__primary: v.variant === "primary",
|
|
3782
|
+
o__secondary: v.variant === "secondary" || v.variant === "outline",
|
|
3783
|
+
o__ghost: v.variant === "ghost",
|
|
3784
|
+
o__destructive: v.variant === "destructive"
|
|
3782
3785
|
}),
|
|
3783
3786
|
children: [
|
|
3784
|
-
|
|
3785
|
-
|
|
3787
|
+
v.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: v.icon }),
|
|
3788
|
+
v.label
|
|
3786
3789
|
]
|
|
3787
3790
|
},
|
|
3788
|
-
|
|
3791
|
+
v.id
|
|
3789
3792
|
)
|
|
3790
3793
|
) })
|
|
3791
3794
|
] }),
|
|
@@ -3799,8 +3802,8 @@ const lr = ({
|
|
|
3799
3802
|
backLabel: r = "Back",
|
|
3800
3803
|
className: n,
|
|
3801
3804
|
children: s
|
|
3802
|
-
}) => /* @__PURE__ */
|
|
3803
|
-
a && /* @__PURE__ */
|
|
3805
|
+
}) => /* @__PURE__ */ d("div", { className: x("flex items-center gap-2 mb-3", n), children: [
|
|
3806
|
+
a && /* @__PURE__ */ d(
|
|
3804
3807
|
"button",
|
|
3805
3808
|
{
|
|
3806
3809
|
type: "button",
|
|
@@ -3813,7 +3816,7 @@ const lr = ({
|
|
|
3813
3816
|
}
|
|
3814
3817
|
),
|
|
3815
3818
|
s && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: s }),
|
|
3816
|
-
t.length > 0 && /* @__PURE__ */ e("div", { className:
|
|
3819
|
+
t.length > 0 && /* @__PURE__ */ e("div", { className: x("flex flex-wrap gap-2", !s && "ml-auto"), children: t.map(
|
|
3817
3820
|
(c) => c.splitOptions && c.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
3818
3821
|
ze,
|
|
3819
3822
|
{
|
|
@@ -3825,7 +3828,7 @@ const lr = ({
|
|
|
3825
3828
|
disabled: c.disabled
|
|
3826
3829
|
},
|
|
3827
3830
|
c.id
|
|
3828
|
-
) : /* @__PURE__ */
|
|
3831
|
+
) : /* @__PURE__ */ d(
|
|
3829
3832
|
"button",
|
|
3830
3833
|
{
|
|
3831
3834
|
type: "button",
|
|
@@ -3833,7 +3836,7 @@ const lr = ({
|
|
|
3833
3836
|
f.stopPropagation(), f.target.blur(), c.onClick();
|
|
3834
3837
|
},
|
|
3835
3838
|
disabled: c.disabled,
|
|
3836
|
-
className:
|
|
3839
|
+
className: x("btn", {
|
|
3837
3840
|
o__primary: c.variant === "primary",
|
|
3838
3841
|
o__secondary: c.variant === "secondary" || c.variant === "outline",
|
|
3839
3842
|
o__ghost: c.variant === "ghost",
|
|
@@ -3860,25 +3863,25 @@ const cr = ({
|
|
|
3860
3863
|
size: r = "md",
|
|
3861
3864
|
className: n
|
|
3862
3865
|
}) => {
|
|
3863
|
-
const s = (
|
|
3864
|
-
if (!
|
|
3866
|
+
const s = (m) => {
|
|
3867
|
+
if (!m) return "-";
|
|
3865
3868
|
try {
|
|
3866
|
-
return new Date(
|
|
3869
|
+
return new Date(m).toLocaleDateString("nl-NL", {
|
|
3867
3870
|
year: "numeric",
|
|
3868
3871
|
month: "long",
|
|
3869
3872
|
day: "numeric"
|
|
3870
3873
|
});
|
|
3871
3874
|
} catch {
|
|
3872
|
-
return String(
|
|
3875
|
+
return String(m);
|
|
3873
3876
|
}
|
|
3874
|
-
}, c = (
|
|
3875
|
-
if (!l) return String(
|
|
3876
|
-
const
|
|
3877
|
-
return
|
|
3878
|
-
},
|
|
3879
|
-
(
|
|
3880
|
-
const l = jt(a,
|
|
3881
|
-
if (
|
|
3877
|
+
}, c = (m) => m ? "Ja" : "Nee", f = (m, l) => {
|
|
3878
|
+
if (!l) return String(m || "-");
|
|
3879
|
+
const u = l.find((h) => h.value === m);
|
|
3880
|
+
return u ? u.label : String(m || "-");
|
|
3881
|
+
}, b = ae(
|
|
3882
|
+
(m) => {
|
|
3883
|
+
const l = jt(a, m.name);
|
|
3884
|
+
if (m.type === "array") {
|
|
3882
3885
|
const h = l;
|
|
3883
3886
|
return !h || h.length === 0 ? /* @__PURE__ */ e(
|
|
3884
3887
|
Z,
|
|
@@ -3888,12 +3891,12 @@ const cr = ({
|
|
|
3888
3891
|
className: "text-neutral-500 dark:text-neutral-400",
|
|
3889
3892
|
children: "Geen items"
|
|
3890
3893
|
}
|
|
3891
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: h.map((C, w) => /* @__PURE__ */
|
|
3894
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: h.map((C, w) => /* @__PURE__ */ d(
|
|
3892
3895
|
"div",
|
|
3893
3896
|
{
|
|
3894
3897
|
className: "p-4 border border-neutral-200 dark:border-neutral-700 rounded-lg space-y-3",
|
|
3895
3898
|
children: [
|
|
3896
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */
|
|
3899
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ d(
|
|
3897
3900
|
Z,
|
|
3898
3901
|
{
|
|
3899
3902
|
variant: "label",
|
|
@@ -3901,15 +3904,15 @@ const cr = ({
|
|
|
3901
3904
|
weight: "medium",
|
|
3902
3905
|
className: "text-neutral-700 dark:text-neutral-300",
|
|
3903
3906
|
children: [
|
|
3904
|
-
|
|
3907
|
+
m.label,
|
|
3905
3908
|
" ",
|
|
3906
3909
|
w + 1
|
|
3907
3910
|
]
|
|
3908
3911
|
}
|
|
3909
3912
|
) }),
|
|
3910
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children:
|
|
3911
|
-
const
|
|
3912
|
-
let
|
|
3913
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: m.arrayFields?.map((N) => {
|
|
3914
|
+
const I = C?.[N.name];
|
|
3915
|
+
let v = "-";
|
|
3913
3916
|
switch (N.type) {
|
|
3914
3917
|
case "text":
|
|
3915
3918
|
case "email":
|
|
@@ -3917,30 +3920,30 @@ const cr = ({
|
|
|
3917
3920
|
case "tel":
|
|
3918
3921
|
case "url":
|
|
3919
3922
|
case "textarea":
|
|
3920
|
-
|
|
3923
|
+
v = I || "-";
|
|
3921
3924
|
break;
|
|
3922
3925
|
case "select":
|
|
3923
3926
|
case "radio":
|
|
3924
|
-
|
|
3925
|
-
|
|
3927
|
+
v = f(
|
|
3928
|
+
I,
|
|
3926
3929
|
N.options
|
|
3927
3930
|
);
|
|
3928
3931
|
break;
|
|
3929
3932
|
case "checkbox":
|
|
3930
|
-
|
|
3933
|
+
v = c(I);
|
|
3931
3934
|
break;
|
|
3932
3935
|
case "date":
|
|
3933
|
-
|
|
3936
|
+
v = s(I);
|
|
3934
3937
|
break;
|
|
3935
3938
|
case "custom":
|
|
3936
|
-
|
|
3937
|
-
value:
|
|
3939
|
+
v = N.customComponent?.({
|
|
3940
|
+
value: I
|
|
3938
3941
|
});
|
|
3939
3942
|
break;
|
|
3940
3943
|
default:
|
|
3941
|
-
|
|
3944
|
+
v = String(I || "-");
|
|
3942
3945
|
}
|
|
3943
|
-
return N.format && (
|
|
3946
|
+
return N.format && (v = N.format(I, C)), /* @__PURE__ */ d("div", { className: "space-y-1", children: [
|
|
3944
3947
|
/* @__PURE__ */ e(
|
|
3945
3948
|
Z,
|
|
3946
3949
|
{
|
|
@@ -3956,7 +3959,7 @@ const cr = ({
|
|
|
3956
3959
|
variant: "body",
|
|
3957
3960
|
size: "sm",
|
|
3958
3961
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
3959
|
-
children:
|
|
3962
|
+
children: v
|
|
3960
3963
|
}
|
|
3961
3964
|
)
|
|
3962
3965
|
] }, N.name);
|
|
@@ -3966,10 +3969,10 @@ const cr = ({
|
|
|
3966
3969
|
w
|
|
3967
3970
|
)) });
|
|
3968
3971
|
}
|
|
3969
|
-
if (
|
|
3970
|
-
return
|
|
3971
|
-
if (
|
|
3972
|
-
const h =
|
|
3972
|
+
if (m.type === "custom" && m.customComponent)
|
|
3973
|
+
return m.customComponent({ value: l });
|
|
3974
|
+
if (m.format) {
|
|
3975
|
+
const h = m.format(l, a);
|
|
3973
3976
|
return /* @__PURE__ */ e(
|
|
3974
3977
|
Z,
|
|
3975
3978
|
{
|
|
@@ -3980,31 +3983,31 @@ const cr = ({
|
|
|
3980
3983
|
}
|
|
3981
3984
|
);
|
|
3982
3985
|
}
|
|
3983
|
-
let
|
|
3984
|
-
switch (
|
|
3986
|
+
let u = "-";
|
|
3987
|
+
switch (m.type) {
|
|
3985
3988
|
case "text":
|
|
3986
3989
|
case "email":
|
|
3987
3990
|
case "password":
|
|
3988
3991
|
case "number":
|
|
3989
3992
|
case "tel":
|
|
3990
3993
|
case "url":
|
|
3991
|
-
|
|
3994
|
+
u = l ? String(l) : "-";
|
|
3992
3995
|
break;
|
|
3993
3996
|
case "textarea":
|
|
3994
|
-
|
|
3997
|
+
u = l ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(l || "-") }) : "-";
|
|
3995
3998
|
break;
|
|
3996
3999
|
case "select":
|
|
3997
4000
|
case "radio":
|
|
3998
|
-
|
|
4001
|
+
u = f(l, m.options);
|
|
3999
4002
|
break;
|
|
4000
4003
|
case "checkbox":
|
|
4001
|
-
|
|
4004
|
+
u = c(l);
|
|
4002
4005
|
break;
|
|
4003
4006
|
case "date":
|
|
4004
|
-
|
|
4007
|
+
u = s(l);
|
|
4005
4008
|
break;
|
|
4006
4009
|
default:
|
|
4007
|
-
|
|
4010
|
+
u = l ? String(l) : "-";
|
|
4008
4011
|
}
|
|
4009
4012
|
return /* @__PURE__ */ e(
|
|
4010
4013
|
Z,
|
|
@@ -4012,37 +4015,37 @@ const cr = ({
|
|
|
4012
4015
|
variant: "body",
|
|
4013
4016
|
size: "sm",
|
|
4014
4017
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
4015
|
-
children:
|
|
4018
|
+
children: u
|
|
4016
4019
|
}
|
|
4017
4020
|
);
|
|
4018
4021
|
},
|
|
4019
4022
|
[a]
|
|
4020
|
-
), p =
|
|
4021
|
-
(
|
|
4022
|
-
if (
|
|
4023
|
+
), p = ae(
|
|
4024
|
+
(m) => {
|
|
4025
|
+
if (m.conditional && !m.conditional(a))
|
|
4023
4026
|
return null;
|
|
4024
|
-
const l =
|
|
4027
|
+
const l = m.items.filter((h) => !(h.hidden || h.conditional && !h.conditional(a)));
|
|
4025
4028
|
if (l.length === 0) return null;
|
|
4026
|
-
const
|
|
4029
|
+
const u = x(
|
|
4027
4030
|
"space-y-4",
|
|
4028
4031
|
{
|
|
4029
|
-
"grid gap-4":
|
|
4030
|
-
"flex flex-wrap gap-4":
|
|
4032
|
+
"grid gap-4": m.layout === "grid",
|
|
4033
|
+
"flex flex-wrap gap-4": m.layout === "flex"
|
|
4031
4034
|
},
|
|
4032
|
-
|
|
4033
|
-
"grid-cols-1": !
|
|
4034
|
-
"grid-cols-2":
|
|
4035
|
-
"grid-cols-3":
|
|
4036
|
-
"grid-cols-4":
|
|
4035
|
+
m.layout === "grid" && {
|
|
4036
|
+
"grid-cols-1": !m.columns || m.columns === 1,
|
|
4037
|
+
"grid-cols-2": m.columns === 2,
|
|
4038
|
+
"grid-cols-3": m.columns === 3,
|
|
4039
|
+
"grid-cols-4": m.columns === 4
|
|
4037
4040
|
},
|
|
4038
|
-
|
|
4041
|
+
m.className
|
|
4039
4042
|
);
|
|
4040
|
-
return /* @__PURE__ */
|
|
4043
|
+
return /* @__PURE__ */ d(
|
|
4041
4044
|
"div",
|
|
4042
4045
|
{
|
|
4043
4046
|
className: "grid grid-cols-1 md:grid-cols-3 gap-8 p-6 border border-neutral dark:border-neutral-700 rounded-xl",
|
|
4044
4047
|
children: [
|
|
4045
|
-
/* @__PURE__ */
|
|
4048
|
+
/* @__PURE__ */ d("div", { className: "md:col-span-1", children: [
|
|
4046
4049
|
/* @__PURE__ */ e(
|
|
4047
4050
|
Z,
|
|
4048
4051
|
{
|
|
@@ -4050,23 +4053,23 @@ const cr = ({
|
|
|
4050
4053
|
size: "lg",
|
|
4051
4054
|
weight: "semibold",
|
|
4052
4055
|
className: "text-neutral-900 dark:text-neutral-100",
|
|
4053
|
-
children:
|
|
4056
|
+
children: m.title
|
|
4054
4057
|
}
|
|
4055
4058
|
),
|
|
4056
|
-
|
|
4059
|
+
m.description && /* @__PURE__ */ e(
|
|
4057
4060
|
Z,
|
|
4058
4061
|
{
|
|
4059
4062
|
variant: "body",
|
|
4060
4063
|
size: "sm",
|
|
4061
4064
|
className: "text-neutral-600 dark:text-neutral-400 mt-1",
|
|
4062
|
-
children:
|
|
4065
|
+
children: m.description
|
|
4063
4066
|
}
|
|
4064
4067
|
)
|
|
4065
4068
|
] }),
|
|
4066
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className:
|
|
4069
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: u, children: l.map((h) => /* @__PURE__ */ d(
|
|
4067
4070
|
"div",
|
|
4068
4071
|
{
|
|
4069
|
-
className:
|
|
4072
|
+
className: x(
|
|
4070
4073
|
"space-y-1",
|
|
4071
4074
|
h.width && typeof h.width == "string" && `w-[${h.width}]`,
|
|
4072
4075
|
h.width && typeof h.width == "number" && `col-span-${h.width}`
|
|
@@ -4081,18 +4084,18 @@ const cr = ({
|
|
|
4081
4084
|
children: h.label
|
|
4082
4085
|
}
|
|
4083
4086
|
),
|
|
4084
|
-
|
|
4087
|
+
b(h)
|
|
4085
4088
|
]
|
|
4086
4089
|
},
|
|
4087
4090
|
h.name
|
|
4088
4091
|
)) }) })
|
|
4089
4092
|
]
|
|
4090
4093
|
},
|
|
4091
|
-
|
|
4094
|
+
m.id
|
|
4092
4095
|
);
|
|
4093
4096
|
},
|
|
4094
|
-
[a,
|
|
4095
|
-
),
|
|
4097
|
+
[a, b]
|
|
4098
|
+
), g = x(
|
|
4096
4099
|
"space-y-6",
|
|
4097
4100
|
{
|
|
4098
4101
|
"max-w-md": r === "sm",
|
|
@@ -4102,21 +4105,21 @@ const cr = ({
|
|
|
4102
4105
|
},
|
|
4103
4106
|
n
|
|
4104
4107
|
);
|
|
4105
|
-
return /* @__PURE__ */ e("div", { className:
|
|
4108
|
+
return /* @__PURE__ */ e("div", { className: g, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(p) }) });
|
|
4106
4109
|
}, Te = ({ item: t, isSelectedHandler: a, onClick: r }) => {
|
|
4107
4110
|
const [n, s] = V(!1), c = t.children && t.children.length > 0, f = () => {
|
|
4108
4111
|
c && s(!n);
|
|
4109
|
-
},
|
|
4110
|
-
return /* @__PURE__ */
|
|
4111
|
-
/* @__PURE__ */
|
|
4112
|
+
}, b = a ? a(t.path) : !1;
|
|
4113
|
+
return /* @__PURE__ */ d("li", { children: [
|
|
4114
|
+
/* @__PURE__ */ d(
|
|
4112
4115
|
"div",
|
|
4113
4116
|
{
|
|
4114
|
-
className:
|
|
4117
|
+
className: x(
|
|
4115
4118
|
"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",
|
|
4116
4119
|
{
|
|
4117
|
-
"active-nav-item":
|
|
4118
|
-
"shadow-lvl-0":
|
|
4119
|
-
"font-semibold":
|
|
4120
|
+
"active-nav-item": b && !c,
|
|
4121
|
+
"shadow-lvl-0": b && !c,
|
|
4122
|
+
"font-semibold": b || c || t.children !== void 0
|
|
4120
4123
|
}
|
|
4121
4124
|
),
|
|
4122
4125
|
onClick: () => {
|
|
@@ -4126,18 +4129,18 @@ const cr = ({
|
|
|
4126
4129
|
t.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: t.icon }),
|
|
4127
4130
|
/* @__PURE__ */ e("span", { className: "flex-1", children: t.label }),
|
|
4128
4131
|
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e("span", { className: "ml-2 mr-1.5", children: t.count }),
|
|
4129
|
-
c && /* @__PURE__ */ e("span", { className: `${n ? "collapsed" : ""}`, children: /* @__PURE__ */ e(
|
|
4132
|
+
c && /* @__PURE__ */ e("span", { className: `${n ? "collapsed" : ""}`, children: /* @__PURE__ */ e(He, { className: "w-4 h-4 text-muted" }) })
|
|
4130
4133
|
]
|
|
4131
4134
|
}
|
|
4132
4135
|
),
|
|
4133
|
-
c && !n && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: t.children?.map((p,
|
|
4136
|
+
c && !n && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: t.children?.map((p, g) => /* @__PURE__ */ e(
|
|
4134
4137
|
Te,
|
|
4135
4138
|
{
|
|
4136
4139
|
item: p,
|
|
4137
4140
|
isSelectedHandler: a,
|
|
4138
4141
|
onClick: r
|
|
4139
4142
|
},
|
|
4140
|
-
|
|
4143
|
+
g
|
|
4141
4144
|
)) })
|
|
4142
4145
|
] });
|
|
4143
4146
|
}, ir = ({
|
|
@@ -4147,21 +4150,21 @@ const cr = ({
|
|
|
4147
4150
|
isSelectedHandler: n,
|
|
4148
4151
|
onClick: s,
|
|
4149
4152
|
preMenuItemsComponent: c
|
|
4150
|
-
}) => /* @__PURE__ */
|
|
4151
|
-
/* @__PURE__ */
|
|
4153
|
+
}) => /* @__PURE__ */ d("div", { className: "flex flex-col h-screen mb-6", children: [
|
|
4154
|
+
/* @__PURE__ */ d("div", { className: "sidebar-menu-header", children: [
|
|
4152
4155
|
/* @__PURE__ */ e("span", { className: "text-xl font-semibold text-default mb-2", children: t }),
|
|
4153
|
-
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: a?.map((f,
|
|
4156
|
+
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: a?.map((f, b) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: f }, b)) })
|
|
4154
4157
|
] }),
|
|
4155
4158
|
c && /* @__PURE__ */ e("div", { className: "sidebar-menu-pre-items mb-4", children: c }),
|
|
4156
4159
|
/* @__PURE__ */ e("ul", { children: r.map(
|
|
4157
|
-
(f,
|
|
4160
|
+
(f, b) => !f.path && !f.label && !f.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, b) : /* @__PURE__ */ e(
|
|
4158
4161
|
Te,
|
|
4159
4162
|
{
|
|
4160
4163
|
item: f,
|
|
4161
4164
|
isSelectedHandler: n,
|
|
4162
4165
|
onClick: s
|
|
4163
4166
|
},
|
|
4164
|
-
|
|
4167
|
+
b
|
|
4165
4168
|
)
|
|
4166
4169
|
) })
|
|
4167
4170
|
] }), dr = ({
|
|
@@ -4172,21 +4175,21 @@ const cr = ({
|
|
|
4172
4175
|
align: s = "left",
|
|
4173
4176
|
truncate: c = !1,
|
|
4174
4177
|
className: f,
|
|
4175
|
-
children:
|
|
4178
|
+
children: b,
|
|
4176
4179
|
...p
|
|
4177
4180
|
}) => {
|
|
4178
|
-
const
|
|
4181
|
+
const g = a || Bt(t), m = x(
|
|
4179
4182
|
"font-primary",
|
|
4180
4183
|
// Size variants
|
|
4181
4184
|
{
|
|
4182
|
-
"text-xs":
|
|
4183
|
-
"text-sm":
|
|
4184
|
-
"text-base":
|
|
4185
|
-
"text-lg":
|
|
4186
|
-
"text-xl":
|
|
4187
|
-
"text-2xl":
|
|
4188
|
-
"text-3xl":
|
|
4189
|
-
"text-4xl":
|
|
4185
|
+
"text-xs": g === "xs",
|
|
4186
|
+
"text-sm": g === "sm",
|
|
4187
|
+
"text-base": g === "md",
|
|
4188
|
+
"text-lg": g === "lg",
|
|
4189
|
+
"text-xl": g === "xl",
|
|
4190
|
+
"text-2xl": g === "2xl",
|
|
4191
|
+
"text-3xl": g === "3xl",
|
|
4192
|
+
"text-4xl": g === "4xl"
|
|
4190
4193
|
},
|
|
4191
4194
|
// Weight variants
|
|
4192
4195
|
{
|
|
@@ -4220,7 +4223,7 @@ const cr = ({
|
|
|
4220
4223
|
},
|
|
4221
4224
|
f
|
|
4222
4225
|
), l = `h${t}`;
|
|
4223
|
-
return /* @__PURE__ */ e(l, { className:
|
|
4226
|
+
return /* @__PURE__ */ e(l, { className: m, ...p, children: b });
|
|
4224
4227
|
};
|
|
4225
4228
|
function Bt(t) {
|
|
4226
4229
|
return {
|
|
@@ -4241,7 +4244,7 @@ const ur = ({
|
|
|
4241
4244
|
className: c,
|
|
4242
4245
|
itemClassName: f
|
|
4243
4246
|
}) => {
|
|
4244
|
-
const
|
|
4247
|
+
const b = x(
|
|
4245
4248
|
// Base styles
|
|
4246
4249
|
"space-y-1",
|
|
4247
4250
|
// Variant styles
|
|
@@ -4262,7 +4265,7 @@ const ur = ({
|
|
|
4262
4265
|
"text-lg": n === "lg"
|
|
4263
4266
|
},
|
|
4264
4267
|
c
|
|
4265
|
-
), p = (l,
|
|
4268
|
+
), p = (l, u) => x(
|
|
4266
4269
|
// Base item styles
|
|
4267
4270
|
"transition-colors duration-200",
|
|
4268
4271
|
// Size-based padding
|
|
@@ -4281,44 +4284,44 @@ const ur = ({
|
|
|
4281
4284
|
"opacity-50 cursor-not-allowed": !0
|
|
4282
4285
|
},
|
|
4283
4286
|
f
|
|
4284
|
-
),
|
|
4287
|
+
), g = (l) => {
|
|
4285
4288
|
s && !l.disabled && l.onClick && l.onClick();
|
|
4286
|
-
},
|
|
4287
|
-
s && !
|
|
4289
|
+
}, m = (l, u) => {
|
|
4290
|
+
s && !u.disabled && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), u.onClick?.());
|
|
4288
4291
|
};
|
|
4289
|
-
return a === "ordered" ? /* @__PURE__ */ e("ol", { className:
|
|
4292
|
+
return a === "ordered" ? /* @__PURE__ */ e("ol", { className: b, children: t.map((l, u) => /* @__PURE__ */ e(
|
|
4290
4293
|
"li",
|
|
4291
4294
|
{
|
|
4292
4295
|
className: p(l),
|
|
4293
|
-
onClick: () =>
|
|
4294
|
-
onKeyDown: (h) =>
|
|
4296
|
+
onClick: () => g(l),
|
|
4297
|
+
onKeyDown: (h) => m(h, l),
|
|
4295
4298
|
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
4296
4299
|
role: s ? "button" : void 0,
|
|
4297
4300
|
children: l.content
|
|
4298
4301
|
},
|
|
4299
|
-
l.id ||
|
|
4300
|
-
)) }) : a === "description" ? /* @__PURE__ */ e("dl", { className:
|
|
4302
|
+
l.id || u
|
|
4303
|
+
)) }) : a === "description" ? /* @__PURE__ */ e("dl", { className: b, children: t.map((l, u) => /* @__PURE__ */ e(
|
|
4301
4304
|
"div",
|
|
4302
4305
|
{
|
|
4303
4306
|
className: p(l),
|
|
4304
|
-
onClick: () =>
|
|
4305
|
-
onKeyDown: (h) =>
|
|
4307
|
+
onClick: () => g(l),
|
|
4308
|
+
onKeyDown: (h) => m(h, l),
|
|
4306
4309
|
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
4307
4310
|
role: s ? "button" : void 0,
|
|
4308
4311
|
children: l.content
|
|
4309
4312
|
},
|
|
4310
|
-
l.id ||
|
|
4311
|
-
)) }) : /* @__PURE__ */ e("ul", { className:
|
|
4313
|
+
l.id || u
|
|
4314
|
+
)) }) : /* @__PURE__ */ e("ul", { className: b, children: t.map((l, u) => /* @__PURE__ */ e(
|
|
4312
4315
|
"li",
|
|
4313
4316
|
{
|
|
4314
4317
|
className: p(l),
|
|
4315
|
-
onClick: () =>
|
|
4316
|
-
onKeyDown: (h) =>
|
|
4318
|
+
onClick: () => g(l),
|
|
4319
|
+
onKeyDown: (h) => m(h, l),
|
|
4317
4320
|
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
4318
4321
|
role: s ? "button" : void 0,
|
|
4319
4322
|
children: l.content
|
|
4320
4323
|
},
|
|
4321
|
-
l.id ||
|
|
4324
|
+
l.id || u
|
|
4322
4325
|
)) });
|
|
4323
4326
|
}, mr = ({
|
|
4324
4327
|
commands: t,
|
|
@@ -4328,46 +4331,46 @@ const ur = ({
|
|
|
4328
4331
|
initialCommandPath: s,
|
|
4329
4332
|
initialActiveIndex: c
|
|
4330
4333
|
}) => {
|
|
4331
|
-
const [f,
|
|
4334
|
+
const [f, b] = V(""), [p, g] = V(s || []), [m, l] = V(c || 0), u = X(null), h = X(null), w = (p.length ? t.find((N) => N.id === p[0])?.subCommands || [] : t).filter(
|
|
4332
4335
|
(N) => N.label.toLowerCase().includes(f.toLowerCase())
|
|
4333
4336
|
);
|
|
4334
|
-
return
|
|
4335
|
-
a || (
|
|
4336
|
-
}, [a]),
|
|
4337
|
-
const N = (
|
|
4337
|
+
return K(() => {
|
|
4338
|
+
a || (b(""), g(s || []), l(c || 0));
|
|
4339
|
+
}, [a]), K(() => {
|
|
4340
|
+
const N = (I) => {
|
|
4338
4341
|
if (a) {
|
|
4339
|
-
if (
|
|
4342
|
+
if (I.key === "Escape")
|
|
4340
4343
|
r();
|
|
4341
|
-
else if (
|
|
4344
|
+
else if (I.key === "ArrowUp")
|
|
4342
4345
|
l(
|
|
4343
|
-
(
|
|
4346
|
+
(v) => v > 0 ? v - 1 : w.length - 1
|
|
4344
4347
|
);
|
|
4345
|
-
else if (
|
|
4348
|
+
else if (I.key === "ArrowDown")
|
|
4346
4349
|
l(
|
|
4347
|
-
(
|
|
4350
|
+
(v) => v < w.length - 1 ? v + 1 : 0
|
|
4348
4351
|
);
|
|
4349
|
-
else if (
|
|
4350
|
-
const
|
|
4351
|
-
|
|
4352
|
+
else if (I.key === "Enter") {
|
|
4353
|
+
const v = w[m];
|
|
4354
|
+
v && (v.subCommands ? (g([...p, v.id]), l(0)) : v.action && (v.action(), r()));
|
|
4352
4355
|
}
|
|
4353
4356
|
}
|
|
4354
4357
|
};
|
|
4355
4358
|
return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
|
|
4356
|
-
}, [a, r, w,
|
|
4357
|
-
const N = (
|
|
4358
|
-
|
|
4359
|
+
}, [a, r, w, m, p]), K(() => {
|
|
4360
|
+
const N = (I) => {
|
|
4361
|
+
u.current && !u.current.contains(I.target) && r();
|
|
4359
4362
|
};
|
|
4360
4363
|
return a && document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
4361
|
-
}, [a, r]),
|
|
4364
|
+
}, [a, r]), K(() => {
|
|
4362
4365
|
if (!a) return;
|
|
4363
|
-
h.current?.querySelector(`[data-index="${
|
|
4364
|
-
}, [
|
|
4366
|
+
h.current?.querySelector(`[data-index="${m}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4367
|
+
}, [m, a]), a ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 flex items-center justify-center shadow-lvl-0", children: /* @__PURE__ */ d(
|
|
4365
4368
|
"div",
|
|
4366
4369
|
{
|
|
4367
4370
|
className: "flex flex-col w-full max-w-lg max-h-[80vh] p-2 mx-auto rounded-xl border border-neutral shadow-lg bg-module",
|
|
4368
|
-
ref:
|
|
4371
|
+
ref: u,
|
|
4369
4372
|
children: [
|
|
4370
|
-
/* @__PURE__ */
|
|
4373
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4371
4374
|
/* @__PURE__ */ e($e, { className: "w-4 h-4 text-muted shrink-0" }),
|
|
4372
4375
|
/* @__PURE__ */ e(
|
|
4373
4376
|
"input",
|
|
@@ -4376,31 +4379,31 @@ const ur = ({
|
|
|
4376
4379
|
autoFocus: !0,
|
|
4377
4380
|
placeholder: n?.searchPlaceholder || "Search commands...",
|
|
4378
4381
|
value: f,
|
|
4379
|
-
onChange: (N) =>
|
|
4382
|
+
onChange: (N) => b(N.target.value),
|
|
4380
4383
|
className: "w-full py-2 text-default border-0 focus:outline-none focus:ring-0 focus:border-0 focus:shadow-none bg-transparent"
|
|
4381
4384
|
}
|
|
4382
4385
|
)
|
|
4383
4386
|
] }),
|
|
4384
|
-
/* @__PURE__ */
|
|
4387
|
+
/* @__PURE__ */ d(
|
|
4385
4388
|
"div",
|
|
4386
4389
|
{
|
|
4387
4390
|
ref: h,
|
|
4388
4391
|
className: "mt-2 pt-2 text-sm border-t border-neutral max-h-[50vh] overflow-y-auto",
|
|
4389
4392
|
children: [
|
|
4390
4393
|
w.length === 0 && /* @__PURE__ */ e("div", { className: "text-muted text-center text-sm", children: n?.noCommandsFound || "No commands found" }),
|
|
4391
|
-
w.map((N,
|
|
4394
|
+
w.map((N, I) => /* @__PURE__ */ d(
|
|
4392
4395
|
"div",
|
|
4393
4396
|
{
|
|
4394
|
-
"data-index":
|
|
4395
|
-
className: `flex items-center p-2 cursor-pointer rounded-md text-default ${
|
|
4397
|
+
"data-index": I,
|
|
4398
|
+
className: `flex items-center p-2 cursor-pointer rounded-md text-default ${I === m ? "bg-neutral-container" : ""}`,
|
|
4396
4399
|
onClick: () => {
|
|
4397
|
-
N.subCommands ? (
|
|
4400
|
+
N.subCommands ? (g([...p, N.id]), l(0)) : N.action && (N.action(), r());
|
|
4398
4401
|
},
|
|
4399
|
-
onMouseEnter: () => l(
|
|
4402
|
+
onMouseEnter: () => l(I),
|
|
4400
4403
|
children: [
|
|
4401
4404
|
N.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: N.icon }),
|
|
4402
4405
|
/* @__PURE__ */ e("span", { className: "flex-grow", children: N.label }),
|
|
4403
|
-
N.subCommands && /* @__PURE__ */ e("span", { className: "text-muted", children: /* @__PURE__ */ e(
|
|
4406
|
+
N.subCommands && /* @__PURE__ */ e("span", { className: "text-muted", children: /* @__PURE__ */ e(qe, { className: "w-4 h-4" }) })
|
|
4404
4407
|
]
|
|
4405
4408
|
},
|
|
4406
4409
|
N.id
|
|
@@ -4408,16 +4411,16 @@ const ur = ({
|
|
|
4408
4411
|
]
|
|
4409
4412
|
}
|
|
4410
4413
|
),
|
|
4411
|
-
/* @__PURE__ */
|
|
4412
|
-
/* @__PURE__ */
|
|
4414
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-4 px-3 pt-2 mt-2 text-xs text-muted border-t border-neutral", children: [
|
|
4415
|
+
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
4413
4416
|
/* @__PURE__ */ e("kbd", { className: "inline-flex items-center justify-center min-w-[1.25rem] px-1 py-0.5 rounded border border-neutral bg-module-subtle text-[10px] font-medium not-italic", children: "↑↓" }),
|
|
4414
4417
|
n?.navigate || "to navigate"
|
|
4415
4418
|
] }),
|
|
4416
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
4417
4420
|
/* @__PURE__ */ e("kbd", { className: "inline-flex items-center justify-center min-w-[1.25rem] px-1 py-0.5 rounded border border-neutral bg-module-subtle text-[10px] font-medium not-italic", children: "↵" }),
|
|
4418
4421
|
n?.select || "to select"
|
|
4419
4422
|
] }),
|
|
4420
|
-
/* @__PURE__ */
|
|
4423
|
+
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
4421
4424
|
/* @__PURE__ */ e("kbd", { className: "inline-flex items-center justify-center min-w-[1.25rem] px-1 py-0.5 rounded border border-neutral bg-module-subtle text-[10px] font-medium not-italic", children: "Esc" }),
|
|
4422
4425
|
n?.close || "to close"
|
|
4423
4426
|
] })
|
|
@@ -4495,14 +4498,14 @@ const ur = ({
|
|
|
4495
4498
|
shadow: s,
|
|
4496
4499
|
border: c,
|
|
4497
4500
|
borderColor: f,
|
|
4498
|
-
className:
|
|
4501
|
+
className: b,
|
|
4499
4502
|
children: p,
|
|
4500
|
-
...
|
|
4501
|
-
},
|
|
4503
|
+
...g
|
|
4504
|
+
}, m) => /* @__PURE__ */ e(
|
|
4502
4505
|
"div",
|
|
4503
4506
|
{
|
|
4504
|
-
ref:
|
|
4505
|
-
className:
|
|
4507
|
+
ref: m,
|
|
4508
|
+
className: x(
|
|
4506
4509
|
t && Pt[t],
|
|
4507
4510
|
a && _t[a],
|
|
4508
4511
|
r && Ot[r],
|
|
@@ -4510,15 +4513,15 @@ const ur = ({
|
|
|
4510
4513
|
s && Ft[s],
|
|
4511
4514
|
c && Wt[c],
|
|
4512
4515
|
f && Rt[f],
|
|
4513
|
-
|
|
4516
|
+
b
|
|
4514
4517
|
),
|
|
4515
|
-
...
|
|
4518
|
+
...g,
|
|
4516
4519
|
children: p
|
|
4517
4520
|
}
|
|
4518
4521
|
)
|
|
4519
4522
|
);
|
|
4520
4523
|
Ae.displayName = "Box";
|
|
4521
|
-
const fr = ({ children: t, title: a, ...r }) => /* @__PURE__ */
|
|
4524
|
+
const fr = ({ children: t, title: a, ...r }) => /* @__PURE__ */ d(Ae, { background: "module", radius: "xl", shadow: "sm", ...r, children: [
|
|
4522
4525
|
a && /* @__PURE__ */ e("span", { className: "text-base font-medium text-default mb-2", children: a }),
|
|
4523
4526
|
t
|
|
4524
4527
|
] });
|
|
@@ -4530,44 +4533,44 @@ function hr({
|
|
|
4530
4533
|
componentProps: s,
|
|
4531
4534
|
className: c
|
|
4532
4535
|
}) {
|
|
4533
|
-
const f = X(null), [
|
|
4534
|
-
return X(null),
|
|
4535
|
-
let
|
|
4536
|
+
const f = X(null), [b, p] = V(!0), [g, m] = V(null), l = X(null);
|
|
4537
|
+
return X(null), K(() => {
|
|
4538
|
+
let u = !0;
|
|
4536
4539
|
return (async () => {
|
|
4537
4540
|
p(!0);
|
|
4538
4541
|
try {
|
|
4539
4542
|
const C = await a();
|
|
4540
|
-
if (!
|
|
4543
|
+
if (!u) return;
|
|
4541
4544
|
const w = C.component || C.default || C;
|
|
4542
|
-
|
|
4545
|
+
m(r === "react" ? () => w : () => C);
|
|
4543
4546
|
} catch (C) {
|
|
4544
4547
|
console.error(`[FederatedResource] Load failed: ${t}`, C);
|
|
4545
4548
|
} finally {
|
|
4546
|
-
|
|
4549
|
+
u && p(!1);
|
|
4547
4550
|
}
|
|
4548
4551
|
})(), () => {
|
|
4549
|
-
|
|
4552
|
+
u = !1;
|
|
4550
4553
|
};
|
|
4551
|
-
}, [t, a]),
|
|
4552
|
-
if (
|
|
4553
|
-
const
|
|
4554
|
-
if (
|
|
4554
|
+
}, [t, a]), K(() => {
|
|
4555
|
+
if (b || !g || r === "react") return;
|
|
4556
|
+
const u = f.current;
|
|
4557
|
+
if (u) {
|
|
4555
4558
|
if (r === "svelte") {
|
|
4556
|
-
const h =
|
|
4559
|
+
const h = g.default || g, C = new h({ target: u, props: s || {} });
|
|
4557
4560
|
return l.current = C, () => C.$destroy();
|
|
4558
4561
|
}
|
|
4559
|
-
if (
|
|
4560
|
-
const h =
|
|
4562
|
+
if (g.mount) {
|
|
4563
|
+
const h = g.mount({ container: u, props: s || {} });
|
|
4561
4564
|
return () => {
|
|
4562
|
-
typeof h == "function" ? h() :
|
|
4565
|
+
typeof h == "function" ? h() : g.unmount?.(u);
|
|
4563
4566
|
};
|
|
4564
4567
|
}
|
|
4565
4568
|
}
|
|
4566
|
-
}, [
|
|
4569
|
+
}, [g, r, b]), K(() => {
|
|
4567
4570
|
r === "svelte" && l.current && l.current.$set?.(s);
|
|
4568
|
-
}, [s, r]), /* @__PURE__ */
|
|
4569
|
-
|
|
4570
|
-
r === "react" &&
|
|
4571
|
+
}, [s, r]), /* @__PURE__ */ d("div", { ref: f, className: c, style: { display: "contents" }, children: [
|
|
4572
|
+
b && n,
|
|
4573
|
+
r === "react" && g && /* @__PURE__ */ e(g, { ...s })
|
|
4571
4574
|
] });
|
|
4572
4575
|
}
|
|
4573
4576
|
class pr extends Ge {
|
|
@@ -4584,7 +4587,7 @@ class pr extends Ge {
|
|
|
4584
4587
|
console.error(`[ErrorBoundary] Error in ${this.props.name || "Component"}:`, a, r);
|
|
4585
4588
|
}
|
|
4586
4589
|
render() {
|
|
4587
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
4590
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ d("div", { className: "p-4 m-4 border border-red-200 bg-red-50 rounded-lg", children: [
|
|
4588
4591
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-red-800", children: "Something went wrong" }),
|
|
4589
4592
|
/* @__PURE__ */ e("p", { className: "text-sm text-red-600 mt-1", children: this.props.name ? `Error in ${this.props.name}` : "The component failed to render." }),
|
|
4590
4593
|
/* @__PURE__ */ e(
|
|
@@ -4601,7 +4604,7 @@ class pr extends Ge {
|
|
|
4601
4604
|
export {
|
|
4602
4605
|
nr as Badge,
|
|
4603
4606
|
Ae as Box,
|
|
4604
|
-
|
|
4607
|
+
te as Button,
|
|
4605
4608
|
Qt as ButtonGroup,
|
|
4606
4609
|
fr as Card,
|
|
4607
4610
|
ge as Checkbox,
|
|
@@ -4636,7 +4639,7 @@ export {
|
|
|
4636
4639
|
ue as TextField,
|
|
4637
4640
|
Xt as VideoSurface,
|
|
4638
4641
|
cr as View,
|
|
4639
|
-
|
|
4642
|
+
x as cn,
|
|
4640
4643
|
Jt as createSizes,
|
|
4641
4644
|
Kt as createVariants
|
|
4642
4645
|
};
|