@opencxh/ui-kit 3.112.2 → 3.113.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 +706 -707
- package/dist/index.js.map +1 -1
- package/dist/src/overlays/Popover.d.ts +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clsx as Ue } from "clsx";
|
|
2
2
|
import { jsxs as i, jsx as e, Fragment as fe } from "react/jsx-runtime";
|
|
3
|
-
import { VideoOff as We, User as Ke, MicOff as _e, Mic as Ge, X as ve, ChevronDown as be, ExternalLink as Je, Calendar as Ye, ChevronLeft as
|
|
3
|
+
import { VideoOff as We, User as Ke, MicOff as _e, Mic as Ge, X as ve, ChevronDown as be, ExternalLink as Je, Calendar as Ye, ChevronLeft as je, ChevronRight as ye, ChevronDownIcon as Xe, Loader2 as Ze, Search as Ne, Check as Me, ChevronUp as Qe, ChevronsLeft as et, ChevronsRight as tt, FileText as ke, HardDrive as $e, ArrowLeft as Ee, FolderPlus as rt, Upload as nt, Folder as De, Trash2 as st, Plus as at, Sparkles as lt, ImageOff as ot, Pencil as ct, ArrowUpRight as it } from "lucide-react";
|
|
4
4
|
import le, { useRef as se, useEffect as Y, forwardRef as de, useState as R, useLayoutEffect as dt, useMemo as me, useCallback as ce, createContext as ut, Component as mt } from "react";
|
|
5
5
|
function u(...t) {
|
|
6
6
|
return Ue(t);
|
|
@@ -28,14 +28,14 @@ function Kr({
|
|
|
28
28
|
hasVideo: a,
|
|
29
29
|
videoSlot: l,
|
|
30
30
|
className: c,
|
|
31
|
-
fill:
|
|
31
|
+
fill: h
|
|
32
32
|
}) {
|
|
33
33
|
return /* @__PURE__ */ i(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
36
|
className: u(
|
|
37
37
|
"relative rounded-lg overflow-hidden bg-video-surface flex items-center justify-center",
|
|
38
|
-
|
|
38
|
+
h ? "h-full w-full" : "aspect-video",
|
|
39
39
|
s && "ring-2 ring-speaking",
|
|
40
40
|
c
|
|
41
41
|
),
|
|
@@ -105,21 +105,21 @@ const ft = {
|
|
|
105
105
|
leftIcon: a,
|
|
106
106
|
rightIcon: l,
|
|
107
107
|
iconOnly: c = !1,
|
|
108
|
-
shape:
|
|
109
|
-
className:
|
|
108
|
+
shape: h = "default",
|
|
109
|
+
className: g,
|
|
110
110
|
children: N,
|
|
111
111
|
disabled: x,
|
|
112
112
|
...d
|
|
113
|
-
},
|
|
114
|
-
const
|
|
113
|
+
}, f) => {
|
|
114
|
+
const v = x || s;
|
|
115
115
|
return /* @__PURE__ */ i(
|
|
116
116
|
"button",
|
|
117
117
|
{
|
|
118
|
-
ref:
|
|
118
|
+
ref: f,
|
|
119
119
|
type: "button",
|
|
120
120
|
className: u(
|
|
121
121
|
"inline-flex shrink-0 items-center justify-center gap-2 cursor-pointer font-semibold",
|
|
122
|
-
|
|
122
|
+
h === "circle" ? "rounded-full" : "rounded-md",
|
|
123
123
|
"transition-colors duration-fast ease-out",
|
|
124
124
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
125
125
|
"disabled:cursor-not-allowed disabled:border-border-subtle",
|
|
@@ -128,9 +128,9 @@ const ft = {
|
|
|
128
128
|
c ? xt[r] : ht[r],
|
|
129
129
|
(n || r === "full") && "w-full",
|
|
130
130
|
s && "cursor-wait",
|
|
131
|
-
|
|
131
|
+
g
|
|
132
132
|
),
|
|
133
|
-
disabled:
|
|
133
|
+
disabled: v,
|
|
134
134
|
"aria-busy": s || void 0,
|
|
135
135
|
...d,
|
|
136
136
|
children: [
|
|
@@ -199,9 +199,9 @@ const Gr = ({
|
|
|
199
199
|
onClick: a,
|
|
200
200
|
className: l,
|
|
201
201
|
"aria-label": c,
|
|
202
|
-
...
|
|
202
|
+
...h
|
|
203
203
|
}) => {
|
|
204
|
-
const
|
|
204
|
+
const g = typeof r == "number" ? r : gt(r), N = u(
|
|
205
205
|
"inline-block shrink-0",
|
|
206
206
|
bt[n],
|
|
207
207
|
s && [
|
|
@@ -210,7 +210,7 @@ const Gr = ({
|
|
|
210
210
|
],
|
|
211
211
|
l
|
|
212
212
|
), x = {
|
|
213
|
-
size:
|
|
213
|
+
size: g,
|
|
214
214
|
strokeWidth: 2,
|
|
215
215
|
className: N,
|
|
216
216
|
onClick: s ? a : void 0,
|
|
@@ -221,7 +221,7 @@ const Gr = ({
|
|
|
221
221
|
onKeyDown: s ? (d) => {
|
|
222
222
|
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), a?.());
|
|
223
223
|
} : void 0,
|
|
224
|
-
...
|
|
224
|
+
...h
|
|
225
225
|
};
|
|
226
226
|
return /* @__PURE__ */ e(t, { ...x });
|
|
227
227
|
};
|
|
@@ -248,44 +248,44 @@ function Jr({
|
|
|
248
248
|
size: a = "md",
|
|
249
249
|
active: l = !1,
|
|
250
250
|
caret: c = !1,
|
|
251
|
-
onClear:
|
|
252
|
-
clearLabel:
|
|
251
|
+
onClear: h,
|
|
252
|
+
clearLabel: g = "Filter wissen",
|
|
253
253
|
onClick: N,
|
|
254
254
|
title: x,
|
|
255
255
|
className: d
|
|
256
256
|
}) {
|
|
257
|
-
const
|
|
257
|
+
const f = l && !!h, v = s === "pill" ? "rounded-full" : "rounded-md", C = u(
|
|
258
258
|
// A button's default cursor is an arrow, so it has to be asked for.
|
|
259
259
|
"inline-flex cursor-pointer select-none items-center text-sm font-semibold",
|
|
260
260
|
a === "sm" ? "h-control-sm" : "h-control-md",
|
|
261
261
|
"transition-colors duration-fast ease-out",
|
|
262
|
-
|
|
262
|
+
v,
|
|
263
263
|
// Picking a value outranks whatever the value happens to mean.
|
|
264
264
|
l ? "bg-accent text-accent-fg" : u("border", pt[n]),
|
|
265
265
|
d
|
|
266
|
-
),
|
|
266
|
+
), y = /* @__PURE__ */ i(fe, { children: [
|
|
267
267
|
r,
|
|
268
268
|
t,
|
|
269
269
|
c && /* @__PURE__ */ e(J, { icon: be, size: "xs" })
|
|
270
|
-
] }),
|
|
270
|
+
] }), p = u(
|
|
271
271
|
"inline-flex items-center gap-1.5 pl-3",
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
v,
|
|
273
|
+
f ? "pr-1.5" : "pr-3",
|
|
274
274
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
275
275
|
);
|
|
276
|
-
return
|
|
277
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: N, className:
|
|
276
|
+
return f ? /* @__PURE__ */ i("span", { className: C, title: x, children: [
|
|
277
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: N, className: p, children: y }),
|
|
278
278
|
/* @__PURE__ */ e(
|
|
279
279
|
"button",
|
|
280
280
|
{
|
|
281
281
|
type: "button",
|
|
282
|
-
"aria-label":
|
|
283
|
-
onClick:
|
|
284
|
-
className: u("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring",
|
|
282
|
+
"aria-label": g,
|
|
283
|
+
onClick: h,
|
|
284
|
+
className: u("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", v),
|
|
285
285
|
children: /* @__PURE__ */ e(J, { icon: ve, size: "xs" })
|
|
286
286
|
}
|
|
287
287
|
)
|
|
288
|
-
] }) : /* @__PURE__ */ e("button", { type: "button", title: x, onClick: N, className: u(C,
|
|
288
|
+
] }) : /* @__PURE__ */ e("button", { type: "button", title: x, onClick: N, className: u(C, p), children: y });
|
|
289
289
|
}
|
|
290
290
|
const vt = {
|
|
291
291
|
xs: "text-xs",
|
|
@@ -319,12 +319,12 @@ const vt = {
|
|
|
319
319
|
external: a = !1,
|
|
320
320
|
className: l,
|
|
321
321
|
children: c,
|
|
322
|
-
href:
|
|
323
|
-
target:
|
|
322
|
+
href: h,
|
|
323
|
+
target: g,
|
|
324
324
|
rel: N,
|
|
325
325
|
...x
|
|
326
326
|
}) => {
|
|
327
|
-
const d = a ||
|
|
327
|
+
const d = a || h && (h.startsWith("http") || h.startsWith("mailto:")), f = u(
|
|
328
328
|
"inline-flex items-center gap-1 underline-offset-2",
|
|
329
329
|
"transition-colors duration-fast ease-out",
|
|
330
330
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -338,14 +338,14 @@ const vt = {
|
|
|
338
338
|
],
|
|
339
339
|
s && "pointer-events-none cursor-not-allowed text-text-disabled opacity-50",
|
|
340
340
|
l
|
|
341
|
-
),
|
|
341
|
+
), v = {
|
|
342
342
|
...x,
|
|
343
|
-
href: s ? void 0 :
|
|
344
|
-
target: d ? "_blank" :
|
|
343
|
+
href: s ? void 0 : h,
|
|
344
|
+
target: d ? "_blank" : g,
|
|
345
345
|
rel: d ? "noopener noreferrer" : N,
|
|
346
346
|
"aria-disabled": s || void 0
|
|
347
347
|
};
|
|
348
|
-
return /* @__PURE__ */ i("a", { className:
|
|
348
|
+
return /* @__PURE__ */ i("a", { className: f, ...v, children: [
|
|
349
349
|
c,
|
|
350
350
|
d && /* @__PURE__ */ e(Je, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
|
|
351
351
|
] });
|
|
@@ -368,12 +368,12 @@ function Xr({
|
|
|
368
368
|
"aria-label": l,
|
|
369
369
|
className: u("inline-flex gap-0.5 rounded-md bg-surface-hover p-0.5", a),
|
|
370
370
|
children: t.map((c) => {
|
|
371
|
-
const
|
|
371
|
+
const h = c.value === r;
|
|
372
372
|
return /* @__PURE__ */ e(
|
|
373
373
|
"button",
|
|
374
374
|
{
|
|
375
375
|
role: "tab",
|
|
376
|
-
"aria-selected":
|
|
376
|
+
"aria-selected": h,
|
|
377
377
|
type: "button",
|
|
378
378
|
onClick: () => n(c.value),
|
|
379
379
|
className: u(
|
|
@@ -381,7 +381,7 @@ function Xr({
|
|
|
381
381
|
"transition-colors duration-fast ease-out",
|
|
382
382
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
383
383
|
wt[s],
|
|
384
|
-
|
|
384
|
+
h ? "bg-surface text-text font-semibold" : "text-text-muted hover:text-text"
|
|
385
385
|
),
|
|
386
386
|
children: c.label
|
|
387
387
|
},
|
|
@@ -391,61 +391,75 @@ function Xr({
|
|
|
391
391
|
}
|
|
392
392
|
);
|
|
393
393
|
}
|
|
394
|
+
function we(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start" } = {}) {
|
|
395
|
+
const [l, c] = R({});
|
|
396
|
+
return dt(() => {
|
|
397
|
+
if (!t) return;
|
|
398
|
+
const h = () => {
|
|
399
|
+
const g = r.current;
|
|
400
|
+
if (!g) return;
|
|
401
|
+
const N = g.getBoundingClientRect(), x = window.innerHeight - N.bottom, d = N.top, f = a.startsWith("top"), v = f ? d < 200 && x > d : x < 200 && d > x, C = f !== v, y = { position: "fixed" };
|
|
402
|
+
C ? (y.bottom = window.innerHeight - N.top + n, y.maxHeight = Math.max(120, d - n * 2)) : (y.top = N.bottom + n, y.maxHeight = Math.max(120, x - n * 2)), a.endsWith("end") ? y.right = window.innerWidth - N.right : y.left = N.left, s && (y.width = N.width), c(y);
|
|
403
|
+
};
|
|
404
|
+
return h(), window.addEventListener("scroll", h, !0), window.addEventListener("resize", h), () => {
|
|
405
|
+
window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
|
|
406
|
+
};
|
|
407
|
+
}, [t, r, n, s, a]), l;
|
|
408
|
+
}
|
|
394
409
|
const kt = ({
|
|
395
410
|
trigger: t,
|
|
396
411
|
children: r,
|
|
397
412
|
placement: n = "bottom-start",
|
|
398
413
|
className: s,
|
|
399
|
-
|
|
400
|
-
|
|
414
|
+
rootClassName: a,
|
|
415
|
+
triggerClassName: l,
|
|
416
|
+
disabled: c = !1,
|
|
417
|
+
triggerLabel: h
|
|
401
418
|
}) => {
|
|
402
|
-
const [
|
|
419
|
+
const [g, N] = R(!1), x = se(null), d = se(null), f = we(g, d, { placement: n });
|
|
403
420
|
Y(() => {
|
|
404
|
-
if (!
|
|
405
|
-
const
|
|
406
|
-
x.current && !x.current.contains(
|
|
407
|
-
},
|
|
408
|
-
|
|
421
|
+
if (!g) return;
|
|
422
|
+
const y = (D) => {
|
|
423
|
+
x.current && !x.current.contains(D.target) && N(!1);
|
|
424
|
+
}, p = (D) => {
|
|
425
|
+
D.key === "Escape" && N(!1);
|
|
409
426
|
};
|
|
410
|
-
return document.addEventListener("mousedown",
|
|
411
|
-
document.removeEventListener("mousedown",
|
|
427
|
+
return document.addEventListener("mousedown", y), document.addEventListener("keydown", p), () => {
|
|
428
|
+
document.removeEventListener("mousedown", y), document.removeEventListener("keydown", p);
|
|
412
429
|
};
|
|
413
|
-
}, [
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if (g) {
|
|
419
|
-
const $ = {};
|
|
420
|
-
n.startsWith("bottom") ? $.top = g.bottom + 6 : $.bottom = window.innerHeight - g.top + 6, n.endsWith("start") ? $.left = g.left : $.right = window.innerWidth - g.right, N($);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
f((g) => !g);
|
|
424
|
-
}
|
|
425
|
-
}, y = () => f(!1);
|
|
426
|
-
return /* @__PURE__ */ i("div", { ref: x, className: "relative inline-flex", children: [
|
|
430
|
+
}, [g]);
|
|
431
|
+
const v = (y) => {
|
|
432
|
+
y.stopPropagation(), !c && N((p) => !p);
|
|
433
|
+
}, C = () => N(!1);
|
|
434
|
+
return /* @__PURE__ */ i("div", { ref: x, className: u("relative inline-flex", a), children: [
|
|
427
435
|
/* @__PURE__ */ e(
|
|
428
436
|
"button",
|
|
429
437
|
{
|
|
430
438
|
ref: d,
|
|
431
439
|
type: "button",
|
|
432
|
-
onClick:
|
|
433
|
-
disabled:
|
|
434
|
-
"aria-label":
|
|
435
|
-
"aria-expanded":
|
|
436
|
-
className: u(
|
|
440
|
+
onClick: v,
|
|
441
|
+
disabled: c,
|
|
442
|
+
"aria-label": h,
|
|
443
|
+
"aria-expanded": g,
|
|
444
|
+
className: u(
|
|
445
|
+
"inline-flex items-center",
|
|
446
|
+
c && "cursor-not-allowed opacity-50",
|
|
447
|
+
l
|
|
448
|
+
),
|
|
437
449
|
children: t
|
|
438
450
|
}
|
|
439
451
|
),
|
|
440
|
-
|
|
452
|
+
g && /* @__PURE__ */ e(
|
|
441
453
|
"div",
|
|
442
454
|
{
|
|
443
455
|
className: u(
|
|
444
|
-
|
|
456
|
+
// overflow-y-auto pairs with the hook's max-height: without it a
|
|
457
|
+
// panel taller than the space available is simply cut off.
|
|
458
|
+
"fixed z-overlay overflow-y-auto rounded-lg border border-border bg-surface shadow-overlay",
|
|
445
459
|
s
|
|
446
460
|
),
|
|
447
|
-
style:
|
|
448
|
-
children: typeof r == "function" ? r(
|
|
461
|
+
style: f,
|
|
462
|
+
children: typeof r == "function" ? r(C) : r
|
|
449
463
|
}
|
|
450
464
|
)
|
|
451
465
|
] });
|
|
@@ -457,7 +471,7 @@ const kt = ({
|
|
|
457
471
|
sm: "h-control-sm w-7",
|
|
458
472
|
md: "h-control-md w-8"
|
|
459
473
|
};
|
|
460
|
-
function
|
|
474
|
+
function Pe({
|
|
461
475
|
label: t,
|
|
462
476
|
onClick: r,
|
|
463
477
|
variant: n = "primary",
|
|
@@ -465,11 +479,11 @@ function je({
|
|
|
465
479
|
icon: a,
|
|
466
480
|
options: l,
|
|
467
481
|
disabled: c = !1,
|
|
468
|
-
loading:
|
|
469
|
-
menuPlacement:
|
|
482
|
+
loading: h = !1,
|
|
483
|
+
menuPlacement: g = "bottom-end",
|
|
470
484
|
menuLabel: N = "More options"
|
|
471
485
|
}) {
|
|
472
|
-
const x = c ||
|
|
486
|
+
const x = c || h, d = l.length > 0;
|
|
473
487
|
return /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-px", children: [
|
|
474
488
|
/* @__PURE__ */ e(
|
|
475
489
|
ee,
|
|
@@ -478,7 +492,7 @@ function je({
|
|
|
478
492
|
size: s,
|
|
479
493
|
onClick: r,
|
|
480
494
|
disabled: c,
|
|
481
|
-
loading:
|
|
495
|
+
loading: h,
|
|
482
496
|
leftIcon: a,
|
|
483
497
|
className: u(d && "rounded-r-none"),
|
|
484
498
|
children: t
|
|
@@ -487,7 +501,7 @@ function je({
|
|
|
487
501
|
d && /* @__PURE__ */ e(
|
|
488
502
|
kt,
|
|
489
503
|
{
|
|
490
|
-
placement:
|
|
504
|
+
placement: g,
|
|
491
505
|
disabled: x,
|
|
492
506
|
triggerLabel: N,
|
|
493
507
|
className: "min-w-menu py-1",
|
|
@@ -505,25 +519,25 @@ function je({
|
|
|
505
519
|
children: /* @__PURE__ */ e(be, { className: "size-icon-md" })
|
|
506
520
|
}
|
|
507
521
|
),
|
|
508
|
-
children: (
|
|
522
|
+
children: (f) => /* @__PURE__ */ e(fe, { children: l.map((v) => /* @__PURE__ */ i(
|
|
509
523
|
"button",
|
|
510
524
|
{
|
|
511
525
|
type: "button",
|
|
512
526
|
onClick: () => {
|
|
513
|
-
|
|
527
|
+
v.onClick(), f();
|
|
514
528
|
},
|
|
515
529
|
className: u(
|
|
516
530
|
"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm",
|
|
517
531
|
"transition-colors duration-fast ease-out",
|
|
518
532
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
519
|
-
|
|
533
|
+
v.variant === "destructive" ? "text-danger-fg hover:bg-danger-soft" : "text-text hover:bg-surface-hover"
|
|
520
534
|
),
|
|
521
535
|
children: [
|
|
522
|
-
|
|
523
|
-
|
|
536
|
+
v.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: v.icon }),
|
|
537
|
+
v.label
|
|
524
538
|
]
|
|
525
539
|
},
|
|
526
|
-
|
|
540
|
+
v.id
|
|
527
541
|
)) })
|
|
528
542
|
}
|
|
529
543
|
)
|
|
@@ -553,26 +567,26 @@ const zt = {
|
|
|
553
567
|
indeterminate: a = !1,
|
|
554
568
|
shape: l = "square",
|
|
555
569
|
containerClassName: c,
|
|
556
|
-
labelClassName:
|
|
557
|
-
className:
|
|
570
|
+
labelClassName: h,
|
|
571
|
+
className: g,
|
|
558
572
|
id: N,
|
|
559
573
|
...x
|
|
560
574
|
}, d) => {
|
|
561
|
-
const
|
|
562
|
-
(
|
|
563
|
-
|
|
575
|
+
const f = le.useId(), v = N || `checkbox-${f}`, C = !!n, y = le.useRef(null), p = le.useCallback(
|
|
576
|
+
(D) => {
|
|
577
|
+
y.current = D, typeof d == "function" ? d(D) : d && typeof d == "object" && (d.current = D);
|
|
564
578
|
},
|
|
565
579
|
[d]
|
|
566
580
|
);
|
|
567
581
|
return le.useEffect(() => {
|
|
568
|
-
|
|
582
|
+
y.current && (y.current.indeterminate = a);
|
|
569
583
|
}, [a]), /* @__PURE__ */ i("div", { className: u("flex flex-col", c), children: [
|
|
570
584
|
/* @__PURE__ */ i("div", { className: u("flex items-center gap-3", Et[s]), children: [
|
|
571
585
|
/* @__PURE__ */ e(
|
|
572
586
|
"input",
|
|
573
587
|
{
|
|
574
|
-
ref:
|
|
575
|
-
id:
|
|
588
|
+
ref: p,
|
|
589
|
+
id: v,
|
|
576
590
|
type: "checkbox",
|
|
577
591
|
"aria-invalid": C || void 0,
|
|
578
592
|
className: u(
|
|
@@ -583,7 +597,7 @@ const zt = {
|
|
|
583
597
|
"disabled:cursor-not-allowed disabled:bg-surface-hover",
|
|
584
598
|
zt[s],
|
|
585
599
|
C ? "border-danger-border" : "border-border-strong",
|
|
586
|
-
|
|
600
|
+
g
|
|
587
601
|
),
|
|
588
602
|
...x
|
|
589
603
|
}
|
|
@@ -592,12 +606,12 @@ const zt = {
|
|
|
592
606
|
/* @__PURE__ */ e(
|
|
593
607
|
"label",
|
|
594
608
|
{
|
|
595
|
-
htmlFor:
|
|
609
|
+
htmlFor: v,
|
|
596
610
|
className: u(
|
|
597
611
|
"cursor-pointer",
|
|
598
612
|
C ? "text-danger-fg" : "text-text",
|
|
599
613
|
Mt[s],
|
|
600
|
-
|
|
614
|
+
h
|
|
601
615
|
),
|
|
602
616
|
children: t
|
|
603
617
|
}
|
|
@@ -610,22 +624,7 @@ const zt = {
|
|
|
610
624
|
}
|
|
611
625
|
);
|
|
612
626
|
xe.displayName = "Checkbox";
|
|
613
|
-
|
|
614
|
-
const [l, c] = R({});
|
|
615
|
-
return dt(() => {
|
|
616
|
-
if (!t) return;
|
|
617
|
-
const f = () => {
|
|
618
|
-
const p = r.current;
|
|
619
|
-
if (!p) return;
|
|
620
|
-
const N = p.getBoundingClientRect(), x = window.innerHeight - N.bottom, d = N.top, h = a.startsWith("top"), y = h ? d < 200 && x > d : x < 200 && d > x, C = h !== y, g = { position: "fixed" };
|
|
621
|
-
C ? (g.bottom = window.innerHeight - N.top + n, g.maxHeight = Math.max(120, d - n * 2)) : (g.top = N.bottom + n, g.maxHeight = Math.max(120, x - n * 2)), a.endsWith("end") ? g.right = window.innerWidth - N.right : g.left = N.left, s && (g.width = N.width), c(g);
|
|
622
|
-
};
|
|
623
|
-
return f(), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
|
|
624
|
-
window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
|
|
625
|
-
};
|
|
626
|
-
}, [t, r, n, s, a]), l;
|
|
627
|
-
}
|
|
628
|
-
const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }), Dt = () => /* @__PURE__ */ e(J, { icon: Pe, size: "md", color: "current" }), Tt = () => /* @__PURE__ */ e(J, { icon: ye, size: "md", color: "current" }), Ce = de(({
|
|
627
|
+
const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }), Dt = () => /* @__PURE__ */ e(J, { icon: je, size: "md", color: "current" }), Tt = () => /* @__PURE__ */ e(J, { icon: ye, size: "md", color: "current" }), Se = de(({
|
|
629
628
|
value: t,
|
|
630
629
|
onChange: r,
|
|
631
630
|
placeholder: n = "Select date",
|
|
@@ -633,24 +632,24 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
633
632
|
required: a = !1,
|
|
634
633
|
size: l = "md",
|
|
635
634
|
className: c,
|
|
636
|
-
minDate:
|
|
637
|
-
maxDate:
|
|
635
|
+
minDate: h,
|
|
636
|
+
maxDate: g,
|
|
638
637
|
format: N = "MM/dd/yyyy",
|
|
639
638
|
withTime: x = !1
|
|
640
639
|
}, d) => {
|
|
641
|
-
const [
|
|
640
|
+
const [f, v] = R(!1), [C, y] = R(() => t || /* @__PURE__ */ new Date()), p = se(null), D = we(f, p);
|
|
642
641
|
Y(() => {
|
|
643
642
|
const b = (m) => {
|
|
644
|
-
|
|
643
|
+
p.current && !p.current.contains(m.target) && v(!1);
|
|
645
644
|
};
|
|
646
|
-
return
|
|
645
|
+
return f && document.addEventListener("mousedown", b), () => {
|
|
647
646
|
document.removeEventListener("mousedown", b);
|
|
648
647
|
};
|
|
649
|
-
}, [
|
|
650
|
-
const
|
|
648
|
+
}, [f]);
|
|
649
|
+
const $ = (b) => {
|
|
651
650
|
if (!b) return "";
|
|
652
|
-
const m = b.getDate().toString().padStart(2, "0"), E = (b.getMonth() + 1).toString().padStart(2, "0"), w = b.getFullYear(),
|
|
653
|
-
return x ? `${
|
|
651
|
+
const m = b.getDate().toString().padStart(2, "0"), E = (b.getMonth() + 1).toString().padStart(2, "0"), w = b.getFullYear(), j = N === "dd/MM/yyyy" ? `${m}/${E}/${w}` : N === "yyyy-MM-dd" ? `${w}-${E}-${m}` : `${E}/${m}/${w}`;
|
|
652
|
+
return x ? `${j} ${_(b)}` : j;
|
|
654
653
|
}, _ = (b) => `${b.getHours().toString().padStart(2, "0")}:${b.getMinutes().toString().padStart(2, "0")}`, M = (b) => {
|
|
655
654
|
const [m, E] = b.split(":").map(Number);
|
|
656
655
|
if (Number.isNaN(m) || Number.isNaN(E)) return;
|
|
@@ -659,25 +658,25 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
659
658
|
}, q = () => {
|
|
660
659
|
const b = C.getFullYear(), m = C.getMonth(), E = new Date(b, m, 1), w = new Date(E);
|
|
661
660
|
w.setDate(w.getDate() - E.getDay());
|
|
662
|
-
const
|
|
661
|
+
const j = [], k = new Date(w);
|
|
663
662
|
for (let ae = 0; ae < 42; ae++)
|
|
664
|
-
|
|
665
|
-
return
|
|
663
|
+
j.push(new Date(k)), k.setDate(k.getDate() + 1);
|
|
664
|
+
return j;
|
|
666
665
|
}, V = (b) => {
|
|
667
|
-
if (b.getMonth() === C.getMonth() && !(
|
|
666
|
+
if (b.getMonth() === C.getMonth() && !(h && b < h) && !(g && b > g)) {
|
|
668
667
|
if (x) {
|
|
669
668
|
const E = new Date(b);
|
|
670
669
|
E.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(E);
|
|
671
670
|
return;
|
|
672
671
|
}
|
|
673
|
-
r?.(b),
|
|
672
|
+
r?.(b), v(!1);
|
|
674
673
|
}
|
|
675
674
|
}, I = () => {
|
|
676
|
-
|
|
675
|
+
y(new Date(C.getFullYear(), C.getMonth() - 1, 1));
|
|
677
676
|
}, W = () => {
|
|
678
|
-
|
|
677
|
+
y(new Date(C.getFullYear(), C.getMonth() + 1, 1));
|
|
679
678
|
}, H = () => {
|
|
680
|
-
r?.(null),
|
|
679
|
+
r?.(null), v(!1);
|
|
681
680
|
}, X = u(
|
|
682
681
|
"w-full border border-border rounded-md transition-colors duration-fast",
|
|
683
682
|
"bg-surface text-text",
|
|
@@ -705,19 +704,19 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
705
704
|
"November",
|
|
706
705
|
"December"
|
|
707
706
|
];
|
|
708
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
707
|
+
return /* @__PURE__ */ i("div", { ref: p, className: "relative", children: [
|
|
709
708
|
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
710
709
|
/* @__PURE__ */ e(
|
|
711
710
|
"input",
|
|
712
711
|
{
|
|
713
712
|
ref: d,
|
|
714
713
|
type: "text",
|
|
715
|
-
value:
|
|
714
|
+
value: $(t ?? null),
|
|
716
715
|
placeholder: n,
|
|
717
716
|
disabled: s,
|
|
718
717
|
required: a,
|
|
719
718
|
readOnly: !0,
|
|
720
|
-
onClick: () => !s &&
|
|
719
|
+
onClick: () => !s && v(!f),
|
|
721
720
|
className: u(X, "pr-10 cursor-pointer")
|
|
722
721
|
}
|
|
723
722
|
),
|
|
@@ -725,14 +724,14 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
725
724
|
"button",
|
|
726
725
|
{
|
|
727
726
|
type: "button",
|
|
728
|
-
onClick: () => !s &&
|
|
727
|
+
onClick: () => !s && v(!f),
|
|
729
728
|
disabled: s,
|
|
730
729
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted hover:text-text-muted",
|
|
731
730
|
children: /* @__PURE__ */ e($t, {})
|
|
732
731
|
}
|
|
733
732
|
)
|
|
734
733
|
] }),
|
|
735
|
-
|
|
734
|
+
f && /* @__PURE__ */ i("div", { style: D, className: "z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
736
735
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
737
736
|
/* @__PURE__ */ e(
|
|
738
737
|
"button",
|
|
@@ -758,7 +757,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
758
757
|
] }),
|
|
759
758
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((b) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: b }, b)) }),
|
|
760
759
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: Z.map((b, m) => {
|
|
761
|
-
const E = b.getMonth() === C.getMonth(), w = t && b.toDateString() === t.toDateString(),
|
|
760
|
+
const E = b.getMonth() === C.getMonth(), w = t && b.toDateString() === t.toDateString(), j = b.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), k = !E || h && b < h || g && b > g;
|
|
762
761
|
return /* @__PURE__ */ e(
|
|
763
762
|
"button",
|
|
764
763
|
{
|
|
@@ -769,7 +768,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
769
768
|
{
|
|
770
769
|
"text-text hover:bg-surface-hover": E && !w && !k,
|
|
771
770
|
"bg-accent text-accent-fg": w,
|
|
772
|
-
"bg-surface-hover text-text":
|
|
771
|
+
"bg-surface-hover text-text": j && !w,
|
|
773
772
|
"text-text-muted cursor-not-allowed": k
|
|
774
773
|
}
|
|
775
774
|
),
|
|
@@ -803,7 +802,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
803
802
|
/* @__PURE__ */ e(
|
|
804
803
|
"button",
|
|
805
804
|
{
|
|
806
|
-
onClick: () =>
|
|
805
|
+
onClick: () => v(!1),
|
|
807
806
|
className: "text-sm text-info-fg hover:underline",
|
|
808
807
|
children: "Close"
|
|
809
808
|
}
|
|
@@ -825,20 +824,20 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
825
824
|
fullWidth: a = !1,
|
|
826
825
|
options: l,
|
|
827
826
|
placeholder: c,
|
|
828
|
-
containerClassName:
|
|
829
|
-
labelClassName:
|
|
827
|
+
containerClassName: h,
|
|
828
|
+
labelClassName: g,
|
|
830
829
|
className: N,
|
|
831
830
|
id: x,
|
|
832
831
|
searchable: d,
|
|
833
|
-
multiple:
|
|
834
|
-
value:
|
|
832
|
+
multiple: f,
|
|
833
|
+
value: v,
|
|
835
834
|
onChange: C,
|
|
836
|
-
allowCreate:
|
|
837
|
-
onCreateOption:
|
|
838
|
-
|
|
839
|
-
},
|
|
840
|
-
const _ = x || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [q, V] = le.useState(!1), [I, W] = le.useState(""), H = le.useRef(null), X = le.useRef(null), Z =
|
|
841
|
-
le.useImperativeHandle(
|
|
835
|
+
allowCreate: y,
|
|
836
|
+
onCreateOption: p,
|
|
837
|
+
...D
|
|
838
|
+
}, $) => {
|
|
839
|
+
const _ = x || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [q, V] = le.useState(!1), [I, W] = le.useState(""), H = le.useRef(null), X = le.useRef(null), Z = we(q, X, { matchWidth: !0 }), [Q, b] = le.useState(l);
|
|
840
|
+
le.useImperativeHandle($, () => H.current), le.useEffect(() => {
|
|
842
841
|
const S = (A) => {
|
|
843
842
|
H.current && !H.current.contains(A.target) && V(!1);
|
|
844
843
|
};
|
|
@@ -852,8 +851,8 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
852
851
|
), E = le.useCallback(
|
|
853
852
|
(S, A) => {
|
|
854
853
|
const L = [...S], T = (U) => {
|
|
855
|
-
const
|
|
856
|
-
|
|
854
|
+
const P = (U ?? "").trim();
|
|
855
|
+
P && (m(L, P) || L.push({ value: P, label: P }));
|
|
857
856
|
};
|
|
858
857
|
return Array.isArray(A) ? A.forEach(T) : T(A), L;
|
|
859
858
|
},
|
|
@@ -864,32 +863,32 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
864
863
|
const A = [...l];
|
|
865
864
|
return S.forEach((L) => {
|
|
866
865
|
!m(A, L.value) && !m(A, L.label) && A.push(L);
|
|
867
|
-
}), E(A,
|
|
866
|
+
}), E(A, v);
|
|
868
867
|
});
|
|
869
|
-
}, [l,
|
|
868
|
+
}, [l, v, E, m]);
|
|
870
869
|
const w = (S) => {
|
|
871
|
-
if (
|
|
872
|
-
const A = Array.isArray(
|
|
870
|
+
if (f) {
|
|
871
|
+
const A = Array.isArray(v) ? v : [], L = A.includes(S) ? A.filter((T) => T !== S) : [...A, S];
|
|
873
872
|
C?.(L);
|
|
874
873
|
} else
|
|
875
874
|
C?.(S), V(!1), W("");
|
|
876
|
-
},
|
|
877
|
-
(S) => Array.isArray(
|
|
875
|
+
}, j = f ? null : Q.find((S) => S.value === v), k = f ? Q.filter(
|
|
876
|
+
(S) => Array.isArray(v) && v.includes(S.value)
|
|
878
877
|
) : [], ae = d && I ? Q.filter(
|
|
879
878
|
(S) => S.label.toLowerCase().includes(I.toLowerCase())
|
|
880
|
-
) : Q, ne = !!
|
|
879
|
+
) : Q, ne = !!y && !!d && !!I.trim() && !m(Q, I), te = (S) => {
|
|
881
880
|
const A = S.trim();
|
|
882
881
|
if (!A) return;
|
|
883
|
-
const L =
|
|
882
|
+
const L = p?.(A) ?? {
|
|
884
883
|
value: A,
|
|
885
884
|
label: A
|
|
886
885
|
};
|
|
887
886
|
if (m(Q, L.value) || m(Q, L.label)) {
|
|
888
|
-
w(L.value), W(""),
|
|
887
|
+
w(L.value), W(""), f || V(!1);
|
|
889
888
|
return;
|
|
890
889
|
}
|
|
891
|
-
b((T) => [...T, L]), w(L.value), W(""),
|
|
892
|
-
}, G = () =>
|
|
890
|
+
b((T) => [...T, L]), w(L.value), W(""), f || V(!1);
|
|
891
|
+
}, G = () => f ? k.length > 0 ? k.map((S) => S.label).join(", ") : c || "Select options" : j?.label || c || "Select an option";
|
|
893
892
|
return /* @__PURE__ */ i(
|
|
894
893
|
"div",
|
|
895
894
|
{
|
|
@@ -897,9 +896,9 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
897
896
|
className: u(
|
|
898
897
|
"relative flex flex-col",
|
|
899
898
|
a && "w-full",
|
|
900
|
-
|
|
899
|
+
h
|
|
901
900
|
),
|
|
902
|
-
|
|
901
|
+
...D,
|
|
903
902
|
children: [
|
|
904
903
|
t && /* @__PURE__ */ e(
|
|
905
904
|
"label",
|
|
@@ -909,7 +908,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
909
908
|
className: u(
|
|
910
909
|
"block text-xs font-semibold uppercase tracking-label mb-1.5",
|
|
911
910
|
M ? "text-danger-fg" : "text-text-muted",
|
|
912
|
-
|
|
911
|
+
g
|
|
913
912
|
),
|
|
914
913
|
children: t
|
|
915
914
|
}
|
|
@@ -979,7 +978,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
979
978
|
}
|
|
980
979
|
),
|
|
981
980
|
/* @__PURE__ */ i("ul", { className: "min-h-0 flex-1 overflow-auto py-1", children: [
|
|
982
|
-
c && !
|
|
981
|
+
c && !f && /* @__PURE__ */ e(
|
|
983
982
|
"li",
|
|
984
983
|
{
|
|
985
984
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
@@ -990,7 +989,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
990
989
|
}
|
|
991
990
|
),
|
|
992
991
|
ae.map((S) => {
|
|
993
|
-
const A =
|
|
992
|
+
const A = f ? Array.isArray(v) && v.includes(S.value) : v === S.value;
|
|
994
993
|
return /* @__PURE__ */ e(
|
|
995
994
|
"li",
|
|
996
995
|
{
|
|
@@ -1002,7 +1001,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
|
|
|
1002
1001
|
A && "bg-accent-soft text-accent font-semibold"
|
|
1003
1002
|
),
|
|
1004
1003
|
children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1005
|
-
|
|
1004
|
+
f && /* @__PURE__ */ e(
|
|
1006
1005
|
"input",
|
|
1007
1006
|
{
|
|
1008
1007
|
type: "checkbox",
|
|
@@ -1050,22 +1049,22 @@ const Lt = {
|
|
|
1050
1049
|
fullWidth: a = !1,
|
|
1051
1050
|
startIcon: l,
|
|
1052
1051
|
endIcon: c,
|
|
1053
|
-
loading:
|
|
1054
|
-
containerClassName:
|
|
1052
|
+
loading: h = !1,
|
|
1053
|
+
containerClassName: g,
|
|
1055
1054
|
labelClassName: N,
|
|
1056
1055
|
className: x,
|
|
1057
1056
|
id: d,
|
|
1058
|
-
...
|
|
1059
|
-
},
|
|
1060
|
-
const C = le.useId(),
|
|
1061
|
-
return /* @__PURE__ */ i("div", { className: u("flex flex-col", a && "w-full",
|
|
1057
|
+
...f
|
|
1058
|
+
}, v) => {
|
|
1059
|
+
const C = le.useId(), y = d || `textfield-${C}`, p = !!n, D = n || r ? `${y}-description` : void 0;
|
|
1060
|
+
return /* @__PURE__ */ i("div", { className: u("flex flex-col", a && "w-full", g), children: [
|
|
1062
1061
|
t && /* @__PURE__ */ e(
|
|
1063
1062
|
"label",
|
|
1064
1063
|
{
|
|
1065
|
-
htmlFor:
|
|
1064
|
+
htmlFor: y,
|
|
1066
1065
|
className: u(
|
|
1067
1066
|
Oe,
|
|
1068
|
-
|
|
1067
|
+
p ? "text-danger-fg" : "text-text-subtle",
|
|
1069
1068
|
N
|
|
1070
1069
|
),
|
|
1071
1070
|
children: t
|
|
@@ -1076,10 +1075,10 @@ const Lt = {
|
|
|
1076
1075
|
/* @__PURE__ */ e(
|
|
1077
1076
|
"input",
|
|
1078
1077
|
{
|
|
1079
|
-
ref:
|
|
1080
|
-
id:
|
|
1081
|
-
"aria-invalid":
|
|
1082
|
-
"aria-describedby":
|
|
1078
|
+
ref: v,
|
|
1079
|
+
id: y,
|
|
1080
|
+
"aria-invalid": p || void 0,
|
|
1081
|
+
"aria-describedby": D,
|
|
1083
1082
|
className: u(
|
|
1084
1083
|
"block w-full rounded-md border bg-surface-input text-text",
|
|
1085
1084
|
"transition-colors duration-fast ease-out",
|
|
@@ -1088,14 +1087,14 @@ const Lt = {
|
|
|
1088
1087
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
1089
1088
|
Lt[s],
|
|
1090
1089
|
l && "pl-9",
|
|
1091
|
-
(c ||
|
|
1092
|
-
|
|
1090
|
+
(c || h) && "pr-9",
|
|
1091
|
+
p ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
1093
1092
|
x
|
|
1094
1093
|
),
|
|
1095
|
-
...
|
|
1094
|
+
...f
|
|
1096
1095
|
}
|
|
1097
1096
|
),
|
|
1098
|
-
(c ||
|
|
1097
|
+
(c || h) && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted", children: h ? /* @__PURE__ */ e(
|
|
1099
1098
|
"span",
|
|
1100
1099
|
{
|
|
1101
1100
|
"aria-hidden": !0,
|
|
@@ -1106,8 +1105,8 @@ const Lt = {
|
|
|
1106
1105
|
(n || r) && /* @__PURE__ */ e(
|
|
1107
1106
|
"p",
|
|
1108
1107
|
{
|
|
1109
|
-
id:
|
|
1110
|
-
className: u("mt-1 text-xs",
|
|
1108
|
+
id: D,
|
|
1109
|
+
className: u("mt-1 text-xs", p ? "text-danger-fg" : "text-text-subtle"),
|
|
1111
1110
|
children: n || r
|
|
1112
1111
|
}
|
|
1113
1112
|
)
|
|
@@ -1123,13 +1122,13 @@ function It({
|
|
|
1123
1122
|
size: a = "md",
|
|
1124
1123
|
placeholder: l,
|
|
1125
1124
|
templatePlaceholder: c,
|
|
1126
|
-
showTemplate:
|
|
1125
|
+
showTemplate: h = !0
|
|
1127
1126
|
}) {
|
|
1128
|
-
const [
|
|
1127
|
+
const [g, N] = R([]);
|
|
1129
1128
|
Y(() => {
|
|
1130
1129
|
let d = !0;
|
|
1131
|
-
return Promise.resolve(n?.()).then((
|
|
1132
|
-
d &&
|
|
1130
|
+
return Promise.resolve(n?.()).then((f) => {
|
|
1131
|
+
d && f && N(f.data ?? []);
|
|
1133
1132
|
}).catch(() => {
|
|
1134
1133
|
}), () => {
|
|
1135
1134
|
d = !1;
|
|
@@ -1143,12 +1142,12 @@ function It({
|
|
|
1143
1142
|
size: a,
|
|
1144
1143
|
fullWidth: !0,
|
|
1145
1144
|
value: x.folderId ?? "",
|
|
1146
|
-
options:
|
|
1145
|
+
options: g.map((d) => ({ value: d.id, label: d.name })),
|
|
1147
1146
|
placeholder: l ?? "Select a folder",
|
|
1148
1147
|
onChange: (d) => r?.({ ...x, folderId: d })
|
|
1149
1148
|
}
|
|
1150
1149
|
),
|
|
1151
|
-
|
|
1150
|
+
h && /* @__PURE__ */ e(
|
|
1152
1151
|
he,
|
|
1153
1152
|
{
|
|
1154
1153
|
size: a,
|
|
@@ -1160,12 +1159,12 @@ function It({
|
|
|
1160
1159
|
)
|
|
1161
1160
|
] });
|
|
1162
1161
|
}
|
|
1163
|
-
const ue = (...t) => t.filter(Boolean).join(" "),
|
|
1162
|
+
const ue = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(Ne, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Pt = (t) => /* @__PURE__ */ e(be, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Ot = {
|
|
1164
1163
|
sm: "h-control-sm px-3 text-sm",
|
|
1165
1164
|
md: "h-control-md px-3 text-base",
|
|
1166
1165
|
lg: "h-control-lg px-3 text-base",
|
|
1167
1166
|
full: "h-control-md w-full px-3 text-base"
|
|
1168
|
-
},
|
|
1167
|
+
}, Ce = {
|
|
1169
1168
|
sm: "h-4 w-4",
|
|
1170
1169
|
md: "h-5 w-5",
|
|
1171
1170
|
lg: "h-6 w-6",
|
|
@@ -1177,41 +1176,41 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1177
1176
|
error: n,
|
|
1178
1177
|
size: s = "md",
|
|
1179
1178
|
fullWidth: a = !1,
|
|
1180
|
-
startIcon: l = /* @__PURE__ */ e(
|
|
1179
|
+
startIcon: l = /* @__PURE__ */ e(jt, {}),
|
|
1181
1180
|
loading: c = !1,
|
|
1182
|
-
containerClassName:
|
|
1183
|
-
labelClassName:
|
|
1181
|
+
containerClassName: h,
|
|
1182
|
+
labelClassName: g,
|
|
1184
1183
|
className: N,
|
|
1185
1184
|
id: x,
|
|
1186
1185
|
options: d,
|
|
1187
|
-
onRemoteSearch:
|
|
1188
|
-
onSelect:
|
|
1186
|
+
onRemoteSearch: f,
|
|
1187
|
+
onSelect: v,
|
|
1189
1188
|
debounceTime: C = 500,
|
|
1190
|
-
showAllOnOpen:
|
|
1191
|
-
value:
|
|
1192
|
-
onChange:
|
|
1193
|
-
|
|
1189
|
+
showAllOnOpen: y = !1,
|
|
1190
|
+
value: p,
|
|
1191
|
+
onChange: D,
|
|
1192
|
+
...$
|
|
1194
1193
|
}, _) => {
|
|
1195
|
-
const M = x || `searchfield-${Math.random().toString(36).substr(2, 9)}`, q = !!n, V = se(null), I = se(null), [W, H] = R(
|
|
1194
|
+
const M = x || `searchfield-${Math.random().toString(36).substr(2, 9)}`, q = !!n, V = se(null), I = se(null), [W, H] = R(p || ""), [X, Z] = R(!1), [Q, b] = R(!1), [m, E] = R(!1);
|
|
1196
1195
|
Y(() => {
|
|
1197
|
-
|
|
1198
|
-
}, [
|
|
1196
|
+
p !== void 0 && H(p);
|
|
1197
|
+
}, [p]);
|
|
1199
1198
|
const w = me(() => {
|
|
1200
|
-
if (
|
|
1199
|
+
if (y && !m || !W) return d;
|
|
1201
1200
|
const S = String(W).toLowerCase();
|
|
1202
1201
|
return d.filter(
|
|
1203
1202
|
(A) => String(A.label).toLowerCase().includes(S)
|
|
1204
1203
|
);
|
|
1205
|
-
}, [W, d,
|
|
1204
|
+
}, [W, d, y, m]);
|
|
1206
1205
|
Y(() => {
|
|
1207
|
-
if (!
|
|
1206
|
+
if (!f || !W) {
|
|
1208
1207
|
b(!1);
|
|
1209
1208
|
return;
|
|
1210
1209
|
}
|
|
1211
1210
|
const S = setTimeout(async () => {
|
|
1212
1211
|
b(!0);
|
|
1213
1212
|
try {
|
|
1214
|
-
await
|
|
1213
|
+
await f(String(W));
|
|
1215
1214
|
} catch (A) {
|
|
1216
1215
|
console.error("Remote search failed:", A);
|
|
1217
1216
|
} finally {
|
|
@@ -1221,19 +1220,19 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1221
1220
|
return () => {
|
|
1222
1221
|
clearTimeout(S), b(!1);
|
|
1223
1222
|
};
|
|
1224
|
-
}, [W, C,
|
|
1223
|
+
}, [W, C, f]), Y(() => {
|
|
1225
1224
|
const S = (A) => {
|
|
1226
1225
|
V.current && !V.current.contains(A.target) && Z(!1);
|
|
1227
1226
|
};
|
|
1228
1227
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
1229
1228
|
}, []);
|
|
1230
|
-
const
|
|
1229
|
+
const j = (S) => {
|
|
1231
1230
|
const A = S.target.value;
|
|
1232
|
-
H(A), Z(!0), E(!0),
|
|
1231
|
+
H(A), Z(!0), E(!0), D && D(S);
|
|
1233
1232
|
}, k = (S) => {
|
|
1234
|
-
H(S.label), Z(!1), E(!1),
|
|
1233
|
+
H(S.label), Z(!1), E(!1), v && v(S.value);
|
|
1235
1234
|
}, ae = () => {
|
|
1236
|
-
(d.length > 0 ||
|
|
1235
|
+
(d.length > 0 || f) && (Z(!0), E(!1));
|
|
1237
1236
|
}, ne = c || Q, te = X && (w.length > 0 || ne), G = me(() => _ || I, [_]);
|
|
1238
1237
|
return /* @__PURE__ */ i(
|
|
1239
1238
|
"div",
|
|
@@ -1241,7 +1240,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1241
1240
|
className: ue(
|
|
1242
1241
|
"flex flex-col",
|
|
1243
1242
|
a ? "w-full" : "",
|
|
1244
|
-
|
|
1243
|
+
h || "",
|
|
1245
1244
|
"relative"
|
|
1246
1245
|
),
|
|
1247
1246
|
ref: V,
|
|
@@ -1253,20 +1252,20 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1253
1252
|
className: ue(
|
|
1254
1253
|
"block text-sm font-medium mb-1",
|
|
1255
1254
|
q ? "text-danger-fg" : "text-text",
|
|
1256
|
-
|
|
1255
|
+
g || ""
|
|
1257
1256
|
),
|
|
1258
1257
|
children: t
|
|
1259
1258
|
}
|
|
1260
1259
|
),
|
|
1261
1260
|
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1262
|
-
l && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: ue("text-text-muted",
|
|
1261
|
+
l && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: ue("text-text-muted", Ce[s]), children: l }) }),
|
|
1263
1262
|
/* @__PURE__ */ e(
|
|
1264
1263
|
"input",
|
|
1265
1264
|
{
|
|
1266
1265
|
ref: G,
|
|
1267
1266
|
id: M,
|
|
1268
1267
|
value: W,
|
|
1269
|
-
onChange:
|
|
1268
|
+
onChange: j,
|
|
1270
1269
|
onFocus: ae,
|
|
1271
1270
|
className: ue(
|
|
1272
1271
|
// Base styles
|
|
@@ -1283,7 +1282,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1283
1282
|
q ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
1284
1283
|
N || ""
|
|
1285
1284
|
),
|
|
1286
|
-
|
|
1285
|
+
...$
|
|
1287
1286
|
}
|
|
1288
1287
|
),
|
|
1289
1288
|
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: ne || c ? (
|
|
@@ -1291,18 +1290,18 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1291
1290
|
/* @__PURE__ */ e(
|
|
1292
1291
|
Ze,
|
|
1293
1292
|
{
|
|
1294
|
-
className: ue("animate-spin text-info-fg",
|
|
1293
|
+
className: ue("animate-spin text-info-fg", Ce[s]),
|
|
1295
1294
|
"aria-hidden": !0
|
|
1296
1295
|
}
|
|
1297
1296
|
)
|
|
1298
1297
|
) : (
|
|
1299
1298
|
// Dropdown Chevron
|
|
1300
1299
|
/* @__PURE__ */ e(
|
|
1301
|
-
|
|
1300
|
+
Pt,
|
|
1302
1301
|
{
|
|
1303
1302
|
className: ue(
|
|
1304
1303
|
"text-text-muted cursor-pointer transition-transform",
|
|
1305
|
-
|
|
1304
|
+
Ce[s],
|
|
1306
1305
|
X ? "rotate-180" : "rotate-0"
|
|
1307
1306
|
),
|
|
1308
1307
|
onClick: () => {
|
|
@@ -1340,7 +1339,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1340
1339
|
children: n || r
|
|
1341
1340
|
}
|
|
1342
1341
|
),
|
|
1343
|
-
|
|
1342
|
+
f && /* @__PURE__ */ i("p", { className: "mt-2 text-xs text-success-fg", children: [
|
|
1344
1343
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
1345
1344
|
String(W)
|
|
1346
1345
|
] })
|
|
@@ -1352,7 +1351,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1352
1351
|
Bt.displayName = "SearchableTextField";
|
|
1353
1352
|
const Ft = de(
|
|
1354
1353
|
({ checked: t, onChange: r, label: n, disabled: s = !1, className: a, ...l }, c) => {
|
|
1355
|
-
const
|
|
1354
|
+
const h = /* @__PURE__ */ e(
|
|
1356
1355
|
"span",
|
|
1357
1356
|
{
|
|
1358
1357
|
"aria-hidden": !0,
|
|
@@ -1391,12 +1390,12 @@ const Ft = de(
|
|
|
1391
1390
|
role: "switch",
|
|
1392
1391
|
checked: t,
|
|
1393
1392
|
disabled: s,
|
|
1394
|
-
onChange: (
|
|
1393
|
+
onChange: (g) => r(g.target.checked),
|
|
1395
1394
|
className: "peer sr-only",
|
|
1396
1395
|
...l
|
|
1397
1396
|
}
|
|
1398
1397
|
),
|
|
1399
|
-
/* @__PURE__ */ e("span", { className: "inline-flex rounded-full peer-focus-visible:focus-ring", children:
|
|
1398
|
+
/* @__PURE__ */ e("span", { className: "inline-flex rounded-full peer-focus-visible:focus-ring", children: h }),
|
|
1400
1399
|
n && /* @__PURE__ */ e("span", { className: "text-sm text-text", children: n })
|
|
1401
1400
|
]
|
|
1402
1401
|
}
|
|
@@ -1426,29 +1425,29 @@ function Rt({
|
|
|
1426
1425
|
{
|
|
1427
1426
|
className: "grid gap-2 bg-surface-hover p-3",
|
|
1428
1427
|
style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
|
|
1429
|
-
children: Array.from({ length: s }).map((c,
|
|
1428
|
+
children: Array.from({ length: s }).map((c, h) => /* @__PURE__ */ e(
|
|
1430
1429
|
"div",
|
|
1431
1430
|
{
|
|
1432
1431
|
className: "h-4 w-2/3 rounded-sm bg-border-strong"
|
|
1433
1432
|
},
|
|
1434
|
-
`header-${
|
|
1433
|
+
`header-${h}`
|
|
1435
1434
|
))
|
|
1436
1435
|
}
|
|
1437
1436
|
),
|
|
1438
|
-
Array.from({ length: a }).map((c,
|
|
1437
|
+
Array.from({ length: a }).map((c, h) => /* @__PURE__ */ e(
|
|
1439
1438
|
"div",
|
|
1440
1439
|
{
|
|
1441
1440
|
className: "grid gap-2 border-t border-border-subtle p-3",
|
|
1442
1441
|
style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
|
|
1443
|
-
children: Array.from({ length: s }).map((
|
|
1442
|
+
children: Array.from({ length: s }).map((g, N) => /* @__PURE__ */ e(
|
|
1444
1443
|
"div",
|
|
1445
1444
|
{
|
|
1446
1445
|
className: "h-4 w-full rounded-sm bg-surface-hover"
|
|
1447
1446
|
},
|
|
1448
|
-
`cell-${
|
|
1447
|
+
`cell-${h}-${N}`
|
|
1449
1448
|
))
|
|
1450
1449
|
},
|
|
1451
|
-
`row-${
|
|
1450
|
+
`row-${h}`
|
|
1452
1451
|
))
|
|
1453
1452
|
] })
|
|
1454
1453
|
] }) });
|
|
@@ -1461,11 +1460,11 @@ const Vt = ({
|
|
|
1461
1460
|
placement: a = "bottom-start",
|
|
1462
1461
|
disabled: l = !1,
|
|
1463
1462
|
className: c,
|
|
1464
|
-
showCheck:
|
|
1465
|
-
header:
|
|
1463
|
+
showCheck: h = !0,
|
|
1464
|
+
header: g
|
|
1466
1465
|
}) => {
|
|
1467
|
-
const [N, x] = R(!1), [d,
|
|
1468
|
-
|
|
1466
|
+
const [N, x] = R(!1), [d, f] = R(null), [v, C] = R({ top: 0, left: 0 }), y = se(null), p = se(null), D = se(null), $ = se(null), _ = we(N, p, { placement: a }), M = se(null), q = () => Array.from(
|
|
1467
|
+
$.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1469
1468
|
);
|
|
1470
1469
|
Y(() => {
|
|
1471
1470
|
N && q()[0]?.focus();
|
|
@@ -1475,26 +1474,26 @@ const Vt = ({
|
|
|
1475
1474
|
const w = q();
|
|
1476
1475
|
if (w.length === 0) return;
|
|
1477
1476
|
m.preventDefault();
|
|
1478
|
-
const
|
|
1477
|
+
const j = w.indexOf(document.activeElement), k = m.key === "Home" ? 0 : m.key === "End" ? w.length - 1 : m.key === "ArrowDown" ? (j + 1) % w.length : (j - 1 + w.length) % w.length;
|
|
1479
1478
|
w[k]?.focus();
|
|
1480
1479
|
};
|
|
1481
1480
|
Y(() => {
|
|
1482
1481
|
const m = (E) => {
|
|
1483
|
-
|
|
1482
|
+
y.current && (!y.current.contains(E.target) || D.current && !D.current.contains(E.target)) && (x(!1), f(null), M.current && (clearTimeout(M.current), M.current = null));
|
|
1484
1483
|
};
|
|
1485
1484
|
return N && document.addEventListener("mousedown", m), () => {
|
|
1486
1485
|
document.removeEventListener("mousedown", m);
|
|
1487
1486
|
};
|
|
1488
1487
|
}, [N]), Y(() => {
|
|
1489
1488
|
const m = (E) => {
|
|
1490
|
-
E.key === "Escape" && (x(!1),
|
|
1489
|
+
E.key === "Escape" && (x(!1), f(null), p.current?.focus(), M.current && (clearTimeout(M.current), M.current = null));
|
|
1491
1490
|
};
|
|
1492
1491
|
return N && document.addEventListener("keydown", m), () => {
|
|
1493
1492
|
document.removeEventListener("keydown", m);
|
|
1494
1493
|
};
|
|
1495
1494
|
}, [N]), Y(() => {
|
|
1496
|
-
if (d &&
|
|
1497
|
-
const m =
|
|
1495
|
+
if (d && y.current) {
|
|
1496
|
+
const m = y.current.querySelector(
|
|
1498
1497
|
`[data-option-value="${d}"]`
|
|
1499
1498
|
);
|
|
1500
1499
|
if (m) {
|
|
@@ -1509,17 +1508,17 @@ const Vt = ({
|
|
|
1509
1508
|
M.current && clearTimeout(M.current);
|
|
1510
1509
|
}, []);
|
|
1511
1510
|
const I = (m) => {
|
|
1512
|
-
m.stopPropagation(), !l && (x(!N),
|
|
1511
|
+
m.stopPropagation(), !l && (x(!N), f(null), M.current && (clearTimeout(M.current), M.current = null));
|
|
1513
1512
|
}, W = (m, E, w) => {
|
|
1514
|
-
m.stopPropagation(), !E.disabled && !E.divider && (!E.children || E.children.length === 0) && (s?.(E.value, w), x(!1),
|
|
1513
|
+
m.stopPropagation(), !E.disabled && !E.divider && (!E.children || E.children.length === 0) && (s?.(E.value, w), x(!1), f(null));
|
|
1515
1514
|
}, H = (m) => {
|
|
1516
|
-
M.current && (clearTimeout(M.current), M.current = null), m.children && m.children.length > 0 ?
|
|
1515
|
+
M.current && (clearTimeout(M.current), M.current = null), m.children && m.children.length > 0 ? f(m.value) : f(null);
|
|
1517
1516
|
}, X = (m) => {
|
|
1518
1517
|
m.children && m.children.length > 0 ? M.current = setTimeout(() => {
|
|
1519
|
-
|
|
1520
|
-
}, 150) :
|
|
1518
|
+
f(null);
|
|
1519
|
+
}, 150) : f(null);
|
|
1521
1520
|
}, Z = (m, E, w) => {
|
|
1522
|
-
m.stopPropagation(), !E.disabled && !E.divider && (s?.(E.value, w), x(!1),
|
|
1521
|
+
m.stopPropagation(), !E.disabled && !E.divider && (s?.(E.value, w), x(!1), f(null));
|
|
1523
1522
|
}, Q = u(
|
|
1524
1523
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1525
1524
|
"max-h-60 overflow-auto"
|
|
@@ -1530,7 +1529,7 @@ const Vt = ({
|
|
|
1530
1529
|
return /* @__PURE__ */ i(
|
|
1531
1530
|
"div",
|
|
1532
1531
|
{
|
|
1533
|
-
ref:
|
|
1532
|
+
ref: y,
|
|
1534
1533
|
className: u(
|
|
1535
1534
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-surface-hover",
|
|
1536
1535
|
c
|
|
@@ -1539,7 +1538,7 @@ const Vt = ({
|
|
|
1539
1538
|
/* @__PURE__ */ e(
|
|
1540
1539
|
"button",
|
|
1541
1540
|
{
|
|
1542
|
-
ref:
|
|
1541
|
+
ref: p,
|
|
1543
1542
|
onClick: I,
|
|
1544
1543
|
disabled: l,
|
|
1545
1544
|
"aria-haspopup": "menu",
|
|
@@ -1550,8 +1549,8 @@ const Vt = ({
|
|
|
1550
1549
|
children: t
|
|
1551
1550
|
}
|
|
1552
1551
|
),
|
|
1553
|
-
N && /* @__PURE__ */ e("div", { ref:
|
|
1554
|
-
|
|
1552
|
+
N && /* @__PURE__ */ e("div", { ref: $, className: Q, style: _, onKeyDown: V, children: /* @__PURE__ */ i("div", { className: "p-2", role: "menu", children: [
|
|
1553
|
+
g && (typeof g == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: g }) : g),
|
|
1555
1554
|
r.map((m, E) => {
|
|
1556
1555
|
if (m.divider)
|
|
1557
1556
|
return /* @__PURE__ */ e(
|
|
@@ -1561,7 +1560,7 @@ const Vt = ({
|
|
|
1561
1560
|
},
|
|
1562
1561
|
`divider-${E}`
|
|
1563
1562
|
);
|
|
1564
|
-
const w = m.children && m.children.length > 0,
|
|
1563
|
+
const w = m.children && m.children.length > 0, j = d === m.value;
|
|
1565
1564
|
return /* @__PURE__ */ i("div", { className: "relative group", children: [
|
|
1566
1565
|
/* @__PURE__ */ i(
|
|
1567
1566
|
"button",
|
|
@@ -1577,7 +1576,7 @@ const Vt = ({
|
|
|
1577
1576
|
"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover focus-visible:outline-none focus-visible:focus-ring",
|
|
1578
1577
|
{
|
|
1579
1578
|
"opacity-50 cursor-not-allowed": m.disabled,
|
|
1580
|
-
"bg-surface-hover":
|
|
1579
|
+
"bg-surface-hover": j && w
|
|
1581
1580
|
}
|
|
1582
1581
|
),
|
|
1583
1582
|
children: [
|
|
@@ -1589,27 +1588,27 @@ const Vt = ({
|
|
|
1589
1588
|
] })
|
|
1590
1589
|
] }),
|
|
1591
1590
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1592
|
-
|
|
1591
|
+
h && n === m.value && /* @__PURE__ */ e(Me, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
|
|
1593
1592
|
w && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
|
|
1594
1593
|
] })
|
|
1595
1594
|
]
|
|
1596
1595
|
}
|
|
1597
1596
|
),
|
|
1598
|
-
w &&
|
|
1597
|
+
w && j && /* @__PURE__ */ e(
|
|
1599
1598
|
"div",
|
|
1600
1599
|
{
|
|
1601
|
-
ref:
|
|
1600
|
+
ref: D,
|
|
1602
1601
|
className: b,
|
|
1603
1602
|
style: {
|
|
1604
|
-
top: `${
|
|
1605
|
-
left: `${
|
|
1603
|
+
top: `${v.top}px`,
|
|
1604
|
+
left: `${v.left}px`
|
|
1606
1605
|
},
|
|
1607
1606
|
onMouseEnter: () => {
|
|
1608
|
-
M.current && (clearTimeout(M.current), M.current = null),
|
|
1607
|
+
M.current && (clearTimeout(M.current), M.current = null), f(m.value);
|
|
1609
1608
|
},
|
|
1610
1609
|
onMouseLeave: () => {
|
|
1611
1610
|
M.current = setTimeout(() => {
|
|
1612
|
-
|
|
1611
|
+
f(null);
|
|
1613
1612
|
}, 150);
|
|
1614
1613
|
},
|
|
1615
1614
|
children: /* @__PURE__ */ e("div", { className: "p-2", children: m.children.map((k, ae) => {
|
|
@@ -1647,7 +1646,7 @@ const Vt = ({
|
|
|
1647
1646
|
k.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: k.description })
|
|
1648
1647
|
] })
|
|
1649
1648
|
] }),
|
|
1650
|
-
|
|
1649
|
+
h && ne && /* @__PURE__ */ e(Me, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 })
|
|
1651
1650
|
]
|
|
1652
1651
|
},
|
|
1653
1652
|
k.value
|
|
@@ -1660,8 +1659,8 @@ const Vt = ({
|
|
|
1660
1659
|
(() => {
|
|
1661
1660
|
const m = r.reduce((E, w) => {
|
|
1662
1661
|
if (w.divider) return E;
|
|
1663
|
-
const
|
|
1664
|
-
return E + 1 +
|
|
1662
|
+
const j = w.children ? w.children.filter((k) => !k.divider).length : 0;
|
|
1663
|
+
return E + 1 + j;
|
|
1665
1664
|
}, 0);
|
|
1666
1665
|
return m > 1 && /* @__PURE__ */ e("div", { className: "border-t border-border mt-2 pt-2", children: /* @__PURE__ */ i("div", { className: "text-xs text-text-muted px-3 py-1", children: [
|
|
1667
1666
|
m,
|
|
@@ -1672,12 +1671,12 @@ const Vt = ({
|
|
|
1672
1671
|
]
|
|
1673
1672
|
}
|
|
1674
1673
|
);
|
|
1675
|
-
}, Ht = () => /* @__PURE__ */ e(J, { icon: Ne, size: "md", color: "current" }), qt = ({ active: t }) => /* @__PURE__ */ e(J, { icon: Qe, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Ut = ({ active: t }) => /* @__PURE__ */ e(J, { icon: be, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Wt = () => /* @__PURE__ */ e(J, { icon:
|
|
1674
|
+
}, Ht = () => /* @__PURE__ */ e(J, { icon: Ne, size: "md", color: "current" }), qt = ({ active: t }) => /* @__PURE__ */ e(J, { icon: Qe, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Ut = ({ active: t }) => /* @__PURE__ */ e(J, { icon: be, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Wt = () => /* @__PURE__ */ e(J, { icon: je, size: "md", color: "current" }), Kt = () => /* @__PURE__ */ e(J, { icon: ye, size: "md", color: "current" }), _t = () => /* @__PURE__ */ e(J, { icon: et, size: "md", color: "current" }), Gt = () => /* @__PURE__ */ e(J, { icon: tt, size: "md", color: "current" }), Be = () => /* @__PURE__ */ e(J, { icon: be, size: "md", color: "current" }), Jt = (t) => {
|
|
1676
1675
|
const r = (s) => t.multiSelect && Array.isArray(t.value) ? t.value?.includes(s) : t.value === s, n = (s) => {
|
|
1677
1676
|
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((a) => a !== s)) : t.onChange(s);
|
|
1678
1677
|
};
|
|
1679
1678
|
return t.type === "date" ? /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-40", children: /* @__PURE__ */ e(
|
|
1680
|
-
|
|
1679
|
+
Se,
|
|
1681
1680
|
{
|
|
1682
1681
|
size: "sm",
|
|
1683
1682
|
value: t.value,
|
|
@@ -1727,18 +1726,18 @@ const Vt = ({
|
|
|
1727
1726
|
searchPlaceholder: a = "Search...",
|
|
1728
1727
|
filters: l = [],
|
|
1729
1728
|
paginated: c = !1,
|
|
1730
|
-
pageSizeOptions:
|
|
1731
|
-
defaultPageSize:
|
|
1729
|
+
pageSizeOptions: h = [10, 25, 50, 100],
|
|
1730
|
+
defaultPageSize: g = 10,
|
|
1732
1731
|
actions: N = [],
|
|
1733
1732
|
onRowClick: x,
|
|
1734
1733
|
selectable: d = !1,
|
|
1735
|
-
selectedRows:
|
|
1736
|
-
onSelectionChange:
|
|
1734
|
+
selectedRows: f = [],
|
|
1735
|
+
onSelectionChange: v,
|
|
1737
1736
|
getRowKey: C = (q, V) => V,
|
|
1738
|
-
emptyContent:
|
|
1739
|
-
hoverable:
|
|
1740
|
-
bordered:
|
|
1741
|
-
striped:
|
|
1737
|
+
emptyContent: y,
|
|
1738
|
+
hoverable: p = !0,
|
|
1739
|
+
bordered: D = !1,
|
|
1740
|
+
striped: $ = !1,
|
|
1742
1741
|
className: _,
|
|
1743
1742
|
rowClassName: M
|
|
1744
1743
|
}) => {
|
|
@@ -1747,7 +1746,7 @@ const Vt = ({
|
|
|
1747
1746
|
direction: null
|
|
1748
1747
|
}), [H, X] = R({
|
|
1749
1748
|
page: 0,
|
|
1750
|
-
pageSize:
|
|
1749
|
+
pageSize: g
|
|
1751
1750
|
}), Z = se(null), Q = me(() => {
|
|
1752
1751
|
let o = t;
|
|
1753
1752
|
if (s && q.trim()) {
|
|
@@ -1786,22 +1785,22 @@ const Vt = ({
|
|
|
1786
1785
|
[r]
|
|
1787
1786
|
), w = ce((o) => {
|
|
1788
1787
|
X((z) => ({ ...z, page: o }));
|
|
1789
|
-
}, []),
|
|
1788
|
+
}, []), j = ce((o) => {
|
|
1790
1789
|
X({ page: 0, pageSize: o });
|
|
1791
1790
|
}, []), k = ce(
|
|
1792
1791
|
(o, z) => {
|
|
1793
|
-
if (!
|
|
1792
|
+
if (!v) return;
|
|
1794
1793
|
const B = C(o, 0);
|
|
1795
|
-
|
|
1796
|
-
(F, O) => C(
|
|
1794
|
+
f.map((F, O) => C(F, O)), v(z ? [...f, o] : f.filter(
|
|
1795
|
+
(F, O) => C(f[O], O) !== B
|
|
1797
1796
|
));
|
|
1798
1797
|
},
|
|
1799
|
-
[
|
|
1798
|
+
[f, v, C]
|
|
1800
1799
|
), ae = ce(
|
|
1801
1800
|
(o) => {
|
|
1802
|
-
|
|
1801
|
+
v && v(o ? [...m] : []);
|
|
1803
1802
|
},
|
|
1804
|
-
[m,
|
|
1803
|
+
[m, v]
|
|
1805
1804
|
);
|
|
1806
1805
|
Y(() => {
|
|
1807
1806
|
X((o) => ({ ...o, page: 0 }));
|
|
@@ -1810,21 +1809,21 @@ const Vt = ({
|
|
|
1810
1809
|
}, [l.map((o) => o.value).join(",")]);
|
|
1811
1810
|
const ne = b.length, te = Math.ceil(ne / H.pageSize), G = H.page * H.pageSize + 1, S = Math.min(G + H.pageSize - 1, ne), A = m.length > 0 && m.every((o) => {
|
|
1812
1811
|
const z = C(o, 0);
|
|
1813
|
-
return
|
|
1812
|
+
return f.some(
|
|
1814
1813
|
(B, F) => C(B, F) === z
|
|
1815
1814
|
);
|
|
1816
1815
|
}), L = m.some((o) => {
|
|
1817
1816
|
const z = C(o, 0);
|
|
1818
|
-
return
|
|
1817
|
+
return f.some(
|
|
1819
1818
|
(B, F) => C(B, F) === z
|
|
1820
1819
|
);
|
|
1821
1820
|
}), T = u(
|
|
1822
1821
|
"w-full text-sm leading-5 text-text border-collapse",
|
|
1823
1822
|
_
|
|
1824
|
-
), U = u("bg-surface"),
|
|
1823
|
+
), U = u("bg-surface"), P = u(
|
|
1825
1824
|
"text-text p-3 border-b border-border"
|
|
1826
1825
|
), K = u("h-row-lg", {
|
|
1827
|
-
"hover:bg-surface-sunk":
|
|
1826
|
+
"hover:bg-surface-sunk": p,
|
|
1828
1827
|
"cursor-pointer": x
|
|
1829
1828
|
});
|
|
1830
1829
|
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
@@ -1852,7 +1851,7 @@ const Vt = ({
|
|
|
1852
1851
|
) }),
|
|
1853
1852
|
/* @__PURE__ */ i("table", { ref: Z, className: u(T, "min-w-full"), children: [
|
|
1854
1853
|
/* @__PURE__ */ e("thead", { className: U, children: /* @__PURE__ */ i("tr", { children: [
|
|
1855
|
-
d && /* @__PURE__ */ e("th", { className: u(
|
|
1854
|
+
d && /* @__PURE__ */ e("th", { className: u(P, "w-12"), children: /* @__PURE__ */ e(
|
|
1856
1855
|
"input",
|
|
1857
1856
|
{
|
|
1858
1857
|
type: "checkbox",
|
|
@@ -1868,7 +1867,7 @@ const Vt = ({
|
|
|
1868
1867
|
"th",
|
|
1869
1868
|
{
|
|
1870
1869
|
className: u(
|
|
1871
|
-
|
|
1870
|
+
P,
|
|
1872
1871
|
"font-semibold text-xs text-text-muted uppercase tracking-label",
|
|
1873
1872
|
"group",
|
|
1874
1873
|
{
|
|
@@ -1911,20 +1910,20 @@ const Vt = ({
|
|
|
1911
1910
|
},
|
|
1912
1911
|
o.id
|
|
1913
1912
|
)),
|
|
1914
|
-
N.length > 0 && /* @__PURE__ */ e("th", { className: u(
|
|
1913
|
+
N.length > 0 && /* @__PURE__ */ e("th", { className: u(P, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
1915
1914
|
] }) }),
|
|
1916
1915
|
/* @__PURE__ */ e("tbody", { children: m.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1917
1916
|
"td",
|
|
1918
1917
|
{
|
|
1919
1918
|
colSpan: r.length + (d ? 1 : 0) + (N.length > 0 ? 1 : 0),
|
|
1920
1919
|
className: u(
|
|
1921
|
-
|
|
1920
|
+
P,
|
|
1922
1921
|
"text-center py-8 text-text-muted"
|
|
1923
1922
|
),
|
|
1924
|
-
children:
|
|
1923
|
+
children: y || "No data available"
|
|
1925
1924
|
}
|
|
1926
1925
|
) }) : m.map((o, z) => {
|
|
1927
|
-
const B = C(o, z), F =
|
|
1926
|
+
const B = C(o, z), F = f.some(
|
|
1928
1927
|
(O, re) => C(O, re) === B
|
|
1929
1928
|
);
|
|
1930
1929
|
return /* @__PURE__ */ i(
|
|
@@ -1939,7 +1938,7 @@ const Vt = ({
|
|
|
1939
1938
|
O.stopPropagation(), x?.(o, z);
|
|
1940
1939
|
},
|
|
1941
1940
|
children: [
|
|
1942
|
-
d && /* @__PURE__ */ e("td", { className:
|
|
1941
|
+
d && /* @__PURE__ */ e("td", { className: P, children: /* @__PURE__ */ e(
|
|
1943
1942
|
"input",
|
|
1944
1943
|
{
|
|
1945
1944
|
type: "checkbox",
|
|
@@ -1955,7 +1954,7 @@ const Vt = ({
|
|
|
1955
1954
|
return /* @__PURE__ */ e(
|
|
1956
1955
|
"td",
|
|
1957
1956
|
{
|
|
1958
|
-
className: u(
|
|
1957
|
+
className: u(P, {
|
|
1959
1958
|
"text-left": O.align === "left" || !O.align,
|
|
1960
1959
|
"text-center": O.align === "center",
|
|
1961
1960
|
"text-right": O.align === "right",
|
|
@@ -1967,7 +1966,7 @@ const Vt = ({
|
|
|
1967
1966
|
O.id
|
|
1968
1967
|
);
|
|
1969
1968
|
}),
|
|
1970
|
-
N.length > 0 && /* @__PURE__ */ e("td", { className:
|
|
1969
|
+
N.length > 0 && /* @__PURE__ */ e("td", { className: P, children: /* @__PURE__ */ e(
|
|
1971
1970
|
Vt,
|
|
1972
1971
|
{
|
|
1973
1972
|
trigger: /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-text-muted hover:text-text", children: [
|
|
@@ -2013,9 +2012,9 @@ const Vt = ({
|
|
|
2013
2012
|
"select",
|
|
2014
2013
|
{
|
|
2015
2014
|
value: H.pageSize,
|
|
2016
|
-
onChange: (o) =>
|
|
2015
|
+
onChange: (o) => j(Number(o.target.value)),
|
|
2017
2016
|
className: "h-control-sm w-16 rounded-md border border-border bg-surface-input px-2 text-sm text-text",
|
|
2018
|
-
children:
|
|
2017
|
+
children: h.map((o) => /* @__PURE__ */ e("option", { value: o, children: o }, o))
|
|
2019
2018
|
}
|
|
2020
2019
|
)
|
|
2021
2020
|
] })
|
|
@@ -2080,31 +2079,31 @@ const Vt = ({
|
|
|
2080
2079
|
onTabChange: n,
|
|
2081
2080
|
className: s
|
|
2082
2081
|
}) => {
|
|
2083
|
-
const [a, l] = R(t[0]?.id || ""), c = r || a,
|
|
2084
|
-
n ? n(
|
|
2082
|
+
const [a, l] = R(t[0]?.id || ""), c = r || a, h = (g) => {
|
|
2083
|
+
n ? n(g) : l(g);
|
|
2085
2084
|
};
|
|
2086
|
-
return /* @__PURE__ */ e("div", { className: u("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((
|
|
2085
|
+
return /* @__PURE__ */ e("div", { className: u("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((g) => /* @__PURE__ */ e(
|
|
2087
2086
|
"button",
|
|
2088
2087
|
{
|
|
2089
|
-
onClick: () => !
|
|
2090
|
-
disabled:
|
|
2088
|
+
onClick: () => !g.disabled && h(g.id),
|
|
2089
|
+
disabled: g.disabled,
|
|
2091
2090
|
className: u(
|
|
2092
2091
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-fast",
|
|
2093
2092
|
{
|
|
2094
|
-
"border-accent-border text-text": c ===
|
|
2095
|
-
"border-transparent text-text-muted hover:text-text": c !==
|
|
2096
|
-
"border-transparent text-disabled cursor-not-allowed":
|
|
2093
|
+
"border-accent-border text-text": c === g.id,
|
|
2094
|
+
"border-transparent text-text-muted hover:text-text": c !== g.id && !g.disabled,
|
|
2095
|
+
"border-transparent text-disabled cursor-not-allowed": g.disabled
|
|
2097
2096
|
}
|
|
2098
2097
|
),
|
|
2099
2098
|
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2100
|
-
|
|
2101
|
-
|
|
2099
|
+
g.label,
|
|
2100
|
+
g.badge && /* @__PURE__ */ e("span", { className: u(
|
|
2102
2101
|
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
|
2103
|
-
c ===
|
|
2104
|
-
), children:
|
|
2102
|
+
c === g.id ? "bg-accent-soft text-accent" : "bg-surface-hover text-text-muted"
|
|
2103
|
+
), children: g.badge })
|
|
2105
2104
|
] })
|
|
2106
2105
|
},
|
|
2107
|
-
|
|
2106
|
+
g.id
|
|
2108
2107
|
)) }) });
|
|
2109
2108
|
}, Xt = ({
|
|
2110
2109
|
items: t,
|
|
@@ -2115,14 +2114,14 @@ const Vt = ({
|
|
|
2115
2114
|
size: l = "md",
|
|
2116
2115
|
className: c
|
|
2117
2116
|
}) => {
|
|
2118
|
-
const [
|
|
2117
|
+
const [h, g] = R(
|
|
2119
2118
|
r || n || t[0]?.id || ""
|
|
2120
|
-
), N = n ||
|
|
2121
|
-
s ? s(
|
|
2119
|
+
), N = n || h, x = (y) => {
|
|
2120
|
+
s ? s(y) : g(y);
|
|
2122
2121
|
}, d = {
|
|
2123
2122
|
activeTab: N,
|
|
2124
2123
|
setActiveTab: x
|
|
2125
|
-
},
|
|
2124
|
+
}, f = t.find((y) => y.id === N), v = u(
|
|
2126
2125
|
"flex",
|
|
2127
2126
|
{
|
|
2128
2127
|
"border-b border-border px-2": a === "default" || a === "underline",
|
|
@@ -2131,8 +2130,8 @@ const Vt = ({
|
|
|
2131
2130
|
"space-x-8": a === "default" || a === "underline"
|
|
2132
2131
|
},
|
|
2133
2132
|
c
|
|
2134
|
-
), C = (
|
|
2135
|
-
const
|
|
2133
|
+
), C = (y, p) => {
|
|
2134
|
+
const D = "transition-colors duration-fast font-medium", $ = {
|
|
2136
2135
|
"text-xs px-2 py-1": l === "sm",
|
|
2137
2136
|
"text-sm px-3 py-2": l === "md",
|
|
2138
2137
|
"text-base px-4 py-3": l === "lg"
|
|
@@ -2144,44 +2143,44 @@ const Vt = ({
|
|
|
2144
2143
|
// Underline variant
|
|
2145
2144
|
"border-b-2 pb-2": a === "underline"
|
|
2146
2145
|
}, M = {
|
|
2147
|
-
"opacity-50 cursor-not-allowed":
|
|
2148
|
-
"cursor-pointer": !
|
|
2149
|
-
}, q =
|
|
2146
|
+
"opacity-50 cursor-not-allowed": y.disabled,
|
|
2147
|
+
"cursor-pointer": !y.disabled
|
|
2148
|
+
}, q = p ? {
|
|
2150
2149
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
2151
2150
|
"bg-surface text-text shadow-none": a === "pills"
|
|
2152
|
-
} : {}, V = !
|
|
2151
|
+
} : {}, V = !p && !y.disabled ? {
|
|
2153
2152
|
"border-transparent text-text-muted hover:text-text": a === "default",
|
|
2154
2153
|
"text-text-muted hover:text-text": a === "pills",
|
|
2155
2154
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
2156
2155
|
} : {};
|
|
2157
|
-
return u(
|
|
2156
|
+
return u(D, $, _, M, q, V);
|
|
2158
2157
|
};
|
|
2159
2158
|
return /* @__PURE__ */ e(Yt.Provider, { value: d, children: /* @__PURE__ */ i("div", { children: [
|
|
2160
|
-
/* @__PURE__ */ e("div", { className:
|
|
2159
|
+
/* @__PURE__ */ e("div", { className: v, role: "tablist", children: t.map((y) => /* @__PURE__ */ e(
|
|
2161
2160
|
"button",
|
|
2162
2161
|
{
|
|
2163
2162
|
type: "button",
|
|
2164
2163
|
role: "tab",
|
|
2165
|
-
"aria-selected": N ===
|
|
2166
|
-
"aria-controls": `tabpanel-${
|
|
2167
|
-
disabled:
|
|
2168
|
-
onClick: () => !
|
|
2169
|
-
className: C(
|
|
2164
|
+
"aria-selected": N === y.id,
|
|
2165
|
+
"aria-controls": `tabpanel-${y.id}`,
|
|
2166
|
+
disabled: y.disabled,
|
|
2167
|
+
onClick: () => !y.disabled && x(y.id),
|
|
2168
|
+
className: C(y, N === y.id),
|
|
2170
2169
|
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2171
|
-
|
|
2172
|
-
|
|
2170
|
+
y.label,
|
|
2171
|
+
y.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-surface-hover text-text-muted", children: y.badge })
|
|
2173
2172
|
] })
|
|
2174
2173
|
},
|
|
2175
|
-
|
|
2174
|
+
y.id
|
|
2176
2175
|
)) }),
|
|
2177
|
-
|
|
2176
|
+
f?.content && /* @__PURE__ */ e(
|
|
2178
2177
|
"div",
|
|
2179
2178
|
{
|
|
2180
2179
|
role: "tabpanel",
|
|
2181
2180
|
id: `tabpanel-${N}`,
|
|
2182
2181
|
"aria-labelledby": `tab-${N}`,
|
|
2183
2182
|
className: "mt-4",
|
|
2184
|
-
children:
|
|
2183
|
+
children: f.content
|
|
2185
2184
|
}
|
|
2186
2185
|
)
|
|
2187
2186
|
] }) });
|
|
@@ -2200,22 +2199,22 @@ function Fe({
|
|
|
2200
2199
|
closeOnBackdropClick: a = !0,
|
|
2201
2200
|
closeOnEscape: l = !0,
|
|
2202
2201
|
className: c,
|
|
2203
|
-
backdropClassName:
|
|
2204
|
-
children:
|
|
2202
|
+
backdropClassName: h,
|
|
2203
|
+
children: g,
|
|
2205
2204
|
footer: N,
|
|
2206
2205
|
showCloseButton: x = !0
|
|
2207
2206
|
}) {
|
|
2208
|
-
const d = se(null),
|
|
2207
|
+
const d = se(null), f = se(null);
|
|
2209
2208
|
Y(() => {
|
|
2210
2209
|
if (!t || !l) return;
|
|
2211
|
-
const C = (
|
|
2212
|
-
|
|
2210
|
+
const C = (y) => {
|
|
2211
|
+
y.key === "Escape" && r();
|
|
2213
2212
|
};
|
|
2214
2213
|
return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
|
|
2215
|
-
}, [t, l, r]), Y(() => (t ? (
|
|
2214
|
+
}, [t, l, r]), Y(() => (t ? (f.current = document.activeElement, d.current && d.current.focus(), document.body.style.overflow = "hidden") : (f.current && f.current.focus(), document.body.style.overflow = ""), () => {
|
|
2216
2215
|
document.body.style.overflow = "";
|
|
2217
2216
|
}), [t]);
|
|
2218
|
-
const
|
|
2217
|
+
const v = (C) => {
|
|
2219
2218
|
a && C.target === C.currentTarget && r();
|
|
2220
2219
|
};
|
|
2221
2220
|
return t ? /* @__PURE__ */ e(
|
|
@@ -2225,9 +2224,9 @@ function Fe({
|
|
|
2225
2224
|
"fixed inset-0 z-modal flex items-center justify-center p-4",
|
|
2226
2225
|
"bg-scrim",
|
|
2227
2226
|
// 'animate-fade-in',
|
|
2228
|
-
|
|
2227
|
+
h
|
|
2229
2228
|
),
|
|
2230
|
-
onClick:
|
|
2229
|
+
onClick: v,
|
|
2231
2230
|
children: /* @__PURE__ */ i(
|
|
2232
2231
|
"div",
|
|
2233
2232
|
{
|
|
@@ -2263,7 +2262,7 @@ function Fe({
|
|
|
2263
2262
|
}
|
|
2264
2263
|
)
|
|
2265
2264
|
] }),
|
|
2266
|
-
/* @__PURE__ */ e("div", { className: "p-6", children:
|
|
2265
|
+
/* @__PURE__ */ e("div", { className: "p-6", children: g }),
|
|
2267
2266
|
N && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: N })
|
|
2268
2267
|
]
|
|
2269
2268
|
}
|
|
@@ -2311,33 +2310,33 @@ const Qt = {
|
|
|
2311
2310
|
align: a = "left",
|
|
2312
2311
|
truncate: l = !1,
|
|
2313
2312
|
italic: c = !1,
|
|
2314
|
-
underline:
|
|
2315
|
-
lineHeight:
|
|
2313
|
+
underline: h = !1,
|
|
2314
|
+
lineHeight: g = "normal",
|
|
2316
2315
|
as: N,
|
|
2317
2316
|
className: x,
|
|
2318
2317
|
children: d,
|
|
2319
|
-
...
|
|
2318
|
+
...f
|
|
2320
2319
|
}) => {
|
|
2321
|
-
const
|
|
2320
|
+
const v = N || sr(t), C = t === "caption", y = t === "label", p = t === "code", D = u(
|
|
2322
2321
|
"font-sans",
|
|
2323
2322
|
// Variant — caption and label pin their own size/weight
|
|
2324
2323
|
C && "text-xs text-text-subtle",
|
|
2325
|
-
|
|
2326
|
-
|
|
2324
|
+
y && "text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
2325
|
+
p && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
|
|
2327
2326
|
// Size — only where the variant does not pin it
|
|
2328
|
-
!C && !
|
|
2327
|
+
!C && !y && !p && Qt[r],
|
|
2329
2328
|
// Weight — label owns its weight
|
|
2330
|
-
!
|
|
2329
|
+
!y && er[n],
|
|
2331
2330
|
tr[s],
|
|
2332
2331
|
rr[a],
|
|
2333
2332
|
// Line height only overrides the body variant
|
|
2334
|
-
t === "body" && nr[
|
|
2333
|
+
t === "body" && nr[g],
|
|
2335
2334
|
c && "italic",
|
|
2336
|
-
|
|
2335
|
+
h && "underline",
|
|
2337
2336
|
l && "truncate",
|
|
2338
2337
|
x
|
|
2339
2338
|
);
|
|
2340
|
-
return /* @__PURE__ */ e(
|
|
2339
|
+
return /* @__PURE__ */ e(v, { className: D, ...f, children: d });
|
|
2341
2340
|
};
|
|
2342
2341
|
function sr(t) {
|
|
2343
2342
|
return {
|
|
@@ -2355,35 +2354,35 @@ const ar = ({
|
|
|
2355
2354
|
error: a,
|
|
2356
2355
|
disabled: l,
|
|
2357
2356
|
accept: c,
|
|
2358
|
-
onListFiles:
|
|
2359
|
-
onListMounts:
|
|
2357
|
+
onListFiles: h,
|
|
2358
|
+
onListMounts: g,
|
|
2360
2359
|
onUploadFile: N,
|
|
2361
2360
|
onDownloadFile: x,
|
|
2362
2361
|
onRegisterFile: d
|
|
2363
2362
|
}) => {
|
|
2364
|
-
const [
|
|
2363
|
+
const [f, v] = R(!1), [C, y] = R([]), [p, D] = R(null), [$, _] = R("/"), [M, q] = R([]), [V, I] = R(!1), [W, H] = R(""), [X, Z] = R(
|
|
2365
2364
|
typeof t == "object" ? t : null
|
|
2366
2365
|
), [Q, b] = R(!1), [m, E] = R(""), w = se(null);
|
|
2367
2366
|
Y(() => {
|
|
2368
|
-
|
|
2369
|
-
}, [
|
|
2370
|
-
|
|
2371
|
-
}, [
|
|
2372
|
-
const
|
|
2367
|
+
f && j();
|
|
2368
|
+
}, [f]), Y(() => {
|
|
2369
|
+
f && p && k();
|
|
2370
|
+
}, [f, p, $, W]);
|
|
2371
|
+
const j = async () => {
|
|
2373
2372
|
I(!0);
|
|
2374
2373
|
try {
|
|
2375
|
-
const o = await
|
|
2376
|
-
o?.data &&
|
|
2374
|
+
const o = await g?.();
|
|
2375
|
+
o?.data && y(o.data);
|
|
2377
2376
|
} catch (o) {
|
|
2378
2377
|
console.error("Failed to load mounts", o);
|
|
2379
2378
|
} finally {
|
|
2380
2379
|
I(!1);
|
|
2381
2380
|
}
|
|
2382
2381
|
}, k = async () => {
|
|
2383
|
-
if (
|
|
2382
|
+
if (p) {
|
|
2384
2383
|
I(!0);
|
|
2385
2384
|
try {
|
|
2386
|
-
const o = await
|
|
2385
|
+
const o = await h?.({ mountId: p.id, name: W, path: $ });
|
|
2387
2386
|
o?.data && q(o.data);
|
|
2388
2387
|
} catch (o) {
|
|
2389
2388
|
console.error("Failed to load files", o);
|
|
@@ -2407,7 +2406,7 @@ const ar = ({
|
|
|
2407
2406
|
providerKey: z.name,
|
|
2408
2407
|
ownerId: "me"
|
|
2409
2408
|
};
|
|
2410
|
-
Z(O), r(O, F),
|
|
2409
|
+
Z(O), r(O, F), v(!1);
|
|
2411
2410
|
} catch (B) {
|
|
2412
2411
|
console.error("Local file selection failed", B);
|
|
2413
2412
|
} finally {
|
|
@@ -2416,19 +2415,19 @@ const ar = ({
|
|
|
2416
2415
|
}
|
|
2417
2416
|
}, ne = async (o) => {
|
|
2418
2417
|
const z = o.target.files?.[0];
|
|
2419
|
-
if (!(!z || !
|
|
2418
|
+
if (!(!z || !p)) {
|
|
2420
2419
|
I(!0);
|
|
2421
2420
|
try {
|
|
2422
2421
|
const B = await z.arrayBuffer(), F = await N?.({
|
|
2423
2422
|
file: new Uint8Array(B),
|
|
2424
2423
|
filename: z.name,
|
|
2425
2424
|
mimeType: z.type || "application/octet-stream",
|
|
2426
|
-
mountId:
|
|
2427
|
-
path:
|
|
2425
|
+
mountId: p.id,
|
|
2426
|
+
path: $
|
|
2428
2427
|
});
|
|
2429
2428
|
if (F?.data) {
|
|
2430
2429
|
const O = F.data;
|
|
2431
|
-
Z(O), r(O, new Uint8Array(B)),
|
|
2430
|
+
Z(O), r(O, new Uint8Array(B)), v(!1);
|
|
2432
2431
|
}
|
|
2433
2432
|
} catch (B) {
|
|
2434
2433
|
console.error("Upload failed", B);
|
|
@@ -2437,17 +2436,17 @@ const ar = ({
|
|
|
2437
2436
|
}
|
|
2438
2437
|
}
|
|
2439
2438
|
}, te = async () => {
|
|
2440
|
-
if (!(!m || !
|
|
2439
|
+
if (!(!m || !p)) {
|
|
2441
2440
|
I(!0);
|
|
2442
2441
|
try {
|
|
2443
|
-
const o = `${
|
|
2442
|
+
const o = `${$}${m}/`;
|
|
2444
2443
|
d && (await d({
|
|
2445
2444
|
name: m,
|
|
2446
2445
|
type: "folder",
|
|
2447
|
-
path:
|
|
2446
|
+
path: $,
|
|
2448
2447
|
mimeType: "application/x-directory",
|
|
2449
2448
|
size: 0,
|
|
2450
|
-
mountId:
|
|
2449
|
+
mountId: p.id,
|
|
2451
2450
|
providerKey: o,
|
|
2452
2451
|
ownerId: "me"
|
|
2453
2452
|
}), await k()), b(!1), E("");
|
|
@@ -2461,7 +2460,7 @@ const ar = ({
|
|
|
2461
2460
|
I(!0);
|
|
2462
2461
|
try {
|
|
2463
2462
|
const z = await x?.(o.id);
|
|
2464
|
-
Z(o), r(o, z),
|
|
2463
|
+
Z(o), r(o, z), v(!1);
|
|
2465
2464
|
} catch (z) {
|
|
2466
2465
|
console.error("Failed to download file", z);
|
|
2467
2466
|
} finally {
|
|
@@ -2473,19 +2472,19 @@ const ar = ({
|
|
|
2473
2472
|
const o = /* @__PURE__ */ new Set(), z = [];
|
|
2474
2473
|
return M.forEach((B) => {
|
|
2475
2474
|
if (B.type === "folder") {
|
|
2476
|
-
B.path ===
|
|
2475
|
+
B.path === $ && o.add(B.name);
|
|
2477
2476
|
return;
|
|
2478
2477
|
}
|
|
2479
|
-
const F = B.providerKey || B.name, re = (
|
|
2478
|
+
const F = B.providerKey || B.name, re = ($ ? F.substring($.length) : F).split("/").filter((ie) => ie !== "");
|
|
2480
2479
|
re.length > 1 ? o.add(re[0]) : re.length === 1 && z.push(B);
|
|
2481
2480
|
}), {
|
|
2482
2481
|
folders: Array.from(o).sort(),
|
|
2483
2482
|
files: z.sort((B, F) => B.name.localeCompare(F.name))
|
|
2484
2483
|
};
|
|
2485
|
-
}, [M,
|
|
2484
|
+
}, [M, $]), L = (o) => {
|
|
2486
2485
|
_((z) => `${z}${o}/`);
|
|
2487
2486
|
}, T = () => {
|
|
2488
|
-
const o =
|
|
2487
|
+
const o = $.split("/").filter((z) => z !== "");
|
|
2489
2488
|
o.pop(), o.length === 0 ? _("/") : _(`${o.join("/")}/`);
|
|
2490
2489
|
}, U = me(() => {
|
|
2491
2490
|
const o = A.folders.map((z) => ({
|
|
@@ -2499,7 +2498,7 @@ const ar = ({
|
|
|
2499
2498
|
type: "file"
|
|
2500
2499
|
});
|
|
2501
2500
|
}), o;
|
|
2502
|
-
}, [A]),
|
|
2501
|
+
}, [A]), P = [
|
|
2503
2502
|
{
|
|
2504
2503
|
id: "name",
|
|
2505
2504
|
header: "Name",
|
|
@@ -2508,7 +2507,7 @@ const ar = ({
|
|
|
2508
2507
|
/* @__PURE__ */ e(
|
|
2509
2508
|
J,
|
|
2510
2509
|
{
|
|
2511
|
-
icon: z.type === "folder" ? De :
|
|
2510
|
+
icon: z.type === "folder" ? De : ke,
|
|
2512
2511
|
size: "sm",
|
|
2513
2512
|
color: z.type === "folder" ? "warning" : "secondary"
|
|
2514
2513
|
}
|
|
@@ -2559,7 +2558,7 @@ const ar = ({
|
|
|
2559
2558
|
header: "",
|
|
2560
2559
|
accessor: "id",
|
|
2561
2560
|
align: "right",
|
|
2562
|
-
cell: (o, z) => /* @__PURE__ */ e(ee, { size: "sm", variant: "outline", onClick: () =>
|
|
2561
|
+
cell: (o, z) => /* @__PURE__ */ e(ee, { size: "sm", variant: "outline", onClick: () => D(z), children: "Open" })
|
|
2563
2562
|
}
|
|
2564
2563
|
];
|
|
2565
2564
|
return /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
@@ -2567,7 +2566,7 @@ const ar = ({
|
|
|
2567
2566
|
/* @__PURE__ */ i(
|
|
2568
2567
|
"div",
|
|
2569
2568
|
{
|
|
2570
|
-
onClick: () => !l &&
|
|
2569
|
+
onClick: () => !l && v(!0),
|
|
2571
2570
|
className: u(
|
|
2572
2571
|
"flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
|
|
2573
2572
|
"hover:border-border-strong bg-surface",
|
|
@@ -2575,7 +2574,7 @@ const ar = ({
|
|
|
2575
2574
|
l && "opacity-50 cursor-not-allowed bg-surface-sunk"
|
|
2576
2575
|
),
|
|
2577
2576
|
children: [
|
|
2578
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(J, { icon: X ?
|
|
2577
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(J, { icon: X ? ke : $e, color: X ? "primary" : "secondary" }) }),
|
|
2579
2578
|
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: X ? /* @__PURE__ */ e("span", { className: "text-sm text-text font-medium", children: X.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-text-muted", children: s }) }),
|
|
2580
2579
|
X && !l && /* @__PURE__ */ e(
|
|
2581
2580
|
"button",
|
|
@@ -2592,11 +2591,11 @@ const ar = ({
|
|
|
2592
2591
|
/* @__PURE__ */ e(
|
|
2593
2592
|
Fe,
|
|
2594
2593
|
{
|
|
2595
|
-
open:
|
|
2594
|
+
open: f,
|
|
2596
2595
|
onClose: () => {
|
|
2597
|
-
|
|
2596
|
+
v(!1), D(null), _("/"), b(!1);
|
|
2598
2597
|
},
|
|
2599
|
-
title:
|
|
2598
|
+
title: p ? `Explorer: ${p.name}` : "Select Storage Mount",
|
|
2600
2599
|
size: "lg",
|
|
2601
2600
|
children: /* @__PURE__ */ e(
|
|
2602
2601
|
Xt,
|
|
@@ -2606,7 +2605,7 @@ const ar = ({
|
|
|
2606
2605
|
{
|
|
2607
2606
|
id: "remote",
|
|
2608
2607
|
label: "Platform Storage",
|
|
2609
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
2608
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: p ? /* @__PURE__ */ i(fe, { children: [
|
|
2610
2609
|
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2611
2610
|
/* @__PURE__ */ e(
|
|
2612
2611
|
ee,
|
|
@@ -2614,13 +2613,13 @@ const ar = ({
|
|
|
2614
2613
|
variant: "ghost",
|
|
2615
2614
|
size: "sm",
|
|
2616
2615
|
onClick: () => {
|
|
2617
|
-
|
|
2616
|
+
$ && $ !== "/" ? T() : D(null);
|
|
2618
2617
|
},
|
|
2619
|
-
leftIcon: /* @__PURE__ */ e(J, { icon:
|
|
2620
|
-
children:
|
|
2618
|
+
leftIcon: /* @__PURE__ */ e(J, { icon: Ee, size: "xs" }),
|
|
2619
|
+
children: $ ? "Back" : "Back to Mounts"
|
|
2621
2620
|
}
|
|
2622
2621
|
),
|
|
2623
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2622
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children: $ }) }),
|
|
2624
2623
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
2625
2624
|
he,
|
|
2626
2625
|
{
|
|
@@ -2685,7 +2684,7 @@ const ar = ({
|
|
|
2685
2684
|
Te,
|
|
2686
2685
|
{
|
|
2687
2686
|
data: U,
|
|
2688
|
-
columns:
|
|
2687
|
+
columns: P,
|
|
2689
2688
|
loading: V,
|
|
2690
2689
|
emptyContent: "This folder is empty",
|
|
2691
2690
|
onRowClick: (o) => o.type === "folder" ? L(o.name) : G(o)
|
|
@@ -2698,7 +2697,7 @@ const ar = ({
|
|
|
2698
2697
|
columns: K,
|
|
2699
2698
|
loading: V,
|
|
2700
2699
|
emptyContent: "No storage mounts configured",
|
|
2701
|
-
onRowClick: (o) =>
|
|
2700
|
+
onRowClick: (o) => D(o)
|
|
2702
2701
|
}
|
|
2703
2702
|
) }) })
|
|
2704
2703
|
},
|
|
@@ -2706,7 +2705,7 @@ const ar = ({
|
|
|
2706
2705
|
id: "local",
|
|
2707
2706
|
label: "Local File",
|
|
2708
2707
|
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-border rounded-xl bg-surface-sunk/50", children: [
|
|
2709
|
-
/* @__PURE__ */ e("div", { className: "p-4 bg-accent-soft rounded-full mb-4", children: /* @__PURE__ */ e(J, { icon:
|
|
2708
|
+
/* @__PURE__ */ e("div", { className: "p-4 bg-accent-soft rounded-full mb-4", children: /* @__PURE__ */ e(J, { icon: ke, size: "xl", color: "primary" }) }),
|
|
2710
2709
|
/* @__PURE__ */ e(oe, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
|
|
2711
2710
|
/* @__PURE__ */ i(oe, { variant: "body", size: "sm", className: "text-text-muted mt-1 mb-6 text-center max-w-xs", children: [
|
|
2712
2711
|
"This file will be used directly in the form and will ",
|
|
@@ -2739,7 +2738,7 @@ const ar = ({
|
|
|
2739
2738
|
md: "px-3 py-2 text-base",
|
|
2740
2739
|
lg: "px-3 py-2 text-md",
|
|
2741
2740
|
full: "px-3 py-2 text-md"
|
|
2742
|
-
},
|
|
2741
|
+
}, ze = de(
|
|
2743
2742
|
({
|
|
2744
2743
|
label: t,
|
|
2745
2744
|
helperText: r,
|
|
@@ -2748,13 +2747,13 @@ const ar = ({
|
|
|
2748
2747
|
fullWidth: a = !1,
|
|
2749
2748
|
loading: l = !1,
|
|
2750
2749
|
containerClassName: c,
|
|
2751
|
-
labelClassName:
|
|
2752
|
-
className:
|
|
2750
|
+
labelClassName: h,
|
|
2751
|
+
className: g,
|
|
2753
2752
|
id: N,
|
|
2754
2753
|
rows: x = 4,
|
|
2755
2754
|
...d
|
|
2756
|
-
},
|
|
2757
|
-
const
|
|
2755
|
+
}, f) => {
|
|
2756
|
+
const v = le.useId(), C = N || `textarea-${v}`, y = !!n, p = n || r ? `${C}-description` : void 0;
|
|
2758
2757
|
return /* @__PURE__ */ i("div", { className: u("flex flex-col", a && "w-full", c), children: [
|
|
2759
2758
|
t && /* @__PURE__ */ e(
|
|
2760
2759
|
"label",
|
|
@@ -2762,8 +2761,8 @@ const ar = ({
|
|
|
2762
2761
|
htmlFor: C,
|
|
2763
2762
|
className: u(
|
|
2764
2763
|
Oe,
|
|
2765
|
-
|
|
2766
|
-
|
|
2764
|
+
y ? "text-danger-fg" : "text-text-subtle",
|
|
2765
|
+
h
|
|
2767
2766
|
),
|
|
2768
2767
|
children: t
|
|
2769
2768
|
}
|
|
@@ -2772,11 +2771,11 @@ const ar = ({
|
|
|
2772
2771
|
/* @__PURE__ */ e(
|
|
2773
2772
|
"textarea",
|
|
2774
2773
|
{
|
|
2775
|
-
ref:
|
|
2774
|
+
ref: f,
|
|
2776
2775
|
id: C,
|
|
2777
2776
|
rows: x,
|
|
2778
|
-
"aria-invalid":
|
|
2779
|
-
"aria-describedby":
|
|
2777
|
+
"aria-invalid": y || void 0,
|
|
2778
|
+
"aria-describedby": p,
|
|
2780
2779
|
className: u(
|
|
2781
2780
|
"block w-full resize-y rounded-md border bg-surface-input text-text",
|
|
2782
2781
|
"transition-colors duration-fast ease-out",
|
|
@@ -2784,8 +2783,8 @@ const ar = ({
|
|
|
2784
2783
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2785
2784
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
2786
2785
|
lr[s],
|
|
2787
|
-
|
|
2788
|
-
|
|
2786
|
+
y ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
2787
|
+
g
|
|
2789
2788
|
),
|
|
2790
2789
|
...d
|
|
2791
2790
|
}
|
|
@@ -2801,15 +2800,15 @@ const ar = ({
|
|
|
2801
2800
|
(n || r) && /* @__PURE__ */ e(
|
|
2802
2801
|
"p",
|
|
2803
2802
|
{
|
|
2804
|
-
id:
|
|
2805
|
-
className: u("mt-1 text-xs",
|
|
2803
|
+
id: p,
|
|
2804
|
+
className: u("mt-1 text-xs", y ? "text-danger-fg" : "text-text-subtle"),
|
|
2806
2805
|
children: n || r
|
|
2807
2806
|
}
|
|
2808
2807
|
)
|
|
2809
2808
|
] });
|
|
2810
2809
|
}
|
|
2811
2810
|
);
|
|
2812
|
-
|
|
2811
|
+
ze.displayName = "TextArea";
|
|
2813
2812
|
function Ae(t, r) {
|
|
2814
2813
|
return r.split(".").reduce(
|
|
2815
2814
|
(n, s) => n && typeof n == "object" && s in n ? n[s] : void 0,
|
|
@@ -2820,8 +2819,8 @@ function or(t, r, n) {
|
|
|
2820
2819
|
const s = r.split("."), a = Array.isArray(t) ? [...t] : { ...t };
|
|
2821
2820
|
let l = a;
|
|
2822
2821
|
for (let c = 0; c < s.length - 1; c++) {
|
|
2823
|
-
const
|
|
2824
|
-
l[
|
|
2822
|
+
const h = s[c], g = l[h];
|
|
2823
|
+
l[h] = g && typeof g == "object" ? Array.isArray(g) ? [...g] : { ...g } : {}, l = l[h];
|
|
2825
2824
|
}
|
|
2826
2825
|
return l[s[s.length - 1]] = n, a;
|
|
2827
2826
|
}
|
|
@@ -2843,23 +2842,23 @@ const Qr = ({
|
|
|
2843
2842
|
onChange: a,
|
|
2844
2843
|
transform: l,
|
|
2845
2844
|
validate: c,
|
|
2846
|
-
submitButton:
|
|
2847
|
-
cancelButton:
|
|
2845
|
+
submitButton: h = { label: "Submit", variant: "primary" },
|
|
2846
|
+
cancelButton: g = { label: "Cancel", variant: "outline" },
|
|
2848
2847
|
showButtons: N = !0,
|
|
2849
2848
|
layout: x = "vertical",
|
|
2850
2849
|
size: d = "md",
|
|
2851
|
-
loading:
|
|
2852
|
-
className:
|
|
2850
|
+
loading: f = !1,
|
|
2851
|
+
className: v,
|
|
2853
2852
|
ref: C,
|
|
2854
|
-
sdk:
|
|
2853
|
+
sdk: y
|
|
2855
2854
|
}) => {
|
|
2856
|
-
const [
|
|
2855
|
+
const [p, D] = R(r || {}), [$, _] = R({}), [M, q] = R({});
|
|
2857
2856
|
Y(() => {
|
|
2858
|
-
r &&
|
|
2857
|
+
r && D({ ...r });
|
|
2859
2858
|
}, [r]);
|
|
2860
2859
|
const V = ce(
|
|
2861
2860
|
(b, m, E) => {
|
|
2862
|
-
const w = t.flatMap((
|
|
2861
|
+
const w = t.flatMap((j) => j.items).find((j) => j.name === b);
|
|
2863
2862
|
if (!w) return null;
|
|
2864
2863
|
if (w.required && (m == null || m === ""))
|
|
2865
2864
|
return `${w.label} is required`;
|
|
@@ -2869,7 +2868,7 @@ const Qr = ({
|
|
|
2869
2868
|
if (m && !Array.isArray(m))
|
|
2870
2869
|
return `${w.label} must be an array.`;
|
|
2871
2870
|
if (Array.isArray(m) && w.arrayFields) {
|
|
2872
|
-
const
|
|
2871
|
+
const j = [];
|
|
2873
2872
|
let k = !1;
|
|
2874
2873
|
if (m.forEach((ae, ne) => {
|
|
2875
2874
|
const te = {};
|
|
@@ -2882,9 +2881,9 @@ const Qr = ({
|
|
|
2882
2881
|
A && (te[G.name] = A, k = !0);
|
|
2883
2882
|
}
|
|
2884
2883
|
}
|
|
2885
|
-
|
|
2884
|
+
j[ne] = te;
|
|
2886
2885
|
}), k)
|
|
2887
|
-
return JSON.stringify(
|
|
2886
|
+
return JSON.stringify(j);
|
|
2888
2887
|
}
|
|
2889
2888
|
}
|
|
2890
2889
|
return w.validator ? w.validator(m, E) : null;
|
|
@@ -2893,45 +2892,45 @@ const Qr = ({
|
|
|
2893
2892
|
), I = ce(
|
|
2894
2893
|
(b, m) => {
|
|
2895
2894
|
let E = or(
|
|
2896
|
-
|
|
2895
|
+
p,
|
|
2897
2896
|
b,
|
|
2898
2897
|
m
|
|
2899
2898
|
);
|
|
2900
|
-
t.flatMap((k) => k.items).find((k) => k.name === b)?.removeIfEmpty && (m == null || m === "") && (E = cr(E, b)),
|
|
2901
|
-
const
|
|
2899
|
+
t.flatMap((k) => k.items).find((k) => k.name === b)?.removeIfEmpty && (m == null || m === "") && (E = cr(E, b)), D(E), q((k) => ({ ...k, [b]: !0 }));
|
|
2900
|
+
const j = V(b, m, E);
|
|
2902
2901
|
_((k) => ({
|
|
2903
2902
|
...k,
|
|
2904
|
-
[b]:
|
|
2903
|
+
[b]: j || ""
|
|
2905
2904
|
})), a?.(E, b);
|
|
2906
2905
|
},
|
|
2907
|
-
[
|
|
2906
|
+
[p, t, V, a]
|
|
2908
2907
|
), W = ce(
|
|
2909
2908
|
async (b) => {
|
|
2910
|
-
if (b.preventDefault(),
|
|
2911
|
-
const m = {}, E = t.flatMap((
|
|
2912
|
-
for (const
|
|
2913
|
-
if (
|
|
2909
|
+
if (b.preventDefault(), f) return;
|
|
2910
|
+
const m = {}, E = t.flatMap((j) => j.items);
|
|
2911
|
+
for (const j of E) {
|
|
2912
|
+
if (j.hidden || j.conditional && !j.conditional(p))
|
|
2914
2913
|
continue;
|
|
2915
2914
|
const k = V(
|
|
2916
|
-
|
|
2917
|
-
Ae(
|
|
2918
|
-
|
|
2915
|
+
j.name,
|
|
2916
|
+
Ae(p, j.name),
|
|
2917
|
+
p
|
|
2919
2918
|
);
|
|
2920
|
-
k && (m[
|
|
2919
|
+
k && (m[j.name] = k);
|
|
2921
2920
|
}
|
|
2922
2921
|
if (c) {
|
|
2923
|
-
const
|
|
2924
|
-
|
|
2922
|
+
const j = c(p);
|
|
2923
|
+
j && Object.assign(m, j);
|
|
2925
2924
|
}
|
|
2926
|
-
if (_(m), Object.keys(m).some((
|
|
2925
|
+
if (_(m), Object.keys(m).some((j) => m[j]))
|
|
2927
2926
|
return;
|
|
2928
|
-
const w = l ? l(
|
|
2929
|
-
await n?.(
|
|
2927
|
+
const w = l ? l(p) : p;
|
|
2928
|
+
await n?.(p, w);
|
|
2930
2929
|
},
|
|
2931
|
-
[
|
|
2930
|
+
[p, t, V, c, l, n, f]
|
|
2932
2931
|
), H = ce(
|
|
2933
2932
|
(b) => {
|
|
2934
|
-
const m = Ae(
|
|
2933
|
+
const m = Ae(p, b.name), E = M[b.name] ? $[b.name] : void 0, w = b.disabled || f, j = {
|
|
2935
2934
|
value: m || "",
|
|
2936
2935
|
disabled: w,
|
|
2937
2936
|
required: b.required,
|
|
@@ -2948,7 +2947,7 @@ const Qr = ({
|
|
|
2948
2947
|
return /* @__PURE__ */ e(
|
|
2949
2948
|
he,
|
|
2950
2949
|
{
|
|
2951
|
-
...
|
|
2950
|
+
...j,
|
|
2952
2951
|
onChange: (k) => I(b.name, k.target.value),
|
|
2953
2952
|
type: b.textType || b.type,
|
|
2954
2953
|
autoComplete: b.autocomplete,
|
|
@@ -2958,9 +2957,9 @@ const Qr = ({
|
|
|
2958
2957
|
);
|
|
2959
2958
|
case "textarea":
|
|
2960
2959
|
return /* @__PURE__ */ e(
|
|
2961
|
-
|
|
2960
|
+
ze,
|
|
2962
2961
|
{
|
|
2963
|
-
...
|
|
2962
|
+
...j,
|
|
2964
2963
|
onChange: (k) => I(b.name, k.target.value),
|
|
2965
2964
|
rows: 4,
|
|
2966
2965
|
error: E,
|
|
@@ -2971,7 +2970,7 @@ const Qr = ({
|
|
|
2971
2970
|
return /* @__PURE__ */ e(
|
|
2972
2971
|
pe,
|
|
2973
2972
|
{
|
|
2974
|
-
...
|
|
2973
|
+
...j,
|
|
2975
2974
|
onChange: (k) => I(b.name, k),
|
|
2976
2975
|
options: (b.options || []).map((k) => ({
|
|
2977
2976
|
...k,
|
|
@@ -2988,7 +2987,7 @@ const Qr = ({
|
|
|
2988
2987
|
return /* @__PURE__ */ e(
|
|
2989
2988
|
xe,
|
|
2990
2989
|
{
|
|
2991
|
-
...
|
|
2990
|
+
...j,
|
|
2992
2991
|
checked: !!m,
|
|
2993
2992
|
onChange: (k) => I(b.name, k.target.checked),
|
|
2994
2993
|
size: d
|
|
@@ -3019,9 +3018,9 @@ const Qr = ({
|
|
|
3019
3018
|
)) });
|
|
3020
3019
|
case "date":
|
|
3021
3020
|
return /* @__PURE__ */ e(
|
|
3022
|
-
|
|
3021
|
+
Se,
|
|
3023
3022
|
{
|
|
3024
|
-
...
|
|
3023
|
+
...j,
|
|
3025
3024
|
value: m ? new Date(m) : null,
|
|
3026
3025
|
onChange: (k) => I(b.name, k),
|
|
3027
3026
|
size: d
|
|
@@ -3031,29 +3030,29 @@ const Qr = ({
|
|
|
3031
3030
|
return /* @__PURE__ */ e(
|
|
3032
3031
|
ar,
|
|
3033
3032
|
{
|
|
3034
|
-
...
|
|
3033
|
+
...j,
|
|
3035
3034
|
value: m,
|
|
3036
3035
|
onChange: (k) => I(b.name, k),
|
|
3037
3036
|
error: E,
|
|
3038
|
-
onListFiles: (k) =>
|
|
3037
|
+
onListFiles: (k) => y?.http.invoke({
|
|
3039
3038
|
method: "POST",
|
|
3040
3039
|
action: "storage.file.list",
|
|
3041
3040
|
body: k
|
|
3042
3041
|
}),
|
|
3043
|
-
onListMounts: () =>
|
|
3042
|
+
onListMounts: () => y?.http.invoke({
|
|
3044
3043
|
method: "GET",
|
|
3045
3044
|
action: "storage.mount"
|
|
3046
3045
|
}),
|
|
3047
|
-
onUploadFile: (k) =>
|
|
3046
|
+
onUploadFile: (k) => y?.http.invoke({
|
|
3048
3047
|
method: "POST",
|
|
3049
3048
|
action: "storage.file.upload",
|
|
3050
3049
|
body: k
|
|
3051
3050
|
}),
|
|
3052
|
-
onDownloadFile: (k) =>
|
|
3051
|
+
onDownloadFile: (k) => y?.http.invoke({
|
|
3053
3052
|
method: "GET",
|
|
3054
3053
|
action: `storage.file.${k}.download`
|
|
3055
3054
|
}),
|
|
3056
|
-
onRegisterFile: (k) =>
|
|
3055
|
+
onRegisterFile: (k) => y?.http.invoke({
|
|
3057
3056
|
method: "POST",
|
|
3058
3057
|
action: "storage.file.folder",
|
|
3059
3058
|
body: k
|
|
@@ -3066,7 +3065,7 @@ const Qr = ({
|
|
|
3066
3065
|
{
|
|
3067
3066
|
value: m || {},
|
|
3068
3067
|
onChange: (k) => I(b.name, k),
|
|
3069
|
-
onListFolders: () =>
|
|
3068
|
+
onListFolders: () => y?.http.invoke({
|
|
3070
3069
|
method: "GET",
|
|
3071
3070
|
action: "storage.mount"
|
|
3072
3071
|
}),
|
|
@@ -3136,10 +3135,10 @@ const Qr = ({
|
|
|
3136
3135
|
he,
|
|
3137
3136
|
{
|
|
3138
3137
|
...U,
|
|
3139
|
-
onChange: (
|
|
3138
|
+
onChange: (P) => G(
|
|
3140
3139
|
A,
|
|
3141
3140
|
L.name,
|
|
3142
|
-
|
|
3141
|
+
P.target.value
|
|
3143
3142
|
),
|
|
3144
3143
|
type: L.textType || L.type,
|
|
3145
3144
|
autoComplete: L.autocomplete,
|
|
@@ -3149,13 +3148,13 @@ const Qr = ({
|
|
|
3149
3148
|
);
|
|
3150
3149
|
case "textarea":
|
|
3151
3150
|
return /* @__PURE__ */ e(
|
|
3152
|
-
|
|
3151
|
+
ze,
|
|
3153
3152
|
{
|
|
3154
3153
|
...U,
|
|
3155
|
-
onChange: (
|
|
3154
|
+
onChange: (P) => G(
|
|
3156
3155
|
A,
|
|
3157
3156
|
L.name,
|
|
3158
|
-
|
|
3157
|
+
P.target.value
|
|
3159
3158
|
),
|
|
3160
3159
|
rows: 4,
|
|
3161
3160
|
error: T,
|
|
@@ -3167,15 +3166,15 @@ const Qr = ({
|
|
|
3167
3166
|
pe,
|
|
3168
3167
|
{
|
|
3169
3168
|
...U,
|
|
3170
|
-
onChange: (
|
|
3169
|
+
onChange: (P) => G(
|
|
3171
3170
|
A,
|
|
3172
3171
|
L.name,
|
|
3173
|
-
|
|
3172
|
+
P
|
|
3174
3173
|
),
|
|
3175
3174
|
options: (L.options || []).map(
|
|
3176
|
-
(
|
|
3177
|
-
...
|
|
3178
|
-
value: String(
|
|
3175
|
+
(P) => ({
|
|
3176
|
+
...P,
|
|
3177
|
+
value: String(P.value)
|
|
3179
3178
|
})
|
|
3180
3179
|
),
|
|
3181
3180
|
searchable: L.searchable,
|
|
@@ -3191,16 +3190,16 @@ const Qr = ({
|
|
|
3191
3190
|
{
|
|
3192
3191
|
...U,
|
|
3193
3192
|
checked: !!S?.[L.name],
|
|
3194
|
-
onChange: (
|
|
3193
|
+
onChange: (P) => G(
|
|
3195
3194
|
A,
|
|
3196
3195
|
L.name,
|
|
3197
|
-
|
|
3196
|
+
P.target.checked
|
|
3198
3197
|
),
|
|
3199
3198
|
size: d
|
|
3200
3199
|
}
|
|
3201
3200
|
);
|
|
3202
3201
|
case "radio":
|
|
3203
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: L.options?.map((
|
|
3202
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: L.options?.map((P) => /* @__PURE__ */ i(
|
|
3204
3203
|
"label",
|
|
3205
3204
|
{
|
|
3206
3205
|
className: "flex cursor-pointer items-center gap-2 text-base text-text",
|
|
@@ -3210,29 +3209,29 @@ const Qr = ({
|
|
|
3210
3209
|
{
|
|
3211
3210
|
type: "radio",
|
|
3212
3211
|
name: `${b.name}.${A}.${L.name}`,
|
|
3213
|
-
value:
|
|
3214
|
-
checked: S?.[L.name] ===
|
|
3212
|
+
value: P.value,
|
|
3213
|
+
checked: S?.[L.name] === P.value,
|
|
3215
3214
|
onChange: () => G(
|
|
3216
3215
|
A,
|
|
3217
3216
|
L.name,
|
|
3218
|
-
|
|
3217
|
+
P.value
|
|
3219
3218
|
),
|
|
3220
|
-
disabled: w ||
|
|
3219
|
+
disabled: w || P.disabled,
|
|
3221
3220
|
className: "size-checkbox shrink-0 border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3222
3221
|
}
|
|
3223
3222
|
),
|
|
3224
|
-
|
|
3223
|
+
P.label
|
|
3225
3224
|
]
|
|
3226
3225
|
},
|
|
3227
|
-
|
|
3226
|
+
P.value
|
|
3228
3227
|
)) });
|
|
3229
3228
|
case "date": {
|
|
3230
|
-
const
|
|
3229
|
+
const P = S?.[L.name];
|
|
3231
3230
|
return /* @__PURE__ */ e(
|
|
3232
|
-
|
|
3231
|
+
Se,
|
|
3233
3232
|
{
|
|
3234
3233
|
...U,
|
|
3235
|
-
value:
|
|
3234
|
+
value: P ? new Date(P) : null,
|
|
3236
3235
|
onChange: (K) => G(
|
|
3237
3236
|
A,
|
|
3238
3237
|
L.name,
|
|
@@ -3245,10 +3244,10 @@ const Qr = ({
|
|
|
3245
3244
|
case "custom":
|
|
3246
3245
|
return L.customComponent?.({
|
|
3247
3246
|
value: S?.[L.name],
|
|
3248
|
-
onChange: (
|
|
3247
|
+
onChange: (P) => G(
|
|
3249
3248
|
A,
|
|
3250
3249
|
L.name,
|
|
3251
|
-
|
|
3250
|
+
P
|
|
3252
3251
|
),
|
|
3253
3252
|
error: T,
|
|
3254
3253
|
disabled: w
|
|
@@ -3304,12 +3303,12 @@ const Qr = ({
|
|
|
3304
3303
|
return null;
|
|
3305
3304
|
}
|
|
3306
3305
|
},
|
|
3307
|
-
[
|
|
3306
|
+
[p, M, $, f, d, I]
|
|
3308
3307
|
), X = ce(
|
|
3309
3308
|
(b) => {
|
|
3310
|
-
if (b.conditional && !b.conditional(
|
|
3309
|
+
if (b.conditional && !b.conditional(p))
|
|
3311
3310
|
return null;
|
|
3312
|
-
const m = b.items.filter((w) => !(w.hidden || w.conditional && !w.conditional(
|
|
3311
|
+
const m = b.items.filter((w) => !(w.hidden || w.conditional && !w.conditional(p)));
|
|
3313
3312
|
if (m.length === 0) return null;
|
|
3314
3313
|
const E = u(
|
|
3315
3314
|
b.layout === "flex" ? "flex flex-wrap gap-3" : "grid gap-3",
|
|
@@ -3330,7 +3329,7 @@ const Qr = ({
|
|
|
3330
3329
|
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children: b.title }),
|
|
3331
3330
|
b.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: b.description })
|
|
3332
3331
|
] }),
|
|
3333
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children: m.map((w) => (M[w.name] &&
|
|
3332
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children: m.map((w) => (M[w.name] && $[w.name], /* @__PURE__ */ i(
|
|
3334
3333
|
"div",
|
|
3335
3334
|
{
|
|
3336
3335
|
className: u(
|
|
@@ -3356,7 +3355,7 @@ const Qr = ({
|
|
|
3356
3355
|
b.id
|
|
3357
3356
|
);
|
|
3358
3357
|
},
|
|
3359
|
-
[
|
|
3358
|
+
[p, M, $, H]
|
|
3360
3359
|
), Z = u(
|
|
3361
3360
|
"overflow-hidden rounded-lg border border-border bg-surface",
|
|
3362
3361
|
{
|
|
@@ -3365,7 +3364,7 @@ const Qr = ({
|
|
|
3365
3364
|
"max-w-4xl": d === "lg",
|
|
3366
3365
|
"max-w-full": d === "full"
|
|
3367
3366
|
},
|
|
3368
|
-
|
|
3367
|
+
v
|
|
3369
3368
|
), Q = d === "full" ? "md" : d;
|
|
3370
3369
|
return /* @__PURE__ */ i("form", { ref: C, onSubmit: W, className: Z, children: [
|
|
3371
3370
|
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(X) }),
|
|
@@ -3375,24 +3374,24 @@ const Qr = ({
|
|
|
3375
3374
|
ee,
|
|
3376
3375
|
{
|
|
3377
3376
|
type: "button",
|
|
3378
|
-
variant:
|
|
3379
|
-
size:
|
|
3380
|
-
disabled:
|
|
3377
|
+
variant: g.variant ?? "ghost",
|
|
3378
|
+
size: g.size || Q,
|
|
3379
|
+
disabled: g.disabled || f,
|
|
3381
3380
|
onClick: s,
|
|
3382
|
-
className:
|
|
3383
|
-
children:
|
|
3381
|
+
className: g.className,
|
|
3382
|
+
children: g.label
|
|
3384
3383
|
}
|
|
3385
3384
|
),
|
|
3386
3385
|
/* @__PURE__ */ e(
|
|
3387
3386
|
ee,
|
|
3388
3387
|
{
|
|
3389
3388
|
type: "submit",
|
|
3390
|
-
variant:
|
|
3391
|
-
size:
|
|
3392
|
-
disabled:
|
|
3393
|
-
loading:
|
|
3394
|
-
className:
|
|
3395
|
-
children:
|
|
3389
|
+
variant: h.variant,
|
|
3390
|
+
size: h.size || Q,
|
|
3391
|
+
disabled: h.disabled || f,
|
|
3392
|
+
loading: f,
|
|
3393
|
+
className: h.className,
|
|
3394
|
+
children: h.label
|
|
3396
3395
|
}
|
|
3397
3396
|
)
|
|
3398
3397
|
] }) })
|
|
@@ -3406,23 +3405,23 @@ function en({
|
|
|
3406
3405
|
cancelLabel: a = "Annuleren",
|
|
3407
3406
|
tone: l = "default",
|
|
3408
3407
|
loading: c = !1,
|
|
3409
|
-
onConfirm:
|
|
3410
|
-
onCancel:
|
|
3408
|
+
onConfirm: h,
|
|
3409
|
+
onCancel: g
|
|
3411
3410
|
}) {
|
|
3412
3411
|
return /* @__PURE__ */ e(
|
|
3413
3412
|
Fe,
|
|
3414
3413
|
{
|
|
3415
3414
|
open: t,
|
|
3416
|
-
onClose:
|
|
3415
|
+
onClose: g,
|
|
3417
3416
|
title: r,
|
|
3418
3417
|
size: "sm",
|
|
3419
3418
|
footer: /* @__PURE__ */ i("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
3420
|
-
/* @__PURE__ */ e(ee, { variant: "ghost", onClick:
|
|
3419
|
+
/* @__PURE__ */ e(ee, { variant: "ghost", onClick: g, disabled: c, children: a }),
|
|
3421
3420
|
/* @__PURE__ */ e(
|
|
3422
3421
|
ee,
|
|
3423
3422
|
{
|
|
3424
3423
|
variant: l === "danger" ? "destructive" : "primary",
|
|
3425
|
-
onClick:
|
|
3424
|
+
onClick: h,
|
|
3426
3425
|
loading: c,
|
|
3427
3426
|
children: s
|
|
3428
3427
|
}
|
|
@@ -3464,8 +3463,8 @@ function tn({
|
|
|
3464
3463
|
dismissible: a = !1,
|
|
3465
3464
|
onDismiss: l,
|
|
3466
3465
|
className: c,
|
|
3467
|
-
children:
|
|
3468
|
-
...
|
|
3466
|
+
children: h,
|
|
3467
|
+
...g
|
|
3469
3468
|
}) {
|
|
3470
3469
|
return /* @__PURE__ */ i(
|
|
3471
3470
|
"span",
|
|
@@ -3479,7 +3478,7 @@ function tn({
|
|
|
3479
3478
|
dr[r],
|
|
3480
3479
|
c
|
|
3481
3480
|
),
|
|
3482
|
-
...
|
|
3481
|
+
...g,
|
|
3483
3482
|
children: [
|
|
3484
3483
|
n && /* @__PURE__ */ e(
|
|
3485
3484
|
"span",
|
|
@@ -3490,8 +3489,8 @@ function tn({
|
|
|
3490
3489
|
)
|
|
3491
3490
|
}
|
|
3492
3491
|
),
|
|
3493
|
-
s && /* @__PURE__ */ e("span", { className: u("flex-shrink-0",
|
|
3494
|
-
|
|
3492
|
+
s && /* @__PURE__ */ e("span", { className: u("flex-shrink-0", h && "mr-1"), children: s }),
|
|
3493
|
+
h,
|
|
3495
3494
|
a && l && /* @__PURE__ */ e(
|
|
3496
3495
|
"button",
|
|
3497
3496
|
{
|
|
@@ -3517,7 +3516,7 @@ function rn({
|
|
|
3517
3516
|
actions: a,
|
|
3518
3517
|
card: l = !1,
|
|
3519
3518
|
className: c,
|
|
3520
|
-
...
|
|
3519
|
+
...h
|
|
3521
3520
|
}) {
|
|
3522
3521
|
return /* @__PURE__ */ i(
|
|
3523
3522
|
"div",
|
|
@@ -3527,7 +3526,7 @@ function rn({
|
|
|
3527
3526
|
l && "rounded-lg border border-border bg-surface px-11 py-9 shadow-overlay",
|
|
3528
3527
|
c
|
|
3529
3528
|
),
|
|
3530
|
-
...
|
|
3529
|
+
...h,
|
|
3531
3530
|
children: [
|
|
3532
3531
|
t != null && /* @__PURE__ */ e("span", { className: u("flex size-disc items-center justify-center rounded-full text-2xl", mr[r]), children: t }),
|
|
3533
3532
|
/* @__PURE__ */ e("div", { className: "text-lg font-semibold text-text", children: n }),
|
|
@@ -3709,33 +3708,33 @@ function on({
|
|
|
3709
3708
|
className: a
|
|
3710
3709
|
}) {
|
|
3711
3710
|
const l = t.indexOf(r), c = { role: s ? "group" : void 0, "aria-label": s, "aria-hidden": s ? void 0 : !0 };
|
|
3712
|
-
return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className: u("flex items-center gap-1.5", a), children: t.map((
|
|
3711
|
+
return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className: u("flex items-center gap-1.5", a), children: t.map((h, g) => /* @__PURE__ */ e(
|
|
3713
3712
|
"span",
|
|
3714
3713
|
{
|
|
3715
3714
|
className: u(
|
|
3716
3715
|
"h-step-bar rounded-full transition-all duration-fast ease-out",
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3716
|
+
g === l ? "w-5 bg-accent" : "w-3.5",
|
|
3717
|
+
g < l && "bg-border-strong",
|
|
3718
|
+
g > l && "bg-border"
|
|
3720
3719
|
)
|
|
3721
3720
|
},
|
|
3722
|
-
|
|
3723
|
-
)) }) : /* @__PURE__ */ e("div", { ...c, className: u("flex items-center gap-2", a), children: t.map((
|
|
3721
|
+
h
|
|
3722
|
+
)) }) : /* @__PURE__ */ e("div", { ...c, className: u("flex items-center gap-2", a), children: t.map((h, g) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
3724
3723
|
/* @__PURE__ */ e(
|
|
3725
3724
|
"span",
|
|
3726
3725
|
{
|
|
3727
|
-
"aria-current":
|
|
3726
|
+
"aria-current": g === l ? "step" : void 0,
|
|
3728
3727
|
className: u(
|
|
3729
3728
|
"flex size-tile-sm items-center justify-center rounded-full text-xs font-medium",
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3729
|
+
g === l && "bg-accent text-accent-fg",
|
|
3730
|
+
g < l && "bg-accent-soft text-accent",
|
|
3731
|
+
g > l && "bg-surface-hover text-text-muted"
|
|
3733
3732
|
),
|
|
3734
|
-
children:
|
|
3733
|
+
children: g + 1
|
|
3735
3734
|
}
|
|
3736
3735
|
),
|
|
3737
|
-
|
|
3738
|
-
] },
|
|
3736
|
+
g < t.length - 1 && /* @__PURE__ */ e("span", { className: "h-px w-8 bg-border-strong" })
|
|
3737
|
+
] }, h)) });
|
|
3739
3738
|
}
|
|
3740
3739
|
function cn({ title: t, icon: r = /* @__PURE__ */ e(lt, { className: "size-icon-md", "aria-hidden": !0 }), action: n, children: s, className: a, ...l }) {
|
|
3741
3740
|
return /* @__PURE__ */ i(
|
|
@@ -3770,7 +3769,7 @@ function yr(t) {
|
|
|
3770
3769
|
return r.length >= 2 ? (r[0][0] + r[1][0]).toUpperCase() : r.length === 1 ? r[0].slice(0, 2).toUpperCase() : "?";
|
|
3771
3770
|
}
|
|
3772
3771
|
const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
3773
|
-
const [l, c] = le.useState(!1),
|
|
3772
|
+
const [l, c] = le.useState(!1), h = u(
|
|
3774
3773
|
"inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 font-semibold select-none bg-surface-hover-border-emphasis text-text",
|
|
3775
3774
|
vr[n],
|
|
3776
3775
|
s
|
|
@@ -3781,15 +3780,15 @@ const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3781
3780
|
src: r,
|
|
3782
3781
|
alt: t ?? "",
|
|
3783
3782
|
title: a ?? t,
|
|
3784
|
-
className: u(
|
|
3783
|
+
className: u(h, "object-cover"),
|
|
3785
3784
|
onError: () => c(!0)
|
|
3786
3785
|
}
|
|
3787
|
-
) : /* @__PURE__ */ e("span", { className:
|
|
3786
|
+
) : /* @__PURE__ */ e("span", { className: h, title: a ?? t, "aria-label": t, children: yr(t) });
|
|
3788
3787
|
}, Le = "ring-surface", wr = "ring-surface-accent", dn = ({ people: t, max: r = 4, size: n = "sm", className: s }) => {
|
|
3789
3788
|
if (t.length === 0) return null;
|
|
3790
3789
|
const a = t.slice(0, r), l = t.length - a.length;
|
|
3791
3790
|
return /* @__PURE__ */ i("span", { className: u("inline-flex items-center", s), children: [
|
|
3792
|
-
a.map((c,
|
|
3791
|
+
a.map((c, h) => /* @__PURE__ */ e(
|
|
3793
3792
|
Nr,
|
|
3794
3793
|
{
|
|
3795
3794
|
name: c.name,
|
|
@@ -3797,12 +3796,12 @@ const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
|
|
|
3797
3796
|
size: n,
|
|
3798
3797
|
title: c.name ? c.seen === !1 ? `${c.name} — nog niet gelezen` : c.name : void 0,
|
|
3799
3798
|
className: u(
|
|
3800
|
-
|
|
3799
|
+
h > 0 && "-ml-2",
|
|
3801
3800
|
c.owner ? wr : Le,
|
|
3802
3801
|
c.seen === !1 && "opacity-40"
|
|
3803
3802
|
)
|
|
3804
3803
|
},
|
|
3805
|
-
c.id ?? `${c.name}-${
|
|
3804
|
+
c.id ?? `${c.name}-${h}`
|
|
3806
3805
|
)),
|
|
3807
3806
|
l > 0 && /* @__PURE__ */ i(
|
|
3808
3807
|
"span",
|
|
@@ -3855,22 +3854,22 @@ const mn = ({
|
|
|
3855
3854
|
radius: a = "md",
|
|
3856
3855
|
showLoading: l = !0,
|
|
3857
3856
|
showError: c = !0,
|
|
3858
|
-
fallback:
|
|
3859
|
-
loadingContent:
|
|
3857
|
+
fallback: h,
|
|
3858
|
+
loadingContent: g,
|
|
3860
3859
|
errorContent: N,
|
|
3861
3860
|
className: x,
|
|
3862
3861
|
onLoad: d,
|
|
3863
|
-
onError:
|
|
3864
|
-
...
|
|
3862
|
+
onError: f,
|
|
3863
|
+
...v
|
|
3865
3864
|
}) => {
|
|
3866
|
-
const [C,
|
|
3867
|
-
|
|
3865
|
+
const [C, y] = R(!0), [p, D] = R(!1), [$, _] = R(t), M = (Z) => {
|
|
3866
|
+
y(!1), D(!1), d?.(Z);
|
|
3868
3867
|
}, q = (Z) => {
|
|
3869
|
-
if (
|
|
3870
|
-
_(
|
|
3868
|
+
if (y(!1), D(!0), h && $ !== h) {
|
|
3869
|
+
_(h), D(!1), y(!0);
|
|
3871
3870
|
return;
|
|
3872
3871
|
}
|
|
3873
|
-
|
|
3872
|
+
f?.(Z);
|
|
3874
3873
|
}, V = u(
|
|
3875
3874
|
"relative overflow-hidden bg-surface-hover",
|
|
3876
3875
|
// Size variants
|
|
@@ -3902,8 +3901,8 @@ const mn = ({
|
|
|
3902
3901
|
), I = u(
|
|
3903
3902
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
3904
3903
|
{
|
|
3905
|
-
"opacity-0": C ||
|
|
3906
|
-
"opacity-100": !C && !
|
|
3904
|
+
"opacity-0": C || p,
|
|
3905
|
+
"opacity-100": !C && !p
|
|
3907
3906
|
}
|
|
3908
3907
|
), W = u(
|
|
3909
3908
|
"absolute inset-0 flex items-center justify-center",
|
|
@@ -3916,16 +3915,16 @@ const mn = ({
|
|
|
3916
3915
|
/* @__PURE__ */ e(
|
|
3917
3916
|
"img",
|
|
3918
3917
|
{
|
|
3919
|
-
...
|
|
3920
|
-
src:
|
|
3918
|
+
...v,
|
|
3919
|
+
src: $,
|
|
3921
3920
|
alt: r,
|
|
3922
3921
|
className: I,
|
|
3923
3922
|
onLoad: M,
|
|
3924
3923
|
onError: q
|
|
3925
3924
|
}
|
|
3926
3925
|
),
|
|
3927
|
-
C && l && /* @__PURE__ */ e("div", { className: W, children:
|
|
3928
|
-
|
|
3926
|
+
C && l && /* @__PURE__ */ e("div", { className: W, children: g || H }),
|
|
3927
|
+
p && c && /* @__PURE__ */ e("div", { className: W, children: N || X })
|
|
3929
3928
|
] });
|
|
3930
3929
|
};
|
|
3931
3930
|
function fn({
|
|
@@ -3936,18 +3935,18 @@ function fn({
|
|
|
3936
3935
|
renderItem: a,
|
|
3937
3936
|
trailing: l,
|
|
3938
3937
|
onSelect: c,
|
|
3939
|
-
onActiveIndexChange:
|
|
3940
|
-
isActive:
|
|
3938
|
+
onActiveIndexChange: h,
|
|
3939
|
+
isActive: g,
|
|
3941
3940
|
unread: N,
|
|
3942
3941
|
dimmed: x,
|
|
3943
3942
|
groupBy: d,
|
|
3944
|
-
groups:
|
|
3945
|
-
renderGroupHeader:
|
|
3943
|
+
groups: f,
|
|
3944
|
+
renderGroupHeader: v,
|
|
3946
3945
|
stickyGroupHeaders: C = !1,
|
|
3947
|
-
collapsibleGroups:
|
|
3948
|
-
hideGroupCount:
|
|
3949
|
-
selectable:
|
|
3950
|
-
selectedItems:
|
|
3946
|
+
collapsibleGroups: y = !1,
|
|
3947
|
+
hideGroupCount: p = !1,
|
|
3948
|
+
selectable: D = !1,
|
|
3949
|
+
selectedItems: $ = [],
|
|
3951
3950
|
onSelectionChange: _,
|
|
3952
3951
|
bulkActions: M,
|
|
3953
3952
|
header: q,
|
|
@@ -3961,20 +3960,20 @@ function fn({
|
|
|
3961
3960
|
}) {
|
|
3962
3961
|
const [b, m] = le.useState(
|
|
3963
3962
|
() => Object.fromEntries(
|
|
3964
|
-
(
|
|
3963
|
+
(f ?? []).filter((T) => T.defaultCollapsed).map((T) => [T.id, !0])
|
|
3965
3964
|
)
|
|
3966
3965
|
), E = le.useRef(null), w = (T) => {
|
|
3967
3966
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(T.key)) return;
|
|
3968
|
-
const
|
|
3967
|
+
const P = Array.from(
|
|
3969
3968
|
E.current?.querySelectorAll("li[data-list-row]") ?? []
|
|
3970
3969
|
);
|
|
3971
|
-
if (
|
|
3970
|
+
if (P.length === 0) return;
|
|
3972
3971
|
T.preventDefault();
|
|
3973
|
-
const K =
|
|
3974
|
-
|
|
3975
|
-
},
|
|
3972
|
+
const K = P.indexOf(document.activeElement), o = T.key === "Home" ? 0 : T.key === "End" ? P.length - 1 : T.key === "ArrowDown" ? (K + 1) % P.length : (K - 1 + P.length) % P.length;
|
|
3973
|
+
P[o]?.focus();
|
|
3974
|
+
}, j = (T, U) => r ? r(T, U) : U, k = (T) => $.includes(T), ae = (T, U) => {
|
|
3976
3975
|
_ && _(
|
|
3977
|
-
U ? [
|
|
3976
|
+
U ? [...$, T] : $.filter((P) => P !== T)
|
|
3978
3977
|
);
|
|
3979
3978
|
}, ne = (T) => _?.(T ? [...t] : []), te = u(
|
|
3980
3979
|
"flex flex-col",
|
|
@@ -4000,8 +3999,8 @@ function fn({
|
|
|
4000
3999
|
)) });
|
|
4001
4000
|
if (t.length === 0 && W)
|
|
4002
4001
|
return /* @__PURE__ */ e("div", { className: te, children: W });
|
|
4003
|
-
const G = t.length > 0 &&
|
|
4004
|
-
const K =
|
|
4002
|
+
const G = t.length > 0 && $.length === t.length, S = $.length > 0 && !G, A = (T, U, P) => {
|
|
4003
|
+
const K = g?.(T, U) ?? !1, o = N?.(T, U) ?? !1, z = x?.(T, U) ?? !1, B = D && k(T);
|
|
4005
4004
|
return /* @__PURE__ */ i(
|
|
4006
4005
|
"li",
|
|
4007
4006
|
{
|
|
@@ -4011,7 +4010,7 @@ function fn({
|
|
|
4011
4010
|
"data-list-row": "",
|
|
4012
4011
|
"aria-current": K || void 0,
|
|
4013
4012
|
onClick: () => c(T, U),
|
|
4014
|
-
onFocus: () =>
|
|
4013
|
+
onFocus: () => h?.(U),
|
|
4015
4014
|
onKeyDown: (F) => {
|
|
4016
4015
|
F.key !== "Enter" && F.key !== " " || (F.preventDefault(), c(T, U));
|
|
4017
4016
|
}
|
|
@@ -4019,14 +4018,14 @@ function fn({
|
|
|
4019
4018
|
className: u(
|
|
4020
4019
|
"flex items-center gap-3 px-4 py-2 text-base",
|
|
4021
4020
|
"transition-colors duration-fast ease-out",
|
|
4022
|
-
n === "divided" && !
|
|
4021
|
+
n === "divided" && !P && "border-t border-border-subtle",
|
|
4023
4022
|
c && "cursor-pointer focus-visible:outline-none focus-visible:focus-ring",
|
|
4024
4023
|
K || B ? "bg-accent-soft text-text" : c && "hover:bg-surface-hover",
|
|
4025
4024
|
o && "font-bold",
|
|
4026
4025
|
z && "opacity-55"
|
|
4027
4026
|
),
|
|
4028
4027
|
children: [
|
|
4029
|
-
|
|
4028
|
+
D && /* @__PURE__ */ e("span", { onClick: (F) => F.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4030
4029
|
xe,
|
|
4031
4030
|
{
|
|
4032
4031
|
checked: k(T),
|
|
@@ -4046,7 +4045,7 @@ function fn({
|
|
|
4046
4045
|
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(T, U) })
|
|
4047
4046
|
]
|
|
4048
4047
|
},
|
|
4049
|
-
|
|
4048
|
+
j(T, U)
|
|
4050
4049
|
);
|
|
4051
4050
|
}, L = (() => {
|
|
4052
4051
|
if (!d)
|
|
@@ -4056,15 +4055,15 @@ function fn({
|
|
|
4056
4055
|
const z = d(K, o);
|
|
4057
4056
|
T.has(z) || T.set(z, []), T.get(z).push({ item: K, index: o });
|
|
4058
4057
|
});
|
|
4059
|
-
const U =
|
|
4058
|
+
const U = f ?? [];
|
|
4060
4059
|
return [
|
|
4061
4060
|
...U.filter((K) => T.has(K.id)),
|
|
4062
4061
|
...[...T.keys()].filter((K) => !U.some((o) => o.id === K)).map((K) => ({ id: K }))
|
|
4063
4062
|
].flatMap((K, o) => {
|
|
4064
|
-
const z = T.get(K.id) ?? [], B =
|
|
4063
|
+
const z = T.get(K.id) ?? [], B = y && b[K.id], F = K.title ?? K.id, O = K.count ?? z.length, re = /* @__PURE__ */ e(
|
|
4065
4064
|
"li",
|
|
4066
4065
|
{
|
|
4067
|
-
onClick:
|
|
4066
|
+
onClick: y ? () => m((ie) => ({ ...ie, [K.id]: !ie[K.id] })) : void 0,
|
|
4068
4067
|
className: u(
|
|
4069
4068
|
"flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
|
|
4070
4069
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
@@ -4072,12 +4071,12 @@ function fn({
|
|
|
4072
4071
|
o > 0 && "border-t",
|
|
4073
4072
|
"border-b",
|
|
4074
4073
|
C && "sticky z-10",
|
|
4075
|
-
|
|
4074
|
+
y && "cursor-pointer select-none hover:text-text"
|
|
4076
4075
|
),
|
|
4077
|
-
"aria-expanded":
|
|
4076
|
+
"aria-expanded": y ? !B : void 0,
|
|
4078
4077
|
style: C ? { top: V ? 28 : 0 } : void 0,
|
|
4079
|
-
children:
|
|
4080
|
-
|
|
4078
|
+
children: v ? v(K, z.map((ie) => ie.item)) : /* @__PURE__ */ i(fe, { children: [
|
|
4079
|
+
y && /* @__PURE__ */ e(
|
|
4081
4080
|
ye,
|
|
4082
4081
|
{
|
|
4083
4082
|
"aria-hidden": !0,
|
|
@@ -4088,7 +4087,7 @@ function fn({
|
|
|
4088
4087
|
}
|
|
4089
4088
|
),
|
|
4090
4089
|
/* @__PURE__ */ e("span", { children: F }),
|
|
4091
|
-
!
|
|
4090
|
+
!p && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: O })
|
|
4092
4091
|
] })
|
|
4093
4092
|
},
|
|
4094
4093
|
`group-${K.id}`
|
|
@@ -4102,7 +4101,7 @@ function fn({
|
|
|
4102
4101
|
});
|
|
4103
4102
|
})();
|
|
4104
4103
|
return /* @__PURE__ */ i("div", { ref: E, className: te, onKeyDown: c ? w : void 0, children: [
|
|
4105
|
-
|
|
4104
|
+
D && $.length > 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
|
|
4106
4105
|
/* @__PURE__ */ e(
|
|
4107
4106
|
xe,
|
|
4108
4107
|
{
|
|
@@ -4113,7 +4112,7 @@ function fn({
|
|
|
4113
4112
|
}
|
|
4114
4113
|
),
|
|
4115
4114
|
/* @__PURE__ */ i("span", { className: "text-xs text-text-subtle", children: [
|
|
4116
|
-
|
|
4115
|
+
$.length,
|
|
4117
4116
|
" geselecteerd"
|
|
4118
4117
|
] }),
|
|
4119
4118
|
M && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: M })
|
|
@@ -4182,24 +4181,24 @@ const bn = ({
|
|
|
4182
4181
|
actions: a = [],
|
|
4183
4182
|
children: l,
|
|
4184
4183
|
className: c,
|
|
4185
|
-
backLabel:
|
|
4186
|
-
backClassName:
|
|
4184
|
+
backLabel: h = "Back",
|
|
4185
|
+
backClassName: g,
|
|
4187
4186
|
onBack: N,
|
|
4188
4187
|
editable: x = !1,
|
|
4189
4188
|
onTitleChange: d
|
|
4190
4189
|
}) => {
|
|
4191
|
-
const [
|
|
4190
|
+
const [f, v] = R(!1), [C, y] = R(r), p = se(null);
|
|
4192
4191
|
Y(() => {
|
|
4193
|
-
|
|
4192
|
+
y(r);
|
|
4194
4193
|
}, [r]), Y(() => {
|
|
4195
|
-
|
|
4196
|
-
}, [
|
|
4197
|
-
const
|
|
4198
|
-
x &&
|
|
4199
|
-
},
|
|
4200
|
-
|
|
4194
|
+
f && p.current && (p.current.focus(), p.current.select());
|
|
4195
|
+
}, [f]);
|
|
4196
|
+
const D = () => {
|
|
4197
|
+
x && v(!0);
|
|
4198
|
+
}, $ = () => {
|
|
4199
|
+
v(!1), C.trim() !== "" && C !== r && d ? d(C.trim()) : y(r);
|
|
4201
4200
|
}, _ = (M) => {
|
|
4202
|
-
M.key === "Enter" ?
|
|
4201
|
+
M.key === "Enter" ? p.current?.blur() : M.key === "Escape" && (y(r), v(!1));
|
|
4203
4202
|
};
|
|
4204
4203
|
return /* @__PURE__ */ i(
|
|
4205
4204
|
"div",
|
|
@@ -4213,16 +4212,16 @@ const bn = ({
|
|
|
4213
4212
|
children: [
|
|
4214
4213
|
/* @__PURE__ */ i("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
4215
4214
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ i("div", { className: "flex items-start gap-2 text-text", children: [
|
|
4216
|
-
N && /* @__PURE__ */ e(ee, { variant: "secondary", onClick: N, leftIcon: /* @__PURE__ */ e(J, { icon:
|
|
4215
|
+
N && /* @__PURE__ */ e(ee, { variant: "secondary", onClick: N, leftIcon: /* @__PURE__ */ e(J, { icon: Ee, size: "sm" }), iconOnly: !0 }),
|
|
4217
4216
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
4218
|
-
|
|
4217
|
+
f ? /* @__PURE__ */ e(
|
|
4219
4218
|
"input",
|
|
4220
4219
|
{
|
|
4221
|
-
ref:
|
|
4220
|
+
ref: p,
|
|
4222
4221
|
type: "text",
|
|
4223
4222
|
value: C,
|
|
4224
|
-
onChange: (M) =>
|
|
4225
|
-
onBlur:
|
|
4223
|
+
onChange: (M) => y(M.target.value),
|
|
4224
|
+
onBlur: $,
|
|
4226
4225
|
onKeyDown: _,
|
|
4227
4226
|
className: "text-1xl font-semibold bg-transparent border-b-1 border-border rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 w-full"
|
|
4228
4227
|
}
|
|
@@ -4230,7 +4229,7 @@ const bn = ({
|
|
|
4230
4229
|
/* @__PURE__ */ e(
|
|
4231
4230
|
"h2",
|
|
4232
4231
|
{
|
|
4233
|
-
onClick:
|
|
4232
|
+
onClick: D,
|
|
4234
4233
|
className: u(
|
|
4235
4234
|
"text-2xl font-semibold truncate",
|
|
4236
4235
|
x && "cursor-pointer"
|
|
@@ -4244,7 +4243,7 @@ const bn = ({
|
|
|
4244
4243
|
ct,
|
|
4245
4244
|
{
|
|
4246
4245
|
size: 15,
|
|
4247
|
-
onClick:
|
|
4246
|
+
onClick: D,
|
|
4248
4247
|
className: "shrink-0 cursor-pointer text-text-muted opacity-0 group-hover:opacity-100 transition-opacity"
|
|
4249
4248
|
}
|
|
4250
4249
|
)
|
|
@@ -4254,7 +4253,7 @@ const bn = ({
|
|
|
4254
4253
|
] }) }),
|
|
4255
4254
|
a.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: a.map(
|
|
4256
4255
|
(M) => M.render ? /* @__PURE__ */ e(le.Fragment, { children: M.render() }, M.id) : M.splitOptions && M.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
4257
|
-
|
|
4256
|
+
Pe,
|
|
4258
4257
|
{
|
|
4259
4258
|
label: M.label,
|
|
4260
4259
|
onClick: M.onClick,
|
|
@@ -4290,11 +4289,11 @@ const bn = ({
|
|
|
4290
4289
|
className: s,
|
|
4291
4290
|
children: a
|
|
4292
4291
|
}) => /* @__PURE__ */ i("div", { className: u("flex items-center gap-2 mb-3", s), children: [
|
|
4293
|
-
r && /* @__PURE__ */ e(ee, { variant: "ghost", size: "sm", onClick: r, leftIcon: /* @__PURE__ */ e(
|
|
4292
|
+
r && /* @__PURE__ */ e(ee, { variant: "ghost", size: "sm", onClick: r, leftIcon: /* @__PURE__ */ e(Ee, { size: 14 }), children: n }),
|
|
4294
4293
|
a && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: a }),
|
|
4295
4294
|
t.length > 0 && /* @__PURE__ */ e("div", { className: u("flex flex-wrap gap-2", !a && "ml-auto"), children: t.map(
|
|
4296
4295
|
(l) => l.splitOptions && l.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
4297
|
-
|
|
4296
|
+
Pe,
|
|
4298
4297
|
{
|
|
4299
4298
|
label: l.label,
|
|
4300
4299
|
onClick: l.onClick,
|
|
@@ -4419,14 +4418,14 @@ const wn = ({
|
|
|
4419
4418
|
}
|
|
4420
4419
|
}, l = (x) => x ? "Ja" : "Nee", c = (x, d) => {
|
|
4421
4420
|
if (!d) return String(x || "-");
|
|
4422
|
-
const
|
|
4423
|
-
return
|
|
4424
|
-
},
|
|
4421
|
+
const f = d.find((v) => v.value === x);
|
|
4422
|
+
return f ? f.label : String(x || "-");
|
|
4423
|
+
}, h = ce(
|
|
4425
4424
|
(x) => {
|
|
4426
4425
|
const d = zr(r, x.name);
|
|
4427
4426
|
if (x.type === "array") {
|
|
4428
|
-
const
|
|
4429
|
-
return !
|
|
4427
|
+
const v = d;
|
|
4428
|
+
return !v || v.length === 0 ? /* @__PURE__ */ e(
|
|
4430
4429
|
oe,
|
|
4431
4430
|
{
|
|
4432
4431
|
variant: "body",
|
|
@@ -4434,7 +4433,7 @@ const wn = ({
|
|
|
4434
4433
|
className: "text-text-muted",
|
|
4435
4434
|
children: "Geen items"
|
|
4436
4435
|
}
|
|
4437
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
4436
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: v.map((C, y) => /* @__PURE__ */ i(
|
|
4438
4437
|
"div",
|
|
4439
4438
|
{
|
|
4440
4439
|
className: "p-4 border border-border rounded-xl space-y-3",
|
|
@@ -4449,51 +4448,51 @@ const wn = ({
|
|
|
4449
4448
|
children: [
|
|
4450
4449
|
x.label,
|
|
4451
4450
|
" ",
|
|
4452
|
-
|
|
4451
|
+
y + 1
|
|
4453
4452
|
]
|
|
4454
4453
|
}
|
|
4455
4454
|
) }),
|
|
4456
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: x.arrayFields?.map((
|
|
4457
|
-
const
|
|
4458
|
-
let
|
|
4459
|
-
switch (
|
|
4455
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: x.arrayFields?.map((p) => {
|
|
4456
|
+
const D = C?.[p.name];
|
|
4457
|
+
let $ = "-";
|
|
4458
|
+
switch (p.type) {
|
|
4460
4459
|
case "text":
|
|
4461
4460
|
case "email":
|
|
4462
4461
|
case "number":
|
|
4463
4462
|
case "tel":
|
|
4464
4463
|
case "url":
|
|
4465
4464
|
case "textarea":
|
|
4466
|
-
|
|
4465
|
+
$ = D || "-";
|
|
4467
4466
|
break;
|
|
4468
4467
|
case "select":
|
|
4469
4468
|
case "radio":
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4469
|
+
$ = c(
|
|
4470
|
+
D,
|
|
4471
|
+
p.options
|
|
4473
4472
|
);
|
|
4474
4473
|
break;
|
|
4475
4474
|
case "checkbox":
|
|
4476
|
-
|
|
4475
|
+
$ = l(D);
|
|
4477
4476
|
break;
|
|
4478
4477
|
case "date":
|
|
4479
|
-
|
|
4478
|
+
$ = a(D);
|
|
4480
4479
|
break;
|
|
4481
4480
|
case "custom":
|
|
4482
|
-
|
|
4483
|
-
value:
|
|
4481
|
+
$ = p.customComponent?.({
|
|
4482
|
+
value: D
|
|
4484
4483
|
});
|
|
4485
4484
|
break;
|
|
4486
4485
|
default:
|
|
4487
|
-
|
|
4486
|
+
$ = String(D || "-");
|
|
4488
4487
|
}
|
|
4489
|
-
return
|
|
4488
|
+
return p.format && ($ = p.format(D, C)), /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
4490
4489
|
/* @__PURE__ */ e(
|
|
4491
4490
|
oe,
|
|
4492
4491
|
{
|
|
4493
4492
|
variant: "label",
|
|
4494
4493
|
size: "xs",
|
|
4495
4494
|
className: "text-text-muted",
|
|
4496
|
-
children:
|
|
4495
|
+
children: p.label
|
|
4497
4496
|
}
|
|
4498
4497
|
),
|
|
4499
4498
|
/* @__PURE__ */ e(
|
|
@@ -4502,31 +4501,31 @@ const wn = ({
|
|
|
4502
4501
|
variant: "body",
|
|
4503
4502
|
size: "sm",
|
|
4504
4503
|
className: "text-text",
|
|
4505
|
-
children:
|
|
4504
|
+
children: $
|
|
4506
4505
|
}
|
|
4507
4506
|
)
|
|
4508
|
-
] },
|
|
4507
|
+
] }, p.name);
|
|
4509
4508
|
}) })
|
|
4510
4509
|
]
|
|
4511
4510
|
},
|
|
4512
|
-
|
|
4511
|
+
y
|
|
4513
4512
|
)) });
|
|
4514
4513
|
}
|
|
4515
4514
|
if (x.type === "custom" && x.customComponent)
|
|
4516
4515
|
return x.customComponent({ value: d });
|
|
4517
4516
|
if (x.format) {
|
|
4518
|
-
const
|
|
4517
|
+
const v = x.format(d, r);
|
|
4519
4518
|
return /* @__PURE__ */ e(
|
|
4520
4519
|
oe,
|
|
4521
4520
|
{
|
|
4522
4521
|
variant: "body",
|
|
4523
4522
|
size: "sm",
|
|
4524
4523
|
className: "text-text",
|
|
4525
|
-
children:
|
|
4524
|
+
children: v
|
|
4526
4525
|
}
|
|
4527
4526
|
);
|
|
4528
4527
|
}
|
|
4529
|
-
let
|
|
4528
|
+
let f = "-";
|
|
4530
4529
|
switch (x.type) {
|
|
4531
4530
|
case "text":
|
|
4532
4531
|
case "email":
|
|
@@ -4534,23 +4533,23 @@ const wn = ({
|
|
|
4534
4533
|
case "number":
|
|
4535
4534
|
case "tel":
|
|
4536
4535
|
case "url":
|
|
4537
|
-
|
|
4536
|
+
f = d ? String(d) : "-";
|
|
4538
4537
|
break;
|
|
4539
4538
|
case "textarea":
|
|
4540
|
-
|
|
4539
|
+
f = d ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(d || "-") }) : "-";
|
|
4541
4540
|
break;
|
|
4542
4541
|
case "select":
|
|
4543
4542
|
case "radio":
|
|
4544
|
-
|
|
4543
|
+
f = c(d, x.options);
|
|
4545
4544
|
break;
|
|
4546
4545
|
case "checkbox":
|
|
4547
|
-
|
|
4546
|
+
f = l(d);
|
|
4548
4547
|
break;
|
|
4549
4548
|
case "date":
|
|
4550
|
-
|
|
4549
|
+
f = a(d);
|
|
4551
4550
|
break;
|
|
4552
4551
|
default:
|
|
4553
|
-
|
|
4552
|
+
f = d ? String(d) : "-";
|
|
4554
4553
|
}
|
|
4555
4554
|
return /* @__PURE__ */ e(
|
|
4556
4555
|
oe,
|
|
@@ -4558,18 +4557,18 @@ const wn = ({
|
|
|
4558
4557
|
variant: "body",
|
|
4559
4558
|
size: "sm",
|
|
4560
4559
|
className: "text-text",
|
|
4561
|
-
children:
|
|
4560
|
+
children: f
|
|
4562
4561
|
}
|
|
4563
4562
|
);
|
|
4564
4563
|
},
|
|
4565
4564
|
[r]
|
|
4566
|
-
),
|
|
4565
|
+
), g = ce(
|
|
4567
4566
|
(x) => {
|
|
4568
4567
|
if (x.conditional && !x.conditional(r))
|
|
4569
4568
|
return null;
|
|
4570
|
-
const d = x.items.filter((
|
|
4569
|
+
const d = x.items.filter((v) => !(v.hidden || v.conditional && !v.conditional(r)));
|
|
4571
4570
|
if (d.length === 0) return null;
|
|
4572
|
-
const
|
|
4571
|
+
const f = u(
|
|
4573
4572
|
"space-y-4",
|
|
4574
4573
|
{
|
|
4575
4574
|
"grid gap-4": x.layout === "grid",
|
|
@@ -4609,35 +4608,35 @@ const wn = ({
|
|
|
4609
4608
|
}
|
|
4610
4609
|
)
|
|
4611
4610
|
] }),
|
|
4612
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className:
|
|
4611
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: f, children: d.map((v) => /* @__PURE__ */ i(
|
|
4613
4612
|
"div",
|
|
4614
4613
|
{
|
|
4615
4614
|
className: "space-y-1",
|
|
4616
4615
|
style: {
|
|
4617
|
-
width: typeof
|
|
4618
|
-
gridColumn: typeof
|
|
4616
|
+
width: typeof v.width == "string" ? v.width : void 0,
|
|
4617
|
+
gridColumn: typeof v.width == "number" ? `span ${v.width} / span ${v.width}` : void 0
|
|
4619
4618
|
},
|
|
4620
4619
|
children: [
|
|
4621
|
-
|
|
4620
|
+
v.type !== "custom" && /* @__PURE__ */ e(
|
|
4622
4621
|
oe,
|
|
4623
4622
|
{
|
|
4624
4623
|
variant: "label",
|
|
4625
4624
|
size: "sm",
|
|
4626
4625
|
className: "font-medium text-text-muted",
|
|
4627
|
-
children:
|
|
4626
|
+
children: v.label
|
|
4628
4627
|
}
|
|
4629
4628
|
),
|
|
4630
|
-
|
|
4629
|
+
h(v)
|
|
4631
4630
|
]
|
|
4632
4631
|
},
|
|
4633
|
-
|
|
4632
|
+
v.name
|
|
4634
4633
|
)) }) })
|
|
4635
4634
|
]
|
|
4636
4635
|
},
|
|
4637
4636
|
x.id
|
|
4638
4637
|
);
|
|
4639
4638
|
},
|
|
4640
|
-
[r,
|
|
4639
|
+
[r, h]
|
|
4641
4640
|
), N = u(
|
|
4642
4641
|
"space-y-6",
|
|
4643
4642
|
{
|
|
@@ -4648,7 +4647,7 @@ const wn = ({
|
|
|
4648
4647
|
},
|
|
4649
4648
|
s
|
|
4650
4649
|
);
|
|
4651
|
-
return /* @__PURE__ */ e("div", { className: N, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(
|
|
4650
|
+
return /* @__PURE__ */ e("div", { className: N, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(g) }) });
|
|
4652
4651
|
}, Re = ({ item: t, isSelectedHandler: r, onClick: n, depth: s = 0 }) => {
|
|
4653
4652
|
const a = !!(t.children && t.children.length > 0), l = r ? r(t.path) : !1;
|
|
4654
4653
|
return a ? /* @__PURE__ */ i("li", { children: [
|
|
@@ -4664,7 +4663,7 @@ const wn = ({
|
|
|
4664
4663
|
]
|
|
4665
4664
|
}
|
|
4666
4665
|
),
|
|
4667
|
-
/* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.children?.map((c,
|
|
4666
|
+
/* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.children?.map((c, h) => /* @__PURE__ */ e(
|
|
4668
4667
|
Re,
|
|
4669
4668
|
{
|
|
4670
4669
|
item: c,
|
|
@@ -4672,7 +4671,7 @@ const wn = ({
|
|
|
4672
4671
|
onClick: n,
|
|
4673
4672
|
depth: s + 1
|
|
4674
4673
|
},
|
|
4675
|
-
|
|
4674
|
+
h
|
|
4676
4675
|
)) })
|
|
4677
4676
|
] }) : /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
4678
4677
|
"div",
|
|
@@ -4715,7 +4714,7 @@ const wn = ({
|
|
|
4715
4714
|
}) => /* @__PURE__ */ i("nav", { className: "flex h-full shrink-0 flex-col p-3 pt-4", children: [
|
|
4716
4715
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-2 pb-3", children: [
|
|
4717
4716
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-lg font-semibold text-text", children: t }),
|
|
4718
|
-
r && r.length > 0 && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: r.map((c,
|
|
4717
|
+
r && r.length > 0 && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: r.map((c, h) => /* @__PURE__ */ e(
|
|
4719
4718
|
"span",
|
|
4720
4719
|
{
|
|
4721
4720
|
className: u(
|
|
@@ -4725,19 +4724,19 @@ const wn = ({
|
|
|
4725
4724
|
),
|
|
4726
4725
|
children: c
|
|
4727
4726
|
},
|
|
4728
|
-
|
|
4727
|
+
h
|
|
4729
4728
|
)) })
|
|
4730
4729
|
] }),
|
|
4731
4730
|
l && /* @__PURE__ */ e("div", { className: "px-1 pb-3", children: l }),
|
|
4732
4731
|
/* @__PURE__ */ e("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto", children: n.map(
|
|
4733
|
-
(c,
|
|
4732
|
+
(c, h) => !c.path && !c.label && !c.children ? /* @__PURE__ */ e("li", { "aria-hidden": !0, className: "h-4" }, h) : /* @__PURE__ */ e(
|
|
4734
4733
|
Re,
|
|
4735
4734
|
{
|
|
4736
4735
|
item: c,
|
|
4737
4736
|
isSelectedHandler: s,
|
|
4738
4737
|
onClick: a
|
|
4739
4738
|
},
|
|
4740
|
-
|
|
4739
|
+
h
|
|
4741
4740
|
)
|
|
4742
4741
|
) })
|
|
4743
4742
|
] }), Er = {
|
|
@@ -4777,8 +4776,8 @@ const wn = ({
|
|
|
4777
4776
|
align: a = "left",
|
|
4778
4777
|
truncate: l = !1,
|
|
4779
4778
|
className: c,
|
|
4780
|
-
children:
|
|
4781
|
-
...
|
|
4779
|
+
children: h,
|
|
4780
|
+
...g
|
|
4782
4781
|
}) => {
|
|
4783
4782
|
const N = `h${t}`, x = u(
|
|
4784
4783
|
"font-sans text-pretty",
|
|
@@ -4789,7 +4788,7 @@ const wn = ({
|
|
|
4789
4788
|
l && "truncate",
|
|
4790
4789
|
c
|
|
4791
4790
|
);
|
|
4792
|
-
return /* @__PURE__ */ e(N, { className: x, ...
|
|
4791
|
+
return /* @__PURE__ */ e(N, { className: x, ...g, children: h });
|
|
4793
4792
|
};
|
|
4794
4793
|
function Tr(t) {
|
|
4795
4794
|
return {
|
|
@@ -4809,44 +4808,44 @@ const Sn = ({
|
|
|
4809
4808
|
initialCommandPath: a,
|
|
4810
4809
|
initialActiveIndex: l
|
|
4811
4810
|
}) => {
|
|
4812
|
-
const [c,
|
|
4813
|
-
(
|
|
4811
|
+
const [c, h] = R(""), [g, N] = R(a || []), [x, d] = R(l || 0), f = se(null), v = se(null), y = (g.length ? t.find((p) => p.id === g[0])?.subCommands || [] : t).filter(
|
|
4812
|
+
(p) => p.label.toLowerCase().includes(c.toLowerCase())
|
|
4814
4813
|
);
|
|
4815
4814
|
return Y(() => {
|
|
4816
|
-
r || (
|
|
4815
|
+
r || (h(""), N(a || []), d(l || 0));
|
|
4817
4816
|
}, [r]), Y(() => {
|
|
4818
|
-
const
|
|
4817
|
+
const p = (D) => {
|
|
4819
4818
|
if (r) {
|
|
4820
|
-
if (
|
|
4819
|
+
if (D.key === "Escape")
|
|
4821
4820
|
n();
|
|
4822
|
-
else if (
|
|
4821
|
+
else if (D.key === "ArrowUp")
|
|
4823
4822
|
d(
|
|
4824
|
-
(
|
|
4823
|
+
($) => $ > 0 ? $ - 1 : y.length - 1
|
|
4825
4824
|
);
|
|
4826
|
-
else if (
|
|
4825
|
+
else if (D.key === "ArrowDown")
|
|
4827
4826
|
d(
|
|
4828
|
-
(
|
|
4827
|
+
($) => $ < y.length - 1 ? $ + 1 : 0
|
|
4829
4828
|
);
|
|
4830
|
-
else if (
|
|
4831
|
-
const
|
|
4832
|
-
|
|
4829
|
+
else if (D.key === "Enter") {
|
|
4830
|
+
const $ = y[x];
|
|
4831
|
+
$ && ($.subCommands ? (N([...g, $.id]), d(0)) : $.action && ($.action(), n()));
|
|
4833
4832
|
}
|
|
4834
4833
|
}
|
|
4835
4834
|
};
|
|
4836
|
-
return document.addEventListener("keydown",
|
|
4837
|
-
}, [r, n,
|
|
4838
|
-
const
|
|
4839
|
-
|
|
4835
|
+
return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
|
|
4836
|
+
}, [r, n, y, x, g]), Y(() => {
|
|
4837
|
+
const p = (D) => {
|
|
4838
|
+
f.current && !f.current.contains(D.target) && n();
|
|
4840
4839
|
};
|
|
4841
|
-
return r && document.addEventListener("mousedown",
|
|
4840
|
+
return r && document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
4842
4841
|
}, [r, n]), Y(() => {
|
|
4843
4842
|
if (!r) return;
|
|
4844
|
-
|
|
4843
|
+
v.current?.querySelector(`[data-index="${x}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4845
4844
|
}, [x, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ i(
|
|
4846
4845
|
"div",
|
|
4847
4846
|
{
|
|
4848
4847
|
className: "flex flex-col w-full max-w-lg max-h-dialog p-2 mx-auto rounded-lg border border-border shadow-modal bg-surface",
|
|
4849
|
-
ref:
|
|
4848
|
+
ref: f,
|
|
4850
4849
|
children: [
|
|
4851
4850
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4852
4851
|
/* @__PURE__ */ e(Ne, { className: "w-4 h-4 text-text-muted shrink-0" }),
|
|
@@ -4857,7 +4856,7 @@ const Sn = ({
|
|
|
4857
4856
|
autoFocus: !0,
|
|
4858
4857
|
placeholder: s?.searchPlaceholder || "Search commands...",
|
|
4859
4858
|
value: c,
|
|
4860
|
-
onChange: (
|
|
4859
|
+
onChange: (p) => h(p.target.value),
|
|
4861
4860
|
className: "w-full border-0 bg-transparent py-2 text-text focus:outline-none"
|
|
4862
4861
|
}
|
|
4863
4862
|
)
|
|
@@ -4865,26 +4864,26 @@ const Sn = ({
|
|
|
4865
4864
|
/* @__PURE__ */ i(
|
|
4866
4865
|
"div",
|
|
4867
4866
|
{
|
|
4868
|
-
ref:
|
|
4867
|
+
ref: v,
|
|
4869
4868
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
4870
4869
|
children: [
|
|
4871
|
-
|
|
4872
|
-
|
|
4870
|
+
y.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
4871
|
+
y.map((p, D) => /* @__PURE__ */ i(
|
|
4873
4872
|
"div",
|
|
4874
4873
|
{
|
|
4875
|
-
"data-index":
|
|
4876
|
-
className: `flex items-center p-2 cursor-pointer rounded-md ${
|
|
4874
|
+
"data-index": D,
|
|
4875
|
+
className: `flex items-center p-2 cursor-pointer rounded-md ${D === x ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
4877
4876
|
onClick: () => {
|
|
4878
|
-
|
|
4877
|
+
p.subCommands ? (N([...g, p.id]), d(0)) : p.action && (p.action(), n());
|
|
4879
4878
|
},
|
|
4880
|
-
onMouseEnter: () => d(
|
|
4879
|
+
onMouseEnter: () => d(D),
|
|
4881
4880
|
children: [
|
|
4882
|
-
|
|
4883
|
-
/* @__PURE__ */ e("span", { className: "flex-grow", children:
|
|
4884
|
-
|
|
4881
|
+
p.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: p.icon }),
|
|
4882
|
+
/* @__PURE__ */ e("span", { className: "flex-grow", children: p.label }),
|
|
4883
|
+
p.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(ye, { className: "w-4 h-4" }) })
|
|
4885
4884
|
]
|
|
4886
4885
|
},
|
|
4887
|
-
|
|
4886
|
+
p.id
|
|
4888
4887
|
))
|
|
4889
4888
|
]
|
|
4890
4889
|
}
|
|
@@ -4938,14 +4937,14 @@ const Sn = ({
|
|
|
4938
4937
|
backdrop: "bg-page",
|
|
4939
4938
|
editor: "bg-surface",
|
|
4940
4939
|
input: "bg-surface-input"
|
|
4941
|
-
},
|
|
4940
|
+
}, jr = {
|
|
4942
4941
|
none: "rounded-none",
|
|
4943
4942
|
sm: "rounded-sm",
|
|
4944
4943
|
md: "rounded-md",
|
|
4945
4944
|
lg: "rounded-lg",
|
|
4946
4945
|
xl: "rounded-xl",
|
|
4947
4946
|
full: "rounded-full"
|
|
4948
|
-
},
|
|
4947
|
+
}, Pr = {
|
|
4949
4948
|
none: "shadow-none",
|
|
4950
4949
|
sm: "shadow-none",
|
|
4951
4950
|
md: "shadow-overlay",
|
|
@@ -4976,8 +4975,8 @@ const Sn = ({
|
|
|
4976
4975
|
shadow: a,
|
|
4977
4976
|
border: l,
|
|
4978
4977
|
borderColor: c,
|
|
4979
|
-
className:
|
|
4980
|
-
children:
|
|
4978
|
+
className: h,
|
|
4979
|
+
children: g,
|
|
4981
4980
|
...N
|
|
4982
4981
|
}, x) => /* @__PURE__ */ e(
|
|
4983
4982
|
"div",
|
|
@@ -4987,14 +4986,14 @@ const Sn = ({
|
|
|
4987
4986
|
t && Ar[t],
|
|
4988
4987
|
r && Lr[r],
|
|
4989
4988
|
n && Ir[n],
|
|
4990
|
-
s &&
|
|
4991
|
-
a &&
|
|
4989
|
+
s && jr[s],
|
|
4990
|
+
a && Pr[a],
|
|
4992
4991
|
l && Or[l],
|
|
4993
4992
|
c && Br[c],
|
|
4994
|
-
|
|
4993
|
+
h
|
|
4995
4994
|
),
|
|
4996
4995
|
...N,
|
|
4997
|
-
children:
|
|
4996
|
+
children: g
|
|
4998
4997
|
}
|
|
4999
4998
|
)
|
|
5000
4999
|
);
|
|
@@ -5022,43 +5021,43 @@ function En({
|
|
|
5022
5021
|
componentProps: a,
|
|
5023
5022
|
className: l
|
|
5024
5023
|
}) {
|
|
5025
|
-
const c = se(null), [
|
|
5024
|
+
const c = se(null), [h, g] = R(!0), [N, x] = R(null), d = se(null);
|
|
5026
5025
|
return se(null), Y(() => {
|
|
5027
|
-
let
|
|
5026
|
+
let f = !0;
|
|
5028
5027
|
return (async () => {
|
|
5029
|
-
|
|
5028
|
+
g(!0);
|
|
5030
5029
|
try {
|
|
5031
5030
|
const C = await r();
|
|
5032
|
-
if (!
|
|
5033
|
-
const
|
|
5034
|
-
x(n === "react" ? () =>
|
|
5031
|
+
if (!f) return;
|
|
5032
|
+
const y = C.component || C.default || C;
|
|
5033
|
+
x(n === "react" ? () => y : () => C);
|
|
5035
5034
|
} catch (C) {
|
|
5036
5035
|
console.error(`[FederatedResource] Load failed: ${t}`, C);
|
|
5037
5036
|
} finally {
|
|
5038
|
-
|
|
5037
|
+
f && g(!1);
|
|
5039
5038
|
}
|
|
5040
5039
|
})(), () => {
|
|
5041
|
-
|
|
5040
|
+
f = !1;
|
|
5042
5041
|
};
|
|
5043
5042
|
}, [t, r]), Y(() => {
|
|
5044
|
-
if (
|
|
5045
|
-
const
|
|
5046
|
-
if (
|
|
5043
|
+
if (h || !N || n === "react") return;
|
|
5044
|
+
const f = c.current;
|
|
5045
|
+
if (f) {
|
|
5047
5046
|
if (n === "svelte") {
|
|
5048
|
-
const
|
|
5047
|
+
const v = N.default || N, C = new v({ target: f, props: a || {} });
|
|
5049
5048
|
return d.current = C, () => C.$destroy();
|
|
5050
5049
|
}
|
|
5051
5050
|
if (N.mount) {
|
|
5052
|
-
const
|
|
5051
|
+
const v = N.mount({ container: f, props: a || {} });
|
|
5053
5052
|
return () => {
|
|
5054
|
-
typeof
|
|
5053
|
+
typeof v == "function" ? v() : N.unmount?.(f);
|
|
5055
5054
|
};
|
|
5056
5055
|
}
|
|
5057
5056
|
}
|
|
5058
|
-
}, [N, n,
|
|
5057
|
+
}, [N, n, h]), Y(() => {
|
|
5059
5058
|
n === "svelte" && d.current && d.current.$set?.(a);
|
|
5060
5059
|
}, [a, n]), /* @__PURE__ */ i("div", { ref: c, className: l, style: { display: "contents" }, children: [
|
|
5061
|
-
|
|
5060
|
+
h && s,
|
|
5062
5061
|
n === "react" && N && /* @__PURE__ */ e(N, { ...a })
|
|
5063
5062
|
] });
|
|
5064
5063
|
}
|
|
@@ -5104,7 +5103,7 @@ export {
|
|
|
5104
5103
|
Sn as CommandPalette,
|
|
5105
5104
|
en as ConfirmDialog,
|
|
5106
5105
|
Rt as ContentLoading,
|
|
5107
|
-
|
|
5106
|
+
Se as DatePicker,
|
|
5108
5107
|
Vt as Dropdown,
|
|
5109
5108
|
rn as EmptyState,
|
|
5110
5109
|
Mn as ErrorBoundary,
|
|
@@ -5136,7 +5135,7 @@ export {
|
|
|
5136
5135
|
kn as SidebarMenu,
|
|
5137
5136
|
Nn as SourceChip,
|
|
5138
5137
|
an as Spinner,
|
|
5139
|
-
|
|
5138
|
+
Pe as SplitButton,
|
|
5140
5139
|
ln as StatusDot,
|
|
5141
5140
|
on as StepIndicator,
|
|
5142
5141
|
ar as StorageInput,
|
|
@@ -5145,7 +5144,7 @@ export {
|
|
|
5145
5144
|
Te as Table,
|
|
5146
5145
|
Xt as Tabs,
|
|
5147
5146
|
oe as Text,
|
|
5148
|
-
|
|
5147
|
+
ze as TextArea,
|
|
5149
5148
|
he as TextField,
|
|
5150
5149
|
_r as VideoSurface,
|
|
5151
5150
|
wn as View,
|