@opencxh/ui-kit 3.94.0 → 3.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +813 -816
- package/dist/index.js.map +1 -1
- package/dist/src/action/SplitButton.d.ts +18 -2
- package/dist/src/overlays/Popover.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { clsx as
|
|
2
|
-
import { jsxs as d, jsx as e, Fragment as
|
|
3
|
-
import { VideoOff as
|
|
4
|
-
import se, { useRef as
|
|
1
|
+
import { clsx as Ae } from "clsx";
|
|
2
|
+
import { jsxs as d, jsx as e, Fragment as we } from "react/jsx-runtime";
|
|
3
|
+
import { VideoOff as je, User as _e, MicOff as Pe, Mic as Be, ChevronDown as Oe, FileText as xe, HardDrive as Ce, X as We, ArrowLeft as ke, Search as $e, FolderPlus as Fe, Upload as Ve, Folder as Se, Pencil as Re, ChevronDownIcon as He, ChevronRight as qe } from "lucide-react";
|
|
4
|
+
import se, { useRef as Z, useEffect as U, forwardRef as ce, useState as B, useMemo as de, useCallback as ae, createContext as Ue, Component as Ge } from "react";
|
|
5
5
|
function p(...t) {
|
|
6
|
-
return
|
|
6
|
+
return Ae(t);
|
|
7
7
|
}
|
|
8
8
|
function er(t) {
|
|
9
9
|
return (a, r) => t[a]?.[r] || "";
|
|
@@ -28,21 +28,21 @@ function nr({
|
|
|
28
28
|
hasVideo: s,
|
|
29
29
|
videoSlot: o,
|
|
30
30
|
className: u,
|
|
31
|
-
fill:
|
|
31
|
+
fill: x
|
|
32
32
|
}) {
|
|
33
33
|
return /* @__PURE__ */ d(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
36
|
className: p(
|
|
37
37
|
"relative rounded-lg overflow-hidden bg-gray-800 flex items-center justify-center",
|
|
38
|
-
|
|
38
|
+
x ? "h-full w-full" : "aspect-video",
|
|
39
39
|
n && "ring-2 ring-emerald-400",
|
|
40
40
|
u
|
|
41
41
|
),
|
|
42
42
|
children: [
|
|
43
|
-
s && o ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: o }) : /* @__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(
|
|
43
|
+
s && o ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: o }) : /* @__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(_e, { className: "w-8 h-8" }) }) }),
|
|
44
44
|
/* @__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: [
|
|
45
|
-
r ? /* @__PURE__ */ e(
|
|
45
|
+
r ? /* @__PURE__ */ e(Pe, { className: "w-3 h-3" }) : /* @__PURE__ */ e(Be, { className: "w-3 h-3" }),
|
|
46
46
|
/* @__PURE__ */ e("span", { className: "truncate max-w-[140px]", children: t })
|
|
47
47
|
] })
|
|
48
48
|
]
|
|
@@ -50,7 +50,7 @@ function nr({
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
function ar({ attach: t, active: a = !0, mirrored: r = !1, className: n }) {
|
|
53
|
-
const s =
|
|
53
|
+
const s = Z(null);
|
|
54
54
|
return U(() => {
|
|
55
55
|
if (!a || !s.current) return;
|
|
56
56
|
const o = t(s.current);
|
|
@@ -69,20 +69,20 @@ function ar({ attach: t, active: a = !0, mirrored: r = !1, className: n }) {
|
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const Ke = {
|
|
73
73
|
primary: "btn o__primary",
|
|
74
74
|
secondary: "btn o__secondary",
|
|
75
75
|
outline: "btn o__secondary",
|
|
76
76
|
ghost: "btn o__tertiary",
|
|
77
77
|
destructive: "btn o__destructive"
|
|
78
|
-
},
|
|
78
|
+
}, Je = {
|
|
79
79
|
xs: "px-2 py-1 text-xs",
|
|
80
80
|
sm: "px-3 py-1.5 text-sm",
|
|
81
81
|
md: "px-4 py-2 text-sm",
|
|
82
82
|
lg: "px-6 py-3 text-base",
|
|
83
83
|
xl: "px-8 py-4 text-lg",
|
|
84
84
|
full: "px-4 py-3 text-base"
|
|
85
|
-
},
|
|
85
|
+
}, Ye = {
|
|
86
86
|
xs: "p-1",
|
|
87
87
|
sm: "p-1.5",
|
|
88
88
|
md: "p-2",
|
|
@@ -98,8 +98,8 @@ const Je = {
|
|
|
98
98
|
leftIcon: s,
|
|
99
99
|
rightIcon: o,
|
|
100
100
|
iconOnly: u = !1,
|
|
101
|
-
className:
|
|
102
|
-
children:
|
|
101
|
+
className: x,
|
|
102
|
+
children: b,
|
|
103
103
|
disabled: g,
|
|
104
104
|
...f
|
|
105
105
|
}, l) => {
|
|
@@ -114,14 +114,14 @@ const Je = {
|
|
|
114
114
|
"inline-flex items-center justify-center transition-colors duration-200",
|
|
115
115
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
116
116
|
// Variant styles
|
|
117
|
-
|
|
117
|
+
Ke[t],
|
|
118
118
|
// Size styles
|
|
119
|
-
u ?
|
|
119
|
+
u ? Ye[a] : Je[a],
|
|
120
120
|
// Full width
|
|
121
121
|
r && "w-full",
|
|
122
122
|
// Loading state
|
|
123
123
|
n && "cursor-wait",
|
|
124
|
-
|
|
124
|
+
x
|
|
125
125
|
),
|
|
126
126
|
disabled: m,
|
|
127
127
|
...f,
|
|
@@ -159,9 +159,9 @@ const Je = {
|
|
|
159
159
|
}
|
|
160
160
|
),
|
|
161
161
|
!n && s && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", !u && "mr-2"), children: s }),
|
|
162
|
-
!u &&
|
|
162
|
+
!u && b,
|
|
163
163
|
!n && o && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", !u && "ml-2"), children: o }),
|
|
164
|
-
u && !n && !s && !o &&
|
|
164
|
+
u && !n && !s && !o && b
|
|
165
165
|
]
|
|
166
166
|
}
|
|
167
167
|
);
|
|
@@ -206,12 +206,12 @@ const lr = ({
|
|
|
206
206
|
external: s = !1,
|
|
207
207
|
className: o,
|
|
208
208
|
children: u,
|
|
209
|
-
href:
|
|
210
|
-
target:
|
|
209
|
+
href: x,
|
|
210
|
+
target: b,
|
|
211
211
|
rel: g,
|
|
212
212
|
...f
|
|
213
213
|
}) => {
|
|
214
|
-
const l = s ||
|
|
214
|
+
const l = s || x && (x.startsWith("http") || x.startsWith("mailto:")), m = p(
|
|
215
215
|
// Base styles
|
|
216
216
|
"inline-flex items-center gap-1 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
217
217
|
// Size variants
|
|
@@ -267,8 +267,8 @@ const lr = ({
|
|
|
267
267
|
o
|
|
268
268
|
), h = {
|
|
269
269
|
...f,
|
|
270
|
-
href: n ? void 0 :
|
|
271
|
-
target: l ? "_blank" :
|
|
270
|
+
href: n ? void 0 : x,
|
|
271
|
+
target: l ? "_blank" : b,
|
|
272
272
|
rel: l ? "noopener noreferrer" : g
|
|
273
273
|
};
|
|
274
274
|
return /* @__PURE__ */ d("a", { className: m, ...h, children: [
|
|
@@ -293,84 +293,136 @@ const lr = ({
|
|
|
293
293
|
}
|
|
294
294
|
)
|
|
295
295
|
] });
|
|
296
|
-
},
|
|
296
|
+
}, Ze = ({
|
|
297
|
+
trigger: t,
|
|
298
|
+
children: a,
|
|
299
|
+
placement: r = "bottom-start",
|
|
300
|
+
className: n,
|
|
301
|
+
disabled: s = !1,
|
|
302
|
+
triggerLabel: o
|
|
303
|
+
}) => {
|
|
304
|
+
const [u, x] = B(!1), [b, g] = B({}), f = Z(null), l = Z(null);
|
|
305
|
+
U(() => {
|
|
306
|
+
if (!u) return;
|
|
307
|
+
const k = (y) => {
|
|
308
|
+
f.current && !f.current.contains(y.target) && x(!1);
|
|
309
|
+
}, w = (y) => {
|
|
310
|
+
y.key === "Escape" && x(!1);
|
|
311
|
+
};
|
|
312
|
+
return document.addEventListener("mousedown", k), document.addEventListener("keydown", w), () => {
|
|
313
|
+
document.removeEventListener("mousedown", k), document.removeEventListener("keydown", w);
|
|
314
|
+
};
|
|
315
|
+
}, [u]);
|
|
316
|
+
const m = (k) => {
|
|
317
|
+
if (k.stopPropagation(), !s) {
|
|
318
|
+
if (!u) {
|
|
319
|
+
const w = l.current?.getBoundingClientRect();
|
|
320
|
+
if (w) {
|
|
321
|
+
const A = {};
|
|
322
|
+
r.startsWith("bottom") ? A.top = w.bottom + 6 : A.bottom = window.innerHeight - w.top + 6, r.endsWith("start") ? A.left = w.left : A.right = window.innerWidth - w.right, g(A);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
x((w) => !w);
|
|
326
|
+
}
|
|
327
|
+
}, h = () => x(!1);
|
|
328
|
+
return /* @__PURE__ */ d("div", { ref: f, className: "relative inline-flex", children: [
|
|
329
|
+
/* @__PURE__ */ e(
|
|
330
|
+
"button",
|
|
331
|
+
{
|
|
332
|
+
ref: l,
|
|
333
|
+
type: "button",
|
|
334
|
+
onClick: m,
|
|
335
|
+
disabled: s,
|
|
336
|
+
"aria-label": o,
|
|
337
|
+
"aria-expanded": u,
|
|
338
|
+
className: p("inline-flex items-center", s && "opacity-50 cursor-not-allowed"),
|
|
339
|
+
children: t
|
|
340
|
+
}
|
|
341
|
+
),
|
|
342
|
+
u && /* @__PURE__ */ e(
|
|
343
|
+
"div",
|
|
344
|
+
{
|
|
345
|
+
className: p(
|
|
346
|
+
"fixed z-[60] bg-module rounded-lg shadow-lg border border-neutral",
|
|
347
|
+
n
|
|
348
|
+
),
|
|
349
|
+
style: b,
|
|
350
|
+
children: typeof a == "function" ? a(h) : a
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
] });
|
|
354
|
+
}, Xe = {
|
|
297
355
|
primary: "btn o__primary",
|
|
298
356
|
secondary: "btn o__secondary",
|
|
299
357
|
outline: "btn o__secondary"
|
|
300
|
-
}, Xe = {
|
|
301
|
-
sm: "px-3 py-1.5 text-sm",
|
|
302
|
-
md: "px-4 py-2 text-sm"
|
|
303
358
|
};
|
|
304
|
-
function
|
|
359
|
+
function Te({
|
|
305
360
|
label: t,
|
|
306
361
|
onClick: a,
|
|
307
362
|
variant: r = "primary",
|
|
308
363
|
size: n = "md",
|
|
309
364
|
icon: s,
|
|
310
365
|
options: o,
|
|
311
|
-
disabled: u = !1
|
|
366
|
+
disabled: u = !1,
|
|
367
|
+
loading: x = !1,
|
|
368
|
+
menuPlacement: b = "bottom-end",
|
|
369
|
+
menuLabel: g = "More options"
|
|
312
370
|
}) {
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const l = (m) => {
|
|
318
|
-
g.current && !g.current.contains(m.target) && x(!1);
|
|
319
|
-
};
|
|
320
|
-
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
321
|
-
}, []), /* @__PURE__ */ d("div", { ref: g, className: "relative inline-flex items-center gap-px", children: [
|
|
322
|
-
/* @__PURE__ */ d(
|
|
323
|
-
"button",
|
|
371
|
+
const f = u || x, l = o.length > 0;
|
|
372
|
+
return /* @__PURE__ */ d("div", { className: "inline-flex items-center gap-px", children: [
|
|
373
|
+
/* @__PURE__ */ e(
|
|
374
|
+
te,
|
|
324
375
|
{
|
|
325
|
-
|
|
376
|
+
variant: r,
|
|
377
|
+
size: n,
|
|
326
378
|
onClick: a,
|
|
327
379
|
disabled: u,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
Se[r],
|
|
333
|
-
Xe[n],
|
|
334
|
-
"!rounded-r-none"
|
|
335
|
-
),
|
|
336
|
-
children: [
|
|
337
|
-
s && /* @__PURE__ */ e("span", { className: "mr-2 flex-shrink-0", children: s }),
|
|
338
|
-
t
|
|
339
|
-
]
|
|
380
|
+
loading: x,
|
|
381
|
+
leftIcon: s,
|
|
382
|
+
className: p(l && "!rounded-r-none"),
|
|
383
|
+
children: t
|
|
340
384
|
}
|
|
341
385
|
),
|
|
342
|
-
/* @__PURE__ */ e(
|
|
343
|
-
|
|
386
|
+
l && /* @__PURE__ */ e(
|
|
387
|
+
Ze,
|
|
344
388
|
{
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
className:
|
|
349
|
-
|
|
350
|
-
"
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
389
|
+
placement: b,
|
|
390
|
+
disabled: f,
|
|
391
|
+
triggerLabel: g,
|
|
392
|
+
className: "min-w-[200px] py-1",
|
|
393
|
+
trigger: /* @__PURE__ */ e(
|
|
394
|
+
"span",
|
|
395
|
+
{
|
|
396
|
+
"aria-hidden": "true",
|
|
397
|
+
className: p(
|
|
398
|
+
"inline-flex items-center justify-center transition-colors duration-200",
|
|
399
|
+
Xe[r],
|
|
400
|
+
n === "sm" ? "px-1.5 py-1.5" : "px-2 py-2",
|
|
401
|
+
"!rounded-l-none"
|
|
402
|
+
),
|
|
403
|
+
children: /* @__PURE__ */ e(Oe, { className: "h-4 w-4" })
|
|
404
|
+
}
|
|
355
405
|
),
|
|
356
|
-
children: /* @__PURE__ */ e(
|
|
406
|
+
children: (m) => /* @__PURE__ */ e(we, { children: o.map((h) => /* @__PURE__ */ d(
|
|
407
|
+
"button",
|
|
408
|
+
{
|
|
409
|
+
type: "button",
|
|
410
|
+
onClick: () => {
|
|
411
|
+
h.onClick(), m();
|
|
412
|
+
},
|
|
413
|
+
className: p(
|
|
414
|
+
"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors",
|
|
415
|
+
h.variant === "destructive" ? "text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900" : "text-default hover:bg-neutral-container"
|
|
416
|
+
),
|
|
417
|
+
children: [
|
|
418
|
+
h.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: h.icon }),
|
|
419
|
+
h.label
|
|
420
|
+
]
|
|
421
|
+
},
|
|
422
|
+
h.id
|
|
423
|
+
)) })
|
|
357
424
|
}
|
|
358
|
-
)
|
|
359
|
-
b && o.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: o.map((l) => /* @__PURE__ */ e(
|
|
360
|
-
"button",
|
|
361
|
-
{
|
|
362
|
-
type: "button",
|
|
363
|
-
onClick: () => {
|
|
364
|
-
l.onClick(), x(!1);
|
|
365
|
-
},
|
|
366
|
-
className: p(
|
|
367
|
-
"w-full text-left px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
|
|
368
|
-
l.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "text-gray-700"
|
|
369
|
-
),
|
|
370
|
-
children: l.label
|
|
371
|
-
},
|
|
372
|
-
l.id
|
|
373
|
-
)) })
|
|
425
|
+
)
|
|
374
426
|
] });
|
|
375
427
|
}
|
|
376
428
|
const Qe = {
|
|
@@ -383,7 +435,7 @@ const Qe = {
|
|
|
383
435
|
md: "text-sm",
|
|
384
436
|
lg: "text-base",
|
|
385
437
|
full: "text-base"
|
|
386
|
-
},
|
|
438
|
+
}, ve = ce(
|
|
387
439
|
({
|
|
388
440
|
label: t,
|
|
389
441
|
helperText: a,
|
|
@@ -392,11 +444,11 @@ const Qe = {
|
|
|
392
444
|
indeterminate: s = !1,
|
|
393
445
|
containerClassName: o,
|
|
394
446
|
labelClassName: u,
|
|
395
|
-
className:
|
|
396
|
-
id:
|
|
447
|
+
className: x,
|
|
448
|
+
id: b,
|
|
397
449
|
...g
|
|
398
450
|
}, f) => {
|
|
399
|
-
const l =
|
|
451
|
+
const l = b || `checkbox-${Math.random().toString(36).substr(2, 9)}`, m = !!r;
|
|
400
452
|
return se.useEffect(() => {
|
|
401
453
|
f && typeof f == "object" && f.current && (f.current.indeterminate = s);
|
|
402
454
|
}, [s, f]), /* @__PURE__ */ d("div", { className: p("flex flex-col", o), children: [
|
|
@@ -419,7 +471,7 @@ const Qe = {
|
|
|
419
471
|
// check glyph is white, so the fill must stay dark in both modes
|
|
420
472
|
// (accent-fill would invert to near-white in dark → invisible check).
|
|
421
473
|
m ? "border-error [&:not(:checked)]:bg-[var(--base-input)] text-error focus:border-error focus:ring-error" : "border-neutral [&:not(:checked)]:bg-[var(--base-input)] text-[#1a1a1a] focus:border-primary focus:ring-primary",
|
|
422
|
-
|
|
474
|
+
x
|
|
423
475
|
),
|
|
424
476
|
...g
|
|
425
477
|
}
|
|
@@ -445,8 +497,8 @@ const Qe = {
|
|
|
445
497
|
] });
|
|
446
498
|
}
|
|
447
499
|
);
|
|
448
|
-
|
|
449
|
-
const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), rt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), nt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }),
|
|
500
|
+
ve.displayName = "Checkbox";
|
|
501
|
+
const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), rt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), nt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }), ye = ce(({
|
|
450
502
|
value: t,
|
|
451
503
|
onChange: a,
|
|
452
504
|
placeholder: r = "Select date",
|
|
@@ -454,22 +506,22 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
454
506
|
required: s = !1,
|
|
455
507
|
size: o = "md",
|
|
456
508
|
className: u,
|
|
457
|
-
minDate:
|
|
458
|
-
maxDate:
|
|
509
|
+
minDate: x,
|
|
510
|
+
maxDate: b,
|
|
459
511
|
format: g = "MM/dd/yyyy"
|
|
460
512
|
}, f) => {
|
|
461
|
-
const [l, m] =
|
|
513
|
+
const [l, m] = B(!1), [h, k] = B(() => t || /* @__PURE__ */ new Date()), w = Z(null);
|
|
462
514
|
U(() => {
|
|
463
|
-
const
|
|
464
|
-
|
|
515
|
+
const D = (W) => {
|
|
516
|
+
w.current && !w.current.contains(W.target) && m(!1);
|
|
465
517
|
};
|
|
466
|
-
return l && document.addEventListener("mousedown",
|
|
467
|
-
document.removeEventListener("mousedown",
|
|
518
|
+
return l && document.addEventListener("mousedown", D), () => {
|
|
519
|
+
document.removeEventListener("mousedown", D);
|
|
468
520
|
};
|
|
469
521
|
}, [l]);
|
|
470
|
-
const
|
|
471
|
-
if (!
|
|
472
|
-
const W =
|
|
522
|
+
const y = (D) => {
|
|
523
|
+
if (!D) return "";
|
|
524
|
+
const W = D.getDate().toString().padStart(2, "0"), V = (D.getMonth() + 1).toString().padStart(2, "0"), i = D.getFullYear();
|
|
473
525
|
switch (g) {
|
|
474
526
|
case "dd/MM/yyyy":
|
|
475
527
|
return `${W}/${V}/${i}`;
|
|
@@ -479,19 +531,19 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
479
531
|
default:
|
|
480
532
|
return `${V}/${W}/${i}`;
|
|
481
533
|
}
|
|
482
|
-
},
|
|
483
|
-
const
|
|
534
|
+
}, A = () => {
|
|
535
|
+
const D = h.getFullYear(), W = h.getMonth(), V = new Date(D, W, 1), i = new Date(V);
|
|
484
536
|
i.setDate(i.getDate() - V.getDay());
|
|
485
|
-
const
|
|
537
|
+
const v = [], E = new Date(i);
|
|
486
538
|
for (let S = 0; S < 42; S++)
|
|
487
|
-
|
|
488
|
-
return
|
|
489
|
-
}, N = (
|
|
490
|
-
|
|
539
|
+
v.push(new Date(E)), E.setDate(E.getDate() + 1);
|
|
540
|
+
return v;
|
|
541
|
+
}, N = (D) => {
|
|
542
|
+
D.getMonth() === h.getMonth() && (x && D < x || b && D > b || (a?.(D), m(!1)));
|
|
491
543
|
}, q = () => {
|
|
492
|
-
|
|
493
|
-
},
|
|
494
|
-
|
|
544
|
+
k(new Date(h.getFullYear(), h.getMonth() - 1, 1));
|
|
545
|
+
}, P = () => {
|
|
546
|
+
k(new Date(h.getFullYear(), h.getMonth() + 1, 1));
|
|
495
547
|
}, G = () => {
|
|
496
548
|
a?.(null), m(!1);
|
|
497
549
|
}, F = p(
|
|
@@ -507,7 +559,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
507
559
|
"px-4 py-3 text-base": o === "full"
|
|
508
560
|
},
|
|
509
561
|
u
|
|
510
|
-
),
|
|
562
|
+
), z = A(), H = [
|
|
511
563
|
"January",
|
|
512
564
|
"February",
|
|
513
565
|
"March",
|
|
@@ -521,14 +573,14 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
521
573
|
"November",
|
|
522
574
|
"December"
|
|
523
575
|
];
|
|
524
|
-
return /* @__PURE__ */ d("div", { ref:
|
|
576
|
+
return /* @__PURE__ */ d("div", { ref: w, className: "relative", children: [
|
|
525
577
|
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
526
578
|
/* @__PURE__ */ e(
|
|
527
579
|
"input",
|
|
528
580
|
{
|
|
529
581
|
ref: f,
|
|
530
582
|
type: "text",
|
|
531
|
-
value:
|
|
583
|
+
value: y(t ?? null),
|
|
532
584
|
placeholder: r,
|
|
533
585
|
disabled: n,
|
|
534
586
|
required: s,
|
|
@@ -566,30 +618,30 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
566
618
|
/* @__PURE__ */ e(
|
|
567
619
|
"button",
|
|
568
620
|
{
|
|
569
|
-
onClick:
|
|
621
|
+
onClick: P,
|
|
570
622
|
className: "p-1 hover:bg-neutral-container rounded",
|
|
571
623
|
children: /* @__PURE__ */ e(nt, {})
|
|
572
624
|
}
|
|
573
625
|
)
|
|
574
626
|
] }),
|
|
575
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((
|
|
576
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children:
|
|
577
|
-
const V =
|
|
627
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((D) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted text-center py-1", children: D }, D)) }),
|
|
628
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: z.map((D, W) => {
|
|
629
|
+
const V = D.getMonth() === h.getMonth(), i = t && D.toDateString() === t.toDateString(), v = D.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), E = !V || x && D < x || b && D > b;
|
|
578
630
|
return /* @__PURE__ */ e(
|
|
579
631
|
"button",
|
|
580
632
|
{
|
|
581
|
-
onClick: () => !E && N(
|
|
633
|
+
onClick: () => !E && N(D),
|
|
582
634
|
disabled: E,
|
|
583
635
|
className: p(
|
|
584
636
|
"w-8 h-8 text-sm rounded transition-colors duration-200",
|
|
585
637
|
{
|
|
586
638
|
"text-default hover:bg-neutral-container": V && !i && !E,
|
|
587
639
|
"bg-primary text-white": i,
|
|
588
|
-
"bg-neutral-container text-default":
|
|
640
|
+
"bg-neutral-container text-default": v && !i,
|
|
589
641
|
"text-muted cursor-not-allowed": E
|
|
590
642
|
}
|
|
591
643
|
),
|
|
592
|
-
children:
|
|
644
|
+
children: D.getDate()
|
|
593
645
|
},
|
|
594
646
|
W
|
|
595
647
|
);
|
|
@@ -669,69 +721,69 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
669
721
|
fullWidth: s = !1,
|
|
670
722
|
startIcon: o = /* @__PURE__ */ e(at, {}),
|
|
671
723
|
loading: u = !1,
|
|
672
|
-
containerClassName:
|
|
673
|
-
labelClassName:
|
|
724
|
+
containerClassName: x,
|
|
725
|
+
labelClassName: b,
|
|
674
726
|
className: g,
|
|
675
727
|
id: f,
|
|
676
728
|
options: l,
|
|
677
729
|
onRemoteSearch: m,
|
|
678
730
|
onSelect: h,
|
|
679
|
-
debounceTime:
|
|
680
|
-
showAllOnOpen:
|
|
681
|
-
value:
|
|
682
|
-
onChange:
|
|
731
|
+
debounceTime: k = 500,
|
|
732
|
+
showAllOnOpen: w = !1,
|
|
733
|
+
value: y,
|
|
734
|
+
onChange: A,
|
|
683
735
|
...N
|
|
684
736
|
}, q) => {
|
|
685
|
-
const
|
|
737
|
+
const P = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, G = !!r, F = Z(null), z = Z(null), [H, D] = B(y || ""), [W, V] = B(!1), [i, v] = B(!1), [E, S] = B(!1);
|
|
686
738
|
U(() => {
|
|
687
|
-
|
|
688
|
-
}, [
|
|
739
|
+
y !== void 0 && D(y);
|
|
740
|
+
}, [y]);
|
|
689
741
|
const M = de(() => {
|
|
690
|
-
if (
|
|
742
|
+
if (w && !E || !H) return l;
|
|
691
743
|
const T = String(H).toLowerCase();
|
|
692
744
|
return l.filter(
|
|
693
|
-
(
|
|
745
|
+
(I) => String(I.label).toLowerCase().includes(T)
|
|
694
746
|
);
|
|
695
|
-
}, [H, l,
|
|
747
|
+
}, [H, l, w, E]);
|
|
696
748
|
U(() => {
|
|
697
749
|
if (!m || !H) {
|
|
698
|
-
|
|
750
|
+
v(!1);
|
|
699
751
|
return;
|
|
700
752
|
}
|
|
701
753
|
const T = setTimeout(async () => {
|
|
702
|
-
|
|
754
|
+
v(!0);
|
|
703
755
|
try {
|
|
704
756
|
await m(String(H));
|
|
705
|
-
} catch (
|
|
706
|
-
console.error("Remote search failed:",
|
|
757
|
+
} catch (I) {
|
|
758
|
+
console.error("Remote search failed:", I);
|
|
707
759
|
} finally {
|
|
708
|
-
|
|
760
|
+
v(!1);
|
|
709
761
|
}
|
|
710
|
-
},
|
|
762
|
+
}, k);
|
|
711
763
|
return () => {
|
|
712
|
-
clearTimeout(T),
|
|
764
|
+
clearTimeout(T), v(!1);
|
|
713
765
|
};
|
|
714
|
-
}, [H,
|
|
715
|
-
const T = (
|
|
716
|
-
F.current && !F.current.contains(
|
|
766
|
+
}, [H, k, m]), U(() => {
|
|
767
|
+
const T = (I) => {
|
|
768
|
+
F.current && !F.current.contains(I.target) && V(!1);
|
|
717
769
|
};
|
|
718
770
|
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
719
771
|
}, []);
|
|
720
772
|
const L = (T) => {
|
|
721
|
-
const
|
|
722
|
-
|
|
773
|
+
const I = T.target.value;
|
|
774
|
+
D(I), V(!0), S(!0), A && A(T);
|
|
723
775
|
}, Q = (T) => {
|
|
724
|
-
|
|
776
|
+
D(T.label), V(!1), S(!1), h && h(T.value);
|
|
725
777
|
}, re = () => {
|
|
726
778
|
(l.length > 0 || m) && (V(!0), S(!1));
|
|
727
|
-
}, X = u || i, $ = W && (M.length > 0 || X),
|
|
779
|
+
}, X = u || i, $ = W && (M.length > 0 || X), j = de(() => q || z, [q]);
|
|
728
780
|
return /* @__PURE__ */ d(
|
|
729
781
|
"div",
|
|
730
782
|
{
|
|
731
783
|
className: ie(
|
|
732
784
|
"flex flex-col",
|
|
733
785
|
s ? "w-full" : "",
|
|
734
|
-
|
|
786
|
+
x || "",
|
|
735
787
|
"relative"
|
|
736
788
|
),
|
|
737
789
|
ref: F,
|
|
@@ -739,11 +791,11 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
739
791
|
t && /* @__PURE__ */ e(
|
|
740
792
|
"label",
|
|
741
793
|
{
|
|
742
|
-
htmlFor:
|
|
794
|
+
htmlFor: P,
|
|
743
795
|
className: ie(
|
|
744
796
|
"block text-sm font-medium mb-1",
|
|
745
797
|
G ? "text-error" : "text-default",
|
|
746
|
-
|
|
798
|
+
b || ""
|
|
747
799
|
),
|
|
748
800
|
children: t
|
|
749
801
|
}
|
|
@@ -753,8 +805,8 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
753
805
|
/* @__PURE__ */ e(
|
|
754
806
|
"input",
|
|
755
807
|
{
|
|
756
|
-
ref:
|
|
757
|
-
id:
|
|
808
|
+
ref: j,
|
|
809
|
+
id: P,
|
|
758
810
|
value: H,
|
|
759
811
|
onChange: L,
|
|
760
812
|
onFocus: re,
|
|
@@ -877,81 +929,81 @@ const ct = {
|
|
|
877
929
|
fullWidth: s = !1,
|
|
878
930
|
options: o,
|
|
879
931
|
placeholder: u,
|
|
880
|
-
containerClassName:
|
|
881
|
-
labelClassName:
|
|
932
|
+
containerClassName: x,
|
|
933
|
+
labelClassName: b,
|
|
882
934
|
className: g,
|
|
883
935
|
id: f,
|
|
884
936
|
searchable: l,
|
|
885
937
|
multiple: m,
|
|
886
938
|
value: h,
|
|
887
|
-
onChange:
|
|
888
|
-
allowCreate:
|
|
889
|
-
onCreateOption:
|
|
890
|
-
...
|
|
939
|
+
onChange: k,
|
|
940
|
+
allowCreate: w,
|
|
941
|
+
onCreateOption: y,
|
|
942
|
+
...A
|
|
891
943
|
}, N) => {
|
|
892
|
-
const q = f || `select-${Math.random().toString(36).substr(2, 9)}`,
|
|
893
|
-
se.useImperativeHandle(N, () =>
|
|
894
|
-
const $ = (
|
|
895
|
-
|
|
944
|
+
const q = f || `select-${Math.random().toString(36).substr(2, 9)}`, P = !!r, [G, F] = se.useState(!1), [z, H] = se.useState(""), D = se.useRef(null), [W, V] = se.useState(o);
|
|
945
|
+
se.useImperativeHandle(N, () => D.current), se.useEffect(() => {
|
|
946
|
+
const $ = (j) => {
|
|
947
|
+
D.current && !D.current.contains(j.target) && F(!1);
|
|
896
948
|
};
|
|
897
949
|
return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
|
|
898
950
|
}, []);
|
|
899
951
|
const i = se.useCallback(
|
|
900
|
-
($,
|
|
901
|
-
(T) => me(T.value) === me(
|
|
952
|
+
($, j) => $.some(
|
|
953
|
+
(T) => me(T.value) === me(j) || me(T.label) === me(j)
|
|
902
954
|
),
|
|
903
955
|
[]
|
|
904
|
-
),
|
|
905
|
-
($,
|
|
906
|
-
const T = [...$],
|
|
956
|
+
), v = se.useCallback(
|
|
957
|
+
($, j) => {
|
|
958
|
+
const T = [...$], I = (ee) => {
|
|
907
959
|
const ne = (ee ?? "").trim();
|
|
908
960
|
ne && (i(T, ne) || T.push({ value: ne, label: ne }));
|
|
909
961
|
};
|
|
910
|
-
return Array.isArray(
|
|
962
|
+
return Array.isArray(j) ? j.forEach(I) : I(j), T;
|
|
911
963
|
},
|
|
912
964
|
[i]
|
|
913
965
|
);
|
|
914
966
|
se.useEffect(() => {
|
|
915
967
|
V(($) => {
|
|
916
|
-
const
|
|
968
|
+
const j = [...o];
|
|
917
969
|
return $.forEach((T) => {
|
|
918
|
-
!i(
|
|
919
|
-
}),
|
|
970
|
+
!i(j, T.value) && !i(j, T.label) && j.push(T);
|
|
971
|
+
}), v(j, h);
|
|
920
972
|
});
|
|
921
|
-
}, [o, h,
|
|
973
|
+
}, [o, h, v, i]);
|
|
922
974
|
const E = ($) => {
|
|
923
975
|
if (m) {
|
|
924
|
-
const
|
|
925
|
-
|
|
976
|
+
const j = Array.isArray(h) ? h : [], T = j.includes($) ? j.filter((I) => I !== $) : [...j, $];
|
|
977
|
+
k?.(T);
|
|
926
978
|
} else
|
|
927
|
-
|
|
979
|
+
k?.($), F(!1), H("");
|
|
928
980
|
}, S = m ? null : W.find(($) => $.value === h), M = m ? W.filter(
|
|
929
981
|
($) => Array.isArray(h) && h.includes($.value)
|
|
930
|
-
) : [], L = l &&
|
|
931
|
-
($) => $.label.toLowerCase().includes(
|
|
932
|
-
) : W, Q = !!
|
|
933
|
-
const
|
|
934
|
-
if (!
|
|
935
|
-
const T =
|
|
936
|
-
value:
|
|
937
|
-
label:
|
|
982
|
+
) : [], L = l && z ? W.filter(
|
|
983
|
+
($) => $.label.toLowerCase().includes(z.toLowerCase())
|
|
984
|
+
) : W, Q = !!w && !!l && !!z.trim() && !i(W, z), re = ($) => {
|
|
985
|
+
const j = $.trim();
|
|
986
|
+
if (!j) return;
|
|
987
|
+
const T = y?.(j) ?? {
|
|
988
|
+
value: j,
|
|
989
|
+
label: j
|
|
938
990
|
};
|
|
939
991
|
if (i(W, T.value) || i(W, T.label)) {
|
|
940
992
|
E(T.value), H(""), m || F(!1);
|
|
941
993
|
return;
|
|
942
994
|
}
|
|
943
|
-
V((
|
|
995
|
+
V((I) => [...I, T]), E(T.value), H(""), m || F(!1);
|
|
944
996
|
}, X = () => m ? M.length > 0 ? M.map(($) => $.label).join(", ") : u || "Select options" : S?.label || u || "Select an option";
|
|
945
997
|
return /* @__PURE__ */ d(
|
|
946
998
|
"div",
|
|
947
999
|
{
|
|
948
|
-
ref:
|
|
1000
|
+
ref: D,
|
|
949
1001
|
className: p(
|
|
950
1002
|
"relative flex flex-col",
|
|
951
1003
|
s && "w-full",
|
|
952
|
-
|
|
1004
|
+
x
|
|
953
1005
|
),
|
|
954
|
-
...
|
|
1006
|
+
...A,
|
|
955
1007
|
children: [
|
|
956
1008
|
t && /* @__PURE__ */ e(
|
|
957
1009
|
"label",
|
|
@@ -960,8 +1012,8 @@ const ct = {
|
|
|
960
1012
|
onClick: () => F(!G),
|
|
961
1013
|
className: p(
|
|
962
1014
|
"block text-sm font-medium mb-1",
|
|
963
|
-
|
|
964
|
-
|
|
1015
|
+
P ? "text-error" : "text-default",
|
|
1016
|
+
b
|
|
965
1017
|
),
|
|
966
1018
|
children: t
|
|
967
1019
|
}
|
|
@@ -979,7 +1031,7 @@ const ct = {
|
|
|
979
1031
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
980
1032
|
"bg-module",
|
|
981
1033
|
ct[n],
|
|
982
|
-
|
|
1034
|
+
P ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
|
|
983
1035
|
g
|
|
984
1036
|
),
|
|
985
1037
|
children: /* @__PURE__ */ e("span", { className: "block truncate", children: X() })
|
|
@@ -991,10 +1043,10 @@ const ct = {
|
|
|
991
1043
|
{
|
|
992
1044
|
type: "text",
|
|
993
1045
|
placeholder: "Search...",
|
|
994
|
-
value:
|
|
1046
|
+
value: z,
|
|
995
1047
|
onChange: ($) => H($.target.value),
|
|
996
1048
|
onKeyDown: ($) => {
|
|
997
|
-
$.key === "Enter" && Q && ($.preventDefault(), re(
|
|
1049
|
+
$.key === "Enter" && Q && ($.preventDefault(), re(z));
|
|
998
1050
|
},
|
|
999
1051
|
className: p(
|
|
1000
1052
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
@@ -1009,10 +1061,10 @@ const ct = {
|
|
|
1009
1061
|
"px-4 py-2 text-sm cursor-pointer",
|
|
1010
1062
|
"text-primary hover:bg-neutral-container"
|
|
1011
1063
|
),
|
|
1012
|
-
onClick: () => re(
|
|
1064
|
+
onClick: () => re(z),
|
|
1013
1065
|
children: [
|
|
1014
1066
|
"+: “",
|
|
1015
|
-
|
|
1067
|
+
z.trim(),
|
|
1016
1068
|
"”"
|
|
1017
1069
|
]
|
|
1018
1070
|
}
|
|
@@ -1023,13 +1075,13 @@ const ct = {
|
|
|
1023
1075
|
{
|
|
1024
1076
|
className: "px-4 py-2 text-sm text-muted cursor-pointer hover:bg-neutral-container",
|
|
1025
1077
|
onClick: () => {
|
|
1026
|
-
|
|
1078
|
+
k?.(""), F(!1);
|
|
1027
1079
|
},
|
|
1028
1080
|
children: u
|
|
1029
1081
|
}
|
|
1030
1082
|
),
|
|
1031
1083
|
L.map(($) => {
|
|
1032
|
-
const
|
|
1084
|
+
const j = m ? Array.isArray(h) && h.includes($.value) : h === $.value;
|
|
1033
1085
|
return /* @__PURE__ */ e(
|
|
1034
1086
|
"li",
|
|
1035
1087
|
{
|
|
@@ -1038,14 +1090,14 @@ const ct = {
|
|
|
1038
1090
|
"px-4 py-2 text-sm cursor-pointer",
|
|
1039
1091
|
"text-default",
|
|
1040
1092
|
$.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-neutral-container",
|
|
1041
|
-
|
|
1093
|
+
j && "font-semibold"
|
|
1042
1094
|
),
|
|
1043
1095
|
children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
|
|
1044
1096
|
m && /* @__PURE__ */ e(
|
|
1045
1097
|
"input",
|
|
1046
1098
|
{
|
|
1047
1099
|
type: "checkbox",
|
|
1048
|
-
checked:
|
|
1100
|
+
checked: j,
|
|
1049
1101
|
readOnly: !0,
|
|
1050
1102
|
className: "mr-3 h-4 w-4 rounded border-neutral [&:not(:checked)]:bg-[var(--base-input)] text-[#1a1a1a] focus:ring-primary"
|
|
1051
1103
|
}
|
|
@@ -1064,7 +1116,7 @@ const ct = {
|
|
|
1064
1116
|
{
|
|
1065
1117
|
className: p(
|
|
1066
1118
|
"mt-1 text-xs",
|
|
1067
|
-
|
|
1119
|
+
P ? "text-error" : "text-muted"
|
|
1068
1120
|
),
|
|
1069
1121
|
children: r || a
|
|
1070
1122
|
}
|
|
@@ -1089,13 +1141,13 @@ const it = {
|
|
|
1089
1141
|
fullWidth: s = !1,
|
|
1090
1142
|
loading: o = !1,
|
|
1091
1143
|
containerClassName: u,
|
|
1092
|
-
labelClassName:
|
|
1093
|
-
className:
|
|
1144
|
+
labelClassName: x,
|
|
1145
|
+
className: b,
|
|
1094
1146
|
id: g,
|
|
1095
1147
|
rows: f = 4,
|
|
1096
1148
|
...l
|
|
1097
1149
|
}, m) => {
|
|
1098
|
-
const h = g || `textarea-${Math.random().toString(36).substr(2, 9)}`,
|
|
1150
|
+
const h = g || `textarea-${Math.random().toString(36).substr(2, 9)}`, k = !!r;
|
|
1099
1151
|
return /* @__PURE__ */ d("div", { className: p("flex flex-col", s && "w-full", u), children: [
|
|
1100
1152
|
t && /* @__PURE__ */ e(
|
|
1101
1153
|
"label",
|
|
@@ -1103,8 +1155,8 @@ const it = {
|
|
|
1103
1155
|
htmlFor: h,
|
|
1104
1156
|
className: p(
|
|
1105
1157
|
"block text-sm font-medium mb-1",
|
|
1106
|
-
|
|
1107
|
-
|
|
1158
|
+
k ? "text-error" : "text-default",
|
|
1159
|
+
x
|
|
1108
1160
|
),
|
|
1109
1161
|
children: t
|
|
1110
1162
|
}
|
|
@@ -1124,8 +1176,8 @@ const it = {
|
|
|
1124
1176
|
// Size styles
|
|
1125
1177
|
it[n],
|
|
1126
1178
|
// State styles
|
|
1127
|
-
|
|
1128
|
-
|
|
1179
|
+
k ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
|
|
1180
|
+
b
|
|
1129
1181
|
),
|
|
1130
1182
|
...l
|
|
1131
1183
|
}
|
|
@@ -1165,7 +1217,7 @@ const it = {
|
|
|
1165
1217
|
{
|
|
1166
1218
|
className: p(
|
|
1167
1219
|
"mt-1 text-xs",
|
|
1168
|
-
|
|
1220
|
+
k ? "text-error" : "text-muted"
|
|
1169
1221
|
),
|
|
1170
1222
|
children: r || a
|
|
1171
1223
|
}
|
|
@@ -1193,22 +1245,22 @@ const dt = {
|
|
|
1193
1245
|
fullWidth: s = !1,
|
|
1194
1246
|
startIcon: o,
|
|
1195
1247
|
endIcon: u,
|
|
1196
|
-
loading:
|
|
1197
|
-
containerClassName:
|
|
1248
|
+
loading: x = !1,
|
|
1249
|
+
containerClassName: b,
|
|
1198
1250
|
labelClassName: g,
|
|
1199
1251
|
className: f,
|
|
1200
1252
|
id: l,
|
|
1201
1253
|
...m
|
|
1202
1254
|
}, h) => {
|
|
1203
|
-
const
|
|
1204
|
-
return /* @__PURE__ */ d("div", { className: p("flex flex-col", s && "w-full",
|
|
1255
|
+
const k = l || `textfield-${Math.random().toString(36).substr(2, 9)}`, w = !!r;
|
|
1256
|
+
return /* @__PURE__ */ d("div", { className: p("flex flex-col", s && "w-full", b), children: [
|
|
1205
1257
|
t && /* @__PURE__ */ e(
|
|
1206
1258
|
"label",
|
|
1207
1259
|
{
|
|
1208
|
-
htmlFor:
|
|
1260
|
+
htmlFor: k,
|
|
1209
1261
|
className: p(
|
|
1210
1262
|
"block text-sm font-medium mb-1",
|
|
1211
|
-
|
|
1263
|
+
w ? "text-error" : "text-default",
|
|
1212
1264
|
g
|
|
1213
1265
|
),
|
|
1214
1266
|
children: t
|
|
@@ -1221,7 +1273,7 @@ const dt = {
|
|
|
1221
1273
|
"input",
|
|
1222
1274
|
{
|
|
1223
1275
|
ref: h,
|
|
1224
|
-
id:
|
|
1276
|
+
id: k,
|
|
1225
1277
|
className: p(
|
|
1226
1278
|
// Base styles
|
|
1227
1279
|
"block w-full rounded-lg border transition-colors duration-200 bg-input",
|
|
@@ -1233,13 +1285,13 @@ const dt = {
|
|
|
1233
1285
|
o && "pl-10",
|
|
1234
1286
|
u && "pr-10",
|
|
1235
1287
|
// State styles
|
|
1236
|
-
|
|
1288
|
+
w ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default focus:border-primary focus:ring-primary",
|
|
1237
1289
|
f
|
|
1238
1290
|
),
|
|
1239
1291
|
...m
|
|
1240
1292
|
}
|
|
1241
1293
|
),
|
|
1242
|
-
(u ||
|
|
1294
|
+
(u || x) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: x ? /* @__PURE__ */ d(
|
|
1243
1295
|
"svg",
|
|
1244
1296
|
{
|
|
1245
1297
|
className: p("animate-spin text-muted", ge[n]),
|
|
@@ -1274,7 +1326,7 @@ const dt = {
|
|
|
1274
1326
|
{
|
|
1275
1327
|
className: p(
|
|
1276
1328
|
"mt-1 text-xs",
|
|
1277
|
-
|
|
1329
|
+
w ? "text-error" : "text-muted"
|
|
1278
1330
|
),
|
|
1279
1331
|
children: r || a
|
|
1280
1332
|
}
|
|
@@ -1291,9 +1343,9 @@ const oe = ({
|
|
|
1291
1343
|
onClick: s,
|
|
1292
1344
|
className: o,
|
|
1293
1345
|
"aria-label": u,
|
|
1294
|
-
...
|
|
1346
|
+
...x
|
|
1295
1347
|
}) => {
|
|
1296
|
-
const
|
|
1348
|
+
const b = typeof a == "number" ? a : ut(a), g = p(
|
|
1297
1349
|
"inline-block",
|
|
1298
1350
|
// Color variants
|
|
1299
1351
|
{
|
|
@@ -1314,7 +1366,7 @@ const oe = ({
|
|
|
1314
1366
|
},
|
|
1315
1367
|
o
|
|
1316
1368
|
), f = {
|
|
1317
|
-
size:
|
|
1369
|
+
size: b,
|
|
1318
1370
|
className: g,
|
|
1319
1371
|
onClick: n ? s : void 0,
|
|
1320
1372
|
"aria-label": u,
|
|
@@ -1323,7 +1375,7 @@ const oe = ({
|
|
|
1323
1375
|
onKeyDown: n ? (l) => {
|
|
1324
1376
|
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), s?.());
|
|
1325
1377
|
} : void 0,
|
|
1326
|
-
...
|
|
1378
|
+
...x
|
|
1327
1379
|
};
|
|
1328
1380
|
return /* @__PURE__ */ e(t, { ...f });
|
|
1329
1381
|
};
|
|
@@ -1343,7 +1395,7 @@ function mt({
|
|
|
1343
1395
|
tableRows: n = 8
|
|
1344
1396
|
}) {
|
|
1345
1397
|
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: [
|
|
1346
|
-
!a && /* @__PURE__ */ d(
|
|
1398
|
+
!a && /* @__PURE__ */ d(we, { children: [
|
|
1347
1399
|
/* @__PURE__ */ e("div", { className: "h-6 bg-neutral-container-emphasis rounded w-1/4" }),
|
|
1348
1400
|
/* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
1349
1401
|
/* @__PURE__ */ e("div", { className: "h-4 bg-neutral-container-emphasis rounded w-3/4" }),
|
|
@@ -1362,12 +1414,12 @@ function mt({
|
|
|
1362
1414
|
"div",
|
|
1363
1415
|
{
|
|
1364
1416
|
className: `grid grid-cols-${r} gap-2 p-3 border-t border-neutral`,
|
|
1365
|
-
children: Array.from({ length: r }).map((u,
|
|
1417
|
+
children: Array.from({ length: r }).map((u, x) => /* @__PURE__ */ e(
|
|
1366
1418
|
"div",
|
|
1367
1419
|
{
|
|
1368
1420
|
className: "h-4 bg-neutral-container-emphasis rounded w-full"
|
|
1369
1421
|
},
|
|
1370
|
-
`cell-${o}-${
|
|
1422
|
+
`cell-${o}-${x}`
|
|
1371
1423
|
))
|
|
1372
1424
|
},
|
|
1373
1425
|
`row-${o}`
|
|
@@ -1383,61 +1435,61 @@ const ft = ({
|
|
|
1383
1435
|
placement: s = "bottom-start",
|
|
1384
1436
|
disabled: o = !1,
|
|
1385
1437
|
className: u,
|
|
1386
|
-
showCheck:
|
|
1387
|
-
header:
|
|
1438
|
+
showCheck: x = !0,
|
|
1439
|
+
header: b
|
|
1388
1440
|
}) => {
|
|
1389
|
-
const [g, f] =
|
|
1441
|
+
const [g, f] = B(!1), [l, m] = B(null), [h, k] = B({ top: 0, left: 0 }), [w, y] = B({}), A = Z(null), N = Z(null), q = Z(null), P = Z(null);
|
|
1390
1442
|
U(() => {
|
|
1391
|
-
const i = (
|
|
1392
|
-
|
|
1443
|
+
const i = (v) => {
|
|
1444
|
+
A.current && (!A.current.contains(v.target) || q.current && !q.current.contains(v.target)) && (f(!1), m(null), P.current && (clearTimeout(P.current), P.current = null));
|
|
1393
1445
|
};
|
|
1394
1446
|
return g && document.addEventListener("mousedown", i), () => {
|
|
1395
1447
|
document.removeEventListener("mousedown", i);
|
|
1396
1448
|
};
|
|
1397
1449
|
}, [g]), U(() => {
|
|
1398
|
-
const i = (
|
|
1399
|
-
|
|
1450
|
+
const i = (v) => {
|
|
1451
|
+
v.key === "Escape" && (f(!1), m(null), P.current && (clearTimeout(P.current), P.current = null));
|
|
1400
1452
|
};
|
|
1401
1453
|
return g && document.addEventListener("keydown", i), () => {
|
|
1402
1454
|
document.removeEventListener("keydown", i);
|
|
1403
1455
|
};
|
|
1404
1456
|
}, [g]), U(() => {
|
|
1405
|
-
if (l &&
|
|
1406
|
-
const i =
|
|
1457
|
+
if (l && A.current) {
|
|
1458
|
+
const i = A.current.querySelector(
|
|
1407
1459
|
`[data-option-value="${l}"]`
|
|
1408
1460
|
);
|
|
1409
1461
|
if (i) {
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
top:
|
|
1413
|
-
left:
|
|
1462
|
+
const v = i.getBoundingClientRect();
|
|
1463
|
+
k({
|
|
1464
|
+
top: v.top,
|
|
1465
|
+
left: v.right + 8
|
|
1414
1466
|
});
|
|
1415
1467
|
}
|
|
1416
1468
|
}
|
|
1417
1469
|
}, [l]), U(() => () => {
|
|
1418
|
-
|
|
1470
|
+
P.current && clearTimeout(P.current);
|
|
1419
1471
|
}, []);
|
|
1420
1472
|
const G = (i) => {
|
|
1421
1473
|
if (i.stopPropagation(), !o) {
|
|
1422
1474
|
if (!g) {
|
|
1423
|
-
const
|
|
1424
|
-
if (
|
|
1475
|
+
const v = N.current?.getBoundingClientRect();
|
|
1476
|
+
if (v) {
|
|
1425
1477
|
const S = {};
|
|
1426
|
-
s.startsWith("bottom") ? S.top =
|
|
1478
|
+
s.startsWith("bottom") ? S.top = v.bottom + 6 : S.bottom = window.innerHeight - v.top + 6, s.endsWith("start") ? S.left = v.left : S.right = window.innerWidth - v.right, y(S);
|
|
1427
1479
|
}
|
|
1428
1480
|
}
|
|
1429
|
-
f(!g), m(null),
|
|
1481
|
+
f(!g), m(null), P.current && (clearTimeout(P.current), P.current = null);
|
|
1430
1482
|
}
|
|
1431
|
-
}, F = (i,
|
|
1432
|
-
i.stopPropagation(), !
|
|
1433
|
-
},
|
|
1434
|
-
|
|
1483
|
+
}, F = (i, v, E) => {
|
|
1484
|
+
i.stopPropagation(), !v.disabled && !v.divider && (!v.children || v.children.length === 0) && (n?.(v.value, E), f(!1), m(null));
|
|
1485
|
+
}, z = (i) => {
|
|
1486
|
+
P.current && (clearTimeout(P.current), P.current = null), i.children && i.children.length > 0 ? m(i.value) : m(null);
|
|
1435
1487
|
}, H = (i) => {
|
|
1436
|
-
i.children && i.children.length > 0 ?
|
|
1488
|
+
i.children && i.children.length > 0 ? P.current = setTimeout(() => {
|
|
1437
1489
|
m(null);
|
|
1438
1490
|
}, 150) : m(null);
|
|
1439
|
-
},
|
|
1440
|
-
i.stopPropagation(), !
|
|
1491
|
+
}, D = (i, v, E) => {
|
|
1492
|
+
i.stopPropagation(), !v.disabled && !v.divider && (n?.(v.value, E), f(!1), m(null));
|
|
1441
1493
|
}, W = p(
|
|
1442
1494
|
"fixed z-[60] min-w-[200px] bg-module rounded-md shadow-lg border border-neutral",
|
|
1443
1495
|
"max-h-60 overflow-auto"
|
|
@@ -1448,7 +1500,7 @@ const ft = ({
|
|
|
1448
1500
|
return /* @__PURE__ */ d(
|
|
1449
1501
|
"div",
|
|
1450
1502
|
{
|
|
1451
|
-
ref:
|
|
1503
|
+
ref: A,
|
|
1452
1504
|
className: p(
|
|
1453
1505
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-neutral-container",
|
|
1454
1506
|
u
|
|
@@ -1466,16 +1518,16 @@ const ft = ({
|
|
|
1466
1518
|
children: t
|
|
1467
1519
|
}
|
|
1468
1520
|
),
|
|
1469
|
-
g && /* @__PURE__ */ e("div", { className: W, style:
|
|
1470
|
-
|
|
1471
|
-
a.map((i,
|
|
1521
|
+
g && /* @__PURE__ */ e("div", { className: W, style: w, children: /* @__PURE__ */ d("div", { className: "p-2", children: [
|
|
1522
|
+
b && (typeof b == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted uppercase tracking-wider px-3 py-2", children: b }) : b),
|
|
1523
|
+
a.map((i, v) => {
|
|
1472
1524
|
if (i.divider)
|
|
1473
1525
|
return /* @__PURE__ */ e(
|
|
1474
1526
|
"div",
|
|
1475
1527
|
{
|
|
1476
1528
|
className: "border-t border-neutral my-2"
|
|
1477
1529
|
},
|
|
1478
|
-
`divider-${
|
|
1530
|
+
`divider-${v}`
|
|
1479
1531
|
);
|
|
1480
1532
|
const E = i.children && i.children.length > 0, S = l === i.value;
|
|
1481
1533
|
return /* @__PURE__ */ d("div", { className: "relative group", children: [
|
|
@@ -1484,7 +1536,7 @@ const ft = ({
|
|
|
1484
1536
|
{
|
|
1485
1537
|
"data-option-value": i.value,
|
|
1486
1538
|
onClick: (M) => F(M, i),
|
|
1487
|
-
onMouseEnter: () =>
|
|
1539
|
+
onMouseEnter: () => z(i),
|
|
1488
1540
|
onMouseLeave: () => H(i),
|
|
1489
1541
|
disabled: i.disabled,
|
|
1490
1542
|
className: p(
|
|
@@ -1503,7 +1555,7 @@ const ft = ({
|
|
|
1503
1555
|
] })
|
|
1504
1556
|
] }),
|
|
1505
1557
|
/* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
|
|
1506
|
-
|
|
1558
|
+
x && r === i.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" }),
|
|
1507
1559
|
E && /* @__PURE__ */ e("span", { className: "text-muted text-xs", children: "▶" })
|
|
1508
1560
|
] })
|
|
1509
1561
|
]
|
|
@@ -1519,10 +1571,10 @@ const ft = ({
|
|
|
1519
1571
|
left: `${h.left}px`
|
|
1520
1572
|
},
|
|
1521
1573
|
onMouseEnter: () => {
|
|
1522
|
-
|
|
1574
|
+
P.current && (clearTimeout(P.current), P.current = null), m(i.value);
|
|
1523
1575
|
},
|
|
1524
1576
|
onMouseLeave: () => {
|
|
1525
|
-
|
|
1577
|
+
P.current = setTimeout(() => {
|
|
1526
1578
|
m(null);
|
|
1527
1579
|
}, 150);
|
|
1528
1580
|
},
|
|
@@ -1541,7 +1593,7 @@ const ft = ({
|
|
|
1541
1593
|
return /* @__PURE__ */ d(
|
|
1542
1594
|
"button",
|
|
1543
1595
|
{
|
|
1544
|
-
onClick: (re) =>
|
|
1596
|
+
onClick: (re) => D(
|
|
1545
1597
|
re,
|
|
1546
1598
|
M,
|
|
1547
1599
|
i.value
|
|
@@ -1561,7 +1613,7 @@ const ft = ({
|
|
|
1561
1613
|
M.description && /* @__PURE__ */ e("span", { className: "text-xs text-muted", children: M.description })
|
|
1562
1614
|
] })
|
|
1563
1615
|
] }),
|
|
1564
|
-
|
|
1616
|
+
x && Q && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" })
|
|
1565
1617
|
]
|
|
1566
1618
|
},
|
|
1567
1619
|
M.value
|
|
@@ -1572,10 +1624,10 @@ const ft = ({
|
|
|
1572
1624
|
] }, i.value);
|
|
1573
1625
|
}),
|
|
1574
1626
|
(() => {
|
|
1575
|
-
const i = a.reduce((
|
|
1576
|
-
if (E.divider) return
|
|
1627
|
+
const i = a.reduce((v, E) => {
|
|
1628
|
+
if (E.divider) return v;
|
|
1577
1629
|
const S = E.children ? E.children.filter((M) => !M.divider).length : 0;
|
|
1578
|
-
return
|
|
1630
|
+
return v + 1 + S;
|
|
1579
1631
|
}, 0);
|
|
1580
1632
|
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: [
|
|
1581
1633
|
i,
|
|
@@ -1677,7 +1729,7 @@ const ft = ({
|
|
|
1677
1729
|
}
|
|
1678
1730
|
)
|
|
1679
1731
|
}
|
|
1680
|
-
),
|
|
1732
|
+
), vt = () => /* @__PURE__ */ e(
|
|
1681
1733
|
"svg",
|
|
1682
1734
|
{
|
|
1683
1735
|
className: "h-4 w-4",
|
|
@@ -1694,7 +1746,7 @@ const ft = ({
|
|
|
1694
1746
|
}
|
|
1695
1747
|
)
|
|
1696
1748
|
}
|
|
1697
|
-
),
|
|
1749
|
+
), yt = () => /* @__PURE__ */ e(
|
|
1698
1750
|
"svg",
|
|
1699
1751
|
{
|
|
1700
1752
|
className: "h-4 w-4",
|
|
@@ -1733,7 +1785,7 @@ const ft = ({
|
|
|
1733
1785
|
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((s) => s !== n)) : t.onChange(n);
|
|
1734
1786
|
};
|
|
1735
1787
|
return t.type === "date" ? /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-[160px]", children: /* @__PURE__ */ e(
|
|
1736
|
-
|
|
1788
|
+
ye,
|
|
1737
1789
|
{
|
|
1738
1790
|
size: "sm",
|
|
1739
1791
|
value: t.value,
|
|
@@ -1783,59 +1835,59 @@ const ft = ({
|
|
|
1783
1835
|
searchPlaceholder: s = "Search...",
|
|
1784
1836
|
filters: o = [],
|
|
1785
1837
|
paginated: u = !1,
|
|
1786
|
-
pageSizeOptions:
|
|
1787
|
-
defaultPageSize:
|
|
1838
|
+
pageSizeOptions: x = [10, 25, 50, 100],
|
|
1839
|
+
defaultPageSize: b = 10,
|
|
1788
1840
|
actions: g = [],
|
|
1789
1841
|
onRowClick: f,
|
|
1790
1842
|
selectable: l = !1,
|
|
1791
1843
|
selectedRows: m = [],
|
|
1792
1844
|
onSelectionChange: h,
|
|
1793
|
-
getRowKey:
|
|
1794
|
-
emptyContent:
|
|
1795
|
-
hoverable:
|
|
1796
|
-
bordered:
|
|
1845
|
+
getRowKey: k = (G, F) => F,
|
|
1846
|
+
emptyContent: w,
|
|
1847
|
+
hoverable: y = !0,
|
|
1848
|
+
bordered: A = !1,
|
|
1797
1849
|
striped: N = !1,
|
|
1798
1850
|
className: q,
|
|
1799
|
-
rowClassName:
|
|
1851
|
+
rowClassName: P
|
|
1800
1852
|
}) => {
|
|
1801
|
-
const [G, F] =
|
|
1853
|
+
const [G, F] = B(""), [z, H] = B({
|
|
1802
1854
|
column: null,
|
|
1803
1855
|
direction: null
|
|
1804
|
-
}), [
|
|
1856
|
+
}), [D, W] = B({
|
|
1805
1857
|
page: 0,
|
|
1806
|
-
pageSize:
|
|
1807
|
-
}), V =
|
|
1858
|
+
pageSize: b
|
|
1859
|
+
}), V = Z(null), i = de(() => {
|
|
1808
1860
|
let c = t;
|
|
1809
1861
|
if (n && G.trim()) {
|
|
1810
1862
|
const C = a.filter(
|
|
1811
1863
|
(R) => R.searchable !== !1
|
|
1812
1864
|
), O = G.toLowerCase();
|
|
1813
1865
|
c = c.filter((R) => C.some((_) => {
|
|
1814
|
-
const
|
|
1815
|
-
return String(
|
|
1866
|
+
const J = typeof _.accessor == "function" ? _.accessor(R) : R[_.accessor];
|
|
1867
|
+
return String(J || "").toLowerCase().includes(O);
|
|
1816
1868
|
}));
|
|
1817
1869
|
}
|
|
1818
1870
|
return o.forEach((C) => {
|
|
1819
1871
|
C.value && C.value !== "all" && (c = c.filter((O) => {
|
|
1820
|
-
const R = a.find((
|
|
1872
|
+
const R = a.find((J) => J.id === C.id);
|
|
1821
1873
|
if (!R) return !0;
|
|
1822
1874
|
const _ = typeof R.accessor == "function" ? R.accessor(O) : O[R.accessor];
|
|
1823
1875
|
return String(_ || "") === C.value;
|
|
1824
1876
|
}));
|
|
1825
1877
|
}), c;
|
|
1826
|
-
}, [t, G, a, n, o]),
|
|
1827
|
-
if (!
|
|
1828
|
-
const c = a.find((C) => C.id ===
|
|
1878
|
+
}, [t, G, a, n, o]), v = de(() => {
|
|
1879
|
+
if (!z.column || !z.direction) return i;
|
|
1880
|
+
const c = a.find((C) => C.id === z.column);
|
|
1829
1881
|
return c ? [...i].sort((C, O) => {
|
|
1830
1882
|
const R = typeof c.accessor == "function" ? c.accessor(C) : C[c.accessor], _ = typeof c.accessor == "function" ? c.accessor(O) : O[c.accessor];
|
|
1831
|
-
let
|
|
1832
|
-
return R < _ ?
|
|
1883
|
+
let J = 0;
|
|
1884
|
+
return R < _ ? J = -1 : R > _ && (J = 1), z.direction === "desc" ? -J : J;
|
|
1833
1885
|
}) : i;
|
|
1834
|
-
}, [i,
|
|
1835
|
-
if (!u) return
|
|
1836
|
-
const c =
|
|
1837
|
-
return
|
|
1838
|
-
}, [
|
|
1886
|
+
}, [i, z, a]), E = de(() => {
|
|
1887
|
+
if (!u) return v;
|
|
1888
|
+
const c = D.page * D.pageSize, C = c + D.pageSize;
|
|
1889
|
+
return v.slice(c, C);
|
|
1890
|
+
}, [v, D, u]), S = ae(
|
|
1839
1891
|
(c) => {
|
|
1840
1892
|
a.find((O) => O.id === c)?.sortable && H((O) => O.column !== c ? { column: c, direction: "asc" } : O.direction === "asc" ? { column: c, direction: "desc" } : { column: null, direction: null });
|
|
1841
1893
|
},
|
|
@@ -1847,12 +1899,12 @@ const ft = ({
|
|
|
1847
1899
|
}, []), Q = ae(
|
|
1848
1900
|
(c, C) => {
|
|
1849
1901
|
if (!h) return;
|
|
1850
|
-
const O =
|
|
1851
|
-
m.map((R, _) =>
|
|
1852
|
-
(R, _) =>
|
|
1902
|
+
const O = k(c, 0);
|
|
1903
|
+
m.map((R, _) => k(R, _)), h(C ? [...m, c] : m.filter(
|
|
1904
|
+
(R, _) => k(m[_], _) !== O
|
|
1853
1905
|
));
|
|
1854
1906
|
},
|
|
1855
|
-
[m, h,
|
|
1907
|
+
[m, h, k]
|
|
1856
1908
|
), re = ae(
|
|
1857
1909
|
(c) => {
|
|
1858
1910
|
h && h(c ? [...E] : []);
|
|
@@ -1861,18 +1913,18 @@ const ft = ({
|
|
|
1861
1913
|
);
|
|
1862
1914
|
U(() => {
|
|
1863
1915
|
W((c) => ({ ...c, page: 0 }));
|
|
1864
|
-
}, [G,
|
|
1916
|
+
}, [G, z]), U(() => {
|
|
1865
1917
|
W((c) => ({ ...c, page: 0 }));
|
|
1866
1918
|
}, [o.map((c) => c.value).join(",")]);
|
|
1867
|
-
const X =
|
|
1868
|
-
const C =
|
|
1919
|
+
const X = v.length, $ = Math.ceil(X / D.pageSize), j = D.page * D.pageSize + 1, T = Math.min(j + D.pageSize - 1, X), I = E.length > 0 && E.every((c) => {
|
|
1920
|
+
const C = k(c, 0);
|
|
1869
1921
|
return m.some(
|
|
1870
|
-
(O, R) =>
|
|
1922
|
+
(O, R) => k(O, R) === C
|
|
1871
1923
|
);
|
|
1872
1924
|
}), ee = E.some((c) => {
|
|
1873
|
-
const C =
|
|
1925
|
+
const C = k(c, 0);
|
|
1874
1926
|
return m.some(
|
|
1875
|
-
(O, R) =>
|
|
1927
|
+
(O, R) => k(O, R) === C
|
|
1876
1928
|
);
|
|
1877
1929
|
}), ne = p(
|
|
1878
1930
|
"w-full text-sm leading-5 text-[var(--text-default)] border-collapse",
|
|
@@ -1880,7 +1932,7 @@ const ft = ({
|
|
|
1880
1932
|
), K = p("bg-[var(--base-module)]"), le = p(
|
|
1881
1933
|
"text-[var(--text-default)] p-3 border-b border-[var(--neutral-border)]"
|
|
1882
1934
|
), he = p("h-12", {
|
|
1883
|
-
"hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]":
|
|
1935
|
+
"hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]": y,
|
|
1884
1936
|
"cursor-pointer": f
|
|
1885
1937
|
});
|
|
1886
1938
|
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
@@ -1912,9 +1964,9 @@ const ft = ({
|
|
|
1912
1964
|
"input",
|
|
1913
1965
|
{
|
|
1914
1966
|
type: "checkbox",
|
|
1915
|
-
checked:
|
|
1967
|
+
checked: I,
|
|
1916
1968
|
ref: (c) => {
|
|
1917
|
-
c && (c.indeterminate = ee && !
|
|
1969
|
+
c && (c.indeterminate = ee && !I);
|
|
1918
1970
|
},
|
|
1919
1971
|
onChange: (c) => re(c.target.checked),
|
|
1920
1972
|
className: "rounded border-neutral [&:not(:checked)]:bg-[var(--base-input)] text-[#1a1a1a]"
|
|
@@ -1945,19 +1997,19 @@ const ft = ({
|
|
|
1945
1997
|
{
|
|
1946
1998
|
className: p(
|
|
1947
1999
|
"flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1948
|
-
|
|
2000
|
+
z.column === c.id && "opacity-100"
|
|
1949
2001
|
),
|
|
1950
2002
|
children: [
|
|
1951
2003
|
/* @__PURE__ */ e(
|
|
1952
2004
|
pt,
|
|
1953
2005
|
{
|
|
1954
|
-
active:
|
|
2006
|
+
active: z.column === c.id && z.direction === "asc"
|
|
1955
2007
|
}
|
|
1956
2008
|
),
|
|
1957
2009
|
/* @__PURE__ */ e(
|
|
1958
2010
|
xt,
|
|
1959
2011
|
{
|
|
1960
|
-
active:
|
|
2012
|
+
active: z.column === c.id && z.direction === "desc"
|
|
1961
2013
|
}
|
|
1962
2014
|
)
|
|
1963
2015
|
]
|
|
@@ -1977,11 +2029,11 @@ const ft = ({
|
|
|
1977
2029
|
le,
|
|
1978
2030
|
"text-center py-8 text-muted"
|
|
1979
2031
|
),
|
|
1980
|
-
children:
|
|
2032
|
+
children: w || "No data available"
|
|
1981
2033
|
}
|
|
1982
2034
|
) }) : E.map((c, C) => {
|
|
1983
|
-
const O =
|
|
1984
|
-
(_,
|
|
2035
|
+
const O = k(c, C), R = m.some(
|
|
2036
|
+
(_, J) => k(_, J) === O
|
|
1985
2037
|
);
|
|
1986
2038
|
return /* @__PURE__ */ d(
|
|
1987
2039
|
"tr",
|
|
@@ -1989,7 +2041,7 @@ const ft = ({
|
|
|
1989
2041
|
className: p(
|
|
1990
2042
|
he,
|
|
1991
2043
|
{ "bg-accent-container": R },
|
|
1992
|
-
|
|
2044
|
+
P?.(c, C)
|
|
1993
2045
|
),
|
|
1994
2046
|
onClick: (_) => {
|
|
1995
2047
|
_.stopPropagation(), f?.(c, C);
|
|
@@ -2007,7 +2059,7 @@ const ft = ({
|
|
|
2007
2059
|
}
|
|
2008
2060
|
) }),
|
|
2009
2061
|
a.map((_) => {
|
|
2010
|
-
const
|
|
2062
|
+
const J = typeof _.accessor == "function" ? _.accessor(c) : c[_.accessor];
|
|
2011
2063
|
return /* @__PURE__ */ e(
|
|
2012
2064
|
"td",
|
|
2013
2065
|
{
|
|
@@ -2018,7 +2070,7 @@ const ft = ({
|
|
|
2018
2070
|
"sticky left-0 bg-module": _.sticky === "left",
|
|
2019
2071
|
"sticky right-0 bg-module": _.sticky === "right"
|
|
2020
2072
|
}),
|
|
2021
|
-
children: _.cell ? _.cell(
|
|
2073
|
+
children: _.cell ? _.cell(J, c, C) : String(J || "")
|
|
2022
2074
|
},
|
|
2023
2075
|
_.id
|
|
2024
2076
|
);
|
|
@@ -2037,10 +2089,10 @@ const ft = ({
|
|
|
2037
2089
|
disabled: _.disabled?.(c)
|
|
2038
2090
|
})),
|
|
2039
2091
|
onSelect: (_) => {
|
|
2040
|
-
const
|
|
2092
|
+
const J = g.find(
|
|
2041
2093
|
(pe) => pe.id === _
|
|
2042
2094
|
);
|
|
2043
|
-
|
|
2095
|
+
J && J.onClick(c, C);
|
|
2044
2096
|
},
|
|
2045
2097
|
placement: "bottom-end"
|
|
2046
2098
|
}
|
|
@@ -2056,7 +2108,7 @@ const ft = ({
|
|
|
2056
2108
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-4", children: [
|
|
2057
2109
|
/* @__PURE__ */ d("span", { className: "text-sm text-muted", children: [
|
|
2058
2110
|
"Showing ",
|
|
2059
|
-
|
|
2111
|
+
j,
|
|
2060
2112
|
" to ",
|
|
2061
2113
|
T,
|
|
2062
2114
|
" of ",
|
|
@@ -2068,10 +2120,10 @@ const ft = ({
|
|
|
2068
2120
|
/* @__PURE__ */ e(
|
|
2069
2121
|
"select",
|
|
2070
2122
|
{
|
|
2071
|
-
value:
|
|
2123
|
+
value: D.pageSize,
|
|
2072
2124
|
onChange: (c) => L(Number(c.target.value)),
|
|
2073
2125
|
className: "border border-[var(--neutral-border)] text-[var(--text-default)] rounded-md px-2 py-1 text-sm bg-[var(--base-input)] w-16",
|
|
2074
|
-
children:
|
|
2126
|
+
children: x.map((c) => /* @__PURE__ */ e("option", { value: c, children: c }, c))
|
|
2075
2127
|
}
|
|
2076
2128
|
)
|
|
2077
2129
|
] })
|
|
@@ -2083,9 +2135,9 @@ const ft = ({
|
|
|
2083
2135
|
size: "sm",
|
|
2084
2136
|
variant: "ghost",
|
|
2085
2137
|
onClick: () => M(0),
|
|
2086
|
-
disabled:
|
|
2138
|
+
disabled: D.page === 0,
|
|
2087
2139
|
iconOnly: !0,
|
|
2088
|
-
children: /* @__PURE__ */ e(
|
|
2140
|
+
children: /* @__PURE__ */ e(vt, {})
|
|
2089
2141
|
}
|
|
2090
2142
|
),
|
|
2091
2143
|
/* @__PURE__ */ e(
|
|
@@ -2093,15 +2145,15 @@ const ft = ({
|
|
|
2093
2145
|
{
|
|
2094
2146
|
size: "sm",
|
|
2095
2147
|
variant: "ghost",
|
|
2096
|
-
onClick: () => M(
|
|
2097
|
-
disabled:
|
|
2148
|
+
onClick: () => M(D.page - 1),
|
|
2149
|
+
disabled: D.page === 0,
|
|
2098
2150
|
iconOnly: !0,
|
|
2099
2151
|
children: /* @__PURE__ */ e(bt, {})
|
|
2100
2152
|
}
|
|
2101
2153
|
),
|
|
2102
2154
|
/* @__PURE__ */ d("span", { className: "px-3 py-1 text-sm text-muted", children: [
|
|
2103
2155
|
"Page ",
|
|
2104
|
-
|
|
2156
|
+
D.page + 1,
|
|
2105
2157
|
" of ",
|
|
2106
2158
|
$
|
|
2107
2159
|
] }),
|
|
@@ -2110,8 +2162,8 @@ const ft = ({
|
|
|
2110
2162
|
{
|
|
2111
2163
|
size: "sm",
|
|
2112
2164
|
variant: "ghost",
|
|
2113
|
-
onClick: () => M(
|
|
2114
|
-
disabled:
|
|
2165
|
+
onClick: () => M(D.page + 1),
|
|
2166
|
+
disabled: D.page >= $ - 1,
|
|
2115
2167
|
iconOnly: !0,
|
|
2116
2168
|
children: /* @__PURE__ */ e(gt, {})
|
|
2117
2169
|
}
|
|
@@ -2122,45 +2174,45 @@ const ft = ({
|
|
|
2122
2174
|
size: "sm",
|
|
2123
2175
|
variant: "ghost",
|
|
2124
2176
|
onClick: () => M($ - 1),
|
|
2125
|
-
disabled:
|
|
2177
|
+
disabled: D.page >= $ - 1,
|
|
2126
2178
|
iconOnly: !0,
|
|
2127
|
-
children: /* @__PURE__ */ e(
|
|
2179
|
+
children: /* @__PURE__ */ e(yt, {})
|
|
2128
2180
|
}
|
|
2129
2181
|
)
|
|
2130
2182
|
] })
|
|
2131
2183
|
] })
|
|
2132
2184
|
] });
|
|
2133
|
-
}, wt =
|
|
2185
|
+
}, wt = Ue(null), or = ({
|
|
2134
2186
|
items: t,
|
|
2135
2187
|
activeTab: a,
|
|
2136
2188
|
onTabChange: r,
|
|
2137
2189
|
className: n
|
|
2138
2190
|
}) => {
|
|
2139
|
-
const [s, o] =
|
|
2140
|
-
r ? r(
|
|
2191
|
+
const [s, o] = B(t[0]?.id || ""), u = a || s, x = (b) => {
|
|
2192
|
+
r ? r(b) : o(b);
|
|
2141
2193
|
};
|
|
2142
|
-
return /* @__PURE__ */ e("div", { className: p("border-b border-neutral-200 dark:border-neutral-700", n), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((
|
|
2194
|
+
return /* @__PURE__ */ e("div", { className: p("border-b border-neutral-200 dark:border-neutral-700", n), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((b) => /* @__PURE__ */ e(
|
|
2143
2195
|
"button",
|
|
2144
2196
|
{
|
|
2145
|
-
onClick: () => !
|
|
2146
|
-
disabled:
|
|
2197
|
+
onClick: () => !b.disabled && x(b.id),
|
|
2198
|
+
disabled: b.disabled,
|
|
2147
2199
|
className: p(
|
|
2148
2200
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-200",
|
|
2149
2201
|
{
|
|
2150
|
-
"border-primary text-primary": u ===
|
|
2151
|
-
"border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": u !==
|
|
2152
|
-
"border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600":
|
|
2202
|
+
"border-primary text-primary": u === b.id,
|
|
2203
|
+
"border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": u !== b.id && !b.disabled,
|
|
2204
|
+
"border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": b.disabled
|
|
2153
2205
|
}
|
|
2154
2206
|
),
|
|
2155
2207
|
children: /* @__PURE__ */ d("span", { className: "flex items-center gap-2", children: [
|
|
2156
|
-
|
|
2157
|
-
|
|
2208
|
+
b.label,
|
|
2209
|
+
b.badge && /* @__PURE__ */ e("span", { className: p(
|
|
2158
2210
|
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
|
2159
|
-
u ===
|
|
2160
|
-
), children:
|
|
2211
|
+
u === b.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
|
|
2212
|
+
), children: b.badge })
|
|
2161
2213
|
] })
|
|
2162
2214
|
},
|
|
2163
|
-
|
|
2215
|
+
b.id
|
|
2164
2216
|
)) }) });
|
|
2165
2217
|
}, kt = ({
|
|
2166
2218
|
items: t,
|
|
@@ -2171,14 +2223,14 @@ const ft = ({
|
|
|
2171
2223
|
size: o = "md",
|
|
2172
2224
|
className: u
|
|
2173
2225
|
}) => {
|
|
2174
|
-
const [
|
|
2226
|
+
const [x, b] = B(
|
|
2175
2227
|
a || r || t[0]?.id || ""
|
|
2176
|
-
), g = r ||
|
|
2177
|
-
n ? n(
|
|
2228
|
+
), g = r || x, f = (w) => {
|
|
2229
|
+
n ? n(w) : b(w);
|
|
2178
2230
|
}, l = {
|
|
2179
2231
|
activeTab: g,
|
|
2180
2232
|
setActiveTab: f
|
|
2181
|
-
}, m = t.find((
|
|
2233
|
+
}, m = t.find((w) => w.id === g), h = p(
|
|
2182
2234
|
"flex",
|
|
2183
2235
|
{
|
|
2184
2236
|
"border-b border-neutral-200 dark:border-neutral-700 px-2": s === "default" || s === "underline",
|
|
@@ -2187,8 +2239,8 @@ const ft = ({
|
|
|
2187
2239
|
"space-x-8": s === "default" || s === "underline"
|
|
2188
2240
|
},
|
|
2189
2241
|
u
|
|
2190
|
-
),
|
|
2191
|
-
const
|
|
2242
|
+
), k = (w, y) => {
|
|
2243
|
+
const A = "transition-colors duration-200 font-medium", N = {
|
|
2192
2244
|
"text-xs px-2 py-1": o === "sm",
|
|
2193
2245
|
"text-sm px-3 py-2": o === "md",
|
|
2194
2246
|
"text-base px-4 py-3": o === "lg"
|
|
@@ -2199,36 +2251,36 @@ const ft = ({
|
|
|
2199
2251
|
"rounded-md": s === "pills",
|
|
2200
2252
|
// Underline variant
|
|
2201
2253
|
"border-b-2 pb-2": s === "underline"
|
|
2202
|
-
},
|
|
2203
|
-
"opacity-50 cursor-not-allowed":
|
|
2204
|
-
"cursor-pointer": !
|
|
2205
|
-
}, G =
|
|
2254
|
+
}, P = {
|
|
2255
|
+
"opacity-50 cursor-not-allowed": w.disabled,
|
|
2256
|
+
"cursor-pointer": !w.disabled
|
|
2257
|
+
}, G = y ? {
|
|
2206
2258
|
"border-primary text-primary": s === "default" || s === "underline",
|
|
2207
2259
|
"bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": s === "pills"
|
|
2208
|
-
} : {}, F = !
|
|
2260
|
+
} : {}, F = !y && !w.disabled ? {
|
|
2209
2261
|
"border-transparent text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "default",
|
|
2210
2262
|
"text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "pills",
|
|
2211
2263
|
"border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": s === "underline"
|
|
2212
2264
|
} : {};
|
|
2213
|
-
return p(
|
|
2265
|
+
return p(A, N, q, P, G, F);
|
|
2214
2266
|
};
|
|
2215
2267
|
return /* @__PURE__ */ e(wt.Provider, { value: l, children: /* @__PURE__ */ d("div", { children: [
|
|
2216
|
-
/* @__PURE__ */ e("div", { className: h, role: "tablist", children: t.map((
|
|
2268
|
+
/* @__PURE__ */ e("div", { className: h, role: "tablist", children: t.map((w) => /* @__PURE__ */ e(
|
|
2217
2269
|
"button",
|
|
2218
2270
|
{
|
|
2219
2271
|
type: "button",
|
|
2220
2272
|
role: "tab",
|
|
2221
|
-
"aria-selected": g ===
|
|
2222
|
-
"aria-controls": `tabpanel-${
|
|
2223
|
-
disabled:
|
|
2224
|
-
onClick: () => !
|
|
2225
|
-
className: w
|
|
2273
|
+
"aria-selected": g === w.id,
|
|
2274
|
+
"aria-controls": `tabpanel-${w.id}`,
|
|
2275
|
+
disabled: w.disabled,
|
|
2276
|
+
onClick: () => !w.disabled && f(w.id),
|
|
2277
|
+
className: k(w, g === w.id),
|
|
2226
2278
|
children: /* @__PURE__ */ d("span", { className: "flex items-center gap-2", children: [
|
|
2227
|
-
|
|
2228
|
-
|
|
2279
|
+
w.label,
|
|
2280
|
+
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 })
|
|
2229
2281
|
] })
|
|
2230
2282
|
},
|
|
2231
|
-
|
|
2283
|
+
w.id
|
|
2232
2284
|
)) }),
|
|
2233
2285
|
m?.content && /* @__PURE__ */ e(
|
|
2234
2286
|
"div",
|
|
@@ -2256,23 +2308,23 @@ function St({
|
|
|
2256
2308
|
closeOnBackdropClick: s = !0,
|
|
2257
2309
|
closeOnEscape: o = !0,
|
|
2258
2310
|
className: u,
|
|
2259
|
-
backdropClassName:
|
|
2260
|
-
children:
|
|
2311
|
+
backdropClassName: x,
|
|
2312
|
+
children: b,
|
|
2261
2313
|
footer: g,
|
|
2262
2314
|
showCloseButton: f = !0
|
|
2263
2315
|
}) {
|
|
2264
|
-
const l =
|
|
2316
|
+
const l = Z(null), m = Z(null);
|
|
2265
2317
|
U(() => {
|
|
2266
2318
|
if (!t || !o) return;
|
|
2267
|
-
const
|
|
2268
|
-
|
|
2319
|
+
const k = (w) => {
|
|
2320
|
+
w.key === "Escape" && a();
|
|
2269
2321
|
};
|
|
2270
|
-
return document.addEventListener("keydown",
|
|
2322
|
+
return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
|
|
2271
2323
|
}, [t, o, a]), U(() => (t ? (m.current = document.activeElement, l.current && l.current.focus(), document.body.style.overflow = "hidden") : (m.current && m.current.focus(), document.body.style.overflow = ""), () => {
|
|
2272
2324
|
document.body.style.overflow = "";
|
|
2273
2325
|
}), [t]);
|
|
2274
|
-
const h = (
|
|
2275
|
-
s &&
|
|
2326
|
+
const h = (k) => {
|
|
2327
|
+
s && k.target === k.currentTarget && a();
|
|
2276
2328
|
};
|
|
2277
2329
|
return t ? /* @__PURE__ */ e(
|
|
2278
2330
|
"div",
|
|
@@ -2281,7 +2333,7 @@ function St({
|
|
|
2281
2333
|
"fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
2282
2334
|
"bg-black/20",
|
|
2283
2335
|
// 'animate-fade-in',
|
|
2284
|
-
|
|
2336
|
+
x
|
|
2285
2337
|
),
|
|
2286
2338
|
onClick: h,
|
|
2287
2339
|
children: /* @__PURE__ */ d(
|
|
@@ -2319,7 +2371,7 @@ function St({
|
|
|
2319
2371
|
}
|
|
2320
2372
|
)
|
|
2321
2373
|
] }),
|
|
2322
|
-
/* @__PURE__ */ e("div", { className: "p-6", children:
|
|
2374
|
+
/* @__PURE__ */ e("div", { className: "p-6", children: b }),
|
|
2323
2375
|
g && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: g })
|
|
2324
2376
|
]
|
|
2325
2377
|
}
|
|
@@ -2327,7 +2379,7 @@ function St({
|
|
|
2327
2379
|
}
|
|
2328
2380
|
) : null;
|
|
2329
2381
|
}
|
|
2330
|
-
const
|
|
2382
|
+
const Y = ({
|
|
2331
2383
|
variant: t = "body",
|
|
2332
2384
|
size: a = "md",
|
|
2333
2385
|
weight: r = "normal",
|
|
@@ -2335,14 +2387,14 @@ const Z = ({
|
|
|
2335
2387
|
align: s = "left",
|
|
2336
2388
|
truncate: o = !1,
|
|
2337
2389
|
italic: u = !1,
|
|
2338
|
-
underline:
|
|
2339
|
-
lineHeight:
|
|
2390
|
+
underline: x = !1,
|
|
2391
|
+
lineHeight: b = "normal",
|
|
2340
2392
|
as: g,
|
|
2341
2393
|
className: f,
|
|
2342
2394
|
children: l,
|
|
2343
2395
|
...m
|
|
2344
2396
|
}) => {
|
|
2345
|
-
const h = g || Lt(t),
|
|
2397
|
+
const h = g || Lt(t), k = p(
|
|
2346
2398
|
// Base styles
|
|
2347
2399
|
"font-primary",
|
|
2348
2400
|
// Variant styles
|
|
@@ -2393,19 +2445,19 @@ const Z = ({
|
|
|
2393
2445
|
},
|
|
2394
2446
|
// Line height (override variant line heights)
|
|
2395
2447
|
t === "body" && {
|
|
2396
|
-
"leading-tight":
|
|
2397
|
-
"leading-normal":
|
|
2398
|
-
"leading-relaxed":
|
|
2448
|
+
"leading-tight": b === "tight",
|
|
2449
|
+
"leading-normal": b === "normal",
|
|
2450
|
+
"leading-relaxed": b === "relaxed"
|
|
2399
2451
|
},
|
|
2400
2452
|
// Text decorations
|
|
2401
2453
|
{
|
|
2402
2454
|
italic: u,
|
|
2403
|
-
underline:
|
|
2455
|
+
underline: x,
|
|
2404
2456
|
truncate: o
|
|
2405
2457
|
},
|
|
2406
2458
|
f
|
|
2407
2459
|
);
|
|
2408
|
-
return /* @__PURE__ */ e(h, { className:
|
|
2460
|
+
return /* @__PURE__ */ e(h, { className: k, ...m, children: l });
|
|
2409
2461
|
};
|
|
2410
2462
|
function Lt(t) {
|
|
2411
2463
|
return {
|
|
@@ -2423,46 +2475,46 @@ const Et = ({
|
|
|
2423
2475
|
error: s,
|
|
2424
2476
|
disabled: o,
|
|
2425
2477
|
accept: u,
|
|
2426
|
-
onListFiles:
|
|
2427
|
-
onListMounts:
|
|
2478
|
+
onListFiles: x,
|
|
2479
|
+
onListMounts: b,
|
|
2428
2480
|
onUploadFile: g,
|
|
2429
2481
|
onDownloadFile: f,
|
|
2430
2482
|
onRegisterFile: l
|
|
2431
2483
|
}) => {
|
|
2432
|
-
const [m, h] =
|
|
2484
|
+
const [m, h] = B(!1), [k, w] = B([]), [y, A] = B(null), [N, q] = B("/"), [P, G] = B([]), [F, z] = B(!1), [H, D] = B(""), [W, V] = B(
|
|
2433
2485
|
typeof t == "object" ? t : null
|
|
2434
|
-
), [i,
|
|
2486
|
+
), [i, v] = B(!1), [E, S] = B(""), M = Z(null);
|
|
2435
2487
|
U(() => {
|
|
2436
2488
|
m && L();
|
|
2437
2489
|
}, [m]), U(() => {
|
|
2438
|
-
m &&
|
|
2439
|
-
}, [m,
|
|
2490
|
+
m && y && Q();
|
|
2491
|
+
}, [m, y, N, H]);
|
|
2440
2492
|
const L = async () => {
|
|
2441
|
-
|
|
2493
|
+
z(!0);
|
|
2442
2494
|
try {
|
|
2443
|
-
const c = await
|
|
2444
|
-
c?.data &&
|
|
2495
|
+
const c = await b?.();
|
|
2496
|
+
c?.data && w(c.data);
|
|
2445
2497
|
} catch (c) {
|
|
2446
2498
|
console.error("Failed to load mounts", c);
|
|
2447
2499
|
} finally {
|
|
2448
|
-
|
|
2500
|
+
z(!1);
|
|
2449
2501
|
}
|
|
2450
2502
|
}, Q = async () => {
|
|
2451
|
-
if (
|
|
2452
|
-
|
|
2503
|
+
if (y) {
|
|
2504
|
+
z(!0);
|
|
2453
2505
|
try {
|
|
2454
|
-
const c = await
|
|
2506
|
+
const c = await x?.({ mountId: y.id, name: H, path: N });
|
|
2455
2507
|
c?.data && G(c.data);
|
|
2456
2508
|
} catch (c) {
|
|
2457
2509
|
console.error("Failed to load files", c);
|
|
2458
2510
|
} finally {
|
|
2459
|
-
|
|
2511
|
+
z(!1);
|
|
2460
2512
|
}
|
|
2461
2513
|
}
|
|
2462
2514
|
}, re = async (c) => {
|
|
2463
2515
|
const C = c.target.files?.[0];
|
|
2464
2516
|
if (C) {
|
|
2465
|
-
|
|
2517
|
+
z(!0);
|
|
2466
2518
|
try {
|
|
2467
2519
|
const O = await C.arrayBuffer(), R = new Uint8Array(O), _ = {
|
|
2468
2520
|
id: `local-${Date.now()}`,
|
|
@@ -2479,19 +2531,19 @@ const Et = ({
|
|
|
2479
2531
|
} catch (O) {
|
|
2480
2532
|
console.error("Local file selection failed", O);
|
|
2481
2533
|
} finally {
|
|
2482
|
-
|
|
2534
|
+
z(!1);
|
|
2483
2535
|
}
|
|
2484
2536
|
}
|
|
2485
2537
|
}, X = async (c) => {
|
|
2486
2538
|
const C = c.target.files?.[0];
|
|
2487
|
-
if (!(!C || !
|
|
2488
|
-
|
|
2539
|
+
if (!(!C || !y)) {
|
|
2540
|
+
z(!0);
|
|
2489
2541
|
try {
|
|
2490
2542
|
const O = await C.arrayBuffer(), R = await g?.({
|
|
2491
2543
|
file: new Uint8Array(O),
|
|
2492
2544
|
filename: C.name,
|
|
2493
2545
|
mimeType: C.type || "application/octet-stream",
|
|
2494
|
-
mountId:
|
|
2546
|
+
mountId: y.id,
|
|
2495
2547
|
path: N
|
|
2496
2548
|
});
|
|
2497
2549
|
if (R?.data) {
|
|
@@ -2501,12 +2553,12 @@ const Et = ({
|
|
|
2501
2553
|
} catch (O) {
|
|
2502
2554
|
console.error("Upload failed", O);
|
|
2503
2555
|
} finally {
|
|
2504
|
-
|
|
2556
|
+
z(!1);
|
|
2505
2557
|
}
|
|
2506
2558
|
}
|
|
2507
2559
|
}, $ = async () => {
|
|
2508
|
-
if (!(!E || !
|
|
2509
|
-
|
|
2560
|
+
if (!(!E || !y)) {
|
|
2561
|
+
z(!0);
|
|
2510
2562
|
try {
|
|
2511
2563
|
const c = `${N}${E}/`;
|
|
2512
2564
|
l && (await l({
|
|
@@ -2515,59 +2567,59 @@ const Et = ({
|
|
|
2515
2567
|
path: N,
|
|
2516
2568
|
mimeType: "application/x-directory",
|
|
2517
2569
|
size: 0,
|
|
2518
|
-
mountId:
|
|
2570
|
+
mountId: y.id,
|
|
2519
2571
|
providerKey: c,
|
|
2520
2572
|
ownerId: "me"
|
|
2521
|
-
}), await Q()),
|
|
2573
|
+
}), await Q()), v(!1), S("");
|
|
2522
2574
|
} catch (c) {
|
|
2523
2575
|
console.error("Failed to create folder", c);
|
|
2524
2576
|
} finally {
|
|
2525
|
-
|
|
2577
|
+
z(!1);
|
|
2526
2578
|
}
|
|
2527
2579
|
}
|
|
2528
|
-
},
|
|
2529
|
-
|
|
2580
|
+
}, j = async (c) => {
|
|
2581
|
+
z(!0);
|
|
2530
2582
|
try {
|
|
2531
2583
|
const C = await f?.(c.id);
|
|
2532
2584
|
V(c), a(c, C), h(!1);
|
|
2533
2585
|
} catch (C) {
|
|
2534
2586
|
console.error("Failed to download file", C);
|
|
2535
2587
|
} finally {
|
|
2536
|
-
|
|
2588
|
+
z(!1);
|
|
2537
2589
|
}
|
|
2538
2590
|
}, T = (c) => {
|
|
2539
2591
|
c.stopPropagation(), V(null), a(null);
|
|
2540
|
-
},
|
|
2592
|
+
}, I = de(() => {
|
|
2541
2593
|
const c = /* @__PURE__ */ new Set(), C = [];
|
|
2542
|
-
return
|
|
2594
|
+
return P.forEach((O) => {
|
|
2543
2595
|
if (O.type === "folder") {
|
|
2544
2596
|
O.path === N && c.add(O.name);
|
|
2545
2597
|
return;
|
|
2546
2598
|
}
|
|
2547
|
-
const R = O.providerKey || O.name,
|
|
2548
|
-
|
|
2599
|
+
const R = O.providerKey || O.name, J = (N ? R.substring(N.length) : R).split("/").filter((pe) => pe !== "");
|
|
2600
|
+
J.length > 1 ? c.add(J[0]) : J.length === 1 && C.push(O);
|
|
2549
2601
|
}), {
|
|
2550
2602
|
folders: Array.from(c).sort(),
|
|
2551
2603
|
files: C.sort((O, R) => O.name.localeCompare(R.name))
|
|
2552
2604
|
};
|
|
2553
|
-
}, [
|
|
2605
|
+
}, [P, N]), ee = (c) => {
|
|
2554
2606
|
q((C) => `${C}${c}/`);
|
|
2555
2607
|
}, ne = () => {
|
|
2556
2608
|
const c = N.split("/").filter((C) => C !== "");
|
|
2557
2609
|
c.pop(), c.length === 0 ? q("/") : q(`${c.join("/")}/`);
|
|
2558
2610
|
}, K = de(() => {
|
|
2559
|
-
const c =
|
|
2611
|
+
const c = I.folders.map((C) => ({
|
|
2560
2612
|
id: `folder-${C}`,
|
|
2561
2613
|
name: C,
|
|
2562
2614
|
type: "folder"
|
|
2563
2615
|
}));
|
|
2564
|
-
return
|
|
2616
|
+
return I.files.forEach((C) => {
|
|
2565
2617
|
c.push({
|
|
2566
2618
|
...C,
|
|
2567
2619
|
type: "file"
|
|
2568
2620
|
});
|
|
2569
2621
|
}), c;
|
|
2570
|
-
}, [
|
|
2622
|
+
}, [I]), le = [
|
|
2571
2623
|
{
|
|
2572
2624
|
id: "name",
|
|
2573
2625
|
header: "Name",
|
|
@@ -2576,7 +2628,7 @@ const Et = ({
|
|
|
2576
2628
|
/* @__PURE__ */ e(
|
|
2577
2629
|
oe,
|
|
2578
2630
|
{
|
|
2579
|
-
icon: C.type === "folder" ?
|
|
2631
|
+
icon: C.type === "folder" ? Se : xe,
|
|
2580
2632
|
size: "sm",
|
|
2581
2633
|
color: C.type === "folder" ? "warning" : "secondary"
|
|
2582
2634
|
}
|
|
@@ -2605,7 +2657,7 @@ const Et = ({
|
|
|
2605
2657
|
size: "sm",
|
|
2606
2658
|
variant: "outline",
|
|
2607
2659
|
onClick: (O) => {
|
|
2608
|
-
O.stopPropagation(), C.type === "folder" ? ee(C.name) :
|
|
2660
|
+
O.stopPropagation(), C.type === "folder" ? ee(C.name) : j(C);
|
|
2609
2661
|
},
|
|
2610
2662
|
loading: F && C.type === "file" && W?.id === C.id,
|
|
2611
2663
|
children: C.type === "folder" ? "Open" : "Select"
|
|
@@ -2618,7 +2670,7 @@ const Et = ({
|
|
|
2618
2670
|
header: "Mount Name",
|
|
2619
2671
|
accessor: "name",
|
|
2620
2672
|
cell: (c) => /* @__PURE__ */ d("div", { className: "flex items-center gap-2 font-medium", children: [
|
|
2621
|
-
/* @__PURE__ */ e(oe, { icon:
|
|
2673
|
+
/* @__PURE__ */ e(oe, { icon: Ce, size: "sm", color: "primary" }),
|
|
2622
2674
|
/* @__PURE__ */ e("span", { children: c })
|
|
2623
2675
|
] })
|
|
2624
2676
|
},
|
|
@@ -2627,11 +2679,11 @@ const Et = ({
|
|
|
2627
2679
|
header: "",
|
|
2628
2680
|
accessor: "id",
|
|
2629
2681
|
align: "right",
|
|
2630
|
-
cell: (c, C) => /* @__PURE__ */ e(te, { size: "sm", variant: "outline", onClick: () =>
|
|
2682
|
+
cell: (c, C) => /* @__PURE__ */ e(te, { size: "sm", variant: "outline", onClick: () => A(C), children: "Open" })
|
|
2631
2683
|
}
|
|
2632
2684
|
];
|
|
2633
2685
|
return /* @__PURE__ */ d("div", { className: "space-y-1", children: [
|
|
2634
|
-
r && /* @__PURE__ */ e(
|
|
2686
|
+
r && /* @__PURE__ */ e(Y, { variant: "label", size: "sm", weight: "medium", children: r }),
|
|
2635
2687
|
/* @__PURE__ */ d(
|
|
2636
2688
|
"div",
|
|
2637
2689
|
{
|
|
@@ -2643,28 +2695,28 @@ const Et = ({
|
|
|
2643
2695
|
o && "opacity-50 cursor-not-allowed bg-module-subtle"
|
|
2644
2696
|
),
|
|
2645
2697
|
children: [
|
|
2646
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: W ? xe :
|
|
2698
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: W ? xe : Ce, color: W ? "primary" : "secondary" }) }),
|
|
2647
2699
|
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: W ? /* @__PURE__ */ e("span", { className: "text-sm text-default font-medium", children: W.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-muted", children: n }) }),
|
|
2648
2700
|
W && !o && /* @__PURE__ */ e(
|
|
2649
2701
|
"button",
|
|
2650
2702
|
{
|
|
2651
2703
|
onClick: T,
|
|
2652
2704
|
className: "p-1 hover:bg-neutral-container rounded",
|
|
2653
|
-
children: /* @__PURE__ */ e(oe, { icon:
|
|
2705
|
+
children: /* @__PURE__ */ e(oe, { icon: We, size: "xs" })
|
|
2654
2706
|
}
|
|
2655
2707
|
)
|
|
2656
2708
|
]
|
|
2657
2709
|
}
|
|
2658
2710
|
),
|
|
2659
|
-
s && /* @__PURE__ */ e(
|
|
2711
|
+
s && /* @__PURE__ */ e(Y, { variant: "body", size: "xs", className: "text-error", children: s }),
|
|
2660
2712
|
/* @__PURE__ */ e(
|
|
2661
2713
|
St,
|
|
2662
2714
|
{
|
|
2663
2715
|
open: m,
|
|
2664
2716
|
onClose: () => {
|
|
2665
|
-
h(!1),
|
|
2717
|
+
h(!1), A(null), q("/"), v(!1);
|
|
2666
2718
|
},
|
|
2667
|
-
title:
|
|
2719
|
+
title: y ? `Explorer: ${y.name}` : "Select Storage Mount",
|
|
2668
2720
|
size: "lg",
|
|
2669
2721
|
children: /* @__PURE__ */ e(
|
|
2670
2722
|
kt,
|
|
@@ -2674,7 +2726,7 @@ const Et = ({
|
|
|
2674
2726
|
{
|
|
2675
2727
|
id: "remote",
|
|
2676
2728
|
label: "Platform Storage",
|
|
2677
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
2729
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: y ? /* @__PURE__ */ d(we, { children: [
|
|
2678
2730
|
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2679
2731
|
/* @__PURE__ */ e(
|
|
2680
2732
|
te,
|
|
@@ -2682,9 +2734,9 @@ const Et = ({
|
|
|
2682
2734
|
variant: "ghost",
|
|
2683
2735
|
size: "sm",
|
|
2684
2736
|
onClick: () => {
|
|
2685
|
-
N && N !== "/" ? ne() :
|
|
2737
|
+
N && N !== "/" ? ne() : A(null);
|
|
2686
2738
|
},
|
|
2687
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2739
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: ke, size: "xs" }),
|
|
2688
2740
|
children: N ? "Back" : "Back to Mounts"
|
|
2689
2741
|
}
|
|
2690
2742
|
),
|
|
@@ -2694,8 +2746,8 @@ const Et = ({
|
|
|
2694
2746
|
{
|
|
2695
2747
|
placeholder: "Search...",
|
|
2696
2748
|
value: H,
|
|
2697
|
-
onChange: (c) =>
|
|
2698
|
-
startIcon: /* @__PURE__ */ e(
|
|
2749
|
+
onChange: (c) => D(c.target.value),
|
|
2750
|
+
startIcon: /* @__PURE__ */ e($e, { size: 14 }),
|
|
2699
2751
|
fullWidth: !0,
|
|
2700
2752
|
size: "sm"
|
|
2701
2753
|
}
|
|
@@ -2706,8 +2758,8 @@ const Et = ({
|
|
|
2706
2758
|
{
|
|
2707
2759
|
variant: "outline",
|
|
2708
2760
|
size: "sm",
|
|
2709
|
-
onClick: () =>
|
|
2710
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2761
|
+
onClick: () => v(!0),
|
|
2762
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: Fe, size: "xs" }),
|
|
2711
2763
|
children: "New Folder"
|
|
2712
2764
|
}
|
|
2713
2765
|
),
|
|
@@ -2717,7 +2769,7 @@ const Et = ({
|
|
|
2717
2769
|
variant: "primary",
|
|
2718
2770
|
size: "sm",
|
|
2719
2771
|
onClick: () => M.current?.click(),
|
|
2720
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2772
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: Ve, size: "xs" }),
|
|
2721
2773
|
loading: F,
|
|
2722
2774
|
children: "Upload"
|
|
2723
2775
|
}
|
|
@@ -2735,7 +2787,7 @@ const Et = ({
|
|
|
2735
2787
|
] })
|
|
2736
2788
|
] }),
|
|
2737
2789
|
i && /* @__PURE__ */ d("div", { className: "flex items-center gap-2 p-3 bg-module-subtle rounded-lg border border-neutral", children: [
|
|
2738
|
-
/* @__PURE__ */ e(oe, { icon:
|
|
2790
|
+
/* @__PURE__ */ e(oe, { icon: Se, size: "sm", color: "warning" }),
|
|
2739
2791
|
/* @__PURE__ */ e(
|
|
2740
2792
|
ue,
|
|
2741
2793
|
{
|
|
@@ -2747,7 +2799,7 @@ const Et = ({
|
|
|
2747
2799
|
}
|
|
2748
2800
|
),
|
|
2749
2801
|
/* @__PURE__ */ e(te, { size: "sm", onClick: $, loading: F, children: "Create" }),
|
|
2750
|
-
/* @__PURE__ */ e(te, { size: "sm", variant: "ghost", onClick: () =>
|
|
2802
|
+
/* @__PURE__ */ e(te, { size: "sm", variant: "ghost", onClick: () => v(!1), children: "Cancel" })
|
|
2751
2803
|
] }),
|
|
2752
2804
|
/* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral", children: /* @__PURE__ */ e(
|
|
2753
2805
|
Le,
|
|
@@ -2756,17 +2808,17 @@ const Et = ({
|
|
|
2756
2808
|
columns: le,
|
|
2757
2809
|
loading: F,
|
|
2758
2810
|
emptyContent: "This folder is empty",
|
|
2759
|
-
onRowClick: (c) => c.type === "folder" ? ee(c.name) :
|
|
2811
|
+
onRowClick: (c) => c.type === "folder" ? ee(c.name) : j(c)
|
|
2760
2812
|
}
|
|
2761
2813
|
) })
|
|
2762
2814
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral", children: /* @__PURE__ */ e(
|
|
2763
2815
|
Le,
|
|
2764
2816
|
{
|
|
2765
|
-
data:
|
|
2817
|
+
data: k,
|
|
2766
2818
|
columns: he,
|
|
2767
2819
|
loading: F,
|
|
2768
2820
|
emptyContent: "No storage mounts configured",
|
|
2769
|
-
onRowClick: (c) =>
|
|
2821
|
+
onRowClick: (c) => A(c)
|
|
2770
2822
|
}
|
|
2771
2823
|
) }) })
|
|
2772
2824
|
},
|
|
@@ -2775,8 +2827,8 @@ const Et = ({
|
|
|
2775
2827
|
label: "Local File",
|
|
2776
2828
|
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: [
|
|
2777
2829
|
/* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: xe, size: "xl", color: "primary" }) }),
|
|
2778
|
-
/* @__PURE__ */ e(
|
|
2779
|
-
/* @__PURE__ */ d(
|
|
2830
|
+
/* @__PURE__ */ e(Y, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
|
|
2831
|
+
/* @__PURE__ */ d(Y, { variant: "body", size: "sm", className: "text-muted mt-1 mb-6 text-center max-w-xs", children: [
|
|
2780
2832
|
"This file will be used directly in the form and will ",
|
|
2781
2833
|
/* @__PURE__ */ e("strong", { children: "not" }),
|
|
2782
2834
|
" be uploaded to platform storage."
|
|
@@ -2820,9 +2872,9 @@ function Mt({
|
|
|
2820
2872
|
size: s = "md",
|
|
2821
2873
|
placeholder: o,
|
|
2822
2874
|
templatePlaceholder: u,
|
|
2823
|
-
showTemplate:
|
|
2875
|
+
showTemplate: x = !0
|
|
2824
2876
|
}) {
|
|
2825
|
-
const [
|
|
2877
|
+
const [b, g] = B([]);
|
|
2826
2878
|
U(() => {
|
|
2827
2879
|
let l = !0;
|
|
2828
2880
|
return Promise.resolve(r?.()).then((m) => {
|
|
@@ -2840,12 +2892,12 @@ function Mt({
|
|
|
2840
2892
|
size: s,
|
|
2841
2893
|
fullWidth: !0,
|
|
2842
2894
|
value: f.folderId ?? "",
|
|
2843
|
-
options:
|
|
2895
|
+
options: b.map((l) => ({ value: l.id, label: l.name })),
|
|
2844
2896
|
placeholder: o ?? "Select a folder",
|
|
2845
2897
|
onChange: (l) => a?.({ ...f, folderId: l })
|
|
2846
2898
|
}
|
|
2847
2899
|
),
|
|
2848
|
-
|
|
2900
|
+
x && /* @__PURE__ */ e(
|
|
2849
2901
|
ue,
|
|
2850
2902
|
{
|
|
2851
2903
|
size: s,
|
|
@@ -2867,8 +2919,8 @@ function $t(t, a, r) {
|
|
|
2867
2919
|
const n = a.split("."), s = Array.isArray(t) ? [...t] : { ...t };
|
|
2868
2920
|
let o = s;
|
|
2869
2921
|
for (let u = 0; u < n.length - 1; u++) {
|
|
2870
|
-
const
|
|
2871
|
-
o[
|
|
2922
|
+
const x = n[u], b = o[x];
|
|
2923
|
+
o[x] = b && typeof b == "object" ? Array.isArray(b) ? [...b] : { ...b } : {}, o = o[x];
|
|
2872
2924
|
}
|
|
2873
2925
|
return o[n[n.length - 1]] = r, s;
|
|
2874
2926
|
}
|
|
@@ -2890,42 +2942,42 @@ const cr = ({
|
|
|
2890
2942
|
onChange: s,
|
|
2891
2943
|
transform: o,
|
|
2892
2944
|
validate: u,
|
|
2893
|
-
submitButton:
|
|
2894
|
-
cancelButton:
|
|
2945
|
+
submitButton: x = { label: "Submit", variant: "primary" },
|
|
2946
|
+
cancelButton: b = { label: "Cancel", variant: "outline" },
|
|
2895
2947
|
showButtons: g = !0,
|
|
2896
2948
|
layout: f = "vertical",
|
|
2897
2949
|
size: l = "md",
|
|
2898
2950
|
loading: m = !1,
|
|
2899
2951
|
className: h,
|
|
2900
|
-
ref:
|
|
2901
|
-
sdk:
|
|
2952
|
+
ref: k,
|
|
2953
|
+
sdk: w
|
|
2902
2954
|
}) => {
|
|
2903
|
-
const [
|
|
2955
|
+
const [y, A] = B(a || {}), [N, q] = B({}), [P, G] = B({});
|
|
2904
2956
|
U(() => {
|
|
2905
|
-
a &&
|
|
2957
|
+
a && A({ ...a });
|
|
2906
2958
|
}, [a]);
|
|
2907
2959
|
const F = ae(
|
|
2908
|
-
(i,
|
|
2960
|
+
(i, v, E) => {
|
|
2909
2961
|
const S = t.flatMap((M) => M.items).find((M) => M.name === i);
|
|
2910
2962
|
if (!S) return null;
|
|
2911
|
-
if (S.required && (
|
|
2963
|
+
if (S.required && (v == null || v === ""))
|
|
2912
2964
|
return `${S.label} is required`;
|
|
2913
2965
|
if (S.type === "array") {
|
|
2914
|
-
if (S.required && (!
|
|
2966
|
+
if (S.required && (!v || v.length === 0))
|
|
2915
2967
|
return `${S.label} cannot be empty.`;
|
|
2916
|
-
if (
|
|
2968
|
+
if (v && !Array.isArray(v))
|
|
2917
2969
|
return `${S.label} must be an array.`;
|
|
2918
|
-
if (Array.isArray(
|
|
2970
|
+
if (Array.isArray(v) && S.arrayFields) {
|
|
2919
2971
|
const M = [];
|
|
2920
2972
|
let L = !1;
|
|
2921
|
-
if (
|
|
2973
|
+
if (v.forEach((Q, re) => {
|
|
2922
2974
|
const X = {};
|
|
2923
2975
|
for (const $ of S.arrayFields) {
|
|
2924
|
-
const
|
|
2925
|
-
if ($.required && (
|
|
2976
|
+
const j = Q?.[$.name];
|
|
2977
|
+
if ($.required && (j == null || j === ""))
|
|
2926
2978
|
X[$.name] = `${$.label} is required`, L = !0;
|
|
2927
2979
|
else if ($.validator) {
|
|
2928
|
-
const T = $.validator(
|
|
2980
|
+
const T = $.validator(j, Q);
|
|
2929
2981
|
T && (X[$.name] = T, L = !0);
|
|
2930
2982
|
}
|
|
2931
2983
|
}
|
|
@@ -2934,52 +2986,52 @@ const cr = ({
|
|
|
2934
2986
|
return JSON.stringify(M);
|
|
2935
2987
|
}
|
|
2936
2988
|
}
|
|
2937
|
-
return S.validator ? S.validator(
|
|
2989
|
+
return S.validator ? S.validator(v, E) : null;
|
|
2938
2990
|
},
|
|
2939
2991
|
[t]
|
|
2940
|
-
),
|
|
2941
|
-
(i,
|
|
2992
|
+
), z = ae(
|
|
2993
|
+
(i, v) => {
|
|
2942
2994
|
let E = $t(
|
|
2943
|
-
|
|
2995
|
+
y,
|
|
2944
2996
|
i,
|
|
2945
|
-
|
|
2997
|
+
v
|
|
2946
2998
|
);
|
|
2947
|
-
t.flatMap((L) => L.items).find((L) => L.name === i)?.removeIfEmpty && (
|
|
2948
|
-
const M = F(i,
|
|
2999
|
+
t.flatMap((L) => L.items).find((L) => L.name === i)?.removeIfEmpty && (v == null || v === "") && (E = Tt(E, i)), A(E), G((L) => ({ ...L, [i]: !0 }));
|
|
3000
|
+
const M = F(i, v, E);
|
|
2949
3001
|
q((L) => ({
|
|
2950
3002
|
...L,
|
|
2951
3003
|
[i]: M || ""
|
|
2952
3004
|
})), s?.(E, i);
|
|
2953
3005
|
},
|
|
2954
|
-
[
|
|
3006
|
+
[y, t, F, s]
|
|
2955
3007
|
), H = ae(
|
|
2956
3008
|
async (i) => {
|
|
2957
3009
|
if (console.log("handleSubmit"), i.preventDefault(), m) return;
|
|
2958
|
-
const
|
|
3010
|
+
const v = {}, E = t.flatMap((M) => M.items);
|
|
2959
3011
|
for (const M of E) {
|
|
2960
|
-
if (M.hidden || M.conditional && !M.conditional(
|
|
3012
|
+
if (M.hidden || M.conditional && !M.conditional(y))
|
|
2961
3013
|
continue;
|
|
2962
3014
|
const L = F(
|
|
2963
3015
|
M.name,
|
|
2964
|
-
Ee(
|
|
2965
|
-
|
|
3016
|
+
Ee(y, M.name),
|
|
3017
|
+
y
|
|
2966
3018
|
);
|
|
2967
|
-
L && (
|
|
3019
|
+
L && (v[M.name] = L);
|
|
2968
3020
|
}
|
|
2969
3021
|
if (u) {
|
|
2970
|
-
const M = u(
|
|
2971
|
-
M && Object.assign(
|
|
3022
|
+
const M = u(y);
|
|
3023
|
+
M && Object.assign(v, M);
|
|
2972
3024
|
}
|
|
2973
|
-
if (q(
|
|
3025
|
+
if (q(v), console.log("newErrors", v), Object.keys(v).some((M) => v[M]))
|
|
2974
3026
|
return;
|
|
2975
|
-
const S = o ? o(
|
|
2976
|
-
await r?.(
|
|
3027
|
+
const S = o ? o(y) : y;
|
|
3028
|
+
await r?.(y, S);
|
|
2977
3029
|
},
|
|
2978
|
-
[
|
|
2979
|
-
),
|
|
3030
|
+
[y, t, F, u, o, r, m]
|
|
3031
|
+
), D = ae(
|
|
2980
3032
|
(i) => {
|
|
2981
|
-
const
|
|
2982
|
-
value:
|
|
3033
|
+
const v = Ee(y, i.name), E = P[i.name] ? N[i.name] : void 0, S = i.disabled || m, M = {
|
|
3034
|
+
value: v || "",
|
|
2983
3035
|
disabled: S,
|
|
2984
3036
|
required: i.required,
|
|
2985
3037
|
placeholder: i.placeholder,
|
|
@@ -2996,7 +3048,7 @@ const cr = ({
|
|
|
2996
3048
|
ue,
|
|
2997
3049
|
{
|
|
2998
3050
|
...M,
|
|
2999
|
-
onChange: (L) =>
|
|
3051
|
+
onChange: (L) => z(i.name, L.target.value),
|
|
3000
3052
|
type: i.textType || i.type,
|
|
3001
3053
|
autoComplete: i.autocomplete,
|
|
3002
3054
|
error: E,
|
|
@@ -3008,7 +3060,7 @@ const cr = ({
|
|
|
3008
3060
|
Ne,
|
|
3009
3061
|
{
|
|
3010
3062
|
...M,
|
|
3011
|
-
onChange: (L) =>
|
|
3063
|
+
onChange: (L) => z(i.name, L.target.value),
|
|
3012
3064
|
rows: 4,
|
|
3013
3065
|
error: E,
|
|
3014
3066
|
size: l
|
|
@@ -3019,7 +3071,7 @@ const cr = ({
|
|
|
3019
3071
|
fe,
|
|
3020
3072
|
{
|
|
3021
3073
|
...M,
|
|
3022
|
-
onChange: (L) =>
|
|
3074
|
+
onChange: (L) => z(i.name, L),
|
|
3023
3075
|
options: (i.options || []).map((L) => ({
|
|
3024
3076
|
...L,
|
|
3025
3077
|
value: String(L.value)
|
|
@@ -3033,11 +3085,11 @@ const cr = ({
|
|
|
3033
3085
|
);
|
|
3034
3086
|
case "checkbox":
|
|
3035
3087
|
return /* @__PURE__ */ e(
|
|
3036
|
-
|
|
3088
|
+
ve,
|
|
3037
3089
|
{
|
|
3038
3090
|
...M,
|
|
3039
|
-
checked: !!
|
|
3040
|
-
onChange: (L) =>
|
|
3091
|
+
checked: !!v,
|
|
3092
|
+
onChange: (L) => z(i.name, L.target.checked),
|
|
3041
3093
|
size: l
|
|
3042
3094
|
}
|
|
3043
3095
|
);
|
|
@@ -3049,21 +3101,21 @@ const cr = ({
|
|
|
3049
3101
|
type: "radio",
|
|
3050
3102
|
name: i.name,
|
|
3051
3103
|
value: L.value,
|
|
3052
|
-
checked:
|
|
3053
|
-
onChange: () =>
|
|
3104
|
+
checked: v === L.value,
|
|
3105
|
+
onChange: () => z(i.name, L.value),
|
|
3054
3106
|
disabled: S || L.disabled,
|
|
3055
3107
|
className: "rounded-full border-neutral-100 dark:border-neutral-600"
|
|
3056
3108
|
}
|
|
3057
3109
|
),
|
|
3058
|
-
/* @__PURE__ */ e(
|
|
3110
|
+
/* @__PURE__ */ e(Y, { variant: "label", size: "sm", children: L.label })
|
|
3059
3111
|
] }, L.value)) });
|
|
3060
3112
|
case "date":
|
|
3061
3113
|
return /* @__PURE__ */ e(
|
|
3062
|
-
|
|
3114
|
+
ye,
|
|
3063
3115
|
{
|
|
3064
3116
|
...M,
|
|
3065
|
-
value:
|
|
3066
|
-
onChange: (L) =>
|
|
3117
|
+
value: v ? new Date(v) : null,
|
|
3118
|
+
onChange: (L) => z(i.name, L),
|
|
3067
3119
|
size: l
|
|
3068
3120
|
}
|
|
3069
3121
|
);
|
|
@@ -3072,28 +3124,28 @@ const cr = ({
|
|
|
3072
3124
|
Et,
|
|
3073
3125
|
{
|
|
3074
3126
|
...M,
|
|
3075
|
-
value:
|
|
3076
|
-
onChange: (L) =>
|
|
3127
|
+
value: v,
|
|
3128
|
+
onChange: (L) => z(i.name, L),
|
|
3077
3129
|
error: E,
|
|
3078
|
-
onListFiles: (L) =>
|
|
3130
|
+
onListFiles: (L) => w?.http.invoke({
|
|
3079
3131
|
method: "POST",
|
|
3080
3132
|
action: "storage.file.list",
|
|
3081
3133
|
body: L
|
|
3082
3134
|
}),
|
|
3083
|
-
onListMounts: () =>
|
|
3135
|
+
onListMounts: () => w?.http.invoke({
|
|
3084
3136
|
method: "GET",
|
|
3085
3137
|
action: "storage.mount"
|
|
3086
3138
|
}),
|
|
3087
|
-
onUploadFile: (L) =>
|
|
3139
|
+
onUploadFile: (L) => w?.http.invoke({
|
|
3088
3140
|
method: "POST",
|
|
3089
3141
|
action: "storage.file.upload",
|
|
3090
3142
|
body: L
|
|
3091
3143
|
}),
|
|
3092
|
-
onDownloadFile: (L) =>
|
|
3144
|
+
onDownloadFile: (L) => w?.http.invoke({
|
|
3093
3145
|
method: "GET",
|
|
3094
3146
|
action: `storage.file.${L}.download`
|
|
3095
3147
|
}),
|
|
3096
|
-
onRegisterFile: (L) =>
|
|
3148
|
+
onRegisterFile: (L) => w?.http.invoke({
|
|
3097
3149
|
method: "POST",
|
|
3098
3150
|
action: "storage.file.folder",
|
|
3099
3151
|
body: L
|
|
@@ -3104,9 +3156,9 @@ const cr = ({
|
|
|
3104
3156
|
return /* @__PURE__ */ e(
|
|
3105
3157
|
Mt,
|
|
3106
3158
|
{
|
|
3107
|
-
value:
|
|
3108
|
-
onChange: (L) =>
|
|
3109
|
-
onListFolders: () =>
|
|
3159
|
+
value: v || {},
|
|
3160
|
+
onChange: (L) => z(i.name, L),
|
|
3161
|
+
onListFolders: () => w?.http.invoke({
|
|
3110
3162
|
method: "GET",
|
|
3111
3163
|
action: "storage.mount"
|
|
3112
3164
|
}),
|
|
@@ -3117,13 +3169,13 @@ const cr = ({
|
|
|
3117
3169
|
);
|
|
3118
3170
|
case "custom":
|
|
3119
3171
|
return i.customComponent?.({
|
|
3120
|
-
value:
|
|
3121
|
-
onChange: (L) =>
|
|
3172
|
+
value: v,
|
|
3173
|
+
onChange: (L) => z(i.name, L),
|
|
3122
3174
|
error: E,
|
|
3123
3175
|
disabled: S
|
|
3124
3176
|
});
|
|
3125
3177
|
case "array": {
|
|
3126
|
-
const L =
|
|
3178
|
+
const L = v || [];
|
|
3127
3179
|
let Q = [];
|
|
3128
3180
|
if (typeof E == "string" && E.startsWith("["))
|
|
3129
3181
|
try {
|
|
@@ -3131,21 +3183,21 @@ const cr = ({
|
|
|
3131
3183
|
} catch {
|
|
3132
3184
|
}
|
|
3133
3185
|
const re = () => {
|
|
3134
|
-
|
|
3135
|
-
}, X = (
|
|
3136
|
-
|
|
3186
|
+
z(i.name, [...L, {}]);
|
|
3187
|
+
}, X = (j) => {
|
|
3188
|
+
z(
|
|
3137
3189
|
i.name,
|
|
3138
|
-
L.filter((T,
|
|
3190
|
+
L.filter((T, I) => I !== j)
|
|
3139
3191
|
);
|
|
3140
|
-
}, $ = (
|
|
3192
|
+
}, $ = (j, T, I) => {
|
|
3141
3193
|
const ee = [...L];
|
|
3142
|
-
ee[
|
|
3143
|
-
...ee[
|
|
3144
|
-
[T]:
|
|
3145
|
-
},
|
|
3194
|
+
ee[j] = {
|
|
3195
|
+
...ee[j],
|
|
3196
|
+
[T]: I
|
|
3197
|
+
}, z(i.name, ee);
|
|
3146
3198
|
};
|
|
3147
3199
|
return /* @__PURE__ */ d("div", { className: "space-y-2", children: [
|
|
3148
|
-
L.map((
|
|
3200
|
+
L.map((j, T) => /* @__PURE__ */ d(
|
|
3149
3201
|
"div",
|
|
3150
3202
|
{
|
|
3151
3203
|
className: "p-4 border rounded-md dark:border-neutral-700 space-y-2 relative",
|
|
@@ -3161,34 +3213,34 @@ const cr = ({
|
|
|
3161
3213
|
children: "Remove"
|
|
3162
3214
|
}
|
|
3163
3215
|
) }),
|
|
3164
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: i.arrayFields?.map((
|
|
3165
|
-
const ee = Q?.[T]?.[
|
|
3216
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: i.arrayFields?.map((I) => {
|
|
3217
|
+
const ee = Q?.[T]?.[I.name];
|
|
3166
3218
|
return /* @__PURE__ */ d(
|
|
3167
3219
|
"div",
|
|
3168
3220
|
{
|
|
3169
3221
|
className: "space-y-1",
|
|
3170
3222
|
children: [
|
|
3171
3223
|
/* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */ d(
|
|
3172
|
-
|
|
3224
|
+
Y,
|
|
3173
3225
|
{
|
|
3174
3226
|
variant: "label",
|
|
3175
3227
|
size: "sm",
|
|
3176
3228
|
className: "font-semibold text-neutral-700 dark:text-neutral-300",
|
|
3177
3229
|
children: [
|
|
3178
|
-
|
|
3179
|
-
|
|
3230
|
+
I.label,
|
|
3231
|
+
I.required && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
|
|
3180
3232
|
]
|
|
3181
3233
|
}
|
|
3182
3234
|
) }),
|
|
3183
3235
|
(() => {
|
|
3184
3236
|
const ne = {
|
|
3185
|
-
value:
|
|
3237
|
+
value: j?.[I.name] || "",
|
|
3186
3238
|
disabled: S,
|
|
3187
|
-
required:
|
|
3188
|
-
placeholder:
|
|
3189
|
-
...
|
|
3239
|
+
required: I.required,
|
|
3240
|
+
placeholder: I.placeholder,
|
|
3241
|
+
...I.fieldProps
|
|
3190
3242
|
};
|
|
3191
|
-
switch (
|
|
3243
|
+
switch (I.type) {
|
|
3192
3244
|
case "text":
|
|
3193
3245
|
case "email":
|
|
3194
3246
|
case "password":
|
|
@@ -3201,11 +3253,11 @@ const cr = ({
|
|
|
3201
3253
|
...ne,
|
|
3202
3254
|
onChange: (K) => $(
|
|
3203
3255
|
T,
|
|
3204
|
-
|
|
3256
|
+
I.name,
|
|
3205
3257
|
K.target.value
|
|
3206
3258
|
),
|
|
3207
|
-
type:
|
|
3208
|
-
autoComplete:
|
|
3259
|
+
type: I.textType || I.type,
|
|
3260
|
+
autoComplete: I.autocomplete,
|
|
3209
3261
|
error: ee,
|
|
3210
3262
|
size: l
|
|
3211
3263
|
}
|
|
@@ -3217,7 +3269,7 @@ const cr = ({
|
|
|
3217
3269
|
...ne,
|
|
3218
3270
|
onChange: (K) => $(
|
|
3219
3271
|
T,
|
|
3220
|
-
|
|
3272
|
+
I.name,
|
|
3221
3273
|
K.target.value
|
|
3222
3274
|
),
|
|
3223
3275
|
rows: 4,
|
|
@@ -3232,38 +3284,38 @@ const cr = ({
|
|
|
3232
3284
|
...ne,
|
|
3233
3285
|
onChange: (K) => $(
|
|
3234
3286
|
T,
|
|
3235
|
-
|
|
3287
|
+
I.name,
|
|
3236
3288
|
K
|
|
3237
3289
|
),
|
|
3238
|
-
options: (
|
|
3290
|
+
options: (I.options || []).map(
|
|
3239
3291
|
(K) => ({
|
|
3240
3292
|
...K,
|
|
3241
3293
|
value: String(K.value)
|
|
3242
3294
|
})
|
|
3243
3295
|
),
|
|
3244
|
-
searchable:
|
|
3245
|
-
multiple:
|
|
3246
|
-
allowCreate:
|
|
3296
|
+
searchable: I.searchable,
|
|
3297
|
+
multiple: I.multiple,
|
|
3298
|
+
allowCreate: I.allowCreate,
|
|
3247
3299
|
error: ee,
|
|
3248
3300
|
size: l
|
|
3249
3301
|
}
|
|
3250
3302
|
);
|
|
3251
3303
|
case "checkbox":
|
|
3252
3304
|
return /* @__PURE__ */ e(
|
|
3253
|
-
|
|
3305
|
+
ve,
|
|
3254
3306
|
{
|
|
3255
3307
|
...ne,
|
|
3256
|
-
checked: !!
|
|
3308
|
+
checked: !!j?.[I.name],
|
|
3257
3309
|
onChange: (K) => $(
|
|
3258
3310
|
T,
|
|
3259
|
-
|
|
3311
|
+
I.name,
|
|
3260
3312
|
K.target.checked
|
|
3261
3313
|
),
|
|
3262
3314
|
size: l
|
|
3263
3315
|
}
|
|
3264
3316
|
);
|
|
3265
3317
|
case "radio":
|
|
3266
|
-
return /* @__PURE__ */ e("div", { className: "space-y-1", children:
|
|
3318
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1", children: I.options?.map((K) => /* @__PURE__ */ d(
|
|
3267
3319
|
"label",
|
|
3268
3320
|
{
|
|
3269
3321
|
className: "flex items-center gap-2",
|
|
@@ -3272,33 +3324,33 @@ const cr = ({
|
|
|
3272
3324
|
"input",
|
|
3273
3325
|
{
|
|
3274
3326
|
type: "radio",
|
|
3275
|
-
name: `${i.name}.${T}.${
|
|
3327
|
+
name: `${i.name}.${T}.${I.name}`,
|
|
3276
3328
|
value: K.value,
|
|
3277
|
-
checked:
|
|
3329
|
+
checked: j?.[I.name] === K.value,
|
|
3278
3330
|
onChange: () => $(
|
|
3279
3331
|
T,
|
|
3280
|
-
|
|
3332
|
+
I.name,
|
|
3281
3333
|
K.value
|
|
3282
3334
|
),
|
|
3283
3335
|
disabled: S || K.disabled,
|
|
3284
3336
|
className: "rounded-full border-neutral-100 dark:border-neutral-600"
|
|
3285
3337
|
}
|
|
3286
3338
|
),
|
|
3287
|
-
/* @__PURE__ */ e(
|
|
3339
|
+
/* @__PURE__ */ e(Y, { variant: "label", size: "sm", children: K.label })
|
|
3288
3340
|
]
|
|
3289
3341
|
},
|
|
3290
3342
|
K.value
|
|
3291
3343
|
)) });
|
|
3292
3344
|
case "date": {
|
|
3293
|
-
const K =
|
|
3345
|
+
const K = j?.[I.name];
|
|
3294
3346
|
return /* @__PURE__ */ e(
|
|
3295
|
-
|
|
3347
|
+
ye,
|
|
3296
3348
|
{
|
|
3297
3349
|
...ne,
|
|
3298
3350
|
value: K ? new Date(K) : null,
|
|
3299
3351
|
onChange: (le) => $(
|
|
3300
3352
|
T,
|
|
3301
|
-
|
|
3353
|
+
I.name,
|
|
3302
3354
|
le
|
|
3303
3355
|
),
|
|
3304
3356
|
size: l
|
|
@@ -3306,11 +3358,11 @@ const cr = ({
|
|
|
3306
3358
|
);
|
|
3307
3359
|
}
|
|
3308
3360
|
case "custom":
|
|
3309
|
-
return
|
|
3310
|
-
value:
|
|
3361
|
+
return I.customComponent?.({
|
|
3362
|
+
value: j?.[I.name],
|
|
3311
3363
|
onChange: (K) => $(
|
|
3312
3364
|
T,
|
|
3313
|
-
|
|
3365
|
+
I.name,
|
|
3314
3366
|
K
|
|
3315
3367
|
),
|
|
3316
3368
|
error: ee,
|
|
@@ -3321,12 +3373,12 @@ const cr = ({
|
|
|
3321
3373
|
return /* @__PURE__ */ d("p", { children: [
|
|
3322
3374
|
"Unsupported field type in array:",
|
|
3323
3375
|
" ",
|
|
3324
|
-
|
|
3376
|
+
I.type
|
|
3325
3377
|
] });
|
|
3326
3378
|
}
|
|
3327
3379
|
})(),
|
|
3328
3380
|
ee && /* @__PURE__ */ e(
|
|
3329
|
-
|
|
3381
|
+
Y,
|
|
3330
3382
|
{
|
|
3331
3383
|
variant: "body",
|
|
3332
3384
|
size: "sm",
|
|
@@ -3336,7 +3388,7 @@ const cr = ({
|
|
|
3336
3388
|
)
|
|
3337
3389
|
]
|
|
3338
3390
|
},
|
|
3339
|
-
|
|
3391
|
+
I.name
|
|
3340
3392
|
);
|
|
3341
3393
|
}) })
|
|
3342
3394
|
]
|
|
@@ -3363,13 +3415,13 @@ const cr = ({
|
|
|
3363
3415
|
return null;
|
|
3364
3416
|
}
|
|
3365
3417
|
},
|
|
3366
|
-
[
|
|
3418
|
+
[y, P, N, m, l, z]
|
|
3367
3419
|
), W = ae(
|
|
3368
3420
|
(i) => {
|
|
3369
|
-
if (i.conditional && !i.conditional(
|
|
3421
|
+
if (i.conditional && !i.conditional(y))
|
|
3370
3422
|
return null;
|
|
3371
|
-
const
|
|
3372
|
-
if (
|
|
3423
|
+
const v = i.items.filter((S) => !(S.hidden || S.conditional && !S.conditional(y)));
|
|
3424
|
+
if (v.length === 0) return null;
|
|
3373
3425
|
const E = p(
|
|
3374
3426
|
"space-y-2",
|
|
3375
3427
|
{
|
|
@@ -3391,7 +3443,7 @@ const cr = ({
|
|
|
3391
3443
|
children: [
|
|
3392
3444
|
/* @__PURE__ */ d("div", { className: "md:col-span-1", children: [
|
|
3393
3445
|
/* @__PURE__ */ e(
|
|
3394
|
-
|
|
3446
|
+
Y,
|
|
3395
3447
|
{
|
|
3396
3448
|
variant: "label",
|
|
3397
3449
|
size: "lg",
|
|
@@ -3401,7 +3453,7 @@ const cr = ({
|
|
|
3401
3453
|
}
|
|
3402
3454
|
),
|
|
3403
3455
|
i.description && /* @__PURE__ */ e(
|
|
3404
|
-
|
|
3456
|
+
Y,
|
|
3405
3457
|
{
|
|
3406
3458
|
variant: "body",
|
|
3407
3459
|
size: "sm",
|
|
@@ -3410,7 +3462,7 @@ const cr = ({
|
|
|
3410
3462
|
}
|
|
3411
3463
|
)
|
|
3412
3464
|
] }),
|
|
3413
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: E, children:
|
|
3465
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: E, children: v.map((S) => (P[S.name] && N[S.name], /* @__PURE__ */ d(
|
|
3414
3466
|
"div",
|
|
3415
3467
|
{
|
|
3416
3468
|
className: p(
|
|
@@ -3420,7 +3472,7 @@ const cr = ({
|
|
|
3420
3472
|
),
|
|
3421
3473
|
children: [
|
|
3422
3474
|
S.type !== "custom" && /* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */ d(
|
|
3423
|
-
|
|
3475
|
+
Y,
|
|
3424
3476
|
{
|
|
3425
3477
|
variant: "label",
|
|
3426
3478
|
size: "sm",
|
|
@@ -3431,7 +3483,7 @@ const cr = ({
|
|
|
3431
3483
|
]
|
|
3432
3484
|
}
|
|
3433
3485
|
) }),
|
|
3434
|
-
|
|
3486
|
+
D(S)
|
|
3435
3487
|
]
|
|
3436
3488
|
},
|
|
3437
3489
|
S.name
|
|
@@ -3441,7 +3493,7 @@ const cr = ({
|
|
|
3441
3493
|
i.id
|
|
3442
3494
|
);
|
|
3443
3495
|
},
|
|
3444
|
-
[
|
|
3496
|
+
[y, P, N, D]
|
|
3445
3497
|
), V = p(
|
|
3446
3498
|
"space-y-6",
|
|
3447
3499
|
{
|
|
@@ -3452,91 +3504,36 @@ const cr = ({
|
|
|
3452
3504
|
},
|
|
3453
3505
|
h
|
|
3454
3506
|
);
|
|
3455
|
-
return /* @__PURE__ */ d("form", { ref:
|
|
3507
|
+
return /* @__PURE__ */ d("form", { ref: k, onSubmit: H, className: V, children: [
|
|
3456
3508
|
/* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(W) }),
|
|
3457
3509
|
g && /* @__PURE__ */ d("div", { className: p("flex gap-3 justify-end pt-8"), children: [
|
|
3458
3510
|
n && /* @__PURE__ */ e(
|
|
3459
3511
|
te,
|
|
3460
3512
|
{
|
|
3461
3513
|
type: "button",
|
|
3462
|
-
variant:
|
|
3463
|
-
size:
|
|
3464
|
-
disabled:
|
|
3514
|
+
variant: b.variant,
|
|
3515
|
+
size: b.size || l,
|
|
3516
|
+
disabled: b.disabled || m,
|
|
3465
3517
|
onClick: n,
|
|
3466
|
-
className:
|
|
3467
|
-
children:
|
|
3518
|
+
className: b.className,
|
|
3519
|
+
children: b.label
|
|
3468
3520
|
}
|
|
3469
3521
|
),
|
|
3470
3522
|
/* @__PURE__ */ e(
|
|
3471
3523
|
te,
|
|
3472
3524
|
{
|
|
3473
3525
|
type: "submit",
|
|
3474
|
-
variant:
|
|
3475
|
-
size:
|
|
3476
|
-
disabled:
|
|
3526
|
+
variant: x.variant,
|
|
3527
|
+
size: x.size || l,
|
|
3528
|
+
disabled: x.disabled || m,
|
|
3477
3529
|
loading: m,
|
|
3478
|
-
className:
|
|
3479
|
-
children:
|
|
3530
|
+
className: x.className,
|
|
3531
|
+
children: x.label
|
|
3480
3532
|
}
|
|
3481
3533
|
)
|
|
3482
3534
|
] })
|
|
3483
3535
|
] });
|
|
3484
|
-
},
|
|
3485
|
-
trigger: t,
|
|
3486
|
-
children: a,
|
|
3487
|
-
placement: r = "bottom-start",
|
|
3488
|
-
className: n,
|
|
3489
|
-
disabled: s = !1
|
|
3490
|
-
}) => {
|
|
3491
|
-
const [o, u] = P(!1), [b, x] = P({}), g = J(null), f = J(null);
|
|
3492
|
-
U(() => {
|
|
3493
|
-
if (!o) return;
|
|
3494
|
-
const h = (k) => {
|
|
3495
|
-
g.current && !g.current.contains(k.target) && u(!1);
|
|
3496
|
-
}, w = (k) => {
|
|
3497
|
-
k.key === "Escape" && u(!1);
|
|
3498
|
-
};
|
|
3499
|
-
return document.addEventListener("mousedown", h), document.addEventListener("keydown", w), () => {
|
|
3500
|
-
document.removeEventListener("mousedown", h), document.removeEventListener("keydown", w);
|
|
3501
|
-
};
|
|
3502
|
-
}, [o]);
|
|
3503
|
-
const l = (h) => {
|
|
3504
|
-
if (h.stopPropagation(), !s) {
|
|
3505
|
-
if (!o) {
|
|
3506
|
-
const w = f.current?.getBoundingClientRect();
|
|
3507
|
-
if (w) {
|
|
3508
|
-
const v = {};
|
|
3509
|
-
r.startsWith("bottom") ? v.top = w.bottom + 6 : v.bottom = window.innerHeight - w.top + 6, r.endsWith("start") ? v.left = w.left : v.right = window.innerWidth - w.right, x(v);
|
|
3510
|
-
}
|
|
3511
|
-
}
|
|
3512
|
-
u((w) => !w);
|
|
3513
|
-
}
|
|
3514
|
-
}, m = () => u(!1);
|
|
3515
|
-
return /* @__PURE__ */ d("div", { ref: g, className: "relative inline-flex", children: [
|
|
3516
|
-
/* @__PURE__ */ e(
|
|
3517
|
-
"button",
|
|
3518
|
-
{
|
|
3519
|
-
ref: f,
|
|
3520
|
-
type: "button",
|
|
3521
|
-
onClick: l,
|
|
3522
|
-
disabled: s,
|
|
3523
|
-
className: p("inline-flex items-center", s && "opacity-50 cursor-not-allowed"),
|
|
3524
|
-
children: t
|
|
3525
|
-
}
|
|
3526
|
-
),
|
|
3527
|
-
o && /* @__PURE__ */ e(
|
|
3528
|
-
"div",
|
|
3529
|
-
{
|
|
3530
|
-
className: p(
|
|
3531
|
-
"fixed z-[60] bg-module rounded-lg shadow-lg border border-neutral",
|
|
3532
|
-
n
|
|
3533
|
-
),
|
|
3534
|
-
style: b,
|
|
3535
|
-
children: typeof a == "function" ? a(m) : a
|
|
3536
|
-
}
|
|
3537
|
-
)
|
|
3538
|
-
] });
|
|
3539
|
-
}, zt = {
|
|
3536
|
+
}, Dt = {
|
|
3540
3537
|
default: "bg-neutral-container text-default",
|
|
3541
3538
|
primary: "bg-accent-container text-accent",
|
|
3542
3539
|
secondary: "bg-neutral-container text-muted",
|
|
@@ -3544,11 +3541,11 @@ const cr = ({
|
|
|
3544
3541
|
warning: "bg-notice-container text-on-notice",
|
|
3545
3542
|
error: "bg-error-container text-error",
|
|
3546
3543
|
info: "bg-beta-container text-link"
|
|
3547
|
-
},
|
|
3544
|
+
}, It = {
|
|
3548
3545
|
sm: "px-2 py-0.5 text-xs",
|
|
3549
3546
|
md: "px-2.5 py-1 text-sm",
|
|
3550
3547
|
lg: "px-3 py-1.5 text-base"
|
|
3551
|
-
},
|
|
3548
|
+
}, zt = {
|
|
3552
3549
|
default: "bg-neutral-fill",
|
|
3553
3550
|
primary: "bg-accent-fill",
|
|
3554
3551
|
secondary: "bg-neutral-fill",
|
|
@@ -3557,7 +3554,7 @@ const cr = ({
|
|
|
3557
3554
|
error: "bg-error-fill",
|
|
3558
3555
|
info: "bg-beta-fill"
|
|
3559
3556
|
};
|
|
3560
|
-
function
|
|
3557
|
+
function ir({
|
|
3561
3558
|
variant: t = "default",
|
|
3562
3559
|
size: a = "md",
|
|
3563
3560
|
dot: r = !1,
|
|
@@ -3565,8 +3562,8 @@ function dr({
|
|
|
3565
3562
|
dismissible: s = !1,
|
|
3566
3563
|
onDismiss: o,
|
|
3567
3564
|
className: u,
|
|
3568
|
-
children:
|
|
3569
|
-
...
|
|
3565
|
+
children: x,
|
|
3566
|
+
...b
|
|
3570
3567
|
}) {
|
|
3571
3568
|
return /* @__PURE__ */ d(
|
|
3572
3569
|
"span",
|
|
@@ -3575,24 +3572,24 @@ function dr({
|
|
|
3575
3572
|
// Base styles
|
|
3576
3573
|
"inline-flex items-center font-medium rounded-full",
|
|
3577
3574
|
// Variant styles
|
|
3578
|
-
|
|
3575
|
+
Dt[t],
|
|
3579
3576
|
// Size styles
|
|
3580
|
-
|
|
3577
|
+
It[a],
|
|
3581
3578
|
u
|
|
3582
3579
|
),
|
|
3583
|
-
...
|
|
3580
|
+
...b,
|
|
3584
3581
|
children: [
|
|
3585
3582
|
r && /* @__PURE__ */ e(
|
|
3586
3583
|
"span",
|
|
3587
3584
|
{
|
|
3588
3585
|
className: p(
|
|
3589
3586
|
"w-2 h-2 rounded-full mr-1.5",
|
|
3590
|
-
|
|
3587
|
+
zt[t]
|
|
3591
3588
|
)
|
|
3592
3589
|
}
|
|
3593
3590
|
),
|
|
3594
|
-
n && /* @__PURE__ */ e("span", { className: p("flex-shrink-0",
|
|
3595
|
-
|
|
3591
|
+
n && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", x && "mr-1"), children: n }),
|
|
3592
|
+
x,
|
|
3596
3593
|
s && o && /* @__PURE__ */ e(
|
|
3597
3594
|
"button",
|
|
3598
3595
|
{
|
|
@@ -3631,7 +3628,7 @@ const At = {
|
|
|
3631
3628
|
lg: "text-base",
|
|
3632
3629
|
xl: "text-lg"
|
|
3633
3630
|
};
|
|
3634
|
-
function
|
|
3631
|
+
function dr({
|
|
3635
3632
|
size: t = "md",
|
|
3636
3633
|
variant: a = "primary",
|
|
3637
3634
|
label: r = "Loading...",
|
|
@@ -3711,7 +3708,7 @@ function Bt(t) {
|
|
|
3711
3708
|
return a.length >= 2 ? (a[0][0] + a[1][0]).toUpperCase() : a.length === 1 ? a[0].slice(0, 2).toUpperCase() : "?";
|
|
3712
3709
|
}
|
|
3713
3710
|
const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
3714
|
-
const [o, u] = se.useState(!1),
|
|
3711
|
+
const [o, u] = se.useState(!1), x = p(
|
|
3715
3712
|
"inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 font-semibold select-none bg-neutral-border-emphasis text-default",
|
|
3716
3713
|
Pt[r],
|
|
3717
3714
|
n
|
|
@@ -3722,15 +3719,15 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3722
3719
|
src: a,
|
|
3723
3720
|
alt: t ?? "",
|
|
3724
3721
|
title: s ?? t,
|
|
3725
|
-
className: p(
|
|
3722
|
+
className: p(x, "object-cover"),
|
|
3726
3723
|
onError: () => u(!0)
|
|
3727
3724
|
}
|
|
3728
|
-
) : /* @__PURE__ */ e("span", { className:
|
|
3729
|
-
}, Me = "shadow-[0_0_0_2px_var(--base-module)]", Wt = "shadow-[0_0_0_2px_var(--base-module),0_0_0_3.5px_var(--accent-border)]",
|
|
3725
|
+
) : /* @__PURE__ */ e("span", { className: x, title: s ?? t, "aria-label": t, children: Bt(t) });
|
|
3726
|
+
}, Me = "shadow-[0_0_0_2px_var(--base-module)]", Wt = "shadow-[0_0_0_2px_var(--base-module),0_0_0_3.5px_var(--accent-border)]", ur = ({ people: t, max: a = 4, size: r = "sm", className: n }) => {
|
|
3730
3727
|
if (t.length === 0) return null;
|
|
3731
3728
|
const s = t.slice(0, a), o = t.length - s.length;
|
|
3732
3729
|
return /* @__PURE__ */ d("span", { className: p("inline-flex items-center", n), children: [
|
|
3733
|
-
s.map((u,
|
|
3730
|
+
s.map((u, x) => /* @__PURE__ */ e(
|
|
3734
3731
|
Ot,
|
|
3735
3732
|
{
|
|
3736
3733
|
name: u.name,
|
|
@@ -3738,12 +3735,12 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3738
3735
|
size: r,
|
|
3739
3736
|
title: u.name ? u.seen === !1 ? `${u.name} — nog niet gelezen` : u.name : void 0,
|
|
3740
3737
|
className: p(
|
|
3741
|
-
|
|
3738
|
+
x > 0 && "-ml-2",
|
|
3742
3739
|
u.owner ? Wt : Me,
|
|
3743
3740
|
u.seen === !1 && "opacity-40"
|
|
3744
3741
|
)
|
|
3745
3742
|
},
|
|
3746
|
-
u.id ?? `${u.name}-${
|
|
3743
|
+
u.id ?? `${u.name}-${x}`
|
|
3747
3744
|
)),
|
|
3748
3745
|
o > 0 && /* @__PURE__ */ d(
|
|
3749
3746
|
"span",
|
|
@@ -3760,7 +3757,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3760
3757
|
}
|
|
3761
3758
|
)
|
|
3762
3759
|
] });
|
|
3763
|
-
},
|
|
3760
|
+
}, mr = ({
|
|
3764
3761
|
src: t,
|
|
3765
3762
|
alt: a,
|
|
3766
3763
|
size: r = "md",
|
|
@@ -3768,19 +3765,19 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3768
3765
|
radius: s = "md",
|
|
3769
3766
|
showLoading: o = !0,
|
|
3770
3767
|
showError: u = !0,
|
|
3771
|
-
fallback:
|
|
3772
|
-
loadingContent:
|
|
3768
|
+
fallback: x,
|
|
3769
|
+
loadingContent: b,
|
|
3773
3770
|
errorContent: g,
|
|
3774
3771
|
className: f,
|
|
3775
3772
|
onLoad: l,
|
|
3776
3773
|
onError: m,
|
|
3777
3774
|
...h
|
|
3778
3775
|
}) => {
|
|
3779
|
-
const [
|
|
3780
|
-
|
|
3776
|
+
const [k, w] = B(!0), [y, A] = B(!1), [N, q] = B(t), P = (V) => {
|
|
3777
|
+
w(!1), A(!1), l?.(V);
|
|
3781
3778
|
}, G = (V) => {
|
|
3782
|
-
if (
|
|
3783
|
-
q(
|
|
3779
|
+
if (w(!1), A(!0), x && N !== x) {
|
|
3780
|
+
q(x), A(!1), w(!0);
|
|
3784
3781
|
return;
|
|
3785
3782
|
}
|
|
3786
3783
|
m?.(V);
|
|
@@ -3812,16 +3809,16 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3812
3809
|
"rounded-full": s === "full"
|
|
3813
3810
|
},
|
|
3814
3811
|
f
|
|
3815
|
-
),
|
|
3812
|
+
), z = p(
|
|
3816
3813
|
"w-full h-full object-cover transition-opacity duration-200",
|
|
3817
3814
|
{
|
|
3818
|
-
"opacity-0":
|
|
3819
|
-
"opacity-100": !
|
|
3815
|
+
"opacity-0": k || y,
|
|
3816
|
+
"opacity-100": !k && !y
|
|
3820
3817
|
}
|
|
3821
3818
|
), H = p(
|
|
3822
3819
|
"absolute inset-0 flex items-center justify-center",
|
|
3823
3820
|
"text-neutral-400 dark:text-neutral-500"
|
|
3824
|
-
),
|
|
3821
|
+
), D = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), W = /* @__PURE__ */ d("div", { className: "text-center", children: [
|
|
3825
3822
|
/* @__PURE__ */ e(
|
|
3826
3823
|
"svg",
|
|
3827
3824
|
{
|
|
@@ -3849,15 +3846,15 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3849
3846
|
...h,
|
|
3850
3847
|
src: N,
|
|
3851
3848
|
alt: a,
|
|
3852
|
-
className:
|
|
3853
|
-
onLoad:
|
|
3849
|
+
className: z,
|
|
3850
|
+
onLoad: P,
|
|
3854
3851
|
onError: G
|
|
3855
3852
|
}
|
|
3856
3853
|
),
|
|
3857
|
-
|
|
3858
|
-
|
|
3854
|
+
k && o && /* @__PURE__ */ e("div", { className: H, children: b || D }),
|
|
3855
|
+
y && u && /* @__PURE__ */ e("div", { className: H, children: g || W })
|
|
3859
3856
|
] });
|
|
3860
|
-
},
|
|
3857
|
+
}, fr = ({
|
|
3861
3858
|
title: t,
|
|
3862
3859
|
subtitle: a,
|
|
3863
3860
|
actions: r = [],
|
|
@@ -3865,22 +3862,22 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3865
3862
|
className: s,
|
|
3866
3863
|
backLabel: o = "Back",
|
|
3867
3864
|
backClassName: u,
|
|
3868
|
-
onBack:
|
|
3869
|
-
editable:
|
|
3865
|
+
onBack: x,
|
|
3866
|
+
editable: b = !1,
|
|
3870
3867
|
onTitleChange: g
|
|
3871
3868
|
}) => {
|
|
3872
|
-
const [f, l] =
|
|
3869
|
+
const [f, l] = B(!1), [m, h] = B(t), k = Z(null);
|
|
3873
3870
|
U(() => {
|
|
3874
3871
|
h(t);
|
|
3875
3872
|
}, [t]), U(() => {
|
|
3876
|
-
f &&
|
|
3873
|
+
f && k.current && (k.current.focus(), k.current.select());
|
|
3877
3874
|
}, [f]);
|
|
3878
|
-
const
|
|
3879
|
-
|
|
3880
|
-
},
|
|
3875
|
+
const w = () => {
|
|
3876
|
+
b && l(!0);
|
|
3877
|
+
}, y = () => {
|
|
3881
3878
|
l(!1), m.trim() !== "" && m !== t && g ? g(m.trim()) : h(t);
|
|
3882
|
-
},
|
|
3883
|
-
N.key === "Enter" ?
|
|
3879
|
+
}, A = (N) => {
|
|
3880
|
+
N.key === "Enter" ? k.current?.blur() : N.key === "Escape" && (h(t), l(!1));
|
|
3884
3881
|
};
|
|
3885
3882
|
return /* @__PURE__ */ d(
|
|
3886
3883
|
"div",
|
|
@@ -3892,47 +3889,47 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3892
3889
|
children: [
|
|
3893
3890
|
/* @__PURE__ */ d("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
3894
3891
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2 text-default", children: [
|
|
3895
|
-
|
|
3892
|
+
x && /* @__PURE__ */ e(
|
|
3896
3893
|
"button",
|
|
3897
3894
|
{
|
|
3898
3895
|
type: "button",
|
|
3899
|
-
onClick:
|
|
3896
|
+
onClick: x,
|
|
3900
3897
|
className: p(
|
|
3901
3898
|
"flex items-center text-sm cursor-pointer transition",
|
|
3902
3899
|
u
|
|
3903
3900
|
),
|
|
3904
|
-
children: /* @__PURE__ */ e(
|
|
3901
|
+
children: /* @__PURE__ */ e(ke, { size: 16, color: "currentColor" })
|
|
3905
3902
|
}
|
|
3906
3903
|
),
|
|
3907
3904
|
f ? /* @__PURE__ */ e(
|
|
3908
3905
|
"input",
|
|
3909
3906
|
{
|
|
3910
|
-
ref:
|
|
3907
|
+
ref: k,
|
|
3911
3908
|
type: "text",
|
|
3912
3909
|
value: m,
|
|
3913
3910
|
onChange: (N) => h(N.target.value),
|
|
3914
|
-
onBlur:
|
|
3915
|
-
onKeyDown:
|
|
3911
|
+
onBlur: y,
|
|
3912
|
+
onKeyDown: A,
|
|
3916
3913
|
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"
|
|
3917
3914
|
}
|
|
3918
3915
|
) : /* @__PURE__ */ d("div", { className: "group flex items-center gap-1.5 min-w-0", children: [
|
|
3919
3916
|
/* @__PURE__ */ e(
|
|
3920
3917
|
"h2",
|
|
3921
3918
|
{
|
|
3922
|
-
onClick:
|
|
3919
|
+
onClick: w,
|
|
3923
3920
|
className: p(
|
|
3924
3921
|
"text-2xl font-semibold truncate",
|
|
3925
|
-
|
|
3922
|
+
b && "cursor-pointer"
|
|
3926
3923
|
),
|
|
3927
|
-
title:
|
|
3924
|
+
title: b ? "Klik om te bewerken" : void 0,
|
|
3928
3925
|
children: t
|
|
3929
3926
|
}
|
|
3930
3927
|
),
|
|
3931
|
-
|
|
3932
|
-
|
|
3928
|
+
b && /* @__PURE__ */ e(
|
|
3929
|
+
Re,
|
|
3933
3930
|
{
|
|
3934
3931
|
size: 15,
|
|
3935
|
-
onClick:
|
|
3932
|
+
onClick: w,
|
|
3936
3933
|
className: "shrink-0 cursor-pointer text-muted opacity-0 group-hover:opacity-100 transition-opacity"
|
|
3937
3934
|
}
|
|
3938
3935
|
)
|
|
@@ -3940,7 +3937,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3940
3937
|
] }) }),
|
|
3941
3938
|
r.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: r.map(
|
|
3942
3939
|
(N) => N.splitOptions && N.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
3943
|
-
|
|
3940
|
+
Te,
|
|
3944
3941
|
{
|
|
3945
3942
|
label: N.label,
|
|
3946
3943
|
onClick: N.onClick,
|
|
@@ -3977,7 +3974,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3977
3974
|
]
|
|
3978
3975
|
}
|
|
3979
3976
|
);
|
|
3980
|
-
},
|
|
3977
|
+
}, hr = ({
|
|
3981
3978
|
actions: t = [],
|
|
3982
3979
|
onBack: a,
|
|
3983
3980
|
backLabel: r = "Back",
|
|
@@ -3991,7 +3988,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3991
3988
|
onClick: a,
|
|
3992
3989
|
className: "flex items-center gap-1 text-sm text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 cursor-pointer transition px-2 py-1 rounded",
|
|
3993
3990
|
children: [
|
|
3994
|
-
/* @__PURE__ */ e(
|
|
3991
|
+
/* @__PURE__ */ e(ke, { size: 16 }),
|
|
3995
3992
|
/* @__PURE__ */ e("span", { children: r })
|
|
3996
3993
|
]
|
|
3997
3994
|
}
|
|
@@ -3999,7 +3996,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3999
3996
|
s && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: s }),
|
|
4000
3997
|
t.length > 0 && /* @__PURE__ */ e("div", { className: p("flex flex-wrap gap-2", !s && "ml-auto"), children: t.map(
|
|
4001
3998
|
(o) => o.splitOptions && o.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
4002
|
-
|
|
3999
|
+
Te,
|
|
4003
4000
|
{
|
|
4004
4001
|
label: o.label,
|
|
4005
4002
|
onClick: o.onClick,
|
|
@@ -4038,7 +4035,7 @@ function Ft(t, a) {
|
|
|
4038
4035
|
t
|
|
4039
4036
|
);
|
|
4040
4037
|
}
|
|
4041
|
-
const
|
|
4038
|
+
const pr = ({
|
|
4042
4039
|
groups: t,
|
|
4043
4040
|
data: a,
|
|
4044
4041
|
size: r = "md",
|
|
@@ -4059,26 +4056,26 @@ const xr = ({
|
|
|
4059
4056
|
if (!l) return String(f || "-");
|
|
4060
4057
|
const m = l.find((h) => h.value === f);
|
|
4061
4058
|
return m ? m.label : String(f || "-");
|
|
4062
|
-
},
|
|
4059
|
+
}, x = ae(
|
|
4063
4060
|
(f) => {
|
|
4064
4061
|
const l = Ft(a, f.name);
|
|
4065
4062
|
if (f.type === "array") {
|
|
4066
4063
|
const h = l;
|
|
4067
4064
|
return !h || h.length === 0 ? /* @__PURE__ */ e(
|
|
4068
|
-
|
|
4065
|
+
Y,
|
|
4069
4066
|
{
|
|
4070
4067
|
variant: "body",
|
|
4071
4068
|
size: "sm",
|
|
4072
4069
|
className: "text-neutral-500 dark:text-neutral-400",
|
|
4073
4070
|
children: "Geen items"
|
|
4074
4071
|
}
|
|
4075
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: h.map((
|
|
4072
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: h.map((k, w) => /* @__PURE__ */ d(
|
|
4076
4073
|
"div",
|
|
4077
4074
|
{
|
|
4078
4075
|
className: "p-4 border border-neutral-200 dark:border-neutral-700 rounded-lg space-y-3",
|
|
4079
4076
|
children: [
|
|
4080
4077
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ d(
|
|
4081
|
-
|
|
4078
|
+
Y,
|
|
4082
4079
|
{
|
|
4083
4080
|
variant: "label",
|
|
4084
4081
|
size: "sm",
|
|
@@ -4087,55 +4084,55 @@ const xr = ({
|
|
|
4087
4084
|
children: [
|
|
4088
4085
|
f.label,
|
|
4089
4086
|
" ",
|
|
4090
|
-
|
|
4087
|
+
w + 1
|
|
4091
4088
|
]
|
|
4092
4089
|
}
|
|
4093
4090
|
) }),
|
|
4094
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: f.arrayFields?.map((
|
|
4095
|
-
const
|
|
4091
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: f.arrayFields?.map((y) => {
|
|
4092
|
+
const A = k?.[y.name];
|
|
4096
4093
|
let N = "-";
|
|
4097
|
-
switch (
|
|
4094
|
+
switch (y.type) {
|
|
4098
4095
|
case "text":
|
|
4099
4096
|
case "email":
|
|
4100
4097
|
case "number":
|
|
4101
4098
|
case "tel":
|
|
4102
4099
|
case "url":
|
|
4103
4100
|
case "textarea":
|
|
4104
|
-
N =
|
|
4101
|
+
N = A || "-";
|
|
4105
4102
|
break;
|
|
4106
4103
|
case "select":
|
|
4107
4104
|
case "radio":
|
|
4108
4105
|
N = u(
|
|
4109
|
-
|
|
4110
|
-
|
|
4106
|
+
A,
|
|
4107
|
+
y.options
|
|
4111
4108
|
);
|
|
4112
4109
|
break;
|
|
4113
4110
|
case "checkbox":
|
|
4114
|
-
N = o(
|
|
4111
|
+
N = o(A);
|
|
4115
4112
|
break;
|
|
4116
4113
|
case "date":
|
|
4117
|
-
N = s(
|
|
4114
|
+
N = s(A);
|
|
4118
4115
|
break;
|
|
4119
4116
|
case "custom":
|
|
4120
|
-
N =
|
|
4121
|
-
value:
|
|
4117
|
+
N = y.customComponent?.({
|
|
4118
|
+
value: A
|
|
4122
4119
|
});
|
|
4123
4120
|
break;
|
|
4124
4121
|
default:
|
|
4125
|
-
N = String(
|
|
4122
|
+
N = String(A || "-");
|
|
4126
4123
|
}
|
|
4127
|
-
return
|
|
4124
|
+
return y.format && (N = y.format(A, k)), /* @__PURE__ */ d("div", { className: "space-y-1", children: [
|
|
4128
4125
|
/* @__PURE__ */ e(
|
|
4129
|
-
|
|
4126
|
+
Y,
|
|
4130
4127
|
{
|
|
4131
4128
|
variant: "label",
|
|
4132
4129
|
size: "xs",
|
|
4133
4130
|
className: "text-neutral-600 dark:text-neutral-400",
|
|
4134
|
-
children:
|
|
4131
|
+
children: y.label
|
|
4135
4132
|
}
|
|
4136
4133
|
),
|
|
4137
4134
|
/* @__PURE__ */ e(
|
|
4138
|
-
|
|
4135
|
+
Y,
|
|
4139
4136
|
{
|
|
4140
4137
|
variant: "body",
|
|
4141
4138
|
size: "sm",
|
|
@@ -4143,11 +4140,11 @@ const xr = ({
|
|
|
4143
4140
|
children: N
|
|
4144
4141
|
}
|
|
4145
4142
|
)
|
|
4146
|
-
] },
|
|
4143
|
+
] }, y.name);
|
|
4147
4144
|
}) })
|
|
4148
4145
|
]
|
|
4149
4146
|
},
|
|
4150
|
-
|
|
4147
|
+
w
|
|
4151
4148
|
)) });
|
|
4152
4149
|
}
|
|
4153
4150
|
if (f.type === "custom" && f.customComponent)
|
|
@@ -4155,7 +4152,7 @@ const xr = ({
|
|
|
4155
4152
|
if (f.format) {
|
|
4156
4153
|
const h = f.format(l, a);
|
|
4157
4154
|
return /* @__PURE__ */ e(
|
|
4158
|
-
|
|
4155
|
+
Y,
|
|
4159
4156
|
{
|
|
4160
4157
|
variant: "body",
|
|
4161
4158
|
size: "sm",
|
|
@@ -4191,7 +4188,7 @@ const xr = ({
|
|
|
4191
4188
|
m = l ? String(l) : "-";
|
|
4192
4189
|
}
|
|
4193
4190
|
return /* @__PURE__ */ e(
|
|
4194
|
-
|
|
4191
|
+
Y,
|
|
4195
4192
|
{
|
|
4196
4193
|
variant: "body",
|
|
4197
4194
|
size: "sm",
|
|
@@ -4201,7 +4198,7 @@ const xr = ({
|
|
|
4201
4198
|
);
|
|
4202
4199
|
},
|
|
4203
4200
|
[a]
|
|
4204
|
-
),
|
|
4201
|
+
), b = ae(
|
|
4205
4202
|
(f) => {
|
|
4206
4203
|
if (f.conditional && !f.conditional(a))
|
|
4207
4204
|
return null;
|
|
@@ -4228,7 +4225,7 @@ const xr = ({
|
|
|
4228
4225
|
children: [
|
|
4229
4226
|
/* @__PURE__ */ d("div", { className: "md:col-span-1", children: [
|
|
4230
4227
|
/* @__PURE__ */ e(
|
|
4231
|
-
|
|
4228
|
+
Y,
|
|
4232
4229
|
{
|
|
4233
4230
|
variant: "label",
|
|
4234
4231
|
size: "lg",
|
|
@@ -4238,7 +4235,7 @@ const xr = ({
|
|
|
4238
4235
|
}
|
|
4239
4236
|
),
|
|
4240
4237
|
f.description && /* @__PURE__ */ e(
|
|
4241
|
-
|
|
4238
|
+
Y,
|
|
4242
4239
|
{
|
|
4243
4240
|
variant: "body",
|
|
4244
4241
|
size: "sm",
|
|
@@ -4257,7 +4254,7 @@ const xr = ({
|
|
|
4257
4254
|
),
|
|
4258
4255
|
children: [
|
|
4259
4256
|
h.type !== "custom" && /* @__PURE__ */ e(
|
|
4260
|
-
|
|
4257
|
+
Y,
|
|
4261
4258
|
{
|
|
4262
4259
|
variant: "label",
|
|
4263
4260
|
size: "sm",
|
|
@@ -4265,7 +4262,7 @@ const xr = ({
|
|
|
4265
4262
|
children: h.label
|
|
4266
4263
|
}
|
|
4267
4264
|
),
|
|
4268
|
-
|
|
4265
|
+
x(h)
|
|
4269
4266
|
]
|
|
4270
4267
|
},
|
|
4271
4268
|
h.name
|
|
@@ -4275,7 +4272,7 @@ const xr = ({
|
|
|
4275
4272
|
f.id
|
|
4276
4273
|
);
|
|
4277
4274
|
},
|
|
4278
|
-
[a,
|
|
4275
|
+
[a, x]
|
|
4279
4276
|
), g = p(
|
|
4280
4277
|
"space-y-6",
|
|
4281
4278
|
{
|
|
@@ -4286,9 +4283,9 @@ const xr = ({
|
|
|
4286
4283
|
},
|
|
4287
4284
|
n
|
|
4288
4285
|
);
|
|
4289
|
-
return /* @__PURE__ */ e("div", { className: g, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(
|
|
4286
|
+
return /* @__PURE__ */ e("div", { className: g, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(b) }) });
|
|
4290
4287
|
}, Ie = ({ item: t, isSelectedHandler: a, onClick: r, depth: n = 0 }) => {
|
|
4291
|
-
const [s, o] =
|
|
4288
|
+
const [s, o] = B(t.defaultCollapsed ?? !1), u = t.children && t.children.length > 0, x = u && n === 0, b = () => {
|
|
4292
4289
|
u && o(!s);
|
|
4293
4290
|
}, g = a ? a(t.path) : !1;
|
|
4294
4291
|
return /* @__PURE__ */ d("li", { children: [
|
|
@@ -4300,17 +4297,17 @@ const xr = ({
|
|
|
4300
4297
|
{
|
|
4301
4298
|
"active-nav-item": g && !u,
|
|
4302
4299
|
"shadow-lvl-0": g && !u,
|
|
4303
|
-
"font-semibold": g ||
|
|
4300
|
+
"font-semibold": g || x
|
|
4304
4301
|
}
|
|
4305
4302
|
),
|
|
4306
4303
|
onClick: () => {
|
|
4307
|
-
u ?
|
|
4304
|
+
u ? b() : t.path && r?.(t.path);
|
|
4308
4305
|
},
|
|
4309
4306
|
children: [
|
|
4310
4307
|
t.icon && /* @__PURE__ */ e("span", { className: "mr-2 shrink-0", children: t.icon }),
|
|
4311
4308
|
/* @__PURE__ */ e("span", { className: "flex-1 min-w-0 truncate", children: t.label }),
|
|
4312
4309
|
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e("span", { className: "ml-2 mr-1.5", children: t.count }),
|
|
4313
|
-
u && /* @__PURE__ */ e("span", { className: `${s ? "collapsed" : ""}`, children: /* @__PURE__ */ e(
|
|
4310
|
+
u && /* @__PURE__ */ e("span", { className: `${s ? "collapsed" : ""}`, children: /* @__PURE__ */ e(He, { className: "w-4 h-4 text-muted" }) })
|
|
4314
4311
|
]
|
|
4315
4312
|
}
|
|
4316
4313
|
),
|
|
@@ -4325,7 +4322,7 @@ const xr = ({
|
|
|
4325
4322
|
l
|
|
4326
4323
|
)) })
|
|
4327
4324
|
] });
|
|
4328
|
-
},
|
|
4325
|
+
}, xr = ({
|
|
4329
4326
|
title: t,
|
|
4330
4327
|
actionIcons: a,
|
|
4331
4328
|
items: r,
|
|
@@ -4335,21 +4332,21 @@ const xr = ({
|
|
|
4335
4332
|
}) => /* @__PURE__ */ d("div", { className: "flex flex-col h-screen mb-6", children: [
|
|
4336
4333
|
/* @__PURE__ */ d("div", { className: "sidebar-menu-header", children: [
|
|
4337
4334
|
/* @__PURE__ */ e("span", { className: "text-xl font-semibold text-default mb-2", children: t }),
|
|
4338
|
-
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: a?.map((u,
|
|
4335
|
+
/* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: a?.map((u, x) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: u }, x)) })
|
|
4339
4336
|
] }),
|
|
4340
4337
|
o && /* @__PURE__ */ e("div", { className: "sidebar-menu-pre-items mb-4", children: o }),
|
|
4341
4338
|
/* @__PURE__ */ e("ul", { children: r.map(
|
|
4342
|
-
(u,
|
|
4339
|
+
(u, x) => !u.path && !u.label && !u.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, x) : /* @__PURE__ */ e(
|
|
4343
4340
|
Ie,
|
|
4344
4341
|
{
|
|
4345
4342
|
item: u,
|
|
4346
4343
|
isSelectedHandler: n,
|
|
4347
4344
|
onClick: s
|
|
4348
4345
|
},
|
|
4349
|
-
|
|
4346
|
+
x
|
|
4350
4347
|
)
|
|
4351
4348
|
) })
|
|
4352
|
-
] }),
|
|
4349
|
+
] }), br = ({
|
|
4353
4350
|
level: t = 1,
|
|
4354
4351
|
size: a,
|
|
4355
4352
|
weight: r = "bold",
|
|
@@ -4357,8 +4354,8 @@ const xr = ({
|
|
|
4357
4354
|
align: s = "left",
|
|
4358
4355
|
truncate: o = !1,
|
|
4359
4356
|
className: u,
|
|
4360
|
-
children:
|
|
4361
|
-
...
|
|
4357
|
+
children: x,
|
|
4358
|
+
...b
|
|
4362
4359
|
}) => {
|
|
4363
4360
|
const g = a || Vt(t), f = p(
|
|
4364
4361
|
"font-primary",
|
|
@@ -4405,7 +4402,7 @@ const xr = ({
|
|
|
4405
4402
|
},
|
|
4406
4403
|
u
|
|
4407
4404
|
), l = `h${t}`;
|
|
4408
|
-
return /* @__PURE__ */ e(l, { className: f, ...
|
|
4405
|
+
return /* @__PURE__ */ e(l, { className: f, ...b, children: x });
|
|
4409
4406
|
};
|
|
4410
4407
|
function Vt(t) {
|
|
4411
4408
|
return {
|
|
@@ -4417,7 +4414,7 @@ function Vt(t) {
|
|
|
4417
4414
|
6: "md"
|
|
4418
4415
|
}[t] || "md";
|
|
4419
4416
|
}
|
|
4420
|
-
const
|
|
4417
|
+
const gr = ({
|
|
4421
4418
|
items: t,
|
|
4422
4419
|
type: a = "unordered",
|
|
4423
4420
|
variant: r = "default",
|
|
@@ -4426,7 +4423,7 @@ const yr = ({
|
|
|
4426
4423
|
className: o,
|
|
4427
4424
|
itemClassName: u
|
|
4428
4425
|
}) => {
|
|
4429
|
-
const
|
|
4426
|
+
const x = p(
|
|
4430
4427
|
// Base styles
|
|
4431
4428
|
"space-y-1",
|
|
4432
4429
|
// Variant styles
|
|
@@ -4447,7 +4444,7 @@ const yr = ({
|
|
|
4447
4444
|
"text-lg": n === "lg"
|
|
4448
4445
|
},
|
|
4449
4446
|
o
|
|
4450
|
-
),
|
|
4447
|
+
), b = (l, m) => p(
|
|
4451
4448
|
// Base item styles
|
|
4452
4449
|
"transition-colors duration-200",
|
|
4453
4450
|
// Size-based padding
|
|
@@ -4471,10 +4468,10 @@ const yr = ({
|
|
|
4471
4468
|
}, f = (l, m) => {
|
|
4472
4469
|
s && !m.disabled && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), m.onClick?.());
|
|
4473
4470
|
};
|
|
4474
|
-
return a === "ordered" ? /* @__PURE__ */ e("ol", { className:
|
|
4471
|
+
return a === "ordered" ? /* @__PURE__ */ e("ol", { className: x, children: t.map((l, m) => /* @__PURE__ */ e(
|
|
4475
4472
|
"li",
|
|
4476
4473
|
{
|
|
4477
|
-
className:
|
|
4474
|
+
className: b(l),
|
|
4478
4475
|
onClick: () => g(l),
|
|
4479
4476
|
onKeyDown: (h) => f(h, l),
|
|
4480
4477
|
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
@@ -4482,10 +4479,10 @@ const yr = ({
|
|
|
4482
4479
|
children: l.content
|
|
4483
4480
|
},
|
|
4484
4481
|
l.id || m
|
|
4485
|
-
)) }) : a === "description" ? /* @__PURE__ */ e("dl", { className:
|
|
4482
|
+
)) }) : a === "description" ? /* @__PURE__ */ e("dl", { className: x, children: t.map((l, m) => /* @__PURE__ */ e(
|
|
4486
4483
|
"div",
|
|
4487
4484
|
{
|
|
4488
|
-
className:
|
|
4485
|
+
className: b(l),
|
|
4489
4486
|
onClick: () => g(l),
|
|
4490
4487
|
onKeyDown: (h) => f(h, l),
|
|
4491
4488
|
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
@@ -4493,10 +4490,10 @@ const yr = ({
|
|
|
4493
4490
|
children: l.content
|
|
4494
4491
|
},
|
|
4495
4492
|
l.id || m
|
|
4496
|
-
)) }) : /* @__PURE__ */ e("ul", { className:
|
|
4493
|
+
)) }) : /* @__PURE__ */ e("ul", { className: x, children: t.map((l, m) => /* @__PURE__ */ e(
|
|
4497
4494
|
"li",
|
|
4498
4495
|
{
|
|
4499
|
-
className:
|
|
4496
|
+
className: b(l),
|
|
4500
4497
|
onClick: () => g(l),
|
|
4501
4498
|
onKeyDown: (h) => f(h, l),
|
|
4502
4499
|
tabIndex: s && !l.disabled ? 0 : void 0,
|
|
@@ -4513,36 +4510,36 @@ const yr = ({
|
|
|
4513
4510
|
initialCommandPath: s,
|
|
4514
4511
|
initialActiveIndex: o
|
|
4515
4512
|
}) => {
|
|
4516
|
-
const [u,
|
|
4517
|
-
(
|
|
4513
|
+
const [u, x] = B(""), [b, g] = B(s || []), [f, l] = B(o || 0), m = Z(null), h = Z(null), w = (b.length ? t.find((y) => y.id === b[0])?.subCommands || [] : t).filter(
|
|
4514
|
+
(y) => y.label.toLowerCase().includes(u.toLowerCase())
|
|
4518
4515
|
);
|
|
4519
4516
|
return U(() => {
|
|
4520
|
-
a || (
|
|
4517
|
+
a || (x(""), g(s || []), l(o || 0));
|
|
4521
4518
|
}, [a]), U(() => {
|
|
4522
|
-
const
|
|
4519
|
+
const y = (A) => {
|
|
4523
4520
|
if (a) {
|
|
4524
|
-
if (
|
|
4521
|
+
if (A.key === "Escape")
|
|
4525
4522
|
r();
|
|
4526
|
-
else if (
|
|
4523
|
+
else if (A.key === "ArrowUp")
|
|
4527
4524
|
l(
|
|
4528
|
-
(N) => N > 0 ? N - 1 :
|
|
4525
|
+
(N) => N > 0 ? N - 1 : w.length - 1
|
|
4529
4526
|
);
|
|
4530
|
-
else if (
|
|
4527
|
+
else if (A.key === "ArrowDown")
|
|
4531
4528
|
l(
|
|
4532
|
-
(N) => N <
|
|
4529
|
+
(N) => N < w.length - 1 ? N + 1 : 0
|
|
4533
4530
|
);
|
|
4534
|
-
else if (
|
|
4535
|
-
const N =
|
|
4536
|
-
N && (N.subCommands ? (g([...
|
|
4531
|
+
else if (A.key === "Enter") {
|
|
4532
|
+
const N = w[f];
|
|
4533
|
+
N && (N.subCommands ? (g([...b, N.id]), l(0)) : N.action && (N.action(), r()));
|
|
4537
4534
|
}
|
|
4538
4535
|
}
|
|
4539
4536
|
};
|
|
4540
|
-
return document.addEventListener("keydown",
|
|
4541
|
-
}, [a, r,
|
|
4542
|
-
const
|
|
4543
|
-
m.current && !m.current.contains(
|
|
4537
|
+
return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
|
|
4538
|
+
}, [a, r, w, f, b]), U(() => {
|
|
4539
|
+
const y = (A) => {
|
|
4540
|
+
m.current && !m.current.contains(A.target) && r();
|
|
4544
4541
|
};
|
|
4545
|
-
return a && document.addEventListener("mousedown",
|
|
4542
|
+
return a && document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
4546
4543
|
}, [a, r]), U(() => {
|
|
4547
4544
|
if (!a) return;
|
|
4548
4545
|
h.current?.querySelector(`[data-index="${f}"]`)?.scrollIntoView({ block: "nearest" });
|
|
@@ -4553,7 +4550,7 @@ const yr = ({
|
|
|
4553
4550
|
ref: m,
|
|
4554
4551
|
children: [
|
|
4555
4552
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4556
|
-
/* @__PURE__ */ e(
|
|
4553
|
+
/* @__PURE__ */ e($e, { className: "w-4 h-4 text-muted shrink-0" }),
|
|
4557
4554
|
/* @__PURE__ */ e(
|
|
4558
4555
|
"input",
|
|
4559
4556
|
{
|
|
@@ -4561,7 +4558,7 @@ const yr = ({
|
|
|
4561
4558
|
autoFocus: !0,
|
|
4562
4559
|
placeholder: n?.searchPlaceholder || "Search commands...",
|
|
4563
4560
|
value: u,
|
|
4564
|
-
onChange: (
|
|
4561
|
+
onChange: (y) => x(y.target.value),
|
|
4565
4562
|
className: "w-full py-2 text-default border-0 focus:outline-none focus:ring-0 focus:border-0 focus:shadow-none bg-transparent"
|
|
4566
4563
|
}
|
|
4567
4564
|
)
|
|
@@ -4572,23 +4569,23 @@ const yr = ({
|
|
|
4572
4569
|
ref: h,
|
|
4573
4570
|
className: "mt-2 pt-2 text-sm border-t border-neutral max-h-[50vh] overflow-y-auto",
|
|
4574
4571
|
children: [
|
|
4575
|
-
|
|
4576
|
-
|
|
4572
|
+
w.length === 0 && /* @__PURE__ */ e("div", { className: "text-muted text-center text-sm", children: n?.noCommandsFound || "No commands found" }),
|
|
4573
|
+
w.map((y, A) => /* @__PURE__ */ d(
|
|
4577
4574
|
"div",
|
|
4578
4575
|
{
|
|
4579
|
-
"data-index":
|
|
4580
|
-
className: `flex items-center p-2 cursor-pointer rounded-md text-default ${
|
|
4576
|
+
"data-index": A,
|
|
4577
|
+
className: `flex items-center p-2 cursor-pointer rounded-md text-default ${A === f ? "bg-neutral-container" : ""}`,
|
|
4581
4578
|
onClick: () => {
|
|
4582
|
-
|
|
4579
|
+
y.subCommands ? (g([...b, y.id]), l(0)) : y.action && (y.action(), r());
|
|
4583
4580
|
},
|
|
4584
|
-
onMouseEnter: () => l(
|
|
4581
|
+
onMouseEnter: () => l(A),
|
|
4585
4582
|
children: [
|
|
4586
|
-
|
|
4587
|
-
/* @__PURE__ */ e("span", { className: "flex-grow", children:
|
|
4588
|
-
|
|
4583
|
+
y.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: y.icon }),
|
|
4584
|
+
/* @__PURE__ */ e("span", { className: "flex-grow", children: y.label }),
|
|
4585
|
+
y.subCommands && /* @__PURE__ */ e("span", { className: "text-muted", children: /* @__PURE__ */ e(qe, { className: "w-4 h-4" }) })
|
|
4589
4586
|
]
|
|
4590
4587
|
},
|
|
4591
|
-
|
|
4588
|
+
y.id
|
|
4592
4589
|
))
|
|
4593
4590
|
]
|
|
4594
4591
|
}
|
|
@@ -4671,7 +4668,7 @@ const yr = ({
|
|
|
4671
4668
|
info: "border-info",
|
|
4672
4669
|
neutral: "border-neutral",
|
|
4673
4670
|
white: "border-white"
|
|
4674
|
-
},
|
|
4671
|
+
}, ze = ce(
|
|
4675
4672
|
({
|
|
4676
4673
|
padding: t,
|
|
4677
4674
|
margin: a,
|
|
@@ -4680,8 +4677,8 @@ const yr = ({
|
|
|
4680
4677
|
shadow: s,
|
|
4681
4678
|
border: o,
|
|
4682
4679
|
borderColor: u,
|
|
4683
|
-
className:
|
|
4684
|
-
children:
|
|
4680
|
+
className: x,
|
|
4681
|
+
children: b,
|
|
4685
4682
|
...g
|
|
4686
4683
|
}, f) => /* @__PURE__ */ e(
|
|
4687
4684
|
"div",
|
|
@@ -4695,19 +4692,19 @@ const yr = ({
|
|
|
4695
4692
|
s && Gt[s],
|
|
4696
4693
|
o && Kt[o],
|
|
4697
4694
|
u && Jt[u],
|
|
4698
|
-
|
|
4695
|
+
x
|
|
4699
4696
|
),
|
|
4700
4697
|
...g,
|
|
4701
|
-
children:
|
|
4698
|
+
children: b
|
|
4702
4699
|
}
|
|
4703
4700
|
)
|
|
4704
4701
|
);
|
|
4705
|
-
|
|
4706
|
-
const
|
|
4702
|
+
ze.displayName = "Box";
|
|
4703
|
+
const yr = ({ children: t, title: a, ...r }) => /* @__PURE__ */ d(ze, { background: "module", radius: "xl", shadow: "sm", ...r, children: [
|
|
4707
4704
|
a && /* @__PURE__ */ e("span", { className: "text-base font-medium text-default mb-2", children: a }),
|
|
4708
4705
|
t
|
|
4709
4706
|
] });
|
|
4710
|
-
function
|
|
4707
|
+
function Nr({
|
|
4711
4708
|
identifier: t,
|
|
4712
4709
|
resourceLoader: a,
|
|
4713
4710
|
framework: r = "react",
|
|
@@ -4715,31 +4712,31 @@ function wr({
|
|
|
4715
4712
|
componentProps: s,
|
|
4716
4713
|
className: o
|
|
4717
4714
|
}) {
|
|
4718
|
-
const u =
|
|
4719
|
-
return
|
|
4715
|
+
const u = Z(null), [x, b] = B(!0), [g, f] = B(null), l = Z(null);
|
|
4716
|
+
return Z(null), U(() => {
|
|
4720
4717
|
let m = !0;
|
|
4721
4718
|
return (async () => {
|
|
4722
|
-
|
|
4719
|
+
b(!0);
|
|
4723
4720
|
try {
|
|
4724
|
-
const
|
|
4721
|
+
const k = await a();
|
|
4725
4722
|
if (!m) return;
|
|
4726
|
-
const
|
|
4727
|
-
f(r === "react" ? () =>
|
|
4728
|
-
} catch (
|
|
4729
|
-
console.error(`[FederatedResource] Load failed: ${t}`,
|
|
4723
|
+
const w = k.component || k.default || k;
|
|
4724
|
+
f(r === "react" ? () => w : () => k);
|
|
4725
|
+
} catch (k) {
|
|
4726
|
+
console.error(`[FederatedResource] Load failed: ${t}`, k);
|
|
4730
4727
|
} finally {
|
|
4731
|
-
m &&
|
|
4728
|
+
m && b(!1);
|
|
4732
4729
|
}
|
|
4733
4730
|
})(), () => {
|
|
4734
4731
|
m = !1;
|
|
4735
4732
|
};
|
|
4736
4733
|
}, [t, a]), U(() => {
|
|
4737
|
-
if (
|
|
4734
|
+
if (x || !g || r === "react") return;
|
|
4738
4735
|
const m = u.current;
|
|
4739
4736
|
if (m) {
|
|
4740
4737
|
if (r === "svelte") {
|
|
4741
|
-
const h = g.default || g,
|
|
4742
|
-
return l.current =
|
|
4738
|
+
const h = g.default || g, k = new h({ target: m, props: s || {} });
|
|
4739
|
+
return l.current = k, () => k.$destroy();
|
|
4743
4740
|
}
|
|
4744
4741
|
if (g.mount) {
|
|
4745
4742
|
const h = g.mount({ container: m, props: s || {} });
|
|
@@ -4748,14 +4745,14 @@ function wr({
|
|
|
4748
4745
|
};
|
|
4749
4746
|
}
|
|
4750
4747
|
}
|
|
4751
|
-
}, [g, r,
|
|
4748
|
+
}, [g, r, x]), U(() => {
|
|
4752
4749
|
r === "svelte" && l.current && l.current.$set?.(s);
|
|
4753
4750
|
}, [s, r]), /* @__PURE__ */ d("div", { ref: u, className: o, style: { display: "contents" }, children: [
|
|
4754
|
-
|
|
4751
|
+
x && n,
|
|
4755
4752
|
r === "react" && g && /* @__PURE__ */ e(g, { ...s })
|
|
4756
4753
|
] });
|
|
4757
4754
|
}
|
|
4758
|
-
class
|
|
4755
|
+
class wr extends Ge {
|
|
4759
4756
|
constructor() {
|
|
4760
4757
|
super(...arguments), this.state = {
|
|
4761
4758
|
hasError: !1,
|
|
@@ -4785,46 +4782,46 @@ class kr extends Ke {
|
|
|
4785
4782
|
}
|
|
4786
4783
|
export {
|
|
4787
4784
|
Ot as Avatar,
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4785
|
+
ur as AvatarStack,
|
|
4786
|
+
ir as Badge,
|
|
4787
|
+
ze as Box,
|
|
4791
4788
|
te as Button,
|
|
4792
4789
|
lr as ButtonGroup,
|
|
4793
|
-
|
|
4794
|
-
|
|
4790
|
+
yr as Card,
|
|
4791
|
+
ve as Checkbox,
|
|
4795
4792
|
vr as CommandPalette,
|
|
4796
4793
|
mt as ContentLoading,
|
|
4797
|
-
|
|
4794
|
+
ye as DatePicker,
|
|
4798
4795
|
ft as Dropdown,
|
|
4799
|
-
|
|
4800
|
-
|
|
4796
|
+
wr as ErrorBoundary,
|
|
4797
|
+
Nr as FederatedResource,
|
|
4801
4798
|
Mt as FolderSelect,
|
|
4802
4799
|
cr as Form,
|
|
4803
|
-
|
|
4800
|
+
br as Heading,
|
|
4804
4801
|
oe as Icon,
|
|
4805
|
-
|
|
4802
|
+
mr as Image,
|
|
4806
4803
|
sr as Link,
|
|
4807
|
-
|
|
4804
|
+
gr as List,
|
|
4808
4805
|
rr as MeetingGrid,
|
|
4809
4806
|
St as Modal,
|
|
4810
|
-
|
|
4811
|
-
|
|
4807
|
+
fr as PageHeader,
|
|
4808
|
+
hr as PageToolbar,
|
|
4812
4809
|
nr as ParticipantTile,
|
|
4813
|
-
|
|
4810
|
+
Ze as Popover,
|
|
4814
4811
|
ot as SearchableTextField,
|
|
4815
4812
|
fe as Select,
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4813
|
+
xr as SidebarMenu,
|
|
4814
|
+
dr as Spinner,
|
|
4815
|
+
Te as SplitButton,
|
|
4819
4816
|
Et as StorageInput,
|
|
4820
4817
|
or as TabBar,
|
|
4821
4818
|
Le as Table,
|
|
4822
4819
|
kt as Tabs,
|
|
4823
|
-
|
|
4820
|
+
Y as Text,
|
|
4824
4821
|
Ne as TextArea,
|
|
4825
4822
|
ue as TextField,
|
|
4826
4823
|
ar as VideoSurface,
|
|
4827
|
-
|
|
4824
|
+
pr as View,
|
|
4828
4825
|
p as cn,
|
|
4829
4826
|
tr as createSizes,
|
|
4830
4827
|
er as createVariants
|